Implement/match remaining LegoLOD functions (#636)

* Implement/match remaining LegoLOD functions

* Add param name
This commit is contained in:
Christian Semmler 2024-03-08 12:03:26 -05:00 committed by GitHub
parent 873926afe2
commit 45cba2c00e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 6 deletions

View file

@ -15,6 +15,9 @@ DECOMP_SIZE_ASSERT(LegoLOD::Mesh, 0x08)
// GLOBAL: LEGO1 0x101013d4 // GLOBAL: LEGO1 0x101013d4
LPDIRECT3DRMMATERIAL g_unk0x101013d4 = NULL; LPDIRECT3DRMMATERIAL g_unk0x101013d4 = NULL;
// GLOBAL: LEGO1 0x101013dc
const char* g_unk0x101013dc = "inh";
inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer); inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer);
inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh); inline BOOL GetMeshData(IDirect3DRMMesh*& mesh, D3DRMGROUPINDEX& index, Tgl::Mesh* pMesh);
@ -41,10 +44,21 @@ LegoLOD::LegoLOD(Tgl::Renderer* p_renderer) : ViewLOD(p_renderer)
m_unk0x1c = 0; m_unk0x1c = 0;
} }
// STUB: LEGO1 0x100aa450 // FUNCTION: LEGO1 0x100aa450
LegoLOD::~LegoLOD() LegoLOD::~LegoLOD()
{ {
// TODO if (m_numMeshes && m_meshes != NULL) {
for (LegoU32 i = 0; i < m_numMeshes; i++) {
if (m_meshes[i].m_tglMesh != NULL) {
delete m_meshes[i].m_tglMesh;
m_meshes[i].m_tglMesh = NULL;
}
}
}
if (m_meshes) {
delete[] m_meshes;
}
} }
// FUNCTION: LEGO1 0x100aa510 // FUNCTION: LEGO1 0x100aa510
@ -297,10 +311,15 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
return FAILURE; return FAILURE;
} }
// STUB: LEGO1 0x100aae20 // FUNCTION: LEGO1 0x100aae20
LegoBool LegoLOD::FUN_100aae20(const LegoChar*) LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
{ {
// TODO if (p_name != NULL) {
if (!strnicmp(p_name, g_unk0x101013dc, strlen(g_unk0x101013dc))) {
return TRUE;
}
}
return FALSE; return FALSE;
} }

View file

@ -29,7 +29,7 @@ class LegoLOD : public ViewLOD {
LegoResult Read(Tgl::Renderer*, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage); LegoResult Read(Tgl::Renderer*, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage);
static LegoBool FUN_100aae20(const LegoChar*); static LegoBool FUN_100aae20(const LegoChar* p_name);
// SYNTHETIC: LEGO1 0x100aa430 // SYNTHETIC: LEGO1 0x100aa430
// LegoLOD::`scalar deleting destructor' // LegoLOD::`scalar deleting destructor'