diff --git a/apps/openmw/mwgui/birth.cpp b/apps/openmw/mwgui/birth.cpp index 1891bf550..4837821e0 100644 --- a/apps/openmw/mwgui/birth.cpp +++ b/apps/openmw/mwgui/birth.cpp @@ -186,7 +186,7 @@ void BirthDialog::updateSpells() for (; it != end; ++it) { const std::string &spellId = *it; - const ESM::Spell *spell = store.spells.search(spellId); + const ESM::Spell *spell = store.get().search(spellId); if (!spell) continue; // Skip spells which cannot be found ESM::Spell::SpellType type = static_cast(spell->mData.mType); diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index 461604b76..c14c7f74b 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -188,8 +188,8 @@ void PickClassDialog::updateClasses() const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); int index = 0; - MWWorld::Store::iterator it = store.get().begin(); - for (; it != store.get().end(); ++it) + MWWorld::Store::iterator it = store.get().begin(); + for (; it != store.get().end(); ++it) { bool playable = (it->mData.mIsPlayable != 0); if (!playable) // Only display playable classes diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index 9595f3284..b2281d87e 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -97,7 +97,7 @@ namespace MWGui for (MWWorld::ESMStore::iterator it = store.begin(); it != store.end(); ++it) { - iter->second->listIdentifier (mNames); + it->second->listIdentifier (mNames); } // sort diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index cb8efe5cc..943081e65 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -229,7 +229,7 @@ void RaceDialog::updateRaces() int index = 0; - MWWorld::Store::iterator it = races.begin() + MWWorld::Store::iterator it = races.begin(); for (; it != races.end(); ++it) { bool playable = it->mData.mFlags & ESM::Race::Playable; diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 5d30b142a..9d6842068 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -456,7 +456,8 @@ void StatsWindow::updateSkillArea() FactionList::const_iterator end = mFactions.end(); for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it) { - const ESM::Faction *faction = store.factions.find(it->first); + const ESM::Faction *faction = + store.get().find(it->first); MyGUI::Widget* w = addItem(faction->mName, coord1, coord2); std::string text; @@ -507,7 +508,8 @@ void StatsWindow::updateSkillArea() addSeparator(coord1, coord2); addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2); - const ESM::BirthSign *sign = store.birthSigns.find(mBirthSignId); + const ESM::BirthSign *sign = + store.get().find(mBirthSignId); MyGUI::Widget* w = addItem(sign->mName, coord1, coord2); ToolTips::createBirthsignToolTip(w, mBirthSignId); diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index d1e3602b7..2c2efa487 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -33,7 +33,7 @@ namespace MWRender // get the size of the world MWWorld::Store::iterator it = esmStore.get().extBegin(); - for (; it != esmStore.get().end(); ++it) + for (; it != esmStore.get().extEnd(); ++it) { if (it->getGridX() < mMinX) mMinX = it->getGridX(); diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index c4d70ba08..58039e249 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -63,11 +63,11 @@ namespace MWWorld return iter; } - SharedIterator operator==(const SharedIterator &x) const { + bool operator==(const SharedIterator &x) const { return mIter == x.mIter; } - SharedIterator operator!=(const SharedIterator &x) const { + bool operator!=(const SharedIterator &x) const { return !(*this == x); } @@ -314,20 +314,20 @@ namespace MWWorld return iterator(mStatic.end()); } - ESM::Land *search(int x, int y) { + ESM::Land *search(int x, int y) const { ESM::Land land; land.mX = x, land.mY = y; - std::vector::iterator it = + std::vector::const_iterator it = std::lower_bound(mStatic.begin(), mStatic.end(), &land, Compare()); if (it != mStatic.end() && (*it)->mX == x && (*it)->mY == y) { - return *it; + return const_cast(*it); } return 0; } - ESM::Land *find(int x, int y) { + ESM::Land *find(int x, int y) const{ ESM::Land *ptr = search(x, y); if (ptr == 0) { std::ostringstream msg; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 02fac8b61..9a1303d76 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -775,6 +775,7 @@ namespace MWWorld std::pair World::createRecord (const ESM::Potion& record) { + /* /// \todo Rewrite the ESMStore so that a dynamic 2nd ESMStore can be attached to it. /// This function should then insert the record into the 2nd store (the code for this /// should also be moved to the ESMStore class). It might be a good idea to review @@ -792,10 +793,10 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_ALCH)); return std::make_pair (stream.str(), created); - } + */} std::pair World::createRecord (const ESM::Class& record) - { + {/* /// \todo See function above. std::ostringstream stream; stream << "$dynamic" << mNextDynamicRecord++; @@ -806,10 +807,10 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_CLAS)); return std::make_pair (stream.str(), created); - } + */} std::pair World::createRecord (const ESM::Spell& record) - { + {/* /// \todo See function above. std::ostringstream stream; stream << "$dynamic" << mNextDynamicRecord++; @@ -820,10 +821,10 @@ namespace MWWorld mStore.all.insert (std::make_pair (stream.str(), ESM::REC_SPEL)); return std::make_pair (stream.str(), created); - } + */} const ESM::Cell *World::createRecord (const ESM::Cell& record) - { + {/* if (record.mData.mFlags & ESM::Cell::Interior) { if (mStore.cells.searchInt (record.mName)) @@ -843,7 +844,7 @@ namespace MWWorld std::make_pair (std::make_pair (record.mData.mX, record.mData.mY), cell)); return cell; } - } + */} void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number)