From 76c594f9a0c6868b48f8fea3ee57f390005e6e8a Mon Sep 17 00:00:00 2001 From: shweet Date: Fri, 20 Nov 2026 20:56:57 -0500 Subject: [PATCH] Add Ogg, Vorbis and Theora as static decoder-only submodules for cutscene videos --- .gitmodules | 12 ++++++++++++ CMakeLists.txt | 32 +++++++++++++++++++++++++++++++- README.md | 2 +- external/ogg | 1 + external/theora | 1 + external/vorbis | 1 + 6 files changed, 47 insertions(+), 2 deletions(-) create mode 160000 external/ogg create mode 160000 external/theora create mode 160000 external/vorbis diff --git a/.gitmodules b/.gitmodules index ce1cee3..e5a0c8e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,3 +14,15 @@ path = external/stb url = https://github.com/nothings/stb.git shallow = true +[submodule "external/ogg"] + path = external/ogg + url = https://github.com/xiph/ogg.git + shallow = true +[submodule "external/vorbis"] + path = external/vorbis + url = https://github.com/xiph/vorbis.git + shallow = true +[submodule "external/theora"] + path = external/theora + url = https://github.com/xiph/theora.git + shallow = true diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a74848..f272f33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,36 @@ 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) +# Xiph's Ogg, Vorbis and Theora for the cutscene videos (.ogv): static, decoders only. +set(INCLUDE_INTTYPES_H 1) +set(INCLUDE_STDINT_H 1) +set(INCLUDE_SYS_TYPES_H 1) +set(SIZE16 int16_t) +set(USIZE16 uint16_t) +set(SIZE32 int32_t) +set(USIZE32 uint32_t) +set(SIZE64 int64_t) +set(USIZE64 uint64_t) +configure_file(external/ogg/include/ogg/config_types.h.in ${CMAKE_BINARY_DIR}/xiph/ogg/config_types.h @ONLY) +add_library(ogg STATIC external/ogg/src/bitwise.c external/ogg/src/framing.c) +target_include_directories(ogg SYSTEM PUBLIC external/ogg/include ${CMAKE_BINARY_DIR}/xiph) + +file(GLOB VORBIS_SOURCES CONFIGURE_DEPENDS external/vorbis/lib/*.c) +foreach(TOOL barkmel psytune tone vorbisenc) + list(REMOVE_ITEM VORBIS_SOURCES ${CMAKE_SOURCE_DIR}/external/vorbis/lib/${TOOL}.c) +endforeach() +add_library(vorbis STATIC ${VORBIS_SOURCES}) +target_include_directories(vorbis SYSTEM PUBLIC external/vorbis/include PRIVATE external/vorbis/lib) +target_link_libraries(vorbis PUBLIC ogg) + +set(THEORA_DECODER apiwrapper bitpack decapiwrapper decinfo decode dequant fragment huffdec idct info internal quant state) +list(TRANSFORM THEORA_DECODER PREPEND external/theora/lib/) +list(TRANSFORM THEORA_DECODER APPEND .c) +add_library(theora STATIC ${THEORA_DECODER}) +target_include_directories(theora SYSTEM PUBLIC external/theora/include) +target_link_libraries(theora PUBLIC ogg) +target_compile_options(theora PRIVATE -w) + # 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). # generated-src/stubs.cpp defines everything not curated yet as a stub that stops the game where it is reached, so the @@ -43,4 +73,4 @@ file(GLOB SOURCES CONFIGURE_DEPENDS src/*.cpp) add_executable(isaac ${SOURCES} generated-src/stubs.cpp) target_include_directories(isaac PRIVATE src) target_include_directories(isaac SYSTEM PRIVATE generated-src external/stb) -target_link_libraries(isaac PRIVATE SDL3::SDL3-static lua simdjson) +target_link_libraries(isaac PRIVATE SDL3::SDL3-static lua simdjson theora vorbis ogg) diff --git a/README.md b/README.md index e0c2c5b..1a5fb09 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ 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, with simdjson for data. Online features (Steam, EOS, curl) are offline stubs. The game +in `external/`, built statically, with simdjson for data and Xiph's Ogg, Vorbis and Theora (decoders only) for the cutscene videos. 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 diff --git a/external/ogg b/external/ogg new file mode 160000 index 0000000..e1774cd --- /dev/null +++ b/external/ogg @@ -0,0 +1 @@ +Subproject commit e1774cd77f471443541596e09078e78fdc342e4f diff --git a/external/theora b/external/theora new file mode 160000 index 0000000..7ffd8b2 --- /dev/null +++ b/external/theora @@ -0,0 +1 @@ +Subproject commit 7ffd8b2ecfc2d93ae5e16028e7528e609266bfbf diff --git a/external/vorbis b/external/vorbis new file mode 160000 index 0000000..0657aee --- /dev/null +++ b/external/vorbis @@ -0,0 +1 @@ +Subproject commit 0657aee69dec8508a0011f47f3b69d7538e9d262