diff options
author | myrix <myrix@mail.ru> | 2021-12-24 12:04:26 +0300 |
---|---|---|
committer | myrix <myrix@mail.ru> | 2021-12-24 12:04:26 +0300 |
commit | 88fc038cebcc25106ef24026c0b29346e0298f3c (patch) | |
tree | 2c4154e9f48803ae77f4027c07bbf960ea888091 | |
parent | 9c7835e27fe812becf82627d2bf6bb0132045317 (diff) |
with mutable, without World and ESMStore interface change
-rw-r--r-- | apps/openmw/mwbase/world.hpp | 6 | ||||
-rw-r--r-- | apps/openmw/mwdialogue/hypertextparser.cpp | 2 | ||||
-rw-r--r-- | apps/openmw/mwworld/esmstore.hpp | 3 | ||||
-rw-r--r-- | apps/openmw/mwworld/store.cpp | 2 | ||||
-rw-r--r-- | apps/openmw/mwworld/store.hpp | 6 | ||||
-rw-r--r-- | apps/openmw/mwworld/worldimp.hpp | 3 |
6 files changed, 5 insertions, 17 deletions
diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index d0ff851274..d1747a2e39 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -87,11 +87,6 @@ namespace MWWorld typedef std::vector<std::pair<MWWorld::Ptr,MWMechanics::Movement> > PtrMovementList; } -namespace MWDialogue -{ - template <typename string_t, typename value_t> class KeywordSearch; -} - namespace MWBase { /// \brief Interface for the World (implemented in MWWorld) @@ -155,7 +150,6 @@ namespace MWBase virtual MWWorld::ConstPtr getPlayerConstPtr() const = 0; virtual const MWWorld::ESMStore& getStore() const = 0; - virtual const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() = 0; virtual std::vector<ESM::ESMReader>& getEsmReader() = 0; diff --git a/apps/openmw/mwdialogue/hypertextparser.cpp b/apps/openmw/mwdialogue/hypertextparser.cpp index c1fb6c9c43..89a42bf2ea 100644 --- a/apps/openmw/mwdialogue/hypertextparser.cpp +++ b/apps/openmw/mwdialogue/hypertextparser.cpp @@ -48,7 +48,7 @@ namespace MWDialogue void tokenizeKeywords(const std::string & text, std::vector<Token> & tokens) { const auto& keywordSearch = - MWBase::Environment::get().getWorld()->getDialogIdKeywordSearch(); + MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().getDialogIdKeywordSearch(); std::vector<KeywordSearch<std::string, int /*unused*/>::Match> matches; keywordSearch.highlightKeywords(text.begin(), text.end(), matches); diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp index 855dd062e9..8582a1daca 100644 --- a/apps/openmw/mwworld/esmstore.hpp +++ b/apps/openmw/mwworld/esmstore.hpp @@ -284,9 +284,6 @@ namespace MWWorld /// Actors with the same ID share spells, abilities, etc. /// @return The shared spell list to use for this actor and whether or not it has already been initialized. std::pair<std::shared_ptr<MWMechanics::SpellList>, bool> getSpellList(const std::string& id) const; - - const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() { - return mDialogs.getDialogIdKeywordSearch(); } }; template <> diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 1dc3ebf622..c767bd669a 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -1072,7 +1072,7 @@ namespace MWWorld return true; } - const MWDialogue::KeywordSearch<std::string, int>& Store<ESM::Dialogue>::getDialogIdKeywordSearch() + const MWDialogue::KeywordSearch<std::string, int>& Store<ESM::Dialogue>::getDialogIdKeywordSearch() const { if (mKeywordSearchModFlag) { diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 58ac1e6780..1ec51ad5fd 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -452,8 +452,8 @@ namespace MWWorld /// @warning ESM::Dialogue Store currently implements a sorted order for unknown reasons. std::vector<ESM::Dialogue*> mShared; - bool mKeywordSearchModFlag; - MWDialogue::KeywordSearch<std::string, int /*unused*/> mKeywordSearch; + mutable bool mKeywordSearchModFlag; + mutable MWDialogue::KeywordSearch<std::string, int /*unused*/> mKeywordSearch; public: Store(); @@ -474,7 +474,7 @@ namespace MWWorld RecordId load(ESM::ESMReader &esm) override; - const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch(); + const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() const; }; } //end namespace diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index bea7710a53..84d97ce37c 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -236,9 +236,6 @@ namespace MWWorld const MWWorld::ESMStore& getStore() const override; - const MWDialogue::KeywordSearch<std::string, int>& getDialogIdKeywordSearch() override { - return mStore.getDialogIdKeywordSearch(); } - std::vector<ESM::ESMReader>& getEsmReader() override; LocalScripts& getLocalScripts() override; |