From cf0354eb8e043fcd9c6c17756701972f948a16f1 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 22 Aug 2024 00:02:48 +0100 Subject: Rewrite the gamedata and entprops systems entirely This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters. --- compile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compile') diff --git a/compile b/compile index d9ab4f6..17a1ba4 100755 --- a/compile +++ b/compile @@ -89,15 +89,15 @@ if [ "$dbg" = 1 ]; then src="$src \ fi $HOSTCC -O2 -fuse-ld=lld $warnings -D_FILE_OFFSET_BITS=64 -include stdbool.h \ - -o .build/codegen src/build/codegen.c src/build/cmeta.c + -o .build/codegen src/build/codegen.c src/build/cmeta.c src/os.c $HOSTCC -O2 -fuse-ld=lld $warnings -D_FILE_OFFSET_BITS=64 -include stdbool.h \ - -o .build/mkgamedata src/build/mkgamedata.c src/kv.c + -o .build/mkgamedata src/build/mkgamedata.c src/os.c $HOSTCC -O2 -fuse-ld=lld $warnings -D_FILE_OFFSET_BITS=64 -include stdbool.h \ - -o .build/mkentprops src/build/mkentprops.c src/kv.c + -o .build/mkentprops src/build/mkentprops.c src/os.c .build/codegen `for s in $src; do echo "src/$s"; done` -.build/mkgamedata gamedata/engine.kv gamedata/gamelib.kv gamedata/inputsystem.kv \ -gamedata/matchmaking.kv gamedata/vgui2.kv gamedata/vguimatsurface.kv -.build/mkentprops gamedata/entprops.kv +.build/mkgamedata gamedata/engine.txt gamedata/gamelib.txt gamedata/inputsystem.txt \ +gamedata/matchmaking.txt gamedata/vgui2.txt gamedata/vguimatsurface.txt +.build/mkentprops gamedata/entprops.txt for s in $src; do cc "$s"; done $CC -shared -fpic -fuse-ld=lld -O0 -w -o .build/libtier0.so src/stubs/tier0.c $CC -shared -fpic -fuse-ld=lld -O0 -w -o .build/libvstdlib.so src/stubs/vstdlib.c -- cgit v1.2.3