vegastrike  0.5.1.r1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vs_globals.h
Go to the documentation of this file.
1 #ifndef __VS_GLOBALS_H_
2 #define __VS_GLOBALS_H_
3 #include "config.h"
4 #include <vector>
5 
6 #include "universe_generic.h"
7 #include "command.h"
9 extern Universe *_Universe;
10 /*
11  * #ifdef _SERVER
12  * #include "universe_generic.h"
13  * extern Universe _Universe;
14  * #else
15  * #include "universe.h"
16  * extern GameUniverse _Universe;
17  * #endif
18  */
19 
20 extern void cleanup();
21 extern void VSExit( int code );
22 extern bool STATIC_VARS_DESTROYED;
23 extern char SERVER;
24 extern int loop_count;
25 extern double avg_loop;
26 extern int nb_checks;
27 extern double last_check;
28 extern double cur_check;
29 extern bool cleanexit;
30 extern bool run_only_player_starsystem;
31 
32 /* All global data is stored in a variable of this type */
33 typedef struct
34 {
37  char use_videos;
39  char use_logos;
42  int audio_frequency_mode; //0==11025/8 1==22050/8 2==44100/8 3==11025/16 4==22050/16 5==44100/16
52  float detaillevel; /*how much the LOD calculation gets multiplied by...higher="bigger" */
55  float znear;
56  float zfar;
57  float fov;
58  float aspect;
59  float difficulty;
60  char vsdebug;
61 } game_data_t;
62 
63 extern game_data_t g_game;
64 class Music;
65 extern Music *muzak;
66 extern int muzak_count;
67 class VegaConfig;
68 extern VegaConfig *vs_config;
69 class NetServer;
70 class NetClient;
71 extern NetClient *Network;
72 extern NetServer *VSServer;
73 
74 class Mission;
75 extern Mission *mission;
76 template < class MyType >
78 {
79  std::vector< MyType > *active_missions;
80 public:
81  bool empty() const
82  {
83  return active_missions->empty();
84  }
85  void push_back( MyType mis )
86  {
87  active_missions->push_back( mis );
88  }
89  MyType back()
90  {
91  return active_missions->back();
92  }
94  {
95  active_missions = new std::vector< MyType > ();
96  }
97 
98  unsigned int size() const
99  {
100  return (active_missions)->size();
101  }
102  MyType operator[]( unsigned int i )
103  {
104  return (*active_missions)[i];
105  }
107  {
108  /* DO NOTHING OR DIE INTENTIONAL LEAK We need this data after Exit*/
109  }
110  std::vector< MyType > * Get()
111  {
112  return active_missions;
113  }
114 };
115 
117 class ForceFeedback;
119 
120 extern double benchmark;
121 
122 #endif
123