From 4c2f8709a3a3fe0591d2a102d62ef18132ea276c Mon Sep 17 00:00:00 2001 From: Briggs Baltzell Date: Wed, 4 Feb 2026 23:44:25 -0600 Subject: [PATCH] Match `dMCloth_c::lightSet1` --- include/d/d_menu_cloth.h | 4 ++-- src/d/d_menu_cloth.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/d/d_menu_cloth.h b/include/d/d_menu_cloth.h index 1b8f1833b..d9ab145e1 100644 --- a/include/d/d_menu_cloth.h +++ b/include/d/d_menu_cloth.h @@ -88,8 +88,8 @@ public: /* 0x003c */ f32 field_0x3c; /* 0x0040 */ f32 field_0x40; /* 0x0044 */ f32 field_0x44; - /* 0x0048 */ u16 field_0x48; - /* 0x004a */ u16 field_0x4a; + /* 0x0048 */ s16 field_0x48; + /* 0x004a */ s16 field_0x4a; /* 0x004c */ f32 field_0x4c; /* 0x0050 */ u16 field_0x50; /* 0x0054 */ f32 field_0x54; diff --git a/src/d/d_menu_cloth.cpp b/src/d/d_menu_cloth.cpp index 8e7ffab94..291259c3b 100644 --- a/src/d/d_menu_cloth.cpp +++ b/src/d/d_menu_cloth.cpp @@ -124,7 +124,16 @@ daCLOTH_ChildHIO_c::daCLOTH_ChildHIO_c() { /* 801996C4-8019977C .text lightSet1__9dMCloth_cF4cXyz */ void dMCloth_c::lightSet1(cXyz) { - /* Nonmatching */ + GXLightObj light; + const f32 f0 = l_HIO.mChildren[mClothType].field_0x4c; + GXInitLightPos( + &light, + -f0 * cM_ssin(l_HIO.mChildren[mClothType].field_0x4a) * cM_scos(l_HIO.mChildren[mClothType].field_0x48), + -f0 * cM_ssin(l_HIO.mChildren[mClothType].field_0x48), + -f0 * cM_scos(l_HIO.mChildren[mClothType].field_0x4a) * cM_scos(l_HIO.mChildren[mClothType].field_0x48) + ); + GXInitLightColor(&light, (GXColor){0xFF, 0xFF, 0xFF, 0x00}); + GXLoadLightObjImm(&light, GX_LIGHT0); } /* 8019977C-80199CD0 .text cloth_init__9dMCloth_cFv */