Merge branch 'master' into omniheaders

This commit is contained in:
Christian Semmler 2023-10-02 12:25:29 -04:00 committed by GitHub
commit 9938b15abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 289 additions and 104 deletions

View File

@ -1,3 +1,8 @@
#include "legoactor.h"
DECOMP_SIZE_ASSERT(LegoActor, 0x78)
// OFFSET: LEGO1 0x1002d110 STUB
LegoActor::LegoActor()
{
}

View File

@ -9,6 +9,8 @@
class LegoActor : public LegoEntity
{
public:
LegoActor();
// OFFSET: LEGO1 0x1002d210
inline virtual const char *ClassName() const override // vtable+0x0c
{

View File

@ -9,7 +9,7 @@ DECOMP_SIZE_ASSERT(LegoEntity, 0x68)
// OFFSET: LEGO1 0x1000c290
LegoEntity::~LegoEntity()
{
Destroy();
Destroy(TRUE);
}
// OFFSET: LEGO1 0x100114f0 STUB
@ -20,6 +20,26 @@ MxLong LegoEntity::Notify(MxParam &p)
return 0;
}
// OFFSET: LEGO1 0x100105f0
void LegoEntity::Reset()
{
float value = 0.0f;
m_vec1.EqualsScalar(&value);
value = 0.0f;
m_vec2.EqualsScalar(&value);
m_unk50 = 0;
m_unk54 = 0;
m_unk58 = 0;
m_actionArgString = NULL;
m_unk10 = 0;
m_unk11 = 0;
m_actionType = ExtraActionType_unknown;
m_actionArgNumber = -1;
m_unk59 = 4;
}
// OFFSET: LEGO1 0x100107e0 STUB
void LegoEntity::vtable18()
{
@ -27,9 +47,14 @@ void LegoEntity::vtable18()
}
// OFFSET: LEGO1 0x10010810 STUB
void LegoEntity::Destroy()
void LegoEntity::Destroy(MxBool)
{
// TODO
if (m_unk54) {
// TODO
}
delete[] m_actionArgString;
Reset();
}
// OFFSET: LEGO1 0x10010e10

View File

@ -2,7 +2,9 @@
#define LEGOENTITY_H
#include "mxentity.h"
#include "mxvector.h"
#include "extra.h"
#include "decomp.h"
// VTABLE 0x100d4858
// SIZE 0x68 (probably)
@ -33,10 +35,21 @@ class LegoEntity : public MxEntity
}
virtual void vtable18(); // vtable+0x18
virtual void Destroy(); // vtable+0x1c
virtual void Destroy(MxBool); // vtable+0x1c
virtual void ParseAction(char *); // vtable+0x20
protected:
void Reset();
undefined m_unk10;
undefined m_unk11;
MxVector3Data m_vec1; // 0x14
MxVector3Data m_vec2; // 0x28
MxVector3Data m_vec3; // 0x3c
undefined4 m_unk50;
undefined4 m_unk54;
undefined m_unk58;
undefined m_unk59;
// For tokens from the extra string that look like this:
// "Action:openram;\lego\scripts\Race\CarRaceR;0"
ExtraActionType m_actionType; // 0x5c

View File

@ -1,7 +1,14 @@
#include "mxcontrolpresenter.h"
// OFFSET: LEGO1 0x10043f50 STUB
DECOMP_SIZE_ASSERT(MxControlPresenter, 0x5c)
// OFFSET: LEGO1 0x10043f50
MxControlPresenter::MxControlPresenter()
{
// TODO
this->m_unk4c = 0;
this->m_unk4e = -1;
this->m_unk50 = 0;
this->m_unk52 = 0;
this->m_unk58 = 0;
this->m_unk54 = 0;
}

View File

@ -1,6 +1,8 @@
#ifndef MXCONTROLPRESENTER_H
#define MXCONTROLPRESENTER_H
#include "decomp.h"
#include "mxcompositepresenter.h"
// VTABLE 0x100d7b88
@ -22,7 +24,13 @@ class MxControlPresenter : public MxCompositePresenter
{
return !strcmp(name, MxControlPresenter::ClassName()) || MxCompositePresenter::IsA(name);
}
private:
undefined2 m_unk4c;
MxS16 m_unk4e;
undefined m_unk50;
undefined2 m_unk52;
undefined2 m_unk54;
undefined4 m_unk58;
};

View File

