mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +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.
|
||||
struct NiSwitchNode : public NiNode
|
||||
{
|
||||
unsigned int initialIndex;
|
||||
|
||||
void read(NIFStream *nif)
|
||||
{
|
||||
NiNode::read(nif);
|
||||
nif->getInt(); // unknown
|
||||
initialIndex = nif->getUInt();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -629,10 +629,8 @@ namespace NifOsg
|
|||
|
||||
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);
|
||||
node->asSwitch()->setSingleChildOn(niSwitchNode->initialIndex);
|
||||
if (niSwitchNode->name == Constants::NightDayLabel && !SceneUtil::hasUserDescription(rootNode, Constants::NightDayLabel))
|
||||
rootNode->getOrCreateUserDataContainer()->addDescription(Constants::NightDayLabel);
|
||||
else if (niSwitchNode->name == Constants::HerbalismLabel && !SceneUtil::hasUserDescription(rootNode, Constants::HerbalismLabel))
|
||||
|
|
Loading…
Reference in a new issue