Panda3D
|
00001 // Filename: fltCopy.h 00002 // Created by: drose (01Nov00) 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 FLTCOPY_H 00016 #define FLTCOPY_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "cvsCopy.h" 00021 00022 #include "dSearchPath.h" 00023 #include "pointerTo.h" 00024 00025 #include "pset.h" 00026 00027 class FltRecord; 00028 class FltTexture; 00029 class FltExternalReference; 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Class : FltCopy 00033 // Description : A program to copy Multigen .flt files into the cvs 00034 // tree. It copies the base file plus all externally 00035 // referenced files as well as all textures. 00036 //////////////////////////////////////////////////////////////////// 00037 class FltCopy : public CVSCopy { 00038 public: 00039 FltCopy(); 00040 00041 void run(); 00042 00043 protected: 00044 virtual bool copy_file(const Filename &source, const Filename &dest, 00045 CVSSourceDirectory *dir, void *extra_data, 00046 bool new_file); 00047 00048 private: 00049 enum FileType { 00050 FT_flt, 00051 FT_texture 00052 }; 00053 00054 class ExtraData { 00055 public: 00056 FileType _type; 00057 FltTexture *_texture; 00058 }; 00059 00060 bool copy_flt_file(const Filename &source, const Filename &dest, 00061 CVSSourceDirectory *dir); 00062 bool copy_texture(const Filename &source, const Filename &dest, 00063 CVSSourceDirectory *dir, FltTexture *tex, 00064 bool new_file); 00065 00066 00067 typedef pset< PT(FltExternalReference) > Refs; 00068 typedef pset< PT(FltTexture) > Textures; 00069 00070 void scan_flt(FltRecord *record, Refs &refs, Textures &textures); 00071 }; 00072 00073 #endif