From 126090bdc503cbc72b78e31f731d643a5b45c24b Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Wed, 31 Aug 2022 22:12:13 +0300 Subject: [PATCH] Load NiBillboardNode mode field --- components/nif/niffile.cpp | 2 +- components/nif/node.cpp | 9 +++++++++ components/nif/node.hpp | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index d09a8f6caa..1ce471e7dd 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -51,7 +51,7 @@ static std::map makeFactory() {"NiCollisionSwitch" , &construct }, {"NiBSParticleNode" , &construct }, {"NiBSAnimationNode" , &construct }, - {"NiBillboardNode" , &construct }, + {"NiBillboardNode" , &construct }, {"NiTriShape" , &construct }, {"NiTriStrips" , &construct }, {"NiLines" , &construct }, diff --git a/components/nif/node.cpp b/components/nif/node.cpp index 089ea6f615..15761b02ef 100644 --- a/components/nif/node.cpp +++ b/components/nif/node.cpp @@ -272,4 +272,13 @@ namespace Nif NiNode::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; + } } diff --git a/components/nif/node.hpp b/components/nif/node.hpp index bfcd008fc9..8160a66dc4 100644 --- a/components/nif/node.hpp +++ b/components/nif/node.hpp @@ -251,5 +251,12 @@ struct NiSortAdjustNode : NiNode void post(NIFFile *nif) override; }; +struct NiBillboardNode : NiNode +{ + int mMode{0}; + + void read(NIFStream *nif) override; +}; + } // Namespace #endif