|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: gfx.c,v 1.21 2003/06/16 21:03:16 stpohle Exp $ */
|
|
|
|
/* $Id: gfx.c,v 1.22 2003/06/20 22:59:21 stpohle Exp $ */
|
|
|
|
/* gfx.c */
|
|
|
|
/* gfx.c */
|
|
|
|
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <SDL.h>
|
|
|
@ -595,12 +595,33 @@ gfx_shutdown ()
|
|
|
|
void
|
|
|
|
void
|
|
|
|
gfx_AddUpdateRect (int x, int y, int w, int h)
|
|
|
|
gfx_AddUpdateRect (int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/* clipping of the box */
|
|
|
|
|
|
|
|
if (x >= gfx.res.x || y >= gfx.res.y || y+h <= 0 || x+w <= 0)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (UpdateRects_nr >= MAX_UPDATERECTS)
|
|
|
|
if (UpdateRects_nr >= MAX_UPDATERECTS)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (x < 0)
|
|
|
|
|
|
|
|
UpdateRects[UpdateRects_nr].x = 0;
|
|
|
|
|
|
|
|
else
|
|
|
|
UpdateRects[UpdateRects_nr].x = x;
|
|
|
|
UpdateRects[UpdateRects_nr].x = x;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (y < 0)
|
|
|
|
|
|
|
|
UpdateRects[UpdateRects_nr].y = 0;
|
|
|
|
|
|
|
|
else
|
|
|
|
UpdateRects[UpdateRects_nr].y = y;
|
|
|
|
UpdateRects[UpdateRects_nr].y = y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (w+x >= gfx.res.x)
|
|
|
|
|
|
|
|
UpdateRects[UpdateRects_nr].w = gfx.res.x - x;
|
|
|
|
|
|
|
|
else
|
|
|
|
UpdateRects[UpdateRects_nr].w = w;
|
|
|
|
UpdateRects[UpdateRects_nr].w = w;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (h+y >= gfx.res.y)
|
|
|
|
|
|
|
|
UpdateRects[UpdateRects_nr].h = gfx.res.y - y;
|
|
|
|
|
|
|
|
else
|
|
|
|
UpdateRects[UpdateRects_nr].h = h;
|
|
|
|
UpdateRects[UpdateRects_nr].h = h;
|
|
|
|
|
|
|
|
|
|
|
|
UpdateRects_nr++;
|
|
|
|
UpdateRects_nr++;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|