mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 10:17:14 +00:00
SDL: Call setupIcon for each window creation with SDL2.
This should make sure that the logo is properly set on Win32 with SDL2.
This commit is contained in:
parent
71cc9e41e8
commit
066e71f61a
@ -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;
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ protected:
|
||||
private:
|
||||
bool _inputGrabState;
|
||||
Common::String _windowCaption;
|
||||
SDL_Surface *_windowIcon;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user