mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
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:

committed by
GitHub

parent
a64bb4d460
commit
06fadd922e
@@ -54,7 +54,7 @@ LegoTextureInfo* LegoTextureContainer::AddToList(LegoTextureInfo* p_textureInfo)
|
||||
LegoTextureInfo* textureInfo = new LegoTextureInfo();
|
||||
|
||||
textureInfo->m_palette = p_textureInfo->m_palette;
|
||||
p_textureInfo->m_palette->Release();
|
||||
textureInfo->m_palette->AddRef();
|
||||
|
||||
memset(&newDesc, 0, sizeof(newDesc));
|
||||
newDesc.dwWidth = desc.dwWidth;
|
||||
|
@@ -362,6 +362,20 @@ LegoResult LegoLOD::FUN_100aad70(LegoTextureInfo* p_textureInfo)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aadc0
|
||||
LegoResult LegoLOD::GetTexture(LegoTextureInfo*& p_textureInfo)
|
||||
{
|
||||
for (LegoU32 i = m_unk0x1c; i < m_numMeshes; i++) {
|
||||
if (m_melems[i].m_unk0x04) {
|
||||
if (LegoTextureInfo::GetGroupTexture(m_melems[i].m_tglMesh, p_textureInfo) == TRUE) {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aae20
|
||||
LegoBool LegoLOD::FUN_100aae20(const LegoChar* p_name)
|
||||
{
|
||||
|
@@ -32,6 +32,7 @@ public:
|
||||
LegoResult FUN_100aacb0(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
|
||||
LegoResult FUN_100aad00(LegoTextureInfo* p_textureInfo);
|
||||
LegoResult FUN_100aad70(LegoTextureInfo* p_textureInfo);
|
||||
LegoResult GetTexture(LegoTextureInfo*& p_textureInfo);
|
||||
|
||||
static LegoBool FUN_100aae20(const LegoChar* p_name);
|
||||
|
||||
|
@@ -498,10 +498,29 @@ LegoResult LegoROI::FUN_100a9210(LegoTextureInfo* p_textureInfo)
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100a92a0
|
||||
LegoResult LegoROI::GetTexture(LegoTextureInfo*&)
|
||||
// FUNCTION: LEGO1 0x100a92a0
|
||||
// FUNCTION: BETA10 0x1018b12d
|
||||
LegoResult LegoROI::GetTexture(LegoTextureInfo*& p_textureInfo)
|
||||
{
|
||||
// TODO
|
||||
CompoundObject::iterator it;
|
||||
|
||||
int lodCount = GetLODCount();
|
||||
for (LegoU32 i = 0; i < lodCount; i++) {
|
||||
LegoLOD* lod = (LegoLOD*) GetLOD(i);
|
||||
|
||||
if (lod->GetTexture(p_textureInfo) == SUCCESS) {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (comp != NULL) {
|
||||
for (it = comp->begin(); it != comp->end(); it++) {
|
||||
if (((LegoROI*) *it)->GetTexture(p_textureInfo) == SUCCESS) {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,7 @@ public:
|
||||
LegoResult SetFrame(LegoAnim* p_anim, LegoTime p_time);
|
||||
LegoResult FUN_100a9170(LegoFloat p_red, LegoFloat p_green, LegoFloat p_blue, LegoFloat p_alpha);
|
||||
LegoResult FUN_100a9210(LegoTextureInfo* p_textureInfo);
|
||||
LegoResult GetTexture(LegoTextureInfo*&);
|
||||
LegoResult GetTexture(LegoTextureInfo*& p_textureInfo);
|
||||
LegoU32 FUN_100a9410(Vector3&, Vector3&, float, float, Vector3&, LegoBool);
|
||||
void SetName(const LegoChar* p_name);
|
||||
|
||||
|
Reference in New Issue
Block a user