Initial Import
[glAntsMech.git] / glants_mech / linux / src / globals.h
blob58b210bcf34f067d7091431302ead321b6d34107
1 //
2 // global.h
3 // - we need to keep a running tab
4 // of everything
5 // for processing and what not
6 //
7 #ifndef _GLOBALS_H_
9 #include <time.h>
11 #define LOADED_TRUE 1
12 #define LOADED_FALSE 0
15 #define ENABLE_HUD 0
17 #define HUD_TIME_T 0
18 #define HUD_ANTS 0
19 #define HUD_SECS 0
20 #define HUD_NEST_FOOD 0
21 #define HUD_GARDEN 0
22 #define HUD_HEALTH 1
23 #define HUD_SCORE 1
24 #define HUD_POS 0
28 // the number of scores to display
29 // if we have 100 scores it wouldnt
30 // make much since to display all of them
31 #define MAX_SCORE_DISPLAY 3
33 #define MAX_ERRORS 33
36 // config variables --
38 #define LINE_OF_SIGHT ant_globals->line_of_sight
39 #define ATTACK_RADIUS ant_globals->attack_radius
40 #define BULLET_DAMAGE ant_globals->bullet_damage
41 #define MIN_BULLET_SPEED ant_globals->min_bullet_speed
42 #define USE_ANT_ENGINE ant_globals->use_ant_engine
43 #define MAX_FIRE_ANTS ant_globals->max_fire_ants
44 #define MAX_BOTS ant_globals->max_bots
45 #define USE_GARDEN_AREA ant_globals->use_garden_area
46 #define MAX_TRAIL_STACK ant_globals->max_trail_stack
47 #define DYING_STATE ant_globals->dying_state
48 #define MAX_PHEROMONES ant_globals->max_pheromones
49 #define PHEROMONE_LIFE ant_globals->pheromone_life
50 #define PHEROMONE_DROP ant_globals->pheromone_drop
51 #define MAX_BULLETS ant_globals->max_bullets
52 #define MAX_FIRE_SPEED ant_globals->max_fire_speed
53 #define MAX_GARDENS ant_globals->max_gardens
54 #define BOT_SPEED ant_globals->bot_speed
55 #define BOT_MAX_SPEED ant_globals->bot_max_speed
56 #define MIN_TURN_SPEED ant_globals->min_turn_speed
57 #define CHECK_RESPAWN ant_globals->check_respawn
58 #define GARD_RESPAWN_RATE ant_globals->gard_respawn_rate
59 #define MIN_STRAIGHT_STEPS ant_globals->min_straight_steps
60 #define MAX_STRAIGHT_STEPS ant_globals->max_straight_steps
61 #define MIN_STRAIGHT_STEPS_2 ant_globals->min_straight_steps_2
62 #define MAX_STRAIGHT_STEPS_2 ant_globals->max_straight_steps_2
63 #define INITIAL_ANT_FOOD ant_globals->initial_ant_food
64 #define INITIAL_GARD_FOOD ant_globals->initial_gard_food
65 #define FOOD_WIDTH ant_globals->food_width
66 #define INIT_FOOD_RATE ant_globals->init_food_rate
67 #define MAX_FOOD_RATE ant_globals->max_food_rate
68 #define MOVE_FOOD_RATE ant_globals->move_food_rate
69 #define FOOD_RATE ant_globals->food_rate
70 #define MAX_SAVED_BOTS ant_globals->saved_bots
73 // Use this for the number of network bots on the field
74 #define MAX_NETWORK_BOTS ant_globals->network_bots
78 // Network globals ----
79 #define _NETWORK_STATE_ ant_globals->network_mode
80 #define _NETWORK_OFF_ 1
81 #define _NETWORK_CLIENT_ 2
82 #define _NETWORK_SERVER_ 3
83 #define CHECK_NET_CLIENT (_NETWORK_STATE_ == _NETWORK_CLIENT_)
84 #define CHECK_NET_SERVER (_NETWORK_STATE_ == _NETWORK_SERVER_)
85 #define CHECK_NET_OFF (_NETWORK_STATE_ == _NETWORK_OFF_)
87 #define SET_NET_CLIENT _NETWORK_STATE_ = _NETWORK_CLIENT_
88 #define SET_NET_SERVER _NETWORK_STATE_ = _NETWORK_SERVER_
89 #define SET_NET_OFF _NETWORK_STATE_ = _NETWORK_OFF_
94 // config defines
95 // keep a track of everything
96 // then write to file
97 #define ID_FILE_NOT_FOUND 0
98 #define ID_LINE_OF_SIGHT 1
99 #define ID_ATTACK_RADIUS 2
100 #define ID_BULLET_DAMAGE 3
101 #define ID_MIN_BULLET_SPEED 4
102 #define ID_USE_ANT_ENGINE 5
103 #define ID_MAX_FIRE_ANTS 6
104 #define ID_MAX_BOTS 7
105 #define ID_USE_GARDEN_AREA 8
106 #define ID_MAX_TRAIL_STACK 9
107 #define ID_DYING_STATE 10
108 #define ID_MAX_PHEROMONES 11
109 #define ID_PHEROMONE_LIFE 12
110 #define ID_PHEROMONE_DROP 13
111 #define ID_MAX_BULLETS 14
112 #define ID_MAX_FIRE_SPEED 15
113 #define ID_MAX_GARDENS 16
114 #define ID_BOT_SPEED 17
115 #define ID_BOT_MAX_SPEED 18
116 #define ID_MIN_TURN_SPEED 19
117 #define ID_CHECK_RESPAWN 20
118 #define ID_GARD_RESPAWN_RATE 21
119 #define ID_MIN_STRAIGHT_STEPS 22
120 #define ID_MAX_STRAIGHT_STEPS 23
121 #define ID_MIN_STRAIGHT_STEPS_2 24
122 #define ID_MAX_STRAIGHT_STEPS_2 25
123 #define ID_INITIAL_ANT_FOOD 26
124 #define ID_INITIAL_GARD_FOOD 27
125 #define ID_FOOD_WIDTH 28
126 #define ID_INIT_FOOD_RATE 29
127 #define ID_MAX_FOOD_RATE 30
128 #define ID_MOVE_FOOD_RATE 31
129 #define ID_FOOD_RATE 32
131 #define CLIENT_NET_MENU 0 // 0
132 #define END_CLIENT_NET 4
133 #define C_HORZ_MENU 5
134 #define END_C_HORZ 10
135 #define CONNECT_TO_SERVER 11
136 #define SERVER_SETTINGS 12 // 12
137 #define CLIENT_SETTINGS 13
138 #define SERVER_NET_MENU 14
139 #define END_SERVER_NET 17
140 #define S_SERV_HORZ 18
141 #define E_SERV_HORZ 21
143 #define _TEXT_CONNECT_ 22
144 #define _TEXT_DISCONNECT_ 23
145 #define _TEXT_START_ 24
146 #define _TEXT_SHUTDOWN_ 25
150 // a score container
152 typedef struct tagScoreObj {
153 int name;
154 int kills;
155 float score;
156 } ScoreObj;
159 typedef struct tagAntGlobals {
161 int alive_ants;
162 float seconds;
163 float time_t;
164 float nest_food;
165 int garden;
166 float player_health;
167 unsigned long ticks;
169 int paused;
170 int alive_bots;
171 int menu_mode;
172 int _menu_state;
174 int saved_bots;
175 int network_bots;
177 int network_mode;
180 // variables for
181 // the scores
182 // - we need to allocate
183 // a new array however
184 struct tagScoreObj *score_obj;
187 // config file variables
188 float line_of_sight;
189 float attack_radius;
190 float bullet_damage;
191 float min_bullet_speed;
192 int use_ant_engine;
193 int max_fire_ants;
194 int max_bots;
195 int use_garden_area;
196 int max_trail_stack;
197 int dying_state;
198 int max_pheromones;
199 int pheromone_life;
200 int pheromone_drop;
201 int max_bullets;
202 int max_fire_speed;
203 int max_gardens;
204 float bot_speed;
205 float bot_max_speed;
206 float min_turn_speed;
207 int check_respawn;
208 int gard_respawn_rate;
209 int min_straight_steps;
210 int max_straight_steps;
211 int min_straight_steps_2;
212 int max_straight_steps_2;
213 int initial_ant_food;
214 int initial_gard_food;
215 float food_width;
216 int init_food_rate;
217 int max_food_rate;
218 float move_food_rate;
219 float food_rate;
222 } AntGlobals, *AntGlobalsPtr;
225 // Text Library
227 void Super_MainText(void);
228 void Super_DrawText(void);
229 void Super_KillText(void);
231 void Super_BeginPaused(void);
232 void Draw_HelpScreen(void);
233 void Draw_IntroScreen(void);
235 // User super_printf for debug code
237 void Super_Printf(char* fmt, ... );
238 void Print_Score(void);
241 void Load_Score(float score, float kills, int id, int i);
243 void Super_LoadGlobals(void);
244 void Super_KillGlobals(void);
246 void InitGlobals(void);
247 void SubtractAnts(int ants);
249 void TogglePaused(void);
251 void PrintGlobals(void);
252 void AddSeconds(float delta);
253 void AddTime(float delta);
254 void SetNestFood(float d);
255 int GetAnts(void);
256 void GameTick(void);
257 unsigned long GetGameTick(void);
258 void SetPlayerHealth(float d);
260 void SetGardenSize(int v);
261 int GetGardenSize(void);
263 void AddAnts(int ants);
264 void DestroyGlobals(void);
266 void Load_ConfigFile(void);
267 void Add_ErrorStr(char *str);
269 void Draw_NetworkScreen(void);
271 void Draw_TString(int x, int y, char *str);
272 void Mode_TitleScreen(void);
274 void Mode_SetRunning(void);
277 extern AntGlobals *ant_globals;
278 extern float framerate;
280 extern int mSuper_Loaded;
282 #endif