2 #Requires vi, Inkscape, Gimp and ~/.gimp*/scripts/png-tga.scm
3 #Used when the version number in background_l2.svg is changed.
4 #Exports png images from background_l2.svg of all color versions,
5 #converts them to tga and copyies them into wickedx folders in /tga
7 echo "Creating folders ..."
20 if [ ! -d wickedx_blue ]
25 if [ ! -d wickedx_green ]
30 if [ ! -d wickedx_magenta ]
35 if [ ! -d wickedx_red ]
40 if [ ! -d wickedx_yellow ]
47 echo "Creating individual color versions of background_l2.svg ..."
48 cp background_l2.svg background_l2_blue.svg
49 cp background_l2.svg background_l2_green.svg
50 cp background_l2.svg background_l2_magenta.svg
51 cp background_l2.svg background_l2_red.svg
52 cp background_l2.svg background_l2_yellow.svg
54 vi -e background_l2_blue.svg <<-EOF
55 :%s/textures/textures_blue/g
60 vi -e background_l2_green.svg <<-EOF
61 :%s/textures/textures_green/g
66 vi -e background_l2_magenta.svg <<-EOF
67 :%s/textures/textures_magenta/g
72 vi -e background_l2_red.svg <<-EOF
73 :%s/textures/textures_red/g
78 vi -e background_l2_yellow.svg <<-EOF
79 :%s/textures/textures_yellow/g
84 echo "Exporting png images from svg files..."
85 inkscape -e tga/background_l2.png -d 90 background_l2.svg
86 inkscape -e tga/background_l2_blue.png -d 90 background_l2_blue.svg
87 inkscape -e tga/background_l2_green.png -d 90 background_l2_green.svg
88 inkscape -e tga/background_l2_magenta.png -d 90 background_l2_magenta.svg
89 inkscape -e tga/background_l2_red.png -d 90 background_l2_red.svg
90 inkscape -e tga/background_l2_yellow.png -d 90 background_l2_yellow.svg
91 rm background_l2_blue.svg
92 rm background_l2_green.svg
93 rm background_l2_magenta.svg
94 rm background_l2_red.svg
95 rm background_l2_yellow.svg
97 echo "Converting png to tga..."
98 #(png-tga fileIn fileOut grayscale alpha0.5)
101 -b '(png-tga "background_l2.png" "background_l2.tga" 0 0)' \
102 -b '(png-tga "background_l2_blue.png" "background_l2_blue.tga" 0 0)' \
103 -b '(png-tga "background_l2_green.png" "background_l2_green.tga" 0 0)' \
104 -b '(png-tga "background_l2_magenta.png" "background_l2_magenta.tga" 0 0)' \
105 -b '(png-tga "background_l2_red.png" "background_l2_red.tga" 0 0)' \
106 -b '(png-tga "background_l2_yellow.png" "background_l2_yellow.tga" 0 0)' \
109 echo "Copying tga files to folders and removing temporary files..."
110 cp background_l2.tga wickedx/background_l2.tga
111 cp background_l2.tga wickedx/background_ingame.tga
112 cp background_l2_blue.tga wickedx_blue/background_l2.tga
113 cp background_l2_blue.tga wickedx_blue/background_ingame.tga
114 cp background_l2_green.tga wickedx_green/background_l2.tga
115 cp background_l2_green.tga wickedx_green/background_ingame.tga
116 cp background_l2_magenta.tga wickedx_magenta/background_l2.tga
117 cp background_l2_magenta.tga wickedx_magenta/background_ingame.tga
118 cp background_l2_red.tga wickedx_red/background_l2.tga
119 cp background_l2_red.tga wickedx_red/background_ingame.tga
120 cp background_l2_yellow.tga wickedx_yellow/background_l2.tga
121 cp background_l2_yellow.tga wickedx_yellow/background_ingame.tga
124 rm background_l2_blue.png
125 rm background_l2_green.png
126 rm background_l2_magenta.png
127 rm background_l2_red.png
128 rm background_l2_yellow.png
130 rm background_l2_blue.tga
131 rm background_l2_green.tga
132 rm background_l2_magenta.tga
133 rm background_l2_red.tga
134 rm background_l2_yellow.tga
136 echo "Export complete."