1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 07:15:34 +00:00
openmw/components/esm3/loadglob.cpp

51 lines
1,010 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.getHNString ("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.writeHNCString ("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;
}
}