mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 21:19:40 +00:00
Load default terrain if there is none defined
This commit is contained in:
parent
e07be2d912
commit
62fe47b144
1 changed files with 7 additions and 3 deletions
|
@ -14,6 +14,8 @@
|
||||||
namespace ESMTerrain
|
namespace ESMTerrain
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const float defaultHeight = -2048;
|
||||||
|
|
||||||
Storage::Storage(const VFS::Manager *vfs)
|
Storage::Storage(const VFS::Manager *vfs)
|
||||||
: mVFS(vfs)
|
: mVFS(vfs)
|
||||||
{
|
{
|
||||||
|
@ -62,7 +64,9 @@ namespace ESMTerrain
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
min = defaultHeight;
|
||||||
|
max = defaultHeight;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Storage::fixNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row)
|
void Storage::fixNormal (osg::Vec3f& normal, int cellX, int cellY, int col, int row)
|
||||||
|
@ -203,7 +207,7 @@ namespace ESMTerrain
|
||||||
assert (vertX < numVerts);
|
assert (vertX < numVerts);
|
||||||
assert (vertY < numVerts);
|
assert (vertY < numVerts);
|
||||||
|
|
||||||
float height = -2048;
|
float height = defaultHeight;
|
||||||
if (heightData)
|
if (heightData)
|
||||||
height = heightData->mHeights[col*ESM::Land::LAND_SIZE + row];
|
height = heightData->mHeights[col*ESM::Land::LAND_SIZE + row];
|
||||||
|
|
||||||
|
@ -412,7 +416,7 @@ namespace ESMTerrain
|
||||||
|
|
||||||
const ESM::Land* land = getLand(cellX, cellY);
|
const ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT))
|
if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT))
|
||||||
return -2048;
|
return defaultHeight;
|
||||||
|
|
||||||
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue