00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TXAFILE_H
00016 #define TXAFILE_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include "txaLine.h"
00021
00022 #include "filename.h"
00023 #include "vector_string.h"
00024
00025 #include "pvector.h"
00026
00027
00028
00029
00030
00031
00032
00033 class TxaFile {
00034 public:
00035 TxaFile();
00036
00037 bool read(istream &in, const string &filename);
00038
00039 bool match_egg(EggFile *egg_file) const;
00040 bool match_texture(TextureImage *texture) const;
00041
00042 void write(ostream &out) const;
00043
00044 private:
00045 static int get_line_or_semicolon(istream &in, string &line);
00046
00047 bool parse_group_line(const vector_string &words);
00048 bool parse_palette_line(const vector_string &words);
00049 bool parse_margin_line(const vector_string &words);
00050 bool parse_background_line(const vector_string &words);
00051 bool parse_coverage_line(const vector_string &words);
00052 bool parse_powertwo_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_cutout_line(const vector_string &words);
00058 bool parse_textureswap_line(const vector_string &words);
00059
00060 typedef pvector<TxaLine> Lines;
00061 Lines _lines;
00062 };
00063
00064 #endif
00065