Add icon resources to Windows binaries
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 28 Nov 2008 01:40:50 +0000 (01:40 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 28 Nov 2008 01:40:50 +0000 (01:40 +0000)
Completely untested stuff.  But it compiles.

git-svn-id: https://s.snth.net/svn/neverball/trunk@2644 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile
share/syswm.c

index 55bd91c..b5d17b4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -217,6 +217,11 @@ PUTT_OBJS := \
        putt/st_conf.o      \
        putt/main.o
 
+ifdef MINGW
+BALL_OBJS += neverball.ico.o
+PUTT_OBJS += neverputt.ico.o
+endif
+
 BALL_DEPS := $(BALL_OBJS:.o=.d)
 PUTT_DEPS := $(PUTT_OBJS:.o=.d)
 MAPC_DEPS := $(MAPC_OBJS:.o=.d)
@@ -238,6 +243,9 @@ DESKTOPS := $(basename $(wildcard dist/*.desktop.in))
 %.desktop : %.desktop.in
        sh scripts/translate-desktop.sh < $< > $@
 
+%.ico.o: dist/ico/%.ico
+       echo "1 ICON \"$<\"" | $(WINDRES) -o $@
+
 #------------------------------------------------------------------------------
 
 all : $(BALL_TARG) $(PUTT_TARG) $(MAPC_TARG) sols locales desktops
index 616bd2c..119ee25 100644 (file)
@@ -13,7 +13,7 @@
 
 void set_SDL_icon(const char *filename)
 {
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(_WIN32)
     SDL_Surface *icon;
 
     if ((icon = load_surface(filename)))
@@ -22,7 +22,7 @@ void set_SDL_icon(const char *filename)
         free(icon->pixels);
         SDL_FreeSurface(icon);
     }
-#endif /* __APPLE__ */
+#endif
     return;
 }