diff options
| -rw-r--r-- | README | 12 | ||||
| -rw-r--r-- | backends/sdl/sdl-common.cpp | 16 | ||||
| -rw-r--r-- | backends/sdl/sdl.cpp | 2 | ||||
| -rw-r--r-- | backends/sdl/sdl_gl.cpp | 47 | ||||
| -rw-r--r-- | common/scaler.h | 3 | 
5 files changed, 58 insertions, 22 deletions
| @@ -378,15 +378,11 @@ simon games.          Keyboard Arrow Keys    - simulate mouse movement          Ctrl-f                 - runs in fast mode.          Ctrl-Alt 0-9           - Switch between graphics filters -        Ctrl-Alt 1             - Switch beetwen bilinear and non-linear +        Ctrl-Alt b             - Switch beetwen bilinear and non-linear                                   filtering [OpenGL backend] -        Ctrl-Alt 2             - Don't fit the game in the whole screen  -                                 (black borders) [OpenGL backend] -        Ctrl-Alt 3             - Fit the game in the whole screen -                                 (no black borders) [OpenGL backend] -        Ctrl-Alt 4-7           - Switch between graphics filters  -                                 [OpenGL backend] - +        Ctrl-Alt a             - Switch between: [OpenGL backend] +                                 - Fit the game in the whole screen (No black borders) +                                 - Don't fit the game in the whole screen (Black borders)       Scumm:          Ctrl 0-9 and Alt 0-9   - load and save game state          Ctrl-g                 - runs in really REALLY fast mode. diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index f22d671476..00e695ac2d 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -572,6 +572,22 @@ bool OSystem_SDL_Common::poll_event(Event *event) {  				}  			} +			// Ctr-Alt-a will change aspect ratio in OpenGL backend +			if (b == (KBD_CTRL|KBD_ALT) && ev.key.keysym.sym=='a') { +					Property prop; +					prop.gfx_mode = 11; +					property(PROP_SET_GFX_MODE, &prop); +					break; +			} + +			// Ctr-Alt-b will change bilinear filtering in OpenGL backend +			if (b == (KBD_CTRL|KBD_ALT) && ev.key.keysym.sym=='b') { +					Property prop; +					prop.gfx_mode = 12; +					property(PROP_SET_GFX_MODE, &prop); +					break; +			} +  #ifdef QTOPIA  			// quit on fn+backspace on zaurus  			if (ev.key.keysym.sym == 127) { diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 0b3e29018b..d5b5d1656c 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -132,7 +132,7 @@ normal_mode:;  		_scaler_proc = Normal1x;  		break;  	default: -		error("unknown gfx mode"); +		error("unknown gfx mode %d", _mode);  		_scaleFactor = 1;  		_scaler_proc = NULL;  	} diff --git a/backends/sdl/sdl_gl.cpp b/backends/sdl/sdl_gl.cpp index ad3a2d9f5a..7ba030bd43 100644 --- a/backends/sdl/sdl_gl.cpp +++ b/backends/sdl/sdl_gl.cpp @@ -54,6 +54,7 @@ protected:  	int _glFlags;  	int _glScreenStart;  	bool _glBilinearFilter; +	bool _glAspectRatio;  	bool _usingOpenGL;  	SDL_Surface *tmpSurface; // Used for black rectangles blitting   	SDL_Rect tmpBlackRect;   // Black rectangle at end of the GL screen @@ -78,7 +79,8 @@ OSystem_SDL_OpenGL::OSystem_SDL_OpenGL()  {    _glScreenStart = 0;     _glBilinearFilter = true; -  _usingOpenGL = true; // false => Switch to filters used in the sdl.cpp version +  _glAspectRatio = false; +  _usingOpenGL = false; // false => Switch to filters used in the sdl.cpp version    _glBottomOfTexture = 256; // height is always 256    // 640x480 resolution    _glWindow.w = 640; @@ -147,12 +149,27 @@ void OSystem_SDL_OpenGL::load_gfx_mode() {  		_scaleFactor = 2;  		_scaler_proc = DotMatrix;  		break; +	case GFX_DOUBLESIZE: +		_scaleFactor = 2; +		_scaler_proc = Normal2x; +		break; + +	case GFX_TRIPLESIZE: +		if (_full_screen) { +			warning("full screen in useless in triplesize mode, reverting to normal mode"); +			goto normal_mode; +		} +		_scaleFactor = 3; +		_scaler_proc = Normal3x; +		break; +  	case GFX_NORMAL: +normal_mode:;  		_scaleFactor = 1;  		_scaler_proc = Normal1x;  		break;  	default: -//		error("unknown gfx mode"); +		error("unknown gfx mode %d", _mode);  		_mode = GFX_NORMAL;  		_scaleFactor = 1;  		_scaler_proc = Normal1x; @@ -525,7 +542,7 @@ uint32 OSystem_SDL_OpenGL::property(int param, Property *value) {  	else if (param == PROP_SET_GFX_MODE) {  		SDL_Rect full = {0, 0, _screenWidth, _screenHeight}; -		if (value->gfx_mode < 3) { // OpenGL modes +		if (value->gfx_mode > 10) { // OpenGL modes  			if (!_usingOpenGL) {  				_usingOpenGL = true;  				_mode = GFX_NORMAL; @@ -534,7 +551,7 @@ uint32 OSystem_SDL_OpenGL::property(int param, Property *value) {  		}  		switch(value->gfx_mode) { -			case 0: // Bilinear Filtering (on/off) +			case GFX_BILINEAR: // Bilinear Filtering (on/off)  				_glBilinearFilter ^= true;  				for (i = 0; i < 2; i++) {  					glBindTexture(GL_TEXTURE_2D, i); @@ -563,15 +580,19 @@ uint32 OSystem_SDL_OpenGL::property(int param, Property *value) {  					}  				}  				break; -			case 1: // Don't use the whole screen (black borders) -				fb2gl.init(0, 0, 0, 15, _glFlags); -				_glScreenStart = 20; -				SDL_FillRect(tmpSurface, &tmpBlackRect, 0); -				fb2gl.blit16(tmpSurface, 1, &tmpBlackRect, 0, 0); -				break; -			case 2: // Use the whole screen -				fb2gl.init(0, 0, 0, 70, _glFlags); -				_glScreenStart = 0; +			case GFX_ASPECTRATIO:  +				_glAspectRatio ^= true; +				if (_glAspectRatio) { +					// Don't use the whole screen (black borders) +					fb2gl.init(0, 0, 0, 15, _glFlags); +					_glScreenStart = 20; +					SDL_FillRect(tmpSurface, &tmpBlackRect, 0); +					fb2gl.blit16(tmpSurface, 1, &tmpBlackRect, 0, 0); +				} else { +					// Use the whole screen +					fb2gl.init(0, 0, 0, 70, _glFlags); +					_glScreenStart = 0; +				}  				break;  			default: // SDL backend  				if (value->gfx_mode >= 10) diff --git a/common/scaler.h b/common/scaler.h index cf55d93733..e3246587c9 100644 --- a/common/scaler.h +++ b/common/scaler.h @@ -53,6 +53,9 @@ enum {  	GFX_ADVMAME3X = 7,  	GFX_TV2X = 8,  	GFX_DOTMATRIX = 9, + +	GFX_ASPECTRATIO = 11, // OpenGL backend +	GFX_BILINEAR = 12,    // OpenGL backend  	GFX_FLIPPING = 100,	// Palmos  	GFX_DOUBLEBUFFER = 101,	// Palmos | 