@ -8,7 +8,7 @@ class MxDSAction;
// VTABLE 0x100dced8
// SIZE 0x1c
class MxDSActionList : public MxList<MxDSAction>
class MxDSActionList : public MxList<MxDSAction*>
{
public:
MxDSActionList() {
@ -23,15 +23,15 @@ class MxDSActionList : public MxList<MxDSAction>
undefined m_unk18;
};
typedef MxListCursorChild<MxDSAction> MxDSActionListCursor;
typedef MxListCursorChild<MxDSAction*> MxDSActionListCursor;
// OFFSET: LEGO1 0x100c9cc0 TEMPLATE
// MxListParent<MxDSAction *>::Compare
// OFFSET: LEGO1 0x100c9d20 TEMPLATE
// MxListParent<MxDSAction>::Destroy
// OFFSET: LEGO1 0x100c9cd0 TEMPLATE
// MxListParent<MxDSAction>::~MxListParent<MxDSAction>
// MxListParent<MxDSAction *>::Destroy
// OFFSET: LEGO1 0x100c9d30 TEMPLATE
// MxList<MxDSAction>::~MxList<MxDSAction>
// MxList<MxDSAction *>::~MxList<MxDSAction *>
#endif // MXDSACTIONLIST_H

View File

@ -5,12 +5,13 @@ DECOMP_SIZE_ASSERT(MxDSSelectAction, 0xb0)
// OFFSET: LEGO1 0x100cb2b0
MxDSSelectAction::MxDSSelectAction()
{
// TODO
this->SetType(MxDSType_SelectAction);
this->m_unk0xac = new MxStringList;
}
// OFFSET: LEGO1 0x100cb8d0 STUB
// OFFSET: LEGO1 0x100cb8d0
MxDSSelectAction::~MxDSSelectAction()
{
// TODO
if (this->m_unk0xac)
delete this->m_unk0xac;
}

View File

@ -2,6 +2,7 @@
#define MXDSSELECTACTION_H
#include "mxdsparallelaction.h"
#include "mxstringlist.h"
#include "decomp.h"
// VTABLE 0x100dcfc8
@ -25,12 +26,9 @@ class MxDSSelectAction : public MxDSParallelAction
return !strcmp(name, MxDSSelectAction::ClassName()) || MxDSParallelAction::IsA(name);
}
undefined4 m_unk0x9c;
undefined4 m_unk0xa0;
undefined4 m_unk0xa4;
undefined4 m_unk0xa8;
undefined4 m_unk0xac;
private:
MxString m_unk0x9c;
MxStringList *m_unk0xac;
};
#endif // MXDSSELECTACTION_H

View File

@ -1,8 +1,6 @@
#include "mxentity.h"
// Size subject to change. It's not clear yet which members belong to
// MxEntity and which belong only the subclasses.
DECOMP_SIZE_ASSERT(MxEntity, 0x5c)
DECOMP_SIZE_ASSERT(MxEntity, 0x10)
// OFFSET: LEGO1 0x1001d190
MxEntity::MxEntity()

View File

@ -7,7 +7,7 @@
#include "mxtypes.h"
// VTABLE 0x100d5390
// SIZE 0x68 or less
// SIZE 0x10
class MxEntity : public MxCore
{
public:
@ -31,7 +31,6 @@ class MxEntity : public MxCore
private:
MxS32 m_mxEntityId; // 0x8
MxAtomId m_atom; // 0xc
undefined m_unk10[76];
};
#endif // MXENTITY_H

View File

