]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Tomaz implemented the vid_pixelaspect patch provided by Grisha Spivak
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 May 2004 00:38:50 +0000 (00:38 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 21 May 2004 00:38:50 +0000 (00:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4210 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
cl_screen.h
gl_backend.c

index 27b06ab54b87ccdfd29d0117701b5c18a5c1f158..8defda16214c7c6da0899c83689532be404c572a 100644 (file)
@@ -17,6 +17,7 @@ cvar_t scr_showpause = {CVAR_SAVE, "showpause","1"};
 cvar_t scr_printspeed = {0, "scr_printspeed","8"};
 cvar_t vid_conwidth = {CVAR_SAVE, "vid_conwidth", "640"};
 cvar_t vid_conheight = {CVAR_SAVE, "vid_conheight", "480"};
+cvar_t vid_pixelaspect = {CVAR_SAVE, "vid_pixelaspect", "1"};
 cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"};
 cvar_t scr_screenshot_jpeg_quality = {CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9"};
 cvar_t scr_screenshot_name = {0, "scr_screenshot_name","dp"};
@@ -471,6 +472,7 @@ void CL_Screen_Init(void)
        Cvar_RegisterVariable (&scr_printspeed);
        Cvar_RegisterVariable (&vid_conwidth);
        Cvar_RegisterVariable (&vid_conheight);
+       Cvar_RegisterVariable (&vid_pixelaspect);
        Cvar_RegisterVariable (&scr_screenshot_jpeg);
        Cvar_RegisterVariable (&scr_screenshot_jpeg_quality);
        Cvar_RegisterVariable (&cl_avidemo);
index 4471f3df5981df72f2c57c21308fe052c2136742..2f1c8e9c981ad1704042dcd5058bd87a7d47ff8f 100644 (file)
@@ -65,6 +65,7 @@ void SHOWLMP_clear(void);
 
 extern cvar_t vid_conwidth;
 extern cvar_t vid_conheight;
+extern cvar_t vid_pixelaspect;
 extern cvar_t scr_screenshot_jpeg;
 extern cvar_t scr_screenshot_jpeg_quality;
 extern cvar_t scr_screenshot_name;
index c5cd70aeade7815fb45b292462bcdb6301ec006a..f5117ecedb65f46bacc3a56ddcd377894bfdab9a 100644 (file)
@@ -1249,7 +1249,7 @@ CalcFov
 float CalcFov (float fov_x, float width, float height)
 {
        // calculate vision size and alter by aspect, then convert back to angle
-       return atan (height / (width / tan(fov_x/360*M_PI))) * 360 / M_PI;
+       return atan (((height/width)/vid_pixelaspect.value)*tan(fov_x/360.*M_PI))*360./M_PI; 
 }
 
 /*