summaryrefslogtreecommitdiff
path: root/nekowatchlet/original-resources/makeatlas.sh
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-08-17 02:29:28 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-08-17 02:29:28 +0200
commit9c44782c5eab5635ca6adf4717409bf2ffb6c694 (patch)
tree99f774bccb6e964864168b346155bbd5a52bf3b2 /nekowatchlet/original-resources/makeatlas.sh
parentf9ac9d207025fb8d40d1be753cde78beb77aa202 (diff)
downloadsowatch-9c44782c5eab5635ca6adf4717409bf2ffb6c694.tar.gz
sowatch-9c44782c5eab5635ca6adf4717409bf2ffb6c694.zip
new nekowatchlet and minor graphics/performance changes
Diffstat (limited to 'nekowatchlet/original-resources/makeatlas.sh')
-rwxr-xr-xnekowatchlet/original-resources/makeatlas.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/nekowatchlet/original-resources/makeatlas.sh b/nekowatchlet/original-resources/makeatlas.sh
new file mode 100755
index 0000000..e04a50f
--- /dev/null
+++ b/nekowatchlet/original-resources/makeatlas.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+
+allfiles=$(echo *.png | sort)
+atlasfiles=""
+stems=""
+
+for i in $allfiles
+do
+ echo $i
+ if [[ $i =~ ^([a-z]+)[1-9].png ]]
+ then
+ stem=${BASH_REMATCH[1]}
+ output=atlas/$stem.png
+ if [[ $atlasfiles != *$output* ]]
+ then
+ montage $stem?.png -geometry 32x32 $output
+ atlasfiles="$atlasfiles $output"
+ stems="$stems $stem"
+ fi
+ fi
+done
+
+montage $atlasfiles -geometry 64x32+0+0 -gravity NorthWest -tile 1x atlas/atlas.png
+
+rm -f $atlasfiles
+
+echo $stems | tr ' ' '\n' > atlas/atlas.txt
+
+exit 0
+