Skip to content
Snippets Groups Projects
Commit 9d06cb4b authored by MascaraSnake's avatar MascaraSnake
Browse files

Merge branch 'fix-window-icon' into 'master'

Fix window icon being reset when switching renderers on non-Windows platforms

See merge request !898
parents 0e2fb596 e0f9b825
No related branches found
No related tags found
2 merge requests!985Shaders next merge,!898Fix window icon being reset when switching renderers on non-Windows platforms
...@@ -217,7 +217,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool ...@@ -217,7 +217,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool
else else
{ {
Impl_CreateWindow(fullscreen); Impl_CreateWindow(fullscreen);
Impl_SetWindowIcon();
wasfullscreen = fullscreen; wasfullscreen = fullscreen;
SDL_SetWindowSize(window, width, height); SDL_SetWindowSize(window, width, height);
if (fullscreen) if (fullscreen)
...@@ -1632,12 +1631,15 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) ...@@ -1632,12 +1631,15 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
realwidth, realheight, flags); realwidth, realheight, flags);
if (window == NULL) if (window == NULL)
{ {
CONS_Printf(M_GetText("Couldn't create window: %s\n"), SDL_GetError()); CONS_Printf(M_GetText("Couldn't create window: %s\n"), SDL_GetError());
return SDL_FALSE; return SDL_FALSE;
} }
Impl_SetWindowIcon();
return Impl_CreateContext(); return Impl_CreateContext();
} }
...@@ -1654,11 +1656,7 @@ static void Impl_SetWindowName(const char *title) ...@@ -1654,11 +1656,7 @@ static void Impl_SetWindowName(const char *title)
static void Impl_SetWindowIcon(void) static void Impl_SetWindowIcon(void)
{ {
if (window == NULL || icoSurface == NULL) if (window && icoSurface)
{
return;
}
//SDL2STUB(); // Monster Iestyn: why is this stubbed?
SDL_SetWindowIcon(window, icoSurface); SDL_SetWindowIcon(window, icoSurface);
} }
...@@ -1766,6 +1764,11 @@ void I_StartupGraphics(void) ...@@ -1766,6 +1764,11 @@ void I_StartupGraphics(void)
VID_StartupOpenGL(); VID_StartupOpenGL();
#endif #endif
// Window icon
#ifdef HAVE_IMAGE
icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm);
#endif
// Fury: we do window initialization after GL setup to allow // Fury: we do window initialization after GL setup to allow
// SDL_GL_LoadLibrary to work well on Windows // SDL_GL_LoadLibrary to work well on Windows
...@@ -1784,11 +1787,6 @@ void I_StartupGraphics(void) ...@@ -1784,11 +1787,6 @@ void I_StartupGraphics(void)
#ifdef HAVE_TTF #ifdef HAVE_TTF
I_ShutdownTTF(); I_ShutdownTTF();
#endif #endif
// Window icon
#ifdef HAVE_IMAGE
icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm);
#endif
Impl_SetWindowIcon();
VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment