00001 // /////////////////////////////////////////////////////////////////////////// 00002 // xrb_engine2_compound.hpp by Victor Dods, created 2005/06/28 00003 // /////////////////////////////////////////////////////////////////////////// 00004 // Unless a different license was explicitly granted in writing by the 00005 // copyright holder (Victor Dods), this software is freely distributable under 00006 // the terms of the GNU General Public License, version 2. Any works deriving 00007 // from this work must also be released under the GNU GPL. See the included 00008 // file LICENSE for details. 00009 // /////////////////////////////////////////////////////////////////////////// 00010 00011 #if !defined(_XRB_ENGINE2_COMPOUND_HPP_) 00012 #define _XRB_ENGINE2_COMPOUND_HPP_ 00013 00014 #include "xrb.hpp" 00015 00016 #include "xrb_engine2_object.hpp" 00017 #include "xrb_gltexture.hpp" 00018 #include "xrb_resourcelibrary.hpp" 00019 00020 namespace Xrb 00021 { 00022 00023 namespace Engine2 00024 { 00025 00026 struct Polygon; 00027 00028 class Compound : public Object 00029 { 00030 public: 00031 00032 virtual ~Compound (); 00033 00034 // /////////////////////////////////////////////////////////////////// 00035 // public serialization functions 00036 // /////////////////////////////////////////////////////////////////// 00037 00038 // static Compound *Create (std::string const &compound_path); 00039 static Compound *Create (Serializer &serializer); 00040 // makes calls to WriteClassSpecific for this and all superclasses 00041 virtual void Write (Serializer &serializer) const; 00042 00043 // /////////////////////////////////////////////////////////////////// 00044 // public Object interface methods 00045 // /////////////////////////////////////////////////////////////////// 00046 00047 // draws the compound 00048 virtual void Draw ( 00049 DrawData const &draw_data, 00050 Float alpha_mask) const; 00051 00052 protected: 00053 00054 // protected constructor so you must use Create() 00055 Compound (); 00056 00057 // /////////////////////////////////////////////////////////////////// 00058 // protected serialization functions 00059 // /////////////////////////////////////////////////////////////////// 00060 00061 // does the guts of serializing reading for this class (doesn't read 00062 // the object subtype) 00063 void ReadClassSpecific (Serializer &serializer); 00064 // does the guts of serializing writing for this class (doesn't write 00065 // the object subtype) 00066 void WriteClassSpecific (Serializer &serializer) const; 00067 00068 // /////////////////////////////////////////////////////////////////// 00069 // protected Object interface methods 00070 // /////////////////////////////////////////////////////////////////// 00071 00072 virtual void CalculateRadius (QuadTreeType quad_tree_type) const; 00073 00074 // /////////////////////////////////////////////////////////////////// 00075 00076 // copies the properties of the given object (compound) to this compound 00077 void CloneProperties (Object const *object); 00078 00079 // move this geometry into CompoundGeometry (or some such) 00080 // so that it can be ResourceLibrary'd 00081 00082 Uint32 m_vertex_count; 00083 FloatVector2 *m_vertex_array; 00084 Uint32 m_polygon_count; 00085 Polygon *m_polygon_array; 00086 }; // end of class Engine2::Compound 00087 00088 } // end of Engine2 00089 00090 } // end of namespace Xrb 00091 00092 #endif // !defined(_XRB_ENGINE2_COMPOUND_HPP_) 00093