1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 08:45:39 +00:00
openmw/components/esm3/loadgmst.cpp

34 lines
800 B
C++
Raw Normal View History

#include "loadgmst.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
2022-09-22 18:26:05 +00:00
void GameSetting::load(ESMReader& esm, bool& isDeleted)
{
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)
mRecordFlags = esm.getRecordFlags();
mId = esm.getHNRefId("NAME");
2022-09-22 18:26:05 +00:00
mValue.read(esm, Variant::Format_Gmst);
}
2022-09-22 18:26:05 +00:00
void GameSetting::save(ESMWriter& esm, bool /*isDeleted*/) const
{
esm.writeHNCRefId("NAME", mId);
2022-09-22 18:26:05 +00:00
mValue.write(esm, Variant::Format_Gmst);
}
2013-02-08 08:58:19 +00:00
void GameSetting::blank()
{
2022-05-29 20:12:30 +00:00
mRecordFlags = 0;
2022-09-22 18:26:05 +00:00
mValue.setType(VT_None);
2013-02-08 08:58:19 +00:00
}
2022-09-22 18:26:05 +00:00
bool operator==(const GameSetting& left, const GameSetting& right)
2013-02-08 08:58:19 +00:00
{
2022-09-22 18:26:05 +00:00
return left.mValue == right.mValue;
2013-02-08 08:58:19 +00:00
}
}