From 2679b7d02bd140989a476de9caee1616502ede2b Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Mon, 16 Mar 2026 16:27:38 -0400 Subject: [PATCH] Fix crashes due to current texture not being set before loading (#61, #95) --- src/d/actor/d_a_mirror.cpp | 3 +++ src/m_Do/m_Do_ext.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/d/actor/d_a_mirror.cpp b/src/d/actor/d_a_mirror.cpp index b66a095d5c..5468d70f87 100644 --- a/src/d/actor/d_a_mirror.cpp +++ b/src/d/actor/d_a_mirror.cpp @@ -208,6 +208,9 @@ void dMirror_packet_c::modelDraw(J3DModel* i_model, Mtx param_1) { color.a = kankyo->bg_amb_col[0].a; J3DModelData* modelData = i_model->getModelData(); +#if TARGET_PC + j3dSys.setTexture(modelData->getTexture()); +#endif u16 materialNum = modelData->getMaterialNum(); for (u16 i = 0; i < materialNum; i++) { J3DMatPacket* matPacket = i_model->getMatPacket(i); diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index 85d708a1e1..fc0e6d71c3 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -2199,6 +2199,9 @@ void mDoExt_invJntPacket::draw() { if (field_0x16) { J3DModelData* sp20 = field_0x10->getModelData(); +#if TARGET_PC + j3dSys.setTexture(sp20->getTexture()); +#endif J3DJoint* sp1C = sp20->getJointNodePointer(field_0x14); for (J3DMaterial* mesh = sp1C->getMesh(); mesh != NULL; mesh = mesh->getNext()) {