Issue 285: For skins and fonts, replaced calls to SDL_image with our own image-loading functions. Also fixed the generic loader that was updating the screen palette even when not useful.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1247 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
7
main.c
7
main.c
@@ -509,16 +509,19 @@ int Init_program(int argc,char * argv[])
|
||||
char icon_path[MAX_PATH_CHARACTERS];
|
||||
SDL_Surface * icon;
|
||||
sprintf(icon_path, "%s%s", Data_directory, "gfx2.gif");
|
||||
icon = IMG_Load(icon_path);
|
||||
icon = Load_surface(icon_path);
|
||||
if (icon)
|
||||
{
|
||||
byte *icon_mask;
|
||||
int x,y;
|
||||
Uint32 pink;
|
||||
|
||||
pink = SDL_MapRGB(icon->format, 255, 0, 255);
|
||||
icon_mask=malloc(128);
|
||||
memset(icon_mask,0,128);
|
||||
for (y=0;y<32;y++)
|
||||
for (x=0;x<32;x++)
|
||||
if (((byte *)(icon->pixels))[(y*32+x)] != 255)
|
||||
if (((byte *)(icon->pixels))[(y*32+x)] != pink)
|
||||
icon_mask[(y*32+x)/8] |=0x80>>(x&7);
|
||||
SDL_WM_SetIcon(icon,icon_mask);
|
||||
free(icon_mask);
|
||||
|
||||
Reference in New Issue
Block a user