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-11-26 09:28:10 +11:00
|
|
|
int curlevelnum;
|
|
|
|
|
2008-10-07 16:53:06 +11:00
|
|
|
int maxlevid;
|
|
|
|
|
2008-11-12 14:25:48 +11:00
|
|
|
int want1up,want2up;
|
|
|
|
|
2008-11-22 11:21:22 +11:00
|
|
|
int globpowerup;
|
|
|
|
|
2008-10-20 09:58:54 +11:00
|
|
|
int gamemode; // easy or hard?
|
2008-10-31 11:41:33 +11:00
|
|
|
int showhelp; // show help text?
|
2008-10-20 09:58:54 +11:00
|
|
|
|
2008-10-07 20:18:42 +11:00
|
|
|
spriteinfo_t spriteinfo[MAXPTYPES];
|
|
|
|
|
2008-10-31 08:55:26 +11:00
|
|
|
char progname[MIDBUFLEN];
|
|
|
|
|
2008-10-10 07:51:09 +11:00
|
|
|
char *datadir;
|
|
|
|
|
2008-10-30 13:24:24 +11:00
|
|
|
int gotcard; // got a card yet this level?
|
2008-10-15 14:20:10 +11:00
|
|
|
int curcard;
|
|
|
|
int deck[DECKSIZE];
|
2008-10-18 05:39:22 +11:00
|
|
|
int forcegoodcard;
|
|
|
|
int nextforcegoodcard;
|
2008-10-15 14:20:10 +11:00
|
|
|
|
2008-12-25 13:18:08 +11:00
|
|
|
// pointer to function
|
|
|
|
void (*drawpixel)(SDL_Surface *s, int x, int y, SDL_Color c);
|
|
|
|
|
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-19 08:46:55 +11:00
|
|
|
SDL_Surface *head,*head5; // imgs in corner showing number of lives
|
2008-11-12 18:23:10 +11:00
|
|
|
SDL_Surface *grave;
|
2008-11-12 16:06:32 +11:00
|
|
|
SDL_Surface *head2,*head52; // imgs 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
|
2008-10-30 10:00:12 +11:00
|
|
|
SDL_Surface *redbox; // for gunner
|
2008-10-07 16:53:06 +11:00
|
|
|
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
|
2008-11-12 14:25:48 +11:00
|
|
|
sprite_t *player, *player2; // 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-23 06:40:10 +11:00
|
|
|
Mix_Music *music, *fastmusic, *normalmusic,*bossmusic,*hiscoremusic;
|
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];
|
2008-10-15 06:36:51 +11:00
|
|
|
TTF_Font *cardfont;
|
2008-09-17 12:34:39 +10:00
|
|
|
|
|
|
|
/* 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;
|
2008-11-13 07:39:03 +11:00
|
|
|
SDL_Color purple;
|
2008-09-17 12:34:39 +10:00
|
|
|
SDL_Color yellow;
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|