mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 10:06:40 +00:00
made return type of ESMTerrain::Storage::getLand const
This commit is contained in:
parent
69045d7ec9
commit
febf611c82
6 changed files with 10 additions and 10 deletions
|
@ -9,7 +9,7 @@ namespace CSVRender
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ESM::Land* TerrainStorage::getLand(int cellX, int cellY)
|
const ESM::Land* TerrainStorage::getLand(int cellX, int cellY)
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << "#" << cellX << " " << cellY;
|
stream << "#" << cellX << " " << cellY;
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace CSVRender
|
||||||
private:
|
private:
|
||||||
const CSMWorld::Data& mData;
|
const CSMWorld::Data& mData;
|
||||||
|
|
||||||
virtual ESM::Land* getLand (int cellX, int cellY);
|
virtual const ESM::Land* getLand (int cellX, int cellY);
|
||||||
virtual const ESM::LandTexture* getLandTexture(int index, short plugin);
|
virtual const ESM::LandTexture* getLandTexture(int index, short plugin);
|
||||||
|
|
||||||
virtual void getBounds(float& minX, float& maxX, float& minY, float& maxY);
|
virtual void getBounds(float& minX, float& maxX, float& minY, float& maxY);
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace MWRender
|
||||||
maxY += 1;
|
maxY += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESM::Land* TerrainStorage::getLand(int cellX, int cellY)
|
const ESM::Land* TerrainStorage::getLand(int cellX, int cellY)
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &esmStore =
|
const MWWorld::ESMStore &esmStore =
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace MWRender
|
||||||
class TerrainStorage : public ESMTerrain::Storage
|
class TerrainStorage : public ESMTerrain::Storage
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
virtual ESM::Land* getLand (int cellX, int cellY);
|
virtual const ESM::Land* getLand (int cellX, int cellY);
|
||||||
virtual const ESM::LandTexture* getLandTexture(int index, short plugin);
|
virtual const ESM::LandTexture* getLandTexture(int index, short plugin);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ namespace ESMTerrain
|
||||||
--cellX;
|
--cellX;
|
||||||
row += ESM::Land::LAND_SIZE-1;
|
row += ESM::Land::LAND_SIZE-1;
|
||||||
}
|
}
|
||||||
ESM::Land* land = getLand(cellX, cellY);
|
const ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (land && land->mDataTypes&ESM::Land::DATA_VNML)
|
if (land && land->mDataTypes&ESM::Land::DATA_VNML)
|
||||||
{
|
{
|
||||||
normal.x() = land->mLandData->mNormals[col*ESM::Land::LAND_SIZE*3+row*3];
|
normal.x() = land->mLandData->mNormals[col*ESM::Land::LAND_SIZE*3+row*3];
|
||||||
|
@ -109,7 +109,7 @@ namespace ESMTerrain
|
||||||
++cellX;
|
++cellX;
|
||||||
row = 0;
|
row = 0;
|
||||||
}
|
}
|
||||||
ESM::Land* land = getLand(cellX, cellY);
|
const ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (land && land->mDataTypes&ESM::Land::DATA_VCLR)
|
if (land && land->mDataTypes&ESM::Land::DATA_VCLR)
|
||||||
{
|
{
|
||||||
color.r() = land->mLandData->mColours[col*ESM::Land::LAND_SIZE*3+row*3] / 255.f;
|
color.r() = land->mLandData->mColours[col*ESM::Land::LAND_SIZE*3+row*3] / 255.f;
|
||||||
|
@ -158,7 +158,7 @@ namespace ESMTerrain
|
||||||
float vertX_ = 0; // of current cell corner
|
float vertX_ = 0; // of current cell corner
|
||||||
for (int cellX = startX; cellX < startX + std::ceil(size); ++cellX)
|
for (int cellX = startX; cellX < startX + std::ceil(size); ++cellX)
|
||||||
{
|
{
|
||||||
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))
|
||||||
land = NULL;
|
land = NULL;
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ namespace ESMTerrain
|
||||||
assert(x<ESM::Land::LAND_TEXTURE_SIZE);
|
assert(x<ESM::Land::LAND_TEXTURE_SIZE);
|
||||||
assert(y<ESM::Land::LAND_TEXTURE_SIZE);
|
assert(y<ESM::Land::LAND_TEXTURE_SIZE);
|
||||||
|
|
||||||
ESM::Land* land = getLand(cellX, cellY);
|
const ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (land && (land->mDataTypes&ESM::Land::DATA_VTEX))
|
if (land && (land->mDataTypes&ESM::Land::DATA_VTEX))
|
||||||
{
|
{
|
||||||
int tex = land->mLandData->mTextures[y * ESM::Land::LAND_TEXTURE_SIZE + x];
|
int tex = land->mLandData->mTextures[y * ESM::Land::LAND_TEXTURE_SIZE + x];
|
||||||
|
@ -368,7 +368,7 @@ namespace ESMTerrain
|
||||||
int cellX = static_cast<int>(std::floor(worldPos.x() / 8192.f));
|
int cellX = static_cast<int>(std::floor(worldPos.x() / 8192.f));
|
||||||
int cellY = static_cast<int>(std::floor(worldPos.y() / 8192.f));
|
int cellY = static_cast<int>(std::floor(worldPos.y() / 8192.f));
|
||||||
|
|
||||||
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 -2048;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace ESMTerrain
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Not implemented in this class, because we need different Store implementations for game and editor
|
// Not implemented in this class, because we need different Store implementations for game and editor
|
||||||
virtual ESM::Land* getLand (int cellX, int cellY) = 0;
|
virtual const ESM::Land* getLand (int cellX, int cellY) = 0;
|
||||||
virtual const ESM::LandTexture* getLandTexture(int index, short plugin) = 0;
|
virtual const ESM::LandTexture* getLandTexture(int index, short plugin) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue