1 /* 2 * file map.h - managing the level tile map 3 * 4 * $Id: map.h,v 1.12 2006/02/09 21:21:24 fzago Exp $ 5 * 6 * Program XBLAST 7 * (C) by Oliver Vogel (e-mail: m.vogel@ndh.net) 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published 11 * by the Free Software Foundation; either version 2; or (at your option) 12 * any later version 13 * 14 * This program is distributed in the hope that it will be entertaining, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILTY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 17 * Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License along 20 * with this program; if not, write to the Free Software Foundation, Inc. 21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 */ 23 #ifndef XBLAST_MAP_H 24 #define XBLAST_MAP_H 25 26 /* 27 * type definitions 28 */ 29 30 /* tiles used in game */ 31 typedef enum 32 { 33 BTEvil = -2, /* virtual tile: free space with bomb */ 34 BTBackground = -1, /* virtual tile: don't draw this block */ 35 BTFree = 0, /* free tile */ 36 BTBurned, /* burned, free tile */ 37 BTBlock, /* solid wall */ 38 BTBlockRise, /* solid wall (rising) */ 39 BTExtra, /* extra block */ 40 BTExtraOpen, /* extras block (cracked/opening) */ 41 BTBomb, /* bomb extra */ 42 BTRange, /* range extra */ 43 BTSick, /* illness extra */ 44 BTSpecial, /* special extra */ 45 BTVoid, /* empty space for decoration */ 46 BTNUM 47 } BMMapTile; 48 49 /* graphics definition for single tile */ 50 typedef struct 51 { 52 const char *name; 53 XBColor fg; 54 XBColor bg; 55 XBColor add; 56 } BMBlockTile; 57 58 /* graphics definition for tile */ 59 typedef BMBlockTile XBScoreGraphics[MAX_BLOCK]; 60 61 /* layout for score board */ 62 typedef BMMapTile XBScoreMap[MAZE_W][MAZE_H]; 63 64 /* 65 * prototypes 66 */ 67 extern XBBool ParseLevelGraphics (const DBSection * section, DBSection * warn); 68 extern void ConfigLevelGraphics (const DBSection * section); 69 extern XBBool ParseLevelMap (const DBSection * section, DBSection * warn); 70 extern void ConfigLevelMap (const DBSection * section); 71 extern void ConfigScoreGraphics (const XBScoreGraphics data); 72 extern void ConfigScoreMap (const XBScoreMap data); 73 extern void FinishLevelGraphics (void); 74 extern void DrawMaze (void); 75 extern void SetRedrawRectangles (void); 76 extern void MarkMaze (int x1, int y1, int x2, int y2); 77 extern void MarkMazeTile (int x, int y); 78 extern void MarkMazeRect (int x, int y, int w, int h); 79 extern XBBool SpriteMarked (const Sprite * spr); 80 extern void ClearRedrawMap (void); 81 extern void UpdateMaze (void); 82 extern void UpdateExpl (void); 83 extern XBBool CheckMaze (int x, int y); 84 extern XBBool CheckMazeFree (int x, int y); 85 extern XBBool CheckMazeFree2 (int x, int y); 86 extern XBBool CheckMazeOpen (int x, int y); 87 extern XBBool CheckMazeWall (int x, int y); 88 extern XBBool CheckMazeSolid (int x, int y); 89 extern XBBool CheckMazeExtra (int x, int y); 90 extern XBBool CheckExplosion (int x, int y); 91 extern void SetBlockExtra (int x, int y, BMMapTile extra); 92 extern void SetMazeBlock (int x, int y, BMMapTile block); 93 extern void SetExplBlock (int x, int y, int value); 94 extern int GetExtra (int invincible, int x, int y); 95 extern XBBool DistribSpecial (void); 96 extern void DistributeExtras (int bombs, int range, int extras, int specials); 97 extern void BlastExtraBlock (int x, int y); 98 extern void CopyExplBlock (int x, int y, const int block[CHARH][CHARW]); 99 extern BMMapTile GetBlockExtra (int x, int y); 100 extern BMMapTile CheckBonuses (int x, int y); 101 extern BMMapTile CheckBonuses2 (int x, int y); 102 extern int CheckMazePhantomWall (int x, int y); 103 extern int CheckMazeGhost (int ghost, int x, int y); 104 extern BMMapTile GetMazeBlock (int x, int y); 105 extern void DeleteAllBombSprites (void); 106 extern void DeleteAllMapBombSprites (void); 107 extern void SetXBMapMode (XBBool mode); 108 extern XBBool GetXBMapMode (void); 109 #endif 110 /* 111 * end of file map.h 112 */ 113