diff --git a/panda/src/express/memoryInfo.cxx b/panda/src/express/memoryInfo.cxx index 67e25aeba6..129f67cf02 100644 --- a/panda/src/express/memoryInfo.cxx +++ b/panda/src/express/memoryInfo.cxx @@ -114,7 +114,9 @@ determine_dynamic_type() { _dynamic_type = _static_type; _flags &= ~F_reconsider_dynamic_type; - //nassert_raise("Unregistered type"); + if (ConfigVariableBool("raise-unregistered-type", false).get_value()) { + nassert_raise("Unregistered type"); + } return; } diff --git a/panda/src/express/memoryUsage.cxx b/panda/src/express/memoryUsage.cxx index c4395bb09f..ea2c488fca 100644 --- a/panda/src/express/memoryUsage.cxx +++ b/panda/src/express/memoryUsage.cxx @@ -96,7 +96,7 @@ show() const { for (vi = count_sorter.begin(); vi != count_sorter.end(); ++vi) { TypeHandle type = (*vi)._type; if (type == TypeHandle::none()) { - nout << "unknown"; + nout << "undefined type (TypeHandle::none())"; } else { nout << type; } @@ -850,8 +850,12 @@ ns_get_pointers_of_type(MemoryUsagePointers &result, TypeHandle type) { if (info->_freeze_index == _freeze_index && info->_ref_ptr != (ReferenceCount *)NULL) { TypeHandle info_type = info->get_type(); - if (info_type != TypeHandle::none() && - info_type.is_derived_from(type)) { + if (type == TypeHandle::none() && + info_type == TypeHandle::none()) { + result.add_entry(info->_ref_ptr, info->_typed_ptr, info_type, + now - info->_time); + } else if (info_type != TypeHandle::none() && + info_type.is_derived_from(type)) { result.add_entry(info->_ref_ptr, info->_typed_ptr, info_type, now - info->_time); } diff --git a/panda/src/particlesystem/config_particlesystem.cxx b/panda/src/particlesystem/config_particlesystem.cxx index db0ad5f412..16915b5ef9 100644 --- a/panda/src/particlesystem/config_particlesystem.cxx +++ b/panda/src/particlesystem/config_particlesystem.cxx @@ -15,6 +15,7 @@ #include "config_particlesystem.h" #include "particleSystem.h" #include "geomParticleRenderer.h" +#include "geomNode.h" ConfigureDef(config_particlesystem); NotifyCategoryDef(particlesystem, ""); @@ -26,6 +27,7 @@ ConfigureFn(config_particlesystem) { ColorInterpolationFunctionStepwave::init_type(); ColorInterpolationFunctionSinusoid::init_type(); ParticleSystem::init_type(); + GeomNode::GeomList::init_type(); // repeated here to ensure instantiated templates get initialized too. init_libparticlesystem(); } diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index c1713e540d..19d9157343 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -72,6 +72,7 @@ #include "renderModeAttrib.h" #include "renderState.h" #include "rescaleNormalAttrib.h" +#include "sceneSetup.h" #include "scissorAttrib.h" #include "scissorEffect.h" #include "shadeModelAttrib.h" @@ -490,6 +491,7 @@ init_libpgraph() { RenderModeAttrib::init_type(); RenderState::init_type(); RescaleNormalAttrib::init_type(); + SceneSetup::init_type(); ScissorAttrib::init_type(); ScissorEffect::init_type(); ShadeModelAttrib::init_type(); diff --git a/panda/src/pgraph/geomNode.h b/panda/src/pgraph/geomNode.h index eda3aa5335..bbe7720998 100644 --- a/panda/src/pgraph/geomNode.h +++ b/panda/src/pgraph/geomNode.h @@ -117,10 +117,11 @@ public: CPT(RenderState) _state; }; + typedef CopyOnWriteObj< pvector > GeomList; + private: bool _preserved; - typedef CopyOnWriteObj< pvector > GeomList; typedef pmap NameCount; INLINE void count_name(NameCount &name_count, const InternalName *name); diff --git a/panda/src/pgraph/pgraph_composite4.cxx b/panda/src/pgraph/pgraph_composite4.cxx index bbed22af3e..c3ddac6f50 100644 --- a/panda/src/pgraph/pgraph_composite4.cxx +++ b/panda/src/pgraph/pgraph_composite4.cxx @@ -6,6 +6,7 @@ #include "renderState.cxx" #include "rescaleNormalAttrib.cxx" #include "sceneGraphReducer.cxx" +#include "sceneSetup.cxx" #include "scissorAttrib.cxx" #include "scissorEffect.cxx" #include "shadeModelAttrib.cxx" diff --git a/panda/src/pgraph/sceneSetup.cxx b/panda/src/pgraph/sceneSetup.cxx index 0b0c46cde9..0e45ed1e3b 100644 --- a/panda/src/pgraph/sceneSetup.cxx +++ b/panda/src/pgraph/sceneSetup.cxx @@ -14,3 +14,4 @@ #include "sceneSetup.h" +TypeHandle SceneSetup::_type_handle; diff --git a/panda/src/pgraph/sceneSetup.h b/panda/src/pgraph/sceneSetup.h index de9ceb702c..982936b5df 100644 --- a/panda/src/pgraph/sceneSetup.h +++ b/panda/src/pgraph/sceneSetup.h @@ -17,7 +17,7 @@ #include "pandabase.h" -#include "referenceCount.h" +#include "typedReferenceCount.h" #include "nodePath.h" #include "camera.h" #include "transformState.h" @@ -32,7 +32,7 @@ class DisplayRegion; // other general setup information for rendering a // particular scene. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA_PGRAPH SceneSetup : public ReferenceCount { +class EXPCL_PANDA_PGRAPH SceneSetup : public TypedReferenceCount { public: INLINE SceneSetup(); @@ -82,6 +82,23 @@ private: CPT(RenderState) _initial_state; CPT(TransformState) _camera_transform; CPT(TransformState) _world_transform; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + TypedReferenceCount::init_type(); + register_type(_type_handle, "SceneSetup", + TypedReferenceCount::get_class_type()); + } + virtual TypeHandle get_type() const { + return get_class_type(); + } + virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +private: + static TypeHandle _type_handle; }; #include "sceneSetup.I"