mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-29 03:01:15 +00:00
Match
This commit is contained in:
parent
b6ce02064a
commit
aa835e16d7
@ -248,29 +248,29 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
comp = new CompoundObject();
|
comp = new CompoundObject();
|
||||||
roi->SetComp(comp);
|
roi->SetComp(comp);
|
||||||
|
|
||||||
for (j = 0; j < _countof(g_characterLODs) - 1; j++) {
|
for (i = 0; i < _countof(g_characterLODs) - 1; i++) {
|
||||||
ViewLODList *lodList, *dupLodList;
|
ViewLODList *lodList, *dupLodList;
|
||||||
LegoROI* childROI;
|
LegoROI* childROI;
|
||||||
MxS32 lodSize;
|
MxS32 lodSize;
|
||||||
const char* parentName;
|
const char* parentName;
|
||||||
char lodName[64];
|
char lodName[64];
|
||||||
|
|
||||||
LegoCharacterData::Part& part = characterData->m_parts[j];
|
LegoCharacterData::Part& part = characterData->m_parts[i];
|
||||||
|
|
||||||
if (j == 0 || j == 1) {
|
if (i == 0 || i == 1) {
|
||||||
parentName = part.m_unk0x04[part.m_unk0x00[part.m_unk0x08]];
|
parentName = part.m_unk0x04[part.m_unk0x00[part.m_unk0x08]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parentName = g_characterLODs[j + 1].m_parentName;
|
parentName = g_characterLODs[i + 1].m_parentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
lodList = lodManager->Lookup(parentName);
|
lodList = lodManager->Lookup(parentName);
|
||||||
lodSize = lodList->Size();
|
lodSize = lodList->Size();
|
||||||
sprintf(lodName, "%s%d", p_key, j);
|
sprintf(lodName, "%s%d", p_key, i);
|
||||||
dupLodList = lodManager->Create(lodName, lodSize);
|
dupLodList = lodManager->Create(lodName, lodSize);
|
||||||
|
|
||||||
for (MxS32 k = 0; k < lodSize; k++) {
|
for (j = 0; j < lodSize; j++) {
|
||||||
dupLodList->PushBack(((LegoLOD*) (*lodList)[k])->Clone(renderer));
|
dupLodList->PushBack(((LegoLOD*) (*lodList)[j])->Clone(renderer));
|
||||||
}
|
}
|
||||||
|
|
||||||
lodList->Release();
|
lodList->Release();
|
||||||
@ -279,35 +279,35 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
childROI = new LegoROI(renderer, lodList);
|
childROI = new LegoROI(renderer, lodList);
|
||||||
lodList->Release();
|
lodList->Release();
|
||||||
|
|
||||||
childROI->SetName(g_characterLODs[j + 1].m_name);
|
childROI->SetName(g_characterLODs[i + 1].m_name);
|
||||||
childROI->SetParentROI(roi);
|
childROI->SetParentROI(roi);
|
||||||
|
|
||||||
BoundingSphere childBoundingSphere;
|
BoundingSphere childBoundingSphere;
|
||||||
childBoundingSphere.Center()[0] = g_characterLODs[j + 1].m_boundingSphere[0];
|
childBoundingSphere.Center()[0] = g_characterLODs[i + 1].m_boundingSphere[0];
|
||||||
childBoundingSphere.Center()[1] = g_characterLODs[j + 1].m_boundingSphere[1];
|
childBoundingSphere.Center()[1] = g_characterLODs[i + 1].m_boundingSphere[1];
|
||||||
childBoundingSphere.Center()[2] = g_characterLODs[j + 1].m_boundingSphere[2];
|
childBoundingSphere.Center()[2] = g_characterLODs[i + 1].m_boundingSphere[2];
|
||||||
childBoundingSphere.Radius() = g_characterLODs[j + 1].m_boundingSphere[3];
|
childBoundingSphere.Radius() = g_characterLODs[i + 1].m_boundingSphere[3];
|
||||||
childROI->SetBoundingSphere(childBoundingSphere);
|
childROI->SetBoundingSphere(childBoundingSphere);
|
||||||
|
|
||||||
BoundingBox childBoundingBox;
|
BoundingBox childBoundingBox;
|
||||||
childBoundingBox.Min()[0] = g_characterLODs[j + 1].m_boundingBox[0];
|
childBoundingBox.Min()[0] = g_characterLODs[i + 1].m_boundingBox[0];
|
||||||
childBoundingBox.Min()[1] = g_characterLODs[j + 1].m_boundingBox[1];
|
childBoundingBox.Min()[1] = g_characterLODs[i + 1].m_boundingBox[1];
|
||||||
childBoundingBox.Min()[2] = g_characterLODs[j + 1].m_boundingBox[2];
|
childBoundingBox.Min()[2] = g_characterLODs[i + 1].m_boundingBox[2];
|
||||||
childBoundingBox.Max()[0] = g_characterLODs[j + 1].m_boundingBox[3];
|
childBoundingBox.Max()[0] = g_characterLODs[i + 1].m_boundingBox[3];
|
||||||
childBoundingBox.Max()[1] = g_characterLODs[j + 1].m_boundingBox[4];
|
childBoundingBox.Max()[1] = g_characterLODs[i + 1].m_boundingBox[4];
|
||||||
childBoundingBox.Max()[2] = g_characterLODs[j + 1].m_boundingBox[5];
|
childBoundingBox.Max()[2] = g_characterLODs[i + 1].m_boundingBox[5];
|
||||||
childROI->SetUnknown0x80(childBoundingBox);
|
childROI->SetUnknown0x80(childBoundingBox);
|
||||||
|
|
||||||
CalcLocalTransform(
|
CalcLocalTransform(
|
||||||
Mx3DPointFloat(g_characterLODs[j + 1].m_position),
|
Mx3DPointFloat(g_characterLODs[i + 1].m_position),
|
||||||
Mx3DPointFloat(g_characterLODs[j + 1].m_direction),
|
Mx3DPointFloat(g_characterLODs[i + 1].m_direction),
|
||||||
Mx3DPointFloat(g_characterLODs[j + 1].m_up),
|
Mx3DPointFloat(g_characterLODs[i + 1].m_up),
|
||||||
mat
|
mat
|
||||||
);
|
);
|
||||||
childROI->WrappedSetLocalTransform(mat);
|
childROI->WrappedSetLocalTransform(mat);
|
||||||
|
|
||||||
if (g_characterLODs[j + 1].m_flags & LegoCharacterLOD::c_flag1 &&
|
if (g_characterLODs[i + 1].m_flags & LegoCharacterLOD::c_flag1 &&
|
||||||
(j != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
|
(i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
|
||||||
|
|
||||||
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
childROI->FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
|
childROI->FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (g_characterLODs[j + 1].m_flags & LegoCharacterLOD::c_flag2 || (j == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
|
else if (g_characterLODs[i + 1].m_flags & LegoCharacterLOD::c_flag2 || (i == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
|
||||||
LegoFloat red, green, blue, alpha;
|
LegoFloat red, green, blue, alpha;
|
||||||
childROI->FUN_100a9bf0(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
|
childROI->FUN_100a9bf0(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
|
||||||
childROI->FUN_100a9170(red, green, blue, alpha);
|
childROI->FUN_100a9170(red, green, blue, alpha);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user