diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 538f63dc9..07d27553d 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -53,6 +53,7 @@ add_openmw_dir (mwworld containerstore actiontalk actiontake manualref player cellfunctors cells localscripts customdata weather inventorystore ptr actionopen actionread actionequip timestamp actionalchemy cellstore actionapply actioneat + esmstore reclists ) add_openmw_dir (mwclass diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index d29e23c18..c1537e8ee 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -31,11 +31,6 @@ namespace ESM struct Spell; } -namespace ESMS -{ - struct ESMStore; -} - namespace MWRender { class ExternalRendering; @@ -48,6 +43,7 @@ namespace MWWorld class LocalScripts; class Ptr; class TimeStamp; + class ESMStore; } namespace MWBase @@ -104,7 +100,7 @@ namespace MWBase virtual MWWorld::Player& getPlayer() = 0; - virtual const ESMS::ESMStore& getStore() const = 0; + virtual const MWWorld::ESMStore& getStore() const = 0; virtual ESM::ESMReader& getEsmReader() = 0; diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index f944391e1..319c02e1e 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -205,7 +205,7 @@ namespace MWClass std::string text; - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); if (ref->ref.mTeleport) { diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp index edcfc7daa..06c0200ac 100644 --- a/apps/openmw/mwclass/misc.cpp +++ b/apps/openmw/mwclass/misc.cpp @@ -143,7 +143,7 @@ namespace MWClass MWGui::ToolTipInfo info; - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); int count = ptr.getRefData().getCount(); @@ -189,7 +189,7 @@ namespace MWClass { MWWorld::Ptr newPtr; - const ESMS::ESMStore &store = + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); if (MWWorld::Class::get(ptr).getName(ptr) == store.gameSettings.find("sGold")->getString()) { diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index fee0dfdf1..54705d91c 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -277,7 +277,7 @@ namespace MWClass info.caption = ref->base->mName + MWGui::ToolTips::getCountString(ptr.getRefData().getCount()); info.icon = ref->base->mIcon; - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); std::string text; diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index 62f7df679..8d2aefc86 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -7,8 +7,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/scriptmanager.hpp" @@ -19,6 +17,7 @@ #include "../mwworld/refdata.hpp" #include "../mwworld/player.hpp" #include "../mwworld/containerstore.hpp" +#include "../mwworld/esmstore.hpp" #include "../mwgui/dialogue.hpp" @@ -84,7 +83,7 @@ namespace template bool checkLocal (char comp, const std::string& name, T value, const MWWorld::Ptr& actor, - const ESMS::ESMStore& store) + const MWWorld::ESMStore& store) { std::string scriptName = MWWorld::Class::get (actor).getScript (actor); @@ -590,8 +589,8 @@ namespace MWDialogue mCompilerContext.setExtensions (&extensions); mDialogueMap.clear(); mActorKnownTopics.clear(); - ESMS::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; - for(ESMS::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) + MWWorld::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; + for(MWWorld::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) { mDialogueMap[toLower(it->first)] = it->second; } @@ -642,9 +641,9 @@ namespace MWDialogue //greeting bool greetingFound = false; - //ESMS::RecListT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; - ESMS::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; - for(ESMS::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) + //MWWorld::RecListT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; + MWWorld::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; + for(MWWorld::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) { ESM::Dialogue ndialogue = it->second; if(ndialogue.mType == ESM::Dialogue::Greeting) @@ -742,8 +741,8 @@ namespace MWDialogue mChoice = -1; mActorKnownTopics.clear(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); - ESMS::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; - for(ESMS::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) + MWWorld::RecListCaseT::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; + for(MWWorld::RecListCaseT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) { ESM::Dialogue ndialogue = it->second; if(ndialogue.mType == ESM::Dialogue::Topic) diff --git a/apps/openmw/mwdialogue/journalentry.cpp b/apps/openmw/mwdialogue/journalentry.cpp index 1c6addb6e..fb982d34f 100644 --- a/apps/openmw/mwdialogue/journalentry.cpp +++ b/apps/openmw/mwdialogue/journalentry.cpp @@ -3,11 +3,11 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" +#include "../mwworld/esmstore.hpp" + namespace MWDialogue { JournalEntry::JournalEntry() {} @@ -16,7 +16,7 @@ namespace MWDialogue : mTopic (topic), mInfoId (infoId) {} - std::string JournalEntry::getText (const ESMS::ESMStore& store) const + std::string JournalEntry::getText (const MWWorld::ESMStore& store) const { const ESM::Dialogue *dialogue = store.dialogs.find (mTopic); diff --git a/apps/openmw/mwdialogue/journalentry.hpp b/apps/openmw/mwdialogue/journalentry.hpp index 3e8640185..19a9f42b5 100644 --- a/apps/openmw/mwdialogue/journalentry.hpp +++ b/apps/openmw/mwdialogue/journalentry.hpp @@ -3,7 +3,7 @@ #include -namespace ESMS +namespace MWWorld { struct ESMStore; } @@ -20,7 +20,7 @@ namespace MWDialogue JournalEntry (const std::string& topic, const std::string& infoId); - std::string getText (const ESMS::ESMStore& store) const; + std::string getText (const MWWorld::ESMStore& store) const; static JournalEntry makeFromQuest (const std::string& topic, int index); diff --git a/apps/openmw/mwdialogue/journalimp.cpp b/apps/openmw/mwdialogue/journalimp.cpp index ac4b7a6de..2b2c60381 100644 --- a/apps/openmw/mwdialogue/journalimp.cpp +++ b/apps/openmw/mwdialogue/journalimp.cpp @@ -1,7 +1,7 @@ #include "journalimp.hpp" -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwdialogue/quest.cpp b/apps/openmw/mwdialogue/quest.cpp index b4f02e128..09feab8f9 100644 --- a/apps/openmw/mwdialogue/quest.cpp +++ b/apps/openmw/mwdialogue/quest.cpp @@ -1,7 +1,7 @@ #include "quest.hpp" -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwdialogue/topic.cpp b/apps/openmw/mwdialogue/topic.cpp index 8c1dfafb8..b6e7c07ae 100644 --- a/apps/openmw/mwdialogue/topic.cpp +++ b/apps/openmw/mwdialogue/topic.cpp @@ -1,7 +1,7 @@ #include "topic.hpp" -#include +#include "../mwworld/esmstore.hpp" namespace MWDialogue { diff --git a/apps/openmw/mwgui/birth.cpp b/apps/openmw/mwgui/birth.cpp index e7862c4e7..2ccf96bc4 100644 --- a/apps/openmw/mwgui/birth.cpp +++ b/apps/openmw/mwgui/birth.cpp @@ -3,7 +3,7 @@ #include #include -#include "components/esm_store/store.hpp" +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -130,10 +130,10 @@ void BirthDialog::updateBirths() { mBirthList->removeAllItems(); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); - ESMS::RecListT::MapType::const_iterator it = store.birthSigns.list.begin(); - ESMS::RecListT::MapType::const_iterator end = store.birthSigns.list.end(); + MWWorld::RecListT::MapType::const_iterator it = store.birthSigns.list.begin(); + MWWorld::RecListT::MapType::const_iterator end = store.birthSigns.list.end(); int index = 0; // sort by name @@ -170,7 +170,7 @@ void BirthDialog::updateSpells() const int lineHeight = 18; MyGUI::IntCoord coord(0, 0, mSpellArea->getWidth(), 18); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::BirthSign *birth = store.birthSigns.find(mCurrentBirthId); std::string texturePath = std::string("textures\\") + birth->mTexture; diff --git a/apps/openmw/mwgui/charactercreation.hpp b/apps/openmw/mwgui/charactercreation.hpp index 28ced2e70..9653aeede 100644 --- a/apps/openmw/mwgui/charactercreation.hpp +++ b/apps/openmw/mwgui/charactercreation.hpp @@ -1,7 +1,7 @@ #ifndef CHARACTER_CREATION_HPP #define CHARACTER_CREATION_HPP -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index f020010ec..40805c77e 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -185,10 +185,10 @@ void PickClassDialog::updateClasses() { mClassList->removeAllItems(); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); - ESMS::RecListT::MapType::const_iterator it = store.classes.list.begin(); - ESMS::RecListT::MapType::const_iterator end = store.classes.list.end(); + MWWorld::RecListT::MapType::const_iterator it = store.classes.list.begin(); + MWWorld::RecListT::MapType::const_iterator end = store.classes.list.end(); int index = 0; for (; it != end; ++it) { @@ -209,7 +209,7 @@ void PickClassDialog::updateStats() { if (mCurrentClassId.empty()) return; - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Class *klass = store.classes.search(mCurrentClassId); if (!klass) return; diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index b939284dd..589a7abac 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -4,11 +4,10 @@ #include #include -#include -#include - #include +#include "../mwworld/esmstore.hpp" + #include "../mwscript/extensions.hpp" #include "../mwbase/environment.hpp" @@ -93,9 +92,9 @@ namespace MWGui scanner.listKeywords (mNames); // identifier - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); - for (ESMS::RecListList::const_iterator iter (store.recLists.begin()); + for (MWWorld::RecListList::const_iterator iter (store.recLists.begin()); iter!=store.recLists.end(); ++iter) { iter->second->listIdentifier (mNames); diff --git a/apps/openmw/mwgui/container.hpp b/apps/openmw/mwgui/container.hpp index 27c3288ae..08d425032 100644 --- a/apps/openmw/mwgui/container.hpp +++ b/apps/openmw/mwgui/container.hpp @@ -1,7 +1,7 @@ #ifndef MGUI_CONTAINER_H #define MGUI_CONTAINER_H -#include +#include "../mwworld/esmstore.hpp" #include "window_base.hpp" #include "referenceinterface.hpp" diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 96b85b4c4..66444e18c 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/dialoguemanager.hpp" diff --git a/apps/openmw/mwgui/dialogue_history.cpp b/apps/openmw/mwgui/dialogue_history.cpp index 4ca764c82..13f72545e 100644 --- a/apps/openmw/mwgui/dialogue_history.cpp +++ b/apps/openmw/mwgui/dialogue_history.cpp @@ -3,7 +3,8 @@ #include "../mwbase/windowmanager.hpp" #include "widgets.hpp" -#include "components/esm_store/store.hpp" + +#include "../mwworld/esmstore.hpp" #include #include diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 7dced94f5..afb4bb621 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -8,14 +8,12 @@ #include "../mwworld/player.hpp" #include "../mwworld/class.hpp" +#include "../mwworld/esmstore.hpp" #include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/stat.hpp" -#include -#include - namespace MWGui { diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index d681bc69d..72feb84a4 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -224,10 +224,10 @@ void RaceDialog::updateRaces() { mRaceList->removeAllItems(); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); - ESMS::RecListT::MapType::const_iterator it = store.races.list.begin(); - ESMS::RecListT::MapType::const_iterator end = store.races.list.end(); + MWWorld::RecListT::MapType::const_iterator it = store.races.list.begin(); + MWWorld::RecListT::MapType::const_iterator end = store.races.list.end(); int index = 0; for (; it != end; ++it) { @@ -258,7 +258,7 @@ void RaceDialog::updateSkills() const int lineHeight = 18; MyGUI::IntCoord coord1(0, 0, mSkillList->getWidth(), 18); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Race *race = store.races.find(mCurrentRaceId); int count = sizeof(race->mData.mBonus)/sizeof(race->mData.mBonus[0]); // TODO: Find a portable macro for this ARRAYSIZE? for (int i = 0; i < count; ++i) @@ -296,7 +296,7 @@ void RaceDialog::updateSpellPowers() const int lineHeight = 18; MyGUI::IntCoord coord(0, 0, mSpellPowerList->getWidth(), 18); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Race *race = store.races.find(mCurrentRaceId); std::vector::const_iterator it = race->mPowers.mList.begin(); diff --git a/apps/openmw/mwgui/race.hpp b/apps/openmw/mwgui/race.hpp index c4734eae8..000b84523 100644 --- a/apps/openmw/mwgui/race.hpp +++ b/apps/openmw/mwgui/race.hpp @@ -4,7 +4,7 @@ #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwrender/characterpreview.hpp" diff --git a/apps/openmw/mwgui/review.cpp b/apps/openmw/mwgui/review.cpp index 984c7d1ae..961856b7c 100644 --- a/apps/openmw/mwgui/review.cpp +++ b/apps/openmw/mwgui/review.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -281,7 +281,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes continue; assert(skillId >= 0 && skillId < ESM::Skill::Length); - const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId]; + const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId]; const MWMechanics::Stat &stat = mSkillValues.find(skillId)->second; float base = stat.getBase(); float modified = stat.getModified(); diff --git a/apps/openmw/mwgui/spellwindow.cpp b/apps/openmw/mwgui/spellwindow.cpp index a203ac92b..c7f61a935 100644 --- a/apps/openmw/mwgui/spellwindow.cpp +++ b/apps/openmw/mwgui/spellwindow.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 665caaae1..ccba9cf74 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -54,7 +54,7 @@ StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager) { 0, 0 } }; - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); for (int i=0; names[i][0]; ++i) { setText (names[i][0], store.gameSettings.find (names[i][1])->getString()); @@ -357,7 +357,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId, if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes continue; assert(skillId >= 0 && skillId < ESM::Skill::Length); - const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId]; + const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId]; const MWMechanics::Stat &stat = mSkillValues.find(skillId)->second; float base = stat.getBase(); float modified = stat.getModified(); @@ -422,7 +422,7 @@ void StatsWindow::updateSkillArea() if (!mMiscSkills.empty()) addSkills(mMiscSkills, "sSkillClassMisc", "Misc Skills", coord1, coord2); - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); // race tooltip const ESM::Race* playerRace = store.races.find (MWBase::Environment::get().getWorld()->getPlayer().getRace()); diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp index 75f8c568b..5186b6328 100644 --- a/apps/openmw/mwgui/stats_window.hpp +++ b/apps/openmw/mwgui/stats_window.hpp @@ -1,7 +1,7 @@ #ifndef MWGUI_STATS_WINDOW_H #define MWGUI_STATS_WINDOW_H -#include +#include "../mwworld/esmstore.hpp" #include #include diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 35224613c..d47a0f547 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -365,7 +365,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info) text.erase(0, 1); const ESM::Enchantment* enchant = 0; - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); if (info.enchant != "") { enchant = store.enchants.search(info.enchant); @@ -571,7 +571,7 @@ void ToolTips::createSkillToolTip(MyGUI::Widget* widget, int skillId) if (skillId == -1) return; - const std::string &skillNameId = ESMS::Skill::sSkillNameIds[skillId]; + const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId]; const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(skillId); assert(skill); const ESM::Attribute* attr = MWBase::Environment::get().getWorld()->getStore().attributes.search(skill->mData.mAttribute); diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index ed09b9805..5050ba88a 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -2,12 +2,12 @@ #include -#include "components/esm_store/store.hpp" - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwworld/esmstore.hpp" + #undef min #undef max @@ -228,7 +228,7 @@ void MWSpell::setSpellId(const std::string &spellId) void MWSpell::createEffectWidgets(std::vector &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, int flags) { - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Spell *spell = store.spells.search(mId); MYGUI_ASSERT(spell, "spell with id '" << mId << "' not found"); @@ -259,7 +259,7 @@ void MWSpell::updateWidgets() { if (mSpellNameWidget && mWindowManager) { - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Spell *spell = store.spells.search(mId); if (spell) static_cast(mSpellNameWidget)->setCaption(spell->mName); @@ -386,7 +386,10 @@ void MWSpellEffect::setSpellEffect(const SpellEffectParams& params) void MWSpellEffect::updateWidgets() { - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + if (!mWindowManager) + return; + + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magicEffect = store.magicEffects.search(mEffectParams.mEffectID); assert(magicEffect); diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index a41e1f123..4ac5383f7 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -1,7 +1,7 @@ #ifndef MWGUI_WIDGETS_H #define MWGUI_WIDGETS_H -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwmechanics/activespells.cpp b/apps/openmw/mwmechanics/activespells.cpp index df5ea7c3f..7deab426d 100644 --- a/apps/openmw/mwmechanics/activespells.cpp +++ b/apps/openmw/mwmechanics/activespells.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index f3b6b1616..b5933a646 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -7,7 +7,7 @@ #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwworld/class.hpp" #include "../mwworld/inventorystore.hpp" @@ -101,7 +101,7 @@ namespace MWMechanics health.setCurrent (health.getCurrent() + 0.1 * endurance); stats.setHealth (health); - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); float fFatigueReturnBase = store.gameSettings.find("fFatigueReturnBase")->getFloat (); float fFatigueReturnMult = store.gameSettings.find("fFatigueReturnMult")->getFloat (); diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 1e57ba313..9a6a5c0f2 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -2,7 +2,7 @@ #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -41,7 +41,7 @@ namespace MWMechanics float normalised = max==0 ? 1 : std::max (0.0f, static_cast (current)/max); - const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); return store.gameSettings.find ("fFatigueBase")->getFloat() - store.gameSettings.find ("fFatigueMult")->getFloat() * (1-normalised); diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 873dd9498..81e3ae540 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1,7 +1,7 @@ #include "mechanicsmanagerimp.hpp" -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -132,7 +132,7 @@ namespace MWMechanics } } - typedef ESMS::IndexListT::MapType ContainerType; + typedef MWWorld::IndexListT::MapType ContainerType; const ContainerType& skills = MWBase::Environment::get().getWorld()->getStore().skills.list; for (ContainerType::const_iterator iter (skills.begin()); iter!=skills.end(); ++iter) diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index bbd42c147..e01f7cc1c 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwmechanics/spells.cpp b/apps/openmw/mwmechanics/spells.cpp index adfb35cd9..b883abaf0 100644 --- a/apps/openmw/mwmechanics/spells.cpp +++ b/apps/openmw/mwmechanics/spells.cpp @@ -1,7 +1,7 @@ #include "spells.hpp" -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwmechanics/spellsuccess.hpp b/apps/openmw/mwmechanics/spellsuccess.hpp index a46667cdc..9928966bb 100644 --- a/apps/openmw/mwmechanics/spellsuccess.hpp +++ b/apps/openmw/mwmechanics/spellsuccess.hpp @@ -8,7 +8,7 @@ #include "../mwworld/class.hpp" #include "../mwmechanics/creaturestats.hpp" -#include +#include "../mwworld/esmstore.hpp" #include "npcstats.hpp" diff --git a/apps/openmw/mwrender/debugging.cpp b/apps/openmw/mwrender/debugging.cpp index 4f7150754..d1f616283 100644 --- a/apps/openmw/mwrender/debugging.cpp +++ b/apps/openmw/mwrender/debugging.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index 7a799a2e4..e8ddecb3d 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -11,8 +11,7 @@ #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" -#include -#include +#include "../mwworld/esmstore.hpp" namespace MWRender { @@ -30,8 +29,8 @@ namespace MWRender Ogre::TexturePtr tex; // get the size of the world - const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells; - for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it) + 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) { if (it->first.first < mMinX) mMinX = it->first.first; diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 1bdbce6d9..82bd3ae01 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 5c2b05aca..8282751f4 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -62,7 +62,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWor mPartPriorities[init] = 0; } - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Race *race = store.races.find(ref->base->mRace); std::string hairID = ref->base->mHair; @@ -322,7 +322,7 @@ void NpcAnimation::updateParts() { ESM::PRT_Tail, { "tail", "" } } }; - const ESMS::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); for(size_t i = 0;i < sizeof(PartTypeList)/sizeof(PartTypeList[0]);i++) { if(mPartPriorities[PartTypeList[i].type] < 1) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 5b5fdce68..fa6bd3cc7 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include #include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone diff --git a/apps/openmw/mwrender/terrain.cpp b/apps/openmw/mwrender/terrain.cpp index 114a9bc37..d4a62a62a 100644 --- a/apps/openmw/mwrender/terrain.cpp +++ b/apps/openmw/mwrender/terrain.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwscript/cellextensions.cpp b/apps/openmw/mwscript/cellextensions.cpp index 57dd7962b..61c28f323 100644 --- a/apps/openmw/mwscript/cellextensions.cpp +++ b/apps/openmw/mwscript/cellextensions.cpp @@ -1,7 +1,7 @@ #include "cellextensions.hpp" -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwscript/compilercontext.cpp b/apps/openmw/mwscript/compilercontext.cpp index 139a5cc6c..8756fb633 100644 --- a/apps/openmw/mwscript/compilercontext.cpp +++ b/apps/openmw/mwscript/compilercontext.cpp @@ -1,7 +1,7 @@ #include "compilercontext.hpp" -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index 37cf34127..5cd769da7 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -3,8 +3,7 @@ #include -#include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/scriptmanager.hpp" @@ -13,12 +12,12 @@ namespace MWScript { - GlobalScripts::GlobalScripts (const ESMS::ESMStore& store) + GlobalScripts::GlobalScripts (const MWWorld::ESMStore& store) : mStore (store) { addScript ("Main"); - for (ESMS::RecListT::MapType::const_iterator iter + for (MWWorld::RecListT::MapType::const_iterator iter (store.startScripts.list.begin()); iter != store.startScripts.list.end(); ++iter) addScript (iter->second.mScript); diff --git a/apps/openmw/mwscript/globalscripts.hpp b/apps/openmw/mwscript/globalscripts.hpp index cc2f7ffdd..f9f9b7ae3 100644 --- a/apps/openmw/mwscript/globalscripts.hpp +++ b/apps/openmw/mwscript/globalscripts.hpp @@ -6,7 +6,7 @@ #include "locals.hpp" -namespace ESMS +namespace MWWorld { struct ESMStore; } @@ -15,12 +15,12 @@ namespace MWScript { class GlobalScripts { - const ESMS::ESMStore& mStore; + const MWWorld::ESMStore& mStore; std::map > mScripts; // running, local variables public: - GlobalScripts (const ESMS::ESMStore& store); + GlobalScripts (const MWWorld::ESMStore& store); void addScript (const std::string& name); diff --git a/apps/openmw/mwscript/guiextensions.cpp b/apps/openmw/mwscript/guiextensions.cpp index 66bb4e043..1eaac5d5f 100644 --- a/apps/openmw/mwscript/guiextensions.cpp +++ b/apps/openmw/mwscript/guiextensions.cpp @@ -9,8 +9,7 @@ #include #include -#include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" @@ -109,8 +108,8 @@ namespace MWScript // "Will match complete or partial cells, so ShowMap, "Vivec" will show cells Vivec and Vivec, Fred's House as well." // http://www.uesp.net/wiki/Tes3Mod:ShowMap - const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells; - for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it) + 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) { std::string name = it->second->mName; boost::algorithm::to_lower(name); @@ -126,8 +125,8 @@ namespace MWScript virtual void execute (Interpreter::Runtime& runtime) { - const ESMS::CellList::ExtCells& extCells = MWBase::Environment::get().getWorld ()->getStore ().cells.extCells; - for (ESMS::CellList::ExtCells::const_iterator it = extCells.begin(); it != extCells.end(); ++it) + 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) { std::string name = it->second->mName; if (name != "") diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 075ac5646..d5159eb7d 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwscript/scriptmanagerimp.cpp b/apps/openmw/mwscript/scriptmanagerimp.cpp index 883d3dfd3..1f4e80382 100644 --- a/apps/openmw/mwscript/scriptmanagerimp.cpp +++ b/apps/openmw/mwscript/scriptmanagerimp.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include #include @@ -17,7 +17,7 @@ namespace MWScript { - ScriptManager::ScriptManager (const ESMS::ESMStore& store, bool verbose, + ScriptManager::ScriptManager (const MWWorld::ESMStore& store, bool verbose, Compiler::Context& compilerContext) : mErrorHandler (std::cerr), mStore (store), mVerbose (verbose), mCompilerContext (compilerContext), mParser (mErrorHandler, mCompilerContext), @@ -125,7 +125,7 @@ namespace MWScript std::pair ScriptManager::compileAll() { - typedef ESMS::ScriptListT::MapType Container; + typedef MWWorld::ScriptListT::MapType Container; const Container& scripts = mStore.scripts.list; diff --git a/apps/openmw/mwscript/scriptmanagerimp.hpp b/apps/openmw/mwscript/scriptmanagerimp.hpp index a97310ae5..c4a016eb7 100644 --- a/apps/openmw/mwscript/scriptmanagerimp.hpp +++ b/apps/openmw/mwscript/scriptmanagerimp.hpp @@ -14,7 +14,7 @@ #include "globalscripts.hpp" -namespace ESMS +namespace MWWorld { struct ESMStore; } @@ -35,7 +35,7 @@ namespace MWScript class ScriptManager : public MWBase::ScriptManager { Compiler::StreamErrorHandler mErrorHandler; - const ESMS::ESMStore& mStore; + const MWWorld::ESMStore& mStore; bool mVerbose; Compiler::Context& mCompilerContext; Compiler::FileParser mParser; @@ -50,7 +50,7 @@ namespace MWScript public: - ScriptManager (const ESMS::ESMStore& store, bool verbose, + ScriptManager (const MWWorld::ESMStore& store, bool verbose, Compiler::Context& compilerContext); virtual void run (const std::string& name, Interpreter::Context& interpreterContext); diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index 0d69608e1..a4634eb21 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -7,7 +7,7 @@ #include -#include +#include "../mwworld/esmstore.hpp" #include diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 6e70f588e..a64651a97 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include #include diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 5d5ef3d1d..62814a38c 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwworld/actioneat.cpp b/apps/openmw/mwworld/actioneat.cpp index abd1ac4b9..63efff738 100644 --- a/apps/openmw/mwworld/actioneat.cpp +++ b/apps/openmw/mwworld/actioneat.cpp @@ -5,14 +5,13 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/npcstats.hpp" +#include "esmstore.hpp" #include "class.hpp" namespace MWWorld diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index 4ac613df7..4333183e3 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -4,15 +4,14 @@ #include "../mwbase/windowmanager.hpp" #include "../mwbase/world.hpp" -#include "../mwworld/player.hpp" -#include "../mwworld/class.hpp" - #include "../mwmechanics/npcstats.hpp" #include "../mwgui/bookwindow.hpp" #include "../mwgui/scrollwindow.hpp" -#include +#include "player.hpp" +#include "class.hpp" +#include "esmstore.hpp" namespace MWWorld { diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp index e5a38d4be..4a94a5797 100644 --- a/apps/openmw/mwworld/cells.cpp +++ b/apps/openmw/mwworld/cells.cpp @@ -1,11 +1,10 @@ #include "cells.hpp" -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "class.hpp" +#include "esmstore.hpp" #include "containerstore.hpp" MWWorld::Ptr::CellStore *MWWorld::Cells::getCellStore (const ESM::Cell *cell) @@ -85,7 +84,7 @@ MWWorld::Ptr MWWorld::Cells::getPtrAndCache (const std::string& name, Ptr::CellS return ptr; } -MWWorld::Cells::Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader) +MWWorld::Cells::Cells (const MWWorld::ESMStore& store, ESM::ESMReader& reader) : mStore (store), mReader (reader), mIdCache (20, std::pair ("", (Ptr::CellStore*)0)), /// \todo make cache size configurable mIdCacheIndex (0) @@ -265,7 +264,7 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name) } // Now try the other cells - for (ESMS::CellList::IntCells::const_iterator iter = mStore.cells.intCells.begin(); + for (MWWorld::CellList::IntCells::const_iterator iter = mStore.cells.intCells.begin(); iter!=mStore.cells.intCells.end(); ++iter) { Ptr::CellStore *cellStore = getCellStore (iter->second); @@ -276,7 +275,7 @@ MWWorld::Ptr MWWorld::Cells::getPtr (const std::string& name) return ptr; } - for (ESMS::CellList::ExtCells::const_iterator iter = mStore.cells.extCells.begin(); + for (MWWorld::CellList::ExtCells::const_iterator iter = mStore.cells.extCells.begin(); iter!=mStore.cells.extCells.end(); ++iter) { Ptr::CellStore *cellStore = getCellStore (iter->second); diff --git a/apps/openmw/mwworld/cells.hpp b/apps/openmw/mwworld/cells.hpp index 3e1383166..edaf70055 100644 --- a/apps/openmw/mwworld/cells.hpp +++ b/apps/openmw/mwworld/cells.hpp @@ -11,17 +11,14 @@ namespace ESM class ESMReader; } -namespace ESM +namespace MWWorld { class ESMStore; -} -namespace MWWorld -{ /// \brief Cell container class Cells { - const ESMS::ESMStore& mStore; + const MWWorld::ESMStore& mStore; ESM::ESMReader& mReader; std::map mInteriors; std::map, CellStore> mExteriors; @@ -39,7 +36,7 @@ namespace MWWorld public: - Cells (const ESMS::ESMStore& store, ESM::ESMReader& reader); + Cells (const MWWorld::ESMStore& store, ESM::ESMReader& reader); ///< \todo pass the dynamic part of the ESMStore isntead (once it is written) of the whole /// world diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index fcdec1e7f..4a84e33a7 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -2,12 +2,11 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "ptr.hpp" +#include "esmstore.hpp" namespace MWWorld { @@ -16,7 +15,7 @@ namespace MWWorld mWaterLevel = cell->mWater; } - void CellStore::load (const ESMS::ESMStore &store, ESM::ESMReader &esm) + void CellStore::load (const MWWorld::ESMStore &store, ESM::ESMReader &esm) { if (mState!=State_Loaded) { @@ -31,7 +30,7 @@ namespace MWWorld } } - void CellStore::preload (const ESMS::ESMStore &store, ESM::ESMReader &esm) + void CellStore::preload (const MWWorld::ESMStore &store, ESM::ESMReader &esm) { if (mState==State_Unloaded) { @@ -41,7 +40,7 @@ namespace MWWorld } } - void CellStore::listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm) + void CellStore::listRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm) { assert (cell); @@ -67,7 +66,7 @@ namespace MWWorld std::sort (mIds.begin(), mIds.end()); } - void CellStore::loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm) + void CellStore::loadRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm) { assert (cell); diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 32ab6e07b..ccdbcf280 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -8,14 +8,10 @@ #include "refdata.hpp" -namespace ESMS -{ - struct ESMStore; -} - namespace MWWorld { class Ptr; + class ESMStore; /// A reference to one object (of any type) in a cell. /// @@ -122,9 +118,9 @@ namespace MWWorld CellRefList statics; CellRefList weapons; - void load (const ESMS::ESMStore &store, ESM::ESMReader &esm); + void load (const MWWorld::ESMStore &store, ESM::ESMReader &esm); - void preload (const ESMS::ESMStore &store, ESM::ESMReader &esm); + void preload (const MWWorld::ESMStore &store, ESM::ESMReader &esm); /// Call functor (ref) for each reference. functor must return a bool. Returning /// false will abort the iteration. @@ -183,9 +179,9 @@ namespace MWWorld } /// Run through references and store IDs - void listRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm); + void listRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm); - void loadRefs(const ESMS::ESMStore &store, ESM::ESMReader &esm); + void loadRefs(const MWWorld::ESMStore &store, ESM::ESMReader &esm); }; } diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 5c4dd03a4..e3dd49380 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -145,7 +145,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::addImpl (const Ptr& ptr return it; } -void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const ESMS::ESMStore& store) +void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const MWWorld::ESMStore& store) { for (std::vector::const_iterator iter (items.mList.begin()); iter!=items.mList.end(); ++iter) diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp index ae27fad3d..1297fc53c 100644 --- a/apps/openmw/mwworld/containerstore.hpp +++ b/apps/openmw/mwworld/containerstore.hpp @@ -83,7 +83,7 @@ namespace MWWorld public: - void fill (const ESM::InventoryList& items, const ESMS::ESMStore& store); + void fill (const ESM::InventoryList& items, const MWWorld::ESMStore& store); ///< Insert items into *this. void clear(); diff --git a/components/esm_store/store.cpp b/apps/openmw/mwworld/esmstore.cpp similarity index 65% rename from components/esm_store/store.cpp rename to apps/openmw/mwworld/esmstore.cpp index d1fe9b10b..c145fb3da 100644 --- a/components/esm_store/store.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -1,31 +1,21 @@ +#include "esmstore.hpp" + #include #include -#include "store.hpp" - -using namespace std; -using namespace ESM; -using namespace ESMS; -/* -static string toStr(int i) +namespace MWWorld { - char name[5]; - *((int*)name) = i; - name[4] = 0; - return std::string(name); -} -*/ -void ESMStore::load(ESMReader &esm) +void ESMStore::load(ESM::ESMReader &esm) { - set missing; + std::set missing; ESM::Dialogue *dialogue = 0; // Loop through all records while(esm.hasMoreRecs()) { - NAME n = esm.getRecName(); + ESM::NAME n = esm.getRecName(); esm.getRecHeader(); // Look up the record type. @@ -71,7 +61,8 @@ void ESMStore::load(ESMReader &esm) if (n.val==ESM::REC_DIAL) { - RecListCaseT& recList = static_cast& > (*it->second); + RecListCaseT& recList = + static_cast& > (*it->second); ESM::Dialogue* d = recList.search (id); @@ -84,20 +75,22 @@ void ESMStore::load(ESMReader &esm) // Insert the reference into the global lookup if(!id.empty() && - (n.val==REC_ACTI || n.val==REC_ALCH || n.val==REC_APPA || n.val==REC_ARMO || - n.val==REC_BOOK || n.val==REC_CLOT || n.val==REC_CONT || n.val==REC_CREA || - n.val==REC_DOOR || n.val==REC_INGR || n.val==REC_LEVC || n.val==REC_LEVI || - n.val==REC_LIGH || n.val==REC_LOCK || n.val==REC_MISC || n.val==REC_NPC_ || - n.val==REC_PROB || n.val==REC_REPA || n.val==REC_STAT || n.val==REC_WEAP) + (n.val==ESM::REC_ACTI || n.val==ESM::REC_ALCH || n.val==ESM::REC_APPA || n.val==ESM::REC_ARMO || + n.val==ESM::REC_BOOK || n.val==ESM::REC_CLOT || n.val==ESM::REC_CONT || n.val==ESM::REC_CREA || + n.val==ESM::REC_DOOR || n.val==ESM::REC_INGR || n.val==ESM::REC_LEVC || n.val==ESM::REC_LEVI || + n.val==ESM::REC_LIGH || n.val==ESM::REC_LOCK || n.val==ESM::REC_MISC || n.val==ESM::REC_NPC_ || + n.val==ESM::REC_PROB || n.val==ESM::REC_REPA || n.val==ESM::REC_STAT || n.val==ESM::REC_WEAP) ) all[id] = n.val; } } - for (int i = 0; i < Attribute::Length; ++i) + for (int i = 0; i < ESM::Attribute::Length; ++i) { - Attribute::AttributeID id = Attribute::sAttributeIds[i]; - attributes.list.insert(std::make_pair(id, Attribute(id, Attribute::sGmstAttributeIds[i], Attribute::sGmstAttributeDescIds[i]))); + typedef ESM::Attribute EsmAttr; + + EsmAttr::AttributeID id = EsmAttr::sAttributeIds[i]; + attributes.list.insert(std::make_pair(id, ESM::Attribute(id, EsmAttr::sGmstAttributeIds[i], EsmAttr::sGmstAttributeDescIds[i]))); } /* This information isn't needed on screen. But keep the code around @@ -113,3 +106,5 @@ void ESMStore::load(ESMReader &esm) cout << endl; */ } + +} // end namespace diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp new file mode 100644 index 000000000..226b758dc --- /dev/null +++ b/apps/openmw/mwworld/esmstore.hpp @@ -0,0 +1,145 @@ +#ifndef OPENMW_MWWORLD_STORE_H +#define OPENMW_MWWORLD_STORE_H + +/* + The ESM storage module. + + This is separate from the ESM loader module, located in esm/. It is + also unaware of the cell loading and storage module. + + The advantage of this, as with all other modularizations, is that + you can replace the storage method later without touching the + loading code. Cutting down dependencies also help on the general + maintainability. + */ + +#include +#include "reclists.hpp" + +namespace MWWorld +{ + + struct ESMStore + { + /* Lists all the list types. Mostly used for quick lookup on + loading. The key is the record name (4 chars) parsed as a 32 + bit int. See esm/records.hpp for the complete list. + */ + RecListList recLists; + + // Each individual list + RecListT activators; + RecListWithIDT potions; + RecListT appas; + RecListT armors; + RecListT bodyParts; + RecListWithIDT books; + RecListT birthSigns; + RecListT classes; + RecListT clothes; + RecListT contChange; + RecListT containers; + RecListWithIDT creatures; + RecListT creaChange; + RecListCaseT dialogs; + RecListT doors; + RecListT enchants; + RecListT factions; + RecListT globals; + RecListWithIDT ingreds; + RecListT creatureLists; + RecListT itemLists; + RecListT lights; + RecListT lockpicks; + RecListT miscItems; + RecListWithIDT npcs; + RecListT npcChange; + RecListT probes; + RecListT races; + RecListT regions; + RecListT repairs; + RecListT soundGens; + RecListT sounds; + RecListT spells; + RecListT startScripts; + RecListT statics; + RecListT weapons; + + // Lists that need special rules + CellList cells; + RecListWithIDT gameSettings; + LandList lands; + LTexList landTexts; + ScriptListT scripts; + IndexListT magicEffects; + IndexListT skills; + //RecListT pathgrids; + PathgridList pathgrids; + + // Special entry which is hardcoded and not loaded from an ESM + IndexListT attributes; + + // Lookup of all IDs. Makes looking up references faster. Just + // maps the id name to the record type. + typedef std::map AllMap; + AllMap all; + + // Look up the given ID in 'all'. Returns 0 if not found. + int find(const std::string &id) const + { + AllMap::const_iterator it = all.find(id); + if(it == all.end()) return 0; + return it->second; + } + + ESMStore() + { + recLists[ESM::REC_ACTI] = &activators; + recLists[ESM::REC_ALCH] = &potions; + recLists[ESM::REC_APPA] = &appas; + recLists[ESM::REC_ARMO] = &armors; + recLists[ESM::REC_BODY] = &bodyParts; + recLists[ESM::REC_BOOK] = &books; + recLists[ESM::REC_BSGN] = &birthSigns; + recLists[ESM::REC_CELL] = &cells; + recLists[ESM::REC_CLAS] = &classes; + recLists[ESM::REC_CLOT] = &clothes; + recLists[ESM::REC_CNTC] = &contChange; + recLists[ESM::REC_CONT] = &containers; + recLists[ESM::REC_CREA] = &creatures; + recLists[ESM::REC_CREC] = &creaChange; + recLists[ESM::REC_DIAL] = &dialogs; + recLists[ESM::REC_DOOR] = &doors; + recLists[ESM::REC_ENCH] = &enchants; + recLists[ESM::REC_FACT] = &factions; + recLists[ESM::REC_GLOB] = &globals; + recLists[ESM::REC_GMST] = &gameSettings; + recLists[ESM::REC_INGR] = &ingreds; + recLists[ESM::REC_LAND] = &lands; + recLists[ESM::REC_LEVC] = &creatureLists; + recLists[ESM::REC_LEVI] = &itemLists; + recLists[ESM::REC_LIGH] = &lights; + recLists[ESM::REC_LOCK] = &lockpicks; + recLists[ESM::REC_LTEX] = &landTexts; + recLists[ESM::REC_MISC] = &miscItems; + recLists[ESM::REC_NPC_] = &npcs; + recLists[ESM::REC_NPCC] = &npcChange; + recLists[ESM::REC_PGRD] = &pathgrids; + recLists[ESM::REC_PROB] = &probes; + recLists[ESM::REC_RACE] = &races; + recLists[ESM::REC_REGN] = ®ions; + recLists[ESM::REC_REPA] = &repairs; + recLists[ESM::REC_SCPT] = &scripts; + recLists[ESM::REC_SNDG] = &soundGens; + recLists[ESM::REC_SOUN] = &sounds; + recLists[ESM::REC_SPEL] = &spells; + recLists[ESM::REC_SSCR] = &startScripts; + recLists[ESM::REC_STAT] = &statics; + recLists[ESM::REC_WEAP] = &weapons; + } + + void load(ESM::ESMReader &esm); + }; +} + +#endif diff --git a/apps/openmw/mwworld/globals.cpp b/apps/openmw/mwworld/globals.cpp index 1430219d9..f904dd2b1 100644 --- a/apps/openmw/mwworld/globals.cpp +++ b/apps/openmw/mwworld/globals.cpp @@ -3,7 +3,7 @@ #include -#include +#include "esmstore.hpp" namespace MWWorld { @@ -27,9 +27,9 @@ namespace MWWorld return iter; } - Globals::Globals (const ESMS::ESMStore& store) + Globals::Globals (const MWWorld::ESMStore& store) { - for (ESMS::RecListT::MapType::const_iterator iter + for (MWWorld::RecListT::MapType::const_iterator iter (store.globals.list.begin()); iter != store.globals.list.end(); ++iter) { char type = ' '; diff --git a/apps/openmw/mwworld/globals.hpp b/apps/openmw/mwworld/globals.hpp index 6aa54ade2..c7aee5f93 100644 --- a/apps/openmw/mwworld/globals.hpp +++ b/apps/openmw/mwworld/globals.hpp @@ -6,13 +6,10 @@ #include -namespace ESMS -{ - struct ESMStore; -} - namespace MWWorld { + class ESMStore; + class Globals { public: @@ -36,7 +33,7 @@ namespace MWWorld public: - Globals (const ESMS::ESMStore& store); + Globals (const MWWorld::ESMStore& store); const Data& operator[] (const std::string& name) const; diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 179a484e9..a69d658b3 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -6,13 +6,12 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwmechanics/npcstats.hpp" +#include "esmstore.hpp" #include "class.hpp" void MWWorld::InventoryStore::copySlots (const InventoryStore& store) diff --git a/apps/openmw/mwworld/localscripts.cpp b/apps/openmw/mwworld/localscripts.cpp index d0d698feb..4a965ef3d 100644 --- a/apps/openmw/mwworld/localscripts.cpp +++ b/apps/openmw/mwworld/localscripts.cpp @@ -1,8 +1,6 @@ - #include "localscripts.hpp" -#include - +#include "esmstore.hpp" #include "cellstore.hpp" namespace @@ -23,7 +21,7 @@ namespace } } -MWWorld::LocalScripts::LocalScripts (const ESMS::ESMStore& store) : mStore (store) {} +MWWorld::LocalScripts::LocalScripts (const MWWorld::ESMStore& store) : mStore (store) {} void MWWorld::LocalScripts::setIgnore (const Ptr& ptr) { diff --git a/apps/openmw/mwworld/localscripts.hpp b/apps/openmw/mwworld/localscripts.hpp index 78f65e356..028dcdeda 100644 --- a/apps/openmw/mwworld/localscripts.hpp +++ b/apps/openmw/mwworld/localscripts.hpp @@ -6,13 +6,9 @@ #include "ptr.hpp" -namespace ESMS -{ - struct ESMStore; -} - namespace MWWorld { + struct ESMStore; class CellStore; /// \brief List of active local scripts @@ -21,11 +17,11 @@ namespace MWWorld std::list > mScripts; std::list >::iterator mIter; MWWorld::Ptr mIgnore; - const ESMS::ESMStore& mStore; + const MWWorld::ESMStore& mStore; public: - LocalScripts (const ESMS::ESMStore& store); + LocalScripts (const MWWorld::ESMStore& store); void setIgnore (const Ptr& ptr); ///< Mark a single reference for ignoring during iteration over local scripts (will revoke diff --git a/apps/openmw/mwworld/manualref.hpp b/apps/openmw/mwworld/manualref.hpp index 6570761ab..3bc617817 100644 --- a/apps/openmw/mwworld/manualref.hpp +++ b/apps/openmw/mwworld/manualref.hpp @@ -3,8 +3,7 @@ #include -#include - +#include "esmstore.hpp" #include "ptr.hpp" #include "cellstore.hpp" @@ -20,7 +19,7 @@ namespace MWWorld ManualRef& operator= (const ManualRef&); template - bool create (const ESMS::RecListT& list, const std::string& name) + bool create (const MWWorld::RecListT& list, const std::string& name) { if (const T *instance = list.search (name)) { @@ -37,7 +36,7 @@ namespace MWWorld } template - bool create (const ESMS::RecListWithIDT& list, const std::string& name) + bool create (const MWWorld::RecListWithIDT& list, const std::string& name) { if (const T *instance = list.search (name)) { @@ -55,7 +54,7 @@ namespace MWWorld public: - ManualRef (const ESMS::ESMStore& store, const std::string& name) + ManualRef (const MWWorld::ESMStore& store, const std::string& name) { // create if (!create (store.activators, name) && diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index e1eb02c32..3aaf2ae48 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -1,7 +1,6 @@ #include "player.hpp" -#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" @@ -9,6 +8,7 @@ #include "../mwmechanics/movement.hpp" #include "../mwmechanics/npcstats.hpp" +#include "esmstore.hpp" #include "class.hpp" namespace MWWorld diff --git a/components/esm_store/reclists.hpp b/apps/openmw/mwworld/reclists.hpp similarity index 91% rename from components/esm_store/reclists.hpp rename to apps/openmw/mwworld/reclists.hpp index d9a764805..1548049ae 100644 --- a/components/esm_store/reclists.hpp +++ b/apps/openmw/mwworld/reclists.hpp @@ -1,7 +1,7 @@ -#ifndef _GAME_ESM_RECLISTS_H -#define _GAME_ESM_RECLISTS_H +#ifndef OPENMW_MWWORLD_RECLISTS_H +#define OPENMW_MWWORLD_RECLISTS_H -#include "components/esm/records.hpp" +#include #include #include #include @@ -10,21 +10,17 @@ #include #include #include -#include - - +#include using namespace boost::algorithm; -namespace ESMS +namespace MWWorld { - using namespace ESM; - struct RecList { virtual ~RecList() {} - virtual void load(ESMReader &esm, const std::string &id) = 0; + virtual void load(ESM::ESMReader &esm, const std::string &id) = 0; virtual int getSize() = 0; virtual void listIdentifier (std::vector& identifier) const = 0; @@ -51,7 +47,7 @@ namespace ESMS MapType list; // Load one object of this type - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { std::string id2 = toLower (id); list[id2].load(esm); @@ -102,7 +98,7 @@ namespace ESMS MapType list; // Load one object of this type - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { //std::string id2 = toLower (id); @@ -170,7 +166,7 @@ namespace ESMS MapType list; // Load one object of this type - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { std::string id2 = toLower (id); list[id2].mId = id2; @@ -216,7 +212,7 @@ namespace ESMS virtual ~LTexList() {} // TODO: For multiple ESM/ESP files we need one list per file. - std::vector ltex; + std::vector ltex; LTexList() { @@ -224,7 +220,7 @@ namespace ESMS ltex.reserve(128); } - const LandTexture* search(size_t index) const + const ESM::LandTexture* search(size_t index) const { assert(index < ltex.size()); return <ex.at(index); @@ -235,9 +231,9 @@ namespace ESMS virtual void listIdentifier (std::vector& identifier) const {} - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { - LandTexture lt; + ESM::LandTexture lt; lt.load(esm); lt.mId = id; @@ -265,7 +261,7 @@ namespace ESMS // Map containing all landscapes typedef std::pair LandCoord; - typedef std::map LandMap; + typedef std::map LandMap; LandMap lands; int count; @@ -275,7 +271,7 @@ namespace ESMS virtual void listIdentifier (std::vector& identifier) const {} // Find land for the given coordinates. Return null if no mData. - Land *search(int x, int y) const + ESM::Land *search(int x, int y) const { LandMap::const_iterator itr = lands.find(std::make_pair (x, y)); if ( itr == lands.end() ) @@ -286,13 +282,13 @@ namespace ESMS return itr->second; } - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { count++; // Create the structure and load it. This actually skips the // landscape data and remembers the file position for later. - Land *land = new Land(); + ESM::Land *land = new ESM::Land(); land->load(esm); // Store the structure @@ -404,7 +400,7 @@ namespace ESMS return 0; } - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { count++; @@ -458,7 +454,7 @@ namespace ESMS // do nothing } - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { count++; ESM::Pathgrid *grid = new ESM::Pathgrid; @@ -473,9 +469,9 @@ namespace ESMS } } - Pathgrid *find(int cellX, int cellY, const std::string &cellName) const + ESM::Pathgrid *find(int cellX, int cellY, const std::string &cellName) const { - Pathgrid *result = search(cellX, cellY, cellName); + ESM::Pathgrid *result = search(cellX, cellY, cellName); if (!result) { throw std::runtime_error("no pathgrid found for cell " + cellName); @@ -483,9 +479,9 @@ namespace ESMS return result; } - Pathgrid *search(int cellX, int cellY, const std::string &cellName) const + ESM::Pathgrid *search(int cellX, int cellY, const std::string &cellName) const { - Pathgrid *result = NULL; + ESM::Pathgrid *result = NULL; if (cellX == 0 && cellY == 0) // possibly interior { IntGrids::const_iterator it = intGrids.find(cellName); @@ -501,7 +497,7 @@ namespace ESMS return result; } - Pathgrid *search(const ESM::Cell &cell) const + ESM::Pathgrid *search(const ESM::Cell &cell) const { int cellX, cellY; if (cell.mData.mFlags & ESM::Cell::Interior) @@ -527,7 +523,7 @@ namespace ESMS MapType list; // Load one object of this type - void load(ESMReader &esm, const std::string &id) + void load(ESM::ESMReader &esm, const std::string &id) { X ref; ref.load (esm); @@ -579,7 +575,7 @@ namespace ESMS MapType list; - void load(ESMReader &esm) + void load(ESM::ESMReader &esm) { X ref; ref.load (esm); @@ -620,10 +616,5 @@ namespace ESMS return object; } }; - - /* We need special lists for: - - Path grids - */ } #endif diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 517025fb2..c3b2ea864 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -1,6 +1,5 @@ #include "scene.hpp" -#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" /// FIXME @@ -10,6 +9,7 @@ #include "player.hpp" #include "localscripts.hpp" +#include "esmstore.hpp" #include "cellfunctors.hpp" diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 391b34a84..c49f8e6bb 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -5,8 +5,6 @@ #include -#include - #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/soundmanager.hpp" @@ -14,6 +12,7 @@ #include "../mwrender/renderingmanager.hpp" #include "player.hpp" +#include "esmstore.hpp" using namespace Ogre; using namespace MWWorld; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c7f0de245..a6b34d542 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -20,7 +20,7 @@ using namespace Ogre; namespace { template - void listCellScripts (const ESMS::ESMStore& store, + void listCellScripts (const MWWorld::ESMStore& store, MWWorld::CellRefList& cellRefList, MWWorld::LocalScripts& localScripts, MWWorld::Ptr::CellStore *cell) { @@ -228,12 +228,12 @@ namespace MWWorld return cell; // didn't work -> now check for regions - std::string cellName2 = ESMS::RecListT::toLower (cellName); + std::string cellName2 = MWWorld::RecListT::toLower (cellName); - for (ESMS::RecListT::MapType::const_iterator iter (mStore.regions.list.begin()); + for (MWWorld::RecListT::MapType::const_iterator iter (mStore.regions.list.begin()); iter!=mStore.regions.list.end(); ++iter) { - if (ESMS::RecListT::toLower (iter->second.mName)==cellName2) + if (MWWorld::RecListT::toLower (iter->second.mName)==cellName2) { if (const ESM::Cell *cell = mStore.cells.searchExtByRegion (iter->first)) return cell; @@ -260,7 +260,7 @@ namespace MWWorld return *mPlayer; } - const ESMS::ESMStore& World::getStore() const + const MWWorld::ESMStore& World::getStore() const { return mStore; } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 527a608a6..68a5ec142 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -1,12 +1,11 @@ #ifndef GAME_MWWORLD_WORLDIMP_H #define GAME_MWWORLD_WORLDIMP_H -#include - #include "../mwrender/debugging.hpp" #include "ptr.hpp" #include "scene.hpp" +#include "esmstore.hpp" #include "physicssystem.hpp" #include "cells.hpp" #include "localscripts.hpp" @@ -56,7 +55,7 @@ namespace MWWorld MWWorld::Scene *mWorldScene; MWWorld::Player *mPlayer; ESM::ESMReader mEsm; - ESMS::ESMStore mStore; + MWWorld::ESMStore mStore; LocalScripts mLocalScripts; MWWorld::Globals *mGlobalVariables; MWWorld::PhysicsSystem *mPhysics; @@ -124,7 +123,7 @@ namespace MWWorld virtual Player& getPlayer(); - virtual const ESMS::ESMStore& getStore() const; + virtual const MWWorld::ESMStore& getStore() const; virtual ESM::ESMReader& getEsmReader(); diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index c714693c3..29d6f46cd 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -34,10 +34,6 @@ add_component_dir (file_finder file_finder filename_less search ) -add_component_dir (esm_store - reclists store - ) - add_component_dir (esm attr defs esmcommon esmreader esmwriter loadacti loadalch loadappa loadarmo loadbody loadbook loadbsgn loadcell loadclas loadclot loadcont loadcrea loadcrec loaddial loaddoor loadench loadfact loadglob loadgmst diff --git a/components/esm_store/store.hpp b/components/esm_store/store.hpp deleted file mode 100644 index db36afd33..000000000 --- a/components/esm_store/store.hpp +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _GAME_ESM_STORE_H -#define _GAME_ESM_STORE_H - -/* - The ESM storage module. - - This is separate from the ESM loader module, located in esm/. It is - also unaware of the cell loading and storage module. - - The advantage of this, as with all other modularizations, is that - you can replace the storage method later without touching the - loading code. Cutting down dependencies also help on the general - maintainability. - */ - -#include "components/esm/records.hpp" -#include "reclists.hpp" - -namespace ESMS -{ - using namespace ESM; - - struct ESMStore - { - /* Lists all the list types. Mostly used for quick lookup on - loading. The key is the record name (4 chars) parsed as a 32 - bit int. See esm/records.hpp for the complete list. - */ - RecListList recLists; - - // Each individual list - RecListT activators; - RecListWithIDT potions; - RecListT appas; - RecListT armors; - RecListT bodyParts; - RecListWithIDT books; - RecListT birthSigns; - RecListT classes; - RecListT clothes; - RecListT contChange; - RecListT containers; - RecListWithIDT creatures; - RecListT creaChange; - RecListCaseT dialogs; - RecListT doors; - RecListT enchants; - RecListT factions; - RecListT globals; - RecListWithIDT ingreds; - RecListT creatureLists; - RecListT itemLists; - RecListT lights; - RecListT lockpicks; - RecListT miscItems; - RecListWithIDT npcs; - RecListT npcChange; - RecListT probes; - RecListT races; - RecListT regions; - RecListT repairs; - RecListT soundGens; - RecListT sounds; - RecListT spells; - RecListT startScripts; - RecListT statics; - RecListT weapons; - - // Lists that need special rules - CellList cells; - RecListWithIDT gameSettings; - LandList lands; - LTexList landTexts; - ScriptListT