From c7628bb9f17e99a8bc3888bcded6b6e0eddf19b5 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 12 Oct 2010 23:57:33 +0000 Subject: [PATCH] minor fixes --- panda/src/speedtree/config_speedtree.cxx | 2 ++ panda/src/speedtree/speedTreeNode.cxx | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/panda/src/speedtree/config_speedtree.cxx b/panda/src/speedtree/config_speedtree.cxx index 0bfabda029..c9afae51e6 100644 --- a/panda/src/speedtree/config_speedtree.cxx +++ b/panda/src/speedtree/config_speedtree.cxx @@ -33,11 +33,13 @@ ConfigVariableString speedtree_license ("speedtree-license", "", PRC_DESC("Specify the license string to pass to SpeedTreeNode::authorize() by default.")); +#ifndef CPPPARSER ConfigVariableFilename speedtree_shaders_dir ("speedtree-shaders-dir", Filename(Filename::from_os_specific(SPEEDTREE_BIN_DIR), "Shaders"), PRC_DESC("Specifies the directory in which to locate SpeedTree's system " "shaders at runtime. If this is empty, the default is based on " "SPEEDTREE_BIN_DIR, as provided at compile time.")); +#endif // CPPPARSER ConfigVariableFilename speedtree_textures_dir ("speedtree-textures-dir", "", diff --git a/panda/src/speedtree/speedTreeNode.cxx b/panda/src/speedtree/speedTreeNode.cxx index 30ec983a00..5b66c0a286 100644 --- a/panda/src/speedtree/speedTreeNode.cxx +++ b/panda/src/speedtree/speedTreeNode.cxx @@ -755,6 +755,15 @@ combine_with(PandaNode *other) { // Two SpeedTreeNodes can combine by moving trees from one to the // other, similar to the way GeomNodes combine. 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); return this; }