diff options
author | Johannes Schickel | 2015-03-01 16:20:02 +0100 |
---|---|---|
committer | Johannes Schickel | 2015-03-01 16:21:53 +0100 |
commit | 066e71f61a0d3b83c0c9c071a11cfdffdef40a41 (patch) | |
tree | a9c9a5dc05d1d9814ec7f7b77f5aad29adfb47be | |
parent | 71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be (diff) | |
download | scummvm-rg350-066e71f61a0d3b83c0c9c071a11cfdffdef40a41.tar.gz scummvm-rg350-066e71f61a0d3b83c0c9c071a11cfdffdef40a41.tar.bz2 scummvm-rg350-066e71f61a0d3b83c0c9c071a11cfdffdef40a41.zip |
SDL: Call setupIcon for each window creation with SDL2.
This should make sure that the logo is properly set on Win32 with SDL2.
-rw-r--r-- | backends/platform/sdl/sdl-window.cpp | 9 | ||||
-rw-r--r-- | backends/platform/sdl/sdl-window.h | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp index 2a3877c523..6d35f77ae0 100644 --- a/backends/platform/sdl/sdl-window.cpp +++ b/backends/platform/sdl/sdl-window.cpp @@ -30,14 +30,13 @@ SdlWindow::SdlWindow() #if SDL_VERSION_ATLEAST(2, 0, 0) - : _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM"), _windowIcon(nullptr) + : _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM") #endif { } SdlWindow::~SdlWindow() { #if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_FreeSurface(_windowIcon); destroyWindow(); #endif } @@ -100,16 +99,14 @@ void SdlWindow::setupIcon() { } #if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_FreeSurface(_windowIcon); - _windowIcon = sdl_surf; if (_window) { SDL_SetWindowIcon(_window, sdl_surf); } #else SDL_WM_SetIcon(sdl_surf, NULL); - SDL_FreeSurface(sdl_surf); #endif + SDL_FreeSurface(sdl_surf); free(icon); } @@ -214,7 +211,7 @@ bool SdlWindow::createWindow(int width, int height, uint32 flags) { if (!_window) { return false; } - SDL_SetWindowIcon(_window, _windowIcon); + setupIcon(); return true; } diff --git a/backends/platform/sdl/sdl-window.h b/backends/platform/sdl/sdl-window.h index 2608ea4a8f..58b898f824 100644 --- a/backends/platform/sdl/sdl-window.h +++ b/backends/platform/sdl/sdl-window.h @@ -101,7 +101,6 @@ protected: private: bool _inputGrabState; Common::String _windowCaption; - SDL_Surface *_windowIcon; #endif }; |