Panda3D
|
00001 // Filename: fltExternalReference.h 00002 // Created by: drose (30Aug00) 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 #ifndef FLTEXTERNALREFERENCE_H 00016 #define FLTEXTERNALREFERENCE_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltBead.h" 00021 00022 #include "filename.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : FltExternalReference 00026 // Description : An external reference to another flt file (possibly 00027 // to a specific bead within the flt file). 00028 //////////////////////////////////////////////////////////////////// 00029 class FltExternalReference : public FltBead { 00030 public: 00031 FltExternalReference(FltHeader *header); 00032 00033 virtual void apply_converted_filenames(); 00034 virtual void output(ostream &out) const; 00035 00036 enum Flags { 00037 F_color_palette_override = 0x80000000, 00038 F_material_palette_override = 0x40000000, 00039 F_texture_palette_override = 0x20000000, 00040 F_line_style_palette_override = 0x10000000, 00041 F_sound_palette_override = 0x08000000, 00042 F_light_palette_override = 0x04000000 00043 }; 00044 00045 string _orig_filename; 00046 Filename _converted_filename; 00047 string _bead_id; 00048 int _flags; 00049 00050 Filename get_ref_filename() const; 00051 void set_ref_filename(const Filename &filename); 00052 00053 protected: 00054 virtual bool extract_record(FltRecordReader &reader); 00055 virtual bool build_record(FltRecordWriter &writer) const; 00056 00057 public: 00058 virtual TypeHandle get_type() const { 00059 return get_class_type(); 00060 } 00061 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00062 static TypeHandle get_class_type() { 00063 return _type_handle; 00064 } 00065 static void init_type() { 00066 FltBead::init_type(); 00067 register_type(_type_handle, "FltExternalReference", 00068 FltBead::get_class_type()); 00069 } 00070 00071 private: 00072 static TypeHandle _type_handle; 00073 }; 00074 00075 #endif 00076 00077