]> git.plutz.net Git - flarejs/commitdiff
remove deprecate data parsers
authorPaul Hänsch <paul@plutz.net>
Sat, 8 Feb 2020 02:09:12 +0000 (03:09 +0100)
committerPaul Hänsch <paul@plutz.net>
Sat, 8 Feb 2020 02:09:12 +0000 (03:09 +0100)
Makefile
data.sh [deleted file]

index 9a51dac96f82c980004d4969739638f6d1249bd5..85b2c36c41d1a13e6292d8dfad2ba5f43a2b7cf6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-default: _subtrees data.js
+default: _subtrees
 
 .PHONY: _subtrees
 
@@ -9,6 +9,3 @@ cgilite:
 
 _cgilite: cgilite
        git subtree pull --squash -P $< https://git.plutz.net/git/$< master
-
-data.js: data.sh mods/
-       ./$< >$@
diff --git a/data.sh b/data.sh
deleted file mode 100755 (executable)
index 1ba1370..0000000
--- a/data.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-printf 'gamedata = {\n'
-for base in mods/fantasycore mods/empyrean_campaign; do
-  find $base/animations $base/engine -name '*.txt' |while read -r file; do
-    file="${file#"${base}"}"
-    printf '"%s": {\n' "$file"
-    sed -E '
-      # read entire file into buffer
-      :X N; $!bX; s;$;\n;; s;^;\n;; s;\r\n;\n;g;
-
-      # Comment and empty lines
-      :Y s;\n#[^\n]*\n;\n;g; tY;
-
-      # INCLUDE, APPEND
-      s;\nAPPEND\n;\n;g;
-      s;\nINCLUDE ([^\n]+)\n;\n"INCLUDE": "\1"\n;g;
-
-      # section heading, eg. [stance]
-      s;\n\[([^\n]+)\]\n(([^]\n[]+\n)+);"\1": {\n\2 },\n;g;
-
-      # frame list start
-      s;\nframes=[0-9]+\n;\n;g;
-      s;(\nframe=[^\n]+)+;\n"frames": [&;g;
-
-      # frame list, 8 angles isometric
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\nframe=[0-9]+,3,([0-9,-]+)\nframe=[0-9]+,4,([0-9,-]+)\nframe=[0-9]+,5,([0-9,-]+)\nframe=[0-9]+,6,([0-9,-]+)\nframe=[0-9]+,7,([0-9,-]+)\n;[[\1], [\2], [\3], [\4], [\5], [\6], [\7], [\8]],\n;g
-      # frame list, workaround for bug in avatar/female/dagger.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,3,([0-9,-]+)\nframe=[0-9]+,4,([0-9,-]+)\nframe=[0-9]+,5,([0-9,-]+)\nframe=[0-9]+,6,([0-9,-]+)\nframe=[0-9]+,7,([0-9,-]+)\n;[[\1], [\2], [0,0,0,0,0,0], [\3], [\4], [\5], [\6], [\7]],\n;g
-      # frame list, workaround for bug in avatar/male/greatsword.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\nframe=[0-9]+,3,([0-9,-]+)\nframe=[0-9]+,4,([0-9,-]+)\nframe=[0-9]+,5,([0-9,-]+)\nframe=[0-9]+,7,([0-9,-]+)\n;[[\1], [\2], [\3], [\4], [\5], [\6], [0,0,0,0,0,0], [\7]],\n;g
-      # frame list, workaround for bug in avatar/male/slingshot.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\nframe=[0-9]+,4,([0-9,-]+)\nframe=[0-9]+,5,([0-9,-]+)\nframe=[0-9]+,6,([0-9,-]+)\nframe=[0-9]+,7,([0-9,-]+)\n;[[\1], [\2], [\3], [0,0,0,0,0,0], [\4], [\5], [\6], [\7]],\n;g
-      # frame list, 6 angles e.g. powers/freeze.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\nframe=[0-9]+,3,([0-9,-]+)\nframe=[0-9]+,4,([0-9,-]+)\nframe=[0-9]+,5,([0-9,-]+)\n;[[\1], [\2], [\3], [\4], [\5], [\6]],\n;g
-      # frame list, 4 angles e.g. powers/spikes.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\nframe=[0-9]+,3,([0-9,-]+)\n;[[\1], [\2], [\3], [\4]],\n;g
-      # frame list, 3 angles e.g. powers/quake.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\nframe=[0-9]+,2,([0-9,-]+)\n;[[\1], [\2], [\3]],\n;g
-      # frame list, 2 angles e.g. powers/blast.txt
-      s;frame=[0-9]+,0,([0-9,-]+)\nframe=[0-9]+,1,([0-9,-]+)\n;[[\1], [\2]],\n;g
-      # frame list, front angle only
-      s;frame=[0-9]+,0,([0-9,-]+)\n;[[\1]],\n;g
-
-      # frame list end
-      s;("frames": []\n,0-9 [-]+),;\1\n],;g;
-
-      # layer group (in engine/hero_layers.txt)
-      s;\nlayer=[0-9],([^\n]+)\n;\nlayers: [\1]\n;;
-      :layer_1
-      s;(\nlayers: [^\n]+)\nlayer=[0-9]+,([^\n]+)\n;\1,[\2]\n;;
-      tlayer_1;
-      :layer_2
-      s;(\nlayers: [^\n"]*)([],[])([^\n]*\n);\1"\2"\3;;
-      tlayer_2; 
-      :layer_3
-      s;(\nlayers: [^\n]+)""([^\n]+\n);\1\2;;
-      tlayer_3
-      s;\nlayers: "([^\n]+)"\n;\nlayers: [\1],\n;;
-
-      # animation duration
-      s;\n(duration)=([0-9]+)ms\n;\n"\1": \2,\n;g
-      s;\n(duration)=([0-9]+)s\n;\n"\1": \2000,\n;g
-
-      :general
-        # general scalar
-        s;\n([^=\n]+)=([0-9-]+)\n;\n"\1": \2,\n;g
-
-        # general array
-        s;\n([^=\n]+)=([0-9,-]+)\n;\n"\1": [\2],\n;g
-
-        # general text
-        s;\n([^=\n]+)=([^\n]+)\n;\n"\1": "\2",\n;g
-      tgeneral;
-    ' "${base}${file}"
-    printf '},\n'
-  done
-done
-printf '}\n'