From d6fdf14d5c320bdca455f910d58d652c5a7827da Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 17 Nov 2023 19:14:26 +0100 Subject: Simplified move and transform code --- utils/gentransswitch.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'utils/gentransswitch.sh') 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 @@ printf '\tswitch (t) {\n' for f in transform_??_???.txt; do t="$(echo $f | sed 's/.*_// ; s/\.txt//')" - printf '\tcase %s:\n\t\treturn _trans_%s(c);\n' "$t" "$t" + mirror_or_rotation="$(echo $t | grep m)" + if [ -z "$mirror_or_rotation" ]; then + m="rotation" + else + m="mirrored" + fi + printf '\tcase %s:\n\t\treturn _trans_%s(%s, c);\n' "$t" "$m" "$t" done printf '\t}\n' -- cgit v1.3