1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/opencs/model/world/metadata.cpp
2022-09-22 21:35:26 +03:00

29 lines
747 B
C++

#include "metadata.hpp"
#include <components/esm3/esmreader.hpp>
#include <components/esm3/esmwriter.hpp>
#include <components/esm3/loadtes3.hpp>
void CSMWorld::MetaData::blank()
{
// 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);
}