1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/components/nif/base.cpp

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

41 lines
1013 B
C++
Raw Normal View History

2022-07-21 11:51:34 +00:00
#include "base.hpp"
namespace Nif
{
void Extra::read(NIFStream* nif)
{
if (nif->getVersion() >= NIFStream::generateVersion(10, 0, 1, 0))
2023-08-31 21:58:23 +00:00
nif->read(mName);
2022-07-21 11:51:34 +00:00
else if (nif->getVersion() <= NIFStream::generateVersion(4, 2, 2, 0))
{
2023-08-31 21:58:23 +00:00
mNext.read(nif);
nif->read(mRecordSize);
2022-07-21 11:51:34 +00:00
}
}
void NiObjectNET::read(NIFStream* nif)
2022-07-21 11:51:34 +00:00
{
nif->read(mName);
2022-07-21 11:51:34 +00:00
if (nif->getVersion() < NIFStream::generateVersion(10, 0, 1, 0))
mExtra.read(nif);
2022-07-21 11:51:34 +00:00
else
readRecordList(nif, mExtraList);
mController.read(nif);
2022-07-21 11:51:34 +00:00
}
void NiObjectNET::post(Reader& nif)
2022-07-21 11:51:34 +00:00
{
mExtra.post(nif);
postRecordList(nif, mExtraList);
mController.post(nif);
}
ExtraList NiObjectNET::getExtraList() const
{
ExtraList list = mExtraList;
for (ExtraPtr extra = mExtra; !extra.empty(); extra = extra->mNext)
list.emplace_back(extra);
return list;
2022-07-21 11:51:34 +00:00
}
}