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

@@ -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)
{