From fd1a9ebd4e5191e00e9d2313deb84912f707a53d Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 29 May 2026 21:11:39 -0600 Subject: [PATCH] Unslopify a few more things --- CMakeLists.txt | 10 +--------- files.cmake | 20 ++++++++------------ src/m_Do/m_Do_machine.cpp | 22 +++++++++++----------- src/m_Do/m_Do_main.cpp | 11 +++++++---- 4 files changed, 27 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c918ffe4a6..240d342562 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,10 +132,6 @@ endif () set(AURORA_ENABLE_DVD ON CACHE BOOL "Enable DVD API support" FORCE) set(AURORA_ENABLE_CARD ON CACHE BOOL "Enable CARD API support" FORCE) set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE) -# Force Freetype (pulled by aurora/RmlUi) to use its bundled mini-zlib. -# Otherwise its find_package(ZLIB) latches onto our FetchContent'd shared zlib, -# duplicating inflate*/inflateInit2_ symbols against zlibstatic. -set(FT_DISABLE_ZLIB TRUE CACHE BOOL "" FORCE) add_subdirectory(extern/aurora EXCLUDE_FROM_ALL) target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1) @@ -145,7 +141,6 @@ option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)") option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.") option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON) option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON) -option(DUSK_TPHD "Enable TPHD asset support" ON) option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF) set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN") @@ -332,10 +327,7 @@ set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors") source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES}) source_group("dusklight" FILES ${DUSK_FILES} ${DUSK_HTTP_BACKEND_FILES}) -set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1) -if (DUSK_TPHD) - list(APPEND GAME_COMPILE_DEFS DUSK_TPHD=1) -endif () +set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 DUSK_TPHD=1) set(GAME_INCLUDE_DIRS include diff --git a/files.cmake b/files.cmake index ce650e70e6..91fc66498a 100644 --- a/files.cmake +++ b/files.cmake @@ -246,18 +246,6 @@ set(DOLZEL_FILES if(DEBUG) list(APPEND DOLZEL_FILES src/d/d_event_debug.cpp) endif(DEBUG) -if (DUSK_TPHD) - list(APPEND DOLZEL_FILES - src/dusk/tphd/TphdPack.hpp - src/dusk/tphd/TphdPack.cpp - src/dusk/tphd/GtxParser.hpp - src/dusk/tphd/GtxParser.cpp - src/dusk/tphd/AddrLib.hpp - src/dusk/tphd/AddrLib.cpp - src/dusk/tphd/HdAssetLayer.hpp - src/dusk/tphd/HdAssetLayer.cpp - ) -endif(DUSK_TPHD) set(Z2AUDIOLIB_FILES src/Z2AudioLib/Z2Calc.cpp @@ -1541,6 +1529,14 @@ set(DUSK_FILES src/dusk/discord_presence.cpp src/dusk/version.cpp src/dusk/action_bindings.cpp + src/dusk/tphd/TphdPack.hpp + src/dusk/tphd/TphdPack.cpp + src/dusk/tphd/GtxParser.hpp + src/dusk/tphd/GtxParser.cpp + src/dusk/tphd/AddrLib.hpp + src/dusk/tphd/AddrLib.cpp + src/dusk/tphd/HdAssetLayer.hpp + src/dusk/tphd/HdAssetLayer.cpp ) set(DUSK_HTTP_BACKEND_FILES diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index 91178963db..8903ec89cf 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -818,10 +818,12 @@ int mDoMch_Create() { // pushes stage BMDs past 8 MB and Link's Kmdl past 5 MB). Parent arena is // 1 GB on PC, distribute generously across every heap that holds model // or animation data at runtime. - archiveHeapSize += 0x08000000; // +128 MB (large RARCs) - gameHeapSize += 0x10000000; // +256 MB (parent of per-actor heaps like "Alink original") - j2dHeapSize += 0x01000000; // +16 MB (UI textures) - dynamicLinkHeapSize += 0x01000000; // +16 MB + if (dusk::tphd_active()) { + archiveHeapSize += 0x08000000; // +128 MB (large RARCs) + gameHeapSize += 0x10000000; // +256 MB (parent of per-actor heaps like "Alink original") + j2dHeapSize += 0x01000000; // +16 MB (UI textures) + dynamicLinkHeapSize += 0x01000000; // +16 MB + } #endif #if !DEBUG @@ -870,13 +872,11 @@ int mDoMch_Create() { #if DEBUG dynamicLinkHeapSize *= 2; #endif - archiveHeapSize *= 2; - j2dHeapSize *= 2; -#if DUSK_TPHD - gameHeapSize *= 2; -#else - gameHeapSize *= 20; // NOTE: increased from 2 to 20 to try to solve heap alloc crashes. maybe do a better fix later -#endif + if (!dusk::tphd_active()) { + archiveHeapSize *= 2; + j2dHeapSize *= 2; + gameHeapSize *= 20; // NOTE: increased from 2 to 20 to try to solve heap alloc crashes. maybe do a better fix later + } #endif JFWSystem::setSysHeapSize(arenaSize); diff --git a/src/m_Do/m_Do_main.cpp b/src/m_Do/m_Do_main.cpp index 30bbf4fd97..755bb8961f 100644 --- a/src/m_Do/m_Do_main.cpp +++ b/src/m_Do/m_Do_main.cpp @@ -88,9 +88,7 @@ #include "dusk/io.hpp" #include "dusk/version.hpp" #include "dusk/discord_presence.hpp" -#if DUSK_TPHD #include "dusk/tphd/HdAssetLayer.hpp" -#endif #include "tracy/Tracy.hpp" #include "f_pc/f_pc_draw.h" #include "tracy/Tracy.hpp" @@ -573,7 +571,8 @@ int game_main(int argc, char* argv[]) { const auto cachePathString = dusk::CachePath.u8string(); AuroraConfig config{}; config.appName = dusk::AppName; - + config.userPath = reinterpret_cast(userPathString.c_str()); + config.cachePath = reinterpret_cast(cachePathString.c_str()); config.vsync = dusk::getSettings().video.enableVsync; config.startFullscreen = dusk::getSettings().video.enableFullscreen; config.windowPosX = -1; @@ -583,7 +582,11 @@ int game_main(int argc, char* argv[]) { config.desiredBackend = ResolveDesiredBackend(parsed_arg_options); config.logCallback = &aurora_log_callback; config.logLevel = startupLogLevel; - config.mem1Size = 1024 * 1024 * 1024; + if (dusk::tphd_active()) { + config.mem1Size = 512 * 1024 * 1024; + } else { + config.mem1Size = 256 * 1024 * 1024; + } config.mem2Size = 24 * 1024 * 1024; config.allowJoystickBackgroundEvents = dusk::getSettings().game.allowBackgroundInput; config.pauseOnFocusLost = dusk::getSettings().game.pauseOnFocusLost;