XML only, rapidjson, and the decompilation workspace removed
Game data is XML only: the JSON form of documents, the DataFormat option and Anm2Ed's JSON .anm2 loader are gone. DataNode wraps pugixml alone, resource_find takes one path, and the read padding simdjson needed is dropped. simdjson is replaced by rapidjson (external/rapidjson, upstream master: REPENTOGON's pinned 2016 commit does not build with clang) for REPENTOGON's own JSON save files, through json_save's document and member helpers. The decompilation workspace is removed (analysis/, db/, dump/, notes/, project/, scripts/): generated-src's classes.h and stubs.cpp move to src/generated/, the overlay moves to src/overlay/ (with its console commands in commands.cpp), and the build adds ccache, mold, precompiled headers, an optional unity build and a build/<platform>/ folder linking the resources, mods and assets. Also included: the save folder and options.ini flags (--saves, --options, --help), Steam Cloud left offline, and further REPENTOGON vanilla fixes and player and room behaviour.
This commit is contained in:
1 parent
4ff67e2e96
commit
2d2c4536da
409 files changed
+1277
-1558216
No files matched your search
+48
-16
@@ -1,10 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
cmake_minimum_required(VERSION 3.29)
|
||||
project(isaac LANGUAGES C CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# ccache and mold when installed. The sloppiness lets ccache cache the precompiled header's users.
|
||||
find_program(CCACHE ccache)
|
||||
if(CCACHE)
|
||||
set(CCACHE_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime,include_file_ctime ${CCACHE})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_LAUNCHER})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_LAUNCHER})
|
||||
endif()
|
||||
find_program(MOLD mold)
|
||||
if(MOLD)
|
||||
set(CMAKE_LINKER_TYPE MOLD)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
@@ -30,11 +42,9 @@ 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/
|
||||
# and Anm2Ed's .anm2 documents.
|
||||
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)
|
||||
# rapidjson, header-only, the library REPENTOGON uses, for REPENTOGON's own JSON save files.
|
||||
add_library(rapidjson INTERFACE)
|
||||
target_include_directories(rapidjson SYSTEM INTERFACE external/rapidjson/include)
|
||||
|
||||
# pugixml for the game's own XML (the install's data and anm2 files, mods' XML): static, without XPath or exceptions.
|
||||
add_library(pugixml STATIC external/pugixml/src/pugixml.cpp)
|
||||
@@ -71,7 +81,7 @@ target_include_directories(theora SYSTEM PUBLIC external/theora/include)
|
||||
target_link_libraries(theora PUBLIC ogg)
|
||||
target_compile_options(theora PRIVATE -w)
|
||||
|
||||
# The developer overlay (src/ui/overlay/) in place of the drop-down console, on Dear ImGui's docking branch: its core,
|
||||
# The developer overlay (src/overlay/) in place of the drop-down console, on Dear ImGui's docking branch: its core,
|
||||
# the std::string widgets and the SDL3 and OpenGL 3 backends, static. OFF builds the game without either.
|
||||
option(ISAAC_OVERLAY "Build the developer overlay in place of the drop-down console" ON)
|
||||
if(ISAAC_OVERLAY)
|
||||
@@ -89,22 +99,44 @@ endif()
|
||||
# with every change to the vanilla game behind its options and the vanilla parity switch. OFF builds the vanilla game.
|
||||
option(ISAAC_REPENTOGON "Build REPENTOGON's modding API into the game" ON)
|
||||
|
||||
# The curated game: every .cpp under src/, sorted into subsystem folders and including each other by path from src/,
|
||||
# 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
|
||||
# executable always links and runs exactly as far as src/ goes.
|
||||
# The game: every .cpp under src/, sorted into subsystem folders and including each other by path from src/.
|
||||
# src/generated/ holds the frozen decompiler output: classes.h declares every original class, and stubs.cpp defines
|
||||
# each original function src/ does not as a stub that stops the game where it is reached.
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.cpp)
|
||||
if(NOT ISAAC_OVERLAY)
|
||||
list(FILTER SOURCES EXCLUDE REGEX "/src/ui/overlay/")
|
||||
list(FILTER SOURCES EXCLUDE REGEX "/src/overlay/")
|
||||
endif()
|
||||
if(NOT ISAAC_REPENTOGON)
|
||||
list(FILTER SOURCES EXCLUDE REGEX "/src/repentogon/")
|
||||
endif()
|
||||
add_executable(isaac ${SOURCES} generated-src/stubs.cpp)
|
||||
add_executable(isaac ${SOURCES})
|
||||
|
||||
# The game goes alone into build/<platform>/, beside links to the resources it reads, the mods folder and assets/.
|
||||
# ISAAC_RESOURCES picks the resources: the import tool's folder, or an install's resources folder.
|
||||
set(ISAAC_RESOURCES ${CMAKE_SOURCE_DIR}/resources CACHE PATH "The resources folder the game reads")
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} PLATFORM)
|
||||
set(GAME_DIRECTORY ${CMAKE_BINARY_DIR}/${PLATFORM})
|
||||
set_target_properties(isaac PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${GAME_DIRECTORY})
|
||||
file(MAKE_DIRECTORY ${GAME_DIRECTORY})
|
||||
foreach(LINK resources mods assets)
|
||||
set(TARGET ${CMAKE_SOURCE_DIR}/${LINK})
|
||||
if(LINK STREQUAL "resources")
|
||||
set(TARGET ${ISAAC_RESOURCES})
|
||||
endif()
|
||||
file(REMOVE ${GAME_DIRECTORY}/${LINK})
|
||||
file(CREATE_LINK ${TARGET} ${GAME_DIRECTORY}/${LINK} SYMBOLIC)
|
||||
endforeach()
|
||||
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 pugixml theora vorbis ogg)
|
||||
target_include_directories(isaac SYSTEM PRIVATE src/generated external/stb)
|
||||
target_link_libraries(isaac PRIVATE SDL3::SDL3-static lua rapidjson pugixml theora vorbis ogg)
|
||||
|
||||
# The standard headers and classes.h make up most of every file's parse, so they are compiled once.
|
||||
# ISAAC_UNITY also merges the files into batches: faster clean builds, slower incremental ones.
|
||||
target_precompile_headers(isaac PRIVATE <algorithm> <array> <cmath> <cstdint> <deque> <functional> <list> <map> <memory>
|
||||
<optional> <set> <span> <string> <string_view> <unordered_map> <vector> src/generated/classes.h)
|
||||
set_source_files_properties(src/engine/kage_sound.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON SKIP_UNITY_BUILD_INCLUSION ON)
|
||||
option(ISAAC_UNITY "Build the game in unity batches" OFF)
|
||||
set_target_properties(isaac PROPERTIES UNITY_BUILD ${ISAAC_UNITY} UNITY_BUILD_BATCH_SIZE 24)
|
||||
if(ISAAC_OVERLAY)
|
||||
target_compile_definitions(isaac PRIVATE ISAAC_OVERLAY)
|
||||
target_link_libraries(isaac PRIVATE imgui)
|
||||
|
||||
Reference in new issue
Block a user