[Scummvm-git-logs] scummvm master -> 769cf5492c57b19cd72545ec7b5617bbb7d6a35a

bluegr bluegr at gmail.com
Sun Mar 10 17:32:32 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
769cf5492c SDL: Wrap the full screen toggle code into a separate function


Commit: 769cf5492c57b19cd72545ec7b5617bbb7d6a35a
    https://github.com/scummvm/scummvm/commit/769cf5492c57b19cd72545ec7b5617bbb7d6a35a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2019-03-10T18:32:13+02:00

Commit Message:
SDL: Wrap the full screen toggle code into a separate function

Changed paths:
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h


diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 767ce24..cf81e04 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -314,15 +314,7 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
 		if (event.kbd.hasFlags(Common::KBD_ALT) &&
 			(event.kbd.keycode == Common::KEYCODE_RETURN ||
 			event.kbd.keycode == (Common::KeyCode)SDLK_KP_ENTER)) {
-			beginGFXTransaction();
-				setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
-			endGFXTransaction();
-#ifdef USE_OSD
-			if (getFeatureState(OSystem::kFeatureFullscreenMode))
-				displayMessageOnOSD(_("Fullscreen mode"));
-			else
-				displayMessageOnOSD(_("Windowed mode"));
-#endif
+			toggleFullScreen();
 			return true;
 		}
 
@@ -349,3 +341,15 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
 
 	return false;
 }
+
+void SdlGraphicsManager::toggleFullScreen() {
+	beginGFXTransaction();
+	setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
+	endGFXTransaction();
+#ifdef USE_OSD
+	if (getFeatureState(OSystem::kFeatureFullscreenMode))
+		displayMessageOnOSD(_("Fullscreen mode"));
+	else
+		displayMessageOnOSD(_("Windowed mode"));
+#endif
+}
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index d16402f..77c8d5d 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -184,6 +184,9 @@ protected:
 	SDL_Surface *_hwScreen;
 	SdlEventSource *_eventSource;
 	SdlWindow *_window;
+
+private:
+	void toggleFullScreen();
 };
 
 #endif





More information about the Scummvm-git-logs mailing list