@ -4,19 +4,24 @@
#include "mxtypes.h"
#include "mxcore.h"
template <class T>
// SIZE 0xc
template <class T>
class MxListEntry
{
public:
MxListEntry() {}
MxListEntry(T *p_obj, MxListEntry *p_prev) {
MxListEntry(T p_obj, MxListEntry *p_prev) {
m_obj = p_obj;
m_prev = p_prev;
m_next = NULL;
}
T *m_obj;
T GetValue() { return this->m_obj; }
friend class MxList<T>;
friend class MxListCursor<T>;
private:
T m_obj;
MxListEntry *m_prev;
MxListEntry *m_next;
};
@ -33,12 +38,12 @@ class MxListParent : public MxCore
}
virtual ~MxListParent() {}
virtual MxS8 Compare(T *, T *) = 0;
virtual MxS8 Compare(T, T) { return 0; };
static void Destroy(T *) {};
static void Destroy(T) {};
protected:
MxU32 m_count; // +0x8
void (*m_customDestructor)(T *); // +0xc
void (*m_customDestructor)(T); // +0xc
};
// VTABLE 0x100d6368
@ -54,13 +59,12 @@ class MxList : protected MxListParent<T>
virtual ~MxList();
void Append(T*);
void Append(T);
void DeleteAll();
MxU32 GetCount() { return m_count; }
void SetDestroy(void (*p_customDestructor)(T *)) { this->m_customDestructor = p_customDestructor; }
void SetDestroy(void (*p_customDestructor)(T)) { this->m_customDestructor = p_customDestructor; }
friend class MxListCursor<T>;
protected:
MxListEntry<T> *m_first; // +0x10
MxListEntry<T> *m_last; // +0x14
@ -79,10 +83,10 @@ class MxListCursor : public MxCore
m_match = NULL;
}
MxBool Find(T *p_obj);
MxBool Find(T p_obj);
void Detach();
MxBool Next(T*& p_obj);
void SetValue(T *p_obj);
MxBool Next(T& p_obj);
void SetValue(T p_obj);
void Head() { m_match = m_list->m_first; }
void Reset() { m_match = NULL; }
@ -123,7 +127,7 @@ inline void MxList<T>::DeleteAll()
break;
MxListEntry<T> *next = t->m_next;
m_customDestructor(t->m_obj);
m_customDestructor(t->GetValue());
delete t;
t = next;
}
@ -134,7 +138,7 @@ inline void MxList<T>::DeleteAll()
}
template <class T>
inline void MxList<T>::Append(T *p_newobj)
inline void MxList<T>::Append(T p_newobj)
{
MxListEntry<T> *currentLast = this->m_last;
MxListEntry<T> *newEntry = new MxListEntry<T>(p_newobj, currentLast);
@ -169,7 +173,7 @@ inline void MxList<T>::_DeleteEntry(MxListEntry<T> *match)
}
template <class T>
inline MxBool MxListCursor<T>::Find(T *p_obj)
inline MxBool MxListCursor<T>::Find(T p_obj)
{
for (m_match = m_list->m_first;
m_match && m_list->Compare(m_match->m_obj, p_obj);
@ -186,7 +190,7 @@ inline void MxListCursor<T>::Detach()
}
template <class T>
inline MxBool MxListCursor<T>::Next(T*& p_obj)
inline MxBool MxListCursor<T>::Next(T& p_obj)
{
if (!m_match)
m_match = m_list->m_first;
@ -200,7 +204,7 @@ inline MxBool MxListCursor<T>::Next(T*& p_obj)
}
template <class T>
inline void MxListCursor<T>::SetValue(T *p_obj)
inline void MxListCursor<T>::SetValue(T p_obj)
{
if (m_match)
m_match->m_obj = p_obj;

View File

@ -8,7 +8,7 @@ class MxPresenter;
// Unclear what the purpose of this class is
// VTABLE 0x100d62f0
// SIZE 0x18
class MxPresenterListParent : public MxList<MxPresenter>
class MxPresenterListParent : public MxList<MxPresenter*>
{
public:
MxPresenterListParent() {
@ -24,15 +24,15 @@ class MxPresenterList : public MxPresenterListParent
virtual MxS8 Compare(MxPresenter *, MxPresenter *); // +0x14
};
typedef MxListCursorChildChild<MxPresenter> MxPresenterListCursor;
typedef MxListCursorChildChild<MxPresenter*> MxPresenterListCursor;
// OFFSET: LEGO1 0x1001cd20 TEMPLATE
// MxListParent<MxPresenter *>::Compare
// OFFSET: LEGO1 0x1001cd30 TEMPLATE
// MxListParent<MxPresenter>::Destroy
// OFFSET: LEGO1 0x1001cdd0 TEMPLATE
// MxListParent<MxPresenter>::~MxListParent<MxPresenter>
// MxListParent<MxPresenter *>::Destroy
// OFFSET: LEGO1 0x1001ce20 TEMPLATE
// MxList<MxPresenter>::~MxList<MxPresenter>
// MxList<MxPresenter *>::~MxList<MxPresenter *>
#endif // MXPRESENTERLIST_H

23
LEGO1/mxstringlist.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef MXSTRINGLIST_H
#define MXSTRINGLIST_H
#include "mxlist.h"
#include "mxstring.h"
// VTABLE 0x100dd040
// SIZE 0x18
class MxStringList : public MxList<MxString> {};
// OFFSET: LEGO1 0x100cb3c0 TEMPLATE
// MxListParent<MxString>::Compare
// OFFSET: LEGO1 0x100cb470 TEMPLATE
// MxListParent<MxString>::Destroy
// OFFSET: LEGO1 0x100cb4c0 TEMPLATE
// MxList<MxString>::~MxList<MxString>
// OFFSET: LEGO1 0x100cc450 TEMPLATE
// MxListEntry<MxString>::GetValue
#endif // MXSTRINGLIST_H

View File

@ -8,16 +8,30 @@
DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900);
// OFFSET: LEGO1 0x1004b8d0 STUB
// OFFSET: LEGO1 0x1004b8d0
MxTransitionManager::MxTransitionManager()
{
// TODO
m_animationTimer = 0;
m_transitionType = NOT_TRANSITIONING;
m_ddSurface = NULL;
m_unk08 = 0;
m_unk1c = 0;
m_unk20.bit0 = FALSE;
m_unk28.bit0 = FALSE;
m_unk24 = 0;
}
// OFFSET: LEGO1 0x1004ba00 STUB
// OFFSET: LEGO1 0x1004ba00
MxTransitionManager::~MxTransitionManager()
{
// TODO
free(m_unk1c);
if (m_unk08 != NULL) {
delete m_unk08->m_unk1c;
delete m_unk08;
}
TickleManager()->UnregisterClient(this);
}
// OFFSET: LEGO1 0x1004bac0 STUB
@ -44,36 +58,43 @@ MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14
// OFFSET: LEGO1 0x1004bb70
MxResult MxTransitionManager::StartTransition(TransitionType p_animationType, MxS32 p_speed,
undefined p_unk, MxBool p_playMusicInAnim)
MxBool p_unk, MxBool p_playMusicInAnim)
{
// TODO: Incomplete and far from matching
if (this->m_transitionType == NOT_TRANSITIONING) {
if (!p_playMusicInAnim) {
MxBackgroundAudioManager *backgroundAudioManager = BackgroundAudioManager();
backgroundAudioManager->Stop();
}
this->m_transitionType = p_animationType;
// TODO: This part of the function is mangled and I can't make out what it's doing right now
this->m_transitionType = p_animationType;
MxU32 time = timeGetTime();
this->m_systemTime = time;
m_unk20.bit0 = p_unk;
this->m_animationSpeed = p_speed;
if (m_unk20.bit0 && m_unk08 != NULL) {
m_unk08->vtable54(1);
MxTickleManager *tickleManager = TickleManager();
tickleManager->RegisterClient(this, p_speed);
MxTransitionManagerUnknownSubclass2 *iVar2 = m_unk08->m_unk1c;
iVar2->m_unk3c = 10000;
iVar2->m_unk30 |= 0x200;
}
LegoInputManager *inputManager = InputManager();
inputManager->m_unk88 = TRUE;
inputManager->m_unk336 = FALSE;
MxU32 time = timeGetTime();
this->m_systemTime = time;
LegoVideoManager *videoManager = VideoManager();
videoManager->SetUnkE4(FALSE);
this->m_animationSpeed = p_speed;
SetAppCursor(1);
return SUCCESS;
MxTickleManager *tickleManager = TickleManager();
tickleManager->RegisterClient(this, p_speed);
LegoInputManager *inputManager = InputManager();
inputManager->m_unk88 = TRUE;
inputManager->m_unk336 = FALSE;
LegoVideoManager *videoManager = VideoManager();
videoManager->SetUnkE4(FALSE);
SetAppCursor(1);
return SUCCESS;
}
return FAILURE;
}
}

