src/video/gem/SDL_gemvideo.c
branchSDL-1.2
changeset 11576 b3255371e439
parent 11571 49fa2a49574b
child 11580 b28174b10269
     1.1 --- a/src/video/gem/SDL_gemvideo.c	Sat Oct 07 00:40:47 2017 +0200
     1.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Oct 07 12:00:04 2017 +0200
     1.3 @@ -98,7 +98,7 @@
     1.4  static void GEM_SetNewPalette(_THIS, Uint16 newpal[256][3]);
     1.5  static void GEM_LockScreen(_THIS);
     1.6  static void GEM_UnlockScreen(_THIS);
     1.7 -static void refresh_window(_THIS, int winhandle, short *rect);
     1.8 +static void refresh_window(_THIS, int winhandle, short *rect, SDL_bool pad_only);
     1.9  
    1.10  #if SDL_VIDEO_OPENGL
    1.11  /* OpenGL functions */
    1.12 @@ -855,9 +855,9 @@
    1.13  	return(current);
    1.14  }
    1.15  
    1.16 -void GEM_align_work_area(_THIS, short windowid, int clear_pads)
    1.17 +void GEM_align_work_area(_THIS, short windowid, SDL_bool clear_pads)
    1.18  {
    1.19 -	int new_x, new_w;
    1.20 +	int new_x, new_w, old_x, old_w;
    1.21  
    1.22  	wind_get(windowid, WF_WORKXYWH, &GEM_work_x,&GEM_work_y,&GEM_work_w,&GEM_work_h);
    1.23  	if (GEM_iconified) {
    1.24 @@ -865,8 +865,8 @@
    1.25  	}
    1.26  
    1.27  	/* Align work area on 16 pixels boundary (faster for bitplanes modes) */
    1.28 -	new_x = GEM_work_x;
    1.29 -	new_w = GEM_work_w;
    1.30 +	new_x = old_x = GEM_work_x;
    1.31 +	new_w = old_w = GEM_work_w;
    1.32  	if (new_x & 15) {
    1.33  		new_x = (new_x|15)+1;
    1.34  	} else {
    1.35 @@ -875,6 +875,9 @@
    1.36  	new_w -= (new_x - GEM_work_x);
    1.37  	new_w &= ~15;
    1.38  
    1.39 +	GEM_work_x = new_x;
    1.40 +	GEM_work_w = new_w;
    1.41 +
    1.42  	if (clear_pads) {
    1.43  		short rect[4];
    1.44  
    1.45 @@ -882,18 +885,15 @@
    1.46  		rect[3] = GEM_work_h;
    1.47  
    1.48  		/* Left padding */
    1.49 -		rect[0] = GEM_work_x;
    1.50 -		rect[2] = new_x-GEM_work_x+1;
    1.51 -		GEM_ClearRectXYWH(this, rect);
    1.52 +		rect[0] = old_x;
    1.53 +		rect[2] = new_x-old_x+1;
    1.54 +		GEM_wind_redraw(this, GEM_handle, rect, SDL_TRUE);
    1.55  
    1.56  		/* Right padding */
    1.57  		rect[0] = new_x + new_w;
    1.58 -		rect[2] = (GEM_work_w-new_w)-(new_x-GEM_work_x)+1;
    1.59 -		GEM_ClearRectXYWH(this, rect);
    1.60 +		rect[2] = (old_w-new_w)-(new_x-old_x)+1;
    1.61 +		GEM_wind_redraw(this, GEM_handle, rect, SDL_TRUE);
    1.62  	}
    1.63 -
    1.64 -	GEM_work_w = new_w;
    1.65 -	GEM_work_x = new_x;
    1.66  }
    1.67  
    1.68  static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface)
    1.69 @@ -1006,7 +1006,7 @@
    1.70  		rect[2] = rects[i].w;
    1.71  		rect[3] = rects[i].h;
    1.72  
    1.73 -		GEM_wind_redraw(this, GEM_handle, rect);
    1.74 +		GEM_wind_redraw(this, GEM_handle, rect, SDL_FALSE);
    1.75  	}
    1.76  }
    1.77  
    1.78 @@ -1096,7 +1096,7 @@
    1.79  	rect[2] = GEM_work_w;
    1.80  	rect[3] = GEM_work_h;
    1.81  
    1.82 -	GEM_wind_redraw(this, GEM_handle, rect);
    1.83 +	GEM_wind_redraw(this, GEM_handle, rect, SDL_FALSE);
    1.84  
    1.85  	return(0);
    1.86  }
    1.87 @@ -1203,7 +1203,7 @@
    1.88  	this->screen->pixels = NULL;
    1.89  }
    1.90  
    1.91 -void GEM_wind_redraw(_THIS, int winhandle, short *inside)
    1.92 +void GEM_wind_redraw(_THIS, int winhandle, short *inside, SDL_bool pad_only)
    1.93  {
    1.94  	short todo[4];
    1.95  
    1.96 @@ -1218,7 +1218,7 @@
    1.97  		while (todo[2] && todo[3]) {
    1.98  
    1.99  			if (rc_intersect((GRECT *)inside,(GRECT *)todo)) {
   1.100 -				refresh_window(this, winhandle, todo);
   1.101 +				refresh_window(this, winhandle, todo, pad_only);
   1.102  			}
   1.103  
   1.104  			if (wind_get(winhandle, WF_NEXTXYWH, &todo[0], &todo[1], &todo[2], &todo[3])==0) {
   1.105 @@ -1234,7 +1234,7 @@
   1.106  	v_show_c(VDI_handle,1);
   1.107  }
   1.108  
   1.109 -static void refresh_window(_THIS, int winhandle, short *rect)
   1.110 +static void refresh_window(_THIS, int winhandle, short *rect, SDL_bool pad_only)
   1.111  {
   1.112  	MFDB mfdb_src;
   1.113  	short pxy[8], work_rect[4];
   1.114 @@ -1286,7 +1286,7 @@
   1.115  	}
   1.116  
   1.117  	/* Do we intersect zone to redraw ? */
   1.118 -	if (!rc_intersect((GRECT *)work_rect, (GRECT *)rect)) {
   1.119 +	if (pad_only || !rc_intersect((GRECT *)work_rect, (GRECT *)rect)) {
   1.120  		return;
   1.121  	}
   1.122