1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-17 07:36:45 +00:00

Load NiBillboardNode mode field

This commit is contained in:
Alexei Kotov 2022-08-31 22:12:13 +03:00
parent 58d08d402a
commit 126090bdc5
3 changed files with 17 additions and 1 deletions

View file

@ -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 >},

View file

@ -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;
}
} }

View file

@ -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