summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/icons/Makefile
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-04-29 18:21:56 -0400
committerFranklin Wei <git@fwei.tk>2017-04-29 18:24:42 -0400
commit881746789a489fad85aae8317555f73dbe261556 (patch)
treecec2946362c4698c8db3c10f3242ef546c2c22dd /apps/plugins/puzzles/src/icons/Makefile
parent03dd4b92be7dcd5c8ab06da3810887060e06abd5 (diff)
downloadrockbox-881746789a489fad85aae8317555f73dbe261556.tar.gz
rockbox-881746789a489fad85aae8317555f73dbe261556.zip
puzzles: refactor and resync with upstream
This brings puzzles up-to-date with upstream revision 2d333750272c3967cfd5cd3677572cddeaad5932, though certain changes made by me, including cursor-only Untangle and some compilation fixes remain. Upstream code has been moved to its separate subdirectory and future syncs can be done by simply copying over the new sources. Change-Id: Ia6506ca5f78c3627165ea6791d38db414ace0804
Diffstat (limited to 'apps/plugins/puzzles/src/icons/Makefile')
-rw-r--r--apps/plugins/puzzles/src/icons/Makefile153
1 files changed, 153 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/icons/Makefile b/apps/plugins/puzzles/src/icons/Makefile
new file mode 100644
index 0000000000..00dae1f841
--- /dev/null
+++ b/apps/plugins/puzzles/src/icons/Makefile
@@ -0,0 +1,153 @@
1# Makefile for Puzzles icons.
2
3PUZZLES = 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
9BASE = $(patsubst %,%-base.png,$(PUZZLES))
10WEB = $(patsubst %,%-web.png,$(PUZZLES))
11
12IBASE = $(patsubst %,%-ibase.png,$(PUZZLES))
13IBASE4 = $(patsubst %,%-ibase4.png,$(PUZZLES))
14P48D24 = $(patsubst %,%-48d24.png,$(PUZZLES))
15P48D8 = $(patsubst %,%-48d8.png,$(PUZZLES))
16P48D4 = $(patsubst %,%-48d4.png,$(PUZZLES))
17P32D24 = $(patsubst %,%-32d24.png,$(PUZZLES))
18P32D8 = $(patsubst %,%-32d8.png,$(PUZZLES))
19P32D4 = $(patsubst %,%-32d4.png,$(PUZZLES))
20P16D24 = $(patsubst %,%-16d24.png,$(PUZZLES))
21P16D8 = $(patsubst %,%-16d8.png,$(PUZZLES))
22P16D4 = $(patsubst %,%-16d4.png,$(PUZZLES))
23ICONS = $(patsubst %,%.ico,$(PUZZLES))
24CICONS = $(patsubst %,%-icon.c,$(PUZZLES))
25RC = $(patsubst %,%.rc,$(PUZZLES))
26
27BIN = ../
28PIC = ./
29
30# Work around newer ImageMagick unilaterally distorting colours when
31# converting to PNG.
32CSP = -set colorspace RGB
33
34base: $(BASE)
35web: $(WEB)
36pngicons: $(P48D24) $(P32D24) $(P16D24)
37winicons: $(ICONS) $(RC)
38gtkicons: $(CICONS)
39all: 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.
44fifteen-base.png : override REDO=0.3
45flip-base.png : override REDO=0.3
46netslide-base.png : override REDO=0.3
47sixteen-base.png : override REDO=0.3
48twiddle-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.
60blackbox-ibase.png : override CROP=352x352 144x144+0+208
61bridges-ibase.png : override CROP=264x264 107x107+157+157
62dominosa-ibase.png : override CROP=304x272 152x152+152+0
63fifteen-ibase.png : override CROP=240x240 120x120+0+120
64filling-ibase.png : override CROP=256x256 133x133+14+78
65flip-ibase.png : override CROP=288x288 145x145+120+72
66galaxies-ibase.png : override CROP=288x288 165x165+0+0
67guess-ibase.png : override CROP=263x420 178x178+75+17
68inertia-ibase.png : override CROP=321x321 128x128+193+0
69keen-ibase.png : override CROP=288x288 96x96+24+120
70lightup-ibase.png : override CROP=256x256 112x112+144+0
71loopy-ibase.png : override CROP=257x257 113x113+0+0
72magnets-ibase.png : override CROP=264x232 96x96+36+100
73mines-ibase.png : override CROP=240x240 110x110+130+130
74net-ibase.png : override CROP=193x193 113x113+0+80
75netslide-ibase.png : override CROP=289x289 144x144+0+0
76palisade-ibase.png : override CROP=288x288 192x192+0+0
77pattern-ibase.png : override CROP=384x384 223x223+0+0
78pearl-ibase.png : override CROP=216x216 94x94+108+15
79pegs-ibase.png : override CROP=263x263 147x147+116+0
80range-ibase.png : override CROP=256x256 98x98+111+15
81rect-ibase.png : override CROP=205x205 115x115+90+0
82signpost-ibase.png : override CROP=240x240 98x98+23+23
83singles-ibase.png : override CROP=224x224 98x98+15+15
84sixteen-ibase.png : override CROP=288x288 144x144+144+144
85slant-ibase.png : override CROP=321x321 160x160+160+160
86solo-ibase.png : override CROP=481x481 145x145+24+24
87tents-ibase.png : override CROP=320x320 165x165+142+0
88towers-ibase.png : override CROP=300x300 102x102+151+6
89tracks-ibase.png : override CROP=246x246 118x118+6+6
90twiddle-ibase.png : override CROP=192x192 102x102+69+21
91undead-ibase.png : override CROP=416x480 192x192+16+80
92unequal-ibase.png : override CROP=208x208 104x104+104+104
93untangle-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
152clean:
153 rm -f *.png *.ico *.rc *-icon.c