Panda3D

tinyGeomMunger.cxx

00001 // Filename: tinyGeomMunger.cxx
00002 // Created by:  drose (29Apr08)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "tinyGeomMunger.h"
00016 #include "dcast.h"
00017 
00018 TypeHandle TinyGeomMunger::_type_handle;
00019 
00020 ALLOC_DELETED_CHAIN_DEF(TinyGeomMunger);
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //     Function: TinyGeomMunger::Constructor
00024 //       Access: Public
00025 //  Description:
00026 ////////////////////////////////////////////////////////////////////
00027 TinyGeomMunger::
00028 TinyGeomMunger(GraphicsStateGuardian *gsg, const RenderState *state) :
00029   StandardMunger(gsg, state, 4, NT_uint8, C_color)
00030 {
00031   // The TinyGSG can apply the color and color scale at runtime.
00032   //  _munge_color = false;
00033   //  _munge_color_scale = false;
00034 }
00035 
00036 ////////////////////////////////////////////////////////////////////
00037 //     Function: TinyGeomMunger::Destructor
00038 //       Access: Public, Virtual
00039 //  Description: 
00040 ////////////////////////////////////////////////////////////////////
00041 TinyGeomMunger::
00042 ~TinyGeomMunger() {
00043 }
00044 
00045 ////////////////////////////////////////////////////////////////////
00046 //     Function: TinyGeomMunger::munge_format_impl
00047 //       Access: Protected, Virtual
00048 //  Description: Given a source GeomVertexFormat, converts it if
00049 //               necessary to the appropriate format for rendering.
00050 ////////////////////////////////////////////////////////////////////
00051 CPT(GeomVertexFormat) TinyGeomMunger::
00052 munge_format_impl(const GeomVertexFormat *orig,
00053                   const GeomVertexAnimationSpec &animation) {
00054   PT(GeomVertexFormat) new_format = new GeomVertexFormat(*orig);
00055   new_format->set_animation(animation);
00056 
00057   CPT(GeomVertexFormat) format = GeomVertexFormat::register_format(new_format);
00058 
00059   return format;
00060 }
00061 
00062 ////////////////////////////////////////////////////////////////////
00063 //     Function: TinyGeomMunger::premunge_format_impl
00064 //       Access: Protected, Virtual
00065 //  Description: Given a source GeomVertexFormat, converts it if
00066 //               necessary to the appropriate format for rendering.
00067 ////////////////////////////////////////////////////////////////////
00068 CPT(GeomVertexFormat) TinyGeomMunger::
00069 premunge_format_impl(const GeomVertexFormat *orig) {
00070   return orig;
00071 }
00072 
00073 ////////////////////////////////////////////////////////////////////
00074 //     Function: TinyGeomMunger::compare_to_impl
00075 //       Access: Protected, Virtual
00076 //  Description: Called to compare two GeomMungers who are known to be
00077 //               of the same type, for an apples-to-apples comparison.
00078 //               This will never be called on two pointers of a
00079 //               different type.
00080 ////////////////////////////////////////////////////////////////////
00081 int TinyGeomMunger::
00082 compare_to_impl(const GeomMunger *other) const {
00083   return StandardMunger::compare_to_impl(other);
00084 }
00085 
00086 ////////////////////////////////////////////////////////////////////
00087 //     Function: TinyGeomMunger::geom_compare_to_impl
00088 //       Access: Protected, Virtual
00089 //  Description: Called to compare two GeomMungers who are known to be
00090 //               of the same type, for an apples-to-apples comparison.
00091 //               This will never be called on two pointers of a
00092 //               different type.
00093 ////////////////////////////////////////////////////////////////////
00094 int TinyGeomMunger::
00095 geom_compare_to_impl(const GeomMunger *other) const {
00096   return StandardMunger::compare_to_impl(other);
00097 }
 All Classes Functions Variables Enumerations