浏览代码

move get_gsg() to StandardMunger

David Rose 20 年之前
父节点
当前提交
8b7d141666

+ 11 - 0
panda/src/display/standardMunger.I

@@ -16,3 +16,14 @@
 //
 //
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
+
+////////////////////////////////////////////////////////////////////
+//     Function: StandardMunger::get_gsg
+//       Access: Public
+//  Description: Returns a pointer to the GSG that created this
+//               munger.
+////////////////////////////////////////////////////////////////////
+INLINE GraphicsStateGuardian *StandardMunger::
+get_gsg() const {
+  return _gsg;
+}

+ 1 - 1
panda/src/display/standardMunger.cxx

@@ -33,7 +33,7 @@ TypeHandle StandardMunger::_type_handle;
 //               we might as well convert it as we munge).
 //               we might as well convert it as we munge).
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 StandardMunger::
 StandardMunger::
-StandardMunger(const GraphicsStateGuardianBase *gsg, const RenderState *state,
+StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state,
                int num_components,
                int num_components,
                StandardMunger::NumericType numeric_type,
                StandardMunger::NumericType numeric_type,
                StandardMunger::Contents contents) :
                StandardMunger::Contents contents) :

+ 4 - 2
panda/src/display/standardMunger.h

@@ -38,11 +38,13 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 class EXPCL_PANDA StandardMunger : public StateMunger {
 class EXPCL_PANDA StandardMunger : public StateMunger {
 public:
 public:
-  StandardMunger(const GraphicsStateGuardianBase *gsg, const RenderState *state,
+  StandardMunger(GraphicsStateGuardianBase *gsg, const RenderState *state,
                  int num_components, NumericType numeric_type,
                  int num_components, NumericType numeric_type,
                  Contents contents);
                  Contents contents);
   virtual ~StandardMunger();
   virtual ~StandardMunger();
 
 
+  INLINE GraphicsStateGuardian *get_gsg() const;
+
 protected:
 protected:
   virtual CPT(qpGeomVertexData) munge_data_impl(const qpGeomVertexData *data);
   virtual CPT(qpGeomVertexData) munge_data_impl(const qpGeomVertexData *data);
   virtual int compare_to_impl(const qpGeomMunger *other) const;
   virtual int compare_to_impl(const qpGeomMunger *other) const;
@@ -54,7 +56,7 @@ private:
   int _num_components;
   int _num_components;
   NumericType _numeric_type;
   NumericType _numeric_type;
   Contents _contents;
   Contents _contents;
-  CPT(GraphicsStateGuardian) _gsg;
+  PT(GraphicsStateGuardian) _gsg;
   CPT(RenderModeAttrib) _render_mode;
   CPT(RenderModeAttrib) _render_mode;
 
 
   bool _munge_color;
   bool _munge_color;

+ 0 - 12
panda/src/glstuff/glGeomMunger_src.I

@@ -25,23 +25,11 @@
 INLINE CLP(GeomMunger)::
 INLINE CLP(GeomMunger)::
 CLP(GeomMunger)(GraphicsStateGuardian *gsg, const RenderState *state) :
 CLP(GeomMunger)(GraphicsStateGuardian *gsg, const RenderState *state) :
   StandardMunger(gsg, state, 4, NT_uint8, C_color),
   StandardMunger(gsg, state, 4, NT_uint8, C_color),
-  _gsg(gsg),
   _texture(state->get_texture()),
   _texture(state->get_texture()),
   _tex_gen(state->get_tex_gen())
   _tex_gen(state->get_tex_gen())
 {
 {
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: CLP(GeomMunger)::get_gsg
-//       Access: Public
-//  Description: Returns a pointer to the GSG that created this
-//               munger.
-////////////////////////////////////////////////////////////////////
-INLINE GraphicsStateGuardian *CLP(GeomMunger)::
-get_gsg() const {
-  return _gsg;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CLP(GeomMunger)::operator new
 //     Function: CLP(GeomMunger)::operator new
 //       Access: Public
 //       Access: Public

+ 0 - 2
panda/src/glstuff/glGeomMunger_src.h

@@ -36,8 +36,6 @@ public:
   INLINE CLP(GeomMunger)(GraphicsStateGuardian *gsg, const RenderState *state);
   INLINE CLP(GeomMunger)(GraphicsStateGuardian *gsg, const RenderState *state);
   virtual ~CLP(GeomMunger)();
   virtual ~CLP(GeomMunger)();
 
 
-  INLINE GraphicsStateGuardian *get_gsg() const;
-
 protected:
 protected:
   virtual CPT(qpGeomVertexFormat) munge_format_impl(const qpGeomVertexFormat *orig,
   virtual CPT(qpGeomVertexFormat) munge_format_impl(const qpGeomVertexFormat *orig,
                                                     const qpGeomVertexAnimationSpec &animation);
                                                     const qpGeomVertexAnimationSpec &animation);