2
0
Эх сурвалжийг харах

Merge remote-tracking branch 'origin/release/1.10.x'

rdb 3 жил өмнө
parent
commit
f0446a6e9c

+ 1 - 1
panda/src/gobj/shader.cxx

@@ -391,7 +391,7 @@ cp_dependency(ShaderMatInput inp) {
     dep |= SSD_colorscale;
   }
   if (inp == SMO_attr_fog || inp == SMO_attr_fogcolor) {
-    dep |= SSD_fog;
+    dep |= SSD_fog | SSD_frame;
   }
   if ((inp == SMO_model_to_view) ||
       (inp == SMO_view_to_model) ||

+ 8 - 0
panda/src/pgraph/pandaNode.I

@@ -1532,6 +1532,14 @@ has_tag(const std::string &key) const {
   return _cdata->_tag_data.find(key) >= 0;
 }
 
+/**
+ * Returns the "into" collide mask for this node.
+ */
+INLINE CollideMask PandaNodePipelineReader::
+get_into_collide_mask() const {
+  return _cdata->_into_collide_mask;
+}
+
 /**
  * Returns the union of all into_collide_mask() values set at CollisionNodes
  * at this level and below.

+ 28 - 8
panda/src/pgraph/pandaNode.cxx

@@ -2910,11 +2910,21 @@ get_component(NodePathComponent *parent, PandaNode *child_node,
   // First, walk through the list of NodePathComponents we already have on the
   // child, looking for one that already exists, referencing the indicated
   // parent component.
-  Paths::const_iterator pi;
-  for (pi = child_node->_paths.begin(); pi != child_node->_paths.end(); ++pi) {
-    if ((*pi)->get_next(pipeline_stage, current_thread) == parent) {
+  for (NodePathComponent *child : child_node->_paths) {
+    if (child->get_next(pipeline_stage, current_thread) == parent) {
       // If we already have such a component, just return it.
-      return (*pi);
+      // But before we do, we have to make sure it's not in the middle of being
+      // destructed.
+#ifdef HAVE_THREADS
+      if (child->ref_if_nonzero()) {
+        PT(NodePathComponent) result;
+        result.cheat() = child;
+        return result;
+      }
+#else
+      // If we're not building with threading, increment as normal.
+      return child;
+#endif
     }
   }
 
@@ -2952,11 +2962,21 @@ get_top_component(PandaNode *child_node, bool force, int pipeline_stage,
 
   // Walk through the list of NodePathComponents we already have on the child,
   // looking for one that already exists as a top node.
-  Paths::const_iterator pi;
-  for (pi = child_node->_paths.begin(); pi != child_node->_paths.end(); ++pi) {
-    if ((*pi)->is_top_node(pipeline_stage, current_thread)) {
+  for (NodePathComponent *child : child_node->_paths) {
+    if (child->is_top_node(pipeline_stage, current_thread)) {
       // If we already have such a component, just return it.
-      return (*pi);
+      // But before we do, we have to make sure it's not in the middle of being
+      // destructed.
+#ifdef HAVE_THREADS
+      if (child->ref_if_nonzero()) {
+        PT(NodePathComponent) result;
+        result.cheat() = child;
+        return result;
+      }
+#else
+      // If we're not building with threading, increment as normal.
+      return child;
+#endif
     }
   }
 

+ 1 - 0
panda/src/pgraph/pandaNode.h

@@ -902,6 +902,7 @@ public:
   INLINE std::string get_tag(const std::string &key) const;
   INLINE bool has_tag(const std::string &key) const;
 
+  INLINE CollideMask get_into_collide_mask() const;
   INLINE CollideMask get_net_collide_mask() const;
   INLINE const RenderAttrib *get_off_clip_planes() const;
   INLINE const BoundingVolume *get_bounds() const;