diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-17 19:14:26 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-17 19:14:26 +0100 |
| commit | d6fdf14d5c320bdca455f910d58d652c5a7827da (patch) | |
| tree | 15642a013e719e81526cf02b6656ce22adb8a3cf /utils/gentransswitch.sh | |
| parent | a26ae103faf8fa53b65f7757fb8b4255a37fcd22 (diff) | |
| download | nissy-core-d6fdf14d5c320bdca455f910d58d652c5a7827da.tar.gz nissy-core-d6fdf14d5c320bdca455f910d58d652c5a7827da.zip | |
Simplified move and transform code
Diffstat (limited to '')
| -rwxr-xr-x | utils/gentransswitch.sh | 8 |
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 @@ | |||
| 3 | printf '\tswitch (t) {\n' | 3 | printf '\tswitch (t) {\n' |
| 4 | for f in transform_??_???.txt; do | 4 | for 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" | ||
| 7 | done | 13 | done |
| 8 | printf '\t}\n' | 14 | printf '\t}\n' |
