From cb9c26b597cd082beb01e1368202733b278e89eb Mon Sep 17 00:00:00 2001 From: alk <45172705+altalk23@users.noreply.github.com> Date: Tue, 14 Feb 2023 23:50:34 +0300 Subject: [PATCH 1/4] Update Modify.hpp --- loader/include/Geode/modify/Modify.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/include/Geode/modify/Modify.hpp b/loader/include/Geode/modify/Modify.hpp index 3b046c96..e2ed7c85 100644 --- a/loader/include/Geode/modify/Modify.hpp +++ b/loader/include/Geode/modify/Modify.hpp @@ -106,7 +106,7 @@ namespace geode::modifier { class ModifyDerive { public: ModifyDerive() { - static_assert(alwaysFalse, "Custom Modify not implemented."); + static_assert(alwaysFalse, "Modified class not recognized, please include to be able to use it."); } }; } From 37361269ec18749ecf2911fd4c149320cb39074c Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Tue, 14 Feb 2023 18:15:13 -0300 Subject: [PATCH 2/4] move Addresser::followThunkFunction to source --- loader/include/Geode/utils/addresser.hpp | 13 +------------ loader/src/utils/addresser.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/loader/include/Geode/utils/addresser.hpp b/loader/include/Geode/utils/addresser.hpp index eb458ffa..7b4a5adb 100644 --- a/loader/include/Geode/utils/addresser.hpp +++ b/loader/include/Geode/utils/addresser.hpp @@ -163,18 +163,7 @@ namespace geode::addresser { return addressOfNonVirtual(reinterpret_cast(func)); } - static inline intptr_t followThunkFunction(intptr_t address) { -#ifdef GEODE_IS_WINDOWS - // check if first instruction is a jmp dword ptr [....], i.e. if the func is a thunk - if (*reinterpret_cast(address) == 0xFF && *reinterpret_cast(address + 1) == 0x25) { - // read where the jmp reads from - address = *reinterpret_cast(address + 2); - // that then contains the actual address of the func - address = *reinterpret_cast(address); - } -#endif - return address; - } + static intptr_t followThunkFunction(intptr_t address); template static intptr_t addressOfNonVirtual(R (T::*func)(Ps...)) { diff --git a/loader/src/utils/addresser.cpp b/loader/src/utils/addresser.cpp index d9a4c9b8..9fd65c2f 100644 --- a/loader/src/utils/addresser.cpp +++ b/loader/src/utils/addresser.cpp @@ -65,3 +65,16 @@ namespace { Addresser::MultipleInheritance* Addresser::instance() { return reinterpret_cast(&TableTable::table); } + +intptr_t Addresser::followThunkFunction(intptr_t address) { +#ifdef GEODE_IS_WINDOWS + // check if first instruction is a jmp dword ptr [....], i.e. if the func is a thunk + if (*reinterpret_cast(address) == 0xFF && *reinterpret_cast(address + 1) == 0x25) { + // read where the jmp reads from + address = *reinterpret_cast(address + 2); + // that then contains the actual address of the func + address = *reinterpret_cast(address); + } +#endif + return address; +} \ No newline at end of file From b78ce23d1e20a90122e3441d029751174ada082d Mon Sep 17 00:00:00 2001 From: alk <45172705+altalk23@users.noreply.github.com> Date: Thu, 16 Feb 2023 17:59:38 +0300 Subject: [PATCH 3/4] Update bug-report.yml --- .github/ISSUE_TEMPLATE/bug-report.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 9cc21420..6da53abe 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -12,6 +12,14 @@ body: - "Windows" validations: required: true + - type: input + id: commit + attributes: + label: SDK commit + description: The commit you used to compile your code with. If the bug is not related with your mod, you can leave this field empty. + placeholder: "Example: a674b97" + validations: + required: false - type: input id: version attributes: From 54e082e8d5765604d88fea71400cd77315125ac8 Mon Sep 17 00:00:00 2001 From: mat <26722564+matcool@users.noreply.github.com> Date: Fri, 17 Feb 2023 15:41:10 -0300 Subject: [PATCH 4/4] fix build for cross compilation clang --- CMakeLists.txt | 6 ++++++ loader/include/Geode/loader/Setting.hpp | 6 +++--- loader/src/loader/Setting.cpp | 24 ++++++++++++------------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 133fa304..9ad04920 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,12 @@ include(cmake/GeodeFile.cmake) include(cmake/Platform.cmake) include(cmake/CPM.cmake) +# this is needed for cross compilation on linux, +# since fmtlib will fail to compile otherwise +if (GEODE_DISABLE_FMT_CONSTEVAL) + target_compile_definitions(${PROJECT_NAME} INTERFACE -DFMT_CONSTEVAL=) +endif() + CPMAddPackage("gh:geode-sdk/json#2b76460") CPMAddPackage("gh:fmtlib/fmt#9.1.0") CPMAddPackage("gh:gulrak/filesystem#3e5b930") diff --git a/loader/include/Geode/loader/Setting.hpp b/loader/include/Geode/loader/Setting.hpp index 0c77f265..cb3134a8 100644 --- a/loader/include/Geode/loader/Setting.hpp +++ b/loader/include/Geode/loader/Setting.hpp @@ -219,9 +219,9 @@ namespace geode { using ColorAlphaSettingValue = GeodeSettingValue; template - struct SettingValueSetter { - static GEODE_DLL T get(SettingValue* setting); - static GEODE_DLL void set(SettingValue* setting, T const& value); + struct GEODE_DLL SettingValueSetter { + static T get(SettingValue* setting); + static void set(SettingValue* setting, T const& value); }; } diff --git a/loader/src/loader/Setting.cpp b/loader/src/loader/Setting.cpp index 4b5d0b3e..c8754dff 100644 --- a/loader/src/loader/Setting.cpp +++ b/loader/src/loader/Setting.cpp @@ -275,18 +275,6 @@ std::string SettingValue::getKey() const { typename type_##Setting::ValueType const& value \ ) const -// instantiate value setters - -namespace geode { - template struct SettingValueSetter; - template struct SettingValueSetter; - template struct SettingValueSetter; - template struct SettingValueSetter; - template struct SettingValueSetter; - template struct SettingValueSetter; - template struct SettingValueSetter; -} - // instantiate values namespace geode { @@ -370,6 +358,18 @@ IMPL_NODE_AND_SETTERS(File); IMPL_NODE_AND_SETTERS(Color); IMPL_NODE_AND_SETTERS(ColorAlpha); +// instantiate value setters + +namespace geode { + template struct SettingValueSetter; + template struct SettingValueSetter; + template struct SettingValueSetter; + template struct SettingValueSetter; + template struct SettingValueSetter; + template struct SettingValueSetter; + template struct SettingValueSetter; +} + // SettingChangedEvent SettingChangedEvent::SettingChangedEvent(Mod* mod, SettingValue* value)