瀏覽代碼

*** empty log message ***

David Rose 24 年之前
父節點
當前提交
0824e8031c
共有 64 個文件被更改,包括 290 次插入243 次删除
  1. 1 1
      panda/src/audio/audio_sound.h
  2. 1 1
      panda/src/char/dynamicVertices.h
  3. 1 1
      panda/src/display/textureContext.h
  4. 1 1
      panda/src/doc/sampleClass.h
  5. 1 1
      panda/src/egg/eggAttributes.h
  6. 1 1
      panda/src/egg/eggGroupNode.h
  7. 1 1
      panda/src/egg/eggNode.h
  8. 1 1
      panda/src/egg/eggRenderMode.h
  9. 1 1
      panda/src/egg2sg/test_loader.cxx
  10. 1 1
      panda/src/event/eventParameter.h
  11. 1 1
      panda/src/event/eventReceiver.h
  12. 4 1
      panda/src/express/Sources.pp
  13. 1 1
      panda/src/express/config_express.cxx
  14. 1 1
      panda/src/express/datagram.h
  15. 1 1
      panda/src/express/memoryUsage.h
  16. 1 1
      panda/src/express/memoryUsagePointers.h
  17. 1 1
      panda/src/express/namable.h
  18. 1 1
      panda/src/express/pointerTo.h
  19. 2 2
      panda/src/express/referenceCount.h
  20. 0 54
      panda/src/express/typeHandle.I
  21. 1 27
      panda/src/express/typeHandle.cxx
  22. 0 103
      panda/src/express/typeHandle.h
  23. 71 0
      panda/src/express/typedObject.I
  24. 35 0
      panda/src/express/typedObject.cxx
  25. 119 0
      panda/src/express/typedObject.h
  26. 1 1
      panda/src/express/typedReferenceCount.h
  27. 3 1
      panda/src/glgsg/glGraphicsStateGuardian.cxx
  28. 1 1
      panda/src/glxdisplay/glxDisplay.h
  29. 1 1
      panda/src/graph/arcChain.h
  30. 1 1
      panda/src/graph/boundedObject.h
  31. 1 1
      panda/src/graph/dftraverser.h
  32. 1 1
      panda/src/graph/graphReducer.h
  33. 1 1
      panda/src/graph/wrt.h
  34. 1 1
      panda/src/light/light.h
  35. 1 1
      panda/src/linmath/lmatrix3.h
  36. 1 1
      panda/src/linmath/lmatrix4.h
  37. 1 1
      panda/src/linmath/lvecBase2.h
  38. 1 1
      panda/src/linmath/lvecBase3.h
  39. 1 1
      panda/src/linmath/lvecBase4.h
  40. 1 1
      panda/src/loader/loaderFileType.h
  41. 1 1
      panda/src/mathutil/boundingVolume.h
  42. 1 1
      panda/src/parametrics/parametricCurveDrawer.h
  43. 1 1
      panda/src/pnmimage/pnmFileType.h
  44. 1 1
      panda/src/pnmimage/pnmFileTypeRegistry.h
  45. 1 1
      panda/src/pnmimage/pnmImageHeader.h
  46. 1 1
      panda/src/putil/bitMask.h
  47. 1 1
      panda/src/putil/config_util.cxx
  48. 1 1
      panda/src/putil/configurable.h
  49. 1 1
      panda/src/putil/factoryBase.h
  50. 1 1
      panda/src/putil/factoryParams.h
  51. 1 1
      panda/src/putil/globalPointerRegistry.h
  52. 1 1
      panda/src/putil/test_types.cxx
  53. 1 1
      panda/src/putil/typedWritable.h
  54. 1 1
      panda/src/putil/writable.h
  55. 1 1
      panda/src/sgattrib/attribTraverser.cxx
  56. 1 1
      panda/src/sgmanip/findApproxPath.h
  57. 1 1
      panda/src/sgraph/renderTraverser.h
  58. 1 1
      panda/src/sgraphutil/frustumCullTraverser.h
  59. 1 1
      panda/src/sgraphutil/sceneGraphAnalyzer.h
  60. 1 1
      panda/src/sgraphutil/sceneGraphReducer.h
  61. 1 1
      pandatool/src/eggcharbase/eggBackPointer.h
  62. 1 1
      pandatool/src/flt/fltRecord.h
  63. 1 1
      pandatool/src/lwo/iffChunk.h
  64. 1 1
      pandatool/src/lwo/iffInputFile.h

