From ccf3e90e49b302ae8ae0920203c1bdfcddd8276b Mon Sep 17 00:00:00 2001 From: William McBrine Date: Fri, 29 Jun 2007 10:57:28 +0000 Subject: [PATCH] A couple more ways to avoid adding a rect. --- sdl1/pdcdisp.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sdl1/pdcdisp.c b/sdl1/pdcdisp.c index 8603c514..9a456f57 100644 --- a/sdl1/pdcdisp.c +++ b/sdl1/pdcdisp.c @@ -13,7 +13,7 @@ #include "pdcsdl.h" -RCSID("$Id: pdcdisp.c,v 1.23 2007/06/29 06:54:18 wmcbrine Exp $") +RCSID("$Id: pdcdisp.c,v 1.24 2007/06/29 10:57:28 wmcbrine Exp $") #include #include @@ -163,10 +163,13 @@ void PDC_gotoyx(int row, int col) SDL_BlitSurface(pdc_font, &src, pdc_screen, &dest); - if (rectcount == MAXRECT) - PDC_update_rects(); + if (oldrow != row || oldcol != col) + { + if (rectcount == MAXRECT) + PDC_update_rects(); - uprect[rectcount++] = dest; + uprect[rectcount++] = dest; + } } /* handle the A_*LINE attributes */ @@ -246,9 +249,14 @@ void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) if (rectcount) lastrect = uprect[rectcount - 1]; - if (rectcount && (lastrect.x == dest.x) && - (lastrect.w == dest.w) && (lastrect.y + lastrect.h == dest.y)) - uprect[rectcount - 1].h = lastrect.h + pdc_fheight; + if (rectcount && lastrect.x == dest.x && lastrect.w == dest.w) + { + if (lastrect.y + lastrect.h == dest.y) + uprect[rectcount - 1].h = lastrect.h + pdc_fheight; + else + if (lastrect.y != dest.y) + uprect[rectcount++] = dest; + } else uprect[rectcount++] = dest;