1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00
OpenMW/components/nif/base.cpp

33 lines
780 B
C++
Raw Normal View History

2022-07-21 15:51:34 +04:00
#include "base.hpp"
namespace Nif
{
2022-09-22 21:26:05 +03:00
void Extra::read(NIFStream* nif)
2022-07-21 15:51:34 +04:00
{
2022-09-22 21:26:05 +03:00
if (nif->getVersion() >= NIFStream::generateVersion(10, 0, 1, 0))
2022-07-21 15:51:34 +04:00
name = nif->getString();
2022-09-22 21:26:05 +03:00
else if (nif->getVersion() <= NIFStream::generateVersion(4, 2, 2, 0))
2022-07-21 15:51:34 +04:00
{
next.read(nif);
recordSize = nif->getUInt();
}
}
2022-09-22 21:26:05 +03:00
void Named::read(NIFStream* nif)
2022-07-21 15:51:34 +04:00
{
name = nif->getString();
2022-09-22 21:26:05 +03:00
if (nif->getVersion() < NIFStream::generateVersion(10, 0, 1, 0))
2022-07-21 15:51:34 +04:00
extra.read(nif);
else
readRecordList(nif, extralist);
2022-07-21 15:51:34 +04:00
controller.read(nif);
}
void Named::post(Reader& nif)
2022-07-21 15:51:34 +04:00
{
extra.post(nif);
postRecordList(nif, extralist);
2022-07-21 15:51:34 +04:00
controller.post(nif);
}
}