[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.108,1.109 sdl-common.h,1.47,1.48 sdl.cpp,1.58,1.59
Max Horn
fingolfin at users.sourceforge.net
Wed Feb 25 02:09:02 CET 2004
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9545
Modified Files:
sdl-common.cpp sdl-common.h sdl.cpp
Log Message:
fix fullscreen switch code 'properly' (sorry for missing this one, folks). Since we don't have the OpenGL variant anymore, we could now merge back the two parts of the SDL backend - and maybe split them into multiple files in a different way (events, graphics, audio, misc ?)
Index: sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- sdl-common.cpp 25 Feb 2004 06:08:00 -0000 1.108
+++ sdl-common.cpp 25 Feb 2004 09:53:36 -0000 1.109
@@ -1111,22 +1111,7 @@
switch (f) {
case kFeatureFullscreenMode:
- if (_full_screen != enable) {
- //assert(_hwscreen != 0);
- _full_screen ^= true;
-#ifdef MACOSX
- // On OS X, SDL_WM_ToggleFullScreen is currently not implemented. Worse,
- // it still always returns -1. So we simply don't call it at all and
- // use hotswap_gfx_mode() directly to switch to fullscreen mode.
- hotswap_gfx_mode();
-#else
- // FIXME: _hwscreen is not currently available from SDL_Common's scope
- //if (!SDL_WM_ToggleFullScreen(_hwscreen)) {
- // if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode
- hotswap_gfx_mode();
- //}
-#endif
- }
+ setFullscreenMode(enable);
break;
case kFeatureAspectRatioCorrection:
if (_screenHeight == 200 && _adjustAspectRatio != enable) {
Index: sdl-common.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- sdl-common.h 24 Feb 2004 22:39:37 -0000 1.47
+++ sdl-common.h 25 Feb 2004 09:53:36 -0000 1.48
@@ -236,6 +236,8 @@
virtual void load_gfx_mode() = 0;
virtual void unload_gfx_mode() = 0;
virtual void hotswap_gfx_mode() = 0;
+
+ virtual void setFullscreenMode(bool enable) = 0;
virtual bool save_screenshot(const char *filename) = 0;
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- sdl.cpp 24 Feb 2004 22:39:37 -0000 1.58
+++ sdl.cpp 25 Feb 2004 09:53:36 -0000 1.59
@@ -40,6 +40,8 @@
virtual void unload_gfx_mode();
virtual bool save_screenshot(const char *filename);
virtual void hotswap_gfx_mode();
+
+ virtual void setFullscreenMode(bool enable);
};
OSystem_SDL_Common *OSystem_SDL_Common::create_intern() {
@@ -367,3 +369,22 @@
SDL_SaveBMP(_hwscreen, filename);
return true;
}
+
+void OSystem_SDL::setFullscreenMode(bool enable) {
+ if (_full_screen != enable) {
+ assert(_hwscreen != 0);
+ _full_screen ^= true;
+#ifdef MACOSX
+ // On OS X, SDL_WM_ToggleFullScreen is currently not implemented. Worse,
+ // it still always returns -1. So we simply don't call it at all and
+ // use hotswap_gfx_mode() directly to switch to fullscreen mode.
+ hotswap_gfx_mode();
+#else
+ // FIXME: _hwscreen is not currently available from SDL_Common's scope
+ if (!SDL_WM_ToggleFullScreen(_hwscreen)) {
+ // if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode
+ hotswap_gfx_mode();
+ }
+#endif
+ }
+}
More information about the Scummvm-git-logs
mailing list