Debian Codegraph @

graphics/make_bullet_spritesheet.sh

raw symbols SCIP
1 #!/bin/sh
2 #
3 # Create a bullet spritesheet by rotating a source image
4 #
5 if [ "$#" -ne 1 ]; then
6 echo "Usage: make_bullet_spritesheet.sh infile"
7 exit 1
8 fi
9 command='convert $1 -background none -virtual-pixel background'
10
11 for i in $(seq 45 45 315); do
12 command="$command \\( -clone 0 -filter Point -distort SRT $i \\)"
13 done
14
15 BASENAME=$(basename "$1" | cut -d. -f1)
16 DIMENSIONS=$(identify -format "%wx%h" $1)
17 OUTFILE=${BASENAME}_${DIMENSIONS}.png
18
19 command="$command +append -alpha on $OUTFILE"
20
21 eval $command
22
23 chmod 644 $OUTFILE
24
25 echo "Created $OUTFILE"