mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 17:45:34 +00:00
Merge branch 'nilightcolorcontroller' into 'master'
Give NiLightColorController its own struct See merge request OpenMW/openmw!4472
This commit is contained in:
commit
c454675cff
3 changed files with 37 additions and 3 deletions
|
@ -231,12 +231,32 @@ namespace Nif
|
|||
mCollider.post(nif);
|
||||
}
|
||||
|
||||
void NiLightColorController::read(NIFStream* nif)
|
||||
{
|
||||
NiPoint3InterpController::read(nif);
|
||||
|
||||
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
|
||||
mMode = static_cast<Mode>(nif->get<uint16_t>());
|
||||
else
|
||||
mMode = static_cast<Mode>((mFlags >> 4) & 1);
|
||||
|
||||
if (nif->getVersion() <= NIFStream::generateVersion(10, 1, 0, 103))
|
||||
mData.read(nif);
|
||||
}
|
||||
|
||||
void NiLightColorController::post(Reader& nif)
|
||||
{
|
||||
NiPoint3InterpController::post(nif);
|
||||
|
||||
mData.post(nif);
|
||||
}
|
||||
|
||||
void NiMaterialColorController::read(NIFStream* nif)
|
||||
{
|
||||
NiPoint3InterpController::read(nif);
|
||||
|
||||
if (nif->getVersion() >= NIFStream::generateVersion(10, 1, 0, 0))
|
||||
mTargetColor = static_cast<TargetColor>(nif->get<uint16_t>() & 3);
|
||||
mTargetColor = static_cast<TargetColor>(nif->get<uint16_t>());
|
||||
else
|
||||
mTargetColor = static_cast<TargetColor>((mFlags >> 4) & 3);
|
||||
|
||||
|
|
|
@ -161,6 +161,21 @@ namespace Nif
|
|||
};
|
||||
using NiBSPArrayController = NiParticleSystemController;
|
||||
|
||||
struct NiLightColorController : public NiPoint3InterpController
|
||||
{
|
||||
enum class Mode
|
||||
{
|
||||
DiffuseSpecular = 0,
|
||||
Ambient = 1,
|
||||
};
|
||||
|
||||
NiPosDataPtr mData;
|
||||
Mode mMode = Mode::DiffuseSpecular;
|
||||
|
||||
void read(NIFStream* nif) override;
|
||||
void post(Reader& nif) override;
|
||||
};
|
||||
|
||||
struct NiMaterialColorController : public NiPoint3InterpController
|
||||
{
|
||||
enum class TargetColor
|
||||
|
|
|
@ -112,8 +112,7 @@ namespace Nif
|
|||
{ "NiGeomMorpherController", &construct<NiGeomMorpherController, RC_NiGeomMorpherController> },
|
||||
{ "NiKeyframeController", &construct<NiKeyframeController, RC_NiKeyframeController> },
|
||||
{ "NiLookAtController", &construct<NiLookAtController, RC_NiLookAtController> },
|
||||
// FIXME: NiLightColorController should have its own struct
|
||||
{ "NiLightColorController", &construct<NiMaterialColorController, RC_NiLightColorController> },
|
||||
{ "NiLightColorController", &construct<NiLightColorController, RC_NiLightColorController> },
|
||||
{ "NiMaterialColorController", &construct<NiMaterialColorController, RC_NiMaterialColorController> },
|
||||
{ "NiPathController", &construct<NiPathController, RC_NiPathController> },
|
||||
{ "NiRollController", &construct<NiRollController, RC_NiRollController> },
|
||||
|
|
Loading…
Reference in a new issue