shithub: rott

Download patch

ref: 4f392bdcff511869ecdffd84e9b21f5555eb335a
parent: e4a472faa9a21e9041db36a032a2f68ab5dbb51a
author: levesqu8 <[email protected]>
date: Tue Jan 2 15:24:43 EST 2018

removed DrawPlayScreen hardcoded values.

--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -427,30 +427,14 @@
     
     if ( SHOW_TOP_STATUS_BAR() )
     {
-        if (iGLOBAL_SCREENWIDTH == 640) 
+        if (iGLOBAL_SCREENWIDTH > 320 || iGLOBAL_SCREENHEIGHT > 200)
         {
             shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
             
             DrawTiledRegion( 0, 0, iGLOBAL_SCREENWIDTH, 16, 0,16, shape );
-            
-            shape = ( pic_t * )W_CacheLumpName( "stat_bar", PU_CACHE, Cvt_pic_t, 1 );
-            GameMemToScreen( shape, topBarCenterOffsetX, 0, bufferofsonly );
-        } 
-        else if (iGLOBAL_SCREENWIDTH == 800) 
-        {  
-            shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
-            
-            DrawTiledRegion( 0, 0, iGLOBAL_SCREENWIDTH, 16, 0,16, shape );
-            
-            shape = ( pic_t * )W_CacheLumpName( "stat_bar", PU_CACHE, Cvt_pic_t, 1 );
-            GameMemToScreen( shape, topBarCenterOffsetX, 0, bufferofsonly );
-            
-        } 
-        else if (iGLOBAL_SCREENWIDTH == 320) 
-        {
-            shape = ( pic_t * )W_CacheLumpName( "stat_bar", PU_CACHE, Cvt_pic_t, 1 );
-            GameMemToScreen( shape, 0, 0, bufferofsonly );
         }
+        shape = ( pic_t * )W_CacheLumpName( "stat_bar", PU_CACHE, Cvt_pic_t, 1 );
+        GameMemToScreen( shape, topBarCenterOffsetX, 0, bufferofsonly );
     }
 
     if ( BATTLEMODE )
@@ -466,57 +450,28 @@
         {
             ShowKillsYoffset = KILLS_HEIGHT;
         }
-            if (iGLOBAL_SCREENWIDTH == 640) {
-                if (iGLOBAL_SCREENHEIGHT == 400)
-                {
-                    shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
-//                    DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, topBarCenterOffsetX, 16, 0,16, shape );
-                    DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, iGLOBAL_SCREENWIDTH, 16, 0,16, shape );
-                    
-                    shape = ( pic_t * ) W_CacheLumpName( "bottbar", PU_CACHE, Cvt_pic_t, 1 );
-                  
-                    //DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, topBarCenterOffsetX, 16, 0,16, shape );
-                    //DrawTiledRegion(320 + topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT -16, topBarCenterOffsetX ,16, 0, 16, shapeTile);
-                    GameMemToScreen( shape, topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT - 16, bufferofsonly ); //using topBarCenterOffsetX since bottbar dims == statbar dims
-                }
-                else
-                {
-                    GameMemToScreen( shape, 320, (224*2)+16-ShowKillsYoffset, bufferofsonly );
-                //copy next shape to mem
-                    GameMemToScreen( shape, 0, (224*2)+16-ShowKillsYoffset, bufferofsonly );
-                // delete bullet in middle of shape picture
-                    DrawPPic( 310, (224*2)+17-ShowKillsYoffset, 8 >> 2, 16,
-                          ( byte * )&erase->data, 2, true, bufferofsonly );
-                // delete hart in middle of shape picture
-                    DrawPPic( 324, (224*2)+17-ShowKillsYoffset, 8 >> 2, 16,
-                          ( byte * )&erase->data, 2, true, bufferofsonly );
+        if (iGLOBAL_SCREENWIDTH > 320 || iGLOBAL_SCREENHEIGHT > 200)
+        {
+            shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
                 
+            //this causes a seg fault when MUSIC_StopSong calls Mix_HaltMusic for some odd reason when player pauses the game...
+            //DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT, iGLOBAL_SCREENWIDTH, 16, 10,10, shape );
                 
-                }
-
-            } else if (iGLOBAL_SCREENWIDTH == 800) {
-                shape =  ( pic_t * )W_CacheLumpName( "backtile", PU_CACHE, Cvt_pic_t, 1 );
-                DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, iGLOBAL_SCREENWIDTH, 16, 0,16, shape );
-                shape = ( pic_t * ) W_CacheLumpName( "bottbar", PU_CACHE, Cvt_pic_t, 1 );
+            //...yet if we do this...no seg fault
+            DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, iGLOBAL_SCREENWIDTH, 13, 10,10, shape );
+            DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 29, iGLOBAL_SCREENWIDTH, 3, 10,10, shape ); //fill in remaining spots
+            
+            
+            shape = ( pic_t * ) W_CacheLumpName( "bottbar", PU_CACHE, Cvt_pic_t, 1 );
                   
