diff --git a/LEGO1/lego/sources/roi/legolod.cpp b/LEGO1/lego/sources/roi/legolod.cpp index ee1006ac..4e7cc1ef 100644 --- a/LEGO1/lego/sources/roi/legolod.cpp +++ b/LEGO1/lego/sources/roi/legolod.cpp @@ -15,6 +15,9 @@ DECOMP_SIZE_ASSERT(LegoLOD::Mesh, 0x08) // GLOBAL: LEGO1 0x101013d4 LPDIRECT3DRMMATERIAL g_unk0x101013d4 = NULL; +// GLOBAL: LEGO1 0x101013dc +const char* g_unk0x101013dc = "inh"; + inline IDirect3DRM2* GetD3DRM(Tgl::Renderer* pRenderer); 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; } -// STUB: LEGO1 0x100aa450 +// FUNCTION: LEGO1 0x100aa450 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 @@ -297,10 +311,15 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text return FAILURE; } -// STUB: LEGO1 0x100aae20 -LegoBool LegoLOD::FUN_100aae20(const LegoChar*) +// FUNCTION: LEGO1 0x100aae20 +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; } diff --git a/LEGO1/lego/sources/roi/legolod.h b/LEGO1/lego/sources/roi/legolod.h index 34f4c124..92ad3515 100644 --- a/LEGO1/lego/sources/roi/legolod.h +++ b/LEGO1/lego/sources/roi/legolod.h @@ -29,7 +29,7 @@ class LegoLOD : public ViewLOD { 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 // LegoLOD::`scalar deleting destructor'