From af435acd5c90a1e70e0236e7a627a5536acee5a9 Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Fri, 12 Dec 2008 01:15:01 +0000 Subject: [PATCH] allow cull callback disabling --- panda/src/pgraph/pandaNode.cxx | 15 +++++++++++++++ panda/src/pgraph/pandaNode.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 3ffa9c2282..1abfdd8126 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -2835,6 +2835,21 @@ set_cull_callback() { CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); } +//////////////////////////////////////////////////////////////////// +// Function: PandaNode::disable_cull_callback +// Access: Protected +// Description: disables the call back +//////////////////////////////////////////////////////////////////// +void PandaNode:: +disable_cull_callback() { + Thread *current_thread = Thread::get_current_thread(); + OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) { + CDStageWriter cdata(_cycler, pipeline_stage, current_thread); + cdata->set_fancy_bit(FB_cull_callback, false); + } + CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler); +} + //////////////////////////////////////////////////////////////////// // Function: PandaNode::stage_remove_child // Access: Private diff --git a/panda/src/pgraph/pandaNode.h b/panda/src/pgraph/pandaNode.h index ddc2dab31d..6fa5bef7ac 100644 --- a/panda/src/pgraph/pandaNode.h +++ b/panda/src/pgraph/pandaNode.h @@ -325,7 +325,7 @@ protected: Thread *current_thread); void set_cull_callback(); - + void disable_cull_callback(); public: virtual void r_prepare_scene(const RenderState *state, PreparedGraphicsObjects *prepared_objects,