Panda3D

txaFile.h

00001 // Filename: txaFile.h
00002 // Created by:  drose (30Nov00)
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 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 //       Class : TxaFile
00029 // Description : This represents the .txa file (usually textures.txa)
00030 //               that contains the user instructions for resizing,
00031 //               grouping, etc. the various textures.
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 
 All Classes Functions Variables Enumerations