diff --git a/src/component/CCharacterComponent.cpp b/src/component/CCharacterComponent.cpp index baea4ca..f6b4045 100644 --- a/src/component/CCharacterComponent.cpp +++ b/src/component/CCharacterComponent.cpp @@ -654,6 +654,21 @@ void CCharacterComponent::UpdateBaseTexture(EGxTexCommand cmd, uint32_t width, u } } +void CCharacterComponent::ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority) { + if (priority == -1) { + return; + } + + if (this->m_itemDisplays[section].texture[priority]) { + TextureCacheDestroyTexture(this->m_itemDisplays[section].texture[priority]); + this->m_itemDisplays[section].texture[priority] = nullptr; + } + + this->m_itemDisplays[section].displayID[priority] = 0; + + this->m_itemDisplays[section].priorityDirty &= ~(1 << priority); +} + void CCharacterComponent::CreateBaseTexture() { auto dataFormat = this->m_textureFormat == GxTex_Dxt1 ? GxTex_Dxt1 diff --git a/src/component/CCharacterComponent.hpp b/src/component/CCharacterComponent.hpp index e3fb036..7015e1f 100644 --- a/src/component/CCharacterComponent.hpp +++ b/src/component/CCharacterComponent.hpp @@ -80,6 +80,7 @@ class CCharacterComponent { ComponentItemDisplay m_itemDisplays[NUM_COMPONENT_SECTIONS] = {}; // Member functions + void ClearItemDisplay(COMPONENT_SECTIONS section, int32_t priority); void CreateBaseTexture(); void GeosRenderPrep(); CharSectionsRec* GetSectionsRecord(COMPONENT_VARIATIONS sectionIndex, int32_t variationIndex, int32_t colorIndex, bool* found);