]> git.rm.cloudns.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)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 25 Jul 2010 06:16:10 +0000 (08:16 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10359 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=2867a36bdaca3c6d0ed41c6b25e5458abea523d8

gl_draw.c

index 4d5bc08afe56bdd3047684fe1569743960edfb6e..1dd33d81c603659cade8b2bc1d0bed28fd88c364 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1882,8 +1882,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);