aboutsummaryrefslogtreecommitdiff
path: root/utils/gentransswitch.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-17 19:14:26 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-17 19:14:26 +0100
commitd6fdf14d5c320bdca455f910d58d652c5a7827da (patch)
tree15642a013e719e81526cf02b6656ce22adb8a3cf /utils/gentransswitch.sh
parenta26ae103faf8fa53b65f7757fb8b4255a37fcd22 (diff)
downloadnissy-core-d6fdf14d5c320bdca455f910d58d652c5a7827da.tar.gz
nissy-core-d6fdf14d5c320bdca455f910d58d652c5a7827da.zip
Simplified move and transform code
Diffstat (limited to 'utils/gentransswitch.sh')
-rwxr-xr-xutils/gentransswitch.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/gentransswitch.sh b/utils/gentransswitch.sh
index a08dff9..42726ce 100755
--- a/utils/gentransswitch.sh
+++ b/utils/gentransswitch.sh
@@ -3,6 +3,12 @@
3printf '\tswitch (t) {\n' 3printf '\tswitch (t) {\n'
4for f in transform_??_???.txt; do 4for f in transform_??_???.txt; do
5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')" 5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')"
6 printf '\tcase %s:\n\t\treturn _trans_%s(c);\n' "$t" "$t" 6 mirror_or_rotation="$(echo $t | grep m)"
7 if [ -z "$mirror_or_rotation" ]; then
8 m="rotation"
9 else
10 m="mirrored"
11 fi
12 printf '\tcase %s:\n\t\treturn _trans_%s(%s, c);\n' "$t" "$m" "$t"
7done 13done
8printf '\t}\n' 14printf '\t}\n'

Generated with cgit - Back to sebastiano.tronto.net