|
|
@ -15,6 +15,7 @@ namespace ESM
|
|
|
|
, mX(0)
|
|
|
|
, mX(0)
|
|
|
|
, mY(0)
|
|
|
|
, mY(0)
|
|
|
|
, mPlugin(0)
|
|
|
|
, mPlugin(0)
|
|
|
|
|
|
|
|
, mNoFile(false)
|
|
|
|
, mDataTypes(0)
|
|
|
|
, mDataTypes(0)
|
|
|
|
, mLandData(NULL)
|
|
|
|
, mLandData(NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -175,6 +176,47 @@ namespace ESM
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Land::blank()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (mLandData)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
delete mLandData;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mPlugin = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < LAND_GLOBAL_MAP_LOD_SIZE; ++i)
|
|
|
|
|
|
|
|
mWnam[0] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mLandData = new LandData;
|
|
|
|
|
|
|
|
mLandData->mHeightOffset = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < LAND_NUM_VERTS; ++i)
|
|
|
|
|
|
|
|
mLandData->mHeights[i] = 0;
|
|
|
|
|
|
|
|
mLandData->mMinHeight = 0;
|
|
|
|
|
|
|
|
mLandData->mMaxHeight = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < LAND_NUM_VERTS; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mLandData->mNormals[i*3+0] = 0;
|
|
|
|
|
|
|
|
mLandData->mNormals[i*3+1] = -1;
|
|
|
|
|
|
|
|
mLandData->mNormals[i*3+2] = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < LAND_NUM_TEXTURES; ++i)
|
|
|
|
|
|
|
|
mLandData->mTextures[i] = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < LAND_NUM_VERTS; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mLandData->mColours[i*3+0] = -1;
|
|
|
|
|
|
|
|
mLandData->mColours[i*3+1] = -1;
|
|
|
|
|
|
|
|
mLandData->mColours[i*3+2] = -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mLandData->mUnk1 = 0;
|
|
|
|
|
|
|
|
mLandData->mUnk2 = 0;
|
|
|
|
|
|
|
|
mLandData->mDataLoaded = Land::DATA_VNML | Land::DATA_VHGT | Land::DATA_WNAM |
|
|
|
|
|
|
|
|
Land::DATA_VCLR | Land::DATA_VTEX;
|
|
|
|
|
|
|
|
mDataTypes = mLandData->mDataLoaded;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mNoFile = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Land::loadData(int flags, LandData* target) const
|
|
|
|
void Land::loadData(int flags, LandData* target) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Create storage if nothing is loaded
|
|
|
|
// Create storage if nothing is loaded
|
|
|
@ -193,6 +235,13 @@ namespace ESM
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Copy data to target if no file
|
|
|
|
|
|
|
|
if (mNoFile)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
*target = *mLandData;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ESM::ESMReader reader;
|
|
|
|
ESM::ESMReader reader;
|
|
|
|
reader.restoreContext(mContext);
|
|
|
|
reader.restoreContext(mContext);
|
|
|
|
|
|
|
|
|
|
|
@ -271,7 +320,7 @@ namespace ESM
|
|
|
|
|
|
|
|
|
|
|
|
Land::Land (const Land& land)
|
|
|
|
Land::Land (const Land& land)
|
|
|
|
: mFlags (land.mFlags), mX (land.mX), mY (land.mY), mPlugin (land.mPlugin),
|
|
|
|
: mFlags (land.mFlags), mX (land.mX), mY (land.mY), mPlugin (land.mPlugin),
|
|
|
|
mContext (land.mContext), mDataTypes (land.mDataTypes),
|
|
|
|
mContext (land.mContext), mNoFile(land.mNoFile), mDataTypes (land.mDataTypes),
|
|
|
|
mLandData (land.mLandData ? new LandData (*land.mLandData) : 0)
|
|
|
|
mLandData (land.mLandData ? new LandData (*land.mLandData) : 0)
|
|
|
|
{}
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
@ -288,6 +337,7 @@ namespace ESM
|
|
|
|
std::swap (mY, land.mY);
|
|
|
|
std::swap (mY, land.mY);
|
|
|
|
std::swap (mPlugin, land.mPlugin);
|
|
|
|
std::swap (mPlugin, land.mPlugin);
|
|
|
|
std::swap (mContext, land.mContext);
|
|
|
|
std::swap (mContext, land.mContext);
|
|
|
|
|
|
|
|
std::swap (mNoFile, land.mNoFile);
|
|
|
|
std::swap (mDataTypes, land.mDataTypes);
|
|
|
|
std::swap (mDataTypes, land.mDataTypes);
|
|
|
|
std::swap (mLandData, land.mLandData);
|
|
|
|
std::swap (mLandData, land.mLandData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|