1 /* 2 Copyright (C) 1994-1995 Apogee Software, Ltd. 3 4 This program is free software; you can redistribute it and/or 5 modify it under the terms of the GNU General Public License 6 as published by the Free Software Foundation; either version 2 7 of the License, or (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 13 See the GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 19 */ 20 //*************************************************************************** 21 // 22 // RT_TED.C - Ted stuff for maps and such 23 // 24 //*************************************************************************** 25 26 #include "rottnet.h" 27 28 29 #ifndef _rt_ted_public 30 #define _rt_ted_public 31 32 #define MAXCLOCKS 10 33 #define MAXSPAWNLOCATIONS 50 34 #define POWERUPTICS ((VBLCOUNTER*60)+6) 35 #define IsPlatform(x,y) ( (MAPSPOT((x),(y),2)==1) || ((MAPSPOT((x),(y),2)>=4) && (MAPSPOT((x),(y),2)<=9))) 36 37 #define EXITTILE (107) 38 #define SECRETEXITTILE (106) 39 40 #define FL_SWITCH 0x01 41 #define FL_ON 0x02 42 #define FL_REVERSIBLE 0x04 43 #define FL_W_DAMAGE 0x08 44 #define FL_W_INVERTED 0x10 45 #define FL_S_FLIPPED 0x20 46 47 48 49 #define MAXTEAMS 11 50 51 typedef struct 52 { 53 int nummembers; 54 int uniformcolor; 55 int tilex,tiley; 56 byte dir; 57 58 } teamtype; 59 60 extern teamtype TEAM[MAXPLAYERS]; 61 62 typedef struct 63 { thingtype which; 64 byte flags; 65 byte hitpoints; 66 word tile; 67 byte tilex,tiley; 68 69 70 } wall_t; 71 72 typedef struct 73 { 74 int number; 75 char mapname[23]; 76 } mapinfo_t; 77 78 typedef struct 79 { 80 int nummaps; 81 mapinfo_t maps[100]; 82 } mapfileinfo_t; 83 84 #define MAXLEVELNAMELENGTH 23 85 #define ALLOCATEDLEVELNAMELENGTH 24 86 #define NUMPLANES 3 87 #define NUMHEADEROFFSETS 100 88 89 #define MAP_SPECIAL_TOGGLE_PUSHWALLS 0x0001 90 91 typedef struct 92 { 93 unsigned used; 94 unsigned CRC; 95 unsigned RLEWtag; 96 unsigned MapSpecials; 97 unsigned planestart[ NUMPLANES ]; 98 unsigned planelength[ NUMPLANES ]; 99 char Name[ ALLOCATEDLEVELNAMELENGTH ]; 100 } RTLMAP; 101 102 103 typedef struct 104 {int x,y,dir; 105 }_2dvec; 106 107 extern _2dvec SPAWNLOC[MAXSPAWNLOCATIONS],FIRST,SECOND; 108 109 typedef struct 110 {int time1; 111 int time2; 112 byte points_to_tilex; 113 byte points_to_tiley; 114 int linkindex; 115 }str_clock; 116 117 118 extern int numareatiles[NUMAREAS+1]; 119 extern int shapestart,shapestop; 120 extern int NUMSPAWNLOCATIONS; 121 extern int mapwidth; 122 extern int mapheight; 123 124 extern wall_t walls[MAXWALLTILES]; 125 extern str_clock Clocks[MAXCLOCKS]; 126 extern int LightsInArea[NUMAREAS+1]; 127 extern int numclocks; 128 extern word ELEVATORLOCATION; 129 130 extern unsigned short int *mapplanes[3]; 131 extern int gunsstart; 132 extern int elevatorstart; 133 extern int spritestop; 134 extern int fog; 135 extern int lightsource; 136 extern int SNAKELEVEL; 137 extern boolean insetupgame; 138 extern char LevelName[80]; 139 extern boolean ISRTL; 140 141 void PreCacheGroup(int,int); 142 void AssignTeams(void); 143 void LoadTedMap( const char *extension, int mapnum ); 144 void SetupGameLevel(void); 145 void ScanInfoPlane(void); 146 void PreCacheLump( int lump, int level ); 147 void SetupGameLevelAgain (void); 148 void ScanInfoPlaneAgain (void); 149 void PreCacheActor( int actor, int which ); 150 void PreCache( void ); 151 152 void SetupWalls( void ); 153 void SetupAnimatedWalls( void ); 154 void SetupSwitches( void ); 155 void SetupPlayers( void ); 156 void SetupMaskedWalls( void ); 157 void SetupPushWalls( void ); 158 void SetupPushWallLinks( void ); 159 void SetupDoors (void); 160 void SetupDoorLinks (void); 161 void SetupClocks (void); 162 void SetupLinkedActors (void); 163 void SetupLights(void); 164 void SetupWindows ( void ); 165 166 int GetWallIndex( int texture ); 167 void PrintMapStats (void); 168 void PrintTileStats (void); 169 170 void GetMapInfo (mapfileinfo_t * mapinfo); 171 void GetMapFileName ( char * filename ); 172 void SetBattleMapFileName ( char * filename ); 173 word GetMapCRC ( int num ); 174 175 int GetNextMap ( int tilex, int tiley ); 176 void Illuminate(); 177 178 int GetSongForLevel ( void ); 179 void CheckHolidays(void); 180 boolean IsChristmas(void); 181 182 boolean DoPanicMapping (void); 183 184 #endif 185