diff --git a/README.md b/README.md index 32fe426de2..579f8c1619 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,23 @@ Enhancements for both OpenMW and OpenCS: * Experimental support of loading TES4/TES5 records (coming soon). * Experimental support of NavMesh (eventually). +openmw.cfg example +------------------ + + ... + fallback-archive=Morrowind.bsa + fallback-archive=Tribunal.bsa + fallback-archive=Bloodmoon.bsa + fallback-archive=TR_Data.bsa + fallback-tes4archive=Oblivion - Meshes.bsa + #fallback-tes4archive=Skyrim - Textures.bsa + #fallback-tes4archive=Dragonborn.bsa + #fallback-tes4archive=Dawnguard.bsa + ... + data="C:/Program Files (x86)/Bethesda Softworks/Morrowind/Data Files" + data="C:/Program Files (x86)/Bethesda Softworks/Oblivion/Data" + ... + Build Dependencies ------------------ diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index c110e94d61..43b3913b24 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -134,7 +134,7 @@ namespace MWBase virtual const MWWorld::ESMStore& getStore() const = 0; - virtual std::vector& getEsmReader() = 0; + virtual std::vector& getEsmReader() = 0; virtual MWWorld::LocalScripts& getLocalScripts() = 0; diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp index 2aa817fa50..e8a785b36d 100644 --- a/apps/openmw/mwworld/cells.cpp +++ b/apps/openmw/mwworld/cells.cpp @@ -83,7 +83,7 @@ void MWWorld::Cells::writeCell (ESM::ESMWriter& writer, CellStore& cell) const writer.endRecord (ESM::REC_CSTA); } -MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector& reader) +MWWorld::Cells::Cells (const MWWorld::ESMStore& store, std::vector >& reader) : mStore (store), mReader (reader), mIdCache (40, std::pair ("", (CellStore*)0)), /// \todo make cache size configurable mIdCacheIndex (0) diff --git a/apps/openmw/mwworld/cells.hpp b/apps/openmw/mwworld/cells.hpp index 0b7d9444fd..7f5adc4879 100644 --- a/apps/openmw/mwworld/cells.hpp +++ b/apps/openmw/mwworld/cells.hpp @@ -28,7 +28,7 @@ namespace MWWorld class Cells { const MWWorld::ESMStore& mStore; - std::vector& mReader; + std::vector >& mReader; mutable std::map mInteriors; mutable std::map, CellStore> mExteriors; std::vector > mIdCache; @@ -47,7 +47,7 @@ namespace MWWorld void clear(); - Cells (const MWWorld::ESMStore& store, std::vector& reader); + Cells (const MWWorld::ESMStore& store, std::vector >& reader); CellStore *getExterior (int x, int y); diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 0e392f0550..c087957b21 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -400,7 +400,7 @@ namespace MWWorld + mNpcs.mList.size(); } - void CellStore::load (const MWWorld::ESMStore &store, std::vector &esm) + void CellStore::load (const MWWorld::ESMStore &store, std::vector > &esm) { if (mState!=State_Loaded) { @@ -417,7 +417,7 @@ namespace MWWorld } } - void CellStore::preload (const MWWorld::ESMStore &store, std::vector &esm) + void CellStore::preload (const MWWorld::ESMStore &store, std::vector > &esm) { if (mState==State_Unloaded) { @@ -427,7 +427,7 @@ namespace MWWorld } } - void CellStore::listRefs(const MWWorld::ESMStore &store, std::vector &esm) + void CellStore::listRefs(const MWWorld::ESMStore &store, std::vector > &esm) { assert (mCell); @@ -439,13 +439,13 @@ namespace MWWorld { // Reopen the ESM reader and seek to the right position. int index = mCell->mContextList.at(i).index; - mCell->restore (esm[index], i); + mCell->restore (*esm[0][index], (int)i); // FIXME: hardcoded 0 means TES3 ESM::CellRef ref; // Get each reference in turn bool deleted = false; - while (mCell->getNextRef (esm[index], ref, deleted)) + while (mCell->getNextRef (*esm[0][index], ref, deleted)) // FIXME hardcoded 0 means TES3 { if (deleted) continue; @@ -472,7 +472,7 @@ namespace MWWorld std::sort (mIds.begin(), mIds.end()); } - void CellStore::loadRefs(const MWWorld::ESMStore &store, std::vector &esm) + void CellStore::loadRefs(const MWWorld::ESMStore &store, std::vector > &esm) { assert (mCell); @@ -484,14 +484,14 @@ namespace MWWorld { // Reopen the ESM reader and seek to the right position. int index = mCell->mContextList.at(i).index; - mCell->restore (esm[index], i); + mCell->restore (*esm[0][index], (int)i); // FIXME: hardcoded 0 means TES3 ESM::CellRef ref; ref.mRefNum.mContentFile = ESM::RefNum::RefNum_NoContentFile; // Get each reference in turn bool deleted = false; - while(mCell->getNextRef(esm[index], ref, deleted)) + while(mCell->getNextRef(*esm[0][index], ref, deleted)) // FIXME: 0 means TES3 { // Don't load reference if it was moved to a different cell. ESM::MovedCellRefTracker::const_iterator iter = diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 672b6046b6..689f07d4f2 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -112,10 +112,10 @@ namespace MWWorld int count() const; ///< Return total number of references, including deleted ones. - void load (const MWWorld::ESMStore &store, std::vector &esm); + void load (const MWWorld::ESMStore &store, std::vector > &esm); ///< Load references from content file. - void preload (const MWWorld::ESMStore &store, std::vector &esm); + void preload (const MWWorld::ESMStore &store, std::vector > &esm); ///< Build ID list from content file. /// Call functor (ref) for each reference. functor must return a bool. Returning @@ -213,9 +213,9 @@ namespace MWWorld } /// Run through references and store IDs - void listRefs(const MWWorld::ESMStore &store, std::vector &esm); + void listRefs(const MWWorld::ESMStore &store, std::vector > &esm); - void loadRefs(const MWWorld::ESMStore &store, std::vector &esm); + void loadRefs(const MWWorld::ESMStore &store, std::vector > &esm); void loadRef (ESM::CellRef& ref, bool deleted, const ESMStore& store); ///< Make case-adjustments to \a ref and insert it into the respective container. diff --git a/apps/openmw/mwworld/contentloader.hpp b/apps/openmw/mwworld/contentloader.hpp index 46bd7d3f96..e589d6d054 100644 --- a/apps/openmw/mwworld/contentloader.hpp +++ b/apps/openmw/mwworld/contentloader.hpp @@ -21,7 +21,7 @@ struct ContentLoader { } - virtual void load(const boost::filesystem::path& filepath, int& index) + virtual void load(const boost::filesystem::path& filepath, std::vector >& contentFiles) { std::cout << "Loading content file " << filepath.string() << std::endl; mListener.setLabel(filepath.string()); diff --git a/apps/openmw/mwworld/esmloader.cpp b/apps/openmw/mwworld/esmloader.cpp index b12d646e70..e87ad8a04a 100644 --- a/apps/openmw/mwworld/esmloader.cpp +++ b/apps/openmw/mwworld/esmloader.cpp @@ -6,7 +6,7 @@ namespace MWWorld { -EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector& readers, +EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector >& readers, ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener) : ContentLoader(listener) , mEsm(readers) @@ -15,17 +15,46 @@ EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector& read { } -void EsmLoader::load(const boost::filesystem::path& filepath, int& index) +// FIXME: tesVerIndex stuff is rather clunky, needs to be refactored +void EsmLoader::load(const boost::filesystem::path& filepath, std::vector >& contentFiles) { - ContentLoader::load(filepath.filename(), index); + int tesVerIndex = 0; // FIXME: hard coded, 0 = MW, 1 = TES4, 2 = TES5 (TODO: Fallout) + int index = 0; - ESM::ESMReader lEsm; - lEsm.setEncoder(mEncoder); - lEsm.setIndex(index); - lEsm.setGlobalReaderList(&mEsm); - lEsm.open(filepath.string()); - mEsm[index] = lEsm; - mStore.load(mEsm[index], &mListener); + ContentLoader::load(filepath.filename(), contentFiles); // set the label on the loading bar + + ESM::ESMReader *lEsm = new ESM::ESMReader(); + lEsm->setEncoder(mEncoder); + lEsm->setGlobalReaderList(&mEsm[tesVerIndex]); // global reader list is used by ESMStore::load only + lEsm->open(filepath.string()); + + int esmVer = lEsm->getVer(); + bool isTes4 = esmVer == ESM::VER_080 || esmVer == ESM::VER_100; + bool isTes5 = esmVer == ESM::VER_094 || esmVer == ESM::VER_17; + bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134; + + if (isTes4 || isTes5 || isFONV) + { + if (isTes4) + tesVerIndex = 1; + else if (isTes5) + tesVerIndex = 2; + else + tesVerIndex = 3; + + // do nothing for now + return; + } + else + { + tesVerIndex = 0; // 0 = MW + index = contentFiles[tesVerIndex].size(); + contentFiles[tesVerIndex].push_back(filepath.filename().string()); + lEsm->setIndex(index); + mEsm[tesVerIndex].push_back(lEsm); + } + + mStore.load(*mEsm[tesVerIndex][index], &mListener); } } /* namespace MWWorld */ diff --git a/apps/openmw/mwworld/esmloader.hpp b/apps/openmw/mwworld/esmloader.hpp index b96af707ce..32c2e977a4 100644 --- a/apps/openmw/mwworld/esmloader.hpp +++ b/apps/openmw/mwworld/esmloader.hpp @@ -22,15 +22,15 @@ class ESMStore; struct EsmLoader : public ContentLoader { - EsmLoader(MWWorld::ESMStore& store, std::vector& readers, - ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener); + EsmLoader(MWWorld::ESMStore& store, std::vector >& readers, + ToUTF8::Utf8Encoder* encoder, Loading::Listener& listener); - void load(const boost::filesystem::path& filepath, int& index); + void load(const boost::filesystem::path& filepath, std::vector >& contentFiles); private: - std::vector& mEsm; - MWWorld::ESMStore& mStore; - ToUTF8::Utf8Encoder* mEncoder; + std::vector >& mEsm; // Note: the ownership of the readers is with the caller + MWWorld::ESMStore& mStore; + ToUTF8::Utf8Encoder* mEncoder; }; } /* namespace MWWorld */ diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 91233cf70b..1b05cb19b5 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -31,38 +31,52 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener) ESM::Dialogue *dialogue = 0; - // Land texture loading needs to use a separate internal store for each plugin. - // We set the number of plugins here to avoid continual resizes during loading, - // and so we can properly verify if valid plugin indices are being passed to the - // LandTexture Store retrieval methods. - mLandTextures.resize(esm.getGlobalReaderList()->size()); + int esmVer = esm.getVer(); + bool isTes4 = esmVer == ESM::VER_080 || esmVer == ESM::VER_100; + bool isTes5 = esmVer == ESM::VER_094 || esmVer == ESM::VER_17; + bool isFONV = esmVer == ESM::VER_132 || esmVer == ESM::VER_133 || esmVer == ESM::VER_134; - /// \todo Move this to somewhere else. ESMReader? - // Cache parent esX files by tracking their indices in the global list of - // all files/readers used by the engine. This will greaty accelerate - // refnumber mangling, as required for handling moved references. - const std::vector &masters = esm.getGameFiles(); - std::vector *allPlugins = esm.getGlobalReaderList(); - for (size_t j = 0; j < masters.size(); j++) { - ESM::Header::MasterData &mast = const_cast(masters[j]); - std::string fname = mast.name; - int index = ~0; - for (int i = 0; i < esm.getIndex(); i++) { - const std::string &candidate = allPlugins->at(i).getContext().filename; - std::string fnamecandidate = boost::filesystem::path(candidate).filename().string(); - if (Misc::StringUtils::ciEqual(fname, fnamecandidate)) { - index = i; - break; + // FIXME: temporary workaround + if (!(isTes4 || isTes5 || isFONV)) // MW only + { + // Land texture loading needs to use a separate internal store for each plugin. + // We set the number of plugins here to avoid continual resizes during loading, + // and so we can properly verify if valid plugin indices are being passed to the + // LandTexture Store retrieval methods. + mLandTextures.resize(esm.getGlobalReaderList()->size()); // FIXME: size should be for MW only + } + + // FIXME: for TES4/TES5 whether a dependent file is loaded is already checked in + // ESM4::Reader::updateModIndicies() which is called in EsmLoader::load() before this + if (!(isTes4 || isTes5 || isFONV)) // MW only + { + /// \todo Move this to somewhere else. ESMReader? + // Cache parent esX files by tracking their indices in the global list of + // all files/readers used by the engine. This will greaty accelerate + // refnumber mangling, as required for handling moved references. + const std::vector &masters = esm.getGameFiles(); + std::vector *allPlugins = esm.getGlobalReaderList(); + for (size_t j = 0; j < masters.size(); j++) { + ESM::Header::MasterData &mast = const_cast(masters[j]); + std::string fname = mast.name; + int index = ~0; + for (int i = 0; i < esm.getIndex(); i++) { + const std::string &candidate = allPlugins->at(i)->getContext().filename; + std::string fnamecandidate = boost::filesystem::path(candidate).filename().string(); + if (Misc::StringUtils::ciEqual(fname, fnamecandidate)) { + index = i; + break; + } } + if (index == (int)~0) { + // Tried to load a parent file that has not been loaded yet. This is bad, + // the launcher should have taken care of this. + std::string fstring = "File " + esm.getName() + " asks for parent file " + masters[j].name + + ", but it has not been loaded yet. Please check your load order."; + esm.fail(fstring); + } + mast.index = index; } - if (index == (int)~0) { - // Tried to load a parent file that has not been loaded yet. This is bad, - // the launcher should have taken care of this. - std::string fstring = "File " + esm.getName() + " asks for parent file " + masters[j].name - + ", but it has not been loaded yet. Please check your load order."; - esm.fail(fstring); - } - mast.index = index; } // Loop through all records diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 71cf4a1433..c15fff497e 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -90,12 +90,12 @@ namespace MWWorld return mLoaders.insert(std::make_pair(extension, loader)).second; } - void load(const boost::filesystem::path& filepath, int& index) + void load(const boost::filesystem::path& filepath, std::vector >& contentFiles) { LoadersContainer::iterator it(mLoaders.find(Misc::StringUtils::lowerCase(filepath.extension().string()))); if (it != mLoaders.end()) { - it->second->load(filepath, index); + it->second->load(filepath, contentFiles); } else { @@ -169,7 +169,7 @@ namespace MWWorld mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback); - mEsm.resize(contentFiles.size()); + mEsm.resize(3); // FIXME: 0 - TES3, 1 - TES4, 2 - TES5 (TODO: Fallout) Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); listener->loadingOn(); @@ -187,7 +187,7 @@ namespace MWWorld listener->loadingOff(); // insert records that may not be present in all versions of MW - if (mEsm[0].getFormat() == 0) + if (mEsm[0][0]->getFormat() == 0) // FIXME: first file may not be for MW ensureNeededRecords(); mStore.setUp(); @@ -474,6 +474,13 @@ namespace MWWorld delete mPhysics; delete mPlayer; + + for (unsigned int i = 0; i < mEsm.size(); ++i) + for (unsigned int j = 0; j < mEsm[i].size(); ++j) + { + mEsm[i][j]->close(); + delete mEsm[i][j]; + } } const ESM::Cell *World::getExterior (const std::string& cellName) const @@ -542,9 +549,9 @@ namespace MWWorld return mStore; } - std::vector& World::getEsmReader() + std::vector& World::getEsmReader() { - return mEsm; + return mEsm[0]; // FIXME: only MW for now (but doesn't seem to be used anywhere?) } LocalScripts& World::getLocalScripts() @@ -2609,18 +2616,35 @@ namespace MWWorld return mScriptsEnabled; } + // The aim is to allow loading various types of TES files in any combination, as long as + // the dependent files are loaded first. To achieve this, separate indicies for each TES + // versions are required. + // + // The trouble is that until the file is opened by an ESM reader to check the version from + // the header we don't know which index to increment. + // + // One option is to allow the content loader to manage. + + // FIXME: Appears to be loading all the files named in 'content' located in fileCollections + // based on the extension string (e.g. .esm). This probably means that the contents are in + // the correct load order. + // + // 'contentLoader' has a number of loaders that can deal with various extension types. void World::loadContentFiles(const Files::Collections& fileCollections, const std::vector& content, ContentLoader& contentLoader) { + std::vector > contentFiles; + contentFiles.resize(3); + std::vector::const_iterator it(content.begin()); std::vector::const_iterator end(content.end()); - for (int idx = 0; it != end; ++it, ++idx) + for (; it != end; ++it) { boost::filesystem::path filename(*it); const Files::MultiDirCollection& col = fileCollections.getCollection(filename.extension().string()); if (col.doesExist(*it)) { - contentLoader.load(col.getPath(*it), idx); + contentLoader.load(col.getPath(*it), contentFiles); } else { @@ -2937,7 +2961,7 @@ namespace MWWorld MWWorld::ActionTeleport action(cellName, closestMarker.getRefData().getPosition(), false); action.execute(ptr); } - + void World::updateWeather(float duration, bool paused) { if (mPlayer->wasTeleported()) @@ -2945,7 +2969,7 @@ namespace MWWorld mPlayer->setTeleported(false); mWeatherManager->switchToNextWeather(true); } - + mWeatherManager->update(duration, paused); } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index bf25c20bbd..0324ce8736 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -66,7 +66,7 @@ namespace MWWorld MWWorld::Scene *mWorldScene; MWWorld::Player *mPlayer; - std::vector mEsm; + std::vector > mEsm; MWWorld::ESMStore mStore; LocalScripts mLocalScripts; MWWorld::Globals mGlobalVariables; @@ -199,7 +199,7 @@ namespace MWWorld virtual const MWWorld::ESMStore& getStore() const; - virtual std::vector& getEsmReader(); + virtual std::vector& getEsmReader(); virtual LocalScripts& getLocalScripts(); diff --git a/components/esm/esmcommon.hpp b/components/esm/esmcommon.hpp index d90a3444dd..0c0419f3a7 100644 --- a/components/esm/esmcommon.hpp +++ b/components/esm/esmcommon.hpp @@ -11,8 +11,15 @@ namespace ESM { enum Version { - VER_12 = 0x3f99999a, - VER_13 = 0x3fa66666 + VER_12 = 0x3f99999a, + VER_13 = 0x3fa66666, + VER_080 = 0x3f4ccccd, // TES4 + VER_100 = 0x3f800000, // TES4 + VER_132 = 0x3fa8f5c3, // FONV Courier's Stash, DeadMoney + VER_133 = 0x3faa3d71, // FONV HonestHearts + VER_134 = 0x3fab851f, // FONV, GunRunnersArsenal, LonesomeRoad, OldWorldBlues + VER_094 = 0x3f70a3d7, // TES5/FO3 + VER_17 = 0x3fd9999a // TES5 }; /* A structure used for holding fixed-length strings. In the case of diff --git a/components/esm/esmreader.cpp b/components/esm/esmreader.cpp index b4b44f8765..1ae7bf259f 100644 --- a/components/esm/esmreader.cpp +++ b/components/esm/esmreader.cpp @@ -71,12 +71,103 @@ void ESMReader::open(Ogre::DataStreamPtr _esm, const std::string &name) { openRaw(_esm, name); - if (getRecName() != "TES3") + NAME modVer = getRecName(); + if (modVer == "TES3") + { + getRecHeader(); + + mHeader.load (*this); + } + else if (modVer == "TES4") + { + mHeader.mData.author.assign(""); + mHeader.mData.desc.assign(""); + char buf[512]; // arbitrary number + unsigned short size; + + skip(16); // skip the rest of the header, note it may be 4 bytes longer + + NAME rec = getRecName(); + if (rec != "HEDR") + rec = getRecName(); // adjust for extra 4 bytes + bool readRec = true; + + while (mEsm->size() - mEsm->tell() >= 4) // Shivering Isle or Bashed Patch can end here + { + if (!readRec) // may be already read + rec = getRecName(); + else + readRec = false; + + switch (rec.val) + { + case 0x52444548: // HEDR + { + skip(2); // data size + getT(mHeader.mData.version); + getT(mHeader.mData.records); + skip(4); // skip next available object id + break; + } + case 0x4d414e43: // CNAM + { + getT(size); + getExact(buf, size); + std::string author; + size = std::min(size, (unsigned short)32); // clamp for TES3 format + author.assign(buf, size - 1); // don't copy null terminator + mHeader.mData.author.assign(author); + break; + } + case 0x4d414e53: // SNAM + { + getT(size); + getExact(buf, size); + std::string desc; + size = std::min(size, (unsigned short)256); // clamp for TES3 format + desc.assign(buf, size - 1); // don't copy null terminator + mHeader.mData.desc.assign(desc); + break; + } + case 0x5453414d: // MAST + { + Header::MasterData m; + getT(size); + getExact(buf, size); + m.name.assign(buf, size-1); // don't copy null terminator + + rec = getRecName(); + if (rec == "DATA") + { + getT(size); + getT(m.size); // 64 bits + } + else + { + // some esp's don't have DATA subrecord + m.size = 0; + readRec = true; // don't read again at the top of while loop + } + mHeader.mMaster.push_back (m); + break; + } + case 0x56544e49: // INTV + case 0x43434e49: // INCC + case 0x4d414e4f: // ONAM + { + getT(size); + skip(size); + break; + } + case 0x50555247: // GRUP + default: + return; // all done + } + } + return; + } + else fail("Not a valid Morrowind file"); - - getRecHeader(); - - mHeader.load (*this); } void ESMReader::open(const std::string &file) diff --git a/components/esm/esmreader.hpp b/components/esm/esmreader.hpp index 3a2f326405..d2d92b23bf 100644 --- a/components/esm/esmreader.hpp +++ b/components/esm/esmreader.hpp @@ -23,6 +23,7 @@ class ESMReader public: ESMReader(); + virtual ~ESMReader() {} /************************************************************************* * @@ -74,9 +75,9 @@ public: void openRaw(const std::string &file); /// Get the file size. Make sure that the file has been opened! - size_t getFileSize() { return mEsm->size(); } + virtual size_t getFileSize() { return mEsm->size(); } /// Get the current position in the file. Make sure that the file has been opened! - size_t getFileOffset() { return mEsm->tell(); } + virtual size_t getFileOffset() { return mEsm->tell(); } // This is a quick hack for multiple esm/esp files. Each plugin introduces its own // terrain palette, but ESMReader does not pass a reference to the correct plugin @@ -86,8 +87,8 @@ public: void setIndex(const int index) {mIdx = index; mCtx.index = index;} int getIndex() {return mIdx;} - void setGlobalReaderList(std::vector *list) {mGlobalReaderList = list;} - std::vector *getGlobalReaderList() {return mGlobalReaderList;} + void setGlobalReaderList(std::vector *list) {mGlobalReaderList = list;} + std::vector *getGlobalReaderList() {return mGlobalReaderList;} /************************************************************************* * @@ -292,8 +293,6 @@ public: private: Ogre::DataStreamPtr mEsm; - ESM_Context mCtx; - unsigned int mRecordFlags; // Special file signifier (see SpecialFile enum above) @@ -301,10 +300,13 @@ private: // Buffer for ESM strings std::vector mBuffer; - Header mHeader; - - std::vector *mGlobalReaderList; + std::vector *mGlobalReaderList; ToUTF8::Utf8Encoder* mEncoder; + +protected: + ESM_Context mCtx; + + Header mHeader; }; } #endif