View File

@ -7,6 +7,52 @@
#include <ddraw.h>
class MxTransitionManagerUnknownSubclass2
{
public:
virtual ~MxTransitionManagerUnknownSubclass2(){}
undefined m_unk04[0x2c];
undefined4 m_unk30;
undefined4 m_unk34;
undefined4 m_unk38;
undefined4 m_unk3c;
};
// TODO: Don't know what this is yet
class MxTransitionManagerUnknownSubclass1
{
public:
virtual ~MxTransitionManagerUnknownSubclass1(){}
virtual void vtable04();
virtual void vtable08();
virtual void vtable0c();
virtual void vtable10();
virtual void vtable14();
virtual void vtable18();
virtual void vtable1c();
virtual void vtable20();
virtual void vtable24();
virtual void vtable28();
virtual void vtable2c();
virtual void vtable30();
virtual void vtable34();
virtual void vtable38();
virtual void vtable3c();
virtual void vtable40();
virtual void vtable44();
virtual void vtable48();
virtual void vtable4c();
virtual void vtable50();
virtual void vtable54(undefined4 p_unk1);
undefined m_unk04[0x18];
MxTransitionManagerUnknownSubclass2 *m_unk1c;
};
// VTABLE 0x100d7ea0
class MxTransitionManager : public MxCore
{
@ -42,11 +88,19 @@ class MxTransitionManager : public MxCore
BROKEN // Unknown what this is supposed to be, it locks the game up
};
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, undefined p_unk, MxBool p_playMusicInAnim);
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_unk, MxBool p_playMusicInAnim);
private:
undefined m_pad00[0x20];
undefined m_pad20[0x04];
MxTransitionManagerUnknownSubclass1 *m_unk08;
undefined4 m_unk0c;
undefined4 m_unk10;
undefined4 m_unk14;
undefined4 m_unk18;
void *m_unk1c;
flag_bitfield m_unk20;
undefined4 m_unk24;
flag_bitfield m_unk28;
TransitionType m_transitionType;
LPDIRECTDRAWSURFACE m_ddSurface;
MxU16 m_animationTimer;

