atari:gem: Remove now useless wind_pxy array SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Wed, 04 Oct 2017 20:49:01 +0200
branchSDL-1.2
changeset 11565df385dfd7bd6
parent 11564 eb391d3461f1
child 11566 8292cd49212c
atari:gem: Remove now useless wind_pxy array
src/video/gem/SDL_gemvideo.c
     1.1 --- a/src/video/gem/SDL_gemvideo.c	Mon Oct 02 22:06:05 2017 +0200
     1.2 +++ b/src/video/gem/SDL_gemvideo.c	Wed Oct 04 20:49:01 2017 +0200
     1.3 @@ -1225,23 +1225,18 @@
     1.4  static void refresh_window(_THIS, int winhandle, short *rect)
     1.5  {
     1.6  	MFDB mfdb_src;
     1.7 -	short pxy[8],wind_pxy[8];
     1.8 +	short pxy[8];
     1.9  	SDL_Surface *surface;
    1.10  	int iconified;
    1.11  
    1.12  	/* Is window iconified ? */
    1.13  	iconified = 0;
    1.14  /*	if (GEM_wfeatures & (1<<WF_ICONIFY))*/ {
    1.15 -		if (wind_get(winhandle, WF_ICONIFY, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])!=0) {
    1.16 -			iconified = wind_pxy[0];
    1.17 +		if (wind_get(winhandle, WF_ICONIFY, &pxy[0], &pxy[1], &pxy[2], &pxy[3])!=0) {
    1.18 +			iconified = pxy[0];
    1.19  		}
    1.20  	}
    1.21  
    1.22 -	wind_pxy[0] = GEM_work_x;
    1.23 -	wind_pxy[1] = GEM_work_y;
    1.24 -	wind_pxy[2] = GEM_work_w;
    1.25 -	wind_pxy[3] = GEM_work_h;
    1.26 -
    1.27  	if (iconified && GEM_icon) {
    1.28  		short icon_rect[4], dst_rect[4];
    1.29  		short iconx,icony;
    1.30 @@ -1251,8 +1246,8 @@
    1.31  		GEM_ClearRect(this, rect);
    1.32  
    1.33  		/* Calculate centered icon(x,y,w,h) relative to window */
    1.34 -		iconx = (wind_pxy[2]-surface->w)>>1;
    1.35 -		icony = (wind_pxy[3]-surface->h)>>1;
    1.36 +		iconx = (GEM_work_w-surface->w)>>1;
    1.37 +		icony = (GEM_work_h-surface->h)>>1;
    1.38  
    1.39  		icon_rect[0] = iconx;
    1.40  		icon_rect[1] = icony;
    1.41 @@ -1260,8 +1255,8 @@
    1.42  		icon_rect[3] = surface->h;
    1.43  
    1.44  		/* Calculate redraw rectangle(x,y,w,h) relative to window */
    1.45 -		dst_rect[0] = rect[0]-wind_pxy[0];
    1.46 -		dst_rect[1] = rect[1]-wind_pxy[1];
    1.47 +		dst_rect[0] = rect[0]-GEM_work_x;
    1.48 +		dst_rect[1] = rect[1]-GEM_work_y;
    1.49  		dst_rect[2] = rect[2]-rect[0]+1;
    1.50  		dst_rect[3] = rect[3]-rect[1]+1;
    1.51  
    1.52 @@ -1279,8 +1274,8 @@
    1.53  #endif
    1.54  
    1.55  		/* Calculate icon(x1,y1,x2,y2) relative to screen */
    1.56 -		icon_rect[0] += wind_pxy[0];
    1.57 -		icon_rect[1] += wind_pxy[1];
    1.58 +		icon_rect[0] += GEM_work_x;
    1.59 +		icon_rect[1] += GEM_work_y;
    1.60  		icon_rect[2] += icon_rect[0]-1;
    1.61  		icon_rect[3] += icon_rect[1]-1;
    1.62  
    1.63 @@ -1291,10 +1286,10 @@
    1.64  	 	pxy[7]=pxy[3]=MIN(icon_rect[3],rect[3]);
    1.65  
    1.66  		/* Calculate icon source image pos relative to window */
    1.67 -		pxy[0] -= wind_pxy[0]+iconx;
    1.68 -		pxy[1] -= wind_pxy[1]+icony;
    1.69 -		pxy[2] -= wind_pxy[0]+iconx;
    1.70 -		pxy[3] -= wind_pxy[1]+icony;
    1.71 +		pxy[0] -= GEM_work_x+iconx;
    1.72 +		pxy[1] -= GEM_work_y+icony;
    1.73 +		pxy[2] -= GEM_work_x+iconx;
    1.74 +		pxy[3] -= GEM_work_y+icony;
    1.75  
    1.76  	} else {
    1.77  		surface = this->screen;
    1.78 @@ -1304,10 +1299,10 @@
    1.79  #endif
    1.80  
    1.81  		/* Redraw all window content */
    1.82 -		pxy[0] = rect[0]-wind_pxy[0];
    1.83 -		pxy[1] = rect[1]-wind_pxy[1];
    1.84 -	 	pxy[2] = rect[2]-wind_pxy[0];
    1.85 -	 	pxy[3] = rect[3]-wind_pxy[1];
    1.86 +		pxy[0] = rect[0]-GEM_work_x;
    1.87 +		pxy[1] = rect[1]-GEM_work_y;
    1.88 +	 	pxy[2] = rect[2]-GEM_work_x;
    1.89 +	 	pxy[3] = rect[3]-GEM_work_y;
    1.90  
    1.91  		pxy[4] = rect[0];
    1.92  		pxy[5] = rect[1];
    1.93 @@ -1319,18 +1314,18 @@
    1.94  		void *src, *dest;
    1.95  		int x1,x2;
    1.96  
    1.97 -		x1 = (rect[0]-wind_pxy[0]) & ~15;
    1.98 -		x2 = rect[2]-wind_pxy[0];
    1.99 +		x1 = (rect[0]-GEM_work_x) & ~15;
   1.100 +		x2 = rect[2]-GEM_work_x;
   1.101  		if (x2 & 15) {
   1.102  			x2 = (x2 | 15) +1;
   1.103  		}
   1.104  
   1.105  		src = surface->pixels;
   1.106 -		src += surface->pitch * (rect[1]-wind_pxy[1]);
   1.107 +		src += surface->pitch * (rect[1]-GEM_work_y);
   1.108  		src += x1;
   1.109  
   1.110  		dest = GEM_buffer2;
   1.111 -		dest += surface->pitch * (rect[1]-wind_pxy[1]);
   1.112 +		dest += surface->pitch * (rect[1]-GEM_work_y);
   1.113  		dest += x1;
   1.114  
   1.115  		SDL_Atari_C2pConvert(