1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 08:19:56 +00:00
openmw-tes3mp/components/esm/esm4reader.hpp
cc9cii 6ec6b9bc2a OpenMW Integration.
Read the ESM/ESP records but do nothing with them for the moment.
2018-10-07 08:55:30 +11:00

38 lines
1.1 KiB
C++

#ifndef COMPONENT_ESM_4READER_H
#define COMPONENT_ESM_4READER_H
#include <extern/esm4/tes4.hpp>
#include <extern/esm4/reader.hpp>
#include "esmreader.hpp"
namespace ESM
{
// Wrapper class for integrating into OpenCS
class ESM4Reader : public ESMReader, public ESM4::ReaderObserver
{
ESM4::Reader mReader;
public:
ESM4Reader(bool oldHeader = true);
virtual ~ESM4Reader();
ESM4::Reader& reader() { return mReader; }
// Added for use with OpenMW (loading progress bar)
inline size_t getFileSize() { return mReader.getFileSize(); }
inline size_t getFileOffset() { return mReader.getFileOffset(); }
// Added for loading Cell/Land
ESM4::ReaderContext getESM4Context();
void restoreESM4Context(const ESM4::ReaderContext& ctx);
void restoreCellChildrenContext(const ESM4::ReaderContext& ctx);
void openTes4File(const std::string &name);
// callback from mReader to ensure hasMoreRecs() can reliably track to EOF
inline void update(std::size_t size) { mCtx.leftFile -= size; }
};
}
#endif // COMPONENT_ESM_4READER_H