2015-06-26 11:01:25 +00:00
|
|
|
#include "metadata.hpp"
|
|
|
|
|
2022-01-22 14:58:41 +00:00
|
|
|
#include <components/esm3/esmreader.hpp>
|
|
|
|
#include <components/esm3/esmwriter.hpp>
|
|
|
|
#include <components/esm3/loadtes3.hpp>
|
2015-06-26 11:01:25 +00:00
|
|
|
|
|
|
|
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.
|
2023-02-10 12:16:52 +00:00
|
|
|
mFormatVersion = ESM::DefaultFormatVersion;
|
2015-06-26 11:01:25 +00:00
|
|
|
mAuthor.clear();
|
|
|
|
mDescription.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::MetaData::load(ESM::ESMReader& esm)
|
|
|
|
{
|
2023-02-10 12:16:52 +00:00
|
|
|
mFormatVersion = esm.getHeader().mFormatVersion;
|
2018-09-25 13:16:40 +00:00
|
|
|
mAuthor = esm.getHeader().mData.author;
|
|
|
|
mDescription = esm.getHeader().mData.desc;
|
2015-06-26 11:01:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::MetaData::save(ESM::ESMWriter& esm) const
|
|
|
|
{
|
2023-02-10 12:16:52 +00:00
|
|
|
esm.setFormatVersion(mFormatVersion);
|
2015-06-26 11:01:25 +00:00
|
|
|
esm.setAuthor(mAuthor);
|
|
|
|
esm.setDescription(mDescription);
|
|
|
|
}
|