]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix some bugs in the last commit (perspective was off)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Jun 2007 05:37:59 +0000 (05:37 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Jun 2007 05:37:59 +0000 (05:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7420 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
clvm_cmds.c

index 59809c91b719e1ccdfaa7829380fd57666bcae48..f010ece68947efd412e6b94f1051a907a8f55b01 100644 (file)
@@ -1580,6 +1580,7 @@ static void R_Envmap_f (void)
        r_view.width = size;
        r_view.height = size;
        r_view.depth = 1;
+       r_view.useperspective = true;
 
        r_view.frustum_x = tan(90 * M_PI / 360.0);
        r_view.frustum_y = tan(90 * M_PI / 360.0);
@@ -1814,6 +1815,7 @@ void SCR_DrawScreen (void)
                // this it simply assumes the requested fov is the vertical fov
                // for a 4x3 display, if the ratio is not 4x3 this makes the fov
                // higher/lower according to the ratio
+               r_view.useperspective = true;
                r_view.frustum_y = tan(scr_fov.value * M_PI / 360.0) * (3.0/4.0) * cl.viewzoom;
                r_view.frustum_x = r_view.frustum_y * (float)r_view.width / (float)r_view.height / vid_pixelheight.value;
 
@@ -1834,6 +1836,7 @@ void SCR_DrawScreen (void)
                        r_view.y = 0;
                        r_view.z = 0;
 
+                       r_view.useperspective = true;
                        r_view.frustum_y = tan(scr_zoomwindow_fov.value * M_PI / 360.0) * (3.0/4.0) * cl.viewzoom;
                        r_view.frustum_x = r_view.frustum_y * vid_pixelheight.value * (float)r_view.width / (float)r_view.height;
 
@@ -1853,6 +1856,7 @@ void SCR_DrawScreen (void)
                r_view.x = 0;
                r_view.y = 0;
                r_view.z = 0;
+               r_view.useperspective = false;
        }
 
        // draw 2D stuff
index b8544075a03717a30dfb6deb79b348202c094e83..f84932a61b5ded0b9f2464fe7c659b31ccebbcb8 100644 (file)
@@ -625,6 +625,12 @@ static void VM_CL_R_ClearScene (void)
        r_view.width = vid.width;
        r_view.height = vid.height;
        r_view.depth = 1;
+       // FIXME: restore frustum_x/frustum_y
+       r_view.useperspective = true;
+       r_view.frustum_y = tan(scr_fov.value * M_PI / 360.0) * (3.0/4.0) * cl.viewzoom;
+       r_view.frustum_x = r_view.frustum_y * (float)r_view.width / (float)r_view.height / vid_pixelheight.value;
+       r_view.frustum_x *= r_refdef.frustumscale_x;
+       r_view.frustum_y *= r_refdef.frustumscale_y;
        // FIXME: restore cl.csqc_origin
        // FIXME: restore cl.csqc_angles
        cl.csqc_vidvars.drawworld = true;