mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo esm typo
This commit is contained in:
parent
c263bbf0f6
commit
d1fb854521
448 changed files with 686 additions and 683 deletions
62
components/esm3/debugprofile.cpp
Normal file
62
components/esm3/debugprofile.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include "debugprofile.hpp"
|
||||
|
||||
#include "esmreader.hpp"
|
||||
#include "esmwriter.hpp"
|
||||
#include "components/esm/defs.hpp"
|
||||
|
||||
unsigned int ESM::DebugProfile::sRecordId = REC_DBGP;
|
||||
|
||||
void ESM::DebugProfile::load (ESMReader& esm, bool &isDeleted)
|
||||
{
|
||||
isDeleted = false;
|
||||
mRecordFlags = esm.getRecordFlags();
|
||||
|
||||
while (esm.hasMoreSubs())
|
||||
{
|
||||
esm.getSubName();
|
||||
switch (esm.retSubName().toInt())
|
||||
{
|
||||
case ESM::SREC_NAME:
|
||||
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;
|
||||
case ESM::SREC_DELE:
|
||||
esm.skipHSub();
|
||||
isDeleted = true;
|
||||
break;
|
||||
default:
|
||||
esm.fail("Unknown subrecord");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ESM::DebugProfile::save (ESMWriter& esm, bool isDeleted) const
|
||||
{
|
||||
esm.writeHNCString ("NAME", mId);
|
||||
|
||||
if (isDeleted)
|
||||
{
|
||||
esm.writeHNString("DELE", "", 3);
|
||||
return;
|
||||
}
|
||||
|
||||
esm.writeHNCString ("DESC", mDescription);
|
||||
esm.writeHNCString ("SCRP", mScriptText);
|
||||
esm.writeHNT ("FLAG", mFlags);
|
||||
}
|
||||
|
||||
void ESM::DebugProfile::blank()
|
||||
{
|
||||
mDescription.clear();
|
||||
mScriptText.clear();
|
||||
mFlags = 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue