diff --git a/panda/src/pgraph/cullResult.cxx b/panda/src/pgraph/cullResult.cxx index 0118888108..7dbe002c9e 100644 --- a/panda/src/pgraph/cullResult.cxx +++ b/panda/src/pgraph/cullResult.cxx @@ -128,6 +128,29 @@ add_object(CullableObject *object, const CullTraverser *traverser) { object->_state = object->_state->compose(get_rescale_normal_state(mode)); } + // Check for a special wireframe setting. + const RenderModeAttrib *rmode; + if (object->_state->get_attrib(rmode)) { + if (rmode->get_mode() == RenderModeAttrib::M_filled_wireframe) { + CullableObject *wireframe_part = new CullableObject(*object); + wireframe_part->_state = get_wireframe_overlay_state(rmode); + + if (wireframe_part->munge_geom + (_gsg, _gsg->get_geom_munger(wireframe_part->_state, current_thread), + traverser, force)) { + int wireframe_bin_index = bin_manager->find_bin("fixed"); + CullBin *bin = get_bin(wireframe_bin_index); + nassertv(bin != (CullBin *)NULL); + check_flash_bin(wireframe_part->_state, bin_manager, wireframe_bin_index); + bin->add_object(wireframe_part, current_thread); + } else { + delete wireframe_part; + } + + object->_state = object->_state->compose(get_wireframe_filled_state()); + } + } + // Check to see if there's a special transparency setting. const TransparencyAttrib *trans; if (object->_state->get_attrib(trans)) { @@ -216,29 +239,6 @@ add_object(CullableObject *object, const CullTraverser *traverser) { } } - // Check for a special wireframe setting. - const RenderModeAttrib *rmode; - if (object->_state->get_attrib(rmode)) { - if (rmode->get_mode() == RenderModeAttrib::M_filled_wireframe) { - CullableObject *wireframe_part = new CullableObject(*object); - wireframe_part->_state = get_wireframe_overlay_state(rmode); - - if (wireframe_part->munge_geom - (_gsg, _gsg->get_geom_munger(wireframe_part->_state, current_thread), - traverser, force)) { - int wireframe_bin_index = bin_manager->find_bin("fixed"); - CullBin *bin = get_bin(wireframe_bin_index); - nassertv(bin != (CullBin *)NULL); - check_flash_bin(wireframe_part->_state, bin_manager, wireframe_bin_index); - bin->add_object(wireframe_part, current_thread); - } else { - delete wireframe_part; - } - - object->_state = object->_state->compose(get_wireframe_filled_state()); - } - } - int bin_index = object->_state->get_bin_index(); CullBin *bin = get_bin(bin_index); nassertv(bin != (CullBin *)NULL);