-                //DrawTiledRegion( 0, iGLOBAL_SCREENHEIGHT - 16, topBarCenterOffsetX, 16, 0,16, shapeTile );
-                //DrawTiledRegion(320 + topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT -16, topBarCenterOffsetX , 16, 0, 16, shapeTile);
-                GameMemToScreen( shape, topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT - 16, bufferofsonly ); //using topBarCenterOffsetX since bottbar dims == statbar dims
-                //GameMemToScreen( shape, 800-320, 584-ShowKillsYoffset, bufferofsonly );
-                //copy next shape to mem
-                //GameMemToScreen( shape, 300, 584-ShowKillsYoffset, bufferofsonly );
-                //copy next shape to mem
-                //GameMemToScreen( shape, 0, 584-ShowKillsYoffset, bufferofsonly );
-                // delete 2 bullets in middle of shape picture
-                //DrawPPic( 305, 584+1-ShowKillsYoffset, 8 >> 2, 16,
-                //          ( byte * )&erase->data, 2, true, bufferofsonly );
-                // delete hart in middle of shape picture
-                //DrawPPic( 610, 584+1-ShowKillsYoffset, 8 >> 2, 16,
-                //          ( byte * )&erase->data, 2, true, bufferofsonly );
+            //GameMemToScreen( shape, topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT - 16, bufferofsonly ); //using topBarCenterOffsetX since bottbar dims == statbar dims
+            
+            
+            
+        }
+            
+        GameMemToScreen( shape, topBarCenterOffsetX, iGLOBAL_SCREENHEIGHT - 16, bufferofsonly ); //using topBarCenterOffsetX since bottbar dims == statbar dims
 
-            } else {
-                GameMemToScreen( shape, 0, 184, bufferofsonly );
-            }
         //}
 
         DrawBarAmmo( bufferofsonly );
--- a/rott/rt_main.c
+++ b/rott/rt_main.c
@@ -456,7 +456,7 @@
         }
 #endif
     }
-    SDL_WM_GrabInput( SDL_GRAB_ON );
+    //SDL_WM_GrabInput( SDL_GRAB_ON );
     GameLoop();
 
 
@@ -866,17 +866,16 @@
             if (i < _argc)
             {
                 int width, height;
-                if ( (sscanf(_argv[i], "%dx%d", &width, &height) == 2) &&
-                        ( ( (width == 320) && (height == 200) ) ||
-                          ( (width == 640) && (height == 480) ) ||
-                          ((width == 640) && (height == 400)) ||
-                          ( (width == 800) && (height == 600) ) ) )
+                unsigned int numResParams = sscanf(_argv[i], "%dx%d", &width, &height);
+                if ( numResParams == 2)
                 {
                     iGLOBAL_SCREENWIDTH  = width;
                     iGLOBAL_SCREENHEIGHT = height;
                 }
+/*
                 else
                     printf("Invalid resolution parameter: %s\n", _argv[i]);
+*/
             }
             else
                 printf("Missing resolution parameter\n");
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -376,26 +376,37 @@
         height = 0;
         viewsizes[height++]= 556;
         viewsizes[height++]= 488;
+        
         viewsizes[height++]= 588;
         viewsizes[height++]= 504;
+        
         viewsizes[height++]= 620;
         viewsizes[height++]= 520;
+        
         viewsizes[height++]= 652;
         viewsizes[height++]= 536;
+        
         viewsizes[height++]= 684;
         viewsizes[height++]= 552;
+        
         viewsizes[height++]= 716;
         viewsizes[height++]= 568;
+        
         viewsizes[height++]= 748;
         viewsizes[height++]= 584;
+        
         viewsizes[height++]= 800;
         viewsizes[height++]= 600;
+        
         viewsizes[height++]= 800;
         viewsizes[height++]= 600;
+        
         viewsizes[height++]= 800;
         viewsizes[height++]= 600;
+        
         viewsizes[height++]= 800;
         viewsizes[height++]= 600;
+        
     }