1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 17:15:34 +00:00
openmw/components/nif/base.cpp

33 lines
759 B
C++
Raw Normal View History

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