Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
config_xml.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2001-2002 Daniel Horn
4  *
5  * http://vegastrike.sourceforge.net/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 /*
23  * xml Configuration written by Alexander Rawass <alexannika@users.sourceforge.net>
24  */
25 
26 #ifndef _VEGACONFIG_H_
27 #define _VEGACONFIG_H_
28 
29 #include "config.h"
30 #include <expat.h>
31 #include <string>
32 #include <gnuhash.h>
33 #include "configxml.h"
34 #include "xml_support.h"
35 #include "easydom.h"
36 #include "in_kb.h"
37 
38 using std::string;
39 
41 
42 typedef vsUMap< string, KBHandler > CommandMap;
43 typedef vsUMap< string, int > KeyMap;
44 
45 class GameVegaConfig : public VegaConfig
46 {
47 public:
48  explicit GameVegaConfig( const char *configfile );
49 #define AXIS_X 0
50 #define AXIS_Y 1
51 #define AXIS_Z 2
52 #define AXIS_THROTTLE 3
53 private:
54  void initCommandMap();
55  void initKeyMap();
56  CommandMap command_map;
57  KeyMap key_map;
58  int hs_value_index;
59 //vector<vColor *> colors;
60  void bindKeys();
61  void doBindings( configNode *node );
62  void checkBind( configNode *node );
63  void doAxis( configNode *node );
64  void checkHatswitch( int nr, configNode *node );
65 };
66 
67 #endif //_VEGACONFIG_H_
68