+ 1 - 1
panda/src/audio/audio_sound.h

@@ -8,7 +8,7 @@
 
 #include "audio_trait.h"
 #include <typedReferenceCount.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <namable.h>
 #include <pointerTo.h>
 

+ 1 - 1
panda/src/char/dynamicVertices.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include <pointerToArray.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <luse.h>
 #include <pta_Vertexf.h>
 #include <pta_Normalf.h>

+ 1 - 1
panda/src/display/textureContext.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 class Texture;
 

+ 1 - 1
panda/src/doc/sampleClass.h

@@ -16,7 +16,7 @@
 #include "localHeaderFile.h"
 #include "anotherLocalHeaderFile.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <anotherPandaHeaderFile.h>
 
 #include <systemHeaderFile.h>

+ 1 - 1
panda/src/egg/eggAttributes.h

@@ -10,7 +10,7 @@
 
 #include "eggMorphList.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <luse.h>
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/egg/eggGroupNode.h

@@ -11,7 +11,7 @@
 #include "eggNode.h"
 
 #include <coordinateSystem.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <pointerTo.h>
 #include <luse.h>
 

+ 1 - 1
panda/src/egg/eggNode.h

@@ -10,7 +10,7 @@
 
 #include "eggNamedObject.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <lmatrix.h>
 #include <pointerTo.h>
 #include <referenceCount.h>

+ 1 - 1
panda/src/egg/eggRenderMode.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 #include <string>
 

+ 1 - 1
panda/src/egg2sg/test_loader.cxx

@@ -23,7 +23,7 @@
 #include <allTransitionsWrapper.h>
 #include <allAttributesWrapper.h>
 #include <nullLevelState.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <notify.h>
 
 #include <stdlib.h>

+ 1 - 1
panda/src/event/eventParameter.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include <typedef.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedReferenceCount.h>
 #include <pointerTo.h>
 //#include <luse.h>

+ 1 - 1
panda/src/event/eventReceiver.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ////////////////////////////////////////////////////////////////////
 // 	 Class : EventReceiver

+ 4 - 1
panda/src/express/Sources.pp

@@ -32,7 +32,9 @@
     reversedNumericData.I reversedNumericData.cxx reversedNumericData.h \
     tokenBoard.I tokenBoard.h	\
     trueClock.I trueClock.cxx trueClock.h typeHandle.I typeHandle.cxx	\
-    typeHandle.h typedReferenceCount.I typedReferenceCount.cxx		\
+    typeHandle.h \
+    typedObject.I typedObject.cxx typedObject.h \
+    typedReferenceCount.I typedReferenceCount.cxx		\
     typedReferenceCount.h typedef.h error_utils.cxx error_utils.h
 
   #define IF_CRYPTO_SOURCES 						\
@@ -56,6 +58,7 @@
     pointerTo.I pointerTo.h referenceCount.I referenceCount.h		\
     reversedNumericData.I reversedNumericData.h \
     tokenBoard.h trueClock.I trueClock.h typeHandle.I typeHandle.h	\
+    typedObject.h typedObject.I \
     typedReferenceCount.I typedReferenceCount.h typedef.h		\
     namable.I namable.h tokenBoard.I patchfile.h patchfile.I		\
     error_utils.h

+ 1 - 1
panda/src/express/config_express.cxx

@@ -5,7 +5,7 @@
 
 #include "config_express.h"
 #include "clockObject.h"
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "referenceCount.h"
 #include "typedReferenceCount.h"
 #include "datagram.h"

+ 1 - 1
panda/src/express/datagram.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include "numeric_types.h"
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "littleEndian.h"
 #include "bigEndian.h"
 

+ 1 - 1
panda/src/express/memoryUsage.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 
 #include <map>
 

+ 1 - 1
panda/src/express/memoryUsagePointers.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "pointerTo.h"
 #include "referenceCount.h"
 

+ 1 - 1
panda/src/express/namable.h

@@ -7,7 +7,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include <string>
 
 ///////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/express/pointerTo.h

@@ -151,7 +151,7 @@ PUBLISHED:
   // e.g. instead of (MyType *)(BaseClass *)ptr, use (MyType *)ptr.p()
  
   // If your base class is a derivative of TypedObject, you might want
-  // to use the DCAST macro defined in typeHandle.h instead,
+  // to use the DCAST macro defined in typedObject.h instead,
   // e.g. DCAST(MyType, ptr).  This provides a clean downcast that
   // doesn't require .p() or any double-casting, and it can be
   // run-time checked for correctness.

+ 2 - 2
panda/src/express/referenceCount.h

@@ -17,7 +17,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "memoryUsage.h"
 #include "config_express.h"
 
@@ -83,7 +83,7 @@ INLINE void unref_delete(RefCountType *ptr);
 //               that does not have get_class_type(), you will have to
 //               define a template specialization on
 //               _get_type_handle() and _do_init_type(), as in
-//               typeHandle.h.
+//               typedObject.h.
 ////////////////////////////////////////////////////////////////////
 template<class Base>
 class EXPCL_PANDAEXPRESS RefCountProxy : public ReferenceCount {

+ 0 - 54
panda/src/express/typeHandle.I

@@ -317,60 +317,6 @@ register_dynamic_type(const string &name,
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE TypedObject::
-TypedObject() { 
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::Copy Constructor
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE TypedObject::
-TypedObject(const TypedObject &) { 
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::Copy Assignment Operator
-//       Access: Public
-//  Description: 
-////////////////////////////////////////////////////////////////////
-INLINE void TypedObject::
-operator = (const TypedObject &) {
-} 
-
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::is_of_type
-//       Access: Public
-//  Description: Returns true if the current object is or derives from
-//               the indicated type.
-////////////////////////////////////////////////////////////////////
-INLINE bool TypedObject::
-is_of_type(TypeHandle handle) const {
-  return get_type().is_derived_from(handle, (TypedObject *)this);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::is_exact_type
-//       Access: Public
-//  Description: Returns true if the current object is the indicated
-//               type exactly.
-////////////////////////////////////////////////////////////////////
-INLINE bool TypedObject::
-is_exact_type(TypeHandle handle) const {
-#ifndef NDEBUG
-  // Call get_name() to force the type to look itself up if necessary.
-  get_type().get_name((TypedObject *)this);
-#endif
-  return get_type() == handle;
-}
-
-
 ////////////////////////////////////////////////////////////////////
 //     Function: _dcast_get_typehandle
 //  Description: Returns the TypeHandle associated with the type of

+ 1 - 27
panda/src/express/typeHandle.cxx

@@ -4,6 +4,7 @@
 ////////////////////////////////////////////////////////////////////
 
 #include "typeHandle.h"
+#include "typedObject.h"
 #include "indent.h"
 #include "config_express.h"
 
@@ -16,8 +17,6 @@
 
 TypeRegistry *TypeRegistry::_global_pointer = NULL;
 
-TypeHandle TypedObject::_type_handle;
-
 // This is initialized to zero by static initialization.
 TypeHandle TypeHandle::_none;
 
@@ -681,28 +680,3 @@ get_parent_towards(TypeHandle type) const {
   return TypeHandle::none();
 }
 
- 
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::Destructor
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-TypedObject::
-~TypedObject() { 
-}
-
- 
-////////////////////////////////////////////////////////////////////
-//     Function: TypedObject::get_type
-//       Access: Public, Virtual
-//  Description: 
-////////////////////////////////////////////////////////////////////
-TypeHandle TypedObject::
-get_type() const {
-  // Normally, this function should never be called, because it is a
-  // pure virtual function.  If it is called, you probably called
-  // get_type() on a recently-destructed object.
-  express_cat.warning()
-    << "TypedObject::get_type() called!\n";
-  return _type_handle;
-}

+ 0 - 103
panda/src/express/typeHandle.h

@@ -270,109 +270,6 @@ register_dynamic_type(const string &name,
 		      TypeHandle parent3, TypeHandle parent4);
 
 
-
-////////////////////////////////////////////////////////////////////
-// 	 Class : TypedObject
-// Description : This is an abstract class that all classes which
-//               use TypeHandle, and also provide virtual functions to
-//               support polymorphism, should inherit from.  Each
-//               derived class should define get_type(), which should
-//               return the specific type of the derived class.
-//               Inheriting from this automatically provides support
-//               for is_of_type() and is_exact_type().
-////////////////////////////////////////////////////////////////////
-class EXPCL_PANDAEXPRESS TypedObject {
-public:
-  INLINE TypedObject();
-  INLINE TypedObject(const TypedObject &copy);
-  INLINE void operator = (const TypedObject &copy);
-
-PUBLISHED: 
-  // A virtual destructor is just a good idea.
-  virtual ~TypedObject();
-
-  // Derived classes should override this function to return
-  // get_class_type().
-  virtual TypeHandle get_type() const=0;
-
-  INLINE bool is_of_type(TypeHandle handle) const;
-  INLINE bool is_exact_type(TypeHandle handle) const;
-
-public:
-  // Derived classes should override this function to call
-  // init_type().  It will only be called in error situations when the
-  // type was for some reason not properly initialized.
-  virtual TypeHandle force_init_type()=0;
-
-public:
-  static TypeHandle get_class_type() {
-    return _type_handle;
-  }
-  static void init_type() {
-    register_type(_type_handle, "TypedObject");
-  }
-
-private:
-  static TypeHandle _type_handle;
-};
-
-// The DCAST (downcast) macro is defined as a convenience for
-// downcasting from some TypedObject pointer (or a PointerTo).  It's
-// just a normal C++-style downcast, except it first checks get_type()
-// to make sure the downcasting is safe.  If you compile with NDEBUG,
-// this check is removed.
-
-// DCAST will return NULL if the downcasting is unsafe.  If you'd
-// rather it abort out of the function (ala nassertv/nassertr), then
-// see DCAST_INTO_V and DCAST_INTO_R, below.
-
-template<class WantType>
-INLINE WantType *_dcast(WantType *, TypedObject *ptr);
-template<class WantType>
-INLINE const WantType *_dcast(WantType *, const TypedObject *ptr);
-
-// Note: it is important that DCAST not repeat the pointer parameter,
-// since many users of DCAST may want to use the result of a function
-// as the pointer parameter, and it could be terribly confusing and
-// difficult to trace if the function was executed twice.  This
-// happened!
-#define DCAST(want_type, pointer) _dcast((want_type*)0, pointer)
-
-// DCAST_INTO_V and DCAST_INTO_R are similar in purpose to DCAST,
-// except they: (a) automatically assign a variable instead of
-// returning the downcasted pointer, and (b) they immediately return
-// out of the function if the downcasting fails.  DCAST_INTO_V is for
-// use in a void function and returns nothing; DCAST_INTO_R is for use
-// in a non-void function and returns the indicated value.
-
-// Both DCAST_INTO_V and DCAST_INTO_R accept as the first parameter a
-// variable of type (want_type *) or (const want_type *), instead of
-// the name of the type.  This variable will be filled with the new
-// pointer.
-
-
-// _dcast_ref is used to implement DCAST_INTO_V and DCAST_INTO_R.  Its
-// difference from _dcast is that it takes a reference to a pointer as
-// a first parameter.  The main point of this is to shut up the
-// compiler about pointers used before their value is assigned.
-template<class WantType>
-INLINE WantType *_dcast_ref(WantType *&, TypedObject *ptr);
-template<class WantType>
-INLINE const WantType *_dcast_ref(WantType *&, const TypedObject *ptr);
-
-
-#define DCAST_INTO_V(to_pointer, from_pointer) \
-  { \
-    (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
-    nassertv((void *)(to_pointer) != (void *)NULL); \
-  }
-
-#define DCAST_INTO_R(to_pointer, from_pointer, return_value) \
-  { \
-    (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
-    nassertr((void *)(to_pointer) != (void *)NULL, return_value); \
-  }
-
 // A few system-wide TypeHandles are defined for some basic types.
 extern TypeHandle EXPCL_PANDAEXPRESS long_type_handle;
 extern TypeHandle EXPCL_PANDAEXPRESS int_type_handle;

+ 71 - 0
panda/src/express/typedObject.I

@@ -0,0 +1,71 @@
+// Filename: typedObject.I
+// Created by:  drose (11May01)
+// 
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::Constructor
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE TypedObject::
+TypedObject() { 
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::Copy Constructor
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE TypedObject::
+TypedObject(const TypedObject &) { 
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::Copy Assignment Operator
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE void TypedObject::
+operator = (const TypedObject &) {
+} 
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::get_type_index
+//       Access: Public
+//  Description: Returns the internal index number associated with
+//               this object's TypeHandle, a unique number for each
+//               different type.  This is equivalent to
+//               get_type().get_index().
+////////////////////////////////////////////////////////////////////
+INLINE int TypedObject::
+get_type_index() const {
+  return get_type().get_index();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::is_of_type
+//       Access: Public
+//  Description: Returns true if the current object is or derives from
+//               the indicated type.
+////////////////////////////////////////////////////////////////////
+INLINE bool TypedObject::
+is_of_type(TypeHandle handle) const {
+  return get_type().is_derived_from(handle, (TypedObject *)this);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::is_exact_type
+//       Access: Public
+//  Description: Returns true if the current object is the indicated
+//               type exactly.
+////////////////////////////////////////////////////////////////////
+INLINE bool TypedObject::
+is_exact_type(TypeHandle handle) const {
+#ifndef NDEBUG
+  // Call get_name() to force the type to look itself up if necessary.
+  get_type().get_name((TypedObject *)this);
+#endif
+  return get_type() == handle;
+}

+ 35 - 0
panda/src/express/typedObject.cxx

@@ -0,0 +1,35 @@
+// Filename: typedObject.cxx
+// Created by:  drose (11May01)
+// 
+////////////////////////////////////////////////////////////////////
+
+#include "typedObject.h"
+#include "config_express.h"
+
+
+TypeHandle TypedObject::_type_handle;
+ 
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::Destructor
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+TypedObject::
+~TypedObject() { 
+}
+
+ 
+////////////////////////////////////////////////////////////////////
+//     Function: TypedObject::get_type
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+TypeHandle TypedObject::
+get_type() const {
+  // Normally, this function should never be called, because it is a
+  // pure virtual function.  If it is called, you probably called
+  // get_type() on a recently-destructed object.
+  express_cat.warning()
+    << "TypedObject::get_type() called!\n";
+  return _type_handle;
+}

+ 119 - 0
panda/src/express/typedObject.h

@@ -0,0 +1,119 @@
+// Filename: typedObject.h
+// Created by:  drose (11May01)
+// 
+////////////////////////////////////////////////////////////////////
+
+#ifndef TYPEDOBJECT_H
+#define TYPEDOBJECT_H
+
+#include <pandabase.h>
+
+#include "typeHandle.h"
+
+
+////////////////////////////////////////////////////////////////////
+// 	 Class : TypedObject
+// Description : This is an abstract class that all classes which
+//               use TypeHandle, and also provide virtual functions to
+//               support polymorphism, should inherit from.  Each
+//               derived class should define get_type(), which should
+//               return the specific type of the derived class.
+//               Inheriting from this automatically provides support
+//               for is_of_type() and is_exact_type().
+////////////////////////////////////////////////////////////////////
+class EXPCL_PANDAEXPRESS TypedObject {
+public:
+  INLINE TypedObject();
+  INLINE TypedObject(const TypedObject &copy);
+  INLINE void operator = (const TypedObject &copy);
+
+PUBLISHED: 
+  // A virtual destructor is just a good idea.
+  virtual ~TypedObject();
+
+  // Derived classes should override this function to return
+  // get_class_type().
+  virtual TypeHandle get_type() const=0;
+
+  INLINE int get_type_index() const;
+  INLINE bool is_of_type(TypeHandle handle) const;
+  INLINE bool is_exact_type(TypeHandle handle) const;
+
+public:
+  // Derived classes should override this function to call
+  // init_type().  It will only be called in error situations when the
+  // type was for some reason not properly initialized.
+  virtual TypeHandle force_init_type()=0;
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    register_type(_type_handle, "TypedObject");
+  }
+
+private:
+  static TypeHandle _type_handle;
+};
+
+// The DCAST (downcast) macro is defined as a convenience for
+// downcasting from some TypedObject pointer (or a PointerTo).  It's
+// just a normal C++-style downcast, except it first checks get_type()
+// to make sure the downcasting is safe.  If you compile with NDEBUG,
+// this check is removed.
+
+// DCAST will return NULL if the downcasting is unsafe.  If you'd
+// rather it abort out of the function (ala nassertv/nassertr), then
+// see DCAST_INTO_V and DCAST_INTO_R, below.
+
+template<class WantType>
+INLINE WantType *_dcast(WantType *, TypedObject *ptr);
+template<class WantType>
+INLINE const WantType *_dcast(WantType *, const TypedObject *ptr);
+
+// Note: it is important that DCAST not repeat the pointer parameter,
+// since many users of DCAST may want to use the result of a function
+// as the pointer parameter, and it could be terribly confusing and
+// difficult to trace if the function was executed twice.  This
+// happened!
+#define DCAST(want_type, pointer) _dcast((want_type*)0, pointer)
+
+// DCAST_INTO_V and DCAST_INTO_R are similar in purpose to DCAST,
+// except they: (a) automatically assign a variable instead of
+// returning the downcasted pointer, and (b) they immediately return
+// out of the function if the downcasting fails.  DCAST_INTO_V is for
+// use in a void function and returns nothing; DCAST_INTO_R is for use
+// in a non-void function and returns the indicated value.
+
+// Both DCAST_INTO_V and DCAST_INTO_R accept as the first parameter a
+// variable of type (want_type *) or (const want_type *), instead of
+// the name of the type.  This variable will be filled with the new
+// pointer.
+
+
+// _dcast_ref is used to implement DCAST_INTO_V and DCAST_INTO_R.  Its
+// difference from _dcast is that it takes a reference to a pointer as
+// a first parameter.  The main point of this is to shut up the
+// compiler about pointers used before their value is assigned.
+template<class WantType>
+INLINE WantType *_dcast_ref(WantType *&, TypedObject *ptr);
+template<class WantType>
+INLINE const WantType *_dcast_ref(WantType *&, const TypedObject *ptr);
+
+
+#define DCAST_INTO_V(to_pointer, from_pointer) \
+  { \
+    (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
+    nassertv((void *)(to_pointer) != (void *)NULL); \
+  }
+
+#define DCAST_INTO_R(to_pointer, from_pointer, return_value) \
+  { \
+    (to_pointer) = _dcast_ref(to_pointer, from_pointer); \
+    nassertr((void *)(to_pointer) != (void *)NULL, return_value); \
+  }
+
+#include "typedObject.I"
+
+#endif

+ 1 - 1
panda/src/express/typedReferenceCount.h

@@ -7,7 +7,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "referenceCount.h"
 
 ////////////////////////////////////////////////////////////////////

+ 3 - 1
panda/src/glgsg/glGraphicsStateGuardian.cxx

@@ -286,7 +286,9 @@ reset() {
   _light_info = new LightInfo[_max_lights];
 
   // Set up the clip plane id map
-  glGetIntegerv(GL_MAX_CLIP_PLANES, &_max_clip_planes);
+  GLint max_clip_planes;
+  glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
+  _max_clip_planes = max_clip_planes;
   _available_clip_plane_ids = PTA(PlaneNode*)(_max_clip_planes);
   _clip_plane_enabled = new bool[_max_clip_planes];
   _cur_clip_plane_enabled = new bool[_max_clip_planes];

+ 1 - 1
panda/src/glxdisplay/glxDisplay.h

@@ -7,7 +7,7 @@
 #define GLXDISPLAY_H
 
 #include <pandabase.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 
 #include <X11/Xlib.h>
 

+ 1 - 1
panda/src/graph/arcChain.h

@@ -14,7 +14,7 @@
 #include <pointerTo.h>
 #include <referenceCount.h>
 #include <notify.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ////////////////////////////////////////////////////////////////////
 //       Class : ArcChain

+ 1 - 1
panda/src/graph/boundedObject.h

@@ -10,7 +10,7 @@
 
 #include "boundingVolume.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <pointerTo.h>
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 1
panda/src/graph/dftraverser.h

@@ -11,7 +11,7 @@
 #include "node.h"
 #include "nodeRelation.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ///////////////////////////////////////////////////////////////////
 // 	 Class : DFTraverser

+ 1 - 1
panda/src/graph/graphReducer.h

@@ -10,7 +10,7 @@
 
 #include "nodeRelation.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ///////////////////////////////////////////////////////////////////
 // 	 Class : GraphReducer

+ 1 - 1
panda/src/graph/wrt.h

@@ -12,7 +12,7 @@
 #include "node.h"
 #include "config_graph.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 class Node;
 

+ 1 - 1
panda/src/light/light.h

@@ -11,7 +11,7 @@
 ////////////////////////////////////////////////////////////////////
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <graphicsStateGuardian.h>
 #include <referenceCount.h>
 

+ 1 - 1
panda/src/linmath/lmatrix3.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 #include <math.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <datagram.h>
 #include <datagramIterator.h>
 #include <notify.h>

+ 1 - 1
panda/src/linmath/lmatrix4.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 #include <math.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <datagram.h>
 #include <datagramIterator.h>
 #include <indent.h>

+ 1 - 1
panda/src/linmath/lvecBase2.h

@@ -7,7 +7,7 @@
 #define LVECBASE2_H
 
 #include <pandabase.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <notify.h>
 #include <datagram.h>
 #include <datagramIterator.h>

+ 1 - 1
panda/src/linmath/lvecBase3.h

@@ -7,7 +7,7 @@
 #define LVECBASE3_H
 
 #include <pandabase.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <notify.h>
 #include <datagram.h>
 #include <datagramIterator.h>

+ 1 - 1
panda/src/linmath/lvecBase4.h

@@ -7,7 +7,7 @@
 #define LVECBASE4_H
 
 #include <pandabase.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <notify.h>
 #include <datagram.h>
 #include <datagramIterator.h>

+ 1 - 1
panda/src/loader/loaderFileType.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <node.h>
 #include <pt_Node.h>
 #include <filename.h>

+ 1 - 1
panda/src/mathutil/boundingVolume.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedReferenceCount.h>
 
 class BoundingSphere;

+ 1 - 1
panda/src/parametrics/parametricCurveDrawer.h

@@ -12,7 +12,7 @@
 #include <node.h>
 #include <vector_PT_NodeRelation.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ////////////////////////////////////////////////////////////////////
 // 	 Class : ParametricCurveDrawer

+ 1 - 1
panda/src/pnmimage/pnmFileType.h

@@ -10,7 +10,7 @@
 
 #include "pnmimage_base.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedWritable.h>
 
 class PNMReader;

+ 1 - 1
panda/src/pnmimage/pnmFileTypeRegistry.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 class PNMFileType;
 

+ 1 - 1
panda/src/pnmimage/pnmImageHeader.h

@@ -10,7 +10,7 @@
 
 #include "pnmimage_base.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <filename.h>
 
 class PNMFileType;

+ 1 - 1
panda/src/putil/bitMask.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include "numeric_types.h"
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "indent.h"
 
 

+ 1 - 1
panda/src/putil/config_util.cxx

@@ -5,7 +5,7 @@
 
 #include "config_util.h"
 #include "clockObject.h"
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "configurable.h"
 #include "namable.h"
 #include "referenceCount.h"

+ 1 - 1
panda/src/putil/configurable.h

@@ -12,7 +12,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 
 ////////////////////////////////////////////////////////////////////
 // Defines

+ 1 - 1
panda/src/putil/factoryBase.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "typedReferenceCount.h"
 #include "factoryParams.h"
 

+ 1 - 1
panda/src/putil/factoryParams.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "typedReferenceCount.h"
 #include "pointerTo.h"
 #include "factoryParam.h"

+ 1 - 1
panda/src/putil/globalPointerRegistry.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include "typeHandle.h"
+#include "typedObject.h"
 
 #include <map>
 

+ 1 - 1
panda/src/putil/test_types.cxx

@@ -3,7 +3,7 @@
 // 
 ////////////////////////////////////////////////////////////////////
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "pointerTo.h"
 #include "pointerToArray.h"
 #include "referenceCount.h"

+ 1 - 1
panda/src/putil/typedWritable.h

@@ -5,7 +5,7 @@
 #ifndef __TYPED_WRITABLE_
 #define __TYPED_WRITABLE_
 
-#include "typeHandle.h"
+#include "typedObject.h"
 #include "writable.h"
 #include "vector_typedWritable.h"
 

+ 1 - 1
panda/src/putil/writable.h

@@ -6,7 +6,7 @@
 #define __WRITABLE_
 
 #include "vector_writable.h"
-#include "typeHandle.h"
+#include "typedObject.h"
 
 class BamWriter;
 class Datagram;

+ 1 - 1
panda/src/sgattrib/attribTraverser.cxx

@@ -15,7 +15,7 @@
 #include <geomNode.h>
 #include <dftraverser.h>
 #include <allAttributesWrapper.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ////////////////////////////////////////////////////////////////////
 //     Function: AttribTraverser::constructor

+ 1 - 1
panda/src/sgmanip/findApproxPath.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 #include <string>
 #include <vector>

+ 1 - 1
panda/src/sgraph/renderTraverser.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include <arcChain.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedReferenceCount.h>
 #include <notify.h>
 

+ 1 - 1
panda/src/sgraphutil/frustumCullTraverser.h

@@ -10,7 +10,7 @@
 
 #include <node.h>
 #include <nodeRelation.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <geometricBoundingVolume.h>
 #include <graphicsStateGuardian.h>
 #include <arcChain.h>

+ 1 - 1
panda/src/sgraphutil/sceneGraphAnalyzer.h

@@ -8,7 +8,7 @@
 
 #include <pandabase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <renderRelation.h>
 
 #include <map>

+ 1 - 1
panda/src/sgraphutil/sceneGraphReducer.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 
 #include <graphReducer.h>
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <pointerTo.h>
 #include <transformTransition.h>
 #include <colorTransition.h>

+ 1 - 1
pandatool/src/eggcharbase/eggBackPointer.h

@@ -8,7 +8,7 @@
 
 #include <pandatoolbase.h>
 
-#include <typeHandle.h>
+#include <typedObject.h>
 
 ////////////////////////////////////////////////////////////////////
 // 	 Class : EggBackPointer

+ 1 - 1
pandatool/src/flt/fltRecord.h

@@ -11,7 +11,7 @@
 #include "fltOpcode.h"
 #include "fltError.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedReferenceCount.h>
 #include <pointerTo.h>
 

+ 1 - 1
pandatool/src/lwo/iffChunk.h

@@ -10,7 +10,7 @@
 
 #include "iffId.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <typedReferenceCount.h>
 
 class IffInputFile;

+ 1 - 1
pandatool/src/lwo/iffInputFile.h

@@ -11,7 +11,7 @@
 #include "iffId.h"
 #include "iffChunk.h"
 
-#include <typeHandle.h>
+#include <typedObject.h>
 #include <pointerTo.h>
 
 class Datagram;