Browse Source

clean up some TypeHandle initialization problems

David Rose 20 years ago
parent
commit
49a86f7eec

+ 4 - 0
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();

+ 2 - 0
panda/src/egg/eggPolysetMaker.cxx

@@ -19,6 +19,8 @@
 #include "eggPolysetMaker.h"
 #include "eggPolygon.h"
 
+TypeHandle EggPolysetMaker::_type_handle;
+
 ////////////////////////////////////////////////////////////////////
 //     Function: EggPolysetMaker::Constructor
 //       Access: Public

+ 17 - 0
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;
 };
 
 

+ 1 - 2
panda/src/grutil/aviTexture.cxx

@@ -4,8 +4,7 @@
 #include "aviTexture.h"
 #include <stdio.h>
 
-
-
+TypeHandle AviTexture::_type_handle;
 
 ////////////////////////////////////////////////////////////////////
 //     Function: AviTexture::AviTexture

+ 18 - 0
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"

+ 2 - 0
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();
 }
 

+ 1 - 0
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();
 }
 

+ 2 - 0
panda/src/particlesystem/particleSystem.cxx

@@ -34,6 +34,8 @@
 #include "pointParticleFactory.h"
 #include "sphereSurfaceEmitter.h"
 
+TypeHandle ParticleSystem::_type_handle;
+
 ////////////////////////////////////////////////////////////////////
 //    Function : ParticleSystem
 //      Access : Public

+ 16 - 0
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
 };