shithub: rott

Download patch

ref: 3fa26c1c743399394546c57430f628431f96b53c
parent: 3c380e243cc62bc0adfbbbaba95976a0c7ab5da2
author: levesqu8 <levesqu8@msu.edu>
date: Tue Jan 23 17:04:32 EST 2018

fix for some resolutions not working at all

--- a/rott/WinRott.h
+++ b/rott/WinRott.h
@@ -5,6 +5,10 @@
 
 //husk at rette i winrott.c
 
+#define MAXSCREENWIDTH 3840
+#define MAXSCREENHEIGHT 2160 //max res is set to be 4k
+
+
 extern int iGLOBAL_SCREENWIDTH;//bna val 800
 extern int iGLOBAL_SCREENHEIGHT;//bna val 600
 
--- a/rott/engine.c
+++ b/rott/engine.c
@@ -39,7 +39,7 @@
 =============================================================================
 */
 //wallcast_t posts[642];//bna++
-wallcast_t posts[1920+4];//bna++
+wallcast_t posts[MAXSCREENWIDTH+4];//bna++
 //wallcast_t posts[321];
 int lasttilex;
 int lasttiley;
--- a/rott/engine.h
+++ b/rott/engine.h
@@ -38,7 +38,7 @@
     int      posttype;
     int      alttile;
 } wallcast_t;
-extern wallcast_t posts[1920+4];//bna++ JUST MAKE IT MAX RES
+extern wallcast_t posts[MAXSCREENWIDTH+4];//bna++ JUST MAKE IT MAX RES
 //extern wallcast_t posts[642];//bna++
 //extern wallcast_t posts[321];
 
--- a/rott/modexlib.c
+++ b/rott/modexlib.c
@@ -53,7 +53,7 @@
 
 int    linewidth;
 //int    ylookup[MAXSCREENHEIGHT];
-int    ylookup[1080];//just set to max res
+int    ylookup[MAXSCREENHEIGHT];//just set to max res
 byte  *page1start;
 byte  *page2start;
 byte  *page3start;
--- a/rott/modexlib.h
+++ b/rott/modexlib.h
@@ -111,7 +111,7 @@
 extern  boolean StretchScreen;//bn�++
 
 //extern  int      ylookup[MAXSCREENHEIGHT];      // Table of row offsets
-extern  int      ylookup[1080];      // just set to max res
+extern  int      ylookup[MAXSCREENHEIGHT];      // just set to max res
 extern  int      linewidth;
 extern  byte    *page1start;
 extern  byte    *page2start;
--- a/rott/rt_floor.c
+++ b/rott/rt_floor.c
@@ -76,7 +76,7 @@
 static byte     *floor;
 static byte     *ceiling;
 //static int xstarts[MAXVIEWHEIGHT];
-static int xstarts[1080];//set to max hight res
+static int xstarts[MAXSCREENHEIGHT];//set to max hight res
 static byte * skysegs[MAXSKYSEGS];
 static byte * skydata[MAXSKYDATA];
 static int      horizonheight;
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -87,7 +87,7 @@
 byte * greenmap;
 byte * playermaps[MAXPLAYERCOLORS];
 //short  pixelangle[MAXVIEWWIDTH];
-short  pixelangle[1920];
+short  pixelangle[MAXSCREENWIDTH];
 byte   gammatable[GAMMAENTRIES];
 int    gammaindex;
 int    focalwidth=160;
@@ -518,38 +518,85 @@
     else if ( iGLOBAL_SCREENWIDTH == 1920)
     {
         height = 0;
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
         
-        viewsizes[height++]= 1920; 
+        viewsizes[height++]= 1920;
         viewsizes[height++]= 1080;
+    }
+    else if ( iGLOBAL_SCREENWIDTH == 3840)
+    {
+        height = 0;
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+        
+        viewsizes[height++]= 3840;
+        viewsizes[height++]= 2160;
+    }
+    else
+    {
+        height = 0;
+        for (height = 0; height < 21;)
+        {
+            viewsizes[height++] = iGLOBAL_SCREENWIDTH;
+            viewsizes[height++] = iGLOBAL_SCREENHEIGHT;
+        }
+    
+    
     }
 
 
--- a/rott/rt_view.h
+++ b/rott/rt_view.h
@@ -76,7 +76,7 @@
 
 extern byte * playermaps[MAXPLAYERCOLORS];
 //extern short  pixelangle[MAXVIEWWIDTH];
-extern short  pixelangle[1920];
+extern short  pixelangle[MAXSCREENWIDTH];
 extern byte   gammatable[GAMMAENTRIES];
 extern int    gammaindex;
 extern byte   uniformcolors[MAXPLAYERCOLORS];
--- a/rott/winrott.c
+++ b/rott/winrott.c
@@ -36,23 +36,8 @@
 
 void RecalculateFocalWidth(void)
 {
-    if (iGLOBAL_SCREENWIDTH == 320) {
-        iGLOBAL_FOCALWIDTH = 160 - FocalWidthOffset;
-        dGLOBAL_FPFOCALWIDTH = 160.0 - FocalWidthOffset;
-    }
-    else if (iGLOBAL_SCREENWIDTH == 640) {
-        iGLOBAL_FOCALWIDTH = 180 - FocalWidthOffset;
-        dGLOBAL_FPFOCALWIDTH = 180.0 - FocalWidthOffset ;
-    }
-    else if (iGLOBAL_SCREENWIDTH == 800) {
-        iGLOBAL_FOCALWIDTH = 200 - FocalWidthOffset;
-        dGLOBAL_FPFOCALWIDTH = 200.0 - FocalWidthOffset;
-    }
-    else if (iGLOBAL_SCREENWIDTH == 1024)
-    {
-        iGLOBAL_FOCALWIDTH = 200 - FocalWidthOffset;
-        dGLOBAL_FPFOCALWIDTH = 200.0 - FocalWidthOffset;
-    }
+    iGLOBAL_FOCALWIDTH = 160 - FocalWidthOffset;
+    dGLOBAL_FPFOCALWIDTH = 160.0 - FocalWidthOffset;
 }
 
 void SetRottScreenRes (int Width, int Height)