1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwworld/esmloader.cpp
elsid b09570692e
Use ifstream for ESMReader
ESMReader reads the whole file, there is no need in the ConstrainedFileStream.
2022-04-15 02:58:57 +02:00

29 lines
667 B
C++

#include "esmloader.hpp"
#include "esmstore.hpp"
#include <components/esm3/esmreader.hpp>
namespace MWWorld
{
EsmLoader::EsmLoader(MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& readers,
ToUTF8::Utf8Encoder* encoder)
: mEsm(readers)
, mStore(store)
, mEncoder(encoder)
{
}
void EsmLoader::load(const boost::filesystem::path& filepath, int& index, Loading::Listener* listener)
{
ESM::ESMReader lEsm;
lEsm.setEncoder(mEncoder);
lEsm.setIndex(index);
lEsm.open(filepath.string());
lEsm.resolveParentFileIndices(mEsm);
mEsm[index] = std::move(lEsm);
mStore.load(mEsm[index], listener);
}
} /* namespace MWWorld */