From bd197ab294e701b547d1b8fc6100a6dcd4ec5016 Mon Sep 17 00:00:00 2001 From: devin Date: Thu, 1 Oct 2026 14:02:48 +0000 Subject: [PATCH] Link scene/memoryCard/iplMemoryCardBase (clean subset) Gate Rect.~Rect and RuntimeTypeInfo.DynamicCast behind IPL_MEMORYCARD_BASE_CPP so this TU emits the weak destructors and the out-of-line dynamic cast the original object contains. Co-Authored-By: coah80 Co-Authored-By: wch --- configure.py | 2 +- libs/NW4R/include/nw4r/ut/Rect.h | 2 +- libs/NW4R/include/nw4r/ut/RuntimeTypeInfo.h | 2 +- src/scene/memoryCard/iplMemoryCardBase.cpp | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index a8eed9db..308885f0 100644 --- a/configure.py +++ b/configure.py @@ -813,7 +813,7 @@ config.libs = [ ), IPLSection("memoryCard", [ Object(Matching, "scene/memoryCard/iplMemoryCard.cpp"), - Object(NonMatching, "scene/memoryCard/iplMemoryCardBase.cpp"), + Object(Matching, "scene/memoryCard/iplMemoryCardBase.cpp"), Object(NonMatching, "scene/memoryCard/iplMemoryCardManager.cpp"), Object(Matching, "scene/memoryCard/iplGCSaveData.cpp"), Object(NonMatching, "scene/memoryCard/iplGCWindow.cpp"), diff --git a/libs/NW4R/include/nw4r/ut/Rect.h b/libs/NW4R/include/nw4r/ut/Rect.h index 165b3095..cf3c7b66 100644 --- a/libs/NW4R/include/nw4r/ut/Rect.h +++ b/libs/NW4R/include/nw4r/ut/Rect.h @@ -20,7 +20,7 @@ namespace nw4r { Rect(f32 l, f32 t, f32 r, f32 b) : left(l), top(t), right(r), bottom(b) {} #endif -#ifndef IPL_CONTROLLER_TRIVIAL_RECT_DTOR +#if !defined(IPL_CONTROLLER_TRIVIAL_RECT_DTOR) && !defined(IPL_MEMORYCARD_BASE_CPP) ~Rect() {} #endif diff --git a/libs/NW4R/include/nw4r/ut/RuntimeTypeInfo.h b/libs/NW4R/include/nw4r/ut/RuntimeTypeInfo.h index 5dcb7d7d..74b85650 100644 --- a/libs/NW4R/include/nw4r/ut/RuntimeTypeInfo.h +++ b/libs/NW4R/include/nw4r/ut/RuntimeTypeInfo.h @@ -37,7 +37,7 @@ namespace nw4r { } // namespace detail template -#ifdef IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST +#if defined(IPL_BOARD_OBJECT_EXTERNAL_DYNAMIC_CAST) || defined(IPL_MEMORYCARD_BASE_CPP) TDerived DynamicCast(TBase* pPtr); #else inline TDerived DynamicCast(TBase* pPtr) { diff --git a/src/scene/memoryCard/iplMemoryCardBase.cpp b/src/scene/memoryCard/iplMemoryCardBase.cpp index e136e742..682be013 100644 --- a/src/scene/memoryCard/iplMemoryCardBase.cpp +++ b/src/scene/memoryCard/iplMemoryCardBase.cpp @@ -1,4 +1,5 @@ #define IPL_MEMORYCARD_BASE_IMPLEMENTATION +#define IPL_MEMORYCARD_BASE_CPP #include "scene/memoryCard/iplMemoryCardBase.h" #include "scene/settingSelect/iplSettingSelect.h" #include "scene/settingSelect/iplSettingButton.h" @@ -130,7 +131,7 @@ void MemoryBase::set_textbox(const char* paneName, u32 message) { void MemoryBase::set_textbox(const char* paneName, u32 message, int animationIndex, int frame) { Anm* animation = get_animation(animationIndex); - if (animation->mAnim->getCurrentFrame() >= frame) { + if (animation->mAnim->getCurrentFrame() >= (f32)frame) { set_textbox(paneName, message); } } @@ -141,7 +142,7 @@ void MemoryBase::set_textbox(const char* paneName, const wchar_t* text, f32 widt while (length != 0) { textBox->SetString(text, 0, length); textBox->CalculateMtx(*mpLayout->getDrawInfo()); - nw4r::ut::Rect bounds = textBox->GetTextDrawRect(*mpLayout->getDrawInfo()); + const nw4r::ut::Rect& bounds = textBox->GetTextDrawRect(*mpLayout->getDrawInfo()); if (bounds.right - bounds.left < width && -1.0f * (bounds.bottom - bounds.top) < height) { break; -- 2.49.1