From 217f1a7e91e2afc3c42b48b8d03cf33ccda11a6e Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 19 May 2004 03:35:48 +0000 Subject: [PATCH] fix off-by-one error in ogl_urect, right and bottom are inclusive not exclusive (d1x r1.28) --- ChangeLog | 3 +++ arch/ogl/gr.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f960703b..5a5d4491 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-05-18 Bradley Bell + * arch/ogl/gr.c: fix off-by-one error in ogl_urect, right and + bottom are inclusive not exclusive (d1x r1.28) + * arch/ogl/ogl.c, include/ogl_init.h, main/polyobj.c: fix briefing spinning robot display in OGL (d1x r1.28, r1.20, r1.2) diff --git a/arch/ogl/gr.c b/arch/ogl/gr.c index 60c6b1bd..ac2712d3 100644 --- a/arch/ogl/gr.c +++ b/arch/ogl/gr.c @@ -1,4 +1,4 @@ -/* $Id: gr.c,v 1.17 2004-05-16 00:45:25 schaffner Exp $ */ +/* $Id: gr.c,v 1.18 2004-05-19 03:35:48 btb Exp $ */ /* * * OGL video functions. - Added 9/15/99 Matthew Mueller @@ -487,10 +487,10 @@ void ogl_urect(int left,int top,int right,int bot){ int c=COLOR; xo=(left+grd_curcanv->cv_bitmap.bm_x)/(float)last_width; - xf=(right+grd_curcanv->cv_bitmap.bm_x)/(float)last_width; + xf = (right + 1 + grd_curcanv->cv_bitmap.bm_x) / (float)last_width; yo=1.0-(top+grd_curcanv->cv_bitmap.bm_y)/(float)last_height; - yf=1.0-(bot+grd_curcanv->cv_bitmap.bm_y)/(float)last_height; - + yf = 1.0 - (bot + 1 + grd_curcanv->cv_bitmap.bm_y) / (float)last_height; + OGL_DISABLE(TEXTURE_2D); glColor3f(CPAL2Tr(c),CPAL2Tg(c),CPAL2Tb(c)); glBegin(GL_QUADS); -- 2.39.2