1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:23:54 +00:00
openmw/components/esm3/loadglob.cpp

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

51 lines
1,002 B
C++
Raw Normal View History

#include "loadglob.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
void Global::load(ESMReader& esm, bool& isDeleted)
2013-02-28 10:50:29 +00:00
{
isDeleted = false;
mRecordFlags = esm.getRecordFlags();
mId = esm.getHNRefId("NAME");
if (esm.isNextSub("DELE"))
{
esm.skipHSub();
isDeleted = true;
}
else
{
mValue.read(esm, Variant::Format_Global);
}
2013-02-28 10:50:29 +00:00
}
void Global::save(ESMWriter& esm, bool isDeleted) const
{
esm.writeHNCRefId("NAME", mId);
if (isDeleted)
{
esm.writeHNCString("DELE", "");
}
else
{
mValue.write(esm, Variant::Format_Global);
}
}
2012-12-03 21:16:02 +00:00
void Global::blank()
{
2022-05-29 20:12:30 +00:00
mRecordFlags = 0;
mValue.setType(VT_None);
2012-12-03 21:16:02 +00:00
}
bool operator==(const Global& left, const Global& right)
{
return left.mId == right.mId && left.mValue == right.mValue;
}
}