/* Copyright (C) 1994-1995 Apogee Software, Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _rt_def_public #define _rt_def_public // RT_DEF.H Zee big one #include #include #include #include "develop.h" #define SAVE_SCREEN 1 #if PLATFORM_UNIX #include #include #include #include #include #endif #if (defined _MSC_VER) /* __int64 is built in. */ #include #include #include //#define alloca(x) _alloca(x) #define access(x, y) _access(x, y) #define F_OK 0 #elif (defined __GNUC__) #define __int64 long long #else #error please define your platform. #endif #if PLATFORM_DOS || PLATFORM_WIN32 #define PATH_SEP_CHAR '\\' #define PATH_SEP_STR "\\" #elif PLATFORM_UNIX #define PATH_SEP_CHAR '/' #define PATH_SEP_STR "/" #define ROOTDIR "/" #define CURDIR "./" #elif PLATFORM_MACCLASSIC #define PATH_SEP_CHAR ':' #define PATH_SEP_STR ":" #else #error please define your platform. #endif #if (!defined MAX_PATH) #if (defined MAXPATHLEN) #define MAX_PATH MAXPATHLEN #elif (defined PATH_MAX) #define MAX_PATH PATH_MAX #else #define MAX_PATH 256 #endif #endif // // // //*************************************************************************** // // Global Constants // //*************************************************************************** #ifndef DATADIR #define DATADIR "" #endif #undef PI #undef M_PI #ifndef NULL #define NULL 0 #endif #define PI 3.141592657 #define LONG(a) ((int)a) #define M_PI 3.14159 #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_TEXT #define O_TEXT 0 #endif #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif #ifndef max #define max(a, b) (((a) > (b)) ? (a) : (b)) #endif #if !PLATFORM_DOS #if PLATFORM_WIN32 #define strcmpi(x, y) stricmp(x, y) #define _fstricmp(x, y) stricmp(x, y) #elif PLATFORM_UNIX #ifndef strcmpi #define strcmpi(x, y) strcasecmp(x, y) #endif #ifndef stricmp #define stricmp(x, y) strcasecmp(x, y) #endif #ifndef _fstricmp #define _fstricmp(x, y) strcasecmp(x, y) #endif char *strupr(char *); char *itoa(int, char *, int); char *ltoa(long, char *, int); char *ultoa(unsigned long, char *, int); char getch(void); long filelength(int handle); #else #error please define for your platform. #endif #if !defined(ANSIESC) #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid()) #else #define STUB_FUNCTION #endif #define far #define cdecl #endif //*************************************************************************** // // Screen Constants // //*************************************************************************** #define VIEWGLOBAL 0x10000 // globals visable flush to wall /* #define VIEWWIDTH MAXSCREENWIDTH//320*2 // size of view window #define VIEWHEIGHT MAXSCREENHEIGHT//200*2 #define MAXSCANLINES MAXSCREENHEIGHT//200*2 // size of ylookup table */ #define CHARWIDTH 2 #define TILEWIDTH 4 #define STATUSLINES 16 //*************************************************************************** // // Engine Constants // //*************************************************************************** #define ANGLES 2048 // must be divisible by 4 #define ANGLEQUAD (ANGLES/4) #define FINEANGLES 2048 #define FINEANGLEQUAD (FINEANGLES/4) #define ANG90 (FINEANGLES/4) #define ANG180 (ANG90*2) #define ANG270 (ANG90*3) #define ANG360 (ANG90*4) #define VANG90 (ANGLES/4) #define VANG180 (VANG90*2) #define VANG270 (VANG90*3) #define VANG360 (VANG90*4) #define ANGLESDIV8 (ANGLES/8) #define MINDIST (0x5800l) #define PIXRADIUS 512 #define FOCALLENGTH (0x5700l) // in global coordinates #define MAXTICS 10 //*************************************************************************** // // Map Constants/ macros // //*************************************************************************** #define GLOBAL1 (1l<<16) #define TILEGLOBAL GLOBAL1 #define PIXGLOBAL (GLOBAL1/64) #define TILESHIFT 16l #define UNSIGNEDSHIFT 8 #define PLAYERSIZE 0x5700l // player radius #define MAPSIZE 128 // maps are 64*64 max #define NUMAREAS 47 #define MAPSPOT(x,y,plane) (mapplanes[plane][MAPSIZE*(y)+(x)]) #define AREATILE 107 #define ICONARROWS 72 #define PUSHABLETILE 80 #define ELEVATORTILE 72 #define ALTELEVATORTILE 106 #define LASTLEVELVALUE 459 #define AREANUMBER(x,y) (MAPSPOT((x),(y),0)-AREATILE) //*************************************************************************** // // Scale Constants // //*************************************************************************** #define SFRACBITS 16 #define SFRACUNIT (0x10000) #define FRACUNIT (0x100) //*************************************************************************** // // Actor Constants // //*************************************************************************** #define RUNSPEED 6000 #define MINACTORDIST 0x9000l #define MAXSTATS 400 // max number of lamps, bonus, etc #define MAXWALLTILES 105 // max number of wall tiles #define MAXACTORS 600 #define NORTH 0 #define EAST 1 #define SOUTH 2 #define WEST 3 //*************************************************************************** // // Input Defines - joystick, keyboard and mouse // //*************************************************************************** #define MaxJoys 2 #define MaxKbds 2 #define MaxJoys 2 #define NumCodes 128 // Key definitions #define key_None 0 #define key_Return 0x0d #define key_Enter key_Return #define key_Escape 0x1b #define key_Space 0x20 #define key_BackSpace 0x08 #define key_Tab 0x09 #define key_Delete 0x7f #define ANGLEBITS 16 #define ANGLEFRACMAX (FINEANGLES<