# HG changeset patch # User Patrice Mandin # Date 1068839293 0 # Node ID 7e4347dd2f9cccf9a36d7cbf00afa88463972a44 # Parent 028e03e273c87df7f04b7afecb55aaafeb7ea24e Small fix for iconification diff -r 028e03e273c8 -r 7e4347dd2f9c src/video/gem/SDL_gemvideo.c --- a/src/video/gem/SDL_gemvideo.c Wed Nov 12 18:49:29 2003 +0000 +++ b/src/video/gem/SDL_gemvideo.c Fri Nov 14 19:48:13 2003 +0000 @@ -67,6 +67,11 @@ #define GEM_VID_DRIVER_NAME "gem" +#undef MIN +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) +#undef MAX +#define MAX(a,b) (((a)>(b)) ? (a) : (b)) + /* Variables */ static unsigned char vdi_index[256] = { @@ -1105,14 +1110,18 @@ if (iconified && GEM_icon) { short icon_rect[4], dst_rect[4]; + short iconx,icony; surface = GEM_icon; GEM_ClearRect(this, rect); /* Calculate centered icon(x,y,w,h) relative to window */ - icon_rect[0] = (wind_pxy[2]-surface->w)>>1; - icon_rect[1] = (wind_pxy[3]-surface->h)>>1; + iconx = (wind_pxy[2]-surface->w)>>1; + icony = (wind_pxy[3]-surface->h)>>1; + + icon_rect[0] = iconx; + icon_rect[1] = icony; icon_rect[2] = surface->w; icon_rect[3] = surface->h; @@ -1142,42 +1151,16 @@ icon_rect[3] += icon_rect[1]-1; /* Calculate intersection rectangle to redraw */ - pxy[0]=0; - pxy[1]=0; - pxy[2]=surface->w - 1; - pxy[3]=surface->h - 1; - pxy[4]=rect[0]; - pxy[5]=rect[1]; - pxy[6]=rect[2]; - pxy[7]=rect[3]; - - if (icon_rect[0]>rect[0]) { - pxy[4]=icon_rect[0]; - } else if (icon_rect[0]rect[1]) { - pxy[5]=icon_rect[1]; - } else if (icon_rect[1]rect[2]) { - pxy[2]=rect[2]-icon_rect[0]; - pxy[6]=rect[2]; - } else if (icon_rect[2]rect[3]) { - pxy[3]=rect[3]-icon_rect[1]; - pxy[7]=rect[3]; - } else if (icon_rect[3]screen;