shithub: rott

Download patch

ref: 18c8ce9fd5cf08c0372f5278fdb6a881b5b84c6b
parent: a5d34c2d7ce3bad682b449848244a853f0a41ca1
author: levesqu8 <levesqu8@msu.edu>
date: Wed Jan 3 14:10:03 EST 2018

1024x768 is functional, rotation doesn't work tho

--- a/rott/engine.c
+++ b/rott/engine.c
@@ -39,7 +39,7 @@
 =============================================================================
 */
 //wallcast_t posts[642];//bna++
-wallcast_t posts[800+2];//bna++
+wallcast_t posts[1024+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[800+2];//bna++ JUST MAKE IT MAX RES
+extern wallcast_t posts[1024+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[600];//just set to max res
+int    ylookup[768];//just set to max res
 byte  *page1start;
 byte  *page2start;
 byte  *page3start;
--- a/rott/modexlib.h
+++ b/rott/modexlib.h
@@ -108,10 +108,10 @@
 #define PEL_DATA                0x3c9
 #endif
 
-extern  boolean StretchScreen;//bn�++
+extern  boolean StretchScreen;//bn�++
 
 //extern  int      ylookup[MAXSCREENHEIGHT];      // Table of row offsets
-extern  int      ylookup[600];      // just set to max res
+extern  int      ylookup[768];      // just set to max res
 extern  int      linewidth;
 extern  byte    *page1start;
 extern  byte    *page2start;
--- a/rott/queue.c
+++ b/rott/queue.c
@@ -1,9 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -583,6 +583,9 @@
             } else if (iGLOBAL_SCREENWIDTH == 800) {
                 G_weaponscale=376;
             }
+            else if (iGLOBAL_SCREENWIDTH == 1024) {
+                G_weaponscale=512;
+            }
         }
 
         // Read in MouseAdjustment
@@ -1880,6 +1883,10 @@
             G_weaponscale=299;
         } else if (iGLOBAL_SCREENWIDTH == 800) {
             G_weaponscale=376;
+        }
+        else if (iGLOBAL_SCREENWIDTH == 1024)
+        {
+            G_weaponscale=512;
         }
     }
     WriteParameter(file,"Weaponscale         ",G_weaponscale);
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -3114,6 +3114,10 @@
     } else if (iGLOBAL_SCREENWIDTH == 800) {
         RotatedImage=SafeMalloc(131072*8);
     }
+    else if (iGLOBAL_SCREENWIDTH == 1024)
+    {
+        RotatedImage=SafeMalloc(131072*14);
+    }
 //SetupScreen(false);//used these 2 to test screen size
 //VW_UpdateScreen ();
     if (masked==0) {
@@ -3124,6 +3128,8 @@
         } else if (iGLOBAL_SCREENWIDTH == 800) {
             //memset(RotatedImage,0,131072);//org
             memset(RotatedImage,0,131072*8);
+        }else if (iGLOBAL_SCREENWIDTH == 1024) { 
+		  memset(RotatedImage,0,131072*14);
         }
     } else {
         if (iGLOBAL_SCREENWIDTH == 320) {
@@ -3133,11 +3139,14 @@
         } else if (iGLOBAL_SCREENWIDTH == 800) {
             memset(RotatedImage,0xff,131072*8);
         }
+        else if (iGLOBAL_SCREENWIDTH == 1024) { 
+            memset(RotatedImage,0xff,131072*14);
+        }
     }
     //memset(RotatedImage,0xff,131072);//org
     //memset(RotatedImage,0xff,131072*8);
 
