From 1a70aa356e7d4f5a050c83e12e6767ce4e7596df Mon Sep 17 00:00:00 2001 From: praydog Date: Sat, 25 May 2024 10:24:35 -0700 Subject: [PATCH 1/2] LooseFileLoader: Fix in DMC5 and older games --- src/mods/LooseFileLoader.cpp | 13 +++++++++++++ src/mods/LooseFileLoader.hpp | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/src/mods/LooseFileLoader.cpp b/src/mods/LooseFileLoader.cpp index fcf870535..5f67f39a8 100644 --- a/src/mods/LooseFileLoader.cpp +++ b/src/mods/LooseFileLoader.cpp @@ -268,13 +268,26 @@ bool LooseFileLoader::handle_path(const wchar_t* path, size_t hash) { return false; } +#if TDB_VER > 67 uint64_t LooseFileLoader::path_to_hash_hook(const wchar_t* path) { +#else +uint64_t LooseFileLoader::path_to_hash_hook(void* This, const wchar_t* path) { +#endif const auto og = g_loose_file_loader->m_path_to_hash_hook->get_original(); + +#if TDB_VER > 67 const auto result = og(path); +#else + const auto result = og(This, path); +#endif // true to skip. if (g_loose_file_loader->handle_path(path, result)) { +#if TDB_VER > 67 return 4294967296; +#else + return 0xFFFFFFFF; +#endif } return result; diff --git a/src/mods/LooseFileLoader.hpp b/src/mods/LooseFileLoader.hpp index 815e5151f..711d45bc0 100644 --- a/src/mods/LooseFileLoader.hpp +++ b/src/mods/LooseFileLoader.hpp @@ -24,7 +24,12 @@ class LooseFileLoader : public Mod { private: void hook(); bool handle_path(const wchar_t* path, size_t hash); + +#if TDB_VER > 67 static uint64_t path_to_hash_hook(const wchar_t* path); +#else + static uint64_t path_to_hash_hook(void* This, const wchar_t* path); +#endif bool m_hook_success{false}; bool m_attempted_hook{false}; From 654bac566ad2cb645a5ddbf72d0008e8698187b8 Mon Sep 17 00:00:00 2001 From: praydog Date: Sat, 25 May 2024 17:12:24 -0700 Subject: [PATCH 2/2] VR (DD2): Fix landscape not rendering --- src/mods/VR.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mods/VR.cpp b/src/mods/VR.cpp index 5115861d2..7c67e1b4a 100644 --- a/src/mods/VR.cpp +++ b/src/mods/VR.cpp @@ -3062,6 +3062,7 @@ void VR::on_end_rendering(void* entry) { "UpdateMovie", // Causes movies to play twice as fast if ran again "UpdateSpeedTree", "UpdateHansoft", + "UpdatePuppet", // The dynamics stuff causes a cloth physics step in the right eye "BeginRenderingDynamics", "BeginDynamics", @@ -3069,7 +3070,9 @@ void VR::on_end_rendering(void* entry) { "EndDynamics", "EndPhysics", "RenderDynamics", +#ifndef DD2 "RenderLandscape", +#endif "DevelopRenderer", "DrawWidget" };