shithub: rott

Download patch

ref: b086a67e31667d8275fc799468dca77a20ba5281
parent: dc50fad6647c96c7b21810a037e67ed69ade258e
author: LTCHIPS <ltchips994@gmail.com>
date: Tue May 15 12:24:51 EDT 2018

even more screen rotate tweaks

--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -3407,10 +3407,10 @@
     
     SDL_Texture * newTex = SDL_CreateTextureFromSurface((SDL_Renderer *) GetRenderer(), sdl_surface);
     
+    float factor;
+    
     for (i=0; i<time; i+=tics)
     {
-        float factor;
-        
         if (option == 0)
             factor = scale;
         if (option == 1)
@@ -3420,8 +3420,6 @@
         else
             factor = scale;
         
-        
-        
         //printf("factor: %f \n", factor);
         
         DoScreenRotateScale(iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT, newTex, angle, factor);
@@ -3431,11 +3429,15 @@
             angle+=(anglestep);
         
         CalcTics();
+        
+        //printf("scaleDRAW: %f \n", scale);
     
     }
     
+    //printf("factor: %f \n", factor);
+    
     if(fadeOut == true)
-        VL_FadeOutScaledScreen (0, 255, 0,0,0,VBLCOUNTER>>1, abs(scale));
+        VL_FadeOutScaledScreen (0, 255, 0,0,0,VBLCOUNTER>>1, abs(factor));
     
     //DoScreenRotateScale(iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT, newTex, 0, 1.0);
     
--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -4674,7 +4674,7 @@
 
         rng = RandomNumber ("Died",0);
                 
-        //rng = 191;
+        rng = 63;
         
         //zooms in on screen
         if (pstate->falling==true)
--- a/rott/rt_vid.c
+++ b/rott/rt_vid.c
@@ -920,6 +920,9 @@
     WaitVBL ();
     VL_GetPalette (&palette1[0][0]);
     memcpy (palette2, palette1, 768);
+    
+    
+    SDL_Texture * tex = GetMainSurfaceAsTexture();
 
 //
 // fade through intermediate frames
@@ -947,8 +950,10 @@
         
         printf("%d \n", (int)((float)iGLOBAL_SCREENWIDTH*scale));
         printf("%d \n", (int)((float)iGLOBAL_SCREENHEIGHT*scale));
+        printf("%f \n", scale);
         
-        DoScreenRotateScale(iGLOBAL_SCREENWIDTH,iGLOBAL_SCREENHEIGHT, (SDL_Texture *) GetMainSurfaceAsTexture(), 0, scale);
+        
+        DoScreenRotateScale(iGLOBAL_SCREENWIDTH,iGLOBAL_SCREENHEIGHT, tex, 0, scale);
     }
 
 //
@@ -955,8 +960,13 @@
 // final color
 //
     VL_FillPalette (red,green,blue);
+    
+    
 
     screenfaded = true;
+    
+    SDL_DestroyTexture(tex);
+    
 }