View File

@ -44,4 +44,19 @@ typedef MxU8 MxBool;
#define TWOCC(a, b) (((a) << 0) | ((b) << 8))
#define FOURCC(a, b, c, d) (((a) << 0) | ((b) << 8) | ((c) << 16) | ((d) << 24))
// Must be union with struct for match.
typedef union {
struct {
MxU8 bit0: 1;
MxU8 bit1: 1;
MxU8 bit2: 1;
MxU8 bit3: 1;
MxU8 bit4: 1;
MxU8 bit5: 1;
MxU8 bit6: 1;
MxU8 bit7: 1;
};
// BYTE all; // ?
} flag_bitfield;
#endif // MXTYPE_H

View File

@ -3,20 +3,7 @@
#include <windows.h>
// Must be union with struct for match.
typedef union {
struct {
BYTE bit0: 1;
BYTE bit1: 1;
BYTE bit2: 1;
BYTE bit3: 1;
BYTE bit4: 1;
BYTE bit5: 1;
BYTE bit6: 1;
BYTE bit7: 1;
};
// BYTE all; // ?
} flag_bitfield;
#include "mxtypes.h"
class MxVideoParamFlags
{

View File

@ -1,13 +1,11 @@
#include "pizza.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(Pizza, 0x9c);
// OFFSET: LEGO1 0x10037ef0
Pizza::Pizza()
{
// FIXME: This inherits from LegoActor, probably why this isn't matching
this->m_unk7c = 0;
this->m_unk80 = 0;
this->m_unk84 = 0;
this->m_unk88 = 0;

View File

@ -1,6 +1,8 @@
#ifndef PIZZA_H
#define PIZZA_H
#include "decomp.h"
#include "isleactor.h"
#include "mxcore.h"
#include "mxomni.h"
@ -29,16 +31,17 @@ class Pizza : public IsleActor
{
return !strcmp(name, Pizza::ClassName()) || IsleActor::IsA(name);
}
private:
MxS32 m_unk78;
MxS32 m_unk7c;
MxS32 m_unk80;
MxS32 m_unk84;
MxS32 m_unk88;
MxS32 m_unk8c;
MxU32 m_unk90;
MxS32 m_unk94;
MxS32 m_unk98;
undefined4 m_unk78;
undefined4 m_unk7c;
undefined4 m_unk80;
undefined4 m_unk84;
undefined4 m_unk88;
undefined4 m_unk8c;
undefined4 m_unk90;
undefined4 m_unk94;
undefined m_unk98;
};
#endif // PIZZA_H

View File

@ -13,7 +13,19 @@ class Police : public LegoWorld
virtual ~Police() override; // vtable+0x0
virtual MxLong Notify(MxParam &p) override; // vtable+0x4
// OFFSET: LEGO1 0x1005e1e0
inline virtual const char *ClassName() const override // vtable+0xc
{
// 0x100f0450
return "Police";
}
// OFFSET: LEGO1 0x1005e1f0
inline virtual MxBool IsA(const char *name) const override // vtable+0x10
{
return !strcmp(name, Police::ClassName()) || LegoWorld::IsA(name);
}
};
#endif // POLICE_H

View File

@ -7,7 +7,19 @@
// SIZE 0x68
class PoliceEntity : public BuildingEntity
{
public:
// OFFSET: LEGO1 0x1000ed60
inline virtual const char *ClassName() const override // vtable+0xc
{
// 0x100f0328
return "PoliceEntity";
}
// OFFSET: LEGO1 0x1000ed70
inline virtual MxBool IsA(const char *name) const override // vtable+0x10
{
return !strcmp(name, PoliceEntity::ClassName()) || BuildingEntity::IsA(name);
}
};
#endif // POLICEENTITY_H