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.
This commit is contained in:
William McBrine
2007-06-19 05:09:27 +00:00
parent 71e71d24ad
commit ca7b90f8eb

View File

@@ -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 <stdlib.h>
#include <string.h>
@@ -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;
}
}