-    if ((masked == false)&&(iGLOBAL_SCREENWIDTH == 800)) {
+    if ((masked == false)&&(iGLOBAL_SCREENWIDTH >= 800)) {
         DisableScreenStretch();
         // SetTextMode (  );
 
@@ -3323,12 +3332,16 @@
         xst = (((-cx)*s)+((328)<<16))-(cy*c);
         xct = (((-cx)*c)+((397)<<16)+(1<<18)-(1<<16))+(cy*s);
     }//328 397
+    else if ((iGLOBAL_SCREENWIDTH == 1024 )&&(masked == false)) {
+	   xst = (((-cx)*s)+((410)<<16))-(cy*c);// 1024/768=1.3333
+	   xct = (((-cx)*c)+((500)<<16)+(1<<18)-(1<<16))+(cy*s);
+   }//388 397
 
     mr_xstep=s;
     mr_ystep=c;
 
 
-    if ((iGLOBAL_SCREENWIDTH == 800)&&(masked==0)) {
+    if ((iGLOBAL_SCREENWIDTH >= 800)&&(masked==0)) {
         screen=destscreen+iGLOBAL_SCREENWIDTH;//bna aaaa fix
     } else {
         screen=destscreen;
--- 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[600];//set to max hight res
+static int xstarts[768];//set to max hight res
 static byte * skysegs[MAXSKYSEGS];
 static byte * skydata[MAXSKYDATA];
 static int      horizonheight;
@@ -274,7 +274,7 @@
     byte * ptr;
     int c;
 
-    temp=SafeMalloc(256*800);
+    temp=SafeMalloc(256*1024);
 
     ptr=temp;
 
--- a/rott/rt_ted.c
+++ b/rott/rt_ted.c
@@ -1181,19 +1181,18 @@
                         
     double ratioNewToOldHeight = ((double)iGLOBAL_SCREENHEIGHT)/200.0;
     
-    double newPrecacheBarX = ratioNewToOldWidth * 28.0;
-    double newPrecacheBarY = ratioNewToOldHeight * 178.0;
+    double newPrecacheBarX = ratioNewToOldWidth * 28.0; //PRECACHEBARX = 28
     
-    double newPrecacheBar1LedX = ratioNewToOldWidth * (double)9.0;
+    double newPrecacheBarY = ratioNewToOldHeight * 178.0; //PRECACHEBARY = 178
+    
+    double newPrecacheBar1LedX = ratioNewToOldWidth * (double)9.0; //PRECACHEBAR1LEDX = 9
                         
-    double newPrecacheBar1LedY = ratioNewToOldHeight * (double)8.0;
+    double newPrecacheBar1LedY = ratioNewToOldHeight * (double)8.0; //PRECACHEBAR1LEDY = 8
     
-    double newPrecacheBar2LedX = newPrecacheBar1LedX;
+    double newPrecacheBar2LedX = newPrecacheBar1LedX; //PRECACHEBAR2LEDX = PRECACHEBAR1LEDX
     
-    double newPrecacheBar2LedY = ratioNewToOldHeight * (double)12.0;
+    double newPrecacheBar2LedY = ratioNewToOldHeight * (double)12.0; //PRECACHEBAR2LEDY = 12
     
-    
-
     if (loadedgame==false)
     {
         maxheapsize=Z_HeapSize();
@@ -1210,15 +1209,20 @@
             currentmem=(newheap*MAXLEDS)/maxheapsize;
             while (lastmem<=currentmem)
             {   //SetTextMode (  );
-                DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2))),
-                                            (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2))),
-                                          (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
-                                          (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
-                                          (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
+                //Note: This isn't drawing 4 LED thingys... its just drawing one big one (made up of 4 of the LED thingys)
                 
+                DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2))),
+                                  (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
+                
+                DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2))),
+                                  (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
+                
+                DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
+                                  (int)(newPrecacheBarY + newPrecacheBar1LedY),W_GetNumForName ("led1"));//led1 progressbar
+                
+                DrawNormalSprite ((int)(newPrecacheBarX + newPrecacheBar1LedX+(Gs*(lastmem<<2)) + 3),
+                                  (int)(newPrecacheBarY + newPrecacheBar1LedY + 3),W_GetNumForName ("led1"));//led1 progressbar
+                
 /*
                 if ( iGLOBAL_SCREENWIDTH == 320) {
                     DrawNormalSprite (PRECACHEBARX+PRECACHELED1X+(lastmem<<2),
@@ -1259,13 +1263,13 @@
             while (lastcache<=currentcache)
             {
                 DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
-                                            (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
-                                          (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
-                                          (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
-                        DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
-                                          (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
+                                  (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
+                DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2))),
+                                  (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
+                DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
+                                  (int)(newPrecacheBarY + newPrecacheBar2LedY),W_GetNumForName ("led2"));//led2 progressbar
+                DrawNormalSprite ((int)(newPrecacheBarX+newPrecacheBar2LedX+(Gs*(lastcache<<2)) + 3),
+                                  (int)(newPrecacheBarY + newPrecacheBar2LedY + 3),W_GetNumForName ("led2"));//led2 progressbar
 /*
                 if ( iGLOBAL_SCREENWIDTH == 320) {
                     DrawNormalSprite (PRECACHEBARX+PRECACHELED2X+(lastcache<<2),
--- a/rott/rt_util.c
+++ b/rott/rt_util.c
@@ -357,7 +357,7 @@
     px = ERRORVERSIONCOL;
     py = ERRORVERSIONROW;
 #if (BETA == 1)
-    UL_printf ("�");
+    UL_printf ("�");
 #else
     UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
 #endif
@@ -1574,7 +1574,7 @@
     px = ERRORVERSIONCOL;
     py = ERRORVERSIONROW;
 #if (BETA == 1)
-    UL_printf ("�");
+    UL_printf ("�");
 #else
     UL_printf (itoa(ROTTMAJORVERSION,&buf[0],10));
 #endif
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -87,7 +87,7 @@
 byte * greenmap;
 byte * playermaps[MAXPLAYERCOLORS];
 //short  pixelangle[MAXVIEWWIDTH];
-short  pixelangle[800];
+short  pixelangle[1024];
 byte   gammatable[GAMMAENTRIES];
 int    gammaindex;
 int    focalwidth=160;
@@ -212,7 +212,7 @@
         scale = (centerx*focalwidth)/(160);
     } else if ( iGLOBAL_SCREENWIDTH == 640) {
         scale = (centerx*focalwidth)/(160);
-    } else if ( iGLOBAL_SCREENWIDTH == 800) {
+    } else if ( iGLOBAL_SCREENWIDTH >= 800) {
         scale = (centerx*focalwidth)/(160);
     }
 //
@@ -408,6 +408,41 @@
         viewsizes[height++]= 600;
         
     }
+    else if ( iGLOBAL_SCREENWIDTH == 1024) {
+	height = 0;
+	viewsizes[height++]= 556; 
+        viewsizes[height++]= 488;
+        
+        viewsizes[height++]= 588; 
+        viewsizes[height++]= 504;
+        
+        viewsizes[height++]= 620; 
+        viewsizes[height++]= 520;
+        
+        viewsizes[height++]= 816; 
+        viewsizes[height++]= 704;
+        
+        viewsizes[height++]= 868; 
+        viewsizes[height++]= 720;
+        
+        viewsizes[height++]= 920; 
+        viewsizes[height++]= 736;
+        
+        viewsizes[height++]= 972; 
+        viewsizes[height++]= 752;
+        
+        viewsizes[height++]= 1024; 
+        viewsizes[height++]= 768;
+        
+        viewsizes[height++]= 1024; 
+        viewsizes[height++]= 768;
+        
+        viewsizes[height++]= 1024; 
+        viewsizes[height++]= 768;
+        
+        viewsizes[height++]= 1024; 
+        viewsizes[height++]= 768;
+	}
 
 
     if ((size<0) || (size>=MAXVIEWSIZES)) { //bna added
--- 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[800];
+extern short  pixelangle[1024];
 extern byte   gammatable[GAMMAENTRIES];
 extern int    gammaindex;
 extern byte   uniformcolors[MAXPLAYERCOLORS];
--- a/rott/watcom.c
+++ b/rott/watcom.c
@@ -33,6 +33,7 @@
 
 fixed FixedScale(fixed orig, fixed factor, fixed divisor)
 {
+/*
     __int64 x = orig;
     __int64 y = factor;
     __int64 z = divisor;
@@ -40,4 +41,7 @@
     __int64 w = (x * y) / z;
 
     return (w) & 0xffffffff;
+*/
+    //changed to this because arithmetic errors occurred with resolutions > 800x600
+    return (float)orig * factor / divisor;
 }
--- a/rott/winrott.c
+++ b/rott/winrott.c
@@ -48,6 +48,11 @@
         iGLOBAL_FOCALWIDTH = 200 - FocalWidthOffset;
         dGLOBAL_FPFOCALWIDTH = 200.0 - FocalWidthOffset;
     }
+    else if (iGLOBAL_SCREENWIDTH == 1024)
+    {
+        iGLOBAL_FOCALWIDTH = 200 - FocalWidthOffset;
+        dGLOBAL_FPFOCALWIDTH = 200.0 - FocalWidthOffset;
+    }
 }
 
 void SetRottScreenRes (int Width, int Height)