1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:23:53 +00:00
openmw/components/esm3/debugprofile.cpp

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

65 lines
1.5 KiB
C++
Raw Normal View History

2014-08-03 08:12:03 +00:00
#include "debugprofile.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
namespace ESM
{
void DebugProfile::load(ESMReader& esm, bool& isDeleted)
{
isDeleted = false;
mRecordFlags = esm.getRecordFlags();
2022-09-22 18:26:05 +00:00
while (esm.hasMoreSubs())
{
esm.getSubName();
switch (esm.retSubName().toInt())
2022-09-22 18:26:05 +00:00
{
case SREC_NAME:
mId = esm.getHString();
break;
case fourCC("DESC"):
mDescription = esm.getHString();
break;
case fourCC("SCRP"):
mScriptText = esm.getHString();
break;
case fourCC("FLAG"):
esm.getHT(mFlags);
break;
case SREC_DELE:
esm.skipHSub();
isDeleted = true;
break;
default:
esm.fail("Unknown subrecord");
break;
2022-09-22 18:26:05 +00:00
}
}
}
2014-08-03 08:12:03 +00:00
void DebugProfile::save(ESMWriter& esm, bool isDeleted) const
{
esm.writeHNCString("NAME", mId);
2014-08-03 08:12:03 +00:00
if (isDeleted)
2022-09-22 18:26:05 +00:00
{
2014-08-03 08:12:03 +00:00
esm.writeHNString("DELE", "", 3);
return;
2014-08-03 08:12:03 +00:00
}
esm.writeHNCString("DESC", mDescription);
esm.writeHNCString("SCRP", mScriptText);
esm.writeHNT("FLAG", mFlags);
2022-09-22 18:26:05 +00:00
}
void DebugProfile::blank()
2014-08-03 08:12:03 +00:00
{
mDescription.clear();
mScriptText.clear();
mFlags = 0;
2014-08-03 08:12:03 +00:00
}
}