mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-22 04:14:04 +00:00
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
455684981c
7 changed files with 15 additions and 9 deletions
|
@ -78,7 +78,7 @@ CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager,
|
||||||
if (landIndex != -1)
|
if (landIndex != -1)
|
||||||
{
|
{
|
||||||
const ESM::Land* esmLand = land.getRecord(mId).get().mLand.get();
|
const ESM::Land* esmLand = land.getRecord(mId).get().mLand.get();
|
||||||
if(esmLand)
|
if(esmLand && esmLand->mDataTypes&ESM::Land::DATA_VHGT)
|
||||||
{
|
{
|
||||||
mTerrain.reset(new Terrain::TerrainGrid(sceneManager, new TerrainStorage(mData), Element_Terrain, true,
|
mTerrain.reset(new Terrain::TerrainGrid(sceneManager, new TerrainStorage(mData), Element_Terrain, true,
|
||||||
Terrain::Align_XY));
|
Terrain::Align_XY));
|
||||||
|
|
|
@ -653,7 +653,7 @@ namespace MWGui
|
||||||
if (selected != -1)
|
if (selected != -1)
|
||||||
lastId = model.getItem(selected).mBase.getCellRef().getRefId();
|
lastId = model.getItem(selected).mBase.getCellRef().getRefId();
|
||||||
ItemModel::ModelIndex cycled = selected;
|
ItemModel::ModelIndex cycled = selected;
|
||||||
for (int i=0; i<model.getItemCount(); ++i)
|
for (unsigned int i=0; i<model.getItemCount(); ++i)
|
||||||
{
|
{
|
||||||
cycled += incr;
|
cycled += incr;
|
||||||
cycled = (cycled + model.getItemCount()) % model.getItemCount();
|
cycled = (cycled + model.getItemCount()) % model.getItemCount();
|
||||||
|
|
|
@ -407,8 +407,6 @@ namespace MWWorld
|
||||||
if (mState==State_Preloaded)
|
if (mState==State_Preloaded)
|
||||||
mIds.clear();
|
mIds.clear();
|
||||||
|
|
||||||
std::cout << "loading cell " << mCell->getDescription() << std::endl;
|
|
||||||
|
|
||||||
loadRefs (store, esm);
|
loadRefs (store, esm);
|
||||||
|
|
||||||
mState = State_Loaded;
|
mState = State_Loaded;
|
||||||
|
|
|
@ -219,6 +219,8 @@ namespace MWWorld
|
||||||
|
|
||||||
if(result.second)
|
if(result.second)
|
||||||
{
|
{
|
||||||
|
std::cout << "loading cell " << cell->getCell()->getDescription() << std::endl;
|
||||||
|
|
||||||
float verts = ESM::Land::LAND_SIZE;
|
float verts = ESM::Land::LAND_SIZE;
|
||||||
float worldsize = ESM::Land::REAL_SIZE;
|
float worldsize = ESM::Land::REAL_SIZE;
|
||||||
|
|
||||||
|
@ -490,8 +492,6 @@ namespace MWWorld
|
||||||
loadingListener->setProgressRange(refsToLoad);
|
loadingListener->setProgressRange(refsToLoad);
|
||||||
|
|
||||||
// Load cell.
|
// Load cell.
|
||||||
std::cout << "cellName: " << cell->getCell()->mName << std::endl;
|
|
||||||
|
|
||||||
loadCell (cell, loadingListener);
|
loadCell (cell, loadingListener);
|
||||||
|
|
||||||
changePlayerCell(cell, position, true);
|
changePlayerCell(cell, position, true);
|
||||||
|
|
|
@ -555,6 +555,9 @@ namespace MWWorld
|
||||||
if (left.first == right.first)
|
if (left.first == right.first)
|
||||||
return left.second > right.second;
|
return left.second > right.second;
|
||||||
|
|
||||||
|
// Exterior cells are listed in descending, row-major order,
|
||||||
|
// this is a workaround for an ambiguous chargen_plank reference in the vanilla game.
|
||||||
|
// there is one at -22,16 and one at -2,-9, the latter should be used.
|
||||||
return left.first > right.first;
|
return left.first > right.first;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1206,6 +1206,10 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ptr.getRefData().setCount(0);
|
ptr.getRefData().setCount(0);
|
||||||
|
// Deleted references can still be accessed by scripts,
|
||||||
|
// so we need this extra step to remove access to the old reference completely.
|
||||||
|
// This will no longer be necessary once we have a proper cell movement tracker.
|
||||||
|
ptr.getCellRef().unsetRefNum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (haveToMove && ptr.getRefData().getBaseNode())
|
if (haveToMove && ptr.getRefData().getBaseNode())
|
||||||
|
|
|
@ -383,7 +383,7 @@ namespace ESMTerrain
|
||||||
int cellY = std::floor(worldPos.y / 8192.f);
|
int cellY = std::floor(worldPos.y / 8192.f);
|
||||||
|
|
||||||
ESM::Land* land = getLand(cellX, cellY);
|
ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (!land)
|
if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT))
|
||||||
return -2048;
|
return -2048;
|
||||||
|
|
||||||
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
||||||
|
@ -465,8 +465,9 @@ namespace ESMTerrain
|
||||||
Terrain::LayerInfo Storage::getLayerInfo(const std::string& texture)
|
Terrain::LayerInfo Storage::getLayerInfo(const std::string& texture)
|
||||||
{
|
{
|
||||||
// Already have this cached?
|
// Already have this cached?
|
||||||
if (mLayerInfoMap.find(texture) != mLayerInfoMap.end())
|
std::map<std::string, Terrain::LayerInfo>::iterator found = mLayerInfoMap.find(texture);
|
||||||
return mLayerInfoMap[texture];
|
if (found != mLayerInfoMap.end())
|
||||||
|
return found->second;
|
||||||
|
|
||||||
Terrain::LayerInfo info;
|
Terrain::LayerInfo info;
|
||||||
info.mParallax = false;
|
info.mParallax = false;
|
||||||
|
|
Loading…
Reference in a new issue