mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 16:45:35 +00:00
Merge pull request #2417 from Capostrophic/switchnode
Use NiSwitchNode initial index field
This commit is contained in:
commit
747b5fbc98
2 changed files with 4 additions and 4 deletions
|
@ -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…
Reference in a new issue