ref: 5f494923c36bc263db1996ec6b61b8fcc0f65c15
parent: 15fbcd640bb628e52fef1b54f5bdd856c5c43bd2
parent: 19f201750768e69d3533e2bc09b7543cae50b3d2
author: LTCHIPS <ltchips994@gmail.com>
date: Wed Jun 6 09:32:26 EDT 2018
Merge pull request #5 from marespiaut/master Big cleanup
--- a/rott/_rt_in.h
+++ b/rott/_rt_in.h
@@ -51,11 +51,4 @@
void Mouse (int x);
-#if defined(__WATCOMC__)
-#pragma aux Mouse = \
- "int 33h" \
- parm [EAX] \
- modify [EAX]
-#endif
-
#endif
--- a/rott/_rt_map.h
+++ b/rott/_rt_map.h
@@ -20,12 +20,6 @@
#ifndef _rt_map_private
#define _rt_map_private
-#if defined(__WATCOM__)
-#pragma aux FastFill = \
- "rep stosb" \
- parm [edi] [eax] [ecx] \
- modify exact [ecx]
-#endif
void FastFill(byte * buf, int color, int count);
--- a/rott/_z_zone.h
+++ b/rott/_z_zone.h
@@ -35,16 +35,10 @@
typedef struct memblock_s
{
-#if (MEMORYCORRUPTIONTEST==1)
- int pretag;
-#endif
int size; // including the header and possibly tiny fragments
void **user; // NULL if a free block
int tag; // purgelevel
struct memblock_s *next, *prev;
-#if (MEMORYCORRUPTIONTEST==1)
- int posttag;
-#endif
} memblock_t;
typedef struct
--- a/rott/byteordr.c
+++ b/rott/byteordr.c
@@ -38,13 +38,13 @@
} \
}
-DEFINE_CONVERTER(pic_t);
-DEFINE_CONVERTER(lpic_t);
-DEFINE_CONVERTER(font_t);
-DEFINE_CONVERTER(lbm_t);
-DEFINE_CONVERTER(patch_t);
-DEFINE_CONVERTER(transpatch_t);
-DEFINE_CONVERTER(cfont_t);
+DEFINE_CONVERTER(pic_t)
+DEFINE_CONVERTER(lpic_t)
+DEFINE_CONVERTER(font_t)
+DEFINE_CONVERTER(lbm_t)
+DEFINE_CONVERTER(patch_t)
+DEFINE_CONVERTER(transpatch_t)
+DEFINE_CONVERTER(cfont_t)
void CvtNull(void *lmp, int num)
--- a/rott/byteordr.h
+++ b/rott/byteordr.h
@@ -30,13 +30,13 @@
#define DECLARE_CONVERTER(type) void Cvt_##type(void *lmp, int num);
-DECLARE_CONVERTER(pic_t);
-DECLARE_CONVERTER(lpic_t);
-DECLARE_CONVERTER(font_t);
-DECLARE_CONVERTER(lbm_t);
-DECLARE_CONVERTER(patch_t);
-DECLARE_CONVERTER(transpatch_t);
-DECLARE_CONVERTER(cfont_t);
+DECLARE_CONVERTER(pic_t)
+DECLARE_CONVERTER(lpic_t)
+DECLARE_CONVERTER(font_t)
+DECLARE_CONVERTER(lbm_t)
+DECLARE_CONVERTER(patch_t)
+DECLARE_CONVERTER(transpatch_t)
+DECLARE_CONVERTER(cfont_t)
void CvtNull(void *lmp, int num);
converter_t CvtForType(int type);
--- a/rott/cin_efct.c
+++ b/rott/cin_efct.c
@@ -87,7 +87,6 @@
)
{
spriteevent * sprite;
- patch_t *p;
sprite = SafeMalloc ( sizeof (spriteevent) );
@@ -103,8 +102,6 @@
sprite->frame=0;
sprite->frametime=framedelay;
- p=(patch_t *)W_CacheLumpNum( W_GetNumForName(sprite->name), PU_CACHE, Cvt_patch_t, 1);
-
sprite->x=x << FRACTIONBITS;
sprite->y=y << FRACTIONBITS;
@@ -274,7 +271,6 @@
void DrawFlic ( flicevent * flic )
{
byte * curpal;
- byte * buf;
char flicname[40];
curpal = SafeMalloc (768);
@@ -285,7 +281,6 @@
if (flic->usefile==false)
{
- buf=W_CacheLumpName(flic->name,PU_CACHE, CvtNull, 1);
strcpy(flicname,flic->name);
}
else
@@ -360,8 +355,6 @@
buf=(byte *)bufferofs+ylookup[back->yoffset];
offset=(back->currentoffset>>FRACTIONBITS)+plane;
- VGAWRITEMAP(plane);
-
for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
{
if (offset>=back->backdropwidth)
@@ -405,8 +398,6 @@
buf=(byte *)bufferofs+ylookup[back->yoffset];
offset=(back->currentoffset>>FRACTIONBITS)+plane;
- VGAWRITEMAP(plane);
-
for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
{
if (offset>=back->backdropwidth)
@@ -452,8 +443,6 @@
buf=(byte *)bufferofs;
offset=(back->currentoffset>>FRACTIONBITS)+plane;
- VGAWRITEMAP(plane);
-
for (i=0; i<iGLOBAL_SCREENWIDTH; i++,offset++,buf++)
{
if (offset>=back->backdropwidth)
@@ -548,7 +537,6 @@
for (; x1<=x2 ; x1++, frac += cin_iscale)
{
- VGAWRITEMAP(x1&3);
ScaleFilmPost(((p->collumnofs[frac>>FRACTIONBITS])+shape),buf+x1);
}
}
@@ -847,17 +835,13 @@
{
byte * buf;
int i;
- int plane;
byte src[200];
int width = StretchScreen? 320:iGLOBAL_SCREENWIDTH;
DrawClearBuffer ();
- plane = 0;
-
{
buf=(byte *)bufferofs;
- VGAWRITEMAP(plane);
for (i=0; i<width; i++,buf++)
{
@@ -894,8 +878,6 @@
buf=(byte *)bufferofs;
src=&(pic->data) + (plane*pic->height);
-
- VGAWRITEMAP(plane);
for (i=0; i<width; i++,src+=pic->height,buf++)
{
--- a/rott/develop.h
+++ b/rott/develop.h
@@ -21,20 +21,8 @@
#define _develop_public
#define NOMEMCHECK
-#define DEBUG 0
-#define DEVELOPMENT 0
-#define BETA 0
-#define SOUNDTEST 0
-#define PRECACHETEST 0
-#define ELEVATORTEST 0
-#define TEAMTEST 0
-#define LOADSAVETEST 0
#define WEAPONCHEAT 1
-#define MEMORYCORRUPTIONTEST 0
#define SYNCCHECK 1
-#define DATACORRUPTIONTEST 0
-#define BATTLECHECK 0 // This should be turned off for release, on for beta
-#define BATTLEINFO 0 // This should be turned off for release
#define DELUXE 0
#define LOWCOST 0
@@ -51,32 +39,5 @@
// okay?
#define TEDLAUNCH 0
-#define SOFTERROR 0
-#define RANDOMTEST 0
-#define WHEREAMI 0
-
-
-
-
-#if (WHEREAMI==1)
-
-#define wami(val) \
- { \
- programlocation=val;\
- }
-
-#define waminot()
-/*
- { \
- programlocation=-1;\
- }
-*/
-
-#else
-
-#define wami(val)
-#define waminot()
-
-#endif
#endif
--- a/rott/dosutil.c
+++ b/rott/dosutil.c
@@ -241,154 +241,3 @@
exit (1);
}
-#if 0
-/* ** */
-
-uint16_t SwapInt16L(uint16_t i)
-{
-#if BYTE_ORDER == BIG_ENDIAN
- return ((uint16_t)i >> 8) | ((uint16_t)i << 8);
-#else
- return i;
-#endif
-}
-
-uint32_t SwapInt32L(uint32_t i)
-{
-#if BYTE_ORDER == BIG_ENDIAN
- return ((uint32_t)(i & 0xFF000000) >> 24) |
- ((uint32_t)(i & 0x00FF0000) >> 8) |
- ((uint32_t)(i & 0x0000FF00) << 8) |
- ((uint32_t)(i & 0x000000FF) << 24);
-#else
- return i;
-#endif
-}
-
-/* ** */
-
-int OpenWrite(char *_fn)
-{
- int fp;
- char fn[MAX_PATH];
- strncpy(fn, _fn, sizeof (fn));
- fn[sizeof (fn) - 1] = '\0';
- FixFilePath(fn);
-
- fp = open(fn, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
- return fp;
-}
-
-int OpenWriteAppend(char *_fn)
-{
- int fp;
- char fn[MAX_PATH];
- strncpy(fn, _fn, sizeof (fn));
- fn[sizeof (fn) - 1] = '\0';
- FixFilePath(fn);
-
- fp = open(fn, O_CREAT|O_WRONLY|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
- return fp;
-}
-
-void CloseWrite(int fp)
-{
- close(fp);
-}
-
-int WriteSeek(int fp, int offset, int whence)
-{
- return lseek(fp, offset, whence);
-}
-
-int WritePos(int fp)
-{
- return lseek(fp, 0, SEEK_CUR);
-}
-
-int WriteInt8(int fp, int8_t d)
-{
- return write(fp, &d, 1);
-}
-
-int WriteInt16(int fp, int16_t d)
-{
- int16_t b = SwapInt16L(d);
-
- return write(fp, &b, 2) / 2;
-}
-
-int WriteInt32(int fp, int32_t d)
-{
- int32_t b = SwapInt32L(d);
-
- return write(fp, &b, 4) / 4;
-}
-
-int WriteBytes(int fp, byte *d, int len)
-{
- return write(fp, d, len);
-}
-
-
-int OpenRead(char *_fn)
-{
- int fp;
- char fn[MAX_PATH];
- strncpy(fn, _fn, sizeof (fn));
- fn[sizeof (fn) - 1] = '\0';
- FixFilePath(fn);
-
- fp = open(fn, O_RDONLY | O_BINARY);
-
- return fp;
-}
-
-void CloseRead(int fp)
-{
- close(fp);
-}
-
-int ReadSeek(int fp, int offset, int whence)
-{
- return lseek(fp, offset, whence);
-}
-
-int ReadLength(int fp)
-{
- return filelength(fp);
-}
-
-int8_t ReadInt8(int fp)
-{
- byte d[1];
-
- read(fp, d, 1);
-
- return d[0];
-}
-
-int16_t ReadInt16(int fp)
-{
- byte d[2];
-
- read(fp, d, 2);
-
- return (d[0]) | (d[1] << 8);
-}
-
-int32_t ReadInt32(int fp)
-{
- byte d[4];
-
- read(fp, d, 4);
-
- return (d[0]) | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);
-}
-
-int ReadBytes(int fp, byte *d, int len)
-{
- return read(fp, d, len);
-}
-
-#endif
--- a/rott/dukemusc.c
+++ b/rott/dukemusc.c
@@ -19,14 +19,7 @@
#include "buildengine/cache1d.h"
#endif
-#if (defined __WATCOMC__)
-// This is probably out of date. --ryan.
-#include "dukesnd_watcom.h"
-#endif
-
-#if (!defined __WATCOMC__)
#define cdecl
-#endif
#include "SDL2/SDL.h"
#include "SDL2/SDL_mixer.h"
--- a/rott/f_scale.h
+++ b/rott/f_scale.h
@@ -30,9 +30,4 @@
void R_DrawFilmColumn (byte * buf);
void DrawFilmPost (byte * buf, byte * src, int height);
-#if (defined __WATCOMC__)
-#pragma aux R_DrawFilmColumn parm [EDI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux DrawFilmPost parm [EDI] [ESI] [ECX] modify exact [eax ecx edx edi esi ebx]
-#endif
-
#endif
--- a/rott/fli_util.c
+++ b/rott/fli_util.c
@@ -255,103 +255,6 @@
}
}
-#if 0
-/** Clock oriented stuff. **/
-
-#define CMODE 0x43
-#define CDATA 0x40
-
-ErrCode clock_open(Clock *c)
-/* Set up clock and store speed of clock. */
-{
- c->speed = 4608; /* Our peculiar speed. */
- outportb(CMODE, 0x34); /* Change from divide by two to linear. */
- outportb(CDATA, 0); /* Set period to highest available. */
- outportb(CDATA, 0);
- return Success;
-}
-
-void clock_close(Clock *c)
-/* Return clock to normal. */
-{
- outportb(CMODE, 0x36); /* Change from linear to divide by two. */
- outportb(CDATA, 0); /* Set period to highest available. */
- outportb(CDATA, 0);
-}
-
-Ulong clock_ticks(Clock *c)
-/* Get current clock tick. */
-{
- /* This routine returns a clock with occassional spikes where time will
- * look like its running backwards 1/18th of a second. The resolution
- * of the clock is 1/(18*256) = 1/4608 second. The spikes are ok for
- * our purposes since the wait loop will just ignore them. */
- union REGS regs;
- Uchar chip_time;
- Ulong time;
-
- regs.h.ah = 0; /* Go ask BIOS timer services */
- int86(0x1A, ®s, ®s); /* for time in 1/18ths second. */
- outportb(CMODE,0); /* Latch time at timer chip. */
- inportb(CDATA); /* Read in LSB of chip time and discard. */
- chip_time = inportb(CDATA); /* Read in MSB of chip time and save. */
- chip_time = -(signed char)chip_time;
- /* We calculate the time using 3 bytes from the BIOS 18hz counter
- * and one byte from the timer chip itself. We discard the hi
- * byte of the BIOS time, shift the rest left by 8, and
- * fill in the low byte with the MSB from the chip timer.
- * This looks a little more complicated than this because
- * the bios time is in various registers - cx for the hi word
- * and dx for the low word. */
- time = (Ulong)regs.h.cl << 24L; /* Get MSB of our final time. */
- time += (Ulong)regs.w.dx << 8L; /* Fold in middle two bytes. */
- time += (Ulong)chip_time; /* Add in LSB from chip. */
- return time;
-}
-
-
-/** Keyboard oriented stuff. **/
-
-ErrCode key_open(Key *key)
-/* Set up keyboard. */
-{
- return Success; /* Pretty easy on a PC. */
-}
-
-void key_close(Key *key)
-/* Close keyboard. */
-{
- return; /* Also very easy under DOS. */
-}
-
-Boolean key_ready(Key *key)
-/* See if a key is ready. */
-{
- unsigned val;
-
- if ((val = _bios_keybrd(_KEYBRD_READY)) == 0)
- return FALSE;
- else
- {
- key->ascii = val;
- key->scancode = val;
- return TRUE;
- }
-}
-
-Uchar key_read(Key *key)
-/* Get next key. */
-{
- unsigned val;
-
- val = _bios_keybrd(_KEYBRD_READ);
- key->ascii = val;
- key->scancode = val;
- return key->ascii;
-}
-
-#endif
-
/** MemPtr stuff - to allocate and free blocks of memory > 64K. */
ErrCode big_alloc(MemPtr *bb, Ulong size)
--- a/rott/fx_man.c
+++ b/rott/fx_man.c
@@ -12,13 +12,7 @@
#include <string.h>
#include <assert.h>
-#if (defined __WATCOMC__)
-#include "dukesnd_watcom.h"
-#endif
-
-#if (!defined __WATCOMC__)
#define cdecl
-#endif
#include "SDL2/SDL.h"
#include "SDL_mixer.h"
@@ -118,10 +112,6 @@
}
}
/* end ASS copy-pastage */
-
-#ifdef __WATCOMC__
-#pragma aux (__cdecl) channelDoneCallback;
-#endif
// This function is called whenever an SDL_mixer channel completes playback.
// We use this for state management and calling the application's callback.
--- a/rott/isr.c
+++ b/rott/isr.c
@@ -40,11 +40,6 @@
#include "rt_main.h"
#include "SDL2/SDL.h"
-#if (DEVELOPMENT == 1)
-
-#include "rt_vid.h"
-
-#endif
//MED
#include "memcheck.h"
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -85,11 +85,7 @@
#ifndef STUB_FUNCTION
/* rt_def.h isn't included, so I just put this here... */
-#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
#endif
--- a/rott/modexlib.h
+++ b/rott/modexlib.h
@@ -80,32 +80,4 @@
void WaitVBL( void );
void TurnOffTextCursor ( void );
-#ifdef __WATCOMC__
-#pragma aux VGAWRITEMAP = \
- "mov eax,01H" \
- "mov edx,03c5h" \
- "shl eax,cl" \
- "out dx,al" \
- parm [ecx] \
- modify exact [eax edx]
-
-#pragma aux VGAMAPMASK = \
- "mov edx,03c5h" \
- "out dx,al" \
- parm [eax] \
- modify exact [edx]
-
-#pragma aux VGAREADMAP = \
- "shl eax,08H" \
- "mov edx,03ceh" \
- "add eax,04H" \
- "out dx,ax" \
- parm [eax] \
- modify exact [eax edx]
-#endif
-
-#define VGAMAPMASK(a)
-#define VGAREADMAP(a)
-#define VGAWRITEMAP(a)
-
#endif
--- a/rott/rottnet.h
+++ b/rott/rottnet.h
@@ -41,10 +41,6 @@
#define MAXPACKETSIZE 2048
#define MAXCOMBUFFERSIZE 2048
-#if __WATCOMC__
-#pragma pack (1)
-#endif
-
typedef struct
{
short intnum; // ROTT executes an int to send commands
@@ -66,30 +62,11 @@
char data[MAXPACKETSIZE];
} rottcom_t;
-#if __WATCOMC__
-#pragma pack (4)
-#endif
-
#define MODEM_GAME 0
#define NETWORK_GAME 1
#define ROTTLAUNCHER ("ROTT.EXE")
-#if defined(DOS) && (__WATCOMC__ == 0)
-
-extern rottcom_t rottcom;
-extern boolean pause;
-
-void ShutdownROTTCOM ( void );
-int CheckParm (char *check);
-void LaunchROTT (void);
-void NetISR (void);
-long GetVector (void);
-
-#else
-
extern rottcom_t * rottcom;
-
-#endif
#endif
--- a/rott/rt_actor.c
+++ b/rott/rt_actor.c
@@ -110,9 +110,6 @@
objtype *new;
void *actorat[MAPSIZE][MAPSIZE];
-#if (DEVELOPMENT == 1)
-FILE * williamdebug;
-#endif
exit_t playstate;
void T_SlideDownScreen(objtype*);
@@ -854,16 +851,6 @@
lastactive->nextactive = ob;
}
lastactive = ob;
-
-#if ((DEVELOPMENT == 1))
-#if ((LOADSAVETEST == 1))
- if (!lastactive)
- Debug("\nlastactive = NULL !");
- else
- Debug("\nlastactive = %8x",lastactive);
-
-#endif
-#endif
}
@@ -1758,12 +1745,6 @@
if (ambush)
new->flags |= FL_AMBUSH;
-
-#if 0
- if (gamestate.Product == ROTT_SUPERCD)
- ConsiderAlternateActor(new,which);
-#endif
-
StandardEnemyInit(new,dir);
if (which == b_darkmonkobj)
@@ -1806,13 +1787,7 @@
void SpawnPatrol (classtype which, int tilex, int tiley, int dir)
{ statetype *temp;
int path=PATH;
-#if 0
- if (gamestate.Product == ROTT_SUPERCD)
- char *altstartlabel;
-#endif
-
-
#if (SHAREWARE==1)
switch(which)
{
@@ -1844,12 +1819,6 @@
if (!loadedgame)
gamestate.killtotal++;
-
-#if 0
- if (gamestate.Product == ROTT_SUPERCD)
- ConsiderAlternateActor(new,which);
-#endif
-
StandardEnemyInit(new,dir);
if ((which == wallopobj) || (which == roboguardobj))
@@ -2240,7 +2209,6 @@
void T_Count(objtype*ob)
{
int index;
- wall_t* tswitch;
touchplatetype *temp;
objtype* tempactor;
@@ -2318,16 +2286,6 @@
tempactor = (objtype*)(temp->whichobj);
tempactor->flags &= ~FL_ACTIVE;
}
-
- tswitch = (wall_t*)actorat[ob->temp1][ob->temp2];
- /*
- if (tswitch && (tswitch->which != ACTOR))
- {
- tilemap[ob->temp1][ob->temp2]--;
- tswitch->flags &= ~FL_ON;
- }
- */
-
}
}
@@ -2789,7 +2747,7 @@
void MissileHit (objtype *ob,void *hitwhat)
{
- int damage=0, random,tcl=0,ocl,fireweapon=0,sound,hitmomx,hitmomy;
+ int damage=0, random,tcl=0,ocl,sound,hitmomx,hitmomy;
objtype* tempactor=NULL,*owner;
@@ -2910,7 +2868,6 @@
case fireballobj:
NewState(ob,&s_explosion1);
damage = (random >> 3) + 10;
- fireweapon = 1;
break;
case missileobj:
@@ -2932,7 +2889,6 @@
else if (M_ISWALL(tempactor) || (tempactor->which == DOOR))
NewState(ob,&s_crossdone1);
damage = EnvironmentDamage(ob);
- fireweapon = 1;
break;
@@ -3018,7 +2974,6 @@
case dmfballobj:
NewState(ob,&s_explosion1);
damage = (random >>3) + 20;
- fireweapon = 1;
break;
case h_mineobj:
@@ -3111,7 +3066,7 @@
void T_CrushUp(objtype*ob)
-{ int dx, dy,dist,dz,i,playeron;
+{ int dx, dy,dist,dz,i;
if ((!ob->ticcount) && (ob->state->condition & SF_SOUND) &&
@@ -3134,7 +3089,6 @@
ob->temp2 = maxheight - ob->temp1 + 32;
- playeron = 0;
for(i=0; i<numplayers; i++)
{ dx = abs(PLAYER[i]->x - ob->x);
dy = abs(PLAYER[i]->y - ob->y);
@@ -3143,7 +3097,6 @@
if ((dx < dist) && (dy < dist) && (dz < 65))
{ ob->flags &= ~FL_BLOCK;
//player->temp2 = 0;
- playeron = 1;
if ((!ob->ticcount) && (ob->state->condition & SF_CRUSH) &&
(levelheight<2) && (!(ob->flags & FL_DYING)))
{ DamageThing(PLAYER[i],EnvironmentDamage(ob));
@@ -3175,20 +3128,16 @@
}
- //if (!playeron)
- { if (ob->state->condition & SF_BLOCK)
+ if (ob->state->condition & SF_BLOCK)
ob->flags |= FL_BLOCK;
else
ob->flags &= ~FL_BLOCK;
- }
-
-
}
void T_CrushDown(objtype*ob)
-{ int dx,dy,dz,i,playeron;
+{ int dx,dy,dz,i;
if ((!ob->ticcount) && (ob->state->condition & SF_SOUND)&&
@@ -3196,7 +3145,6 @@
SD_PlaySoundRTP(BAS[ob->obclass].operate,ob->x,ob->y);
ob->temp2 = ob->z;
- playeron = 0;
for(i=0; i<numplayers; i++)
{ dx = abs(PLAYER[i]->x - ob->x);
dy = abs(PLAYER[i]->y - ob->y);
@@ -3204,7 +3152,6 @@
if ((dx < STANDDIST) && (dy < STANDDIST) && (dz < 20))
{ //PLAYER[i]->temp2 = 0;
- playeron = 1;
ob->flags &= ~FL_BLOCK;
if ((!ob->ticcount) && (ob->state->condition & SF_CRUSH) &&
(!(ob->flags & FL_DYING)))
@@ -3225,14 +3172,10 @@
}
}
- //if (!playeron)
- { if (ob->state->condition & SF_BLOCK)
+ if (ob->state->condition & SF_BLOCK)
ob->flags |= FL_BLOCK;
else
ob->flags &= ~FL_BLOCK;
- }
-
-
}
@@ -3309,14 +3252,6 @@
check->flags &= ~FL_SHOOTABLE;
return;
}
-#if 0
- dist = FindDistance(dx,dy);
- scalefactor = (blastradius-dist)>>4;
- if (scalefactor > 0xffff)
- scalefactor = 0xffff;
- pdamage = FixedMul(damage,scalefactor);
-#endif
-//#if 0
//magdx = abs(dx);
//magdy = abs(dy);
@@ -3334,7 +3269,6 @@
scalefactor = 0x12000;
pdamage = FixedMul(damage,scalefactor);
SoftError("\ndamage: %d, scalefactor: %x\n",pdamage,scalefactor);
-//#endif
impulse = FixedMul(EXPLOSION_IMPULSE,scalefactor);
if (check->obclass == playerobj)
{
@@ -3892,14 +3826,6 @@
ob->flags |= FL_DYING;
ob->soundhandle = -1;
-#if 0
- if ((ob->obclass == blitzguardobj) &&
- (ob->state->condition & SF_DOWN)
- )
-
- SD_Play(PlayerSnds[locplayerstate->player]);
-#endif
-
if (Vicious_Annihilation(ob,attacker))
return;
else if (enableZomROTT)
@@ -5966,11 +5892,9 @@
void MoveActor(objtype*ob)
{
- int linked,oldarea,newarea,
+ int oldarea,newarea,
tilex,tiley,oldtilex,oldtiley;
- linked = 0;
-
ResolveRide(ob);
oldtilex = ob->tilex;
@@ -6783,8 +6707,6 @@
int dzt,dztp1,checkz;
int x,y,dx,dy;
int ocl,tcl;
- int ISPLAYER = 0;
- int hoffset;
ocl = ob->obclass;
@@ -6818,15 +6740,6 @@
radius -= 0x2000;
}
- else
- {
- ISPLAYER = 1;
- if (ob->flags & FL_DOGMODE)
- hoffset = 10;
- }
-
-
-
tilexlow = (int)((tryx-radius) >>TILESHIFT);
tileylow = (int)((tryy-radius) >>TILESHIFT);
@@ -7015,7 +6928,7 @@
{
int tilexlow,tilexhigh,tileylow,tileyhigh,x,y,radius;
classtype ocl;
- boolean WALLSTOP,ISPLAYER=false;
+ boolean ISPLAYER=false;
ocl = ob->obclass;
tryz=tryz;
@@ -7050,17 +6963,12 @@
tilexhigh = (int)((tryx+radius) >>TILESHIFT);
tileyhigh = (int)((tryy+radius) >>TILESHIFT);
-
- WALLSTOP = false;
-
for (y=tileylow; y<=tileyhigh; y++)
for (x=tilexlow; x<=tilexhigh; x++)
{
wall_t *tempwall;
- int wall;
tempwall = (wall_t*)actorat[x][y];
- wall=tilemap[x][y];
if (tempwall)
{
if (tempwall->which==WALL)// && IsWindow(x,y)==false)
@@ -7083,7 +6991,6 @@
}
//return false;
- WALLSTOP = true;
if ((ocl == inertobj) &&
(ob->dirchoosetime == GIBVALUE) &&
@@ -8763,7 +8670,7 @@
void SelectTouchDir (objtype *ob)
{
- int dx,dy,noneleft,invisible;
+ int dx,dy;
hiding_status hole;
@@ -8774,10 +8681,6 @@
olddir=ob->dir;
turnaround= opposite[olddir];
-
- invisible = 0;
- noneleft = 1;
-
if (!MISCVARS->notouch)
{
if (!FindTouch(ob))
@@ -9716,16 +9619,6 @@
prevdir = ((prevdir+2) & 0xf);
}
-#if 0
- SoftError("\n straight dir: %d\n queue dirs ",tdir);
- for(count = 0; count < MISCVARS->NMEqueuesize; count++)
- {
- SoftError("\n dir %d: %d",MISCVARS->NMEqueuesize-count,
- ((ob->temp1 >> (4*count)) &0xf)
- );
-
- }
-#endif
}
else // else goto next queue dir;
{
@@ -9934,9 +9827,6 @@
if (!CheckLine(ob,PLAYER[0],SIGHT))
{ //ob->temp3 = 0;
- //#if ((DEVELOPMENT == 1))
- //Debug("\nCheckLine failed in NME Attack");
- //#endif
NewState(ob,&s_NMEchase);
NewState((objtype*)(ob->target),&s_NMEwheels2);
if (!ob->temp2)
@@ -10146,16 +10036,8 @@
//ob->y = ob->drawy = ob->targettiley;
//ob->tilex = ob->x >> TILESHIFT;
//ob->tiley = ob->y >> TILESHIFT;
- //#if ((DEVELOPMENT == 1))
- // Debug("\nfollower %d being moved to targetx %4x and targety %4x",
- // ob-SNAKEHEAD,ob->x,ob->y);
- // #endif
ob->targettilex = ob->temp1;
ob->targettiley = ob->temp2;
-#if (0)
- Debug("\nfollower %d's new targetx %4x, targety %4x",
- ob-SNAKEHEAD,ob->temp1,ob->temp2);
-#endif
ob->angle = atan2_appx(dx,dy);
ob->dir = angletodir[ob->angle];
ParseMomentum(ob,ob->angle);
@@ -12830,8 +12712,6 @@
else
turnaround=nodir;
*/
- dummy.which = ACTOR;
- dummy.z = ob->z;
if (ob->targettilex || ob->targettiley)
{
tx = ob->targettilex;
@@ -12838,8 +12718,6 @@
ty = ob->targettiley;
dx= tx - ob->x;
dy= ob->y - ty;
- dummy.x = tx;
- dummy.y = ty;
if ((abs(dx) < 0x2000) && (abs(dy) < 0x2000))
ChasePlayer(ob);
}
@@ -13343,9 +13221,6 @@
if ((yzangle>MAXYZANGLE) && (yzangle<FINEANGLES-MAXYZANGLE))
{
-#if (0)
- Debug("\nfailed from yzangle");
-#endif
return false;
}
@@ -13446,16 +13321,10 @@
{
if ( maskobjlist[value&0x3ff]->flags & MW_SHOOTABLE )
{
-#if (0)
- SoftError("\nfailed from shootable mask");
-#endif
return false;
}
else if ( maskobjlist[value&0x3ff]->flags & MW_WEAPONBLOCKING )
{
-#if (0)
- SoftError("\nfailed from block mask");
-#endif
return false;
}
}
@@ -13467,13 +13336,6 @@
}
else
{
-#if (0)
- SoftError("\n obx %d, oby %d, origx %d, origy %d"
- "\n xydist %d, vx %d, vy %d",ob->x,ob->y,orig->x,
- orig->y,xydist,vx,vy);
-
- SoftError("\nfailed from normal wall");
-#endif
return false;
}
}
@@ -13486,9 +13348,6 @@
// FindDistance(orig->x-tempactor->x,orig->y-tempactor->y) )
// ==true) )
{
-#if (0)
- SoftError("\nfailed from actor");
-#endif
return false;
}
}
@@ -13501,17 +13360,11 @@
==true) )
{
-#if (0)
- SoftError("\nfailed from sprite");
-#endif
return false;
}
if (tempactor && (tempactor->which == PWALL))
{
-#if (0)
- SoftError("\nfailed from pushwall");
-#endif
return false;
}
index=(cnt>=0);
--- a/rott/rt_actor.h
+++ b/rott/rt_actor.h
@@ -86,19 +86,7 @@
#define ACTORSIZE 0x5800
#define PWALLRAD 0xa000
-#ifdef __WATCOMC__
-int M_ABS(int value);
-#pragma aux M_ABS = \
- "test eax,eax", \
- "jge done", \
- "neg eax",\
- "done: " \
- parm [eax] \
- value [eax] \
- modify exact [eax]
-#else
#define M_ABS abs
-#endif
#define M_CheckPlayerKilled(ob) \
{ if ((ob->obclass == playerobj) && (ob->flags & FL_DYING)) \
@@ -435,4 +423,4 @@
void ResurrectEnemies();
-#endif
\ No newline at end of file
+#endif
--- a/rott/rt_battl.c
+++ b/rott/rt_battl.c
@@ -131,18 +131,6 @@
int team;
int TeamNumber[ MAXPLAYERCOLORS ];
-#if (BATTLECHECK == 1)
- if ( ( gamestate.teamplay ) && ( BattleMode == battle_Tag ) )
- {
- Error( "BATTLE_Init : Cannot play Tag in team mode.\n" );
- }
-
- if ( ( gamestate.teamplay ) && ( BattleMode == battle_CaptureTheTriad ) )
- {
- Error( "BATTLE_Init : Can only play Capture the Triad in team mode.\n" );
- }
-#endif
-
Timer = 0;
RoundOver = false;
@@ -391,22 +379,6 @@
}
BATTLE_StartRound();
-
-#if (BATTLEINFO == 1)
- SoftError( "GRAVITY = %d\n", GRAVITY );
- SoftError( "BO_Gravity = %d\n", BattleOptions.Gravity );
- SoftError( "BO_Speed = %d\n", BattleOptions.Speed );
- SoftError( "BO_Ammo = %d\n", BattleOptions.Ammo );
- SoftError( "BO_HitPoints = %d\n", BattleOptions.HitPoints );
- SoftError( "BO_Dangers = %d\n", BattleOptions.SpawnDangers );
- SoftError( "BO_Health = %d\n", BattleOptions.SpawnHealth );
- SoftError( "BO_Weapons = %d\n", BattleOptions.SpawnWeapons );
- SoftError( "BO_Respawn = %d\n", BattleOptions.RespawnItems );
- SoftError( "BO_Light = %d\n", BattleOptions.LightLevel );
- SoftError( "BO_Kills = %d\n", BattleOptions.Kills );
- SoftError( "BO_DangerDam = %d\n", BattleOptions.DangerDamage );
- SoftError( "BO_TimeLimit = %d\n", BattleOptions.TimeLimit );
-#endif
}
@@ -606,12 +578,7 @@
if ( ( player < 0 ) || ( player >= MAXPLAYERS ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus - reason %d : Player out of range!\n",
- reason );
-#else
return( battle_no_event );
-#endif
}
if ( !BATTLEMODE )
@@ -665,10 +632,6 @@
break;
case battle_player_killed :
-#if (BATTLEINFO == 1)
- SoftError( "BATTLE_CheckGameStatus: Player %d Died", player );
- SoftError( "---ticks = %d\n", Timer );
-#endif
switch( BattleMode )
{
@@ -700,11 +663,7 @@
if ( ( BattleMode != battle_Collector ) &&
( BattleMode != battle_Scavenger ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus : Got collector item on wrong battle mode!" );
-#else
return( battle_no_event );
-#endif
}
BATTLE_Points[ team ]++;
UpdateKills = true;
@@ -725,11 +684,7 @@
if ( BattleMode != battle_Eluder )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus : Caught Eluder on non-Eluder battle mode!" );
-#else
return( battle_no_event );
-#endif
}
BATTLE_Points[ team ]++;
@@ -752,11 +707,7 @@
if ( BattleMode != battle_Deluder )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus : Shot Eluder on non-Eluder battle mode!" );
-#else
return( battle_no_event );
-#endif
}
BATTLE_Points[ team ]++;
@@ -774,11 +725,7 @@
case battle_captured_triad :
if ( BattleMode != battle_CaptureTheTriad )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus : Triad Captured on invalid battle mode!" );
-#else
return( battle_no_event );
-#endif
}
if ( consoleplayer == player )
@@ -798,12 +745,7 @@
break;
default :
-#if (BATTLECHECK == 1)
- Error( "BATTLE_CheckGameStatus called with a reason of %d.",
- reason );
-#else
return( battle_no_event );
-#endif
break;
}
@@ -868,14 +810,6 @@
}
}
-#if (BATTLEINFO == 1)
- for( i = 0; i < BATTLE_NumberOfTeams; i++ )
- {
- SoftError( "Sorted rank %d = player %d : Score = %d\n", i,
- BATTLE_PlayerOrder[ i ], BATTLE_Points[ BATTLE_PlayerOrder[ i ] ] );
- }
-#endif
-
if ( ( SwapFlag == true ) && ( gamestate.ShowScores ) &&
( SHOW_TOP_STATUS_BAR() || SHOW_KILLS() ) )
{
@@ -903,42 +837,19 @@
int killerteam;
int victimteam;
-#if (BATTLEINFO == 1)
- SoftError( "PlayerKilledPlayer:\nMode = %d\n", BattleMode );
- SoftError( "Reason = %d\n", reason );
- SoftError( "killer = %d, team = %d\n", killer, killerteam );
- SoftError( "victim = %d, team = %d\n", victim, victimteam );
- SoftError( "---ticks = %d\n", Timer );
-#endif
-
if ( ( killer < 0 ) || ( killer >= MAXPLAYERS ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer - reason %d : Killer out of range!\n",
- reason );
-#else
return( battle_no_event );
-#endif
}
if ( ( victim < 0 ) || ( victim >= MAXPLAYERS ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer - reason %d : Victim out of range!\n",
- reason );
-#else
return( battle_no_event );
-#endif
}
if ( ( killer == victim ) && ( reason != battle_kill_with_missile ) &&
( reason != battle_kill_with_missile_in_air ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer : Player "
- "killed self with illegal reason of %d.", reason );
-#else
return( battle_no_event );
-#endif
}
killerteam = BATTLE_Team[ killer ];
@@ -947,12 +858,7 @@
if ( ( killerteam < 0 ) || ( killerteam >= BATTLE_NumberOfTeams ) ||
( victimteam < 0 ) || ( victimteam >= BATTLE_NumberOfTeams ) )
{
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer - reason %d : Team out of range!\n",
- reason );
-#else
return( battle_no_event );
-#endif
}
if ( !BATTLEMODE )
@@ -993,12 +899,7 @@
break;
default :
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer called with a reason of %d.",
- reason );
-#else
return( battle_no_event );
-#endif
}
if ( killerteam == victimteam )
@@ -1032,13 +933,6 @@
status = battle_end_game;
}
}
-#if (BATTLECHECK == 1)
- else if ( reason != battle_kill_by_crushing )
- {
- Error( "BATTLE_PlayerKilledPlayer - reason %d : "
- "Illegal reason in Tag!\n", reason );
- }
-#endif
return( status );
}
@@ -1070,12 +964,7 @@
}
break;
default :
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer called with a "
- "reason of %d in Hunter.", reason );
-#else
;
-#endif
}
}
else
@@ -1110,12 +999,7 @@
break;
default :
-#if (BATTLECHECK == 1)
- Error( "BATTLE_PlayerKilledPlayer called with a reason of %d.",
- reason );
-#else
return( battle_no_event );
-#endif
}
}
--- a/rott/rt_build.c
+++ b/rott/rt_build.c
@@ -236,7 +236,6 @@
shadingtable=colormap+(16<<8);
{
- VGAWRITEMAP(plane);
buf=(char *)(bufferofs);
for (i=0; i<viewwidth; i++,buf++)
@@ -866,7 +865,6 @@
int plane;
int pixel;
byte *shape;
- byte *src;
pic_t *p;
if (MenuBufStarted==false)
@@ -884,7 +882,6 @@
buffer = (byte*)menubuf+(x*TEXTUREHEIGHT)+y;
- src=(byte *)&p->data;
for (plane=0; plane<4; plane++,buffer+=TEXTUREHEIGHT)
{
for (yy = 0; yy < p->height; yy++)
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -23,8 +23,6 @@
//
//****************************************************************************
-#define _ROTT_
-
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -33,17 +31,11 @@
#include <string.h>
#include <ctype.h>
-#ifdef _ROTT_
#include "rt_def.h"
-#else
-#include "st_def.h"
-#endif
#include "rt_cfg.h"
#include "version.h"
-#ifdef _ROTT_
-
#include "scriplib.h"
#include "rt_playr.h"
#include "rt_menu.h"
@@ -62,16 +54,6 @@
#include "isr.h"
#include "fx_man.h"
#include "develop.h"
-
-#else
-
-#include "st_def.h"
-#include "rt_cfg.h"
-#include "scriplib.h"
-#include "rt_sound.h"
-#include "st_util.h"
-
-#endif
//MED
#include "memcheck.h"
@@ -140,12 +122,6 @@
int DefaultPlayerColor = 0;
byte passwordstring[20];
-#ifndef _ROTT_
-
-int fulllight = 0;
-int viewsize = 7;
-
-#endif
MacroList CommbatMacros[MAXMACROS];
char ApogeePath[256];
@@ -158,8 +134,6 @@
static char SoundName[13] = "sound.rot";
-#ifdef _ROTT_
-
static char *ConfigName = "config.rot";
static char *ScoresName = "scores.rot";
static char *ROTT = "rott.rot";
@@ -172,11 +146,6 @@
AlternateInformation BattleLevels;
char CodeName[MAXCODENAMELENGTH];
-#endif
-
-
-#ifdef _ROTT_
-
//******************************************************************************
//
// ReadScores ()
@@ -199,8 +168,6 @@
gamestate.violence = 0;
}
-#endif
-
//******************************************************************************
//
// ReadInt
@@ -329,9 +296,6 @@
stereoreversed = false;
}
-
-#ifdef _ROTT_
-
extern char pword[ 13 ];
//******************************************************************************
//
@@ -930,7 +894,6 @@
passwordstring[11]=0x23;
passwordstring[12]=0x1c;
}
-#endif
//******************************************************************************
//
@@ -971,8 +934,6 @@
Z_Free (scriptbuffer);
}
-
-#ifdef _ROTT_
ReadScores();
GetPathFromEnvironment( filename, ApogeePath, ConfigName );
@@ -1002,7 +963,6 @@
Z_Free(scriptbuffer);
}
-#endif
ConfigLoaded = true;
}
@@ -1110,8 +1070,6 @@
-#ifdef _ROTT_
-
//******************************************************************************
//
// WriteScores ()
@@ -1484,8 +1442,6 @@
close( file );
}
-#endif
-
//******************************************************************************
//
// WriteSoundConfig ()
@@ -1616,7 +1572,6 @@
WriteSoundConfig();
// Write Config, Battle and Score files
-#ifdef _ROTT_
WriteScores();
WriteBattleConfig();
@@ -2006,13 +1961,10 @@
SafeWriteString(file,&passwordtemp[0]);
close (file);
-#endif
inconfig--;
}
-#ifdef _ROTT_
-
//****************************************************************************
//
// GetAlternatePath ()
@@ -2156,6 +2108,4 @@
unlink (filename); // Delete ROTT.ROT
}
}
-
-#endif
--- a/rott/rt_com.c
+++ b/rott/rt_com.c
@@ -238,14 +238,6 @@
// SoftError( "ReadPacket: time=%ld size=%ld src=%ld type=%d\n",GetTicCount(), rottcom->datalength,rottcom->remotenode,rottcom->data[0]);
-#if 0
- rottcom->command=CMD_OUTQUEBUFFERSIZE;
- int386(rottcom->intnum,&comregs,&comregs);
- SoftError( "outque size=%ld\n",*((short *)&(rottcom->data[0])));
- rottcom->command=CMD_INQUEBUFFERSIZE;
- int386(rottcom->intnum,&comregs,&comregs);
- SoftError( "inque size=%ld\n",*((short *)&(rottcom->data[0])));
-#endif
return true;
}
else // Not ready yet....
@@ -301,15 +293,6 @@
// Send It !
#ifdef PLATFORM_UNIX
WriteUDPPacket();
-#endif
-
-#if 0
- rottcom->command=CMD_OUTQUEBUFFERSIZE;
- int386(rottcom->intnum,&comregs,&comregs);
- SoftError( "outque size=%ld\n",*((short *)&(rottcom->data[0])));
- rottcom->command=CMD_INQUEBUFFERSIZE;
- int386(rottcom->intnum,&comregs,&comregs);
- SoftError( "inque size=%ld\n",*((short *)&(rottcom->data[0])));
#endif
}
--- a/rott/rt_crc.c
+++ b/rott/rt_crc.c
@@ -63,35 +63,6 @@
0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040
};
-/* driver */
-#if 0
-main(argc,argv)
-int argc;
-char **argv;
-{
- if(argc>2) perr("Usage: crcfast [filename]");
- if(argc==2) strcpy(filename,argv[1]);
- else
- {
- printf("\nEnter filename: ");
- gets(filename);
- }
- if((fp=fopen(filename,"rb"))==NULL) perr("Can't open file");
- num=0L;
- crc16=crctt=0;
- while((ch=fgetc(fp))!=EOF)
- {
- num++;
- crc16=updatecrc(crc16,ch);
-// crctt=updcrc(crctt,ch);
- }
- fclose(fp);
- printf("\nNumber of bytes = %lu\nCRC16 = %04X\nCRCTT = %04X",
- num,crc16,crctt);
-}
-
-#endif
-
/* update crc reverse */
int updatecrc(int crc, int c)
{
--- a/rott/rt_debug.c
+++ b/rott/rt_debug.c
@@ -1159,171 +1159,6 @@
int DebugKeys (void)
{
-#if (DEVELOPMENT == 1)
- char str[10];
- boolean esc;
- int level;
- int i,f,temp;
- static int whichpowerup = 0;
- static int whichprotection = 0;
-
- if (Keyboard[sc_G]) // G = god mode
- {
- DoGodMode ();
- while (Keyboard[sc_G])
- IN_UpdateKeyboard ();
- return 1;
- }
- else if (Keyboard[sc_Q]) // Q = fast quit
- QuitGame ();
- else if (Keyboard[sc_W]) // W = warp to level
- {
- DoWarp ();
- return 1;
- }
- else if (Keyboard[sc_F]) // F = FPS
- {
- f=0;
- for (i=0; i<VBLCOUNTER*10; i+=tics)
- {
- ThreeDRefresh();
- DoSprites();
- CalcTics ();
- f++;
- }
-
- CurrentFont = smallfont;
-
- US_CenterWindow (12,2);
- temp=f*10;
- SoftError("fps = %2ld.%2ld\n",temp/100,temp%100);
-
- US_Print ("FPS=");
- US_PrintUnsigned (temp/100);
- US_Print (".");
- US_PrintUnsigned (temp%100);
-
- VW_UpdateScreen();
- IN_Ack();
-
- return 1;
- }
- else if (Keyboard[sc_H]) // H = hurt self
- {
- IN_ClearKeysDown ();
- HurtPlayer ();
- }
- else if (Keyboard[sc_Z]) // Z = end level
- {
- EndLevel ();
- }
- else if (Keyboard[sc_P]) // P = step through powerups
- {
- whichpowerup++;
- if (whichpowerup == 6)
- whichpowerup = 0;
-
- switch (whichpowerup)
- {
- case 0: // nothing
- if (player->flags & FL_ELASTO)
- player->flags &= ~FL_NOFRICTION;
- player->flags &= ~(FL_SHROOMS|FL_ELASTO|FL_FLEET|FL_GODMODE|FL_DOGMODE);
- locplayerstate->poweruptime = 0;
- GM_UpdateBonus (0, true);
- break;
-
- case 1: // god mode
- DoGodModePowerup ();
- break;
-
- case 2: // dog mode
- DoDogModePowerup ();
- break;
-
- case 3: // fleet feet
- DoMercuryModePowerup ();
- break;
-
- case 4: // elasto
- DoElastoModePowerup ();
- break;
-
- case 5: // shrooms
- DoShroomsModePowerup ();
- break;
- }
-
- while (Keyboard[sc_P])
- IN_UpdateKeyboard ();
- }
- else if (Keyboard[sc_A]) // step through armor
- {
- whichprotection++;
- if (whichprotection == 4)
- whichprotection = 0;
-
- switch (whichprotection)
- {
- case 0: // nothing
- player->flags &= ~(FL_BPV|FL_AV|FL_GASMASK);
- locplayerstate->protectiontime = 0;
- GM_UpdateBonus (0, false);
- break;
-
- case 1: // gas mask
- GiveGasMask ();
- break;
-
- case 2: // armor
- GiveBulletProofArmor ();
- break;
-
- case 3: // fire vest
- GiveAsbestoArmor ();
- break;
- }
-
- while (Keyboard[sc_A])
- IN_UpdateKeyboard ();
- }
- else if (Keyboard[sc_O]) // O = outfit player
- {
- OutfitPlayer ();
-
- IN_ClearKeysDown ();
- IN_Ack ();
- return 1;
- }
- else if (Keyboard[sc_K]) // K = kill self
- {
- IN_ClearKeysDown ();
- locplayerstate->lives = -1;
- KillPlayer ();
- }
- else if (Keyboard[sc_I]) // I = item cheat
- {
- DoItemCheat ();
- return 1;
- }
- else if (Keyboard[53]) // \ = back to normal
- {
- DoNormalThing ();
- return 1;
- }
- else if (Keyboard[sc_R])
- {
- RecordDemoQuery();
- }
- else if (Keyboard[sc_E])
- {
- EndDemo();
- }
- else if (Keyboard[sc_D])
- {
- PlaybackDemoQuery();
- }
-#endif
return (0);
}
--- a/rott/rt_def.h
+++ b/rott/rt_def.h
@@ -141,11 +141,7 @@
#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
@@ -314,13 +310,6 @@
////////////////// GLOBAL ENUMERATED TYPES ///////////////////////
-#ifdef __WATCOMC__
-typedef enum
-{ false,
- true
-}
-boolean;
-#else
/* boolean is serialized at the moment, and watcomc made it a byte. */
typedef unsigned char boolean;
@@ -327,10 +316,6 @@
enum {
false, true
};
-#endif
-
-
-
typedef enum {
east,
--- a/rott/rt_door.c
+++ b/rott/rt_door.c
@@ -105,33 +105,6 @@
DeactivateLight
};
-#if ((DEVELOPMENT == 1))
-#if ((LOADSAVETEST == 1))
-static char*touchstrings[NUMTOUCHPLATEACTIONS] =
-{ "ActivatePushWall",
- "ActivateMoveWall",
- "LinkedOpenDoor",
- "LinkedCloseDoor",
- "EnableObject",
- "DisableObject",
- "ActivateLight",
- "DeactivateLight"
-};
-#endif
-#endif
-#if ((DEVELOPMENT == 1))
-#if ((ELEVATORTEST == 1))
-
-static char*elevstring[NUMELEVATORACTIONS] =
-{ "ready at source",
- "ready at destination",
- "moving to source",
- "moving to destination",
- "doorclosing"
-};
-#endif
-#endif
-
void UtilizeDoor (int door,void (*action)(int));
void UseDoor (int door);
void Teleport(elevator_t*eptr,int destination);
@@ -346,39 +319,8 @@
memcpy(tptr,&numactions[0],sizeof(numactions));
tptr+=sizeof(numactions);
-#if ((DEVELOPMENT == 1))
-#if (LOADSAVETEST == 1)
- Debug("\n\nSAVE INFO\n");
- Debug("---------");
-
- Debug("\n\nTOUCHINDICES\n");
- Debug("------------\n\n");
- for(i=0; i<MAPSIZE; i++)
- for(j=0; j< MAPSIZE; j++)
- if (touchindices[i][j])
- Debug("\ntouchindices[%3d][%3d]: %d",i,j,touchindices[i][j]);
-
- Debug("\n\nTRIGGER: ");
- for(i=0; i<(sizeof(TRIGGER)/sizeof(TRIGGER[0])); i++)
- if (TRIGGER[i])
- Debug("%1d",TRIGGER[i]);
- Debug("\n\nNUMACTIONS PER TOUCHPLATE\n");
- Debug("-------------------------\n\n");
- for(i=0; i<(sizeof(numactions)/sizeof(numactions[0])); i++)
- if (numactions[i])
- Debug("\n %2d: %2d",i,numactions[i]);
-#endif
-#endif
-
for(i=0; i<lasttouch; i++)
{
-#if ((DEVELOPMENT == 1))
-#if (LOADSAVETEST == 1)
- Debug("\n\nTOUCHPLATE[%2d]\n",i);
- Debug("--------------\n\n");
-#endif
-#endif
-
for(k=0,temp=touchplate[i]; temp; k++,temp = temp->nextaction)
{
dummy.tictime = temp->tictime;
@@ -416,27 +358,6 @@
else
dummy.whichobj = temp->whichobj;
-#if ((DEVELOPMENT == 1))
-#if (LOADSAVETEST == 1)
- Debug("action node %d: tictime: %d, ticcount: %d ",k,dummy.tictime,dummy.ticcount);
- if (dummy.actionindex == -1)
- Debug("action: -1,");
- else
- Debug("action: %13s,",touchstrings[dummy.actionindex]);
-
- if (dummy.swapactionindex == -1)
- Debug("swapaction: -1,");
- else
- Debug("swapaction: %13s,",touchstrings[dummy.swapactionindex]);
-
- if (dummy.whichobj & FL_TACT)
- Debug("whichobj (actor): %4x\n",(dummy.whichobj & ~FL_TACT));
- else
- Debug("whichobj (nonactor): %4x\n",dummy.whichobj);
-#endif
-#endif
-
-
memcpy(tptr,&dummy,sizeof(saved_touch_type));
tptr+=sizeof(saved_touch_type);
}
@@ -525,53 +446,6 @@
}
}
-
-#if ((DEVELOPMENT == 1))
-#if (LOADSAVETEST == 1)
- Debug("\n\nLOAD INFO\n");
- Debug("---------");
-
- Debug("\n\nTOUCHINDICES\n");
- Debug("------------\n\n");
- for(i=0; i<MAPSIZE; i++)
- for(j=0; j< MAPSIZE; j++)
- if (touchindices[i][j])
- Debug("\ntouchindices[%3d][%3d]: %d",i,j,touchindices[i][j]);
-
- Debug("\n\nTRIGGER: ");
- for(i=0; i<(sizeof(TRIGGER)/sizeof(TRIGGER[0])); i++)
- if (TRIGGER[i])
- Debug("%1d",TRIGGER[i]);
- Debug("\n\nNUMACTIONS PER TOUCHPLATE\n");
- Debug("-------------------------\n\n");
- for(i=0; i<(sizeof(numactions)/sizeof(numactions[0])); i++)
- if (numactions[i])
- Debug("\n %2d: %2d",i,numactions[i]);
-
- for(i=0; i<lasttouch; i++)
- {
- Debug("\n\nTOUCHPLATE[%2d]\n",i);
- Debug("--------------\n\n");
-
- for(k=0,temp=touchplate[i]; temp; k++,temp = temp->nextaction)
- {
- Debug("action node %d: tictime: %d, ticcount: %d ",k,temp->tictime,temp->ticcount);
- if (!temp->action)
- Debug("action: NULL,");
- else
- Debug("action: %13s,",touchstrings[GetIndexForAction(temp->action)]);
-
- if (!temp->swapaction)
- Debug("swapaction: NULL,");
- else
- Debug("swapaction: %13s,",touchstrings[GetIndexForAction(temp->swapaction)]);
-
- Debug("whichobj: %4x\n",(int)temp->whichobj);
- }
- }
-#endif
-#endif
-
SafeFree(objlist);
}
@@ -1188,13 +1062,8 @@
int i;
doorobj_t * lastdoorobj;
int up,dn,lt,rt;
- int abovewallstart;
- int swallstart;
int basetexture;
- abovewallstart=W_GetNumForName("ABVWSTRT")+1;
- swallstart=W_GetNumForName("SIDESTRT")+1;
-
doorobjlist[doornum]=(doorobj_t*)Z_LevelMalloc(sizeof(doorobj_t),PU_LEVELSTRUCT,NULL);
if (!doorobjlist[doornum])
Error("SpawnDoor: Failed on allocation of door %d ",doornum);
@@ -2115,14 +1984,8 @@
int side, middle, above, bottom;
maskedwallobj_t * lastmaskobj;
boolean metal;
- int maskedstart;
- int abovemaskedwallstart;
- int swallstart;
himask=W_GetNumForName("HMSKSTRT")+1;
- maskedstart=W_GetNumForName("MASKSTRT");
- abovemaskedwallstart=W_GetNumForName("ABVMSTRT");
- swallstart=W_GetNumForName("SIDESTRT");
maskobjlist[maskednum]=(maskedwallobj_t*)Z_LevelMalloc(sizeof(maskedwallobj_t),PU_LEVELSTRUCT,NULL);
memset(maskobjlist[maskednum],0,sizeof(maskedwallobj_t));
@@ -3036,12 +2899,10 @@
void OperateElevatorDoor(int dnum)
{
elevator_t*eptr;
- doorobj_t *dptr,*door1,*door2;
+ doorobj_t *dptr;
dptr = doorobjlist[dnum];
eptr = &ELEVATOR[dptr->eindex];
- door1 = doorobjlist[eptr->door1];
- door2 = doorobjlist[eptr->door2];
switch(eptr->state)
{ /*
@@ -3050,11 +2911,6 @@
if (dnum == eptr->door1)
{eptr->nextaction = ev_mts;
//eptr->doortoopen = eptr->door1;
- #if (DEVELOPMENT == 1)
- #if (ELEVATORTEST == 1)
- Debug("\nplayer at source requesting elev %d mtd",dptr->eindex);
- #endif
- #endif
}
break;
@@ -3062,11 +2918,6 @@
if (dnum == eptr->door2)
{eptr->nextaction = ev_mtd;
//eptr->doortoopen = eptr->door2;
- #if (DEVELOPMENT == 1)
- #if (ELEVATORTEST == 1)
- Debug("\nplayer at dest requesting elev %d mts",dptr->eindex);
- #endif
- #endif
}
break;
*/
@@ -3074,11 +2925,6 @@
if ((dnum == eptr->door1) && (eptr->nextaction != ev_mts)) // process request, lock doors,
{
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nplayer at source requesting elev %d rad",dptr->eindex);
-#endif
-#endif
// start moving to current loc;
SetNextAction(eptr,0); // if already there, do nothing
@@ -3088,11 +2934,6 @@
case ev_ras:
if ((dnum == eptr->door2) && (eptr->nextaction != ev_mtd))
{
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nplayer at dest requesting elev %d ras",dptr->eindex);
-#endif
-#endif
SetNextAction(eptr,1);
}
@@ -3109,21 +2950,11 @@
else //else prepare for movement
{ if ((eptr->door1 == dnum) && (eptr->nextaction != ev_mts))
{
-#if ((DEVELOPMENT == 1))
-#if ((ELEVATORTEST == 1))
- Debug("\nplayer at source requesting elev %d dc",dptr->eindex);
-#endif
-#endif
SetNextAction(eptr,0);
}
else if ((eptr->door2 == dnum) && (eptr->nextaction != ev_mtd))
{
-#if ((DEVELOPMENT == 1))
-#if ((ELEVATORTEST == 1))
- Debug("\nplayer at dest requesting elev %d dc",dptr->eindex);
-#endif
-#endif
SetNextAction(eptr,1);
}
@@ -3156,11 +2987,6 @@
eptr->state = ev_doorclosing;
eptr->doorclosing = dn;
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nCloseDoor %d",dn);
-#endif
-#endif
if (doorobjlist[dn]->action != dr_closed)
CloseDoor(dn);
doorobjlist[dn]->flags |= DF_ELEVLOCKED;
@@ -3171,7 +2997,7 @@
void OperateElevatorSwitch(objtype*ob,int elevnum,int checkx,int checky)
{ elevator_t*eptr;
- doorobj_t *door1,*door2;
+ doorobj_t *door;
eptr = &ELEVATOR[elevnum];
@@ -3178,36 +3004,20 @@
if ((eptr->state == ev_mts) ||
(eptr->state == ev_mtd))
{
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nobj %d tried to use elevator %d switch while in use",ob->obclass,elevnum);
-#endif
-#endif
return;
}
- door1 = doorobjlist[eptr->door1];
- door2 = doorobjlist[eptr->door2];
+ door = doorobjlist[eptr->door1];
- if ((abs(ob->tilex-door1->tilex)<=1) && //switch at source
- (abs(ob->tiley-door1->tiley)<=1))
+ if ((abs(ob->tilex-door->tilex)<=1) && //switch at source
+ (abs(ob->tiley-door->tiley)<=1))
{ if (!SetNextAction(eptr,1)) // set next to dest
return;
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nswitch at src %d flipped",elevnum);
-#endif
-#endif
eptr->ticcount = 0;
}
else //switch at dest
{ if (!SetNextAction(eptr,0)) // set next to src
return;
-#if (DEVELOPMENT == 1)
-#if (ELEVATORTEST == 1)
- Debug("\nswitch at dest %d flipped",elevnum);
-#endif
-#endif
eptr->ticcount = 0;
}
@@ -4087,19 +3897,6 @@
tilemap[pw->tilex][pw->tiley] = 0;
if (pw->state!=pw_moving)
{
-#if 0
- if (pw->dir==nodir)
- {
- if (tilemap[pw->tilex+1][pw->tiley]==0)
- pw->dir=east;
- else if (tilemap[pw->tilex-1][pw->tiley]==0)
- pw->dir=west;
- else if (tilemap[pw->tilex][pw->tiley+1]==0)
- pw->dir=south;
- else
- pw->dir=north;
- }
-#endif
ConnectPushWall(i);
}
}
--- a/rott/rt_dr_a.h
+++ b/rott/rt_dr_a.h
@@ -34,12 +34,4 @@
void DrawMenuPost (int height, byte * src, byte * buf); // IN rt_dr_a.asm
void DrawMapPost (int height, byte * src, byte * buf); // IN rt_dr_a.asm
-#if defined(__WATCOMC__)
-#pragma aux DrawPost parm [ECX] [ESI] [EDI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux DrawHeightPost parm [ECX] [ESI] [EDI] modify exact [eax ebx ecx edx edi]
-#pragma aux R_DrawWallColumn parm [EDI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux DrawMenuPost parm [ECX] [ESI] [EDI] modify exact [eax ebx ecx edx edi]
-#pragma aux DrawMapPost parm [ECX] [ESI] [EDI] modify exact [eax ebx ecx edx edi]
-#endif
-
#endif
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -638,63 +638,10 @@
return (heightnumerator/nx);
}
-
-
-#if 0
//==========================================================================
-//******************************************************************************
-//
-// NextPlaneptr
-//
-//******************************************************************************
-void NextPlaneptr ( void )
-{
- if (planeptr < &planelist[MAXPLANES-1]) // don't let it overflo'
- planeptr++;
-}
-//******************************************************************************
-//
-// RestPlaneptr
-//
-//******************************************************************************
-
-void ResetPlaneptr ( void )
-{
- planeptr = &planelist[0];
-}
-
-//******************************************************************************
-//
-// NextVisptr
-//
-//******************************************************************************
-
-void NextVisptr ( void )
-{
- if (visptr < &vislist[MAXVISIBLE-1]) // don't let it overflo'
- visptr++;
-}
-
-//******************************************************************************
-//
-// ResetVisptr
-//
-//******************************************************************************
-
-void ResetVisptr ( void )
-{
- visptr = &vislist[0];
-}
-
-#endif
-
-//==========================================================================
-
-
-
/*
=====================
=
@@ -757,9 +704,6 @@
if ((ob->obclass >= p_bazookaobj) || (ob->obclass == missileobj))
{ angle = viewangle - ob->angle;
-#if (0)
- Debug("\nviewangle: %d, angle: %d",viewangle,angle);
-#endif
}
else if ((ob->obclass > wallopobj) && (ob->obclass != b_darksnakeobj))
angle = (viewangle-ANG180)- ob->angle;
@@ -785,9 +729,6 @@
if (ob->state->rotate == 16)
{ rotation = angle/(ANGLES/16);
-#if (0)
- Debug("\nrotation: %d", rotation);
-#endif
return rotation;
}
rotation = angle/(ANGLES/8);
@@ -795,90 +736,7 @@
}
-
-
-#if 0
/*
-=====================
-=
-= DrawMaskedWalls
-=
-=====================
-*/
-
-void DrawMaskedWalls (void)
-{
-
-
- int i,numvisible;
- int gx,gy;
- unsigned short int *tilespot;
- byte *visspot;
- boolean result;
- statobj_t *statptr;
- objtype *obj;
- maskedwallobj_t* tmwall;
-
- whereami=6;
-
-//
-// place maskwall objects
-//
- for(tmwall=FIRSTMASKEDWALL; tmwall; tmwall=tmwall->next)
- {
- if (spotvis[tmwall->tilex][tmwall->tiley])
- {
- mapseen[tmwall->tilex][tmwall->tiley]=1;
- if (tmwall->vertical)
- {
- gx=(tmwall->tilex<<16)+0x8000;
- gy=(tmwall->tiley<<16);
- visptr->texturestart=0;
- visptr->textureend=0;
- if (viewx<gx)
- result=TransformPlane(gx,gy,gx,gy+0xffff,visptr);
- else
- result=TransformPlane(gx,gy+0xffff,gx,gy,visptr);
- visptr->shapenum=tmwall->bottomtexture;
- visptr->altshapenum=tmwall->midtexture;
- visptr->viewx=tmwall->toptexture;
- visptr->shapesize=2;
- }
- else
- {
- gx=(tmwall->tilex<<16);
- gy=(tmwall->tiley<<16)+0x8000;
- visptr->texturestart=0;
- visptr->textureend=0;
- if (viewy<gy)
- result=TransformPlane(gx+0xffff,gy,gx,gy,visptr);
- else
- result=TransformPlane(gx,gy,gx+0xffff,gy,visptr);
- visptr->shapenum=tmwall->bottomtexture;
- visptr->altshapenum=tmwall->midtexture;
- visptr->viewx=tmwall->toptexture;
- visptr->shapesize=2;
- }
- if ((tmwall->flags&MW_TOPFLIPPING) &&
- (nonbobpheight>64)
- )
- {
- visptr->viewx++;
- }
- else if ((tmwall->flags&MW_BOTTOMFLIPPING) &&
- (nonbobpheight>maxheight-32)
- )
- {
- visptr->shapenum++;
- }
- if ((visptr < &vislist[MAXVISIBLE-1]) && (result==true)) // don't let it overflo'
- visptr++;
- }
- }
-}
-#endif
-
-/*
======================
=
= SortScaleds
@@ -936,7 +794,6 @@
int i,numvisible;
int gx,gy;
- unsigned short int *tilespot;
byte *visspot;
boolean result;
statobj_t *statptr;
@@ -1055,21 +912,9 @@
else if (statptr->flags&FL_COLORED)
{
visptr->shapesize=0;
-#if (DEVELOPMENT == 1)
- if ((statptr->hitpoints>=0) &&
- (statptr->hitpoints<MAXPLAYERCOLORS))
- {
-#endif
SetColorLightLevel(statptr->x,statptr->y,visptr,
0,statptr->hitpoints,
(statptr->flags&FL_FULLLIGHT));
-#if (DEVELOPMENT == 1)
- }
- else
- {
- Error("Illegal color map for sprite type %d\n",statptr->itemnumber);
- }
-#endif
}
else
{
@@ -1132,7 +977,6 @@
(visptr->shapenum >= shapestop))
Error("actor shapenum %d out of range (%d-%d)",visptr->shapenum,shapestart,shapestop);
visspot = &spotvis[obj->tilex][obj->tiley];
- tilespot = &tilemap[obj->tilex][obj->tiley];
//
// could be in any of the nine surrounding tiles
@@ -1174,21 +1018,9 @@
playertype *pstate;
M_LINKSTATE(obj,pstate);
-#if (DEVELOPMENT == 1)
- if ((pstate->uniformcolor>=0) &&
- (pstate->uniformcolor<MAXPLAYERCOLORS))
- {
-#endif
SetColorLightLevel(obj->x,obj->y,visptr,
obj->dir,pstate->uniformcolor,
(obj->flags&FL_FULLLIGHT) );
-#if (DEVELOPMENT == 1)
- }
- else
- {
- Error("Illegal color map for players\n");
- }
-#endif
}
else
SetSpriteLightLevel(obj->x,obj->y,visptr,obj->dir,(obj->flags&FL_FULLLIGHT));
@@ -1534,9 +1366,6 @@
oldtime=GetTicCount();
return;
#else
-#if (DEVELOPMENT == 1)
- int i;
-#endif
volatile int tc;
whereami=9;
@@ -1572,35 +1401,7 @@
}
}
oldtime=tc;
-#if (DEVELOPMENT == 1)
- if (graphicsmode==true)
- {
- int drawntics;
-
- VGAWRITEMAP(1);
- drawntics=tics;
- if (drawntics>MAXDRAWNTICS)
- drawntics=MAXDRAWNTICS;
- for (i=0; i<drawntics; i++)
- *((byte *)displayofs+screenofs+(SCREENBWIDE*3)+i)=egacolor[15];
- }
- /*
- if (drawtime>MAXDRAWNTICS)
- drawtime=MAXDRAWNTICS;
- for (i=0;i<drawtime;i++)
- *((byte *)displayofs+screenofs+(SCREENBWIDE*5)+i)=egacolor[2];
- if (walltime>MAXDRAWNTICS)
- walltime=MAXDRAWNTICS;
- for (i=0;i<walltime;i++)
- *((byte *)displayofs+screenofs+(SCREENBWIDE*7)+i)=egacolor[14];
- if (actortime>MAXDRAWNTICS)
- actortime=MAXDRAWNTICS;
- for (i=0;i<actortime;i++)
- *((byte *)displayofs+screenofs+(SCREENBWIDE*9)+i)=egacolor[4];
- }
- */
#endif
-#endif
}
@@ -1940,7 +1741,6 @@
if (doublestep>1)
{
{
- VGAMAPMASK((1<<plane)+(1<<(plane+1)));
buf=(byte *)(bufferofs);
for (post=&posts[plane]; post<&posts[viewwidth]; post+=2,buf+=2)
{
@@ -1955,7 +1755,6 @@
else
{
{
- VGAWRITEMAP(plane);
buf=(byte *)(bufferofs);
for (post=&posts[plane]; post<&posts[viewwidth]; post++,buf++)
{
@@ -2379,7 +2178,6 @@
int dh;
int dx;
int height;
- byte * buf;
whereami=17;
dx=(plane->x2-plane->x1+1);
@@ -2393,7 +2191,6 @@
bot=d2*dx;
botinc=d1-d2;
height=plane->h1<<DHEIGHTFRACTION;
- buf=(byte *)bufferofs;
if (plane->x1>=viewwidth)
return;
for (i=plane->x1; i<=plane->x2; i++)
@@ -2636,7 +2433,6 @@
CurrentFont=tinyfont;
whereami=20;
- VGAMAPMASK(15);
for (i=0; i<18; i++)
memset((byte *)bufferofs+(ylookup[i+PLY])+PLX,0,6);
px=PLX;
@@ -2671,22 +2467,6 @@
whereami=21;
tempptr=player;
-#if (DEVELOPMENT == 1)
- if (Keyboard[sc_9])
- {
- while (Keyboard[sc_9])
- {
- IN_UpdateKeyboard();
- }
- playerview++;
- if (playerview>numplayers)
- playerview=1;
- }
- if (playerview!=0)
- {
- player=PLAYER[playerview-1];
- }
-#endif
//
// Erase old messages
@@ -3446,7 +3226,6 @@
{
mr_yfrac=xct;
mr_xfrac=xst;
- VGAWRITEMAP(plane);
for (y=0; y<Yr; y++,mr_xfrac+=c,mr_yfrac-=s)
DrawRotRow(Xr,screen+ylookup[y],RotatedImage);
}
@@ -3456,7 +3235,6 @@
{
mr_yfrac=xct;
mr_xfrac=xst;
- VGAWRITEMAP(plane);
for (y=0; y<Yr; y++,mr_xfrac+=c,mr_yfrac-=s)
DrawMaskedRotRow(Xr,screen+ylookup[y],RotatedImage);
}
@@ -3481,7 +3259,6 @@
dc_texturemid=(((p->origsize>>1)+p->topoffset)<<SFRACBITS)+(SFRACUNIT>>1);
sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale);
shadingtable=colormap+(1<<12);
- VGAWRITEMAP(x&3);
ScaleMaskedPost(((p->collumnofs[offset])+src), (byte *)bufferofs+x);
}
@@ -3911,269 +3688,9 @@
FlipPage();
}
-#if 0
-//******************************************************************************
-//
-// DoLaserShoot
-//
-//******************************************************************************
-void DoLaserShoot (char * name)
-{
- int sourcex;
- int lastx;
- int sourceheight;
- int destheight;
- int sourcestep;
- int xstep;
- int hstep;
- int midx;
- int startx;
- int dx;
- int f;
- int s;
- int height;
- int x;
- int sx;
- int size;
- patch_t *p;
- byte * shape;
- DrawWorld();
- midx=160;
- shape=W_CacheLumpName(name,PU_CACHE);
- p=(patch_t *)shape;
- size=p->origsize;
-
- startx=midx-(size>>1)-(p->leftoffset);
-
- sourcex=0;
- lastx=startx+p->width;
- sourcestep=(320*65536)/p->width;
- sourceheight=p->origsize<<3;
- destheight=p->origsize;
- CalcTics();
- CalcTics();
-
-
- for (x=startx; x<lastx; x+=tics,sourcex+=(sourcestep*tics))
- {
- for (f=startx; f<=x; f++)
- DrawScaledPost(destheight,shape,f-startx,f);
- height=sourceheight<<16;
- if (x<=midx)
- {
- dx=x-(sourcex>>16);
- xstep=1;
- }
- else
- {
- dx=(sourcex>>16)-x;
- xstep=-1;
- }
- sx=sourcex>>16;
- if (dx)
- hstep=((-destheight+sourceheight)<<16)/dx;
- else
- hstep=0;
- for (s=0; s<dx; s++,height-=hstep,sx+=xstep)
- DrawScaledPost(height>>16,shape,x-startx,sx);
- FlipPage();
- CalcTics();
- DrawWorld();
- break;
- }
-
- // Write out one more time so that the rest of the screen is clear
-
- for (f=startx; f<lastx; f++)
- DrawScaledPost(destheight,shape,f-startx,f);
- FlipPage();
-}
-
-//******************************************************************************
-//
-// DoIntro
-//
-//******************************************************************************
-
-#define MAXMAG (80)
-#define OSCTIME (5*VBLCOUNTER)
-#define OSCXSHIFT (4)
-#define OSCTSHIFT (4)
-
-void DoIntro (void)
-{
- byte * shape;
- byte * origshape;
- int mag;
- int currentmag;
- int magstep;
- int time;
- int x;
- int t;
-
- shadingtable=colormap+(1<<12);
-
- origshape=W_CacheLumpName("ap_wrld",PU_CACHE);
-
- mag=MAXMAG<<16;
- magstep = (MAXMAG<<16)/OSCTIME;
- time = OSCTIME;
- t=0;
-
- CalcTics();
-
- while (time>0)
- {
- int yoffset;
- int ylow;
- int yhigh;
- int offset;
- int postheight;
- byte * src;
-
- shape=origshape;
- VL_ClearBuffer (bufferofs, 0);
- currentmag=mag>>16;
- for (x=0; x<320; x++,shape+=200)
- {
- VGAWRITEMAP(x&3);
- src=shape;
- offset=(t+(x<<OSCXSHIFT))&(FINEANGLES-1);
- yoffset=FixedMul(currentmag,sintable[offset]);
- ylow=yoffset;
- if (ylow<0)
- {
- src-=ylow;
- ylow=0;
- }
- if (ylow>199)
- ylow=199;
- yhigh=yoffset+200;
- if (yhigh>199)
- {
- yhigh=199;
- }
- if (yhigh<0)
- yhigh=0;
- postheight=yhigh-ylow+1;
- if (postheight>0)
- DrawSkyPost((byte *)bufferofs + x + ylookup[ylow],src,postheight);
- }
- FlipPage();
- CalcTics();
- mag -= (magstep * tics);
- time -= tics;
- t += (tics<<OSCTSHIFT);
- if (mag<0) mag = 0;
- }
-}
-
-
-//******************************************************************************
-//
-// DoZIntro
-//
-//******************************************************************************
-
-#define ZMAXMAG (199)
-#define ZOSCTIME (3*VBLCOUNTER)
-#define ZOSCXSHIFT (2)
-#define ZOSCXSTEP ( (FINEANGLES<<(ZOSCXSHIFT+16))/320 )
-#define ZOSCTSHIFT (2)
-
-void DoZIntro (void)
-{
- byte * shape;
- int mag;
- int currentmag;
- int magstep;
- int time;
- int x;
- int t;
-
- SetViewSize (MAXVIEWSIZES-1);
-
- shadingtable=colormap+(1<<12);
-
- shape=W_CacheLumpName("ap_wrld",PU_CACHE);
-
- mag=ZMAXMAG<<16;
- magstep = (ZMAXMAG<<16)/ZOSCTIME;
- time = ZOSCTIME;
- t=0;
-
- CalcTics();
-
-
- while (time>0)
- {
- int zoffset;
- int hoffset;
- int offset;
- int srcoffset;
- int bottomscreen;
- int src;
-// int i;
-
-
- VL_ClearBuffer (bufferofs, 0);
- currentmag=mag>>16;
-
- srcoffset=0;
- for (x=0; x<320;)
- {
- VGAWRITEMAP(x&3);
-
- offset=(t+(FixedMul(x,ZOSCXSTEP)))&(FINEANGLES-1);
- zoffset=FixedMul(currentmag,sintable[offset]);
-// hoffset=FixedMulShift(currentmag,sintable[offset],17);
- hoffset=0;
- dc_texturemid=((100+hoffset)<<SFRACBITS)+(SFRACUNIT>>1);
-
- dc_invscale=((200+zoffset)<<16)/200;
- dc_iscale=0xffffffffu/(unsigned)dc_invscale;
-
- srcoffset+=dc_invscale;
- sprtopoffset=centeryfrac - FixedMul(dc_texturemid,dc_invscale);
- bottomscreen = sprtopoffset + (dc_invscale*200);
- dc_yl = (sprtopoffset+SFRACUNIT-1)>>SFRACBITS;
- dc_yh = ((bottomscreen-1)>>SFRACBITS);
- if (dc_yh >= viewheight)
- dc_yh = viewheight-1;
- if (dc_yl < 0)
- dc_yl = 0;
- if (dc_yl <= dc_yh)
- {
- src=srcoffset>>16;
- if (src>319)
- src=319;
- if (src<0)
- src=0;
- dc_source=shape+(src * 200);
-// if (RandomNumber("hello",0)<128)
- R_DrawColumn ((byte *)bufferofs+x);
- }
-// srcoffset+=0x10000;
- x++;
- if ((LastScan) || IN_GetMouseButtons())
- return;
- }
- FlipPage();
- CalcTics();
- mag -= (magstep * tics);
-// mag += FixedMulShift((magstep * tics),sintable[time&(FINEANGLES-1)],19);
- time -= tics;
- t += (tics<<ZOSCTSHIFT);
- if (mag<0) mag = 0;
- }
-}
-#endif
-
-
-
// Old Stuff
/*
@@ -4280,7 +3797,6 @@
size=linewidth*200;
{
- VGAWRITEMAP(plane);
memcpy((byte *)bufferofs,bkgnd,size);
bkgnd+=size;
}
@@ -4300,7 +3816,6 @@
size=linewidth*200;
{
- VGAREADMAP(plane);
memcpy(bkgnd,(byte *)bufferofs,size);
bkgnd+=size;
}
@@ -4321,9 +3836,7 @@
int dy;
int cx;
int cy;
- int starttime;
-
LastScan = 0;
@@ -4331,7 +3844,6 @@
dy=((endy-y)<<16)/time;
cx=x<<16;
cy=y<<16;
- starttime=time;
CalcTics();
@@ -4575,7 +4087,6 @@
tmp=sky;
for (x=0; x<256; x++)
{
- VGAWRITEMAP(x&3);
for (y=0; y<200; y++)
{
*((byte *)bufferofs+ylookup[y]+x)=*tmp++;
@@ -4584,7 +4095,6 @@
tmp=sky;
for (x=256; x<320; x++)
{
- VGAWRITEMAP(x&3);
for (y=0; y<200; y++)
{
*((byte *)bufferofs+ylookup[y]+x)=*tmp++;
@@ -4647,7 +4157,6 @@
tmp=sky;
for (x=0; x<256; x++)
{
- VGAWRITEMAP(x&3);
for (y=0; y<200; y++)
{
*((byte *)bufferofs+ylookup[y]+x)=*tmp++;
@@ -4656,7 +4165,6 @@
tmp=sky;
for (x=256; x<320; x++)
{
- VGAWRITEMAP(x&3);
for (y=0; y<200; y++)
{
*((byte *)bufferofs+ylookup[y]+x)=*tmp++;
@@ -4833,18 +4341,6 @@
{"EXP1\0",20},
{"GREXP1\0",25},
{"PART1\0",12},
-#if 0
- {"GUTS1\0",12},
- {"ORGAN1\0",12},
- {"RIB1\0",12},
- {"GPINK1\0",12},
- {"GHEAD1\0",12},
- {"GARM1\0",12},
- {"GLEG1\0",12},
- {"GHUM1\0",12},
- {"GHIP1\0",12},
- {"GLIMB1\0",12},
-#endif
};
@@ -6195,35 +5691,6 @@
void DrawSkyPost (byte * buf, byte * src, int height)
{
-#if 0
-// bna fix for missing sky by high res eg 800x600
-// when sky is >400 (max skyheight) then reverse mouintain to missing spot
-// there should be 200 line of mouintain (400+200) = 600 height lines
-// not the best solution but what it works
-
- if (iGLOBAL_SCREENWIDTH > 320) {
- // bna section start
- //int n = 0;
- int orgh = 0;//height;
- if (height > 400) {
- orgh=height;
- }
-
- while (height--) {
- if ((orgh > 0)&&( height<(orgh-400))) {
- src-=2;
- *buf = shadingtable[*src];
- } else {
-
- *buf = shadingtable[*src];
- }
- buf += linewidth;
- src++;
- }
- // bna section end
- }
- else
-#endif
{
int i = 0;
const byte *orig_src = src;
@@ -6281,394 +5748,4 @@
VL_Bar(0, base, iGLOBAL_SCREENHEIGHT, start, FLOORCOLOR);
}
}
-
-#if 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-typedef struct {
- int x;
- int y;
- int angle;
- int speed;
- int color;
- int endx;
- int endy;
- int plane;
- int time;
-} ParticleType;
-
-#define NUMPARTICLES 300
-#define PARTICLETHINKTIME 5
-#define Fix(a) (a &= (FINEANGLES-1))
-ParticleType * Particle;
-int numparticles;
-
-//******************************************************************************
-//
-// InitializeParticles
-//
-//******************************************************************************
-
-void InitializeParticles (void)
-{
- int i;
- ParticleType * part;
-
- Particle=(ParticleType *)SafeMalloc ( sizeof(ParticleType) * numparticles );
- memset ( Particle, 0, sizeof(ParticleType) * numparticles );
-
- for (i=0; i<numparticles; i++)
- {
- part=&Particle[i];
- part->x=((RandomNumber("hello",0)*RandomNumber("hello",0))%viewwidth)<<16;
- part->y=((RandomNumber("hello",0)*RandomNumber("hello",0))%viewheight)<<16;
-// part->x=(((RandomNumber("hello",0)*RandomNumber("hello",0))%(viewwidth-40)+20)<<16);
-// part->y=(((RandomNumber("hello",0)*RandomNumber("hello",0))%(viewheight-40)+20)<<16);
- part->angle=(RandomNumber("hello",0)*RandomNumber("hello",0))%FINEANGLES;
-// part->speed=(RandomNumber("hello",0)%2)<<16;
- part->speed=(1<<16)-1;
- part->color=RandomNumber("hello",0);
- part->endx=-1;
- part->endy=-1;
- part->plane=(part->x>>16)&3;
- part->time=(RandomNumber("",0)%PARTICLETHINKTIME)+1;
-// part->color=255;
- }
-}
-
-//******************************************************************************
-//
-// ShutdownParticles
-//
-//******************************************************************************
-
-void ShutdownParticles (void)
-{
- SafeFree(Particle);
-}
-
-
-void AdjustParticleAngle(int maxadjust, int *currangle,int targetangle)
-{
- int dangle,i,magangle;
-
- for(i=0; i<maxadjust; i++)
- {
- dangle = *currangle - targetangle;
-
- if (dangle)
- {
- magangle = abs(dangle);
- if (magangle > (ANGLES/2))
- {
- if (dangle > 0)
- (*currangle) ++;
- else
- (*currangle) --;
- }
- else
- {
- if (dangle > 0)
- (*currangle) --;
- else
- (*currangle) ++;
- }
- Fix(*currangle);
- }
- }
-}
-
-//******************************************************************************
-//
-// UpdateParticles
-//
-//******************************************************************************
-
-//#define MAXADJUST (FINEANGLES/40)
-#define MAXADJUST (FINEANGLES/20)
-void UpdateParticles (int type)
-{
- int i;
- int dx,dy;
- ParticleType * target;
- ParticleType * part;
-
- if (type==0)
- {
- for (i=0; i<numparticles-1; i++)
- {
- int angle;
-
- part=&Particle[i];
-// target=&Particle[numparticles-1];
-// target=&Particle[i+1];
- target=&Particle[(RandomNumber("",0)*RandomNumber("",0))%numparticles];
- part->x+=-FixedMul (part->speed, costable[part->angle]);
- part->y+= FixedMul (part->speed, sintable[part->angle]);
- part->plane=(part->x>>16)&3;
-
- dx = part->x - target->x;
- dy = target->y - part->y;
- if (dx && dy)
- {
- angle = atan2_appx(dx,dy);
- AdjustParticleAngle(MAXADJUST,&(part->angle),angle);
- }
- }
- part=&Particle[numparticles-1];
- part->x+=-FixedMul (part->speed, costable[part->angle]);
- part->y+= FixedMul (part->speed, sintable[part->angle]);
- part->plane=(part->x>>16)&3;
-
- dx=part->x>>16;
- dy=part->y>>16;
-
- if ( (dx<20) || (dx>(viewwidth-20)) )
- {
- if ( part->angle < (FINEANGLES/2) )
- {
- part->angle=FINEANGLES/2-part->angle;
- Fix(part->angle);
- }
- else
- {
- part->angle=FINEANGLES-part->angle;
- Fix(part->angle);
- }
- }
- if ( (dy<20) || (dy>(viewheight-20)) )
- {
- part->angle=FINEANGLES-part->angle;
- Fix(part->angle);
- }
- }
- else
- {
- for (i=0; i<numparticles; i++)
- {
- int angle;
-
- part=&Particle[i];
- if ((part->x>>16)!=part->endx)
- part->x+=-FixedMul (part->speed, costable[part->angle]);
- else
- part->x=part->endx<<16;
- if ((part->y>>16)!=part->endy)
- part->y+= FixedMul (part->speed, sintable[part->angle]);
- else
- part->y=part->endy<<16;
- part->plane=(part->x>>16)&3;
-
- part->time--;
- if (part->time==0)
- {
- part->time=PARTICLETHINKTIME;
- dx = part->x - (part->endx<<16);
- dy = (part->endy<<16) - part->y;
- if (dx && dy)
- {
- angle = atan2_appx(dx,dy);
- AdjustParticleAngle(MAXADJUST,&(part->angle),angle);
- }
- }
- }
- }
-}
-
-//******************************************************************************
-//
-// DrawParticles
-//
-//******************************************************************************
-
-void DrawParticles (void)
-{
- int i;
- int dx,dy;
- int plane;
- ParticleType * part;
-
- VL_ClearBuffer (bufferofs, 0);
- {
- VGAWRITEMAP(plane);
- for (i=0; i<numparticles; i++)
- {
- part=&Particle[i];
- if (part->plane!=plane)
- continue;
- dx=part->x>>16;
- dy=part->y>>16;
- if (dx<0) dx=0;
- if (dx>=viewwidth) dx=viewwidth-1;
- if (dy<0) dy=0;
- if (dy>=viewheight) dy=viewheight-1;
- *( (byte *) bufferofs + dx + ylookup[dy] ) = part->color;
- }
- }
-}
-
-void DrawParticleTemplate (void)
-{
- byte pal[768];
-
- viewwidth=320;
- viewheight=200;
- memcpy(&pal[0],W_CacheLumpName("ap_pal",PU_CACHE),768);
- VL_NormalizePalette(&pal[0]);
- SwitchPalette(&pal[0],35);
- VL_ClearBuffer (bufferofs, 255);
- DrawNormalSprite (0, 0, W_GetNumForName("ap_titl"));
-}
-
-void DrawAlternateParticleTemplate (void)
-{
- viewwidth=320;
- viewheight=200;
- VL_ClearBuffer (bufferofs, 255);
- DrawNormalSprite (0, 0, W_GetNumForName("LIFE_C1"));
-}
-
-int CountParticles (void)
-{
- int plane,a,b;
- int count;
-
- count=0;
- {
- VGAREADMAP(plane);
- for (a=0; a<200; a++)
- {
- for (b=0; b<320; b++)
- {
- if (*((byte *)bufferofs+(a*linewidth)+b)!=255)
- count++;
- }
- }
- }
- return count;
-}
-
-void AssignParticles (void)
-{
- int plane,a,b;
- byte pixel;
- ParticleType * part;
-
- part=&Particle[0];
- {
- VGAREADMAP(plane);
- for (a=0; a<200; a++)
- {
- for (b=0; b<320; b++)
- {
- pixel = *((byte *)bufferofs+(a*linewidth)+b);
- if (pixel!=255)
- {
- part->endx=b;
- part->endy=a;
- part->color=pixel;
- part++;
- }
- }
- }
- }
-}
-
-//******************************************************************************
-//
-// ParticleIntro
-//
-//******************************************************************************
-
-void ParticleIntro (void)
-{
- int i,j;
-
-
- SetViewSize (MAXVIEWSIZES-1);
- numparticles=NUMPARTICLES;
- DrawAlternateParticleTemplate ();
-// DrawParticleTemplate ();
- numparticles=CountParticles ();
- InitializeParticles ();
- AssignParticles();
-// numparticles>>=1;
-
- CalcTics();
- CalcTics();
- LastScan=0;
- for (i=0; i<VBLCOUNTER*15; i+=tics)
- {
- DrawParticles();
- FlipPage();
- for (j=0; j<tics; j++)
- {
- UpdateParticles(0);
- }
- CalcTics();
- if ((LastScan) || IN_GetMouseButtons())
- break;;
- }
- LastScan=0;
- for (i=0; i<VBLCOUNTER*15; i+=tics)
- {
- DrawParticles();
- FlipPage();
- for (j=0; j<tics; j++)
- {
- UpdateParticles(1);
- }
- CalcTics();
- if ((LastScan) || IN_GetMouseButtons())
- break;;
- }
- ShutdownParticles ();
-}
-
-#endif
--- a/rott/rt_fc_a.h
+++ b/rott/rt_fc_a.h
@@ -31,12 +31,5 @@
void DrawRotRow(int count, byte * dest, byte * src);
void DrawMaskedRotRow(int count, byte * dest, byte * src);
-#if (defined __WATCOMC__)
-#pragma aux DrawSkyPost parm [EDI] [ESI] [ECX] modify exact [eax ecx edx edi esi ebx]
-#pragma aux DrawRow parm [ECX] [EDI] [ESI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux DrawRotRow parm [ECX] [EDI] [ESI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux DrawMaskedRotRow parm [ECX] [EDI] [ESI] modify exact [eax ebx ecx edx esi edi]
-#endif
-
#endif
--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -394,7 +394,6 @@
pic_t *shape;
int shapenum;
- int ShowKillsYoffset = 0;//bna++
//figure out where the middle point of the status bar should be for top bar
topBarCenterOffsetX = (iGLOBAL_SCREENWIDTH - 320) >> 1;
@@ -422,10 +421,6 @@
{
shape = ( pic_t * ) W_CacheLumpName( "bottbar", PU_CACHE, Cvt_pic_t, 1 );
- if ( SHOW_KILLS() )
- {
- ShowKillsYoffset = KILLS_HEIGHT;
- }
if (iGLOBAL_SCREENWIDTH > 320 || iGLOBAL_SCREENHEIGHT > 200)
{
shape = ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
@@ -1661,17 +1656,12 @@
int x;
int y;
int planes;
- byte mask;
byte pixel;
- mask = 1 << (xpos&3);
-
olddest = ylookup[ypos] + xpos;
for (planes = 0; planes < 4; planes++)
{
- VGAMAPMASK (mask);
-
dest = olddest;
dest += planes;
@@ -1730,20 +1720,15 @@
int x;
int y;
int planes;
- byte mask;
byte pixel;
byte * cmap;
cmap=playermaps[color]+(1<<12);
- mask = 1 << (xpos&3);
-
olddest = ylookup[ypos] + xpos;
for (planes = 0; planes < 4; planes++)
{
- VGAMAPMASK (mask);
-
dest = olddest;
dest += planes;
@@ -1904,8 +1889,6 @@
for (planes = 0; planes < 4; planes++)
{
- VGAMAPMASK (mask);
-
dest = olddest;
dest += planes;
@@ -2106,8 +2089,6 @@
for (planes = 0; planes < 4; planes++)
{
- VGAMAPMASK (mask);
-
dest = olddest;
dest += planes;
@@ -2386,11 +2367,8 @@
)
{
- int x;
-
if ( which < stat_gasmask )
{
- x = POWERUP1X;
poweruptime = GetBonusTimeForItem(which);
poweradjust = (poweruptime >> 4);
powerupheight = 0;
@@ -2399,7 +2377,6 @@
}
else
{
- x = POWERUP2X;
protectiontime = GetBonusTimeForItem(which);
poweradjust = (protectiontime >> 4);
protectionheight = 0;
@@ -2584,8 +2561,6 @@
for (planes = 0; planes < 4; planes++)
{
- VGAMAPMASK (mask);
-
dest = olddest;
for (y = 0; y < height; y++)
@@ -2715,8 +2690,6 @@
for (plane = 0; plane<4; plane++)
{
- VGAMAPMASK (mask);
-
screen1 = dest1;
screen2 = dest2;
screen3 = dest3;
@@ -5225,17 +5198,6 @@
size=LoadBuffer(&altbuffer,&bufptr);
LoadPushWalls(altbuffer,size);
SafeFree(altbuffer);
-#if 0
- // Animated Walls Tag
-
- size=5;
- LoadTag(&bufptr,"AWALL",size);
-
- // Animated Walls
- size=LoadBuffer(&altbuffer,&bufptr);
- LoadAnimWalls(altbuffer,size);
- SafeFree(altbuffer);
-#endif
// MaskedWalls Tag
--- a/rott/rt_in.c
+++ b/rott/rt_in.c
@@ -133,22 +133,6 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-#if 0
-const char ScanChars[128] = // Scan code names with single chars
-{
- '?','?','1','2','3','4','5','6','7','8','9','0','-','+','?','?',
- 'Q','W','E','R','T','Y','U','I','O','P','[',']','|','?','A','S',
- 'D','F','G','H','J','K','L',';','\'','?','?','?','Z','X','C','V',
- 'B','N','M',',','.','/','?','?','?',' ','?','?','?','?','?','?',
- '?','?','?','?','?','?','?','?','?','?','-','?','5','?','+','?',
- '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?',
- '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?',
- '?','?','?','?','?','?','?','?','?','?','?','?','?','?','?','?'
-};
-#endif
-
-
-
//****************************************************************************
//
// LOCALS
@@ -229,13 +213,6 @@
} /* else */
} /* else */
-#if 0
- if (mouse_x < 0) mouse_x = 0;
- if (mouse_x > surface->w) mouse_x = surface->w;
- if (mouse_y < 0) mouse_y = 0;
- if (mouse_y > surface->h) mouse_y = surface->h;
-#endif
-
/* set static vars... */
sdl_mouse_delta_x += mouse_relative_x;
sdl_mouse_delta_y += mouse_relative_y;
@@ -560,7 +537,6 @@
{
word x, y;
JoystickDef *def;
- static longword lasttime;
IN_GetJoyAbs (joy, &x, &y);
def = JoyDefs + joy;
@@ -611,7 +587,6 @@
else
*dy = 0;
- lasttime = GetTicCount();
}
@@ -633,34 +608,8 @@
return result;
}
-#if 0
//******************************************************************************
//
-// IN_GetJoyButtonsDB () - Returns the de-bounced button status of the
-// specified joystick
-//
-//******************************************************************************
-
-word IN_GetJoyButtonsDB (word joy)
-{
- longword lasttime;
- word result1,result2;
-
- do
- {
- result1 = INL_GetJoyButtons (joy);
- lasttime = GetTicCount();
- while (GetTicCount() == lasttime)
- ;
- result2 = INL_GetJoyButtons (joy);
- } while (result1 != result2);
-
- return(result1);
-}
-#endif
-
-//******************************************************************************
-//
// INL_StartMouse () - Detects and sets up the mouse
//
//******************************************************************************
@@ -998,8 +947,6 @@
if ((checkcyberman || checkassassin) && (swiftstatus = SWIFT_Initialize ()))
{
- int dynamic;
-
if (checkcyberman)
{
CybermanPresent = swiftstatus;
@@ -1011,8 +958,6 @@
assassinenabled = true;
}
- dynamic = SWIFT_GetDynamicDeviceData ();
-
SWIFT_TactileFeedback (40, 20, 20);
if (SWIFT_GetDynamicDeviceData () == 2)
@@ -1031,30 +976,8 @@
ClearHashTable(scancodes);
}
-
-#if 0
//******************************************************************************
//
-// IN_Default() - Sets up default conditions for the Input Mgr
-//
-//******************************************************************************
-
-void IN_Default (boolean gotit, ControlType in)
-{
- if
- (
- (!gotit)
- || ((in == ctrl_Joystick1) && !JoysPresent[0])
- || ((in == ctrl_Joystick2) && !JoysPresent[1])
- || ((in == ctrl_Mouse) && !MousePresent)
- )
- in = ctrl_Keyboard1;
- IN_SetControlType (0, in);
-}
-#endif
-
-//******************************************************************************
-//
// IN_Shutdown() - Shuts down the Input Mgr
//
//******************************************************************************
@@ -1120,16 +1043,6 @@
case ctrl_Keyboard:
def = &KbdDefs;
-#if 0
- if (Keyboard[def->upleft])
- mx = motion_Left,my = motion_Up;
- else if (Keyboard[def->upright])
- mx = motion_Right,my = motion_Up;
- else if (Keyboard[def->downleft])
- mx = motion_Left,my = motion_Down;
- else if (Keyboard[def->downright])
- mx = motion_Right,my = motion_Down;
-#endif
if (Keyboard[sc_UpArrow])
my = motion_Up;
else if (Keyboard[sc_DownArrow])
@@ -1147,21 +1060,6 @@
realdelta = false;
break;
-#if 0
- case ctrl_Joystick1:
- case ctrl_Joystick2:
- INL_GetJoyDelta (type - ctrl_Joystick, &dx, &dy);
- buttons = INL_GetJoyButtons (type - ctrl_Joystick);
- realdelta = true;
- break;
-
- case ctrl_Mouse:
- INL_GetMouseDelta (&dx,&dy);
- buttons = IN_GetMouseButtons ();
- realdelta = true;
- break;
-
-#endif
default:
;
}
@@ -1463,56 +1361,6 @@
// I_SendKeyboardData(0xf6);
// I_SendKeyboardData(0xf4);
}
-
-
-#if 0
-//******************************************************************************
-//
-// IN_DumpKeyboardQueue ()
-//
-//******************************************************************************
-
-void IN_DumpKeyboardQueue (void)
-{
- int head = Keyhead;
- int tail = Keytail;
- int key;
-
- if (tail != head)
- {
- SoftError( "START DUMP\n");
-
- while (head != tail)
- {
- if (KeyboardQueue[head] & 0x80) // Up event
- {
- key = KeyboardQueue[head] & 0x7F; // AND off high bit
-
-// if (keysdown[key])
-// {
-// SoftError( "%s - was put in next refresh\n",
-// IN_GetScanName (key));
-// }
-// else
-// {
- if (Keyboard[key] == 0)
- SoftError( "%s %ld - was lost\n", IN_GetScanName (key), key);
- else
- SoftError( "%s %ld - up\n", IN_GetScanName (key), key);
-// }
- }
- else // Down event
- SoftError( "%s %ld - down\n", IN_GetScanName (KeyboardQueue[head]), KeyboardQueue[head]);
-
- head = (head+1)&(KEYQMAX-1);
- } // while
-
- SoftError( "END DUMP\n");
-
- } // if
-}
-#endif
-
//******************************************************************************
//
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -106,16 +106,8 @@
boolean infopause;
boolean quiet = false;
-#if (DEVELOPMENT == 1)
-boolean DebugOk = true;
-#else
boolean DebugOk = false;
-#endif
-#if (WHEREAMI==1)
-int programlocation=-1;
-#endif
-
#if SAVE_SCREEN
static char savename[13] = "ROTT0000.LBM";
static int totalbytes;
@@ -264,15 +256,12 @@
// }
if (standalone==false)
{
- int status1 = 0;
int status2 = 0;
- int status3 = 0;
if ( !NoSound && !IS8250 )
{
if (!quiet)
printf( "MU_Startup: " );
- status1 = MU_Startup(false);
if (!quiet)
printf( "%s\n", MUSIC_ErrorString( MUSIC_Error ) );
}
@@ -301,7 +290,6 @@
{
if (!quiet)
printf( "SD_Startup: " );
- status3 = SD_Startup(false);
if (!quiet)
printf( "%s\n", FX_ErrorString( FX_Error ) );
}
@@ -324,21 +312,6 @@
}
I_StartupTimer();
I_StartupKeyboard();
-#if 0
-#if (SHAREWARE == 1)
- if ((!SOUNDSETUP) && (standalone==false))
- {
- byte * txtscn;
- int i;
-
- for (i=0; i<20; i++)
- printf("\n");
- txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("rotts10"), PU_CACHE);
- memcpy ((byte *)0xB8000, txtscn, 4000);
- I_Delay (600);
- }
-#endif
-#endif
locplayerstate = &PLAYERSTATE[consoleplayer];
if (standalone==true)
@@ -423,9 +396,6 @@
{
SetTextMode();
TurnOffTextCursor ();
-#ifdef ANSIESC
- printf("\n\n\n");
-#endif
strcpy (title,"Rise of the Triad Startup Version ");
strcat (title,itoa(ROTTMAJORVERSION,&buf[0],10));
strcat (title,".");
@@ -435,9 +405,7 @@
#else
strcat (title,"DFISH");
#endif
-#ifndef ANSIESC
strcat (title,"\n");
-#endif
px=(80-strlen(title))>>1;
py=0;
@@ -467,9 +435,7 @@
py=1;
UL_printf(title);
-#ifndef ANSIESC
printf ("\n");
-#endif
UL_ColorBox (0, 0, 80, 2, 0x1e);
}
@@ -1059,12 +1025,8 @@
void GameLoop (void)
{
- boolean done = false;
- boolean loadit = false;
int NextLevel;
- wami(1);
-
while (1)
{
//no longer needed in SDL2
@@ -1328,7 +1290,6 @@
break;
case ex_died:
- loadit = done = false;
// SetTextMode ( ); //12345678
Died ();
StopWind();
@@ -1560,7 +1521,6 @@
;
}
}
- waminot();
}
boolean CheckForQuickLoad (void )
@@ -1623,22 +1583,8 @@
//===========================================================================
-#if (DEVELOPMENT == 1)
-extern int totallevelsize;
-#endif
-
void QuitGame ( void )
{
-#if (DEBUG == 1)
- char buf[5];
-#endif
-
-#if (DEVELOPMENT == 1)
- int temp;
-#else
- byte *txtscn;
-#endif
-
MU_FadeOut(200);
while (MU_FadeActive())
{
@@ -1651,64 +1597,6 @@
PrintTileStats();
SetTextMode();
-#if (DEVELOPMENT == 1)
- printf("Clean Exit\n");
- if (gamestate.TimeCount)
- {
- temp=(gamestate.frame*VBLCOUNTER*100)/gamestate.TimeCount;
- printf("fps = %2ld.%2ld\n",temp/100,temp%100);
- }
- printf("argc=%ld\n",_argc);
- for (k=0; k<_argc; k++) printf("%s\n",_argv[k]);
- switch( _heapchk() )
- {
- case _HEAPOK:
- printf( "OK - heap is good\n" );
- break;
- case _HEAPEMPTY:
- printf( "OK - heap is empty\n" );
- break;
- case _HEAPBADBEGIN:
- printf( "ERROR - heap is damaged\n" );
- break;
- case _HEAPBADNODE:
- printf( "ERROR - bad node in heap\n" );
- break;
- }
- printf("\nLight Characteristics\n");
- printf("---------------------\n");
- if (fog)
- printf("FOG is ON\n");
- else
- printf("FOG is OFF\n");
- printf("LIGHTLEVEL=%ld\n",GetLightLevelTile());
- printf("LIGHTRATE =%ld\n",GetLightRateTile());
- printf("\nCENTERY=%ld\n",centery);
-#else
-#if (SHAREWARE==0)
- txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("regend"), PU_CACHE, CvtNull, 1);
-#else
- txtscn = (byte *) W_CacheLumpNum (W_GetNumForName ("shareend"), PU_CACHE, CvtNull, 1);
-#endif
-#if defined (ANSIESC)
- DisplayTextSplash (txtscn, 25);
-#endif
-
-#if (DEBUG == 1)
- px = ERRORVERSIONCOL;
- py = ERRORVERSIONROW;
-#if (BETA == 1)
- UL_printf ("�");
-#else
- UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
-#endif
- // Skip the dot
- px++;
-
- UL_printf (itoa(ROTTMINORVERSION,&buf[0],10));
-#endif
-#endif
-
ClearScanCodes();
exit(0);
@@ -1766,12 +1654,9 @@
objtype * ob,*temp;
battle_status BattleStatus;
- wami(2);
-
if (controlupdatestarted==0)
{
return;
- waminot();
}
atime=GetFastTics();
@@ -1809,12 +1694,6 @@
{
temp = ob->nextactive;
DoActor (ob);
-#if (DEVELOPMENT == 1)
- if ((ob->x<=0) || (ob->y<=0))
- Error("object xy below zero obj->x=%ld obj->y=%ld obj->obclass=%ld\n",ob->x,ob->y,ob->obclass);
- if ((ob->angle<0) || (ob->angle>=FINEANGLES))
- Error("object angle below zero obj->angle=%ld obj->obclass=%ld\n",ob->angle,ob->obclass);
-#endif
ob = temp;
}
@@ -1876,9 +1755,6 @@
FX_SetReverb( min( numareatiles[ player->areanumber ] >> 1, 90 ) );
}
}
-
- waminot();
-
}
extern boolean doRescaling;
@@ -1939,9 +1815,6 @@
boolean canquit = true;
int quittime = 0;
- wami(3);
-
-
if ( (loadedgame == false) && (timelimitenabled == false) )
{
gamestate.TimeCount = 0;
@@ -2036,10 +1909,6 @@
UpdateClientControls();
-#if (DEVELOPMENT == 1)
- Z_CheckHeap();
-#endif
-
if ( AutoDetailOn == true )
{
AdaptDetail();
@@ -2177,7 +2046,6 @@
}
}
}
- waminot();
}
//******************************************************************************
@@ -2190,7 +2058,6 @@
{
int num=-1;
- wami(4);
switch (scancode)
{
case sc_F1:
@@ -2235,7 +2102,6 @@
AddRemoteRidiculeCommand ( consoleplayer, MSG_DIRECTED_TO_ALL, num );
LastScan=0;
}
- waminot();
}
//******************************************************************************
@@ -2264,8 +2130,6 @@
{
static char autopressed = false;
- wami(5);
-
if (demoplayback==true)
{
IN_UpdateKeyboard();
@@ -2304,13 +2168,6 @@
autopressed = false;
}
-#if 0
- if ( modemgame == false )
- {
- CheckDevelopmentKeys();
- }
-#endif
-
if ( ( MSG.messageon == false ) && ( !quitactive ) )
{
if ( ( Keyboard[ buttonscan[ bt_message ] ] ) && ( BATTLEMODE ) )
@@ -2459,7 +2316,6 @@
}
}
-//#if 0
if ( ( Keyboard[ sc_F12 ] ) && ( !BATTLEMODE ) )
{
Keyboard[ sc_F12 ] = false;
@@ -2466,7 +2322,6 @@
LastScan = 0;
DoBossKey();
}
-//#endif
// Gamma correction
if ( Keyboard[ sc_F11 ] )
@@ -2489,23 +2344,6 @@
IN_UpdateKeyboard();
}
}
-#if 0
- if ( Keyboard[ sc_M ] )
- {
- char str[ 50 ] = "Mouse Y-Rotation Input Scale ";
- char str2[ 10 ];
-
- if ( Keyboard[ sc_RShift ] )
- mouse_ry_input_scale += 50;
- else
- mouse_ry_input_scale -= 50;
-
- itoa(mouse_ry_input_scale,str2,10);
- strcat( str, str2 );
- AddMessage( str, MSG_SYSTEM );
-
- }
-#endif
// Increase volume
if ( Keyboard[ sc_CloseBracket ] )
{
@@ -2577,16 +2415,6 @@
}
#if SAVE_SCREEN
-#if (DEVELOPMENT == 1)
- if ( Keyboard[ sc_CapsLock ] && Keyboard[ sc_C ] )
- {
- SaveScreen( true );
- }
- else if ( Keyboard[ sc_CapsLock ] && Keyboard[ sc_X ] )
- {
- SaveScreen( false );
- }
-#endif
else if ( Keyboard[ sc_Alt] && Keyboard[ sc_C ] )
{
SaveScreen( false );
@@ -2608,245 +2436,8 @@
Keystate[0x45] = 0;
}
#endif
- waminot();
}
-
-//******************************************************************************
-//
-// CheckDevelopmentKeys ()
-//
-//******************************************************************************
-#if 0
-void CheckDevelopmentKeys
-(
- void
-)
-
-{
-#if (DEBUG == 1)
- if ( Keyboard[ sc_CapsLock ] && Keyboard[ sc_T ] )
- {
- if ( warp == true )
- {
- player->x = warpx;
- player->y = warpy;
- player->angle = warpa;
- locplayerstate->anglefrac = warpa << ANGLEBITS;
- player->momentumx = 0;
- player->momentumy = 0;
- player->momentumz = 0;
- }
- return;
- }
-#endif
-
- // Lower wall height
- if ( Keyboard[ sc_5 ] )
- {
- if ( levelheight > 1 )
- {
- levelheight--;
- }
-
- while( Keyboard[ sc_5 ] )
- {
- IN_UpdateKeyboard ();
- }
-
- maxheight = ( levelheight << 6 ) - 32;
- nominalheight = maxheight - 32;
- }
-
- // Raise wall height
- if ( Keyboard[ sc_6 ] )
- {
- levelheight++;
-
- while( Keyboard[ sc_6 ] )
- {
- IN_UpdateKeyboard();
- }
-
- maxheight = ( levelheight << 6 ) - 32;
- nominalheight = maxheight - 32;
- }
-
- if ( Keyboard[ sc_8 ] )
- {
- char str[ 50 ] = "You are now player ";
- char str2[ 10 ];
-
- locplayerstate->player++;
- if ( locplayerstate->player == 5 )
- {
- locplayerstate->player = 0;
- }
-
- while( Keyboard[ sc_8 ] )
- {
- IN_UpdateKeyboard ();
- }
-
- itoa( locplayerstate->player, str2, 10 );
- strcat( str, str2 );
- AddMessage( str, MSG_SYSTEM );
- }
-
-#if 0
- // Cycle forward through wall textures
- if (Keyboard[sc_W] && (modemgame==false))
- { int i,j;
-
- for(i=0; i<128; i++)
- for(j=0; j<128; j++)
- { if (IsWall(i,j))
- { if (tilemap[i][j] ==
- (W_GetNumForName("WALLSTOP")-W_GetNumForName("WALLSTRT")-1))
- tilemap[i][j] = 1;
- else
- tilemap[i][j] ++;
- }
- }
- while(Keyboard[sc_W])
- IN_UpdateKeyboard ();
-
- }
-
-
-
- if (Keyboard[sc_Q] && (modemgame==false))
- { int i,j;
-
- for(i=0; i<128; i++)
- for(j=0; j<128; j++)
- { if (IsWall(i,j))
- { if (tilemap[i][j] == 1)
- tilemap[i][j] = 74;
- else
- tilemap[i][j] --;
- }
- }
- while(Keyboard[sc_Q])
- IN_UpdateKeyboard ();
-
- }
-
-#endif
- // Step through cieling/skies
- if ( Keyboard[ sc_K ] )
- {
- if ( sky > 0 )
- {
- MAPSPOT( 1, 0, 0 )++;
- if ( MAPSPOT( 1, 0, 0 ) > 239 )
- {
- MAPSPOT( 1, 0, 0 ) = 234;
- }
- }
- else
- {
- MAPSPOT( 1, 0, 0 )++;
- if ( MAPSPOT( 1, 0, 0 ) > 198 + 15 )
- {
- MAPSPOT( 1, 0, 0 ) = 198;
- }
- }
-
- SetPlaneViewSize();
-
- while( Keyboard[ sc_K ] )
- {
- IN_UpdateKeyboard();
- }
- }
-
- // Step through floors
- if ( Keyboard[ sc_L ] )
- {
- MAPSPOT( 0, 0, 0 )++;
- if ( MAPSPOT( 0, 0, 0 ) > 180 + 15 )
- {
- MAPSPOT( 0, 0, 0 ) = 180;
- SetPlaneViewSize();
-
- while( Keyboard[ sc_L ] )
- {
- IN_UpdateKeyboard();
- }
- }
- }
-
- // Increase darkness level
- if ( Keyboard[ sc_M ] )
- {
- if ( darknesslevel < 7 )
- {
- darknesslevel++;
- }
-
- SetLightLevels( darknesslevel );
-
- while( Keyboard[ sc_M ] )
- {
- IN_UpdateKeyboard();
- }
- }
-
- // Decrease darkness level
- if ( Keyboard[ sc_N ] )
- {
- if ( darknesslevel > 0 )
- {
- darknesslevel--;
- }
-
- SetLightLevels( darknesslevel );
-
- while( Keyboard[ sc_N ] )
- {
- IN_UpdateKeyboard();
- }
- }
-
- // Increase light rate
- if ( Keyboard[ sc_B ] )
- {
- SetLightRate( GetLightRate() + 1 );
- myprintf( "normalshade = %ld\n", normalshade );
-
- while( Keyboard[ sc_B ] )
- {
- IN_UpdateKeyboard();
- }
- }
-
- // Decrease light rate
- if ( Keyboard[ sc_V ] )
- {
- SetLightRate( GetLightRate() - 1 );
- myprintf( "normalshade = %ld\n", normalshade );
-
- while( Keyboard[ sc_V ] )
- {
- IN_UpdateKeyboard();
- }
- }
-
- // Toggle light diminishing on/off
- if ( Keyboard[ sc_T ] )
- {
- fulllight ^= 1;
-
- while( Keyboard[ sc_T ] )
- {
- IN_UpdateKeyboard();
- }
- }
-}
-#endif
-
-
#if SAVE_SCREEN
@@ -3031,10 +2622,6 @@
boolean inhmenu;
-#if (BETA == 1)
-#define SSX (160-(46*2))
-#define SSY (17)
-#endif
void SaveScreen (boolean saveLBM)
{
byte *buffer;
@@ -3042,13 +2629,6 @@
boolean oldHUD;
char filename[ 128 ];
-#if (BETA == 1)
- unsigned tmp;
- char buf[30];
- int i;
-#endif
-
-
oldHUD=HUD;
HUD=false;
doublestep=0;
@@ -3064,39 +2644,6 @@
//buffer = (byte *) SafeMalloc (65000);
buffer = (byte *) SafeMalloc ((iGLOBAL_SCREENHEIGHT*iGLOBAL_SCREENWIDTH)+4000);
-#if (BETA == 1)
- if (SCREENSHOTS == false)
- {
- if (screen!=(byte *)bufferofs)
- {
- tmp=bufferofs;
- bufferofs=displayofs;
- }
- CurrentFont=tinyfont;
-
- VGAMAPMASK(15);
- for (i=-1; i<6; i++)
- memset((byte *)bufferofs+(ylookup[i+SSY])+(SSX>>2),0,46);
- px=SSX;
- py=SSY;
- VW_DrawPropString(" Rise of the Triad (c) 1995 Apogee Version ");
- VW_DrawPropString(itoa(ROTTMAJORVERSION,&buf[0],10));
- VW_DrawPropString(".");
- VW_DrawPropString(itoa(ROTTMINORVERSION,&buf[0],10));
- px=SSX+13;
- py=SSY+8;
- VW_DrawPropString(" Episode ");
- VW_DrawPropString(itoa(gamestate.episode,&buf[0],10));
- VW_DrawPropString(" Area ");
- VW_DrawPropString(itoa(GetLevel(gamestate.episode, gamestate.mapon),&buf[0],10));
-
- if (screen!=(byte *)bufferofs)
- bufferofs=tmp;
- }
-#endif
-
-
-
GetFileName (saveLBM);
GetPathFromEnvironment( filename, ApogeePath, savename );
//
@@ -3106,21 +2653,13 @@
if (saveLBM)
{
WriteLBMfile (filename, buffer, iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT);
-#if (DEVELOPMENT == 1)
- while (Keyboard[sc_CapsLock] && Keyboard[sc_C])
-#else
while (Keyboard[sc_Alt] && Keyboard[sc_V])
-#endif
IN_UpdateKeyboard ();
}
else
{
WritePCX (filename, buffer);
-#if (DEVELOPMENT == 1)
- while (Keyboard[sc_CapsLock] && Keyboard[sc_X])
-#else
while (Keyboard[sc_Alt] && Keyboard[sc_C])
-#endif
IN_UpdateKeyboard ();
}
--- a/rott/rt_main.h
+++ b/rott/rt_main.h
@@ -145,10 +145,6 @@
void ShutDown ( void );
void UpdateGameObjects ( void );
-#if (WHEREAMI==1)
-extern int programlocation;
-#endif
-
extern int polltime;
extern int oldpolltime;
extern volatile int oldtime;
@@ -160,10 +156,6 @@
void SetupWads( void );
extern boolean SCREENSHOTS;
-extern boolean MEMORYTEST;
-extern boolean MODEMTEST;
-extern boolean STATICMEMORYTEST;
-extern boolean STATICMEMORYPREVIEWTEST;
extern boolean COMPUTELEVELSIZE;
extern boolean MONOPRESENT;
extern boolean MAPSTATS;
--- a/rott/rt_map.c
+++ b/rott/rt_map.c
@@ -967,13 +967,6 @@
if (control.dir==dir_North)
dy=-(tics<<17)/(5-mapscale);
}
-#if (DEVELOPMENT == 1)
- if (Keyboard[sc_M])
- {
- CheatMap();
- ChangeMapScale( &x, &y, mapscale );
- }
-#endif
x+=dx;
y+=dy;
--- a/rott/rt_menu.c
+++ b/rott/rt_menu.c
@@ -4943,33 +4943,6 @@
ci->button2=ci->button3=false;
}
}
-
-
-#if 0
- if (SpaceBallPresent && spaceballenabled)
- {
- SP_Get(&packet);
-
- if (packet.button)
- {
- if (packet.button & SP_BTN_1)
- ci->button0 = true;
-
- if (packet.button & SP_BTN_2)
- ci->button1 = true;
- }
-
- if (packet.ty > MENU_AMT)
- ci->dir = dir_North;
- else if (packet.ty < -MENU_AMT)
- ci->dir = dir_South;
-
- if (packet.tx < (-MENU_AMT* 6))
- ci->dir = dir_West;
- else if (packet.tx > (MENU_AMT * 6))
- ci->dir = dir_East;
- }
-#endif
}
@@ -5134,10 +5107,6 @@
)
{
- int oldvolume;
-
- oldvolume = FXvolume;
-
SliderMenu( &FXvolume, 254, 0, 33, 81, 225, 8, "block3", FX_SetVolume,
"Sound Volume", "Low", "High" );
--- a/rott/rt_msg.c
+++ b/rott/rt_msg.c
@@ -542,11 +542,7 @@
break;
default :
-#if ((DEVELOPMENT == 1))
- Error( "DisplayMessage called with invalid priority number." );
-#else
fontcolor = egacolor[ LIGHTGREEN ];
-#endif
}
DrawIString( PrintX, PrintY, Messages[ num ].text, Messages[ num ].flags );
--- a/rott/rt_net.c
+++ b/rott/rt_net.c
@@ -141,25 +141,7 @@
//****************************************************************************
#define ComError SoftError
-#if 0
-void ComError (char *error, ...)
-{
-#if 0
- va_list argptr;
-#endif
- SoftError(error);
-#if 0
- if (standalone==true)
- {
- va_start (argptr, error);
- vprintf (error, argptr);
- va_end (argptr);
- }
-#endif
-}
-#endif
-
//****************************************************************************
//
// ConsoleIsServer()
@@ -320,14 +302,6 @@
server=consoleplayer^1;
}
}
-#if 0
-#if (DEVELOPMENT == 1)
- if (IsServer)
- ComError("I am the server\n");
- ComError("consoleplayer=%ld\n",consoleplayer);
- ComError("server=%ld mynumber=%ld\n",server,consoleplayer);
-#endif
-#endif
}
@@ -446,9 +420,6 @@
void ShutdownClientControls ( void )
{
int i;
-#if (DEVELOPMENT == 1)
- SoftError ("LARGEST time difference=%ld\n",largesttime);
-#endif
controlupdatestarted=0;
for (i=0; i<numplayers; i++)
{
@@ -569,11 +540,6 @@
}
}
-
-#if (DEVELOPMENT == 1)
-// ComError("StartupClientControls: GetTicCount()=%ld oldtime=%ld controlupdatetime=%ld\n",GetTicCount(),oldtime,controlupdatetime);
-#endif
-
if ((demoplayback==false) && (standalone==false))
{
if (modemgame==true)
@@ -613,19 +579,6 @@
else
InUCC = true;
- wami(6);
-
-#if 0
-
- delta=GetTicCount()-lastcontrolupdatetime;
- if (delta>largesttime)
- {
- if (delta>10)
- largesttime=delta;
- largesttime=delta;
- }
-
-#endif
lastcontrolupdatetime=GetTicCount();
if (standalone==false)
@@ -749,19 +702,15 @@
// take out
if (modemgame==true)
{
-//#if (DEVELOPMENT == 1)
if (PanicPressed==true)
{
Error("Game Aborted. Scroll Lock pressed\n");
}
-//#endif
if (Keyboard[sc_Insert] && Keyboard[sc_Q])
Error("Game Aborted. Insert->Q pressed\n");
}
InUCC = false;
-
- waminot();
}
//****************************************************************************
@@ -791,20 +740,15 @@
//****************************************************************************
void CheckForPacket ( void )
{
- wami(7);
while (ReadPacket()==true)
{
if (badpacket==0)
{
ProcessPacket(&ROTTpacket[0], rottcom->remotenode);
-#if (DEVELOPMENT == 1)
-// ComError("CheckForPacket: from=%ld\n",rottcom->remotenode);
-#endif
}
else
RequestPacket (LastCommandTime[rottcom->remotenode]+controldivisor, rottcom->remotenode, controldivisor);
}
- waminot();
}
@@ -971,8 +915,6 @@
{
MoveType * pkt;
- wami(8);
-
pkt=(MoveType *)NextLocalCommand();
pkt->time=controlupdatetime;
@@ -989,12 +931,7 @@
if (modemgame==true)
SendPacket (pkt, server);
-#if (DEVELOPMENT == 1)
-// ComError("packet sent: realtime=%ld time=%ld type=%ld dest=%ld\n",GetTicCount(),pkt->time,pkt->type,server);
-#endif
-
controlupdatetime+=controldivisor;
- waminot();
}
@@ -1142,9 +1079,6 @@
ComError("SendPacket:Problems\n");
else
WritePacket(pkt,GetPacketSize(pkt),dest);
-#if (DEVELOPMENT == 1)
-// ComError( "SendPacket: time=%ld dest=%ld\n",((MoveType *)pkt)->time,dest);
-#endif
}
//****************************************************************************
@@ -1194,16 +1128,6 @@
cmd = CommandAddress(time);
-#if 0
- if (networkgame==false)
- {
- int nump;
- nump=controlupdatetime-time;
- if (nump>numpackets)
- numpackets=nump;
- }
-#endif
-
if (controlupdatetime<=time)
return;
@@ -1391,10 +1315,6 @@
fix=(COM_FixupType *)pkt;
ComError( "Fixup received at %d, time=%d numpackets=%d\n", GetTicCount(), fix->time, fix->numpackets);
-#if 0
- if (networkgame==false)
- FixingPackets=false;
-#endif
time=fix->time;
ptr=&(fix->data);
@@ -1567,66 +1487,8 @@
}
#endif
-#if 0
-
//****************************************************************************
//
-// CheckForSyncTime
-//
-//****************************************************************************
-
-void CheckForSyncTime ( void )
-{
- if ((modemgame==true) && (networkgame==false) && (consoleplayer==0))
- {
- if (controlupdatetime>=syncservertime)
- {
- SendSyncTimePacket();
- syncservertime+=MODEMSYNCSERVERTIME;
- }
- }
-}
-#endif
-
-#if 0
-//****************************************************************************
-//
-// SendSyncTimePacket
-//
-//****************************************************************************
-
-void SendSyncTimePacket ( void )
-{
- int i;
- COM_SyncType sync;
-
- return;
-
- sync.type=COM_SYNCTIME;
-
- if (networkgame==true)
- {
- for (i=0; i<numplayers; i++)
- {
- if ((PlayerStatus[i]!=player_ingame) || ( (i==consoleplayer) && (standalone==false) ) )
- continue;
- sync.synctime=GetTicCount()+GetTransitTime(i);
- WritePacket ( &sync.type, GetPacketSize(&sync.type), i);
- }
- }
- else
- {
- if (PlayerStatus[server]==player_ingame)
- {
- sync.synctime=GetTicCount()+GetTransitTime(server);
- WritePacket ( &sync.type, GetPacketSize(&sync.type), server);
- }
- }
-}
-#endif
-
-//****************************************************************************
-//
// ProcessSoundAndDeltaPacket
//
//****************************************************************************
@@ -1686,17 +1548,6 @@
// SoftError("diff=%ld\n",diff);
// if (abs(diff)>1)
// ISR_SetTime(GetTicCount()-diff);
-#if 0
- diff = controlupdatetime-LastCommandTime[0];
- if (diff>3)
- {
- ISR_SetTime(GetTicCount()-1);
- }
- else if (diff<-3)
- {
- ISR_SetTime(GetTicCount()+1);
- }
-#endif
// }
// else
// {
@@ -1995,12 +1846,6 @@
COM_RequestType request;
int i;
-
-#if (DEVELOPMENT == 1)
- if (modemgame==false)
- Error("Called Request Packet outside of modem game\n");
-#endif
-
request.type=COM_REQUEST;
request.time=time;
request.numpackets=numpackets/controldivisor;
@@ -2033,10 +1878,6 @@
// send out the packet
WritePacket (&request, GetPacketSize(&request), dest);
-
-#if (DEVELOPMENT == 1)
-// ComError( "BADPKT, request sent at %ld lgt=%ld dest=%ld\n",GetTicCount(),time,dest);
-#endif
}
//****************************************************************************
@@ -2198,7 +2039,6 @@
boolean exit;
int i;
int time;
- int quittime;
if (InProcessServer==true)
return;
@@ -2209,7 +2049,6 @@
goto exitProcessServer;
time=GetTicCount();
- quittime=GetTicCount()+SERVERTIMEOUT;
exit=false;
while (time>=serverupdatetime)
@@ -2250,10 +2089,6 @@
}
savetime=GetTicCount()+NETWORKTIMEOUT;
}
-// if (GetTicCount()>quittime)
-// {
-// Error("Server aborting after %ld seconds\n",SERVERTIMEOUT/VBLCOUNTER);
-// }
if ((standalone==false) && (done==false))
{
exit=true;
@@ -2267,13 +2102,6 @@
if (restartgame==true)
break;
SendFullServerPacket();
-#if 0
- if (serverupdatetime>=syncservertime)
- {
- SendSyncTimePacket();
- syncservertime+=NETSYNCSERVERTIME;
- }
-#endif
}
exitProcessServer:
InProcessServer=false;
@@ -2379,9 +2207,6 @@
while(1)
{
ProcessServer();
-#if (DEVELOPMENT == 1)
- Z_CheckHeap();
-#endif
CalcTics();
if (restartgame==true)
break;
@@ -2598,21 +2423,6 @@
if (ob->flags&FL_PUSHED)
{
ob->flags&=~FL_PUSHED;
-#if 0
- if (abs(ob->momentumx)>0)
- {
- if (abs(ob->momentumx+pstate->dmomx)>=abs(ob->momentumx))
- {
- ob->momentumx += pstate->dmomx;
- ob->momentumy += pstate->dmomy;
- }
- }
- else if (abs(ob->momentumy+pstate->dmomy)>=abs(ob->momentumy))
- {
- ob->momentumx += pstate->dmomx;
- ob->momentumy += pstate->dmomy;
- }
-#endif
if (abs(ob->momentumx+pstate->dmomx)>=abs(ob->momentumx))
{
ob->momentumx += pstate->dmomx;
@@ -2683,22 +2493,6 @@
if (demoplayback||demorecord) {
SoftError(" dmx=%4x dmy=%4x da=%4x time=%5d\n",pstate->dmomx,pstate->dmomy,pstate->angle>>11,oldpolltime);
}
-#if 0
-#if (DEVELOPMENT == 1)
- if ((modemgame==true) || (demoplayback==true) || (demorecord==true))
- {
- ComError( "player#%2ld\n",player);
- ComError( "momx = %6ld\n", PLAYER[player]->momentumx);
- ComError( "momy = %6ld\n", PLAYER[player]->momentumy);
- ComError( " x = %6ld\n", PLAYER[player]->x);
- ComError( " y = %6ld\n", PLAYER[player]->y);
- ComError( " z = %6ld\n", PLAYER[player]->z);
- ComError( " a = %6ld\n", PLAYER[player]->angle);
- if (pstate->buttonstate[bt_attack])
- ComError( "FIRING\n");
- }
-#endif
-#endif
}
--- a/rott/rt_net.h
+++ b/rott/rt_net.h
@@ -101,7 +101,7 @@
short momy;
word dangle;
word buttons;
- char Sounddata[0];
+ char Sounddata[];
} MoveType;
typedef struct NullMoveType {
--- a/rott/rt_playr.c
+++ b/rott/rt_playr.c
@@ -60,11 +60,6 @@
#define FLYINGZMOM 350000
-
-#if (DEVELOPMENT == 1)
-#include "rt_str.h"
-#endif
-
extern boolean usejump;
@@ -555,10 +550,6 @@
*/
void SpawnPlayerobj (int tilex, int tiley, int dir, int playerindex)
{
- playertype *pstate;
-
- pstate = &PLAYERSTATE[playerindex];
-
GetNewActor();
MakeActive(new);
@@ -5717,7 +5708,6 @@
{
int pitheight;
int godheight;
- int dogheight;
int height;
int oldz;
int destheightoffset;
@@ -5725,7 +5715,6 @@
pitheight = maxheight - 8;
height = ob->z + pstate->playerheight;
- dogheight = ob->z + DOGOFFSET;
godheight = ob->z + GODOFFSET;
//SoftError("\nheightoffset: %d, temp2: %d",pstate->heightoffset,ob->temp2);
--- a/rott/rt_rand.c
+++ b/rott/rt_rand.c
@@ -24,9 +24,6 @@
#include "rt_util.h"
#include <time.h>
-#if (DEVELOPMENT == 1)
-#include "rt_main.h"
-#endif
//MED
#include "memcheck.h"
@@ -72,9 +69,7 @@
void SetRNGindex ( int i )
{
rndindex=i;
-//#if (DEVELOPMENT == 1)
SoftError("RNG index set at %d\n",i);
-//#endif
}
//****************************************************************************
@@ -89,21 +84,8 @@
}
-#if (RANDOMTEST==1)
//****************************************************************************
//
-// int GameRNG ( char * string, int val )
-//
-//****************************************************************************
-int GameRNG ( char * string, int val )
-{
- rndindex = (rndindex+1)&(SIZE_OF_RANDOM_TABLE-1);
- SoftError("RNG - num=%3d called from=%s val=%d\n",RandomTable[rndindex],string,val);
- return RandomTable[rndindex];
-}
-#else
-//****************************************************************************
-//
// int GameRNG (void)
//
//****************************************************************************
@@ -113,26 +95,11 @@
return RandomTable[rndindex];
}
-#endif
-#if (RANDOMTEST==1)
//****************************************************************************
//
-// int RNG ( char * string, int val )
-//
-//****************************************************************************
-
-int RNG ( char * string, int val )
-{
- sndindex = (sndindex+1)&(SIZE_OF_RANDOM_TABLE-1);
-// SoftError("SRNG - num=%3ld called from=%s val=%ld\n",RandomTable[sndindex],string,val);
- return RandomTable[sndindex];
-}
-#else
-//****************************************************************************
-//
// int RNG (void)
//
//****************************************************************************
@@ -143,5 +110,4 @@
return RandomTable[sndindex];
}
-#endif
--- a/rott/rt_rand.h
+++ b/rott/rt_rand.h
@@ -25,26 +25,11 @@
void InitializeRNG ( void );
int GetRandomSeed ( void );
-
-#if RANDOMTEST
-
-int GameRNG ( char * string, int val );
-#define GameRandomNumber(string,val) GameRNG(string, val)
-
-int RNG ( char * string, int val );
-#define RandomNumber(string,val) RNG(string, val)
-
-#else
-
int GameRNG ( void );
#define GameRandomNumber(string,val) GameRNG()
int RNG ( void );
#define RandomNumber(string,val) RNG()
-
-#endif
-
-
void SetRNGindex ( int i );
int GetRNGindex ( void );
--- a/rott/rt_sc_a.h
+++ b/rott/rt_sc_a.h
@@ -31,11 +31,4 @@
void R_TransColumn (byte * buf);
void R_DrawClippedColumn (byte * buf);
-#if defined(__WATCOMC__)
-#pragma aux R_DrawColumn parm [EDI] modify exact [eax ebx ecx edx esi edi]
-#pragma aux R_DrawSolidColumn parm [EBX] [EDI] modify exact [eax ecx edi]
-#pragma aux R_TransColumn parm [EDI] modify exact [eax ebx esi edi]
-#pragma aux R_DrawClippedColumn parm [EDI] modify exact [eax ebx ecx edx esi edi]
-#endif
-
#endif
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -169,38 +169,8 @@
int bottomscreen;
byte * oldlevel;
byte * seelevel;
-#if (DEVELOPMENT == 1)
- boolean found=false;
- int i;
-#endif
whereami=25;
-#if (DEVELOPMENT == 1)
- if ((shadingtable>=colormap) && (shadingtable<=(colormap+(31*256))))
- {
- found=true;
- }
- else if ((shadingtable>=redmap) && (shadingtable<=(redmap+(31*256))))
- {
- found=true;
- }
- else
- {
- for (i=0; i<MAXPLAYERCOLORS; i++)
- {
- if ((shadingtable>=playermaps[i]) || (shadingtable<=(playermaps[i]+(31*256))))
- found=true;
- }
- }
- if (found==false)
- {
- Error ("Shadingtable out of range\n");
- }
- if ((level<0) || (level>=64))
- {
- Error ("translucent level out of range\n");
- }
-#endif
seelevel=colormap+(((level+64)>>2)<<8);
oldlevel=shadingtable;
@@ -265,10 +235,6 @@
{
dc_source=src-offset;
R_DrawColumn (buf);
-#if (DEVELOPMENT == 1)
-// if (dc_firstsource<src)
-// SoftError("dc_firstsource=%p src=%p\n",dc_firstsource,src);
-#endif
}
src+=length;
offset=*(src++);
@@ -521,7 +487,6 @@
{
{
frac=startfrac;
-// VGAWRITEMAP(plane&3);
for (x1=startx; x1<=x2; x1+=2, frac += (dc_iscale<<1))
{
if (
@@ -612,16 +577,6 @@
frac=0;
x2 = x2 >= viewwidth ? viewwidth-1 : x2;
-#if 0
- for (; x1<=x2 ; x1++, frac += dc_iscale)
- {
- if (posts[x1].wallheight>sprite->viewheight)
- continue;
- VGAWRITEMAP(x1&3);
- VGAREADMAP(x1&3);
- ScaleTransparentPost(((p->collumnofs[frac>>SFRACBITS])+shape),(byte *)bufferofs+(x1>>2),sprite->h2);
- }
-#endif
startx=x1;
startfrac=frac;
@@ -778,7 +733,6 @@
{
frac=startfrac;
b=(byte *)bufferofs+startx;
- VGAWRITEMAP(plane&3);
for (x1=startx; x1<=x2 ; x1++, frac += dc_iscale,b++)
ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
}
@@ -1050,72 +1004,6 @@
}
}
}
-
-#if 0
-byte *shape;
-int frac;
-patch_t *p;
-int x1,x2;
-int tx;
-int xdc_invscale;
-int xdc_iscale;
-byte * buf;
-byte * b;
-int plane;
-int startx,startfrac;
-
-whereami=39;
-SetPlayerLightLevel();
-buf=(byte *)bufferofs;
-shape=W_CacheLumpNum(lump,PU_CACHE);
-p=(patch_t *)shape;
-dc_invscale=(viewheight<<16)/200;
-xdc_invscale=(viewwidth<<16)/320;
-
-tx=-p->leftoffset;
-centeryclipped=viewheight>>1;
-//
-// calculate edges of the shape
-//
-x1 = (tx*xdc_invscale)>>SFRACBITS;
-if (x1 >= viewwidth)
- return; // off the right side
-tx+=p->width;
-x2 = ((tx*xdc_invscale)>>SFRACBITS) - 1 ;
-if (x2 < 0)
- return; // off the left side
-
-dc_iscale=(200*65536)/viewheight;
-xdc_iscale=(320*65536)/viewwidth;
-dc_texturemid=(((p->height>>1)+p->topoffset)<<SFRACBITS)+(SFRACUNIT>>1);
-sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale);
-
-//
-// store information in a vissprite
-//
-if (x1<0)
-{
- frac=xdc_iscale*(-x1);
- x1=0;
-}
-else
- frac=0;
-x2 = x2 >= viewwidth ? viewwidth-1 : x2;
-
-startx=x1;
-startfrac=frac;
-for (plane=startx; plane<startx+4; plane++,startfrac+=xdc_iscale)
-{
- frac=startfrac;
- b=(byte *)bufferofs+(plane>>2);
- VGAWRITEMAP(plane&3);
- for (x1=plane; x1<=x2 ; x1+=4, frac += xdc_iscale<<2,b++)
- ScaleClippedPost(((p->collumnofs[frac>>SFRACBITS])+shape),b);
-}
-}
-#endif
-
-
//******************************************************************************
//
--- a/rott/rt_sound.c
+++ b/rott/rt_sound.c
@@ -68,10 +68,6 @@
-1, -1, -1, -1, -1, -1, SoundScape, -1, -1, -1, -1
};
-#if 0
-void MU_SetupGUSInitFile( void );
-#endif
-
int MUSIC_GetPosition( void ) {
songposition pos;
@@ -124,29 +120,8 @@
W_CacheLumpNum(SoundNumber(sndnum),PU_CACHE, CvtNull, 1);
}
-#if 0
//***************************************************************************
//
-// SD_PrintActive
-//
-//***************************************************************************
-void SD_PrintActive ( void )
-{
- int i;
-
- myprintf("Active Sounds\n");
- for (i=0; i<MAXSOUNDS; i++)
- {
- if (sounds[i].count>0)
- {
- myprintf("sound active #%ld\n",i);
- }
- }
-}
-#endif
-
-//***************************************************************************
-//
// SD_SetupFXCard - Initialize sound Tables and start up sound card
//
//***************************************************************************
@@ -314,12 +289,6 @@
int voice;
byte * snd;
-#if (DEVELOPMENT == 1)
-#if (SOUNDTEST == 1)
- SoftError("SOUND =%d \n",sndnum);
-#endif
-#endif
-
if (!(sounds[sndnum].flags & SD_WRITE))
{
if (sounds[sndnum].count)
@@ -353,17 +322,6 @@
if ( voice < FX_Ok )
{
-#if (DEVELOPMENT == 1)
- /*
- if (MV_ErrorCode == MV_InvalidVOCFile)
- {
- Error("SD_PlayIt: Invalid VOC File snd=%p sndnum=%ld lump=%ld\n",snd,sndnum,SoundNumber(sndnum));
- }
- */
- NumBadSounds++;
- SoftError("SD_PlayIt: Error/Warning %s\n",FX_ErrorString( FX_Error ));
- SoftError("BadSoundNumber %ld time %ld\n",NumBadSounds,GetTicCount());
-#endif
SD_MakeCacheable( sndnum );
return 0;
@@ -565,14 +523,6 @@
if (!FX_SoundActive(sndnum))
return;
-
- status=FX_SetPitch( sndnum, pitch );
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_SetSoundPitch : %s\n",FX_ErrorString( status ));
-#endif
- }
}
//***************************************************************************
@@ -611,15 +561,6 @@
{
angle = 0;
}
-
- status = FX_Pan3D ( handle, angle, distance );
-
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_PanPositionedSound: %s\n",FX_ErrorString( status ));
-#endif
- }
}
//***************************************************************************
@@ -637,15 +578,6 @@
if (!FX_SoundActive(handle))
return;
-
- status=FX_SetPan( handle, vol, left, right );
-
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_SetPan: %s\n",FX_ErrorString( status ));
-#endif
- }
}
//***************************************************************************
@@ -684,15 +616,6 @@
{
angle = 0;
}
-
- status=FX_Pan3D( handle, angle, distance );
-
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_PanPositionedSound: %s\n",FX_ErrorString( status ));
-#endif
- }
}
@@ -708,15 +631,6 @@
if (SD_Started==false)
return;
-
- status=FX_StopSound( handle);
-
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_StopSound: %s\n",FX_ErrorString( status ));
-#endif
- }
}
//***************************************************************************
@@ -731,15 +645,6 @@
if (SD_Started==false)
return;
-
- status=FX_StopAllSounds();
-
- if (status != FX_Ok)
- {
-#if (DEVELOPMENT == 1)
- SoftError("SD_StopAllSounds: %s\n",FX_ErrorString( status ));
-#endif
- }
}
//***************************************************************************
@@ -1174,9 +1079,6 @@
return;
if (!MUSIC_SongPlaying())
{
-#if (DEVELOPMENT == 1)
- SoftError("Called FadeOut with no song playing\n");
-#endif
return;
}
MUSIC_FadeVolume(0,time);
--- a/rott/rt_sqrt.h
+++ b/rott/rt_sqrt.h
@@ -40,70 +40,4 @@
long FixedSqrtLP(long n); // Low Precision (8.8)
long FixedSqrtHP(long n); // High Precision (8.16)
-#ifdef __WATCOMC__
-#pragma aux FixedSqrtLP = \
- " xor eax, eax" \
- " mov ebx, 40000000h" \
- "sqrtLP1: mov edx, ecx" \
- " sub edx, ebx" \
- " jl sqrtLP2" \
- " sub edx, eax" \
- " jl sqrtLP2" \
- " mov ecx,edx" \
- " shr eax, 1" \
- " or eax, ebx" \
- " shr ebx, 2" \
- " jnz sqrtLP1" \
- " shl eax, 8" \
- " jmp sqrtLP3" \
- "sqrtLP2: shr eax, 1" \
- " shr ebx, 2" \
- " jnz sqrtLP1" \
- " shl eax, 8" \
- "sqrtLP3: nop" \
- parm caller [ecx] \
- value [eax] \
- modify [eax ebx ecx edx];
-
-
-#pragma aux FixedSqrtHP = \
- " xor eax, eax" \
- " mov ebx, 40000000h" \
- "sqrtHP1: mov edx, ecx" \
- " sub edx, ebx" \
- " jb sqrtHP2" \
- " sub edx, eax" \
- " jb sqrtHP2" \
- " mov ecx,edx" \
- " shr eax, 1" \
- " or eax, ebx" \
- " shr ebx, 2" \
- " jnz sqrtHP1" \
- " jz sqrtHP5" \
- "sqrtHP2: shr eax, 1" \
- " shr ebx, 2" \
- " jnz sqrtHP1" \
- "sqrtHP5: mov ebx, 00004000h" \
- " shl eax, 16" \
- " shl ecx, 16" \
- "sqrtHP3: mov edx, ecx" \
- " sub edx, ebx" \
- " jb sqrtHP4" \
- " sub edx, eax" \
- " jb sqrtHP4" \
- " mov ecx, edx" \
- " shr eax, 1" \
- " or eax, ebx" \
- " shr ebx, 2" \
- " jnz sqrtHP3" \
- " jmp sqrtHP6" \
- "sqrtHP4: shr eax, 1" \
- " shr ebx, 2" \
- " jnz sqrtHP3" \
- "sqrtHP6: nop" \
- parm caller [ecx] \
- value [eax] \
- modify [eax ebx ecx edx];
-#endif
-
#endif
--- a/rott/rt_stat.c
+++ b/rott/rt_stat.c
@@ -1854,20 +1854,13 @@
*/
void DoSprites(void)
-{ int index,i;
+{ int index;
statobj_t *temp,*tempnext;
-#if (0)
- Debug("\n");
-#endif
- i=0;
for(temp = firstactivestat; temp;)
{ tempnext = temp->nextactive;
-#if (0)
- Debug("\nid: %d, shapenum: %d, numanims: %d",i++,temp->shapenum,temp->numanims);
-#endif
if ((temp->shapenum != NOTHING) && (temp->flags & FL_ACTIVE))
{ index = temp->itemnumber;
--- a/rott/rt_str.c
+++ b/rott/rt_str.c
@@ -103,7 +103,6 @@
if ((x>=0) && (x<iGLOBAL_SCREENWIDTH))
{
y=oy;
- VGAWRITEMAP(x&3);
height = ht;
while (height--)
{
@@ -132,12 +131,10 @@
char c,
*se;
char *s;
- int startx;
strcpy(strbuf, string);
s = strbuf;
- startx=x;
while (*s)
{
se = s;
@@ -236,16 +233,11 @@
byte pix;
int width,step,height,ht;
byte *source, *dest, *origdest;
- int ch,mask;
+ int ch;
-
ht = CurrentFont->height;
dest = origdest = (byte *)(bufferofs+ylookup[py]+px);
-
- mask = 1<<(px&3);
-
-
while ((ch = (unsigned char)*string++)!=0)
{
ch -= 31;
@@ -253,8 +245,6 @@
source = ((byte *)CurrentFont)+CurrentFont->charofs[ch];
while (width--)
{
- VGAMAPMASK(mask);
-
height = ht;
while (height--)
{
@@ -1313,7 +1303,6 @@
pic_t *Win2;
pic_t *Win3;
pic_t *Win4;
- pic_t *Win5;
pic_t *Win6;
pic_t *Win7;
pic_t *Win8;
@@ -1328,8 +1317,6 @@
Win3 = (pic_t *) shape;
shape = W_CacheLumpNum (W_GetNumForName ("window4"), PU_CACHE, Cvt_pic_t, 1);
Win4 = (pic_t *) shape;
- shape = W_CacheLumpNum (W_GetNumForName ("window5"), PU_CACHE, Cvt_pic_t, 1);
- Win5 = (pic_t *) shape;
shape = W_CacheLumpNum (W_GetNumForName ("window6"), PU_CACHE, Cvt_pic_t, 1);
Win6 = (pic_t *) shape;
shape = W_CacheLumpNum (W_GetNumForName ("window7"), PU_CACHE, Cvt_pic_t, 1);
@@ -1430,18 +1417,13 @@
{
byte pix;
- int px1,py1;
- int width,w1;
- int height,h1;
+ int width;
+ int height;
int ht;
- byte *source,*src1;
+ byte *source;
byte *dest;
- byte *origdest,*orgdst1;
- int mask;
+ byte *origdest;
- px1 = px;
- py1 = py;
-
ht = IFont->height;
origdest = ( byte * )( bufferofs + ylookup[ py ] + px );
@@ -1452,13 +1434,9 @@
width = IFont->width[ (unsigned char)ch ];
source = ( ( byte * )IFont ) + IFont->charofs[ (unsigned char)ch ];
- mask = 1 << ( px & 3 );
-
if ((iGLOBAL_SCREENWIDTH <= 320)||(StretchScreen == true)) {
while( width-- )
{
- VGAMAPMASK( mask );
-
height = ht;
while( height-- )
{
@@ -1477,14 +1455,8 @@
dest = origdest;
}
} else { //strech letter in x any direction
- w1 = width;
- h1 = ht;
- orgdst1 = origdest;
- src1 = source;
while( width-- )
{
- VGAMAPMASK( mask );
-
height = ht;
while( height-- )
{
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -259,9 +259,6 @@
return;
if (!W_LumpLength(lump))
{
-#if (PRECACHETEST == 1)
- SoftError("Tried to precache a label, lump = %ld tag=%ld maskednum=%ld\n",lump, level, maskednum);
-#endif
return;
}
for (i=1; i<cacheindex; i++)
@@ -298,9 +295,6 @@
{
if (!W_LumpLength(j))
{
-#if (PRECACHETEST == 1)
- SoftError("Tried to precache a label, lump = %ld\n",j);
-#endif
continue;
}
found=0;
@@ -885,39 +879,6 @@
end =W_GetNumForName("MISSMO14");
PreCacheGroup(start,end,cache_patch_t);
-#if (DEVELOPMENT == 1)
- // cache in all weapon sounds
- SD_PreCacheSoundGroup(SD_ATKPISTOLSND,SD_LOSEMODESND);
-
- // cache in misc player weapons
-#if (SHAREWARE == 0)
- start=W_GetNumForName("KNIFE1");
- end =W_GetNumForName("DOGPAW4");
- PreCacheGroup(start,end,cache_patch_t);
- // cache in kinetic sphere
- start=W_GetNumForName("KSPHERE1");
- end =W_GetNumForName("KSPHERE4");
- PreCacheGroup(start,end,cache_patch_t);
-
-#else
- start=W_GetNumForName("MPIST11");
- end =W_GetNumForName("GODHAND8");
- PreCacheGroup(start,end,cache_patch_t);
-#endif
-
-
- // cache in god mode stuff
-
- PreCacheGroup(W_GetNumForName("VAPO1"),
- W_GetNumForName("LITSOUL"),
- cache_patch_t);
-
- PreCacheGroup(W_GetNumForName("GODFIRE1"),
- W_GetNumForName("GODFIRE4"),
- cache_patch_t);
-
-
-#endif
// cache in player's gun
// cache in rubble
@@ -1129,7 +1090,6 @@
{
int i;
int total;
- byte * dummy;
int maxheapsize;
int newheap;
@@ -1199,7 +1159,6 @@
ticdelay=CACHETICDELAY;
for (i=1; i<cacheindex; i++)
{
- dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtForType(cachelist[i].type), 1);
total+=W_LumpLength(cachelist[i].lump);
newheap=Z_UsedHeap();
currentmem=(newheap*MAXLEDS)/maxheapsize;
@@ -1293,37 +1252,11 @@
;
}
// EnableScreenStretch();
-#if (DEVELOPMENT == 1)
- tempbuf=bufferofs;
- bufferofs=displayofs;
- CurrentFont = smallfont;
- US_CenterWindow(30,6);
- PrintY+=6;
- US_Print("Max Heap Size:");
- US_PrintUnsigned(maxheapsize);
- US_Print("\n");
- US_Print("Used Heap Size:");
- US_PrintUnsigned(newheap);
- US_Print("\n");
- US_Print("Percentage Used:");
- US_PrintUnsigned(newheap*100/maxheapsize);
- US_Print("\n");
- US_Print("TotalPrecached:");
- US_PrintUnsigned(total);
- bufferofs=tempbuf;
- I_Delay (40);
-#endif
-#if (PRECACHETEST == 1)
- SoftError("Max Heap Size: %ld\n",maxheapsize);
- SoftError("Used Heap Size: %ld\n",newheap);
- SoftError("TotalPrecached: %ld\n",total);
-#endif
}
else
{
for (i=1; i<cacheindex; i++)
{
- dummy=W_CacheLumpNum(cachelist[i].lump,cachelist[i].cachelevel, CvtForType(cachelist[i].type), 1);
DoLoadGameAction ();
}
ShutdownPreCache ();
@@ -1335,9 +1268,6 @@
MapDebug("Map Number %d\n",gamestate.mapon);
MapDebug("sizeoflevel=%d\n",Z_UsedLevelHeap());
}
-#if (PRECACHETEST == 1)
- SoftError("<<<<<<<<<<<<<<<<<<<<<<<Precaching done\n");
-#endif
doRescaling = true;
}
@@ -2017,13 +1947,6 @@
if (tile <= 32)
{
index = tile;
-#if 0
- if (tile==12)
- {
- if (MAPSPOT(i,j,2)==0)
- MAPSPOT(i,j,2)=21;
- }
-#endif
}
else
index = tile-3;
@@ -2358,9 +2281,6 @@
numchecked ++;
rand = (rand + 1) % NUMSPAWNLOCATIONS;
}
-#if (DEVELOPMENT == 1)
- SoftError("\nno spawn locations available, using FindEmptyTile");
-#endif
nx = SPAWNLOC[rand].x;
ny = SPAWNLOC[rand].y;
ndir = SPAWNLOC[rand].dir;
@@ -2570,24 +2490,6 @@
//numplayers = 1;
//Error("Okay");
-#if ((DEVELOPMENT == 1))
-#if (TEAMTEST == 1)
-
- Debug("Team Spawn Location\n");
- Debug("-------------------\n");
- for(i=0; i<numteams; i++)
- Debug("%d %3d,%3d\n",i,TEAM[i].tilex,TEAM[i].tiley);
-
-
- Debug("Player Team Location\n");
- Debug("------ ---- --------\n");
- for(i=0; i<numplayers; i++)
- Debug(" %d %d %3d,%3d\n",i,PLAYERSTATE[i].team,PLAYER[i]->tilex,PLAYER[i]->tiley);
-
-// Error("done");
-#endif
-#endif
-
}
@@ -2840,18 +2742,6 @@
Error ("Illegal Maskedwall platform value at x=%d y=%d\n",i,j);
break;
}
-#if 0
- if (IsPlatform(i+1,j))
- {
- if ( (IsPlatform(i,j+1)) || (IsPlatform(i,j-1)) )
- SpawnStatic(i,j,83,MAPSPOT(i,j,2));
- }
- else if (IsPlatform(i-1,j))
- {
- if ( (IsPlatform(i,j+1)) || (IsPlatform(i,j-1)) )
- SpawnStatic(i,j,83,MAPSPOT(i,j,2));
- }
-#endif
}
else
Error("You have what appears to be a platform ontop\n a wall at x=%d y=%d\n",i,j);
@@ -3061,12 +2951,6 @@
touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff);
if (touchindices[touchx][touchy])
{
- if (MAPSPOT(i,j+1,2)!=0)
- {
-#if (DEVELOPMENT == 1)
- SoftError("MAPWARNING:You left a delay for a linked push wall under the pushwall\n at x=%ld y=%ld\n",i,j);
-#endif
- }
Link_To_Touchplate(touchx,touchy,ActivatePushWall,NULL,GetPushWallNumber(i,j),0);
}
else
@@ -3096,12 +2980,6 @@
touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff);
if (touchindices[touchx][touchy])
{
- if (MAPSPOT(i,j+1,2)!=0)
- {
-#if (DEVELOPMENT == 1)
- SoftError("MAPWARNING:You left a delay for a linked push wall under the pushwall\n at x=%ld y=%ld\n",i,j);
-#endif
- }
Link_To_Touchplate(touchx,touchy,ActivateMoveWall,NULL,GetPushWallNumber(i,j),0);
}
else
@@ -3122,12 +3000,6 @@
touchy = (word) ((MAPSPOT(i,j,2) >> 0) & 0xff);
if (touchindices[touchx][touchy])
{
- if (MAPSPOT(i,j+1,2)!=0)
- {
-#if (DEVELOPMENT == 1)
- SoftError("MAPWARNING:You left a delay for a linked push wall under the pushwall\n at x=%ld y=%ld\n",i,j);
-#endif
- }
Link_To_Touchplate(touchx,touchy,ActivateMoveWall,NULL,GetPushWallNumber(i,j),0);
}
else
@@ -3254,12 +3126,6 @@
}
}
-#if ((DEVELOPMENT == 1))
-#if ((ELEVATORTEST == 1))
- for(i=0; i<_numelevators; i++)
- Debug("\nelevator %d door1 %2d, door2 %2d",i,ELEVATOR[i].door1,ELEVATOR[i].door2);
-#endif
-#endif
}
@@ -3373,7 +3239,6 @@
int clockx,clocky;
int doornumber;
word touchx,
- tile,
touchy;
map = mapplanes[0];
@@ -3381,8 +3246,6 @@
for (j = 0; j < mapheight; j++)
for (i = 0; i < mapwidth; i++)
{
- tile = *map++;
-
if (MAPSPOT (i, j, 2))
{
if (IsDoor(i,j)==1)
@@ -3733,15 +3596,6 @@
SpawnSpring(i,j);
break;
-#if 0
- case 460:
-// if ( gamestate.Product != ROTT_SHAREWARE )
- {
- SpawnNewObj(i,j,&s_wind,inertobj);
- }
- break;
-#endif
-
case 462:
case 463:
case 464:
@@ -4304,155 +4158,9 @@
return -1;
}
-
-
-
-#if (DEVELOPMENT == 1)
-
-
/*
==================
=
-= Insane Dump
-=
-==================
-*/
-
-void InsaneDump(void)
-{
- int i,j,level;
- word *map,tile;
- int tally[1000];
- int inlevel[1000][10];
-
- if (TILESTATS==false)
- return;
-
- OpenMapDebug();
-
-
-// WALLS
- memset(tally,0,sizeof(tally));
- memset(inlevel,0,sizeof(inlevel));
- MapDebug("=======================\n");
- MapDebug("= WALLS\n");
- MapDebug("=======================\n");
- mapheight = mapwidth = 128;
- BATTLEMODE = 1;
- for(level=0; level<8; level ++)
- {
- GetEpisode(level);
- LoadROTTMap(level);
- map = mapplanes[0];
- for (j=0; j<mapheight; j++)
- {
- for(i=0; i<mapwidth; i++)
- { tile = *map++;
- if (IsWall(i,j)==true)
- { tally[tile]++;
- inlevel[tile][level]=1;
- }
-
- }
- }
- }
-
- MapDebug("Wall # Frequency Levels\n");
- MapDebug("----------------------------\n");
- for (i=0; i<1000; i++)
- if (i < 90)
- { MapDebug("%4d %4d %s",i,tally[i],
- W_GetNameForNum(GetLumpForTile(i)));
- MapDebug(" ");
- for(level=0; level < 10; level ++)
- if (inlevel[i][level])
- MapDebug("%d,",level);
- MapDebug("\n");
- }
-
-
-
-
-
-// Doors
- memset(tally,0,sizeof(tally));
- memset(inlevel,0,sizeof(inlevel));
- MapDebug("=======================\n");
- MapDebug("= DOORS\n");
- MapDebug("=======================\n");
- for(level=0; level<10; level ++)
- {
- GetEpisode(level);
- LoadROTTMap(level);
- map = mapplanes[0];
- for (j=0; j<mapheight; j++)
- {
- for(i=0; i<mapwidth; i++)
- { tile = *map++;
- if (IsDoor(i,j)==true)
- { tally[tile]++;
- inlevel[tile][level]=1;
- }
-
- }
- }
- }
-
- MapDebug("Door # Frequency Levels\n");
- MapDebug("----------------------------\n");
- for (i=0; i<1000; i++)
- if (tally[i]!=0)
- { MapDebug("%4d %4d ",i,tally[i]);
- for(level=0; level < 10; level ++)
- if (inlevel[i][level])
- MapDebug("%d,",level);
- MapDebug("\n");
-
- }
-
-// MaskedWalls
- memset(tally,0,sizeof(tally));
- memset(inlevel,0,sizeof(inlevel));
- MapDebug("=======================\n");
- MapDebug("= MASKED WALLS\n");
- MapDebug("=======================\n");
- for(level=0; level<10; level ++)
- {
- GetEpisode(level);
- LoadROTTMap(level);
- map = mapplanes[0];
- for (j=0; j<mapheight; j++)
- {
- for(i=0; i<mapwidth; i++)
- { tile = *map++;
- if ((IsMaskedWall(i,j)) && (!IsPlatform(i,j)))
- { tally[tile]++;
- inlevel[tile][level]=1;
- }
-
- }
- }
- }
-
- MapDebug("MWall # Frequency Levels\n");
- MapDebug("----------------------------\n");
- for (i=0; i<1000; i++)
- if (tally[i]!=0)
- { MapDebug("%4d %4d ",i,tally[i]);
- for(level=0; level < 10; level ++)
- if (inlevel[i][level])
- MapDebug("%d,",level);
- MapDebug("\n");
-
- }
-
-}
-
-#endif
-
-/*
-==================
-=
= PrintTileStats
=
==================
@@ -5119,20 +4827,6 @@
*map = 29;
break;
-#if 0
- case 37:
- case 38:
- case 39:
- *map = 36;
- break;
-
- case 41:
- case 42:
- case 43:
- *map = 40;
- break;
-#endif
-
case 50:
case 51:
case 52:
@@ -5139,20 +4833,6 @@
*map = 49;
break;
-#if 0
- case 55:
- case 56:
- case 57:
- *map = 54;
- break;
-
- case 59:
- case 60:
- case 61:
- *map = 58;
- break;
-#endif
-
case 66:
case 67:
case 68:
@@ -5225,18 +4905,6 @@
case 233:
*map = 44;
break;
-
-#if 0
- //Skys
- case 234:
- case 235:
- case 236:
- case 237:
- case 238:
- case 239:
- *map=(*(&(mapplanes[0][MAPSIZE*(0)+(0)]))) + 18;
- break;
-#endif
}
}
}
@@ -5252,26 +4920,6 @@
*/
void DoLowMemoryConversionIconPlane (void)
{
-#if 0
- int i,j;
- word * map;
-
-
- for (j=0; j<mapheight; j++)
- {
- for(i=0; i<mapwidth; i++)
- {
- map=&(mapplanes[2][MAPSIZE*(j)+(i)]);
- switch (*map)
- {
- case 13:
- *(&(mapplanes[0][MAPSIZE*(j)+(i)]))=21;
- *map=0;
- break;
- }
- }
- }
-#endif
}
@@ -5596,28 +5244,6 @@
{
// int i,j;
// word * map;
-
-
-#if 0
- for (j=0; j<mapheight; j++)
- {
- for(i=0; i<mapwidth; i++)
- {
- map=&MAPSPOT(i,j,1);
- switch (*map)
- {
- //sprites
- case 42:
- case 43:
- case 63:
- case 64:
- *map = 43;
- break;
-
- }
- }
- }
-#endif
}
/*
@@ -5711,24 +5337,6 @@
int crud;
int i;
-#if 0
- mapwidth = mapheight = 128;
-
- InsaneDump();
- /*
- for(i=0;i<11;i++)
- {GetEpisode(i);
- LoadROTTMap(i);
- MapDebug("\n//================================//");
- MapDebug("\n// SHAREWARE LEVEL %d //",i);
- MapDebug("\n//================================//\n\n");
-
- PrintTileStats();
- }
- */
- Error("okay");
-#endif
-
insetupgame=true;
InitializeRNG ();
@@ -5902,20 +5510,7 @@
if (loadedgame==false)
{
ConnectAreas();
-#if (DEVELOPMENT == 1)
-#if (PRECACHETEST == 1)
- SoftError("Start PreCaching\n");
-#endif
-#endif
-#if (DEVELOPMENT == 1)
- PrintMapStats();
-#endif
PreCache();
-#if (DEVELOPMENT == 1)
-#if (PRECACHETEST == 1)
- SoftError("Done PreCaching\n");
-#endif
-#endif
SetupPlayScreen();
SetupScreen(false);
}
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -84,10 +84,6 @@
extern const byte * ROTT_ERR;
-#if (DEVELOPMENT == 1)
-int TotalStaticMemory=0;
-#endif
-
#define SWAP(a,b) \
{ \
a=(a)^(b); \
@@ -328,9 +324,6 @@
SetTextMode ();
-#if defined (ANSIESC)
- DisplayTextSplash (&ROTT_ERR, 7);
-#endif
memset (msgbuf, 0, 300);
va_start (argptr, error);
@@ -364,11 +357,6 @@
GetToken (true);
}
-#ifdef ANSIESC
- for (i = 0; i < 8; i++)
- printf ("\n");
-#endif
-
if (player!=NULL)
{
printf ("Player X = %lx\n", (long int)player->x);
@@ -394,8 +382,6 @@
exit (1);
}
-//#if (SOFTERROR==1)
-
/*
=================
=
@@ -414,11 +400,6 @@
va_end (argptr);
}
-//#endif
-
-
-//#if (DEBUG == 1)
-
/*
=================
=
@@ -437,8 +418,6 @@
va_end (argptr);
}
-//#endif
-
/*
=================
=
@@ -498,17 +477,6 @@
*/
void StartupSoftError ( void )
{
-#if (DEBUG == 1)
- if (DebugStarted==false)
- {
- debugout = fopen(DEBUGFILE,"wt+");
- DebugStarted=true;
- }
-#endif
-#if (SOFTERROR == 1)
- if (SoftErrorStarted==false)
- OpenSoftError();
-#endif
}
/*
@@ -1439,11 +1407,7 @@
void UL_printf (byte *str)
{
-#ifdef ANSIESC
- printf ("\x1b[%d;%dH%s",py,px,str);
-#else
printf ("%s ",str); // Hackish but works - DDOI
-#endif
}
/*
@@ -1456,19 +1420,6 @@
void UL_ColorBox (int x, int y, int w, int h, int color)
{
-#if defined (ANSIESC)
- int i,j;
-
-
- for (j=0; j<h; j++)
- {
- for (i=0; i<w; i++)
- {
- printf ("\x1b[%d;%dH",y+j,x+i);
- put_dos2ansi(color);
- }
- }
-#endif
}
//******************************************************************************
--- a/rott/rt_util.h
+++ b/rott/rt_util.h
@@ -142,60 +142,17 @@
void _dos_getdate(struct dosdate_t *date);
-
-#if (SOFTERROR==1)
-
void SoftwareError (char *error, ...) __attribute__((format(printf,1,2)));
-#define SoftError SoftwareError
-#else
-void SoftwareError (char *error, ...) __attribute__((format(printf,1,2)));
-//#define SoftError SoftwareError
-
#define SoftError if (1) {} else SoftwareError
-//#define SoftError
-
-#endif
-
-#if (DEBUG==1)
-
void DebugError (char *error, ...) __attribute__((format(printf,1,2)));
#define Debug DebugError
-
-#else
-
-void DebugError (char *error, ...) __attribute__((format(printf,1,2)));
-#define Debug DebugError
//#define Debug
-#endif
-
void Square (void);
-#ifdef __WATCOMC__
-#pragma aux Square=\
- "mov edx,03c4h", \
- "mov eax,0100h", \
- "out dx,ax", \
- "mov eax,0e3h", \
- "mov edx,03c2h", \
- "out dx,ax", \
- "mov eax,0300h", \
- "mov edx,03c4h", \
- "out dx,ax" \
- modify exact [eax edx]
-#endif
-
-
#define my_outp(a,b)
-
-#ifdef __WATCOMC__
-#pragma aux my_outp = \
- "out dx,al", \
- parm [edx] [eax] \
- modify exact []
-#endif
#define OUTP my_outp
--- a/rott/rt_vh_a.h
+++ b/rott/rt_vh_a.h
@@ -29,8 +29,4 @@
void VH_UpdateScreen (void);
void JoyStick_Vals (void);
-#ifdef __WATCOMC__
-#pragma aux JoyStick_Vals modify exact [eax ebx ecx edx esi edi]
-#endif
-
#endif
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -193,8 +193,6 @@
plane = 4;
while( plane > 0 )
{
- VGAMAPMASK( mask );
-
origdest = start+(4-plane);
sourcey = offy;
@@ -806,56 +804,6 @@
VL_FadeIn(0,255,newpal,steps>>1);
}
-
-#if 0
-
-/*
-=================
-=
-= VL_TestPaletteSet
-=
-= Sets the palette with outsb, then reads it in and compares
-= If it compares ok, fastpalette is set to true.
-=
-=================
-*/
-
-void VL_TestPaletteSet (void)
-{
- int i;
-
- for (i=0; i<768; i++)
- palette1[0][i] = i;
-
- fastpalette = true;
- VL_SetPalette (&palette1[0][0]);
- VL_GetPalette (&palette2[0][0]);
- if (_fmemcmp (&palette1[0][0],&palette2[0][0],768))
- fastpalette = false;
-}
-
-
-/*
-==================
-=
-= VL_ColorBorder
-=
-==================
-*/
-
-void VL_ColorBorder (int color)
-{
- _AH=0x10;
- _AL=1;
- _BH=color;
- geninterrupt (0x10);
- bordercolor = color;
-}
-
-
-#endif
-
-
//==========================================================================
//****************************************************************************
@@ -1074,7 +1022,6 @@
for (plane=x; plane<x+4; plane++)
{
- VGAWRITEMAP((plane&3));
for (yy = 0; yy < p->height; yy++)
{
buf=buffer+ylookup[yy];
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -683,16 +683,6 @@
maxshade-=1;
else if (maxshade<targetmax)
maxshade+=1;
-
-#if 0
- targetlevel=baseminshade+(GENERALNUMLIGHTS-numlights);
- if (abs(minshade-targetlevel)==1)
- minshade=targetlevel;
- else if (minshade>targetlevel)
- minshade-=2;
- else if (minshade<targetlevel)
- minshade+=2;
-#endif
}
/*
--- a/rott/sbconfig.c
+++ b/rott/sbconfig.c
@@ -84,17 +84,6 @@
return sgn * ( ((al*bl)>>16) + (ah*bl) + (al*bh) + ((ah*bh)<<16) );
}
-#elif defined(__WATCOMC__)
-
-fixed FIXED_MUL(fixed a, fixed b);
-
-#pragma aux FIXED_MUL = \
- "imul edx" \
- "shrd eax,edx,16" \
- parm [eax] [edx] \
- value [eax] \
- modify exact [eax] ;
-
#endif /* definition of inline FIXED_MUL */
@@ -460,23 +449,6 @@
return accum;
else
return -accum;
-
-#if 0 /* Old technique */
- if((absValue>=warp->pWarp[i].low) && (absValue<=warp->pWarp[i].high))
- if(warp->pWarp[i].shift>=0)
- value=accum+((absValue-warp->pWarp[i].low)<<warp->pWarp[i].shift);
- else
- value=accum+((absValue-warp->pWarp[i].low)>>abs(warp->pWarp[i].shift));
- else if(warp->pWarp[i].shift>=0)
- accum+=(warp->pWarp[i].high-warp->pWarp[i].low)<<warp->pWarp[i].shift;
- else
- accum+=(warp->pWarp[i].high-warp->pWarp[i].low)>>abs(warp->pWarp[i].shift);
-
- if(absValue>warp->pWarp[warp->nWarp-1].high)
- value=accum;
-
- return sign*value;
-#endif
}
--- a/rott/w_wad.c
+++ b/rott/w_wad.c
@@ -48,11 +48,6 @@
static lumpinfo_t *lumpinfo; // location of each lump on disk
-
-#if (DATACORRUPTIONTEST == 1)
-static byte *lumpcheck;
-#endif
-
/*
============================================================================
@@ -218,10 +213,6 @@
if (!quiet)
printf("W_Wad: Wad Manager Started NUMLUMPS=%ld\n",(long int)numlumps);
-#if (DATACORRUPTIONTEST == 1)
- lumpcheck=SafeMalloc(numlumps);
- memset(lumpcheck,255,numlumps);
-#endif
W_CheckWADIntegrity ();
}
@@ -441,57 +432,13 @@
if (!lumpcache[lump])
{
// read the lump in
-#if (PRECACHETEST == 1)
- char str[9];
- strncpy(&str[0],W_GetNameForNum(lump),8);
- str[8]=0;
- SoftError("Lump #%d, %s cached at %ld tics size=%ld tag=%ld\n",lump,str,ticcount,W_LumpLength (lump),tag);
- if (W_LumpLength(lump)==0)
- SoftError("Caching in zero length lump #%d, %s cached at %ld tics size=%ld tag=%ld\n",lump,str,ticcount,W_LumpLength (lump),tag);
-#endif
-
-#if (DATACORRUPTIONTEST == 1)
- {
- int length;
-
- *(lumpcheck+lump)=CHECKPERIOD;
- length=W_LumpLength(lump);
- Z_Malloc (length+sizeof(word), tag, &lumpcache[lump]);
- W_ReadLump (lump, lumpcache[lump]);
- Debug("Invoking endian converter on %p, %i records.\n", lumpcache[lump], numrec);
- converter(lumpcache[lump], numrec);
-
- *( (word *) ((byte *)lumpcache[lump]+length) ) = CalculateCRC (lumpcache[lump], length);
- }
-#else
Z_Malloc (W_LumpLength (lump), tag, &lumpcache[lump]);
W_ReadLump (lump, lumpcache[lump]);
Debug("Invoking endian converter on %p, %i records\n", lumpcache[lump], numrec);
converter(lumpcache[lump], numrec);
-#endif
}
else
{
-#if (DATACORRUPTIONTEST == 1)
-
- if (*(lumpcheck+lump)==255)
- Error("Tried using lump%ld before reading it in\n",lump);
- (*(lumpcheck+lump))--;
- if (*(lumpcheck+lump)==0)
- {
- word storedcrc;
- word crc;
- int length;
-
- *(lumpcheck+lump)=CHECKPERIOD;
-
- length=W_LumpLength(lump);
- storedcrc = *( (word *) ((byte *)lumpcache[lump]+length) );
- crc = CalculateCRC (lumpcache[lump], length);
- if (crc!=storedcrc)
- Error("Data corruption lump=%ld\n",lump);
- }
-#endif
Z_ChangeTag (lumpcache[lump],tag);
}
--- a/rott/watcom.h
+++ b/rott/watcom.h
@@ -23,37 +23,5 @@
fixed FixedDiv2(fixed a, fixed b);
fixed FixedScale(fixed orig, fixed factor, fixed divisor);
fixed FixedMulShift(fixed a, fixed b, fixed shift);
-#ifdef __WATCOMC__
-#pragma aux FixedMul = \
- "imul ebx", \
- "add eax, 8000h" \
- "adc edx,0h" \
- "shrd eax,edx,16" \
- parm [eax] [ebx] \
- value [eax] \
- modify exact [eax edx]
-
-#pragma aux FixedMulShift = \
- "imul ebx", \
- "shrd eax,edx,cl" \
- parm [eax] [ebx] [ecx]\
- value [eax] \
- modify exact [eax edx]
-
-#pragma aux FixedDiv2 = \
- "cdq", \
- "shld edx,eax,16", \
- "sal eax,16", \
- "idiv ebx" \
- parm [eax] [ebx] \
- value [eax] \
- modify exact [eax edx]
-#pragma aux FixedScale = \
- "imul ebx", \
- "idiv ecx" \
- parm [eax] [ebx] [ecx]\
- value [eax] \
- modify exact [eax edx]
-#endif
#endif
--- a/rott/z_zone.c
+++ b/rott/z_zone.c
@@ -30,9 +30,6 @@
#include "develop.h"
#include "rt_net.h"
-#if (DEVELOPMENT == 1)
-#include "rt_main.h"
-#endif
//MED
#include "memcheck.h"
@@ -256,10 +253,6 @@
========================
*/
-#if (DEVELOPMENT == 1)
-int totallevelsize=0;
-#endif
-
void *Z_Malloc (int size, int tag, void *user)
{
int extra;
@@ -341,12 +334,6 @@
mainzone->rover = base->next; // next allocation will start looking here
-
-#if (MEMORYCORRUPTIONTEST==1)
- base->posttag=MEMORYPOSTTAG;
- base->pretag=MEMORYPRETAG;
-#endif
-
return (void *) ((byte *)base + sizeof(memblock_t));
}
@@ -441,11 +428,6 @@
levelzone->rover = base->next; // next allocation will start looking here
-#if (MEMORYCORRUPTIONTEST==1)
- base->posttag=MEMORYPOSTTAG;
- base->pretag=MEMORYPRETAG;
-#endif
-
return (void *) ((byte *)base + sizeof(memblock_t));
}
@@ -672,15 +654,6 @@
Error ("Z_CheckHeap: next block doesn't have proper back link\n");
if (!block->user && !block->next->user)
Error ("Z_CheckHeap: two consecutive free blocks\n");
-#if (MEMORYCORRUPTIONTEST==1)
- if ((block->tag>0) && (block->user>0))
- {
- if (block->posttag!=MEMORYPOSTTAG)
- Error("Z_CheckHeap: Corrupted posttag\n");
- if (block->pretag!=MEMORYPRETAG)
- Error("Z_CheckHeap: Corrupted pretag\n");
- }
-#endif
}
// Check levelzone
@@ -695,15 +668,6 @@
Error ("Z_CheckHeap: next block doesn't have proper back link\n");
if (!block->user && !block->next->user)
Error ("Z_CheckHeap: two consecutive free blocks\n");
-#if (MEMORYCORRUPTIONTEST==1)
- if ((block->tag>0) && (block->user>0))
- {
- if (block->posttag!=MEMORYPOSTTAG)
- Error("Z_CheckHeap: Corrupted posttag\n");
- if (block->pretag!=MEMORYPRETAG)
- Error("Z_CheckHeap: Corrupted pretag\n");
- }
-#endif
}
}