aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorJohannes Schickel2015-03-01 16:20:02 +0100
committerJohannes Schickel2015-03-01 16:21:53 +0100
commit066e71f61a0d3b83c0c9c071a11cfdffdef40a41 (patch)
treea9c9a5dc05d1d9814ec7f7b77f5aad29adfb47be /backends/platform/sdl
parent71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be (diff)
downloadscummvm-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.
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/sdl-window.cpp9
-rw-r--r--backends/platform/sdl/sdl-window.h1
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
};