aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Ulmer2002-04-29 19:57:03 +0000
committerLionel Ulmer2002-04-29 19:57:03 +0000
commit2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59 (patch)
treee954b8dba40e94467df8dff1678cc2603afcf81f
parentff9fa95f63fa20737cf0f5c3c238e626ddfbee57 (diff)
downloadscummvm-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
-rw-r--r--scummvm.xpm2
-rw-r--r--sdl.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/scummvm.xpm b/scummvm.xpm
index 687cf3a41a..dede9ebe3e 100644
--- a/scummvm.xpm
+++ b/scummvm.xpm
@@ -83,7 +83,7 @@ static char *scummvm_icon[] = {
"! c #3efb00",
"~ c None",
/* pixels */
-"~~~~~~~~~~~~~~~~~~~~~!!!GGKKYE~~",
+"~~~~~~~~~~~~~~~~~~~~~!!!~~~~~~~~",
"~~~~~~~~~~~~~~~!!!!!!!!!!~~~~~~~",
"~~~~~~~~~~~~!!!!!!!!!Q!!!!!~~~~~",
"~~~~~~~~~~!!!!!!QTYUGAHR!!!!~~~~",
diff --git a/sdl.cpp b/sdl.cpp
index b34192aa14..ed188310e9 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -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