From 89927dc7a638342f2a9a79511e2445789fb62006 Mon Sep 17 00:00:00 2001 From: MelonSpeedruns Date: Wed, 29 Apr 2026 15:51:57 -0400 Subject: [PATCH] Fix changing tunics while reflection is active --- include/d/actor/d_a_mirror.h | 3 --- src/d/actor/d_a_mirror.cpp | 36 +++++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/include/d/actor/d_a_mirror.h b/include/d/actor/d_a_mirror.h index 06c5603899..fd69c8682e 100644 --- a/include/d/actor/d_a_mirror.h +++ b/include/d/actor/d_a_mirror.h @@ -25,9 +25,6 @@ public: /* 0x164 */ cXyz mMinVal; /* 0x170 */ cXyz mMaxVal; /* 0x17C */ cXyz mViewScale; -#if TARGET_PC - bool mbReset = false; -#endif }; /** diff --git a/src/d/actor/d_a_mirror.cpp b/src/d/actor/d_a_mirror.cpp index 86ef4314f3..5ec7924722 100644 --- a/src/d/actor/d_a_mirror.cpp +++ b/src/d/actor/d_a_mirror.cpp @@ -38,11 +38,7 @@ dMirror_packet_c::dMirror_packet_c() { } void dMirror_packet_c::reset() { -#if TARGET_PC - mbReset = true; -#else mModelCount = 0; -#endif } void dMirror_packet_c::calcMinMax() { @@ -592,13 +588,6 @@ int daMirror_c::execute() { return 1; } -#if TARGET_PC - if (mPacket.mbReset) { - mPacket.mModelCount = 0; - mPacket.mbReset = false; - } -#endif - daPy_py_c* player = daPy_getLinkPlayerActorClass(); JUT_ASSERT(0, player != NULL); @@ -613,7 +602,32 @@ int daMirror_c::execute() { return 1; } +#if TARGET_PC +static void daMirror_interp_callback(bool isSimFrame, void* pUserWork) { + daMirror_c* mirror = static_cast(pUserWork); + if (mirror == NULL || mirror->mpModel == NULL) { + return; + } + + if (mirror != daMirror_c::m_myObj) { + return; + } + + if (mirror->mpModel != NULL) { + g_env_light.settingTevStruct(0x10, &mirror->current.pos, &mirror->tevStr); + g_env_light.setLightTevColorType(mirror->mpModel, &mirror->tevStr); + mDoExt_modelUpdateDL(mirror->mpModel); + } + + dComIfGd_getOpaListBG()->entryImm(&mirror->mPacket, 0); +} +#endif + int daMirror_c::draw() { +#if TARGET_PC + dusk::frame_interp::add_interpolation_callback(&daMirror_interp_callback, this); +#endif + if (this != daMirror_c::m_myObj) { return 1; }