279 | | int w, h, ncols, nbytes, i; |
280 | | unsigned int rgba[256], icon[32 * 32]; |
281 | | unsigned char mask[32][4]; |
| 279 | int x, y, w, h, ncols, nbytes, i; |
| 280 | unsigned int rgba[256]; |
| 281 | unsigned int *icon; |
307 | | memset(mask, 0, sizeof(mask)); |
308 | | for (h = 0; h < 32; h++) { |
309 | | const char *line = scummvm_icon[1 + ncols + h]; |
310 | | for (w = 0; w < 32; w++) { |
311 | | icon[w + 32 * h] = rgba[(int)line[w]]; |
312 | | if (rgba[(int)line[w]] & 0xFF000000) { |
313 | | mask[h][w >> 3] |= 1 << (7 - (w & 0x07)); |
314 | | } |
| 313 | for (y = 0; y < h; y++) { |
| 314 | const char *line = scummvm_icon[1 + ncols + y]; |
| 315 | for (x = 0; x < w; x++) { |
| 316 | icon[x + w * y] = rgba[(int)line[x]]; |
318 | | SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32, 32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); |
319 | | SDL_WM_SetIcon(sdl_surf, (unsigned char *) mask); |
| 320 | SDL_Surface *sdl_surf = SDL_CreateRGBSurfaceFrom(icon, w, h, 32, w * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000); |
| 321 | if (NULL==(sdl_surf)) { |
| 322 | warning("SDL_CreateRGBSurfaceFrom(icon) failed"); |
| 323 | } |
| 324 | SDL_WM_SetIcon(sdl_surf, NULL); |