00001 // Filename: fltExternalReference.h 00002 // Created by: drose (30Aug00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef FLTEXTERNALREFERENCE_H 00020 #define FLTEXTERNALREFERENCE_H 00021 00022 #include "pandatoolbase.h" 00023 00024 #include "fltBead.h" 00025 00026 #include "filename.h" 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : FltExternalReference 00030 // Description : An external reference to another flt file (possibly 00031 // to a specific bead within the flt file). 00032 //////////////////////////////////////////////////////////////////// 00033 class FltExternalReference : public FltBead { 00034 public: 00035 FltExternalReference(FltHeader *header); 00036 00037 virtual void apply_converted_filenames(); 00038 virtual void output(ostream &out) const; 00039 00040 enum Flags { 00041 F_color_palette_override = 0x80000000, 00042 F_material_palette_override = 0x40000000, 00043 F_texture_palette_override = 0x20000000, 00044 F_line_style_palette_override = 0x10000000, 00045 F_sound_palette_override = 0x08000000, 00046 F_light_palette_override = 0x04000000 00047 }; 00048 00049 string _orig_filename; 00050 Filename _converted_filename; 00051 string _bead_id; 00052 int _flags; 00053 00054 Filename get_ref_filename() const; 00055 void set_ref_filename(const Filename &filename); 00056 00057 protected: 00058 virtual bool extract_record(FltRecordReader &reader); 00059 virtual bool build_record(FltRecordWriter &writer) const; 00060 00061 public: 00062 virtual TypeHandle get_type() const { 00063 return get_class_type(); 00064 } 00065 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00066 static TypeHandle get_class_type() { 00067 return _type_handle; 00068 } 00069 static void init_type() { 00070 FltBead::init_type(); 00071 register_type(_type_handle, "FltExternalReference", 00072 FltBead::get_class_type()); 00073 } 00074 00075 private: 00076 static TypeHandle _type_handle; 00077 }; 00078 00079 #endif 00080 00081