Regenerate simple items textures
[xonotic/xonotic-data.pk3dir.git] / models / weapons / make-sprites.sh
1 #!/bin/bash
2
3 baseline=20
4
5 sprite()
6 {
7         name=$1
8         text=$(echo $2) # Handle newlines
9         color=$3
10
11         echo $name
12
13         # Text
14         exec {FD}< <(convert \
15         -size 185x120 \
16         -background transparent \
17         -fill "#$color" \
18         -font BigNoodleTitling \
19         -interline-spacing -15 \
20         -gravity south \
21         label:"$text" \
22         -trim \
23         png:-)
24         itext=$FD
25
26         # Rectangles
27
28         # Thick
29         xa1=34
30         xa2=$((xa1+185-1))
31         ya1=174
32         ya2=$((ya1+37-1))
33
34         # Thin
35         xb1=34
36         xb2=$((xb1+185-1))
37         yb1=224
38         yb2=$((yb1+15-1))
39
40         exec {FD}< <(convert \
41         -size 256x256 \
42         -background transparent \
43         -fill "#$color" \
44         xc:none \
45         -draw "rectangle $xa1,$ya1 $xa2,$ya2" \
46         -draw "rectangle $xb1,$yb1 $xb2,$yb2" \
47         png:-)
48         irects=$FD
49
50         # Join
51
52         composite \
53         -gravity south \
54         -geometry -2+$((82+$baseline)) \
55         -compress RLE \
56         png:fd:$itext png:fd:$irects g_${name}_simple.tga
57 }
58
59 # grep '* color' ../../qcsrc/common/weapons/w_*.qc | awk '{ print $1 "  \t" $4 " " $5 " " $6 }'
60 # def h(r,g,b): return '#{:02x}{:02x}{:02x}'.format(int(round(r*255)),int(round(g*255)),int(round(b*255)))
61 sprite arc                      "Arc"                           ffffff # White
62 sprite laser            "Blaster"                       ff8080 # Vivid Tangerine
63 sprite crylink          "Crylink"                       ff80ff # Blush Pink
64 sprite rl                       "Devastator"            ffff00 # Yellow
65 sprite electro          "Electro"                       0080ff # Azure Radiance
66 sprite fireball         "Fireball"                      ff8000 # Flush Orange
67 sprite hagar            "Hagar"                         ffff80 # Dolly
68 sprite hlac                     "HLAC"                          00ff00 # Green
69 sprite hookgun          "Grappling\nHook"       008000 # Japanese Laurel
70 sprite uzi                      "Machine\nGun"          ffff00 # Yellow
71 sprite minelayer        "Mine\nLayer"           bfff00 # Lime
72 sprite gl                       "Mortar"                        ff0000 # Red
73 sprite porto            "Port-O-Launch"         808080 # Gray
74 sprite campingrifle     "Rifle"                         80ff00 # Chartreuse
75 sprite seeker           "T.A.G.\nSeeker"        80ff00 # Chartreuse
76 #sprite shockwave       "Shockwave"                     804000 # Cinnamon
77 sprite shotgun          "Shotgun"                       804000 # Cinnamon
78 sprite tuba                     "Tuba"                          00ff00 # Green
79 sprite minstanex        "Vaporizer"                     80ffff # Anakiwa
80 sprite nex                      "Vortex"                        80ffff # Anakiwa