Merge remote-tracking branch 'scrawl/master'

celladd
Marc Zinnschlag 10 years ago
commit 455684981c

@ -78,7 +78,7 @@ CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager,
if (landIndex != -1)
{
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,
Terrain::Align_XY));

@ -653,7 +653,7 @@ namespace MWGui
if (selected != -1)
lastId = model.getItem(selected).mBase.getCellRef().getRefId();
ItemModel::ModelIndex cycled = selected;
for (int i=0; i<model.getItemCount(); ++i)
for (unsigned int i=0; i<model.getItemCount(); ++i)
{
cycled += incr;
cycled = (cycled + model.getItemCount()) % model.getItemCount();

@ -407,8 +407,6 @@ namespace MWWorld
if (mState==State_Preloaded)
mIds.clear();
std::cout << "loading cell " << mCell->getDescription() << std::endl;
loadRefs (store, esm);
mState = State_Loaded;

@ -219,6 +219,8 @@ namespace MWWorld
if(result.second)
{
std::cout << "loading cell " << cell->getCell()->getDescription() << std::endl;
float verts = ESM::Land::LAND_SIZE;
float worldsize = ESM::Land::REAL_SIZE;
@ -490,8 +492,6 @@ namespace MWWorld
loadingListener->setProgressRange(refsToLoad);
// Load cell.
std::cout << "cellName: " << cell->getCell()->mName << std::endl;
loadCell (cell, loadingListener);
changePlayerCell(cell, position, true);

@ -555,6 +555,9 @@ namespace MWWorld
if (left.first == right.first)
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;
}
};

@ -1206,6 +1206,10 @@ namespace MWWorld
}
}
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())

@ -383,7 +383,7 @@ namespace ESMTerrain
int cellY = std::floor(worldPos.y / 8192.f);
ESM::Land* land = getLand(cellX, cellY);
if (!land)
if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT))
return -2048;
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
@ -465,8 +465,9 @@ namespace ESMTerrain
Terrain::LayerInfo Storage::getLayerInfo(const std::string& texture)
{
// Already have this cached?
if (mLayerInfoMap.find(texture) != mLayerInfoMap.end())
return mLayerInfoMap[texture];
std::map<std::string, Terrain::LayerInfo>::iterator found = mLayerInfoMap.find(texture);
if (found != mLayerInfoMap.end())
return found->second;
Terrain::LayerInfo info;
info.mParallax = false;

Loading…
Cancel
Save