Browse Source

minor fixes

David Rose 15 years ago
parent
commit
c7628bb9f1

+ 2 - 0
panda/src/speedtree/config_speedtree.cxx

@@ -33,11 +33,13 @@ ConfigVariableString speedtree_license
 ("speedtree-license", "", 
 ("speedtree-license", "", 
  PRC_DESC("Specify the license string to pass to SpeedTreeNode::authorize() by default."));
  PRC_DESC("Specify the license string to pass to SpeedTreeNode::authorize() by default."));
 
 
+#ifndef CPPPARSER
 ConfigVariableFilename speedtree_shaders_dir
 ConfigVariableFilename speedtree_shaders_dir
 ("speedtree-shaders-dir", Filename(Filename::from_os_specific(SPEEDTREE_BIN_DIR), "Shaders"),
 ("speedtree-shaders-dir", Filename(Filename::from_os_specific(SPEEDTREE_BIN_DIR), "Shaders"),
  PRC_DESC("Specifies the directory in which to locate SpeedTree's system "
  PRC_DESC("Specifies the directory in which to locate SpeedTree's system "
 	  "shaders at runtime.  If this is empty, the default is based on "
 	  "shaders at runtime.  If this is empty, the default is based on "
 	  "SPEEDTREE_BIN_DIR, as provided at compile time."));
 	  "SPEEDTREE_BIN_DIR, as provided at compile time."));
+#endif  // CPPPARSER
 
 
 ConfigVariableFilename speedtree_textures_dir
 ConfigVariableFilename speedtree_textures_dir
 ("speedtree-textures-dir", "",
 ("speedtree-textures-dir", "",

+ 9 - 0
panda/src/speedtree/speedTreeNode.cxx

@@ -755,6 +755,15 @@ combine_with(PandaNode *other) {
     // Two SpeedTreeNodes can combine by moving trees from one to the
     // Two SpeedTreeNodes can combine by moving trees from one to the
     // other, similar to the way GeomNodes combine.
     // other, similar to the way GeomNodes combine.
     SpeedTreeNode *gother = DCAST(SpeedTreeNode, other);
     SpeedTreeNode *gother = DCAST(SpeedTreeNode, other);
+
+    // But, not if they both have a terrain set.
+    if (has_terrain() && gother->has_terrain()) {
+      return NULL;
+
+    } else if (gother->has_terrain()) {
+      set_terrain(gother->get_terrain());
+    }
+
     add_instances_from(gother);
     add_instances_from(gother);
     return this;
     return this;
   }
   }