aboutsummaryrefslogtreecommitdiff
path: root/icons/Makefile
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2006-12-26 22:00:11 +0000
committerSimon Tatham <anakin@pobox.com>2006-12-26 22:00:11 +0000
commit90e6864579d740a6df3bdbbcf3cbc42cc5181d82 (patch)
treea120c2974b70efe6f50f62fe33ae7ac68722d5d2 /icons/Makefile
parentd55ad9fc42ab1f1d38dcf6ef02fe9254e6839165 (diff)
downloadpuzzles-90e6864579d740a6df3bdbbcf3cbc42cc5181d82.zip
puzzles-90e6864579d740a6df3bdbbcf3cbc42cc5181d82.tar.gz
puzzles-90e6864579d740a6df3bdbbcf3cbc42cc5181d82.tar.bz2
puzzles-90e6864579d740a6df3bdbbcf3cbc42cc5181d82.tar.xz
Code to construct Windows icon files for the puzzles, by munging the
screenshots into appropriate sizes and colour depths. This is all done with a nasty Perl script, because ImageMagick does not output correct .ICO format. Not sure why; it isn't _that_ hard. I intend at some point to link the resulting icons into the actual Windows puzzle binaries, but before then I have to make them prettier: most of them would benefit from being derived from a smaller crop of the puzzle screenshot instead of trying to fit the whole thing in. [originally from svn r7017]
Diffstat (limited to 'icons/Makefile')
-rw-r--r--icons/Makefile72
1 files changed, 60 insertions, 12 deletions
diff --git a/icons/Makefile b/icons/Makefile
index 114de63..a5a1c93 100644
--- a/icons/Makefile
+++ b/icons/Makefile
@@ -4,26 +4,74 @@ PUZZLES = blackbox bridges cube dominosa fifteen flip guess inertia lightup \
loopy map mines net netslide pattern pegs rect samegame sixteen \
slant solo tents twiddle untangle
-BASEPNGS = $(patsubst %,%-base.png,$(PUZZLES))
-WEBPNGS = $(patsubst %,%-web.png,$(PUZZLES))
+BASE = $(patsubst %,%-base.png,$(PUZZLES))
+WEB = $(patsubst %,%-web.png,$(PUZZLES))
+
+BASE4 = $(patsubst %,%-base4.png,$(PUZZLES))
+
+P48D24 = $(patsubst %,%-48d24.png,$(PUZZLES))
+P48D8 = $(patsubst %,%-48d8.png,$(PUZZLES))
+P48D4 = $(patsubst %,%-48d4.png,$(PUZZLES))
+P32D24 = $(patsubst %,%-32d24.png,$(PUZZLES))
+P32D8 = $(patsubst %,%-32d8.png,$(PUZZLES))
+P32D4 = $(patsubst %,%-32d4.png,$(PUZZLES))
+P16D24 = $(patsubst %,%-16d24.png,$(PUZZLES))
+P16D8 = $(patsubst %,%-16d8.png,$(PUZZLES))
+P16D4 = $(patsubst %,%-16d4.png,$(PUZZLES))
+ICONS = $(patsubst %,%.ico,$(PUZZLES))
BIN = ../
PIC = ./
-base: $(BASEPNGS)
-webpics: $(WEBPNGS)
+base: $(BASE)
+web: $(WEB)
+pngicons: $(I48D24) $(I32D24) $(I16D24)
+icons: $(ICONS)
-fifteen.png : override REDO=0.3
-flip.png : override REDO=0.3
-netslide.png : override REDO=0.3
-sixteen.png : override REDO=0.3
-twiddle.png : override REDO=0.3
+fifteen-base.png : override REDO=0.3
+flip-base.png : override REDO=0.3
+netslide-base.png : override REDO=0.3
+sixteen-base.png : override REDO=0.3
+twiddle-base.png : override REDO=0.3
-$(BASEPNGS): %-base.png: $(BIN)% $(PIC)%.sav $(PIC)screenshot.sh
+$(BASE): %-base.png: $(BIN)% $(PIC)%.sav
$(PIC)screenshot.sh $(BIN)$* $(PIC)$*.sav $@ $(REDO)
-$(WEBPNGS): %-web.png: %-base.png
+$(BASE4): %-base4.png: %-base.png
+ convert -colors 16 +dither -map win16pal.xpm $^ $@
+
+$(WEB): %-web.png: %-base.png
$(PIC)square.pl 150 5 $^ $@
+$(P48D24): %-48d24.png: %-base.png
+ $(PIC)square.pl 48 4 $^ $@
+$(P32D24): %-32d24.png: %-base.png
+ $(PIC)square.pl 32 2 $^ $@
+$(P16D24): %-16d24.png: %-base.png
+ $(PIC)square.pl 16 1 $^ $@
+
+$(P48D8) $(P32D8) $(P16D8): %d8.png: %d24.png
+ convert -colors 256 $^ $@
+
+# The depth-4 images work better if we normalise the colours
+# _before_ shrinking, and then normalise again afterwards.
+$(P48D4): %-48d4.png: %-base4.png
+ $(PIC)square.pl 48 1 $^ tmp2.png
+ convert -colors 16 -map win16pal.xpm tmp2.png $@
+ rm -f tmp.png tmp2.png
+$(P32D4): %-32d4.png: %-base.png
+ $(PIC)square.pl 32 1 $^ tmp2.png
+ convert -colors 16 -map win16pal.xpm tmp2.png $@
+ rm -f tmp.png tmp2.png
+$(P16D4): %-16d4.png: %-base.png
+ $(PIC)square.pl 16 1 $^ tmp2.png
+ convert -colors 16 -map win16pal.xpm tmp2.png $@
+ rm -f tmp.png tmp2.png
+
+$(ICONS): %.ico: %-48d24.png %-48d8.png %-48d4.png \
+ %-32d24.png %-32d8.png %-32d4.png \
+ %-16d24.png %-16d8.png %-16d4.png
+ $(PIC)icon.pl $? > $@
+
clean:
- rm -f *.png
+ rm -f *.png *.ico