diff options
author | Lionel Ulmer | 2002-04-29 19:57:03 +0000 |
---|---|---|
committer | Lionel Ulmer | 2002-04-29 19:57:03 +0000 |
commit | 2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59 (patch) | |
tree | e954b8dba40e94467df8dff1678cc2603afcf81f /sdl.cpp | |
parent | ff9fa95f63fa20737cf0f5c3c238e626ddfbee57 (diff) | |
download | scummvm-rg350-2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59.tar.gz scummvm-rg350-2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59.tar.bz2 scummvm-rg350-2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59.zip |
Fixed properly the transparency problem. I would like people on BE
machines to test this to see if my code to load the XPM is
endian-clean :-)
svn-id: r4138
Diffstat (limited to 'sdl.cpp')
-rw-r--r-- | sdl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1197,6 +1197,7 @@ void OSystem_SDL::update_cdrom() { void OSystem_SDL::setup_icon() { int w, h, ncols, nbytes, i; unsigned int rgba[256], icon[32 * 32]; + unsigned char mask[32][4]; sscanf(scummvm_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes); if ((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1)) { @@ -1222,15 +1223,19 @@ void OSystem_SDL::setup_icon() { rgba[code] = col; } + memset(mask, 0, sizeof(mask)); for (h = 0; h < 32; h++) { char *line = scummvm_icon[1 + ncols + h]; for (w = 0; w < 32; w++) { icon[w + 32 * h] = rgba[line[w]]; + if (rgba[line[w]] & 0xFF000000) { + mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); + } } } SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); - SDL_WM_SetIcon(sdl_surf, NULL); + SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); } #ifdef USE_NULL_DRIVER |