Browse Source

prepare to implement AuxSceneData

David Rose 21 years ago
parent
commit
d31b91e758

+ 3 - 0
panda/src/pgraph/Sources.pp

@@ -12,6 +12,7 @@
     accumulatedAttribs.I accumulatedAttribs.h \
     alphaTestAttrib.I alphaTestAttrib.h \  
     ambientLight.I ambientLight.h \
+    auxSceneData.I auxSceneData.h \
     bamFile.I bamFile.h \
     billboardEffect.I billboardEffect.h \
     binCullHandler.I binCullHandler.h \
@@ -103,6 +104,7 @@
     accumulatedAttribs.cxx \
     alphaTestAttrib.cxx \  
     ambientLight.cxx \
+    auxSceneData.cxx \
     bamFile.cxx \
     billboardEffect.cxx \
     binCullHandler.cxx \
@@ -192,6 +194,7 @@
     accumulatedAttribs.I accumulatedAttribs.h \
     alphaTestAttrib.I alphaTestAttrib.h \  
     ambientLight.I ambientLight.h \
+    auxSceneData.I auxSceneData.h \
     bamFile.I bamFile.h \
     billboardEffect.I billboardEffect.h \
     binCullHandler.I binCullHandler.h \

+ 28 - 0
panda/src/pgraph/auxSceneData.I

@@ -0,0 +1,28 @@
+// Filename: auxSceneData.I
+// Created by:  drose (27Sep04)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: AuxSceneData::Constructor
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE AuxSceneData::
+AuxSceneData() {
+}
+

+ 21 - 0
panda/src/pgraph/auxSceneData.cxx

@@ -0,0 +1,21 @@
+// Filename: auxSceneData.cxx
+// Created by:  drose (27Sep04)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#include "auxSceneData.h"
+
+TypeHandle AuxSceneData::_type_handle;

+ 62 - 0
panda/src/pgraph/auxSceneData.h

@@ -0,0 +1,62 @@
+// Filename: auxSceneData.h
+// Created by:  drose (27Sep04)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001 - 2004, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://etc.cmu.edu/panda3d/docs/license/ .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef AUXSCENEDATA_H
+#define AUXSCENEDATA_H
+
+#include "pandabase.h"
+
+#include "typedReferenceCount.h"
+
+////////////////////////////////////////////////////////////////////
+//       Class : AuxSceneData
+// Description : This is a base class for a generic data structure
+//               that can be attached per-instance to the camera, to
+//               store per-instance data that must be preserved over
+//               multiple frames.
+//
+//               In particular, this is used to implement the
+//               FadeLODNode, which must remember during traversal at
+//               what point it is in the fade, separately for each
+//               instance and for each camera.
+////////////////////////////////////////////////////////////////////
+class EXPCL_PANDA AuxSceneData : public TypedReferenceCount {
+public:
+  INLINE AuxSceneData();
+  
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    TypedReferenceCount::init_type();
+    register_type(_type_handle, "AuxSceneData",
+                  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 "auxSceneData.I"
+
+#endif

+ 5 - 0
panda/src/pgraph/camera.h

@@ -29,6 +29,7 @@
 #include "pmap.h"
 
 class DisplayRegion;
+class AuxSceneData;
 
 ////////////////////////////////////////////////////////////////////
 //       Class : Camera
@@ -76,6 +77,10 @@ PUBLISHED:
   bool has_tag_state(const string &tag_state) const;
   CPT(RenderState) get_tag_state(const string &tag_state) const;
 
+public:
+  //  void set_aux_scene_data(const NodePath &node_path, AuxSceneData *data);
+  //  AuxSceneData *get_aux_scene_data(const NodePath &node_path) const;
+
 private:
   void add_display_region(DisplayRegion *display_region);
   void remove_display_region(DisplayRegion *display_region);

+ 1 - 0
panda/src/pgraph/colorScaleAttrib.cxx

@@ -23,6 +23,7 @@
 #include "bamWriter.h"
 #include "datagram.h"
 #include "datagramIterator.h"
+#include "config_pgraph.h"
 
 TypeHandle ColorScaleAttrib::_type_handle;
 

+ 2 - 0
panda/src/pgraph/config_pgraph.cxx

@@ -20,6 +20,7 @@
 
 #include "alphaTestAttrib.h"
 #include "ambientLight.h"
+#include "auxSceneData.h"
 #include "billboardEffect.h"
 #include "camera.h"
 #include "clipPlaneAttrib.h"
@@ -183,6 +184,7 @@ init_libpgraph() {
 
   AlphaTestAttrib::init_type();
   AmbientLight::init_type();
+  AuxSceneData::init_type();
   BillboardEffect::init_type();
   Camera::init_type();
   ClipPlaneAttrib::init_type();

+ 1 - 0
panda/src/pgraph/lodNode.cxx

@@ -19,6 +19,7 @@
 #include "lodNode.h"
 #include "cullTraverserData.h"
 #include "cullTraverser.h"
+#include "config_pgraph.h"
 
 TypeHandle LODNode::_type_handle;
 

+ 1 - 0
panda/src/pgraph/polylightEffect.cxx

@@ -24,6 +24,7 @@
 #include "pmap.h"
 #include "colorScaleAttrib.h"
 #include "cullTraverserData.h"
+#include "cullTraverser.h"
 
 #include <math.h>
 

+ 1 - 0
panda/src/pgraph/renderAttrib.cxx

@@ -19,6 +19,7 @@
 #include "renderAttrib.h"
 #include "bamReader.h"
 #include "indent.h"
+#include "config_pgraph.h"
 
 RenderAttrib::Attribs *RenderAttrib::_attribs = NULL;
 TypeHandle RenderAttrib::_type_handle;

+ 1 - 0
panda/src/pgraph/renderEffect.cxx

@@ -19,6 +19,7 @@
 #include "renderEffect.h"
 #include "bamReader.h"
 #include "indent.h"
+#include "config_pgraph.h"
 
 RenderEffect::Effects *RenderEffect::_effects = NULL;
 TypeHandle RenderEffect::_type_handle;

+ 0 - 1
panda/src/pgraph/textureAttrib.cxx

@@ -781,7 +781,6 @@ fillin(DatagramIterator &scan, BamReader *manager) {
     manager->read_pointer(scan);
   }
   else {
-    pgraph_cat.debug() << "came here too\n";
     // read the boolean if _off_all_stages
     _off_all_stages = scan.get_bool();
     // read the number of off_stages