You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
3.3KB

  1. #ifndef BOMBER_H
  2. #define BOMBER_H
  3. #include "SDL.h"
  4. typedef unsigned char uchar;
  5. extern int xcolors[256];
  6. #define NUMGFX 3
  7. #define IXSIZE 640
  8. #define IYSIZE 480
  9. #define MYF1 0x180
  10. #define MYF2 0x181
  11. #define MYF3 0x182
  12. #define MYF4 0x183
  13. #define MYF5 0x184
  14. #define MYF6 0x185
  15. #define MYF7 0x186
  16. #define MYF8 0x187
  17. #define MYF9 0x188
  18. #define MYF10 0x189
  19. #define MYLEFT 0x190
  20. #define MYRIGHT 0x191
  21. #define MYUP 0x192
  22. #define MYDOWN 0x193
  23. #define MYPAGEUP 0x194
  24. #define MYPAGEDOWN 0x195
  25. #define MYHOME 0x196
  26. #define MYEND 0x197
  27. #define MYALTL 0x198
  28. #define MYALTR 0x199
  29. #define MYDELETE 0x7f
  30. #define MYSHIFTED 0x40
  31. #define MYALTED 0x200
  32. typedef struct gfxset {
  33. uchar gs_colormap[768];
  34. uchar gs_inout[256];
  35. uchar *gs_pic;
  36. int gs_xsize;
  37. int gs_ysize;
  38. } gfxset;
  39. typedef struct figure {
  40. int xsize,ysize;
  41. int xdelta,ydelta;
  42. uchar *graphics;
  43. } figure;
  44. typedef struct solid {
  45. int xsize,ysize;
  46. uchar *graphics;
  47. } solid;
  48. typedef struct listhead listhead;
  49. struct listhead {
  50. listhead *prev, *next;
  51. };
  52. typedef struct player {
  53. listhead list, list_all_players;
  54. int xpos,ypos;
  55. int flags;
  56. int abilities;
  57. int speed;
  58. int speedturtle_timeout;
  59. int bombsused;
  60. int bombsavailable;
  61. int flamelength;
  62. int *at;
  63. int figcount;
  64. int doing;
  65. int action;
  66. int color;
  67. int controller;
  68. int fixx,fixy;
  69. int kills, deaths;
  70. figure *figure;
  71. } player;
  72. #define FLG_CONTROL 1
  73. #define FLG_DEAD 2
  74. typedef struct sprite {
  75. int flags;
  76. int xpos,ypos;
  77. figure *fig;
  78. } sprite;
  79. typedef struct damage {
  80. int xpos,ypos;
  81. int xsize,ysize;
  82. } damage;
  83. typedef struct bomb {
  84. listhead list;
  85. int type;
  86. int xpos,ypos;
  87. int px,py;
  88. int power;
  89. int timer;
  90. int figcount;
  91. player *owner;
  92. } bomb;
  93. #define BOMB_OFF 0
  94. #define BOMB_NORMAL 1
  95. #define BOMB_CONTROLLED 2
  96. #define BOMBLIFE 60
  97. #define BOMB_CONTROLLED_LIFE 150
  98. #define FLAMELIFE 15
  99. #define DECAYLIFE 15
  100. typedef struct flame {
  101. listhead list;
  102. int xpos,ypos;
  103. int px,py;
  104. int timer;
  105. int lurd;
  106. player *owner;
  107. } flame;
  108. #define FL_UP 2
  109. #define FL_DOWN 8
  110. #define FL_LEFT 1
  111. #define FL_RIGHT 4
  112. typedef struct brickdecay {
  113. listhead list;
  114. int xpos,ypos;
  115. int px,py;
  116. int timer;
  117. } brickdecay;
  118. typedef struct bonustile {
  119. listhead list;
  120. int xpos,ypos;
  121. int px,py;
  122. int type;
  123. } bonustile;
  124. typedef struct generic {
  125. listhead list;
  126. int xpos,ypos;
  127. int px,py;
  128. int timer;
  129. void (*process)();
  130. void (*draw)();
  131. void *ptr1,*ptr2;
  132. int data1,data2;
  133. } generic;
  134. enum tile_types {
  135. TILE_NONE = -1,
  136. TILE_DISEASE = 0,
  137. TILE_KICK = 1,
  138. TILE_FLAME = 2,
  139. TILE_PUNCH = 3,
  140. TILE_SKATES = 4,
  141. TILE_BOMB = 5,
  142. TILE_SPOOGE = 6,
  143. TILE_GOLDFLAME = 7,
  144. TILE_BAD_DISEASE = 8,
  145. TILE_TRIGGER = 9,
  146. TILE_RANDOM = 10,
  147. TILE_JELLY = 11,
  148. TILE_GRAB = 12,
  149. TILE_RANDOM2 = 13,
  150. TILE_TURTLE = 14
  151. };
  152. // #define ACT_INVALID 0x88
  153. #define ACT_NONE 0
  154. #define ACT_UP 1
  155. #define ACT_DOWN 2
  156. #define ACT_LEFT 3
  157. #define ACT_RIGHT 4
  158. #define ACT_ENTER 5
  159. #define ACT_QUIT 6
  160. #define ACT_MASK 0x1f
  161. #define ACT_PRIMARY 0x40
  162. #define ACT_SECONDARY 0x80
  163. #define FIELD_EMPTY 0
  164. #define FIELD_BORDER 1
  165. #define FIELD_BOMB 2
  166. #define FIELD_BRICK 3
  167. #define FIELD_FLAME 4
  168. #define FIELD_EXPLODING 5
  169. #define FIELD_BONUS 6
  170. #define CODE_CONT 0
  171. #define CODE_QUIT 1
  172. #define CODE_ALLDEAD 2
  173. #define MAXTHINGS 500
  174. #define MAXSETS 8
  175. #define MAXSPRITES 256
  176. #define MAXDAMAGES 512
  177. extern volatile char exitflag;
  178. extern uchar needwhole;
  179. extern figure walking[MAXSETS][60];
  180. #endif /* BOMBER_H */