From 223620e27ea0d6227d800a2417388de098b6b97f Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 28 Feb 2015 13:03:45 +0100 Subject: [PATCH] Fix draw mask propagation for initially hidden nodes when when frustum culling is off --- panda/src/pgraph/pandaNode.I | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/panda/src/pgraph/pandaNode.I b/panda/src/pgraph/pandaNode.I index 162f08e03b..3a1f0c86de 100644 --- a/panda/src/pgraph/pandaNode.I +++ b/panda/src/pgraph/pandaNode.I @@ -721,13 +721,15 @@ get_user_bounds(int pipeline_stage, Thread *current_thread) const { //////////////////////////////////////////////////////////////////// INLINE void PandaNode:: mark_bounds_stale(int pipeline_stage, Thread *current_thread) const { - // It's important that we don't hold the lock during the call to - // force_bounds_stale(). + // We check whether it is already marked stale. If so, we don't have + // to make the call to force_bounds_stale(). bool is_stale_bounds; { CDStageReader cdata(_cycler, pipeline_stage, current_thread); - is_stale_bounds = (cdata->_last_bounds_update != cdata->_next_update); + is_stale_bounds = (cdata->_last_update != cdata->_next_update); } + // It's important that we don't hold the lock during the call to + // force_bounds_stale(). if (!is_stale_bounds) { ((PandaNode *)this)->force_bounds_stale(pipeline_stage, current_thread); } @@ -1833,7 +1835,7 @@ get_off_clip_planes() const { //////////////////////////////////////////////////////////////////// INLINE CPT(BoundingVolume) PandaNodePipelineReader:: get_bounds() const { - nassertr(_cdata->_last_update == _cdata->_next_update, _cdata->_external_bounds); + nassertr(_cdata->_last_bounds_update == _cdata->_next_update, _cdata->_external_bounds); return _cdata->_external_bounds; } @@ -1852,7 +1854,7 @@ get_bounds() const { //////////////////////////////////////////////////////////////////// INLINE int PandaNodePipelineReader:: get_nested_vertices() const { - nassertr(_cdata->_last_update == _cdata->_next_update, _cdata->_nested_vertices); + nassertr(_cdata->_last_bounds_update == _cdata->_next_update, _cdata->_nested_vertices); return _cdata->_nested_vertices; }