mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-24 18:39:59 +00:00
Use NiSwitchNode initial index field
This commit is contained in:
parent
ef2a7160fa
commit
7c8360d0f3
@ -238,10 +238,12 @@ struct NiRotatingParticles : Node
|
|||||||
// A node used as the base to switch between child nodes, such as for LOD levels.
|
// A node used as the base to switch between child nodes, such as for LOD levels.
|
||||||
struct NiSwitchNode : public NiNode
|
struct NiSwitchNode : public NiNode
|
||||||
{
|
{
|
||||||
|
unsigned int initialIndex;
|
||||||
|
|
||||||
void read(NIFStream *nif)
|
void read(NIFStream *nif)
|
||||||
{
|
{
|
||||||
NiNode::read(nif);
|
NiNode::read(nif);
|
||||||
nif->getInt(); // unknown
|
initialIndex = nif->getUInt();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -629,10 +629,8 @@ namespace NifOsg
|
|||||||
|
|
||||||
if (nifNode->recType == Nif::RC_NiSwitchNode)
|
if (nifNode->recType == Nif::RC_NiSwitchNode)
|
||||||
{
|
{
|
||||||
// show only first child by default
|
|
||||||
node->asSwitch()->setSingleChildOn(0);
|
|
||||||
|
|
||||||
const Nif::NiSwitchNode* niSwitchNode = static_cast<const Nif::NiSwitchNode*>(nifNode);
|
const Nif::NiSwitchNode* niSwitchNode = static_cast<const Nif::NiSwitchNode*>(nifNode);
|
||||||
|
node->asSwitch()->setSingleChildOn(niSwitchNode->initialIndex);
|
||||||
if (niSwitchNode->name == Constants::NightDayLabel && !SceneUtil::hasUserDescription(rootNode, Constants::NightDayLabel))
|
if (niSwitchNode->name == Constants::NightDayLabel && !SceneUtil::hasUserDescription(rootNode, Constants::NightDayLabel))
|
||||||
rootNode->getOrCreateUserDataContainer()->addDescription(Constants::NightDayLabel);
|
rootNode->getOrCreateUserDataContainer()->addDescription(Constants::NightDayLabel);
|
||||||
else if (niSwitchNode->name == Constants::HerbalismLabel && !SceneUtil::hasUserDescription(rootNode, Constants::HerbalismLabel))
|
else if (niSwitchNode->name == Constants::HerbalismLabel && !SceneUtil::hasUserDescription(rootNode, Constants::HerbalismLabel))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user