1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 05:53:54 +00:00
openmw/apps/opencs/model/world/metadata.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
747 B
C++
Raw Normal View History

#include "metadata.hpp"
#include <components/esm3/esmreader.hpp>
#include <components/esm3/esmwriter.hpp>
#include <components/esm3/loadtes3.hpp>
void CSMWorld::MetaData::blank()
{
2022-05-20 19:47:13 +00:00
// ESM::Header::CurrentFormat is `1` but since new records are not yet used in opencs
// we use the format `0` for compatibility with old versions.
mFormat = 0;
mAuthor.clear();
mDescription.clear();
}
void CSMWorld::MetaData::load(ESM::ESMReader& esm)
{
mFormat = esm.getHeader().mFormat;
mAuthor = esm.getHeader().mData.author;
mDescription = esm.getHeader().mData.desc;
}
void CSMWorld::MetaData::save(ESM::ESMWriter& esm) const
{
esm.setFormat(mFormat);
esm.setAuthor(mAuthor);
esm.setDescription(mDescription);
}