sdlbomber/bomber.h
2009-08-09 19:10:35 +02:00

217 lines
3.2 KiB
C

#ifndef BOMBER_H
#define BOMBER_H
#include "SDL.h"
typedef unsigned char uchar;
extern int xcolors[256];
#define NUMGFX 3
#define IXSIZE 640
#define IYSIZE 480
#define MYF1 0x180
#define MYF2 0x181
#define MYF3 0x182
#define MYF4 0x183
#define MYF5 0x184
#define MYF6 0x185
#define MYF7 0x186
#define MYF8 0x187
#define MYF9 0x188
#define MYF10 0x189
#define MYLEFT 0x190
#define MYRIGHT 0x191
#define MYUP 0x192
#define MYDOWN 0x193
#define MYPAGEUP 0x194
#define MYPAGEDOWN 0x195
#define MYHOME 0x196
#define MYEND 0x197
#define MYALTL 0x198
#define MYALTR 0x199
#define MYDELETE 0x7f
#define MYSHIFTED 0x40
#define MYALTED 0x200
typedef struct gfxset
{
uchar gs_colormap[768];
uchar gs_inout[256];
uchar *gs_pic;
int gs_xsize;
int gs_ysize;
} gfxset;
typedef struct figure
{
int xsize,ysize;
int xdelta,ydelta;
uchar *graphics;
} figure;
typedef struct solid
{
int xsize,ysize;
uchar *graphics;
} solid;
typedef struct player
{
struct player *next;
int xpos,ypos;
int flags;
int abilities;
int speed;
int speedturtle_timeout;
int bombsused;
int bombsavailable;
int flamelength;
int *at;
int figcount;
int doing;
int action;
int color;
int controller;
int fixx,fixy;
figure *figure;
} player;
#define FLG_CONTROL 1
#define FLG_DEAD 2
typedef struct sprite {
int flags;
int xpos,ypos;
figure *fig;
} sprite;
typedef struct damage {
int xpos,ypos;
int xsize,ysize;
} damage;
typedef struct list {
void *next;
} list;
typedef struct bomb {
struct bomb *next;
int type;
int xpos,ypos;
int px,py;
int power;
int timer;
int figcount;
player *owner;
} bomb;
#define BOMB_OFF 0
#define BOMB_NORMAL 1
#define BOMB_CONTROLLED 2
#define BOMBLIFE 60
#define FLAMELIFE 15
#define DECAYLIFE 15
typedef struct flame {
struct flame *next;
int xpos,ypos;
int px,py;
int timer;
int lurd;
player *owner;
} flame;
#define FL_UP 2
#define FL_DOWN 8
#define FL_LEFT 1
#define FL_RIGHT 4
typedef struct brickdecay {
struct brickdecay *next;
int xpos,ypos;
int px,py;
int timer;
} brickdecay;
typedef union listitem listitem;
union listitem {
listitem *next;
bomb b;
flame f;
brickdecay bc;
player p;
};
typedef struct generic {
struct generic *next;
int xpos,ypos;
int px,py;
int timer;
void (*process)();
void (*draw)();
void *ptr1,*ptr2;
int data1,data2;
} generic;
typedef struct bonustile {
struct bonustile *next;
int xpos,ypos;
int px,py;
int type;
} bonustile;
#define TILE_NONE -1
#define TILE_BOMB 5
#define TILE_FLAME 2
#define TILE_GOLDFLAME 7
#define TILE_CONTROL 9
#define TILE_SKATES 4
#define TILE_TURTLE 14
#define ACT_INVALID 0x88
#define ACT_NONE 0
#define ACT_UP 1
#define ACT_DOWN 2
#define ACT_LEFT 3
#define ACT_RIGHT 4
#define ACT_ENTER 5
#define ACT_QUIT 6
#define ACT_MASK 0x1f
#define ACT_PRIMARY 0x40
#define ACT_SECONDARY 0x80
#define FIELD_EMPTY 0
#define FIELD_BORDER 1
#define FIELD_BOMB 2
#define FIELD_BRICK 3
#define FIELD_FLAME 4
#define FIELD_EXPLODING 5
#define FIELD_BONUS 6
#define CODE_CONT 0
#define CODE_QUIT 1
#define CODE_ALLDEAD 2
#define MAXTHINGS 500
#define MAXSETS 8
#define MAXSPRITES 128
#define MAXDAMAGES 512
#define MAXBOMBSDETONATED 32
extern char exitflag;
extern uchar needwhole;
extern figure walking[MAXSETS][60];
#endif /* BOMBER_H */