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