From 0b86c1071f14be6ad00c7ef84d489fa453dc24e1 Mon Sep 17 00:00:00 2001 From: shweet Date: Thu, 19 Nov 2026 21:27:08 -0500 Subject: [PATCH] external/: simdjson v5.1.1; the game reads JSON that an import tool makes from the player's install Config and .anm2 data are converted from the install's XML (and packed archives) into a gitignored resources/ by a tool in the gitignored tools/, as in smack-a-brother. The game has no XML parser. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 2 ++ .gitmodules | 4 ++++ CMakeLists.txt | 7 ++++++- README.md | 5 +++-- external/simdjson | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) create mode 160000 external/simdjson diff --git a/.gitignore b/.gitignore index eb95474..ba333c1 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ __pycache__/ /.tmp/ /CLAUDE.md /build*/ +/tools/ +/resources/ diff --git a/.gitmodules b/.gitmodules index cd63014..13891cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,7 @@ path = external/lua url = https://github.com/lua/lua.git shallow = true +[submodule "external/simdjson"] + path = external/simdjson + url = https://github.com/simdjson/simdjson.git + shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a5b34d..5ff7a77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,10 +30,15 @@ add_library(lua STATIC ${LUA_SOURCES}) target_include_directories(lua SYSTEM PUBLIC external/lua) target_compile_definitions(lua PRIVATE LUA_USE_POSIX) +# simdjson: its single-file build, static, without exceptions, for the JSON the import tool writes into resources/. +add_library(simdjson STATIC external/simdjson/singleheader/simdjson.cpp) +target_include_directories(simdjson SYSTEM PUBLIC external/simdjson/singleheader) +target_compile_definitions(simdjson PUBLIC SIMDJSON_EXCEPTIONS=0) + # The curated game: src/*.cpp, written on top of the declarations generated-src/classes.h holds for every class. # generated-src/'s own bodies stay out until they compile (scripts/source_tree.py --check reports how many do). file(GLOB SOURCES CONFIGURE_DEPENDS src/*.cpp) add_library(isaac STATIC ${SOURCES}) target_include_directories(isaac PRIVATE src) target_include_directories(isaac SYSTEM PRIVATE generated-src) -target_link_libraries(isaac PRIVATE SDL3::SDL3-static lua) +target_link_libraries(isaac PRIVATE SDL3::SDL3-static lua simdjson) diff --git a/README.md b/README.md index da9ed15..e0c2c5b 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,9 @@ jdk/ ghidra_12.2_PUBLIC/ Temurin 21 (system java is 8, too old) and Ghidra The goal is a C++ source tree that builds a native 64-bit Linux game: `git submodule update --init --recursive`, then `cmake -B build && cmake --build build`. SDL3 (window, OpenGL context, input, audio) and Lua 5.3 (mods) are submodules -in `external/`, built statically. Online features (Steam, EOS, curl) are offline stubs. The game's resources are read -from the player's own install at runtime; nothing from the game ships here. +in `external/`, built statically, with simdjson for data. Online features (Steam, EOS, curl) are offline stubs. The game +reads JSON, not XML: an import tool in `tools/` converts the player's own install (XML, packed archives) and mods into +`resources/` (both gitignored). Nothing from the game ships here. `generated-src/` is the whole decompiled game as C++, regenerated every build and never edited. `src/` is the readable game, written by hand on top of it one function at a time: diff --git a/external/simdjson b/external/simdjson new file mode 160000 index 0000000..40a686a --- /dev/null +++ b/external/simdjson @@ -0,0 +1 @@ +Subproject commit 40a686ab89dc5ee58ec10d0514dd5c99abbc472b