mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
f2fb3d6de8
NIFFile might not always be created from a file or stream containing NIF data. Basically there are 2 different responsibilities for this class: 1. Read NIF file 2. Provide input for nifosg and bulletnifloader. Remove no longer needed NIFFileMock since the state of NIFFfile can be initialized independently from reading NIF file.
33 lines
758 B
C++
33 lines
758 B
C++
#include "base.hpp"
|
|
|
|
namespace Nif
|
|
{
|
|
void Extra::read(NIFStream* nif)
|
|
{
|
|
if (nif->getVersion() >= NIFStream::generateVersion(10, 0, 1, 0))
|
|
name = nif->getString();
|
|
else if (nif->getVersion() <= NIFStream::generateVersion(4, 2, 2, 0))
|
|
{
|
|
next.read(nif);
|
|
recordSize = nif->getUInt();
|
|
}
|
|
}
|
|
|
|
void Named::read(NIFStream* nif)
|
|
{
|
|
name = nif->getString();
|
|
if (nif->getVersion() < NIFStream::generateVersion(10, 0, 1, 0))
|
|
extra.read(nif);
|
|
else
|
|
extralist.read(nif);
|
|
controller.read(nif);
|
|
}
|
|
|
|
void Named::post(Reader& nif)
|
|
{
|
|
extra.post(nif);
|
|
extralist.post(nif);
|
|
controller.post(nif);
|
|
}
|
|
}
|