shithub: rott

Download patch

ref: 73089d393487d3803b29ab51d3a59f2ce8e0c14d
parent: 0f44cfa4ee8ae6d292a8aef6d1b1a54398423eb4
author: Marc-Alexandre Espiaut <marcalexandre@member.fsf.org>
date: Tue Jun 5 08:28:43 EDT 2018

Removing obsolete DEVELOPMENT, DEBUG and/or BETA code from rt_main.c

--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -106,11 +106,7 @@
 boolean infopause;
 boolean quiet = false;
 
-#if (DEVELOPMENT == 1)
-boolean DebugOk = true;
-#else
 boolean DebugOk = false;
-#endif
 
 #if (WHEREAMI==1)
 int programlocation=-1;
@@ -1616,21 +1612,8 @@
 
 //===========================================================================
 
-#if (DEVELOPMENT == 1)
-extern int totallevelsize;
-#endif
-
 void QuitGame ( void )
 {
-#if (DEBUG == 1)
-    char buf[5];
-#endif
-
-#if (DEVELOPMENT == 1)
-    int temp;
-#else
-#endif
-
     MU_FadeOut(200);
     while (MU_FadeActive())
     {
@@ -1643,56 +1626,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 (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);
@@ -1793,12 +1726,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;
         }
 
@@ -2020,10 +1947,6 @@
 
         UpdateClientControls();
 
-#if (DEVELOPMENT == 1)
-        Z_CheckHeap();
-#endif
-
         if ( AutoDetailOn == true )
         {
             AdaptDetail();
@@ -2561,16 +2484,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,23 +2521,6 @@
 )
 
 {
-#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 ] )
     {
@@ -3015,10 +2911,6 @@
 
 boolean inhmenu;
 
-#if (BETA == 1)
-#define SSX (160-(46*2))
-#define SSY (17)
-#endif
 void SaveScreen (boolean saveLBM)
 {
     byte *buffer;
@@ -3026,13 +2918,6 @@
     boolean oldHUD;
     char filename[ 128 ];
 
-#if (BETA == 1)
-    unsigned tmp;
-    char buf[30];
-    int i;
-#endif
-
-
     oldHUD=HUD;
     HUD=false;
     doublestep=0;
@@ -3048,39 +2933,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 );
     //
@@ -3090,21 +2942,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 ();
     }