-
Notifications
You must be signed in to change notification settings - Fork 1
/
externs.h
112 lines (94 loc) · 3.18 KB
/
externs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*------------------------------------------------------------------
externs.h: Global Game Variables
XINVADERS 3D - 3d Shoot'em up
Copyright (C) 2000 Don Llopis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------*/
/* general game variables */
typedef struct GAMEVARSSTRUCT GAMEVARS;
struct GAMEVARSSTRUCT
{
/* obj pointers for rendering */
OBJECT *gobjs[MAX_OBJECTS];
int gobjcount;
double fps; /* frames per second */
double ftime; /* frame-time in milliseconds as double */
double fadjust; /* frame-time adjust = rfps / ftime */
long msec; /* frame-time in milliseconds as int */
long fcount; /* frames rendered */
double rfps; /* reference frames per second */
double fpsavg; /* just an approx running fps average */
int fpsfast; /* count-down, we consider fast if zero */
long sw_t; /* stop-watch current # of seconds */
long sw_save; /* stop-watch pause */
long win_width;
long win_height;
int key_QUIT;
int key_UP1;
int key_DOWN1;
int key_LEFT1;
int key_RIGHT1;
int key_FIRE1;
int key_1PLAYER;
int key_DUELPLAY;
int key_DUELPLAY_H;
int key_DUELPLAY_V;
int key_UP2;
int key_DOWN2;
int key_LEFT2;
int key_RIGHT2;
int key_FIRE2;
/* */
int formation_zone;
int ufo_zone;
int alien_count;
/* flags */
int display_fps;
int paused;
int gameover;
int new_level;
int intro_done;
long hi_score;
long pscore1; /* player's current score */
long pscore2;
long pbonus1; /* player bonus counter */
long pbonus2;
int plives1; /* player's current # of lives */
int plives2;
int pblink1; /* player invunerable */
int pblink2;
int pduel; /* one players, or player duel */
int pfocus; /* player focus 0 or 1 */
int phorizontal;
int pvertical;
int *hi_score_c[20];
int *pscore_c1[20];
int *pscore_c2[20];
int x1l, x1r, y1t, y1b, x2l, x2r, y2t, y2b;
};
/* game.c */
extern GAMEVARS gvars, *gv;
/* arrays for both 'about' and 'rules'. Null-terminated
so that code to handle them only has to be written once. TBB 1.22 */
extern char *game_about_info[];
extern char *game_rules_info[];
/* timer.c : timer(s) */
extern TIMER gtimer, *gt;
/* player.c : the player(s) */
extern OBJECT *player1, *player2;
extern OBJECT *pm1, *pm2;
/* alien.c : the aliens, bombs, and ufo */
extern OBJECT *ufo;
extern OBJECT the_formation;
extern OBJLIST *af_list;
extern OBJLIST *abombs;