2008-09-17 12:34:39 +10:00
|
|
|
#ifndef __GLOBALS_H
|
|
|
|
#define __GLOBALS_H
|
|
|
|
|
|
|
|
/* global variables */
|
2008-09-27 16:02:42 +10:00
|
|
|
int musicplaying;
|
|
|
|
|
2008-09-30 17:42:09 +10:00
|
|
|
levelentry_t levelentry[MAXLEVELS]; // level filenames etc
|
2008-10-01 17:27:44 +10:00
|
|
|
int numlevels;
|
2008-09-30 17:42:09 +10:00
|
|
|
|
2008-10-07 16:53:06 +11:00
|
|
|
int maxlevid;
|
|
|
|
|
2008-10-07 20:18:42 +11:00
|
|
|
spriteinfo_t spriteinfo[MAXPTYPES];
|
|
|
|
|
2008-10-10 07:51:09 +11:00
|
|
|
char *datadir;
|
|
|
|
|
2008-10-07 16:53:06 +11:00
|
|
|
|
2008-09-30 17:42:09 +10:00
|
|
|
SDL_Surface *levelbg; // level background image
|
2008-09-17 12:34:39 +10:00
|
|
|
SDL_Surface *temps; // temporary surface
|
|
|
|
SDL_Surface *screen; // the actual video screen
|
2008-10-10 12:30:40 +11:00
|
|
|
SDL_Surface *head; // img in corner showing number of lives
|
2008-10-03 21:11:07 +10:00
|
|
|
SDL_Surface *icecube; // overlaid on frozen monsters
|
2008-10-07 16:53:06 +11:00
|
|
|
SDL_Surface *greenbox; // for fly spray effect
|
|
|
|
SDL_Surface *healthbar[HEALTHFRAMES]; // for boss health
|
2008-09-17 12:34:39 +10:00
|
|
|
sprite_t *sprite; // head of sprite linked list
|
|
|
|
sprite_t *lastsprite; // tail of sprite linked list
|
|
|
|
sprite_t *player; // pointer to the player's sprite
|
2008-10-07 16:53:06 +11:00
|
|
|
sprite_t *boss; // point to current boss on level (normally NULL)
|
2008-09-17 12:34:39 +10:00
|
|
|
|
2008-10-09 14:32:15 +11:00
|
|
|
Mix_Music *music, *fastmusic, *normalmusic,*bossmusic;
|
2008-09-26 19:51:17 +10:00
|
|
|
Mix_Chunk *sfx[MAXFX];
|
|
|
|
|
2008-09-28 13:18:36 +10:00
|
|
|
text_t *text, *lasttext;
|
|
|
|
|
2008-09-17 12:34:39 +10:00
|
|
|
level_t *curlevel; // the current level's data
|
|
|
|
|
2008-09-28 13:18:36 +10:00
|
|
|
int levelcomplete; // has the levle been finished?
|
|
|
|
|
2008-09-30 17:42:09 +10:00
|
|
|
int nexthurryup; // next hurryuptime for the level
|
|
|
|
|
2008-09-28 15:19:23 +10:00
|
|
|
int cheat;
|
|
|
|
|
2008-09-17 12:34:39 +10:00
|
|
|
tiletype_t fakeblock; // used for returning tiletypes from a function
|
|
|
|
|
2008-09-28 13:18:36 +10:00
|
|
|
int oldexitdir; // exit direction of previous level
|
|
|
|
|
2008-09-17 12:34:39 +10:00
|
|
|
int vidargs; // arguments for SetVideo call
|
|
|
|
|
|
|
|
TTF_Font *font[MAXLETTERHEIGHT];
|
|
|
|
|
|
|
|
/* timers */
|
|
|
|
int gtime; // game time - time elapsed on current level
|
|
|
|
int timer; // generic 1-100 timer for repeated events
|
|
|
|
int toggletimer; // used for toggling between fullscreen mode
|
|
|
|
|
2008-10-01 17:27:44 +10:00
|
|
|
|
|
|
|
char *deathtext[] = {
|
|
|
|
"Ouch!",
|
|
|
|
"Ow!",
|
|
|
|
"Argh!",
|
|
|
|
"Noooo!"
|
|
|
|
};
|
|
|
|
char *bifftext[] = {
|
|
|
|
"Biff!",
|
|
|
|
"Pow!",
|
|
|
|
"Wham!",
|
|
|
|
"Splat!"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-09-17 12:34:39 +10:00
|
|
|
/* colours */
|
|
|
|
SDL_Color red;
|
|
|
|
SDL_Color black;
|
2008-09-30 17:42:09 +10:00
|
|
|
SDL_Color blue;
|
2008-09-17 12:34:39 +10:00
|
|
|
SDL_Color white;
|
|
|
|
SDL_Color green;
|
|
|
|
SDL_Color yellow;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|