mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
C++
63 lines
1.5 KiB
C++
11 years ago
|
#include "debugprofile.hpp"
|
||
|
|
||
|
#include "esmreader.hpp"
|
||
|
#include "esmwriter.hpp"
|
||
3 years ago
|
#include "components/esm/defs.hpp"
|
||
11 years ago
|
|
||
|
unsigned int ESM::DebugProfile::sRecordId = REC_DBGP;
|
||
|
|
||
10 years ago
|
void ESM::DebugProfile::load (ESMReader& esm, bool &isDeleted)
|
||
11 years ago
|
{
|
||
10 years ago
|
isDeleted = false;
|
||
3 years ago
|
mRecordFlags = esm.getRecordFlags();
|
||
10 years ago
|
|
||
|
while (esm.hasMoreSubs())
|
||
|
{
|
||
|
esm.getSubName();
|
||
3 years ago
|
switch (esm.retSubName().toInt())
|
||
10 years ago
|
{
|
||
9 years ago
|
case ESM::SREC_NAME:
|
||
10 years ago
|
mId = esm.getHString();
|
||
|
break;
|
||
|
case ESM::FourCC<'D','E','S','C'>::value:
|
||
|
mDescription = esm.getHString();
|
||
|
break;
|
||
|
case ESM::FourCC<'S','C','R','P'>::value:
|
||
|
mScriptText = esm.getHString();
|
||
|
break;
|
||
|
case ESM::FourCC<'F','L','A','G'>::value:
|
||
|
esm.getHT(mFlags);
|
||
|
break;
|
||
9 years ago
|
case ESM::SREC_DELE:
|
||
10 years ago
|
esm.skipHSub();
|
||
|
isDeleted = true;
|
||
|
break;
|
||
10 years ago
|
default:
|
||
|
esm.fail("Unknown subrecord");
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
11 years ago
|
}
|
||
|
|
||
10 years ago
|
void ESM::DebugProfile::save (ESMWriter& esm, bool isDeleted) const
|
||
11 years ago
|
{
|
||
10 years ago
|
esm.writeHNCString ("NAME", mId);
|
||
10 years ago
|
|
||
10 years ago
|
if (isDeleted)
|
||
10 years ago
|
{
|
||
4 years ago
|
esm.writeHNString("DELE", "", 3);
|
||
10 years ago
|
return;
|
||
|
}
|
||
|
|
||
11 years ago
|
esm.writeHNCString ("DESC", mDescription);
|
||
11 years ago
|
esm.writeHNCString ("SCRP", mScriptText);
|
||
11 years ago
|
esm.writeHNT ("FLAG", mFlags);
|
||
11 years ago
|
}
|
||
|
|
||
|
void ESM::DebugProfile::blank()
|
||
|
{
|
||
|
mDescription.clear();
|
||
11 years ago
|
mScriptText.clear();
|
||
11 years ago
|
mFlags = 0;
|
||
11 years ago
|
}
|