Skip to content

Commit a82e220

Browse files
committed
UPBGE: Remove unused m_rootnode member in KX_Scene.
This member was used only locally in a function, its visibility is restricted then.
1 parent 555e650 commit a82e220

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

source/gameengine/Ketsji/KX_Scene.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ KX_Scene::KX_Scene(SCA_IInputDevice *inputDevice,
151151
m_mousemgr(nullptr),
152152
m_physicsEnvironment(0),
153153
m_sceneName(sceneName),
154-
m_rootnode(nullptr),
155154
m_activeCamera(nullptr),
156155
m_overrideCullingCamera(nullptr),
157156
m_ueberExecutionPriority(0),
@@ -481,19 +480,19 @@ KX_GameObject *KX_Scene::AddNodeReplicaObject(SG_Node *node, KX_GameObject *game
481480
newobj->SetSGNode(node);
482481
}
483482
else {
484-
m_rootnode = new SG_Node(newobj, this, KX_Scene::m_callbacks);
483+
SG_Node *rootnode = new SG_Node(newobj, this, KX_Scene::m_callbacks);
485484

486485
// This fixes part of the scaling-added object bug.
487486
SG_Node *orgnode = gameobj->GetSGNode();
488-
m_rootnode->SetLocalScale(orgnode->GetLocalScale());
489-
m_rootnode->SetLocalPosition(orgnode->GetLocalPosition());
490-
m_rootnode->SetLocalOrientation(orgnode->GetLocalOrientation());
487+
rootnode->SetLocalScale(orgnode->GetLocalScale());
488+
rootnode->SetLocalPosition(orgnode->GetLocalPosition());
489+
rootnode->SetLocalOrientation(orgnode->GetLocalOrientation());
491490

492491
// Define the relationship between this node and it's parent.
493492
KX_NormalParentRelation *parent_relation = new KX_NormalParentRelation();
494-
m_rootnode->SetParentRelation(parent_relation);
493+
rootnode->SetParentRelation(parent_relation);
495494

496-
newobj->SetSGNode(m_rootnode);
495+
newobj->SetSGNode(rootnode);
497496
}
498497

499498
SG_Node *replicanode = newobj->GetSGNode();

source/gameengine/Ketsji/KX_Scene.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,6 @@ class KX_Scene : public EXP_Value, public SCA_IScene
179179
/// Network scene.
180180
KX_NetworkMessageScene *m_networkScene;
181181

182-
/**
183-
* A temporary variable used to parent objects together on
184-
* replication. Don't get confused by the name it is not
185-
* the scene's root node!
186-
*/
187-
SG_Node *m_rootnode;
188-
189182
/// The active camera for the scene.
190183
KX_Camera *m_activeCamera;
191184
/// The active camera for scene culling.

0 commit comments

Comments
 (0)