mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 10:41:15 +00:00
Match
This commit is contained in:
parent
2c08701ad9
commit
945d809e46
@ -114,12 +114,13 @@ LegoResult LegoROI::Read(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
LegoResult result = FAILURE;
|
LegoResult result = FAILURE;
|
||||||
LegoU32 i;
|
LegoU32 i, j;
|
||||||
LegoU32 numLODs;
|
LegoU32 numLODs, surplusLODs;
|
||||||
LegoROI* roi;
|
LegoROI* roi;
|
||||||
LegoLOD* lod;
|
LegoLOD* lod;
|
||||||
LegoU32 length;
|
LegoU32 length, roiLength;
|
||||||
LegoChar* textureName;
|
LegoChar *roiName, *textureName;
|
||||||
|
LegoTextureInfo* textureInfo;
|
||||||
ViewLODList* lodList;
|
ViewLODList* lodList;
|
||||||
LegoU32 numROIs;
|
LegoU32 numROIs;
|
||||||
LegoSphere sphere;
|
LegoSphere sphere;
|
||||||
@ -173,14 +174,12 @@ LegoResult LegoROI::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_unk0x100) {
|
if (m_unk0x100) {
|
||||||
LegoU32 roiLength; // TODO
|
|
||||||
|
|
||||||
for (roiLength = strlen(m_name); roiLength; roiLength--) {
|
for (roiLength = strlen(m_name); roiLength; roiLength--) {
|
||||||
if (m_name[roiLength - 1] < '0' || m_name[roiLength - 1] > '9')
|
if (m_name[roiLength - 1] < '0' || m_name[roiLength - 1] > '9')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoChar* roiName = new LegoChar[roiLength + 1];
|
roiName = new LegoChar[roiLength + 1];
|
||||||
memcpy(roiName, m_name, roiLength);
|
memcpy(roiName, m_name, roiLength);
|
||||||
roiName[roiLength] = '\0';
|
roiName[roiLength] = '\0';
|
||||||
|
|
||||||
@ -207,7 +206,6 @@ LegoResult LegoROI::Read(
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoU32 surplusLODs;
|
|
||||||
if (numLODs > g_roiConfig) {
|
if (numLODs > g_roiConfig) {
|
||||||
surplusLODs = numLODs - g_roiConfig;
|
surplusLODs = numLODs - g_roiConfig;
|
||||||
numLODs = g_roiConfig;
|
numLODs = g_roiConfig;
|
||||||
@ -216,7 +214,7 @@ LegoResult LegoROI::Read(
|
|||||||
surplusLODs = 0;
|
surplusLODs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_roiConfig < 3) {
|
if (g_roiConfig <= 2) {
|
||||||
for (i = 0; g_unk0x10101380[i] != NULL; i++) {
|
for (i = 0; g_unk0x10101380[i] != NULL; i++) {
|
||||||
if (!strnicmp(m_name, g_unk0x10101380[i], 4)) {
|
if (!strnicmp(m_name, g_unk0x10101380[i], 4)) {
|
||||||
roiName = g_unk0x10101380[i];
|
roiName = g_unk0x10101380[i];
|
||||||
@ -234,7 +232,6 @@ LegoResult LegoROI::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((lodList = p_viewLODListManager->Lookup(roiName))) {
|
if ((lodList = p_viewLODListManager->Lookup(roiName))) {
|
||||||
LegoU32 j;
|
|
||||||
for (j = 0; g_unk0x10101390[j] != NULL; j++) {
|
for (j = 0; g_unk0x10101390[j] != NULL; j++) {
|
||||||
if (!strcmpi(g_unk0x10101390[j], roiName)) {
|
if (!strcmpi(g_unk0x10101390[j], roiName)) {
|
||||||
break;
|
break;
|
||||||
@ -253,7 +250,7 @@ LegoResult LegoROI::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (j == 0) {
|
if (j == 0) {
|
||||||
if (surplusLODs != 0 && lod->GetUnknown0x0cTest()) {
|
if (surplusLODs != 0 && lod->GetUnknown0x08Test()) {
|
||||||
numLODs++;
|
numLODs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,7 +267,7 @@ LegoResult LegoROI::Read(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
if (surplusLODs != 0 && lod->GetUnknown0x0cTest()) {
|
if (surplusLODs != 0 && lod->GetUnknown0x08Test()) {
|
||||||
numLODs++;
|
numLODs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,7 +292,7 @@ LegoResult LegoROI::Read(
|
|||||||
|
|
||||||
if (textureName != NULL) {
|
if (textureName != NULL) {
|
||||||
if (!strnicmp(textureName, "t_", 2)) {
|
if (!strnicmp(textureName, "t_", 2)) {
|
||||||
LegoTextureInfo* textureInfo = p_textureContainer->Get(textureName + 2);
|
textureInfo = p_textureContainer->Get(textureName + 2);
|
||||||
|
|
||||||
if (textureInfo == NULL) {
|
if (textureInfo == NULL) {
|
||||||
goto done;
|
goto done;
|
||||||
|
|||||||
@ -28,8 +28,6 @@ class LegoLOD : public ViewLOD {
|
|||||||
|
|
||||||
LegoResult Read(Tgl::Renderer*, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage);
|
LegoResult Read(Tgl::Renderer*, LegoTextureContainer* p_textureContainer, LegoStorage* p_storage);
|
||||||
|
|
||||||
inline LegoBool GetUnknown0x0cTest() { return m_unk0x0c & 0xffffff08; }
|
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100aa430
|
// SYNTHETIC: LEGO1 0x100aa430
|
||||||
// LegoLOD::`scalar deleting destructor'
|
// LegoLOD::`scalar deleting destructor'
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@ class ViewLOD : public LODObject {
|
|||||||
|
|
||||||
Tgl::Group* GetGeometry() { return m_meshGroup; }
|
Tgl::Group* GetGeometry() { return m_meshGroup; }
|
||||||
const Tgl::Group* GetGeometry() const { return m_meshGroup; }
|
const Tgl::Group* GetGeometry() const { return m_meshGroup; }
|
||||||
|
unsigned char GetUnknown0x08Test() { return m_unk0x08 & 0xffffff08; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100a6f60
|
// SYNTHETIC: LEGO1 0x100a6f60
|
||||||
// ViewLOD::`scalar deleting destructor'
|
// ViewLOD::`scalar deleting destructor'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user