00001 // Filename: txaFile.h 00002 // Created by: drose (30Nov00) 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 TXAFILE_H 00020 #define TXAFILE_H 00021 00022 #include <pandatoolbase.h> 00023 00024 #include "txaLine.h" 00025 00026 #include <filename.h> 00027 #include <vector_string.h> 00028 00029 #include "pvector.h" 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Class : TxaFile 00033 // Description : This represents the .txa file (usually textures.txa) 00034 // that contains the user instructions for resizing, 00035 // grouping, etc. the various textures. 00036 //////////////////////////////////////////////////////////////////// 00037 class TxaFile { 00038 public: 00039 TxaFile(); 00040 00041 bool read(Filename filename); 00042 00043 bool match_egg(EggFile *egg_file) const; 00044 bool match_texture(TextureImage *texture) const; 00045 00046 void write(ostream &out) const; 00047 00048 private: 00049 bool parse_group_line(const vector_string &words); 00050 bool parse_palette_line(const vector_string &words); 00051 bool parse_margin_line(const vector_string &words); 00052 bool parse_coverage_line(const vector_string &words); 00053 bool parse_imagetype_line(const vector_string &words); 00054 bool parse_shadowtype_line(const vector_string &words); 00055 bool parse_round_line(const vector_string &words); 00056 bool parse_remap_line(const vector_string &words); 00057 bool parse_remapchar_line(const vector_string &words); 00058 00059 typedef pvector<TxaLine> Lines; 00060 Lines _lines; 00061 }; 00062 00063 #endif 00064