Skip to content

Commit

Permalink
Order symbols in LegoWorld (#1321)
Browse files Browse the repository at this point in the history
* Partially order `LegoWorld` symbols

* Further order `LegoWorld`
  • Loading branch information
foxtacles authored Jan 10, 2025
1 parent 58d3bd3 commit ee2bcb4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 45 deletions.
44 changes: 26 additions & 18 deletions LEGO1/lego/legoomni/include/legoworld.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#ifndef LEGOWORLD_H
#define LEGOWORLD_H

// clang-format off
#include "mxpresenterlist.h"
#include "legoentitylist.h"
#include "legocachesoundlist.h"
// clang-format on

#include "legoentity.h"
#include "legomain.h"
#include "legopathcontrollerlist.h"
#include "mxpresenterlist.h"
#include "roi/legoroi.h"

class LegoCacheSoundList;
class LegoCameraController;
class LegoEntityList;
class LegoPathBoundary;
class LegoHideAnimPresenter;

Expand Down Expand Up @@ -44,8 +47,26 @@ class LegoWorld : public LegoEntity {
LegoWorld();
~LegoWorld() override; // vtable+0x00

MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void ReadyWorld(); // vtable+0x50
virtual LegoCameraController* VTable0x54(); // vtable+0x54
virtual void Add(MxCore* p_object); // vtable+0x58

// The BETA10 match could also be LegoWorld::Escape(), only the child classes might be able to tell
// FUNCTION: LEGO1 0x1001d670
// FUNCTION: BETA10 0x10017530
virtual MxBool VTable0x5c() { return FALSE; } // vtable+0x5c

// FUNCTION: LEGO1 0x100010a0
virtual void VTable0x60() {} // vtable+0x60

// FUNCTION: LEGO1 0x1001d680
virtual MxBool Escape() { return FALSE; } // vtable+0x64

virtual void Enable(MxBool p_enable); // vtable+0x68

// FUNCTION: LEGO1 0x1001d690
// FUNCTION: BETA10 0x10017660
Expand All @@ -62,19 +83,6 @@ class LegoWorld : public LegoEntity {
return !strcmp(p_name, LegoWorld::ClassName()) || LegoEntity::IsA(p_name);
}

MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
virtual void ReadyWorld(); // vtable+0x50
virtual LegoCameraController* VTable0x54(); // vtable+0x54
virtual void Add(MxCore* p_object); // vtable+0x58
virtual MxBool VTable0x5c(); // vtable+0x5c

// FUNCTION: LEGO1 0x100010a0
virtual void VTable0x60() {} // vtable+0x60

virtual MxBool Escape(); // vtable+0x64
virtual void Enable(MxBool p_enable); // vtable+0x68

MxBool PresentersPending();
void Remove(MxCore* p_object);
MxResult PlaceActor(
Expand Down
16 changes: 0 additions & 16 deletions LEGO1/lego/legoomni/src/entity/legoworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
#include "legoanimationmanager.h"
#include "legoanimpresenter.h"
#include "legobuildingmanager.h"
#include "legocachesoundlist.h"
#include "legocachesoundmanager.h"
#include "legocameracontroller.h"
#include "legocontrolmanager.h"
#include "legoentitylist.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legolocomotionanimpresenter.h"
Expand Down Expand Up @@ -47,20 +45,6 @@ LegoWorld::LegoWorld() : m_list0x68(TRUE)
NotificationManager()->Register(this);
}

// FUNCTION: LEGO1 0x1001d670
// FUNCTION: BETA10 0x10017530
MxBool LegoWorld::VTable0x5c()
{
// The BETA10 match could also be LegoWorld::Escape(), only the child classes might be able to tell
return FALSE;
}

// FUNCTION: LEGO1 0x1001d680
MxBool LegoWorld::Escape()
{
return FALSE;
}

// FUNCTION: LEGO1 0x1001dfa0
LegoWorld::~LegoWorld()
{
Expand Down
7 changes: 4 additions & 3 deletions LEGO1/omni/include/mxcollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ class MxCollection : public MxCore {
SetDestroy(Destroy);
}

virtual MxS8 Compare(T, T) { return 0; } // vtable+0x14

~MxCollection() override {}

static void Destroy(T) {}

void SetDestroy(void (*p_customDestructor)(T)) { this->m_customDestructor = p_customDestructor; }

~MxCollection() override {}
virtual MxS8 Compare(T, T) { return 0; }

protected:
MxU32 m_count; // 0x08
void (*m_customDestructor)(T); // 0x0c
Expand Down
9 changes: 1 addition & 8 deletions LEGO1/omni/include/mxlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ template <class T>
class MxList : protected MxCollection<T> {
public:
MxList() { m_first = m_last = NULL; }

~MxList() override;
~MxList() override { DeleteAll(); }

void Append(T p_obj) { InsertEntry(p_obj, this->m_last, NULL); }
void Prepend(T p_obj) { InsertEntry(p_obj, NULL, this->m_first); }
Expand Down Expand Up @@ -127,12 +126,6 @@ class MxPtrListCursor : public MxListCursor<T*> {
MxPtrListCursor(MxPtrList<T>* p_list) : MxListCursor<T*>(p_list) {}
};

template <class T>
MxList<T>::~MxList()
{
DeleteAll();
}

// Delete entries and values
template <class T>
inline void MxList<T>::DeleteAll()
Expand Down

0 comments on commit ee2bcb4

Please sign in to comment.