aboutsummaryrefslogtreecommitdiff
path: root/scripts/manifest2header.awk
diff options
context:
space:
mode:
authorUnavailableDev <69792062+UnavailableDev@users.noreply.github.com>2023-04-06 12:32:23 +0200
committerGitHub <noreply@github.com>2023-04-06 12:32:23 +0200
commitd1c00c98ca0f2ca498284e60fa057a610cc5c461 (patch)
treea2efebcb9917d7f4f3666a722338f50b9590e843 /scripts/manifest2header.awk
parent1771aaa12736b4dbc24419270cf595de6d345969 (diff)
parent93e9426d5642dfab7a13d5a34873b296de1d9642 (diff)
Merge pull request #58 from UnavailableDev/dev
Dynamic tilemap
Diffstat (limited to 'scripts/manifest2header.awk')
-rwxr-xr-xscripts/manifest2header.awk23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/manifest2header.awk b/scripts/manifest2header.awk
new file mode 100755
index 0000000..b141a8b
--- /dev/null
+++ b/scripts/manifest2header.awk
@@ -0,0 +1,23 @@
+#!/bin/awk -f
+BEGIN {
+ offset = 0
+ groups = 0
+ arr = "0"
+ print "#pragma once"
+ print "#include <stddef.h>"
+}
+(offset > 0) {
+ arr = arr ", " offset
+}
+1 {
+ sub(".*/", "", $1)
+ print "#define HH_TM_"toupper($1)"_OFFSET "offset
+ print "#define HH_TM_"toupper($1)"_SIZE "$2
+ groups += 1
+ offset += $2
+}
+END {
+ print "#define HH_TM_SIZE "offset
+ print "#define HH_TM_GROUPS "groups
+ print "const static uint8_t hh_palette_lut[]={"arr", NULL};"
+}