Panda3D
|
00001 // Filename: eggTextureCards.h 00002 // Created by: drose (21Feb01) 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 EGGTEXTURECARDS_H 00016 #define EGGTEXTURECARDS_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "eggWriter.h" 00021 #include "eggTexture.h" 00022 #include "luse.h" 00023 #include "vector_string.h" 00024 00025 class EggVertexPool; 00026 class EggVertex; 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Class : EggTextureCards 00030 // Description : Generates an egg file featuring a number of polygons, 00031 // one for each named texture. This is a support 00032 // program for getting textures through egg-palettize. 00033 //////////////////////////////////////////////////////////////////// 00034 class EggTextureCards : public EggWriter { 00035 public: 00036 EggTextureCards(); 00037 00038 protected: 00039 virtual bool handle_args(Args &args); 00040 00041 static bool dispatch_wrap_mode(const string &opt, const string &arg, void *var); 00042 static bool dispatch_filter_type(const string &opt, const string &arg, void *var); 00043 static bool dispatch_quality_level(const string &opt, const string &arg, void *var); 00044 static bool dispatch_format(const string &opt, const string &arg, void *var); 00045 00046 private: 00047 bool scan_texture(const Filename &filename, LVecBase4d &geometry, 00048 int &num_channels); 00049 void make_vertices(const LPoint4d &geometry, EggVertexPool *vpool, 00050 EggVertex *&v1, EggVertex *&v2, EggVertex *&v3, EggVertex *&v4); 00051 00052 public: 00053 void run(); 00054 00055 LVecBase4d _polygon_geometry; 00056 LVecBase2d _pixel_scale; 00057 bool _got_pixel_scale; 00058 vector_string _suffixes; 00059 LColor _polygon_color; 00060 vector_string _texture_names; 00061 EggTexture::WrapMode _wrap_mode; 00062 EggTexture::WrapMode _wrap_u; 00063 EggTexture::WrapMode _wrap_v; 00064 EggTexture::FilterType _minfilter; 00065 EggTexture::FilterType _magfilter; 00066 bool _got_aniso_degree; 00067 int _aniso_degree; 00068 EggTexture::QualityLevel _quality_level; 00069 EggTexture::Format _format; 00070 EggTexture::Format _format_1, _format_2, _format_3, _format_4; 00071 bool _apply_bface; 00072 double _frame_rate; 00073 bool _noexist; 00074 }; 00075 00076 #endif 00077