Load NiBillboardNode mode field

crashfix_debugdraw
Alexei Kotov 2 years ago
parent 58d08d402a
commit 126090bdc5

@ -51,7 +51,7 @@ static std::map<std::string, CreateRecord> makeFactory()
{"NiCollisionSwitch" , &construct <NiNode , RC_NiCollisionSwitch >}, {"NiCollisionSwitch" , &construct <NiNode , RC_NiCollisionSwitch >},
{"NiBSParticleNode" , &construct <NiNode , RC_NiBSParticleNode >}, {"NiBSParticleNode" , &construct <NiNode , RC_NiBSParticleNode >},
{"NiBSAnimationNode" , &construct <NiNode , RC_NiBSAnimationNode >}, {"NiBSAnimationNode" , &construct <NiNode , RC_NiBSAnimationNode >},
{"NiBillboardNode" , &construct <NiNode , RC_NiBillboardNode >}, {"NiBillboardNode" , &construct <NiBillboardNode , RC_NiBillboardNode >},
{"NiTriShape" , &construct <NiTriShape , RC_NiTriShape >}, {"NiTriShape" , &construct <NiTriShape , RC_NiTriShape >},
{"NiTriStrips" , &construct <NiTriStrips , RC_NiTriStrips >}, {"NiTriStrips" , &construct <NiTriStrips , RC_NiTriStrips >},
{"NiLines" , &construct <NiLines , RC_NiLines >}, {"NiLines" , &construct <NiLines , RC_NiLines >},

@ -272,4 +272,13 @@ namespace Nif
NiNode::post(nif); NiNode::post(nif);
mSubSorter.post(nif); mSubSorter.post(nif);
} }
void NiBillboardNode::read(NIFStream *nif)
{
NiNode::read(nif);
if (nif->getVersion() >= NIFStream::generateVersion(10,1,0,0))
mMode = nif->getUShort() & 0x7;
else
mMode = (flags >> 5) & 0x3;
}
} }

@ -251,5 +251,12 @@ struct NiSortAdjustNode : NiNode
void post(NIFFile *nif) override; void post(NIFFile *nif) override;
}; };
struct NiBillboardNode : NiNode
{
int mMode{0};
void read(NIFStream *nif) override;
};
} // Namespace } // Namespace
#endif #endif

Loading…
Cancel
Save