]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
PROPERLY handle roundoff errors in drawsetcliparea
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 Jul 2010 06:14:44 +0000 (06:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 Jul 2010 06:14:44 +0000 (06:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10359 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index af704ea3841c6b04d1018d010a269cb8fbb45b6d..16eb6069ae1d2a080f8beaa21c3d3c41034446a8 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1921,8 +1921,8 @@ void DrawQ_SetClipArea(float x, float y, float width, float height)
        // OGL uses top to bottom
        ix = (int)(0.5 + x * ((float)vid.width / vid_conwidth.integer));
        iy = (int)(0.5 + y * ((float) vid.height / vid_conheight.integer));
-       iw = (int)(width * ((float)vid.width / vid_conwidth.integer));
-       ih = (int)(height * ((float)vid.height / vid_conheight.integer));
+       iw = (int)(0.5 + (x+width) * ((float)vid.width / vid_conwidth.integer)) - ix;
+       ih = (int)(0.5 + (y+height) * ((float) vid.height / vid_conheight.integer)) - iy;
        GL_Scissor(ix, vid.height - iy - ih, iw, ih);
 
        GL_ScissorTest(true);