aboutsummaryrefslogtreecommitdiff
path: root/utils/gentranscode.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-05 16:29:14 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-05 16:37:39 +0100
commit1964938ca6abef6e5c81d9dccdf42c55abacb5e9 (patch)
tree9908417751ddf22e45ea68da0f209083249ac08e /utils/gentranscode.sh
parent9c1659d91a331735f88c127aa236a59153e23dfc (diff)
downloadnissy-core-1964938ca6abef6e5c81d9dccdf42c55abacb5e9.tar.gz
nissy-core-1964938ca6abef6e5c81d9dccdf42c55abacb5e9.zip
Refactoring
Diffstat (limited to 'utils/gentranscode.sh')
-rwxr-xr-xutils/gentranscode.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/gentranscode.sh b/utils/gentranscode.sh
index 7749ba7..2f73df7 100755
--- a/utils/gentranscode.sh
+++ b/utils/gentranscode.sh
@@ -2,8 +2,8 @@
2 2
3type="${1:-src}" 3type="${1:-src}"
4 4
5gcc -DDEBUG h48_to_"$type".c ../src/cube.c -o h48_to_"$type" 5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6gcc -DDEBUG invert.c ../src/cube.c -o invert 6gcc -DDEBUG invert.c ../cube.c -o invert
7 7
8# Old version 8# Old version
9genarray() { 9genarray() {
@@ -22,7 +22,7 @@ genarray() {
22genfuncs() { 22genfuncs() {
23 for f in transform_??_???.txt; do 23 for f in transform_??_???.txt; do
24 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')" 24 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')"
25 printf 'static inline cube_t\ninline_trans_%s' "$trans" 25 printf 'static inline cube_t\n_trans_%s' "$trans"
26 printf '(cube_t c)\n{\n' 26 printf '(cube_t c)\n{\n'
27 printf '\tcube_t ret;\n\n' 27 printf '\tcube_t ret;\n\n'
28 printf '\tcube_t tn = ' 28 printf '\tcube_t tn = '
@@ -32,7 +32,7 @@ genfuncs() {
32 printf ';\n\n\tret = compose(tn, c);\n' 32 printf ';\n\n\tret = compose(tn, c);\n'
33 printf '\tret = compose(ret, ti);\n' 33 printf '\tret = compose(ret, ti);\n'
34 if [ -n "$(echo "$trans" | grep "m")" ]; then 34 if [ -n "$(echo "$trans" | grep "m")" ]; then
35 printf '\tret = flipallcorners(ret);\n' 35 printf '\tret = _invertco(ret);\n'
36 fi 36 fi
37 printf '\n\treturn ret;\n}\n\n' 37 printf '\n\treturn ret;\n}\n\n'
38 done 38 done

Generated with cgit - Back to sebastiano.tronto.net