Implement/match LegoROI/LegoLOD::GetTexture (#814)

* Implement/match LegoROI/LegoLOD::GetTexture

* Remove explicit truth tests

* LegoTextureContainer::AddToList fix

* Revert "Remove explicit truth tests"

This reverts commit d169349bd6.
This commit is contained in:
Christian Semmler
2024-04-17 09:18:34 -04:00
committed by GitHub
parent a64bb4d460
commit 06fadd922e
7 changed files with 67 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ public:
static LegoTextureInfo* Create(const char* p_name, LegoTexture* p_texture);
static BOOL SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textureInfo);
static BOOL GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_textureInfo);
LegoResult FUN_10066010(LegoU8* p_bits);
@@ -27,4 +28,7 @@ public:
LPDIRECT3DRMTEXTURE2 m_texture; // 0x0c
};
// GLOBAL: LEGO1 0x100db6f0
// IID_IDirect3DRMTexture2
#endif // LEGOTEXTUREINFO_H

View File

@@ -160,6 +160,30 @@ BOOL LegoTextureInfo::SetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo* p_textu
return TRUE;
}
// FUNCTION: LEGO1 0x10065f90
BOOL LegoTextureInfo::GetGroupTexture(Tgl::Mesh* pMesh, LegoTextureInfo*& p_textureInfo)
{
TglImpl::MeshImpl::MeshData* data = ((TglImpl::MeshImpl*) pMesh)->ImplementationData();
IDirect3DRMMesh* mesh = data->groupMesh;
D3DRMGROUPINDEX id = data->groupIndex;
LPDIRECT3DRMTEXTURE returnPtr = NULL;
LPDIRECT3DRMTEXTURE2 texture = NULL;
if (mesh->GetGroupTexture(id, &returnPtr) == D3DRM_OK) {
if (returnPtr->QueryInterface(IID_IDirect3DRMTexture2, (LPVOID*) &texture) == D3DRM_OK) {
p_textureInfo = (LegoTextureInfo*) texture->GetAppData();
texture->Release();
returnPtr->Release();
}
return TRUE;
}
return FALSE;
}
// STUB: LEGO1 0x10066010
LegoResult LegoTextureInfo::FUN_10066010(LegoU8* p_bits)
{