IsleActor::Create, IsleActor::Notify (#779)

* IsleActor::Create, IsleActor::Notify

* fix pizzeria vtable

* clang-format

* fix pizza vtable

* fix annotation

* refactor, add annotations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Joshua Peisach 2024-04-11 07:55:22 -04:00 committed by GitHub
parent 91ae26589a
commit 8cbb094b75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 116 additions and 20 deletions

View file

@ -2,9 +2,11 @@
#define ISLEACTOR_H
#include "legoactor.h"
#include "legoworld.h"
#include "mxactionnotificationparam.h"
// VTABLE: LEGO1 0x100d5178
// SIZE 0x78
// SIZE 0x7c
class IsleActor : public LegoActor {
public:
MxLong Notify(MxParam& p_param) override; // vtable+0x04
@ -23,6 +25,30 @@ class IsleActor : public LegoActor {
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
// FUNCTION: LEGO1 0x1000e5f0
virtual undefined4 VTable0x68() { return 0; } // vtable+0x68
// FUNCTION: LEGO1 0x1000e600
virtual undefined4 VTable0x6c() { return 0; } // vtable+0x6c
// FUNCTION: LEGO1 0x1000e610
virtual undefined4 VTable0x70() { return 0; } // vtable+0x70
// FUNCTION: LEGO1 0x1000e620
virtual undefined4 HandleEndAction(MxEndActionNotificationParam&) { return 0; } // vtable+0x74
// FUNCTION: LEGO1 0x1000e630
virtual undefined4 HandleButtonDown(MxNotificationParam&) { return 0; } // vtable+0x78
// FUNCTION: LEGO1 0x1000e640
virtual undefined4 HandleButtonUp(MxNotificationParam&) { return 0; } // vtable+0x7c
// FUNCTION: LEGO1 0x1000e650
virtual undefined4 VTable0x80(MxParam&) { return 0; } // vtable+0x80
private:
LegoWorld* m_world; // 0x78
};
// SYNTHETIC: LEGO1 0x1000e940

View file

@ -27,20 +27,22 @@ class Pizza : public IsleActor {
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
undefined4 VTable0x68() override; // vtable+0x68
undefined4 HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
undefined4 VTable0x80(MxParam&) override; // vtable+0x80
// SYNTHETIC: LEGO1 0x100380e0
// Pizza::`scalar deleting destructor'
private:
undefined4 m_unk0x78;
undefined4 m_unk0x7c;
undefined4 m_unk0x80;
undefined4 m_unk0x84;
undefined4 m_unk0x88;
undefined4 m_unk0x8c;
undefined4 m_unk0x90;
undefined4 m_unk0x94;
undefined m_unk0x98;
undefined4 m_unk0x7c; // 0x7c
undefined4 m_unk0x80; // 0x80
undefined4 m_unk0x84; // 0x84
undefined4 m_unk0x88; // 0x88
undefined4 m_unk0x8c; // 0x8c
undefined4 m_unk0x90; // 0x90
undefined4 m_unk0x94; // 0x94
undefined m_unk0x98; // 0x98
};
#endif // PIZZA_H

View file

@ -1,6 +1,7 @@
#ifndef PIZZERIA_H
#define PIZZERIA_H
#include "decomp.h"
#include "isleactor.h"
// VTABLE: LEGO1 0x100d5520
@ -23,12 +24,12 @@ class Pizzeria : public IsleActor {
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
undefined4 VTable0x68() override; // vtable+0x68
// SYNTHETIC: LEGO1 0x1000e8d0
// Pizzeria::`scalar deleting destructor'
private:
undefined4 m_unk0x78; // 0x78
undefined4 m_unk0x7c; // 0x7c
undefined4 m_unk0x80; // 0x80
};

View file

@ -1,18 +1,57 @@
#include "isleactor.h"
// NOTE: This is copied from base class LegoActor. IsleActor may in fact be larger but we don't know yet.
DECOMP_SIZE_ASSERT(IsleActor, 0x78)
#include "legoentity.h"
#include "legoomni.h"
#include "legoworld.h"
#include "misc.h"
#include "mxnotificationparam.h"
// STUB: LEGO1 0x1002c780
DECOMP_SIZE_ASSERT(IsleActor, 0x7c)
// FUNCTION: LEGO1 0x1002c780
MxResult IsleActor::Create(MxDSAction& p_dsAction)
{
// TODO
return SUCCESS;
MxResult ret = LegoEntity::Create(p_dsAction);
if (ret == SUCCESS) {
m_world = CurrentWorld();
if (!m_world) {
ret = FAILURE;
}
}
return ret;
}
// STUB: LEGO1 0x1002c7b0
// FUNCTION: LEGO1 0x1002c7b0
MxLong IsleActor::Notify(MxParam& p_param)
{
// TODO
return 0;
MxLong result = 0;
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationType0:
result = VTable0x6c();
break;
case c_notificationEndAction:
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
break;
case c_notificationButtonUp:
result = HandleButtonUp((MxNotificationParam&) p_param);
break;
case c_notificationButtonDown:
result = HandleButtonDown((MxNotificationParam&) p_param);
break;
case c_notificationType11:
result = VTable0x68();
break;
case c_notificationType18:
result = VTable0x70();
break;
case c_notificationType19:
result = VTable0x80(p_param);
break;
}
return result;
}

View file

@ -30,9 +30,30 @@ MxResult Pizza::Create(MxDSAction& p_dsAction)
return SUCCESS;
}
// STUB: LEGO1 0x100383f0
undefined4 Pizza::VTable0x68()
{
// TODO
return 0;
}
// STUB: LEGO1 0x100384f0
undefined4 Pizza::VTable0x80(MxParam&)
{
// TODO
return 0;
}
// STUB: LEGO1 0x100388a0
MxResult Pizza::Tickle()
{
// TODO
return SUCCESS;
}
// STUB: LEGO1 0x10038b10
undefined4 Pizza::HandleEndAction(MxEndActionNotificationParam&)
{
// TODO
return 0;
}

View file

@ -8,3 +8,10 @@ MxResult Pizzeria::Create(MxDSAction& p_dsAction)
// TODO
return SUCCESS;
}
// STUB: LEGO1 0x10017a50
undefined4 Pizzeria::VTable0x68()
{
// TODO
return 0;
}