LegoWorldList

This commit is contained in:
disinvite 2023-12-06 10:56:12 -05:00
parent a7b81539b1
commit 43d79fd818
5 changed files with 70 additions and 4 deletions

View File

@ -98,6 +98,7 @@ add_library(lego1 SHARED
LEGO1/legovehiclebuildstate.cpp
LEGO1/legovideomanager.cpp
LEGO1/legoworld.cpp
LEGO1/legoworldlist.cpp
LEGO1/legoworldpresenter.cpp
LEGO1/motorcycle.cpp
LEGO1/mxactionnotificationparam.cpp

View File

@ -11,6 +11,7 @@
#include "legoutil.h"
#include "legovideomanager.h"
#include "legoworld.h"
#include "legoworldlist.h"
#include "mxautolocker.h"
#include "mxbackgroundaudiomanager.h"
#include "mxdsfile.h"
@ -358,7 +359,7 @@ void LegoOmni::Init()
m_inputMgr = NULL;
m_unk6c = 0;
m_gifManager = NULL;
m_unk78 = 0;
m_worldList = NULL;
m_currentWorld = NULL;
m_unk80 = FALSE;
m_currentVehicle = NULL;
@ -427,9 +428,9 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p)
m_animationManager = new LegoAnimationManager();
m_buildingManager = new LegoBuildingManager();
m_gameState = new LegoGameState();
// TODO: initialize list at m_unk78
m_worldList = new LegoWorldList();
if (m_unk6c && m_gifManager && m_unk78 && m_plantManager && m_animationManager && m_buildingManager) {
if (m_unk6c && m_gifManager && m_worldList && m_plantManager && m_animationManager && m_buildingManager) {
// TODO: initialize a bunch of MxVariables
RegisterScripts();
FUN_1001a700();

View File

@ -21,6 +21,7 @@ class LegoSoundManager;
class LegoUnkSaveDataWriter;
class LegoVideoManager;
class LegoWorld;
class LegoWorldList;
class MxAtomId;
class MxBackgroundAudioManager;
class MxDSFile;
@ -117,7 +118,7 @@ class LegoOmni : public MxOmni {
undefined4 m_unk6c;
LegoInputManager* m_inputMgr; // 0x70
GifManager* m_gifManager;
undefined4 m_unk78;
LegoWorldList* m_worldList; // 0x78
LegoWorld* m_currentWorld;
MxBool m_unk80;
LegoNavController* m_navController; // 0x84

36
LEGO1/legoworldlist.cpp Normal file
View File

@ -0,0 +1,36 @@
#include "legoworldlist.h"
#include "legoworld.h"
// FUNCTION: LEGO1 0x100598d0
MxS8 LegoWorldList::Compare(LegoWorld* p_a, LegoWorld* p_b)
{
return p_a == p_b ? 0 : p_a < p_b ? -1 : 1;
}
// TEMPLATE: LEGO1 0x100598f0
// MxCollection<LegoWorld *>::Compare
// TEMPLATE: LEGO1 0x10059900
// MxCollection<LegoWorld *>::~MxCollection<LegoWorld *>
// TEMPLATE: LEGO1 0x10059950
// MxCollection<LegoWorld *>::Destroy
// TEMPLATE: LEGO1 0x10059960
// MxList<LegoWorld *>::~MxList<LegoWorld *>
// FUNCTION: LEGO1 0x100599f0
void LegoWorldList::Destroy(LegoWorld* p_world)
{
delete p_world;
}
// SYNTHETIC: LEGO1 0x10059ac0
// MxCollection<LegoWorld *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10059b30
// MxList<LegoWorld *>::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10059be0
// MxPtrList<LegoWorld>::`scalar deleting destructor'

27
LEGO1/legoworldlist.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef LEGOWORLDLIST_H
#define LEGOWORLDLIST_H
#include "mxlist.h"
#include "mxtypes.h"
class LegoWorld;
// VTABLE: LEGO1 0x100d8700
// class MxCollection<LegoWorld *>
// VTABLE: LEGO1 0x100d8718
// class MxList<LegoWorld *>
// VTABLE: LEGO1 0x100d8730
// class MxPtrList<LegoWorld>
// VTABLE: LEGO1 0x100d8680
// SIZE 0x18
class LegoWorldList : public MxPtrList<LegoWorld> {
public:
LegoWorldList() : MxPtrList<LegoWorld>(Destroy) {}
virtual MxS8 Compare(LegoWorld*, LegoWorld*) override; // vtable+0x14
static void Destroy(LegoWorld*);
};
#endif // LEGOWORLDLIST_H