1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-19 09:11:33 +00:00

applying new interface vol.8, inconsistent

This commit is contained in:
greye 2012-11-06 11:53:00 +04:00
parent a9c1ce412a
commit 932a9dc6f9
5 changed files with 43 additions and 26 deletions

View file

@ -228,7 +228,8 @@ void Debugging::togglePathgrid()
void Debugging::enableCellPathgrid(MWWorld::Ptr::CellStore *store) void Debugging::enableCellPathgrid(MWWorld::Ptr::CellStore *store)
{ {
ESM::Pathgrid *pathgrid = MWBase::Environment::get().getWorld()->getStore().pathgrids.search(*store->mCell); const ESM::Pathgrid *pathgrid =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*store->mCell);
if (!pathgrid) return; if (!pathgrid) return;
Vector3 cellPathGridPos(0, 0, 0); Vector3 cellPathGridPos(0, 0, 0);

View file

@ -28,18 +28,21 @@ namespace MWRender
{ {
Ogre::TexturePtr tex; Ogre::TexturePtr tex;
const MWWorld::ESMStore &esmStore =
MWBase::Environment::get().getWorld()->getStore();
// get the size of the world // get the size of the world
const MWWorld::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells; MWWorld::Store<ESM::Cell>::iterator it = esmStore.get<ESM::Cell>().extBegin();
for (MWWorld::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it) for (; it != esmStore.get<ESM::Cell>().end(); ++it)
{ {
if (it->first.first < mMinX) if (it->getGridX() < mMinX)
mMinX = it->first.first; mMinX = it->getGridX();
if (it->first.first > mMaxX) if (it->getGridX() > mMaxX)
mMaxX = it->first.first; mMaxX = it->getGridX();
if (it->first.second < mMinY) if (it->getGridY() < mMinY)
mMinY = it->first.second; mMinY = it->getGridY();
if (it->first.second > mMaxY) if (it->getGridY() > mMaxY)
mMaxY = it->first.second; mMaxY = it->getGridY();
} }
int cellSize = 24; int cellSize = 24;
@ -58,7 +61,7 @@ namespace MWRender
{ {
for (int y = mMinY; y <= mMaxY; ++y) for (int y = mMinY; y <= mMaxY; ++y)
{ {
ESM::Land* land = MWBase::Environment::get().getWorld ()->getStore ().lands.search (x,y); ESM::Land* land = esmStore.get<ESM::Land>().search (x,y);
if (land) if (land)
{ {

View file

@ -62,13 +62,14 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
mPartPriorities[init] = 0; mPartPriorities[init] = 0;
} }
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store =
const ESM::Race *race = store.races.find(ref->mBase->mRace); MWBase::Environment::get().getWorld()->getStore();
const ESM::Race *race = store.get<ESM::Race>().find(ref->mBase->mRace);
std::string hairID = ref->mBase->mHair; std::string hairID = ref->mBase->mHair;
std::string headID = ref->mBase->mHead; std::string headID = ref->mBase->mHead;
headModel = "meshes\\" + store.bodyParts.find(headID)->mModel; headModel = "meshes\\" + store.get<ESM::BodyPart>().find(headID)->mModel;
hairModel = "meshes\\" + store.bodyParts.find(hairID)->mModel; hairModel = "meshes\\" + store.get<ESM::BodyPart>().find(hairID)->mModel;
npcName = ref->mBase->mName; npcName = ref->mBase->mName;
isFemale = !!(ref->mBase->mFlags&ESM::NPC::Female); isFemale = !!(ref->mBase->mFlags&ESM::NPC::Female);
@ -331,7 +332,7 @@ void NpcAnimation::updateParts()
bool tryfemale = isFemale; bool tryfemale = isFemale;
int ni = 0; int ni = 0;
do { do {
part = store.bodyParts.search(bodyRaceID+(tryfemale?"_f_":"_m_")+PartTypeList[i].name[ni]); part = store.get<ESM::BodyPart>().search(bodyRaceID+(tryfemale?"_f_":"_m_")+PartTypeList[i].name[ni]);
if(part) break; if(part) break;
ni ^= 1; ni ^= 1;
@ -569,11 +570,14 @@ void NpcAnimation::addPartGroup(int group, int priority, std::vector<ESM::PartRe
{ {
ESM::PartReference &part = parts[i]; ESM::PartReference &part = parts[i];
const MWWorld::Store<ESM::BodyPart> &parts =
MWBase::Environment::get().getWorld()->getStore().get<ESM::BodyPart>();
const ESM::BodyPart *bodypart = 0; const ESM::BodyPart *bodypart = 0;
if(isFemale) if(isFemale)
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mFemale); bodypart = parts.search(part.mFemale);
if(!bodypart) if(!bodypart)
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mMale); bodypart = parts.search(part.mMale);
if(bodypart) if(bodypart)
addOrReplaceIndividualPart(part.mPart, group, priority,"meshes\\" + bodypart->mModel); addOrReplaceIndividualPart(part.mPart, group, priority,"meshes\\" + bodypart->mModel);

View file

@ -373,10 +373,14 @@ void RenderingManager::update (float duration)
} }
} }
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){ void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store)
if(store->mCell->mData.mFlags & store->mCell->HasWater {
const MWWorld::Store<ESM::Land> &lands =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>();
if(store->mCell->mData.mFlags & ESM::Cell::HasWater
|| ((store->mCell->isExterior()) || ((store->mCell->isExterior())
&& !MWBase::Environment::get().getWorld()->getStore().lands.search(store->mCell->getGridX(),store->mCell->getGridY()) )) // always use water, if the cell does not have land. && !lands.search(store->mCell->getGridX(),store->mCell->getGridY()) )) // always use water, if the cell does not have land.
{ {
if(mWater == 0) if(mWater == 0)
mWater = new MWRender::Water(mRendering.getCamera(), this, store->mCell); mWater = new MWRender::Water(mRendering.getCamera(), this, store->mCell);

View file

@ -95,7 +95,8 @@ namespace MWRender
const int cellX = store->mCell->getGridX(); const int cellX = store->mCell->getGridX();
const int cellY = store->mCell->getGridY(); const int cellY = store->mCell->getGridY();
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY); ESM::Land* land =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>().search(cellX, cellY);
if (land == NULL) // no land data means we're not going to create any terrain. if (land == NULL) // no land data means we're not going to create any terrain.
return; return;
@ -245,7 +246,10 @@ namespace MWRender
{ {
//NB: All vtex ids are +1 compared to the ltex ids //NB: All vtex ids are +1 compared to the ltex ids
assert( (int)MWBase::Environment::get().getWorld()->getStore().landTexts.getSize() >= (int)ltexIndex - 1 && const MWWorld::Store<ESM::LandTexture> &ltexStore =
MWBase::Environment::get().getWorld()->getStore().get<ESM::LandTexture>();
assert( (int)ltexStore.getSize() >= (int)ltexIndex - 1 &&
"LAND.VTEX must be within the bounds of the LTEX array"); "LAND.VTEX must be within the bounds of the LTEX array");
std::string texture; std::string texture;
@ -255,7 +259,7 @@ namespace MWRender
} }
else else
{ {
texture = MWBase::Environment::get().getWorld()->getStore().landTexts.search(ltexIndex-1)->mTexture; texture = ltexStore.search(ltexIndex-1)->mTexture;
//TODO this is needed due to MWs messed up texture handling //TODO this is needed due to MWs messed up texture handling
texture = texture.substr(0, texture.rfind(".")) + ".dds"; texture = texture.substr(0, texture.rfind(".")) + ".dds";
} }
@ -411,7 +415,8 @@ namespace MWRender
} }
ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY); ESM::Land* land =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Land>().search(cellX, cellY);
if ( land != NULL ) if ( land != NULL )
{ {
if (!land->isDataLoaded(ESM::Land::DATA_VTEX)) if (!land->isDataLoaded(ESM::Land::DATA_VTEX))