From 1ee0f862e1ff304bcc3e6130319bbef635675be1 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 2 May 2026 11:44:33 -0700 Subject: [PATCH] map highlight fix --- extern/aurora | 2 +- .../include/JSystem/JUtility/JUTPalette.h | 3 +++ .../include/JSystem/JUtility/JUTTexture.h | 5 +++-- libs/JSystem/src/JUtility/JUTPalette.cpp | 6 ++++++ libs/JSystem/src/JUtility/JUTTexture.cpp | 18 +++++++++--------- src/d/d_menu_fmap2D.cpp | 5 +++++ 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/extern/aurora b/extern/aurora index 1119435dd1..41d5c9c5a2 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 1119435dd1bbd28c43941f4b5f9b51e24a8a1146 +Subproject commit 41d5c9c5a2462f57105356ae578d9246e37f6ef2 diff --git a/libs/JSystem/include/JSystem/JUtility/JUTPalette.h b/libs/JSystem/include/JSystem/JUtility/JUTPalette.h index 017d511d50..5d29005a92 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTPalette.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTPalette.h @@ -40,6 +40,9 @@ public: JUTTransparency getTransparency() const { return JUTTransparency(mTransparency); } u16 getNumColors() const { return mNumColors; } ResTLUT* getColorTable() const { return mColorTable; } +#if TARGET_PC + void dataUploaded(); +#endif private: /* 0x00 */ GXTlutObj mTlutObj; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTTexture.h b/libs/JSystem/include/JSystem/JUtility/JUTTexture.h index e0f1e15ff0..6a7a8f9a0e 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTTexture.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTTexture.h @@ -75,6 +75,7 @@ public: s32 getTransparency() const { return mTexInfo->alphaEnabled; } s32 getWidth() const { return mTexInfo->width; } s32 getHeight() const { return mTexInfo->height; } + JUTPalette* getPalette() const { return mPalette; } void setCaptureFlag(bool flag) { mFlags &= 2 | flag; } bool getCaptureFlag() const { return mFlags & 1; } bool getEmbPaletteDelFlag() const { return mFlags & 2; } @@ -82,7 +83,7 @@ public: int getTlutName() const { return mTlutName; } bool operator==(const JUTTexture& other) { return mTexInfo == other.mTexInfo - && field_0x2c == other.field_0x2c + && mPalette == other.mPalette && mWrapS == other.mWrapS && mWrapT == other.mWrapT && mMinFilter == other.mMinFilter @@ -100,7 +101,7 @@ private: /* 0x20 */ const ResTIMG* mTexInfo; /* 0x24 */ void* mTexData; /* 0x28 */ JUTPalette* mEmbPalette; - /* 0x2C */ JUTPalette* field_0x2c; + /* 0x2C */ JUTPalette* mPalette; /* 0x30 */ u8 mWrapS; /* 0x31 */ u8 mWrapT; /* 0x32 */ u8 mMinFilter; diff --git a/libs/JSystem/src/JUtility/JUTPalette.cpp b/libs/JSystem/src/JUtility/JUTPalette.cpp index d98bf98c2e..9c8a51432c 100644 --- a/libs/JSystem/src/JUtility/JUTPalette.cpp +++ b/libs/JSystem/src/JUtility/JUTPalette.cpp @@ -38,3 +38,9 @@ bool JUTPalette::load() { return check; } + +#if TARGET_PC +void JUTPalette::dataUploaded() { + GXInitTlutObjData(&mTlutObj, (void*)mColorTable); +} +#endif diff --git a/libs/JSystem/src/JUtility/JUTTexture.cpp b/libs/JSystem/src/JUtility/JUTTexture.cpp index 060c581e80..1d799c2820 100644 --- a/libs/JSystem/src/JUtility/JUTTexture.cpp +++ b/libs/JSystem/src/JUtility/JUTTexture.cpp @@ -27,7 +27,7 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, u8 param_1) { mTexData = (void*)((intptr_t)mTexInfo + 0x20); } - field_0x2c = NULL; + mPalette = NULL; mTlutName = 0; mWrapS = mTexInfo->wrapS; mWrapT = mTexInfo->wrapT; @@ -95,7 +95,7 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, JUTPalette* param_1, GXTlut p } mEmbPalette = param_1; setEmbPaletteDelFlag(false); - field_0x2c = NULL; + mPalette = NULL; if (param_1 != NULL) { mTlutName = param_2; if (param_2 != param_1->getTlutName()) { @@ -120,11 +120,11 @@ void JUTTexture::storeTIMG(ResTIMG const* param_0, JUTPalette* param_1, GXTlut p void JUTTexture::attachPalette(JUTPalette* param_0) { if (mTexInfo->indexTexture) { if (param_0 == NULL && mEmbPalette != NULL) { - field_0x2c = mEmbPalette; + mPalette = mEmbPalette; } else { - field_0x2c = param_0; + mPalette = param_0; } - initTexObj(field_0x2c->getTlutName()); + initTexObj(mPalette->getTlutName()); } } @@ -133,9 +133,9 @@ void JUTTexture::init() { initTexObj(); } else { if (mEmbPalette != NULL) { - field_0x2c = mEmbPalette; + mPalette = mEmbPalette; - initTexObj(field_0x2c->getTlutName()); + initTexObj(mPalette->getTlutName()); } else { OS_REPORT("This texture is CI-Format, but EmbPalette is NULL.\n"); } @@ -179,8 +179,8 @@ void JUTTexture::initTexObj(GXTlut param_0) { } void JUTTexture::load(GXTexMapID param_0) { - if (field_0x2c) { - field_0x2c->load(); + if (mPalette) { + mPalette->load(); } GXLoadTexObj(&mTexObj, param_0); } diff --git a/src/d/d_menu_fmap2D.cpp b/src/d/d_menu_fmap2D.cpp index f01ef2a10d..ea9912998b 100644 --- a/src/d/d_menu_fmap2D.cpp +++ b/src/d/d_menu_fmap2D.cpp @@ -1420,6 +1420,11 @@ void dMenu_Fmap2DBack_c::stageTextureDraw() { mpSpotTexture->setAlpha(mAlphaRate * 255.0f * field_0xfa8 * mSpotTextureFadeAlpha); } +#if TARGET_PC + JUTPalette* pPalette = mpSpotTexture->getTexture(0)->getPalette(); + pPalette->dataUploaded(); +#endif + mpSpotTexture->draw(mTransX + getMapScissorAreaLX(), mTransZ + getMapScissorAreaLY(), getMapScissorAreaSizeRealX(), getMapScissorAreaSizeRealY(), false, false, false);