shithub: rott

Download patch

ref: 60c69e088e00e271da6857f056c67cc5d1b8df3a
parent: 7ebdf2d96809083b19b8a0003fce5302014ca598
author: levesqu8 <levesqu8@msu.edu>
date: Thu Nov 2 10:56:51 EDT 2017

Added scaleOffset to allow adjusting of Focal width

--- a/rott/rt_cfg.c
+++ b/rott/rt_cfg.c
@@ -119,6 +119,7 @@
 boolean autoAimMissileWeps = 0;
 boolean autoAim = 1;
 boolean enableExtraPistolDrops = 0;
+int scaleOffset = 0;
 
 boolean joystickenabled  = 0;
 boolean joypadenabled    = 0;
@@ -530,6 +531,10 @@
         
         //Read in EnableExtraPistolDrops
         ReadBoolean("EnableExtraPistolDrops", &enableExtraPistolDrops);
+        
+        //Read in scaleOffset
+        
+        ReadInt("scaleOffset", &scaleOffset);
 
         // Read in MouseEnabled
         ReadBoolean("MouseEnabled",&mouseenabled);
@@ -1775,6 +1780,11 @@
     SafeWriteString(file, "; 1 - Enemies equipped with pistols have a chance of dropping an extra pistol when killed.\n");
     SafeWriteString(file, "; 0 - Enemies will not drop extra pistols at all. (Default)\n");
     WriteParameter(file, "EnableExtraPistolDrops     ", enableExtraPistolDrops);
+    
+    //Write out scaleOffset
+    SafeWriteString(file,"\n;\n");
+    SafeWriteString(file,"; Field Of View offset\n");
+    WriteParameter(file,"scaleOffset     ",scaleOffset);
     
     // Write out MouseEnabled
 
--- a/rott/winrott.c
+++ b/rott/winrott.c
@@ -30,7 +30,7 @@
 
 extern int  viewheight;
 extern int  viewwidth;
-
+extern int scaleOffset;
 //----------------------------------------------------------------------
 #define FINEANGLES                        2048
 void SetRottScreenRes (int Width, int Height)
@@ -44,8 +44,8 @@
     iG_SCREENWIDTH = iGLOBAL_SCREENWIDTH*(96/320);;// default screen width in bytes
 
     if (iGLOBAL_SCREENWIDTH == 320) {
-        iGLOBAL_FOCALWIDTH = 160;
-        dGLOBAL_FPFOCALWIDTH = 160.0;
+        iGLOBAL_FOCALWIDTH = 160 - scaleOffset;
+        dGLOBAL_FPFOCALWIDTH = 160.0 - scaleOffset;
         iGLOBAL_HEALTH_X = 20;
         iGLOBAL_HEALTH_Y = 185;
         iGLOBAL_AMMO_X = 300;
@@ -54,8 +54,8 @@
         dTopYZANGLELIMIT = (44*FINEANGLES/360);;
     }
     if (iGLOBAL_SCREENWIDTH == 640) {
-        iGLOBAL_FOCALWIDTH = 180;
-        dGLOBAL_FPFOCALWIDTH = 180.0 ;
+        iGLOBAL_FOCALWIDTH = 180- scaleOffset;
+        dGLOBAL_FPFOCALWIDTH = 180.0- scaleOffset ;
         iGLOBAL_HEALTH_X = 40;//20*2;
         iGLOBAL_HEALTH_Y = 466;//(185*2)+16;
         iGLOBAL_AMMO_X = 600;//300*2;
@@ -64,8 +64,8 @@
         dTopYZANGLELIMIT = (42*FINEANGLES/360);;
     }
     if (iGLOBAL_SCREENWIDTH == 800) {
-        iGLOBAL_FOCALWIDTH = 200;
-        dGLOBAL_FPFOCALWIDTH = 200.0 ;
+        iGLOBAL_FOCALWIDTH = 200- scaleOffset;
+        dGLOBAL_FPFOCALWIDTH = 200.0 - scaleOffset;
         iGLOBAL_HEALTH_X = 40;//20*2;
         iGLOBAL_HEALTH_Y = 585;//(185/200)*600;
         iGLOBAL_AMMO_X = 750;//(300/320)*800;