feat(model): load skin sections in CM2Model::InitializeLoaded

This commit is contained in:
fallenoak 2025-10-13 20:32:08 -05:00
parent d18e8cf608
commit 801fbc43b9
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 19 additions and 1 deletions

View File

@ -990,7 +990,24 @@ int32_t CM2Model::InitializeLoaded() {
}
}
// TODO
if (this->m_shared->skinProfile->skinSections.Count()) {
this->m_skinSections = reinterpret_cast<uint32_t*>(&data[0]);
data += (sizeof(uint32_t) * this->m_shared->skinProfile->skinSections.Count());
if (this->model30) {
memcpy(this->m_skinSections, model30->m_skinSections, sizeof(uint32_t) * this->m_shared->skinProfile->skinSections.Count());
} else {
// Mark all skin sections as visible by default
for (int32_t i = 0; i < this->m_shared->skinProfile->skinSections.Count(); i++) {
auto modelSkinSection = &this->m_skinSections[i];
if (modelSkinSection) {
*modelSkinSection = 1;
}
}
}
}
if (this->m_shared->m_data->colors.Count()) {
this->m_colors = reinterpret_cast<M2ModelColor*>(&data[0]);

View File

@ -99,6 +99,7 @@ class CM2Model {
M2ModelBone* m_bones = nullptr;
C44Matrix* m_boneMatrices = nullptr;
M2ModelColor* m_colors = nullptr;
uint32_t* m_skinSections = nullptr;
HTEXTURE* m_textures = nullptr;
M2ModelTextureWeight* m_textureWeights = nullptr;
C44Matrix* m_textureMatrices = nullptr;