00001 /*************************************************************************** 00002 * parser.h 00003 * 00004 * Sun May 16 11:31:53 2004 00005 * Copyright 2004 tite 00006 * thierry.schartz@bluebottle.com 00007 ****************************************************************************/ 00008 00009 /* 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _PARSER_H 00026 #define _PARSER_H 00027 00028 #ifdef WIN32 00029 #include <windows.h> 00030 #endif 00031 00032 00033 #include <string> 00034 #include <map> 00035 00036 namespace ngn { 00037 namespace core { 00038 00039 00040 00041 class SkyboxScriptParser 00042 { 00043 public: 00044 // constructor 00045 SkyboxScriptParser( std::string scriptfile, std::string map_to_find ); 00046 00047 // return envmap name ( for a given bsp file ) 00048 std::string getEnvMap(); 00049 // true if envmap is given in the script, false if different textures are used 00050 bool hasEnvMap() const; 00051 // parse the file and return true if script is valid 00052 bool parse(); 00053 // get the texture file tu use for a particular skybox face 00054 std::string getFaceMap( std::string face ); 00055 // true if skybox use only one texture for all the faces 00056 bool useOneTexture() const; 00057 00058 private: 00059 std::string m_file; 00060 std::string m_map_file; 00061 bool m_is_envmap; 00062 std::map<std::string,std::string> m_map; 00063 bool m_all_set; 00064 }; 00065 00066 00067 00068 00069 }//core 00070 }//ngn 00071 #endif /* _PARSER_H */ 00072