mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 10:41:15 +00:00
WIP
This commit is contained in:
parent
7306c453a2
commit
a4932b9e7f
@ -8,6 +8,8 @@
|
|||||||
class LegoPartPresenter : public MxMediaPresenter {
|
class LegoPartPresenter : public MxMediaPresenter {
|
||||||
public:
|
public:
|
||||||
LegoPartPresenter() { Reset(); }
|
LegoPartPresenter() { Reset(); }
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x10067300
|
||||||
~LegoPartPresenter() override { Destroy(TRUE); }
|
~LegoPartPresenter() override { Destroy(TRUE); }
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1000cf70
|
// FUNCTION: LEGO1 0x1000cf70
|
||||||
|
|||||||
@ -3,7 +3,11 @@
|
|||||||
|
|
||||||
#include "legoentitypresenter.h"
|
#include "legoentitypresenter.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
class LegoWorld;
|
class LegoWorld;
|
||||||
|
struct ModelDbPart;
|
||||||
|
struct ModelDbModel;
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d8ee0
|
// VTABLE: LEGO1 0x100d8ee0
|
||||||
// SIZE 0x54
|
// SIZE 0x54
|
||||||
@ -33,6 +37,8 @@ class LegoWorldPresenter : public LegoEntityPresenter {
|
|||||||
MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c
|
MxResult StartAction(MxStreamController* p_controller, MxDSAction* p_action) override; // vtable+0x3c
|
||||||
void VTable0x60(MxPresenter* p_presenter) override; // vtable+0x60
|
void VTable0x60(MxPresenter* p_presenter) override; // vtable+0x60
|
||||||
|
|
||||||
|
MxResult FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile);
|
||||||
|
MxResult FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world);
|
||||||
MxResult LoadWorld(char* p_worldName, LegoWorld* p_world);
|
MxResult LoadWorld(char* p_worldName, LegoWorld* p_world);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10066750
|
// SYNTHETIC: LEGO1 0x10066750
|
||||||
|
|||||||
@ -187,7 +187,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelDbWorld* worlds;
|
ModelDbWorld* worlds = NULL;
|
||||||
MxS32 numWorlds;
|
MxS32 numWorlds;
|
||||||
FILE* wdbFile = fopen(wdbPath, "rb");
|
FILE* wdbFile = fopen(wdbPath, "rb");
|
||||||
|
|
||||||
@ -235,6 +235,7 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buff = new MxU8[size];
|
||||||
if (fread(&buff, size, 1, wdbFile) != 1) {
|
if (fread(&buff, size, 1, wdbFile) != 1) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
@ -257,6 +258,78 @@ MxResult LegoWorldPresenter::LoadWorld(char* p_worldName, LegoWorld* p_world)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModelDbPartListCursor cursor(worlds[i].m_partList);
|
||||||
|
ModelDbPart* part;
|
||||||
|
|
||||||
|
while (cursor.Next(part)) {
|
||||||
|
if (GetViewLODListManager()->Lookup(part->m_name.GetData()) == NULL &&
|
||||||
|
FUN_10067360(*part, wdbFile) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MxS32 j = 0; j < worlds[i].m_numModels; j++) {
|
||||||
|
if (!strnicmp(worlds[i].m_models[j].m_modelName, "isle", 4)) {
|
||||||
|
switch (g_legoWorldPresenterQuality) {
|
||||||
|
case 0:
|
||||||
|
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_lo")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (strcmpi(worlds[i].m_models[j].m_modelName, "isle_hi")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (g_legoWorldPresenterQuality < 1 && !strcmpi(worlds[i].m_models[j].m_modelName, "haus")) {
|
||||||
|
if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (worlds[i].m_models[j].m_modelName[4] == '3') {
|
||||||
|
if (FUN_100674b0(worlds[i].m_models[j], wdbFile, p_world) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FUN_100674b0(worlds[i].m_models[j - 2], wdbFile, p_world) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FUN_100674b0(worlds[i].m_models[j - 1], wdbFile, p_world) != SUCCESS) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// STUB: LEGO1 0x10067360
|
||||||
|
MxResult LegoWorldPresenter::FUN_10067360(ModelDbPart& p_part, FILE* p_wdbFile)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// STUB: LEGO1 0x100674b0
|
||||||
|
MxResult LegoWorldPresenter::FUN_100674b0(ModelDbModel& p_model, FILE* p_wdbFile, LegoWorld* p_world)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,6 +78,9 @@
|
|||||||
// LIBRARY: LEGO1 0x1008c410
|
// LIBRARY: LEGO1 0x1008c410
|
||||||
// _strlwr
|
// _strlwr
|
||||||
|
|
||||||
|
// LIBRARY: LEGO1 0x1008c570
|
||||||
|
// _access
|
||||||
|
|
||||||
// LIBRARY: LEGO1 0x1008c5c0
|
// LIBRARY: LEGO1 0x1008c5c0
|
||||||
// _fseek
|
// _fseek
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
DECOMP_SIZE_ASSERT(ModelDbWorld, 0x18)
|
DECOMP_SIZE_ASSERT(ModelDbWorld, 0x18)
|
||||||
DECOMP_SIZE_ASSERT(ModelDbPart, 0x18)
|
DECOMP_SIZE_ASSERT(ModelDbPart, 0x18)
|
||||||
DECOMP_SIZE_ASSERT(ModelDbModel, 0x38)
|
DECOMP_SIZE_ASSERT(ModelDbModel, 0x38)
|
||||||
|
DECOMP_SIZE_ASSERT(ModelDbPartList, 0x1c)
|
||||||
|
DECOMP_SIZE_ASSERT(ModelDbPartListCursor, 0x10)
|
||||||
|
|
||||||
// STUB: LEGO1 0x100276b0
|
// STUB: LEGO1 0x100276b0
|
||||||
MxResult ModelDbModel::Read(FILE* p_file)
|
MxResult ModelDbModel::Read(FILE* p_file)
|
||||||
|
|||||||
@ -49,6 +49,16 @@ class ModelDbPartList : public MxList<ModelDbPart*> {
|
|||||||
undefined m_unk0x18;
|
undefined m_unk0x18;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// VTABLE: LEGO1 0x100d68d0
|
||||||
|
// class MxListCursor<ModelDbPart *>
|
||||||
|
|
||||||
|
// VTABLE: LEGO1 0x100d68e8
|
||||||
|
// SIZE 0x10
|
||||||
|
class ModelDbPartListCursor : public MxListCursor<ModelDbPart*> {
|
||||||
|
public:
|
||||||
|
ModelDbPartListCursor(ModelDbPartList* p_list) : MxListCursor<ModelDbPart*>(p_list) {}
|
||||||
|
};
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x10027c70
|
// TEMPLATE: LEGO1 0x10027c70
|
||||||
// MxCollection<ModelDbPart *>::Compare
|
// MxCollection<ModelDbPart *>::Compare
|
||||||
|
|
||||||
@ -67,11 +77,21 @@ class ModelDbPartList : public MxList<ModelDbPart*> {
|
|||||||
// SYNTHETIC: LEGO1 0x10027e50
|
// SYNTHETIC: LEGO1 0x10027e50
|
||||||
// MxList<ModelDbPart *>::`scalar deleting destructor'
|
// MxList<ModelDbPart *>::`scalar deleting destructor'
|
||||||
|
|
||||||
|
// SYNTHETIC: LEGO1 0x10027f00
|
||||||
|
// ModelDbPartListCursor::`scalar deleting destructor'
|
||||||
|
|
||||||
|
// TEMPLATE: LEGO1 0x10027f70
|
||||||
|
// MxListCursor<ModelDbPart *>::~MxListCursor<ModelDbPart *>
|
||||||
|
|
||||||
|
// SYNTHETIC: LEGO1 0x10027fc0
|
||||||
|
// MxListCursor<ModelDbPart *>::`scalar deleting destructor'
|
||||||
|
|
||||||
// SIZE 0x38
|
// SIZE 0x38
|
||||||
struct ModelDbModel {
|
struct ModelDbModel {
|
||||||
MxResult Read(FILE* p_file);
|
MxResult Read(FILE* p_file);
|
||||||
|
|
||||||
undefined m_unk0x00[0x38]; // 0x00
|
char* m_modelName; // 0x00
|
||||||
|
undefined m_unk0x04[0x34]; // 0x04
|
||||||
};
|
};
|
||||||
|
|
||||||
// SIZE 0x18
|
// SIZE 0x18
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user