summaryrefslogtreecommitdiff
path: root/setup/mainmenu.c
diff options
context:
space:
mode:
authorSimon Howard2008-04-26 14:33:14 +0000
committerSimon Howard2008-04-26 14:33:14 +0000
commit3c0abe55d70e46ec61bf5c9349160c52d46c84f9 (patch)
treee6ee7af60d9899162a33eca72b918685144be7f5 /setup/mainmenu.c
parentfa497db8c7fd6af3803019a99dad13ba5dd5e0bd (diff)
downloadchocolate-doom-3c0abe55d70e46ec61bf5c9349160c52d46c84f9.tar.gz
chocolate-doom-3c0abe55d70e46ec61bf5c9349160c52d46c84f9.tar.bz2
chocolate-doom-3c0abe55d70e46ec61bf5c9349160c52d46c84f9.zip
Add new Chocolate Doom icon.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1129
Diffstat (limited to 'setup/mainmenu.c')
-rw-r--r--setup/mainmenu.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/setup/mainmenu.c b/setup/mainmenu.c
index 4ff5b449..d4dfe0db 100644
--- a/setup/mainmenu.c
+++ b/setup/mainmenu.c
@@ -151,6 +151,24 @@ static void InitConfig(void)
static void SetIcon(void)
{
SDL_Surface *surface;
+ Uint8 *mask;
+ int i;
+
+ // Generate the mask
+
+ mask = malloc(setup_icon_w * setup_icon_h / 8);
+ memset(mask, 0, setup_icon_w * setup_icon_h / 8);
+
+ for (i=0; i<setup_icon_w * setup_icon_h; ++i)
+ {
+ if (setup_icon_data[i * 3] != 0x00
+ || setup_icon_data[i * 3 + 1] != 0x00
+ || setup_icon_data[i * 3 + 2] != 0x00)
+ {
+ mask[i / 8] |= 1 << (7 - i % 8);
+ }
+ }
+
surface = SDL_CreateRGBSurfaceFrom(setup_icon_data,
setup_icon_w,
@@ -162,8 +180,9 @@ static void SetIcon(void)
0xff << 16,
0);
- SDL_WM_SetIcon(surface, NULL);
+ SDL_WM_SetIcon(surface, mask);
SDL_FreeSurface(surface);
+ free(mask);
}
//