mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Read NiFloatExtraDataController records
This commit is contained in:
parent
c34faaf336
commit
812b0cf246
@ -526,6 +526,63 @@ namespace Nif
|
||||
mObjectPalette.post(nif);
|
||||
}
|
||||
|
||||
void NiExtraDataController::read(NIFStream* nif)
|
||||
{
|
||||
NiSingleInterpController::read(nif);
|
||||
|
||||
if (nif->getVersion() >= NIFStream::generateVersion(10, 2, 0, 0))
|
||||
nif->read(mExtraDataName);
|
||||
}
|
||||
|
||||
void NiFloatExtraDataController::read(NIFStream* nif)
|
||||
{
|
||||
NiExtraDataController::read(nif);
|
||||
|
||||
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 104))
|
||||
return;
|
||||
|
||||
// Unknown
|
||||
if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 0))
|
||||
{
|
||||
uint8_t numExtraBytes;
|
||||
nif->read(numExtraBytes);
|
||||
nif->skip(7);
|
||||
nif->skip(numExtraBytes);
|
||||
}
|
||||
|
||||
mData.read(nif);
|
||||
}
|
||||
|
||||
void NiFloatExtraDataController::post(Reader& nif)
|
||||
{
|
||||
NiExtraDataController::post(nif);
|
||||
|
||||
mData.post(nif);
|
||||
}
|
||||
|
||||
void NiFloatsExtraDataController::read(NIFStream* nif)
|
||||
{
|
||||
NiExtraDataController::read(nif);
|
||||
|
||||
nif->read(mFloatsExtraDataIndex);
|
||||
if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103))
|
||||
mData.read(nif);
|
||||
}
|
||||
|
||||
void NiFloatsExtraDataController::post(Reader& nif)
|
||||
{
|
||||
NiExtraDataController::post(nif);
|
||||
|
||||
mData.post(nif);
|
||||
}
|
||||
|
||||
void NiFloatsExtraDataPoint3Controller::read(NIFStream* nif)
|
||||
{
|
||||
NiExtraDataController::read(nif);
|
||||
|
||||
nif->read(mFloatsExtraDataIndex);
|
||||
}
|
||||
|
||||
void NiBlendInterpolator::read(NIFStream* nif)
|
||||
{
|
||||
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 112))
|
||||
|
@ -346,6 +346,38 @@ namespace Nif
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
// Abstract
|
||||
struct NiExtraDataController : NiSingleInterpController
|
||||
{
|
||||
std::string mExtraDataName;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
struct NiFloatExtraDataController : NiExtraDataController
|
||||
{
|
||||
NiFloatDataPtr mData;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct NiFloatsExtraDataController : NiExtraDataController
|
||||
{
|
||||
int32_t mFloatsExtraDataIndex;
|
||||
NiFloatDataPtr mData;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct NiFloatsExtraDataPoint3Controller : NiExtraDataController
|
||||
{
|
||||
int32_t mFloatsExtraDataIndex;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
};
|
||||
|
||||
// Abstract
|
||||
struct NiInterpolator : public Record
|
||||
{
|
||||
|
@ -122,6 +122,13 @@ namespace Nif
|
||||
{ "NiMultiTargetTransformController",
|
||||
&construct<NiMultiTargetTransformController, RC_NiMultiTargetTransformController> },
|
||||
|
||||
// Extra data controllers, Gamebryo
|
||||
{ "NiColorExtraDataController", &construct<NiExtraDataController, RC_NiColorExtraDataController> },
|
||||
{ "NiFloatExtraDataController", &construct<NiFloatExtraDataController, RC_NiFloatExtraDataController> },
|
||||
{ "NiFloatsExtraDataController", &construct<NiFloatsExtraDataController, RC_NiFloatsExtraDataController> },
|
||||
{ "NiFloatsExtraDataPoint3Controller",
|
||||
&construct<NiFloatsExtraDataPoint3Controller, RC_NiFloatsExtraDataPoint3Controller> },
|
||||
|
||||
// Bethesda
|
||||
{ "BSFrustumFOVController", &construct<NiFloatInterpController, RC_BSFrustumFOVController> },
|
||||
{ "BSKeyframeController", &construct<BSKeyframeController, RC_BSKeyframeController> },
|
||||
|
@ -127,6 +127,7 @@ namespace Nif
|
||||
RC_NiCollisionSwitch,
|
||||
RC_NiColorData,
|
||||
RC_NiColorExtraData,
|
||||
RC_NiColorExtraDataController,
|
||||
RC_NiColorInterpolator,
|
||||
RC_NiControllerManager,
|
||||
RC_NiControllerSequence,
|
||||
@ -136,8 +137,11 @@ namespace Nif
|
||||
RC_NiFlipController,
|
||||
RC_NiFloatData,
|
||||
RC_NiFloatExtraData,
|
||||
RC_NiFloatExtraDataController,
|
||||
RC_NiFloatInterpolator,
|
||||
RC_NiFloatsExtraData,
|
||||
RC_NiFloatsExtraDataController,
|
||||
RC_NiFloatsExtraDataPoint3Controller,
|
||||
RC_NiFltAnimationNode,
|
||||
RC_NiFogProperty,
|
||||
RC_NiGeomMorpherController,
|
||||
|
Loading…
x
Reference in New Issue
Block a user