diff --git a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp index 3a8842a5..a5f64321 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworldpresenter.cpp @@ -342,15 +342,15 @@ MxResult LegoWorldPresenter::FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile) // FUNCTION: LEGO1 0x100674b0 MxResult LegoWorldPresenter::FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world) { - MxU8* buff = new MxU8[p_model.m_unk0x04]; + MxU8* buff = new MxU8[p_model.m_modelDataLength]; - fseek(p_wdbFile, p_model.m_unk0x08, SEEK_SET); - if (fread(buff, p_model.m_unk0x04, 1, p_wdbFile) != 1) { + fseek(p_wdbFile, p_model.m_modelDataOffset, SEEK_SET); + if (fread(buff, p_model.m_modelDataLength, 1, p_wdbFile) != 1) { return FAILURE; } MxDSChunk chunk; - chunk.SetLength(p_model.m_unk0x04); + chunk.SetLength(p_model.m_modelDataLength); chunk.SetData(buff); MxDSAction action; diff --git a/LEGO1/modeldb/modeldb.cpp b/LEGO1/modeldb/modeldb.cpp index c56e62b7..66958e73 100644 --- a/LEGO1/modeldb/modeldb.cpp +++ b/LEGO1/modeldb/modeldb.cpp @@ -28,10 +28,10 @@ MxResult ModelDbModel::Read(FILE* p_file) return FAILURE; } - if (fread(&m_unk0x04, sizeof(m_unk0x04), 1, p_file) != 1) { + if (fread(&m_modelDataLength, sizeof(m_modelDataLength), 1, p_file) != 1) { return FAILURE; } - if (fread(&m_unk0x08, sizeof(m_unk0x08), 1, p_file) != 1) { + if (fread(&m_modelDataOffset, sizeof(m_modelDataOffset), 1, p_file) != 1) { return FAILURE; } if (fread(&len, sizeof(len), 1, p_file) != 1) { diff --git a/LEGO1/modeldb/modeldb.h b/LEGO1/modeldb/modeldb.h index 911832e5..02642926 100644 --- a/LEGO1/modeldb/modeldb.h +++ b/LEGO1/modeldb/modeldb.h @@ -94,14 +94,14 @@ struct ModelDbModel { void Free(); MxResult Read(FILE* p_file); - char* m_modelName; // 0x00 - undefined4 m_unk0x04; // 0x04 - undefined4 m_unk0x08; // 0x08 - char* m_presenterName; // 0x0c - float m_location[3]; // 0x10 - float m_direction[3]; // 0x1c - float m_up[3]; // 0x28 - undefined m_unk0x34; // 0x34 + char* m_modelName; // 0x00 + MxU32 m_modelDataLength; // 0x04 + MxU32 m_modelDataOffset; // 0x08 + char* m_presenterName; // 0x0c + float m_location[3]; // 0x10 + float m_direction[3]; // 0x1c + float m_up[3]; // 0x28 + undefined m_unk0x34; // 0x34 }; // SIZE 0x18