mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
applying new interface vol.8, inconsistent
This commit is contained in:
parent
a9c1ce412a
commit
932a9dc6f9
5 changed files with 43 additions and 26 deletions
|
@ -228,7 +228,8 @@ void Debugging::togglePathgrid()
|
|||
|
||||
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;
|
||||
|
||||
Vector3 cellPathGridPos(0, 0, 0);
|
||||
|
|
|
@ -28,18 +28,21 @@ namespace MWRender
|
|||
{
|
||||
Ogre::TexturePtr tex;
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
// get the size of the world
|
||||
const MWWorld::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells;
|
||||
for (MWWorld::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it)
|
||||
MWWorld::Store<ESM::Cell>::iterator it = esmStore.get<ESM::Cell>().extBegin();
|
||||
for (; it != esmStore.get<ESM::Cell>().end(); ++it)
|
||||
{
|
||||
if (it->first.first < mMinX)
|
||||
mMinX = it->first.first;
|
||||
if (it->first.first > mMaxX)
|
||||
mMaxX = it->first.first;
|
||||
if (it->first.second < mMinY)
|
||||
mMinY = it->first.second;
|
||||
if (it->first.second > mMaxY)
|
||||
mMaxY = it->first.second;
|
||||
if (it->getGridX() < mMinX)
|
||||
mMinX = it->getGridX();
|
||||
if (it->getGridX() > mMaxX)
|
||||
mMaxX = it->getGridX();
|
||||
if (it->getGridY() < mMinY)
|
||||
mMinY = it->getGridY();
|
||||
if (it->getGridY() > mMaxY)
|
||||
mMaxY = it->getGridY();
|
||||
}
|
||||
|
||||
int cellSize = 24;
|
||||
|
@ -58,7 +61,7 @@ namespace MWRender
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -62,13 +62,14 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor
|
|||
mPartPriorities[init] = 0;
|
||||
}
|
||||
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
const ESM::Race *race = store.races.find(ref->mBase->mRace);
|
||||
const MWWorld::ESMStore &store =
|
||||
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 headID = ref->mBase->mHead;
|
||||
headModel = "meshes\\" + store.bodyParts.find(headID)->mModel;
|
||||
hairModel = "meshes\\" + store.bodyParts.find(hairID)->mModel;
|
||||
headModel = "meshes\\" + store.get<ESM::BodyPart>().find(headID)->mModel;
|
||||
hairModel = "meshes\\" + store.get<ESM::BodyPart>().find(hairID)->mModel;
|
||||
npcName = ref->mBase->mName;
|
||||
|
||||
isFemale = !!(ref->mBase->mFlags&ESM::NPC::Female);
|
||||
|
@ -331,7 +332,7 @@ void NpcAnimation::updateParts()
|
|||
bool tryfemale = isFemale;
|
||||
int ni = 0;
|
||||
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;
|
||||
|
||||
ni ^= 1;
|
||||
|
@ -569,11 +570,14 @@ void NpcAnimation::addPartGroup(int group, int priority, std::vector<ESM::PartRe
|
|||
{
|
||||
ESM::PartReference &part = parts[i];
|
||||
|
||||
const MWWorld::Store<ESM::BodyPart> &parts =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::BodyPart>();
|
||||
|
||||
const ESM::BodyPart *bodypart = 0;
|
||||
if(isFemale)
|
||||
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mFemale);
|
||||
bodypart = parts.search(part.mFemale);
|
||||
if(!bodypart)
|
||||
bodypart = MWBase::Environment::get().getWorld()->getStore().bodyParts.search(part.mMale);
|
||||
bodypart = parts.search(part.mMale);
|
||||
|
||||
if(bodypart)
|
||||
addOrReplaceIndividualPart(part.mPart, group, priority,"meshes\\" + bodypart->mModel);
|
||||
|
|
|
@ -373,10 +373,14 @@ void RenderingManager::update (float duration)
|
|||
}
|
||||
}
|
||||
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){
|
||||
if(store->mCell->mData.mFlags & store->mCell->HasWater
|
||||
void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store)
|
||||
{
|
||||
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())
|
||||
&& !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)
|
||||
mWater = new MWRender::Water(mRendering.getCamera(), this, store->mCell);
|
||||
|
|
|
@ -95,7 +95,8 @@ namespace MWRender
|
|||
const int cellX = store->mCell->getGridX();
|
||||
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.
|
||||
return;
|
||||
|
||||
|
@ -245,7 +246,10 @@ namespace MWRender
|
|||
{
|
||||
//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> <exStore =
|
||||
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");
|
||||
|
||||
std::string texture;
|
||||
|
@ -255,7 +259,7 @@ namespace MWRender
|
|||
}
|
||||
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
|
||||
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->isDataLoaded(ESM::Land::DATA_VTEX))
|
||||
|
|
Loading…
Reference in a new issue