diff options
author | Colin Snover | 2017-08-27 22:21:05 -0500 |
---|---|---|
committer | Colin Snover | 2017-10-07 12:30:29 -0500 |
commit | ebe6c40a6abb2789349c2b6471eef24ac270ab94 (patch) | |
tree | a54844f3eadc19e0cb168879466da165843d7c9f /backends/platform/sdl | |
parent | 83436e685fe5c0fd05fa49c8e85386a1115dee58 (diff) | |
download | scummvm-rg350-ebe6c40a6abb2789349c2b6471eef24ac270ab94.tar.gz scummvm-rg350-ebe6c40a6abb2789349c2b6471eef24ac270ab94.tar.bz2 scummvm-rg350-ebe6c40a6abb2789349c2b6471eef24ac270ab94.zip |
SDL: Do not reset window size when engines update rendering surface
This change allows:
* Engines to update their target rendering surface/size and pixel
format with the backend multiple times during gameplay;
* Users to resize the ScummVM window without having it reset
size/position every time an engine updates its target surface
format;
* Conversions/scaling to continue to run efficiently in hardware,
instead of requiring engines to pick their maximum possible
output format once and upscale inefficiently in software;
* The window to reset size once when an engine calls to set its
initial output size, and to reset again once ScummVM returns to
the launcher.
This is relevant for at least SCI32 and DreamWeb engines, which
perform graphics mode switches during games.
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 12 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index bbd5c89f80..f44d87666a 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -297,20 +297,28 @@ void OSystem_SDL::initBackend() { dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->activateManager(); } -#if defined(USE_TASKBAR) void OSystem_SDL::engineInit() { +#if SDL_VERSION_ATLEAST(2, 0, 0) + dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->unlockWindowSize(); +#endif +#ifdef USE_TASKBAR // Add the started engine to the list of recent tasks _taskbarManager->addRecent(ConfMan.getActiveDomainName(), ConfMan.get("description")); // Set the overlay icon the current running engine _taskbarManager->setOverlayIcon(ConfMan.getActiveDomainName(), ConfMan.get("description")); +#endif } void OSystem_SDL::engineDone() { +#if SDL_VERSION_ATLEAST(2, 0, 0) + dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->unlockWindowSize(); +#endif +#ifdef USE_TASKBAR // Remove overlay icon _taskbarManager->setOverlayIcon("", ""); -} #endif +} void OSystem_SDL::initSDL() { // Check if SDL has not been initialized diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index bc4292be0b..61513fa65f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -59,10 +59,8 @@ public: // Override functions from ModularBackend and OSystem virtual void initBackend(); -#if defined(USE_TASKBAR) virtual void engineInit(); virtual void engineDone(); -#endif virtual void quit(); virtual void fatalError(); |