mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(component): add CCharacterComponent::UpdateItemDisplay
This commit is contained in:
parent
86f902423b
commit
ea51e2e20f
@ -1146,6 +1146,35 @@ void CCharacterComponent::SetSkinColor(int32_t skinColorID, bool a3, bool a4, co
|
||||
this->m_flags &= ~0x8;
|
||||
}
|
||||
|
||||
int32_t CCharacterComponent::UpdateItemDisplay(COMPONENT_SECTIONS section, const ItemDisplayInfoRec* newDisplayRec, int32_t priority) {
|
||||
bool isNPC = this->m_data.flags & 0x1;
|
||||
|
||||
if (isNPC) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (this->m_itemDisplays[section].displayID[priority]) {
|
||||
auto curDisplayID = this->m_itemDisplays[section].displayID[priority];
|
||||
auto curDisplayRec = g_itemDisplayInfoDB.GetRecord(curDisplayID);
|
||||
|
||||
// New display is same as old display
|
||||
if (curDisplayRec && curDisplayRec->m_texture[section] == newDisplayRec->m_texture[section]) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
this->m_itemDisplays[section].priorityDirty &= ~(1 << priority);
|
||||
|
||||
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] = newDisplayRec->m_ID;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t CCharacterComponent::VariationsLoaded(int32_t a2) {
|
||||
TCTEXTUREINFO info;
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
class CACHEENTRY;
|
||||
class CCharacterComponent;
|
||||
class CharSectionsRec;
|
||||
class ItemDisplayInfoRec;
|
||||
|
||||
struct BlpPalPixel;
|
||||
struct MipBits;
|
||||
@ -96,6 +97,7 @@ class CCharacterComponent {
|
||||
void SetHairColor(int32_t hairColorID, bool a3, const char* a4);
|
||||
void SetHairStyle(int32_t hairStyleID, const char* a3);
|
||||
void SetSkinColor(int32_t skinColorID, bool a3, bool a4, const char* a5);
|
||||
int32_t UpdateItemDisplay(COMPONENT_SECTIONS section, const ItemDisplayInfoRec* newDisplayRec, int32_t priority);
|
||||
int32_t VariationsLoaded(int32_t a2);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user