diff --git a/panda/src/pgraph/Sources.pp b/panda/src/pgraph/Sources.pp index e8c03a2f24..fc2a094d24 100644 --- a/panda/src/pgraph/Sources.pp +++ b/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 \ diff --git a/panda/src/pgraph/auxSceneData.I b/panda/src/pgraph/auxSceneData.I new file mode 100644 index 0000000000..6b51be1dd8 --- /dev/null +++ b/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 +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////// +// Function: AuxSceneData::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE AuxSceneData:: +AuxSceneData() { +} + diff --git a/panda/src/pgraph/auxSceneData.cxx b/panda/src/pgraph/auxSceneData.cxx new file mode 100644 index 0000000000..5ae5f1474e --- /dev/null +++ b/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 +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#include "auxSceneData.h" + +TypeHandle AuxSceneData::_type_handle; diff --git a/panda/src/pgraph/auxSceneData.h b/panda/src/pgraph/auxSceneData.h new file mode 100644 index 0000000000..f5f9bf44ce --- /dev/null +++ b/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 +// panda3d-general@lists.sourceforge.net . +// +//////////////////////////////////////////////////////////////////// + +#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 diff --git a/panda/src/pgraph/camera.h b/panda/src/pgraph/camera.h index 239288d14d..9a21dc7531 100644 --- a/panda/src/pgraph/camera.h +++ b/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); diff --git a/panda/src/pgraph/colorScaleAttrib.cxx b/panda/src/pgraph/colorScaleAttrib.cxx index 65de44c552..8e5a307f12 100644 --- a/panda/src/pgraph/colorScaleAttrib.cxx +++ b/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; diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index cb55858b0c..06a0332630 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/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(); diff --git a/panda/src/pgraph/lodNode.cxx b/panda/src/pgraph/lodNode.cxx index 26b24e541a..9a272efea9 100644 --- a/panda/src/pgraph/lodNode.cxx +++ b/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; diff --git a/panda/src/pgraph/polylightEffect.cxx b/panda/src/pgraph/polylightEffect.cxx index d62fd235f7..0612127349 100755 --- a/panda/src/pgraph/polylightEffect.cxx +++ b/panda/src/pgraph/polylightEffect.cxx @@ -24,6 +24,7 @@ #include "pmap.h" #include "colorScaleAttrib.h" #include "cullTraverserData.h" +#include "cullTraverser.h" #include diff --git a/panda/src/pgraph/renderAttrib.cxx b/panda/src/pgraph/renderAttrib.cxx index 68a325ae18..54774ce12f 100644 --- a/panda/src/pgraph/renderAttrib.cxx +++ b/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; diff --git a/panda/src/pgraph/renderEffect.cxx b/panda/src/pgraph/renderEffect.cxx index b99b1eeaee..66fc923aaf 100644 --- a/panda/src/pgraph/renderEffect.cxx +++ b/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; diff --git a/panda/src/pgraph/textureAttrib.cxx b/panda/src/pgraph/textureAttrib.cxx index fff6c69ad4..086c19dadf 100644 --- a/panda/src/pgraph/textureAttrib.cxx +++ b/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