Remove the 'cheated' flag in Range's game_ui, which was stickily
[sgt/puzzles] / icons / Makefile
CommitLineData
afc306fc 1# Makefile for Puzzles icons.
2
8b3b3223 3PUZZLES = blackbox bridges cube dominosa fifteen filling flip galaxies guess \
72c00e19 4 inertia keen lightup loopy magnets map mines net netslide pattern \
e7414d31 5 pegs range rect samegame signpost singles sixteen slant solo tents \
6 towers twiddle unequal untangle
afc306fc 7
fbd2dc51 8BASE = $(patsubst %,%-base.png,$(PUZZLES))
9WEB = $(patsubst %,%-web.png,$(PUZZLES))
10
e0433c68 11IBASE = $(patsubst %,%-ibase.png,$(PUZZLES))
12IBASE4 = $(patsubst %,%-ibase4.png,$(PUZZLES))
fbd2dc51 13P48D24 = $(patsubst %,%-48d24.png,$(PUZZLES))
14P48D8 = $(patsubst %,%-48d8.png,$(PUZZLES))
15P48D4 = $(patsubst %,%-48d4.png,$(PUZZLES))
16P32D24 = $(patsubst %,%-32d24.png,$(PUZZLES))
17P32D8 = $(patsubst %,%-32d8.png,$(PUZZLES))
18P32D4 = $(patsubst %,%-32d4.png,$(PUZZLES))
19P16D24 = $(patsubst %,%-16d24.png,$(PUZZLES))
20P16D8 = $(patsubst %,%-16d8.png,$(PUZZLES))
21P16D4 = $(patsubst %,%-16d4.png,$(PUZZLES))
22ICONS = $(patsubst %,%.ico,$(PUZZLES))
f12cdd72 23CICONS = $(patsubst %,%-icon.c,$(PUZZLES))
fa2cb13d 24RC = $(patsubst %,%.rc,$(PUZZLES))
afc306fc 25
26BIN = ../
27PIC = ./
28
fbd2dc51 29base: $(BASE)
30web: $(WEB)
e0433c68 31pngicons: $(P48D24) $(P32D24) $(P16D24)
fa2cb13d 32winicons: $(ICONS) $(RC)
f12cdd72 33gtkicons: $(CICONS)
3e224760 34all: base web pngicons winicons gtkicons
afc306fc 35
e0433c68 36# Build the base puzzle screenshots from which all the other images
37# are derived. Some of them involve showing a move animation
38# part-way through.
fbd2dc51 39fifteen-base.png : override REDO=0.3
40flip-base.png : override REDO=0.3
41netslide-base.png : override REDO=0.3
42sixteen-base.png : override REDO=0.3
43twiddle-base.png : override REDO=0.3
fbd2dc51 44$(BASE): %-base.png: $(BIN)% $(PIC)%.sav
afc306fc 45 $(PIC)screenshot.sh $(BIN)$* $(PIC)$*.sav $@ $(REDO)
46
e0433c68 47# Build the screenshots for the web, by scaling the original base
48# images to a uniform size.
fbd2dc51 49$(WEB): %-web.png: %-base.png
afc306fc 50 $(PIC)square.pl 150 5 $^ $@
51
e0433c68 52# Build the base _icon_ images, by careful cropping of the base
53# images: icons are very small so it's often necessary to zoom in
54# on a smaller portion of the screenshot.
55blackbox-ibase.png : override CROP=352x352 144x144+0+208
56bridges-ibase.png : override CROP=264x264 107x107+157+157
57dominosa-ibase.png : override CROP=304x272 152x152+152+0
58fifteen-ibase.png : override CROP=240x240 120x120+0+120
7b5c79f8 59filling-ibase.png : override CROP=256x256 133x133+14+78
e0433c68 60flip-ibase.png : override CROP=288x288 145x145+120+72
ab3a1e43 61galaxies-ibase.png : override CROP=288x288 165x165+0+0
e0433c68 62guess-ibase.png : override CROP=263x420 178x178+75+17
63inertia-ibase.png : override CROP=321x321 128x128+193+0
c8c23a7f 64keen-ibase.png : override CROP=288x288 96x96+24+120
e0433c68 65lightup-ibase.png : override CROP=256x256 112x112+144+0
66loopy-ibase.png : override CROP=257x257 113x113+0+0
72c00e19 67magnets-ibase.png : override CROP=264x232 96x96+36+100
e0433c68 68mines-ibase.png : override CROP=240x240 110x110+130+130
69net-ibase.png : override CROP=193x193 113x113+0+80
70netslide-ibase.png : override CROP=289x289 144x144+0+0
71pattern-ibase.png : override CROP=384x384 223x223+0+0
72pegs-ibase.png : override CROP=263x263 147x147+116+0
e7414d31 73range-ibase.png : override CROP=256x256 98x98+111+15
e0433c68 74rect-ibase.png : override CROP=205x205 115x115+90+0
4cbcbfca 75signpost-ibase.png : override CROP=240x240 98x98+23+23
b5ba72bc 76singles-ibase.png : override CROP=224x224 98x98+15+15
e0433c68 77sixteen-ibase.png : override CROP=288x288 144x144+144+144
78slant-ibase.png : override CROP=321x321 160x160+160+160
0b119fd7 79solo-ibase.png : override CROP=481x481 145x145+24+24
e0433c68 80tents-ibase.png : override CROP=320x320 165x165+142+0
6361649b 81towers-ibase.png : override CROP=300x300 102x102+151+6
e0433c68 82twiddle-ibase.png : override CROP=192x192 102x102+69+21
0d926fd4 83unequal-ibase.png : override CROP=208x208 104x104+104+104
e0433c68 84untangle-ibase.png : override CROP=320x320 164x164+3+116
85$(IBASE): %-ibase.png: %-base.png
86 $(PIC)crop.sh $^ $@ $(CROP)
87
88# Convert the full-size icon images to 4-bit colour, because that
89# seems to work better than reducing it in 24 bits and then
90# dithering.
91$(IBASE4): %-ibase4.png: %-ibase.png
92 convert -colors 16 +dither -map $(PIC)win16pal.xpm $^ $@
93
94# Build the 24-bit PNGs for the icons, at three sizes.
95$(P48D24): %-48d24.png: %-ibase.png
fbd2dc51 96 $(PIC)square.pl 48 4 $^ $@
e0433c68 97$(P32D24): %-32d24.png: %-ibase.png
fbd2dc51 98 $(PIC)square.pl 32 2 $^ $@
e0433c68 99$(P16D24): %-16d24.png: %-ibase.png
fbd2dc51 100 $(PIC)square.pl 16 1 $^ $@
101
e0433c68 102# The 8-bit icon PNGs are just custom-paletted quantisations of the
103# 24-bit ones.
fbd2dc51 104$(P48D8) $(P32D8) $(P16D8): %d8.png: %d24.png
105 convert -colors 256 $^ $@
106
e0433c68 107# But the depth-4 images work better if we re-shrink from the
108# ibase4 versions of the images, and then normalise the colours
109# again afterwards. (They're still not very good, but my hope is
110# that on most modern Windows machines this won't matter too
111# much...)
112$(P48D4): %-48d4.png: %-ibase4.png
7fa3b75c 113 $(PIC)square.pl 48 1 $^ $@-tmp2.png
114 convert -colors 16 -map $(PIC)win16pal.xpm $@-tmp2.png $@
115 rm -f $@-tmp2.png
e0433c68 116$(P32D4): %-32d4.png: %-ibase.png
7fa3b75c 117 $(PIC)square.pl 32 1 $^ $@-tmp2.png
118 convert -colors 16 -map $(PIC)win16pal.xpm $@-tmp2.png $@
119 rm -f $@-tmp2.png
e0433c68 120$(P16D4): %-16d4.png: %-ibase.png
7fa3b75c 121 $(PIC)square.pl 16 1 $^ $@-tmp2.png
122 convert -colors 16 -map $(PIC)win16pal.xpm $@-tmp2.png $@
123 rm -f $@-tmp2.png
fbd2dc51 124
fa2cb13d 125# Build the actual Windows icons themselves, by feeding all those
126# PNGs to my icon builder script.
fbd2dc51 127$(ICONS): %.ico: %-48d24.png %-48d8.png %-48d4.png \
128 %-32d24.png %-32d8.png %-32d4.png \
129 %-16d24.png %-16d8.png %-16d4.png
7f7476c2 130 $(PIC)icon.pl -24 $*-48d24.png $*-32d24.png $*-16d24.png \
131 -8 $*-48d8.png $*-32d8.png $*-16d8.png \
132 -4 $*-48d4.png $*-32d4.png $*-16d4.png > $@
fbd2dc51 133
fa2cb13d 134# Build the .RC files which bind the icons into the applications.
135$(RC): %.rc:
cb0c7d4a 136 echo '#include "puzzles.rc2"' > $@
137 echo '200 ICON "$*.ico"' >> $@
fa2cb13d 138
f12cdd72 139# Build the GTK icon source files.
140$(CICONS): %-icon.c: %-16d24.png %-32d24.png %-48d24.png
141 $(PIC)cicon.pl $^ > $@
142
afc306fc 143clean:
f12cdd72 144 rm -f *.png *.ico *.rc *-icon.c