1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +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
1002 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 11:50:29 +01: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 11:50:29 +01: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 22:16:02 +01:00
void Global::blank()
{
2022-05-29 22:12:30 +02:00
mRecordFlags = 0;
mValue.setType(VT_None);
2012-12-03 22:16:02 +01:00
}
bool operator==(const Global& left, const Global& right)
{
return left.mId == right.mId && left.mValue == right.mValue;
}
}