From ca7b90f8eb1eb1226aa533acfbf6acdbc00ac1fd Mon Sep 17 00:00:00 2001 From: William McBrine Date: Tue, 19 Jun 2007 05:09:27 +0000 Subject: [PATCH] SDL_Flip() can be faster when there are a large number of rectangles... mostly this will be when rectcount is about to overflow. The existing mechanism is clearly faster in many circumstances, and, I think, in most that will be encountered in real applications. But it's a complex issue. --- sdl1/pdcdisp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdl1/pdcdisp.c b/sdl1/pdcdisp.c index e85f0b6b..82c5c44c 100644 --- a/sdl1/pdcdisp.c +++ b/sdl1/pdcdisp.c @@ -13,7 +13,7 @@ #include "pdcsdl.h" -RCSID("$Id: pdcdisp.c,v 1.18 2007/06/19 01:49:02 wmcbrine Exp $") +RCSID("$Id: pdcdisp.c,v 1.19 2007/06/19 05:09:27 wmcbrine Exp $") #include #include @@ -69,7 +69,11 @@ void PDC_update_rects(void) { if (rectcount) { - SDL_UpdateRects(pdc_screen, rectcount, uprect); + if (rectcount == MAXRECT) + SDL_Flip(pdc_screen); + else + SDL_UpdateRects(pdc_screen, rectcount, uprect); + rectcount = 0; } }