Browse Source

aggresive flattening of certain nodes

Zachary Pavlov 16 years ago
parent
commit
c0f1124dfe
1 changed files with 5 additions and 1 deletions
  1. 5 1
      panda/src/pgraph/sceneGraphReducer.cxx

+ 5 - 1
panda/src/pgraph/sceneGraphReducer.cxx

@@ -773,7 +773,11 @@ do_flatten_siblings(PandaNode *parent_node, PandaNode *child1,
 ////////////////////////////////////////////////////////////////////
 PT(PandaNode) SceneGraphReducer::
 collapse_nodes(PandaNode *node1, PandaNode *node2, bool siblings) {
-  return node2->combine_with(node1);
+  PT(PandaNode) result = node2->combine_with(node1);
+  if (result == NULL) {
+    result = node1->combine_with(node2);
+  }
+  return result;
 }