Fix for missing icon on XP.
Moved the call to seticon() and the underlying SDL_WM_SetIcon() to _before_ the first call of SDL_SetVideoMode() like it says in the docs. Fix for loss of icon transparency on win32. Discovered that using a NULL mask in the call to SDL_WM_SetIcon() restored the icon transparency.
This commit is contained in:
parent
7c9495324e
commit
6e45d58cd3
1 changed files with 10 additions and 12 deletions
|
|
@ -4994,6 +4994,11 @@ void setup(int argc, char * argv[])
|
|||
#endif
|
||||
|
||||
|
||||
/* Set window icon and caption: */
|
||||
|
||||
seticon();
|
||||
SDL_WM_SetCaption("Tux Paint", "Tux Paint");
|
||||
|
||||
/* Open Window: */
|
||||
|
||||
if (fullscreen)
|
||||
|
|
@ -5101,12 +5106,6 @@ void setup(int argc, char * argv[])
|
|||
|
||||
|
||||
|
||||
/* Set window icon and caption: */
|
||||
|
||||
seticon();
|
||||
SDL_WM_SetCaption("Tux Paint", "Tux Paint");
|
||||
|
||||
|
||||
/* Create drawing canvas: */
|
||||
|
||||
canvas = SDL_CreateRGBSurface(screen->flags,
|
||||
|
|
@ -5716,7 +5715,6 @@ void seticon(void)
|
|||
Uint8 * mask;
|
||||
SDL_Surface * icon;
|
||||
|
||||
|
||||
/* Load icon into a surface: */
|
||||
|
||||
#ifndef WIN32
|
||||
|
|
@ -5735,21 +5733,21 @@ void seticon(void)
|
|||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
/* Create mask: */
|
||||
|
||||
masklen = (((icon -> w) + 7) / 8) * (icon -> h);
|
||||
mask = malloc(masklen * sizeof(Uint8));
|
||||
memset(mask, 0xFF, masklen);
|
||||
|
||||
|
||||
/* Set icon: */
|
||||
|
||||
SDL_WM_SetIcon(icon, mask);
|
||||
|
||||
|
||||
/* Free icon surface & mask: */
|
||||
|
||||
free(mask);
|
||||
#else
|
||||
/* Set icon: */
|
||||
SDL_WM_SetIcon(icon, NULL);
|
||||
#endif
|
||||
SDL_FreeSurface(icon);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue