From: divverent Date: Sun, 25 Jul 2010 06:14:44 +0000 (+0000) Subject: PROPERLY handle roundoff errors in drawsetcliparea X-Git-Tag: xonotic-v0.1.0preview~230^2~119 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2867a36bdaca3c6d0ed41c6b25e5458abea523d8;p=xonotic%2Fdarkplaces.git PROPERLY handle roundoff errors in drawsetcliparea git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10359 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_draw.c b/gl_draw.c index af704ea3..16eb6069 100644 --- 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);