From 49a86f7eecb21967814b84900231600b9aa4d231 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 15 Sep 2005 16:14:07 +0000 Subject: [PATCH] clean up some TypeHandle initialization problems --- panda/src/egg/config_egg.cxx | 4 ++++ panda/src/egg/eggPolysetMaker.cxx | 2 ++ panda/src/egg/eggPolysetMaker.h | 17 +++++++++++++++++ panda/src/grutil/aviTexture.cxx | 3 +-- panda/src/grutil/aviTexture.h | 18 ++++++++++++++++++ panda/src/grutil/config_grutil.cxx | 2 ++ .../particlesystem/config_particlesystem.cxx | 1 + panda/src/particlesystem/particleSystem.cxx | 2 ++ panda/src/particlesystem/particleSystem.h | 16 ++++++++++++++++ 9 files changed, 63 insertions(+), 2 deletions(-) diff --git a/panda/src/egg/config_egg.cxx b/panda/src/egg/config_egg.cxx index 0589e13b89..212232da4f 100644 --- a/panda/src/egg/config_egg.cxx +++ b/panda/src/egg/config_egg.cxx @@ -30,6 +30,7 @@ #include "eggFilenameNode.h" #include "eggGroup.h" #include "eggGroupNode.h" +#include "eggGroupUniquifier.h" #include "eggLine.h" #include "eggMaterial.h" #include "eggNameUniquifier.h" @@ -40,6 +41,7 @@ #include "eggObject.h" #include "eggPoint.h" #include "eggPolygon.h" +#include "eggPolysetMaker.h" #include "eggPoolUniquifier.h" #include "eggPrimitive.h" #include "eggSAnimData.h" @@ -180,6 +182,7 @@ init_libegg() { EggFilenameNode::init_type(); EggGroup::init_type(); EggGroupNode::init_type(); + EggGroupUniquifier::init_type(); EggLine::init_type(); EggMaterial::init_type(); EggNameUniquifier::init_type(); @@ -190,6 +193,7 @@ init_libegg() { EggObject::init_type(); EggPoint::init_type(); EggPolygon::init_type(); + EggPolysetMaker::init_type(); EggPoolUniquifier::init_type(); EggPrimitive::init_type(); EggSAnimData::init_type(); diff --git a/panda/src/egg/eggPolysetMaker.cxx b/panda/src/egg/eggPolysetMaker.cxx index ac45895428..7eaab604c6 100644 --- a/panda/src/egg/eggPolysetMaker.cxx +++ b/panda/src/egg/eggPolysetMaker.cxx @@ -19,6 +19,8 @@ #include "eggPolysetMaker.h" #include "eggPolygon.h" +TypeHandle EggPolysetMaker::_type_handle; + //////////////////////////////////////////////////////////////////// // Function: EggPolysetMaker::Constructor // Access: Public diff --git a/panda/src/egg/eggPolysetMaker.h b/panda/src/egg/eggPolysetMaker.h index 781d8617b9..b664114dfb 100644 --- a/panda/src/egg/eggPolysetMaker.h +++ b/panda/src/egg/eggPolysetMaker.h @@ -71,6 +71,23 @@ public: private: int _properties; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + EggBinMaker::init_type(); + register_type(_type_handle, "EggPolysetMaker", + EggBinMaker::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; }; diff --git a/panda/src/grutil/aviTexture.cxx b/panda/src/grutil/aviTexture.cxx index 9c6ded13e7..06d5dc9c6b 100755 --- a/panda/src/grutil/aviTexture.cxx +++ b/panda/src/grutil/aviTexture.cxx @@ -4,8 +4,7 @@ #include "aviTexture.h" #include - - +TypeHandle AviTexture::_type_handle; //////////////////////////////////////////////////////////////////// // Function: AviTexture::AviTexture diff --git a/panda/src/grutil/aviTexture.h b/panda/src/grutil/aviTexture.h index 347e445082..3e744365a4 100755 --- a/panda/src/grutil/aviTexture.h +++ b/panda/src/grutil/aviTexture.h @@ -38,6 +38,24 @@ private: int _current_frame; int _width; int _height; + +public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + Texture::init_type(); + register_type(_type_handle, "AviTexture", + Texture::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 "aviTexture.I" diff --git a/panda/src/grutil/config_grutil.cxx b/panda/src/grutil/config_grutil.cxx index 10fdec166b..2e0432a062 100644 --- a/panda/src/grutil/config_grutil.cxx +++ b/panda/src/grutil/config_grutil.cxx @@ -18,6 +18,7 @@ #include "config_grutil.h" #include "frameRateMeter.h" +#include "aviTexture.h" #include "dconfig.h" @@ -61,5 +62,6 @@ init_libgrutil() { initialized = true; FrameRateMeter::init_type(); + AviTexture::init_type(); } diff --git a/panda/src/particlesystem/config_particlesystem.cxx b/panda/src/particlesystem/config_particlesystem.cxx index efcbc241a9..ddc67b3fae 100644 --- a/panda/src/particlesystem/config_particlesystem.cxx +++ b/panda/src/particlesystem/config_particlesystem.cxx @@ -29,6 +29,7 @@ ConfigureFn(config_particlesystem) { ColorInterpolationFunctionLinear::init_type(); ColorInterpolationFunctionStepwave::init_type(); ColorInterpolationFunctionSinusoid::init_type(); + ParticleSystem::init_type(); init_libparticlesystem(); } diff --git a/panda/src/particlesystem/particleSystem.cxx b/panda/src/particlesystem/particleSystem.cxx index 1811cd8908..26acff1e77 100644 --- a/panda/src/particlesystem/particleSystem.cxx +++ b/panda/src/particlesystem/particleSystem.cxx @@ -34,6 +34,8 @@ #include "pointParticleFactory.h" #include "sphereSurfaceEmitter.h" +TypeHandle ParticleSystem::_type_handle; + //////////////////////////////////////////////////////////////////// // Function : ParticleSystem // Access : Public diff --git a/panda/src/particlesystem/particleSystem.h b/panda/src/particlesystem/particleSystem.h index 3f7cec469c..97232dbdf2 100644 --- a/panda/src/particlesystem/particleSystem.h +++ b/panda/src/particlesystem/particleSystem.h @@ -160,6 +160,22 @@ private: bool _i_was_spawned_flag; public: + static TypeHandle get_class_type() { + return _type_handle; + } + static void init_type() { + Physical::init_type(); + register_type(_type_handle, "ParticleSystem", + Physical::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; + friend class ParticleSystemManager; // particleSystemManager.h };