1 /*------------------------------------------------------------------
2   externs.h: Global Game Variables
3 
4     XINVADERS 3D - 3d Shoot'em up
5     Copyright (C) 2000 Don Llopis
6 
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (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 /* general game variables */
24 typedef struct GAMEVARSSTRUCT GAMEVARS;
25 struct GAMEVARSSTRUCT
26 {
27    /* obj pointers for rendering */
28    OBJECT *gobjs[MAX_OBJECTS];
29    int    gobjcount;
30 
31    double fps;     /* frames per second */
32    double ftime;   /* frame-time in milliseconds as double */
33    double fadjust; /* frame-time adjust = rfps / ftime     */
34    long   msec;    /* frame-time in milliseconds as int    */
35    long   fcount;  /* frames rendered */
36    double rfps;    /* reference frames per second */
37 
38    long sw_t;      /* stop-watch current # of seconds */
39    long sw_save;   /* stop-watch pause */
40 
41    int key_QUIT;
42    int key_UP;
43    int key_DOWN;
44    int key_LEFT;
45    int key_RIGHT;
46    int key_FIRE;
47 
48    /* */
49    int formation_zone;
50    int ufo_zone;
51    int alien_count;
52 
53    /* flags */
54    int display_fps;
55    int paused;
56    int gameover;
57    int new_level;
58    int intro_done;
59 
60    long hi_score;
61    long pscore;    /* player's current score */
62    long pbonus;    /* player bonus counter */
63    int  plives;    /* player's current # of lives */
64    int  pblinking; /* player invunerable */
65 
66 };
67 
68 /* game.c */
69 extern GAMEVARS gvars, *gv;
70 /* arrays for both 'about' and 'rules'. Null-terminated
71    so that code to handle them only has to be written once. TBB 1.22 */
72 extern char *game_about_info[];
73 extern char *game_rules_info[];
74 
75 /* timer.c : timer(s) */
76 extern TIMER gtimer, *gt;
77 
78 /* player.c : the player(s) */
79 extern OBJECT  *player;
80 extern OBJECT  *pm;
81 
82 /* alien.c : the aliens, bombs, and ufo */
83 extern OBJECT  *ufo;
84 extern OBJECT  the_formation;
85 extern OBJLIST *af_list;
86 extern OBJLIST *abombs;
87