[Scummvm-cvs-logs] CVS: scummvm sdl.cpp,1.108,1.109 scummvm.xpm,1.1,1.2

Lionel Ulmer bbrox at users.sourceforge.net
Mon Apr 29 13:08:02 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv11758

Modified Files:
	sdl.cpp scummvm.xpm 
Log Message:
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 :-)



Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** sdl.cpp	29 Apr 2002 16:01:31 -0000	1.108
--- sdl.cpp	29 Apr 2002 19:57:03 -0000	1.109
***************
*** 1198,1201 ****
--- 1198,1202 ----
  	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);
***************
*** 1223,1235 ****
  		rgba[code] = col;
  	}
  	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]];
  		}
  	}
  
  	SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000);
! 	SDL_WM_SetIcon(sdl_surf, NULL);
  }
  
--- 1224,1240 ----
  		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, (unsigned char *) mask);
  }
  

Index: scummvm.xpm
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scummvm.xpm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** scummvm.xpm	29 Apr 2002 16:01:31 -0000	1.1
--- scummvm.xpm	29 Apr 2002 19:57:03 -0000	1.2
***************
*** 84,88 ****
  "~ c None",
  /* pixels */
! "~~~~~~~~~~~~~~~~~~~~~!!!GGKKYE~~",
  "~~~~~~~~~~~~~~~!!!!!!!!!!~~~~~~~",
  "~~~~~~~~~~~~!!!!!!!!!Q!!!!!~~~~~",
--- 84,88 ----
  "~ c None",
  /* pixels */
! "~~~~~~~~~~~~~~~~~~~~~!!!~~~~~~~~",
  "~~~~~~~~~~~~~~~!!!!!!!!!!~~~~~~~",
  "~~~~~~~~~~~~!!!!!!!!!Q!!!!!~~~~~",





More information about the Scummvm-git-logs mailing list