shithub: rott

Download patch

ref: 2316fa9b6796dd0923c9782059bc84309b392e58
parent: c645b7d68aa287db6eb9e193e2c0f67d4e8f1115
author: Marc-Alexandre Espiaut <marcalexandre@member.fsf.org>
date: Tue Jun 5 08:21:00 EDT 2018

Removing obsolete *TEST and DEVELOPMENT code from rt_ted.c

--- 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
@@ -1291,31 +1252,6 @@
                 ;
         }
 //  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
     {
@@ -1332,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;
 }
 
@@ -2355,9 +2288,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;
@@ -2567,24 +2497,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
-
 }
 
 
@@ -3058,12 +2970,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
@@ -3093,12 +2999,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
@@ -3119,12 +3019,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
@@ -3251,12 +3145,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
 }
 
 
@@ -4298,155 +4186,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
 =
 ==================
@@ -5896,20 +5638,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);
     }