feat(component): load underwear textures when setting skin color

This commit is contained in:
fallenoak 2025-10-23 16:57:36 -05:00
parent 3e011c91f6
commit 84d6bdac05
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D

View File

@ -666,7 +666,32 @@ void CCharacterComponent::SetSkinColor(int32_t skinColorID, bool a3, bool a4, co
);
if (skinColorID < numColors && sectionsRec && !(sectionsRec->m_flags & 0x8)) {
// TODO underwear
auto underwearRec = this->GetSectionsRecord(VARIATION_UNDERWEAR, 0, skinColorID, nullptr);
auto t0 = TEXTURE_INDEX(VARIATION_UNDERWEAR, 0);
auto t1 = TEXTURE_INDEX(VARIATION_UNDERWEAR, 1);
if (this->m_texture[t0]) {
TextureCacheDestroyTexture(this->m_texture[t0]);
this->m_texture[t0] = nullptr;
}
if (this->m_texture[t1]) {
TextureCacheDestroyTexture(this->m_texture[t1]);
this->m_texture[t1] = nullptr;
}
if (*underwearRec->m_textureName[0]) {
SStrCopy(s_pathEnd, underwearRec->m_textureName[0]);
this->m_texture[t0] = TextureCacheCreateTexture(s_path);
STORM_ASSERT(this->m_texture[t0]);
}
if (*underwearRec->m_textureName[1]) {
SStrCopy(s_pathEnd, underwearRec->m_textureName[1]);
this->m_texture[t1] = TextureCacheCreateTexture(s_path);
STORM_ASSERT(this->m_texture[t1]);
}
}
this->ReplaceExtraSkinTexture(a5);