1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/components/esm3/loadgmst.cpp
elsid 6d261d38dd
Add functions to read and write ESM::RefId and use them
To be later changed with another implementation.
2023-02-13 22:07:58 +01:00

34 lines
800 B
C++

#include "loadgmst.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
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");
mValue.read(esm, Variant::Format_Gmst);
}
void GameSetting::save(ESMWriter& esm, bool /*isDeleted*/) const
{
esm.writeHNCRefId("NAME", mId);
mValue.write(esm, Variant::Format_Gmst);
}
void GameSetting::blank()
{
mRecordFlags = 0;
mValue.setType(VT_None);
}
bool operator==(const GameSetting& left, const GameSetting& right)
{
return left.mValue == right.mValue;
}
}