summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-07-20 17:35:17 -0700
committerBen Longbons <b.r.longbons@gmail.com>2012-07-31 14:50:52 -0700
commit58aceadf8929b7d46d5dccc54cd406e563ed4247 (patch)
tree45e340fd38a374b14596ce2864e9c2bb445a7278 /tools
parent2900bbe3004fdf86a379a19d9fe1723fe0f0eada (diff)
downloadclientdata-58aceadf8929b7d46d5dccc54cd406e563ed4247.tar.gz
clientdata-58aceadf8929b7d46d5dccc54cd406e563ed4247.tar.bz2
clientdata-58aceadf8929b7d46d5dccc54cd406e563ed4247.tar.xz
clientdata-58aceadf8929b7d46d5dccc54cd406e563ed4247.zip
Canonicalize tileset order and use external tilesets
Diffstat (limited to 'tools')
-rwxr-xr-xtools/add-git-attributes2
-rwxr-xr-xtools/edit-all-to-export-tilesets.sh19
-rwxr-xr-xtools/list-tileset-order15
3 files changed, 36 insertions, 0 deletions
diff --git a/tools/add-git-attributes b/tools/add-git-attributes
new file mode 100755
index 00000000..80cc30c9
--- /dev/null
+++ b/tools/add-git-attributes
@@ -0,0 +1,2 @@
+#!/bin/sh
+git config diff.csv2tsv.textconv 'sed s/,/\\t/g'
diff --git a/tools/edit-all-to-export-tilesets.sh b/tools/edit-all-to-export-tilesets.sh
new file mode 100755
index 00000000..7be3411f
--- /dev/null
+++ b/tools/edit-all-to-export-tilesets.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+for MAP in $(ls maps | grep '\.tmx$')
+do
+ TILESETS=$(
+ grep '<tileset' "maps/$MAP" |
+ while read TILESET
+ do
+ TILESET=${TILESET#*name=\"}
+ TILESET=${TILESET%%\"*}
+ echo tilesets/${TILESET}.tsx
+ done
+ )
+ rm -f ${TILESETS}
+ (cd tilesets; tiled ../maps/$MAP;)
+ git add -N tilesets/
+ git add --patch
+done
+
+
diff --git a/tools/list-tileset-order b/tools/list-tileset-order
new file mode 100755
index 00000000..b8d3f85b
--- /dev/null
+++ b/tools/list-tileset-order
@@ -0,0 +1,15 @@
+#!/bin/bash
+DIR=${1:-maps}
+for MAP in $(ls "$DIR" | grep '\.tmx$' )
+do
+ echo -n "${MAP%.tmx}:"
+ grep '<tileset' "$DIR/$MAP" |
+ while read TILESET
+ do
+ TILESET=${TILESET#*source=\"}
+ TILESET=${TILESET%%.tsx\"*}
+ TILESET=${TILESET##*/}
+ echo -n " $TILESET"
+ done
+ echo
+done