atari:gem: Align window work area on 16-pixels boundary (faster for bitplanes modes). Remove commented function GEM_ToggleFullscreen not used, and some extra whitespaces. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sat, 30 Sep 2017 15:43:28 +0200
branchSDL-1.2
changeset 115549694b296d6e6
parent 11550 802d6c2c9c61
child 11555 a3426706e128
atari:gem: Align window work area on 16-pixels boundary (faster for bitplanes modes). Remove commented function GEM_ToggleFullscreen not used, and some extra whitespaces.
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemvideo.c
     1.1 --- a/src/video/gem/SDL_gemevents.c	Wed Sep 27 20:59:46 2017 +0200
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Sat Sep 30 15:43:28 2017 +0200
     1.3 @@ -24,7 +24,7 @@
     1.4  /*
     1.5   * GEM SDL video driver implementation
     1.6   * inspired from the Dummy SDL driver
     1.7 - * 
     1.8 + *
     1.9   * Patrice Mandin
    1.10   * and work from
    1.11   * Olivier Landemarre, Johan Klockars, Xavier Joubert, Claude Attard
    1.12 @@ -161,7 +161,7 @@
    1.13  		if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
    1.14  			SDL_PrivateKeyboard(SDL_PRESSED,
    1.15  				SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
    1.16 -			
    1.17 +
    1.18  		/* Key unpressed ? */
    1.19  		if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
    1.20  			SDL_PrivateKeyboard(SDL_RELEASED,
    1.21 @@ -196,7 +196,7 @@
    1.22  			quit=(message[1] == latest_msg_id);
    1.23  			break;
    1.24  		case WM_CLOSED:
    1.25 -		case AP_TERM:    
    1.26 +		case AP_TERM:
    1.27  			SDL_PrivateQuit();
    1.28  			quit=1;
    1.29  			break;
    1.30 @@ -227,7 +227,10 @@
    1.31  			}
    1.32  			/* Update window title */
    1.33  			if (GEM_refresh_name && GEM_icon_name) {
    1.34 -				wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_icon_name)>>16),(short)(((unsigned long)GEM_icon_name) & 0xffff),0,0);
    1.35 +				wind_set(GEM_handle,WF_NAME,
    1.36 +					(short)(((unsigned long)GEM_icon_name)>>16),
    1.37 +					(short)(((unsigned long)GEM_icon_name) & 0xffff),
    1.38 +					0,0);
    1.39  				GEM_refresh_name = SDL_FALSE;
    1.40  			}
    1.41  			break;
    1.42 @@ -239,7 +242,10 @@
    1.43  				SDL_PrivateAppActive(1, SDL_APPACTIVE);
    1.44  			}
    1.45  			if (GEM_refresh_name && GEM_title_name) {
    1.46 -				wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
    1.47 +				wind_set(GEM_handle,WF_NAME,
    1.48 +					(short)(((unsigned long)GEM_title_name)>>16),
    1.49 +					(short)(((unsigned long)GEM_title_name) & 0xffff),
    1.50 +					0,0);
    1.51  				GEM_refresh_name = SDL_FALSE;
    1.52  			}
    1.53  			break;
    1.54 @@ -280,7 +286,7 @@
    1.55  			}
    1.56  			break;
    1.57  	}
    1.58 -	
    1.59 +
    1.60  	return quit;
    1.61  }
    1.62  
    1.63 @@ -383,10 +389,10 @@
    1.64  
    1.65  	for (i=0;i<3;i++) {
    1.66  		int curbutton, prevbutton;
    1.67 -		
    1.68 +
    1.69  		curbutton = mb & (1<<i);
    1.70  		prevbutton = prevmb & (1<<i);
    1.71 -	
    1.72 +
    1.73  		if (curbutton && !prevbutton) {
    1.74  			SDL_PrivateMouseButton(SDL_PRESSED, i+1, 0, 0);
    1.75  		}
     2.1 --- a/src/video/gem/SDL_gemvideo.c	Wed Sep 27 20:59:46 2017 +0200
     2.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Sep 30 15:43:28 2017 +0200
     2.3 @@ -89,9 +89,6 @@
     2.4  static void GEM_UnlockHWSurface(_THIS, SDL_Surface *surface);
     2.5  static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface);
     2.6  static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
     2.7 -#if 0
     2.8 -static int GEM_ToggleFullScreen(_THIS, int on);
     2.9 -#endif
    2.10  
    2.11  /* Internal functions */
    2.12  static void GEM_FreeBuffers(_THIS);
    2.13 @@ -162,7 +159,7 @@
    2.14  	device->UnlockHWSurface = GEM_UnlockHWSurface;
    2.15  	device->FlipHWSurface = GEM_FlipHWSurface;
    2.16  	device->FreeHWSurface = GEM_FreeHWSurface;
    2.17 -	device->ToggleFullScreen = NULL /*GEM_ToggleFullScreen*/;
    2.18 +	device->ToggleFullScreen = NULL;
    2.19  
    2.20  	/* Window manager */
    2.21  	device->SetCaption = GEM_SetCaption;
    2.22 @@ -223,7 +220,7 @@
    2.23  	if  (Getcookie(C_EdDI, &cookie_EdDI) != C_FOUND) {
    2.24  		return;
    2.25  	}
    2.26 -	
    2.27 +
    2.28  	EdDI_version = Atari_get_EdDI_version( (void *)cookie_EdDI);
    2.29  
    2.30  	vq_scrninfo(VDI_handle, work_out);
    2.31 @@ -314,14 +311,14 @@
    2.32  	GEM_version = aes_global[0];
    2.33  	if (GEM_version >= 0x0410) {
    2.34  		short ap_gout[4], errorcode;
    2.35 -		
    2.36 +
    2.37  		GEM_wfeatures=0;
    2.38  		errorcode=appl_getinfo(AES_WINDOW, &ap_gout[0], &ap_gout[1], &ap_gout[2], &ap_gout[3]);
    2.39  
    2.40  		if (errorcode==0) {
    2.41 -			GEM_wfeatures=ap_gout[0];			
    2.42 +			GEM_wfeatures=ap_gout[0];
    2.43  		}
    2.44 -	}	
    2.45 +	}
    2.46  
    2.47  	/* Ask VDI physical workstation handle opened by AES */
    2.48  	VDI_handle = graf_handle(&dummy, &dummy, &dummy, &dummy);
    2.49 @@ -388,7 +385,7 @@
    2.50  	} else {
    2.51  		VDI_oldnumcolors=1<<VDI_bpp;
    2.52  	}
    2.53 -	
    2.54 +
    2.55  	for(i = 0; i < VDI_oldnumcolors; i++) {
    2.56  		short rgb[3];
    2.57  
    2.58 @@ -756,6 +753,11 @@
    2.59  			x2 += GEM_desk_x;
    2.60  			y2 += GEM_desk_y;
    2.61  
    2.62 +			/* Align work area on 16 pixels boundary (faster for bitplanes modes) */
    2.63 +			wind_calc(WC_WORK, GEM_win_type, x2,y2,w2,h2, &x2,&y2,&w2,&h2);
    2.64 +			x2 &= -16;
    2.65 +			wind_calc(WC_BORDER, GEM_win_type, x2,y2,w2,h2, &x2,&y2,&w2,&h2);
    2.66 +
    2.67  			/* Destroy existing window */
    2.68  			if (GEM_handle >= 0) {
    2.69  				wind_close(GEM_handle);
    2.70 @@ -775,7 +777,10 @@
    2.71  #endif
    2.72  
    2.73  			/* Setup window name */
    2.74 -			wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
    2.75 +			wind_set(GEM_handle,WF_NAME,
    2.76 +				(short)(((unsigned long)GEM_title_name)>>16),
    2.77 +				(short)(((unsigned long)GEM_title_name) & 0xffff),
    2.78 +				0,0);
    2.79  			GEM_refresh_name = SDL_FALSE;
    2.80  
    2.81  			/* Open the window */
    2.82 @@ -1063,16 +1068,16 @@
    2.83  
    2.84  	for(i = 0; i < ncolors; i++)
    2.85  	{
    2.86 -		int		r, g, b;
    2.87 -		short	rgb[3];
    2.88 +		int r, g, b;
    2.89 +		short rgb[3];
    2.90  
    2.91  		r = colors[i].r;
    2.92  		g = colors[i].g;
    2.93  		b = colors[i].b;
    2.94  
    2.95  		rgb[0] = VDI_curpalette[i][0] = (1000 * r) / 255;
    2.96 -		rgb[1] = VDI_curpalette[i][1] =(1000 * g) / 255;
    2.97 -		rgb[2] = VDI_curpalette[i][2] =(1000 * b) / 255;
    2.98 +		rgb[1] = VDI_curpalette[i][1] = (1000 * g) / 255;
    2.99 +		rgb[2] = VDI_curpalette[i][2] = (1000 * b) / 255;
   2.100  
   2.101  		vs_color(VDI_handle, vdi_index[firstcolor+i], rgb);
   2.102  	}
   2.103 @@ -1080,19 +1085,6 @@
   2.104  	return(1);
   2.105  }
   2.106  
   2.107 -#if 0
   2.108 -static int GEM_ToggleFullScreen(_THIS, int on)
   2.109 -{
   2.110 -	if (on) {
   2.111 -		GEM_LockScreen(this);
   2.112 -	} else {
   2.113 -		GEM_UnlockScreen(this);
   2.114 -	}
   2.115 -
   2.116 -	return(1);
   2.117 -}
   2.118 -#endif
   2.119 -
   2.120  /* Note:  If we are terminated, this could be called in the middle of
   2.121     another SDL video routine -- notably UpdateRects.
   2.122  */
   2.123 @@ -1145,7 +1137,7 @@
   2.124  		SDL_modelist[0]=NULL;
   2.125  	}
   2.126  
   2.127 -	this->screen->pixels = NULL;	
   2.128 +	this->screen->pixels = NULL;
   2.129  }
   2.130  
   2.131  void GEM_wind_redraw(_THIS, int winhandle, short *inside)
   2.132 @@ -1203,7 +1195,7 @@
   2.133  	if (iconified && GEM_icon) {
   2.134  		short icon_rect[4], dst_rect[4];
   2.135  		short iconx,icony;
   2.136 -		
   2.137 +
   2.138  		surface = GEM_icon;
   2.139  
   2.140  		GEM_ClearRect(this, rect);
   2.141 @@ -1264,12 +1256,12 @@
   2.142  		/* Redraw all window content */
   2.143  		pxy[0] = rect[0]-wind_pxy[0];
   2.144  		pxy[1] = rect[1]-wind_pxy[1];
   2.145 -	 	pxy[2] = rect[2]-wind_pxy[0];   
   2.146 -	 	pxy[3] = rect[3]-wind_pxy[1];  
   2.147 +	 	pxy[2] = rect[2]-wind_pxy[0];
   2.148 +	 	pxy[3] = rect[3]-wind_pxy[1];
   2.149  
   2.150  		pxy[4] = rect[0];
   2.151  		pxy[5] = rect[1];
   2.152 -		pxy[6] = rect[2];  
   2.153 +		pxy[6] = rect[2];
   2.154  		pxy[7] = rect[3];
   2.155  	}
   2.156