[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.60,1.61 sdl.cpp,1.33,1.34 sdl_gl.cpp,1.29,1.30
Travis Howell
kirben at users.sourceforge.net
Mon Jun 16 23:14:15 CEST 2003
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv4910/backends/sdl
Modified Files:
sdl-common.cpp sdl.cpp sdl_gl.cpp
Log Message:
Make OpenGL specific scaler use other keys so all normal scaler canbe made available.
Index: sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- sdl-common.cpp 15 Jun 2003 11:32:14 -0000 1.60
+++ sdl-common.cpp 17 Jun 2003 06:13:57 -0000 1.61
@@ -572,6 +572,22 @@
}
}
+ // 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) {
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- sdl.cpp 28 May 2003 22:19:11 -0000 1.33
+++ sdl.cpp 17 Jun 2003 06:13:57 -0000 1.34
@@ -132,7 +132,7 @@
_scaler_proc = Normal1x;
break;
default:
- error("unknown gfx mode");
+ error("unknown gfx mode %d", _mode);
_scaleFactor = 1;
_scaler_proc = NULL;
}
Index: sdl_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl_gl.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- sdl_gl.cpp 14 May 2003 19:47:57 -0000 1.29
+++ sdl_gl.cpp 17 Jun 2003 06:13:57 -0000 1.30
@@ -54,6 +54,7 @@
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 @@
{
_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 @@
_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 @@
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 @@
}
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 @@
}
}
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)
More information about the Scummvm-git-logs
mailing list