Act3Cop::VTable0x94 and related (#1209)

* Act3Cop::VTable0x94 and related

* No need to include

* Cast LegoWorld* to Act3*
This commit is contained in:
MS 2024-12-11 16:20:21 -05:00 committed by GitHub
parent ac19539d0f
commit c05ff6ff4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 99 additions and 4 deletions

View file

@ -113,13 +113,19 @@ class Act3 : public LegoWorld {
void SetShark(Act3Shark* p_shark) { m_shark = p_shark; } void SetShark(Act3Shark* p_shark) { m_shark = p_shark; }
void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
Act3Brickster* GetBrickster() { return m_brickster; }
// SYNTHETIC: LEGO1 0x10072630 // SYNTHETIC: LEGO1 0x10072630
// Act3::`scalar deleting destructor' // Act3::`scalar deleting destructor'
void EatDonut(MxS32 p_index);
void RemoveDonut(Act3Ammo& p_p);
MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up); MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
void FUN_10073400(); void FUN_10073400();
void FUN_10073430(); void FUN_10073430();
void GoodEnding(const Matrix4& p_matrix);
static void DebugPrintf(const char* p_format, ...);
protected: protected:
MxLong HandleTransitionEnd(); MxLong HandleTransitionEnd();

View file

@ -3,6 +3,8 @@
#include "act3actors.h" #include "act3actors.h"
class LegoWorld;
// VTABLE: LEGO1 0x100d7750 LegoPathActor // VTABLE: LEGO1 0x100d7750 LegoPathActor
// VTABLE: LEGO1 0x100d7820 LegoAnimActor // VTABLE: LEGO1 0x100d7820 LegoAnimActor
// SIZE 0x188 // SIZE 0x188
@ -19,12 +21,15 @@ class Act3Cop : public Act3Actor {
void SetUnknown0x20(MxFloat p_unk0x20) { m_unk0x20 = p_unk0x20; } void SetUnknown0x20(MxFloat p_unk0x20) { m_unk0x20 = p_unk0x20; }
void FUN_10040360();
// SYNTHETIC: LEGO1 0x10043120 // SYNTHETIC: LEGO1 0x10043120
// Act3Cop::`scalar deleting destructor' // Act3Cop::`scalar deleting destructor'
private: private:
MxFloat m_unk0x20; // 0x20 MxFloat m_unk0x20; // 0x20
undefined4 m_unk0x24[3]; // 0x24 LegoWorld* m_world; // 0x24
undefined4 m_unk0x24[2]; // 0x28
}; };
#endif // ACT3COP_H #endif // ACT3COP_H

View file

@ -1,5 +1,14 @@
#include "act3cop.h" #include "act3cop.h"
#include "act3.h"
#include "act3brickster.h"
#include "legocachesoundmanager.h"
#include "legosoundmanager.h"
#include "misc.h"
#include "roi/legoroi.h"
#include <assert.h>
DECOMP_SIZE_ASSERT(Act3Cop, 0x188) DECOMP_SIZE_ASSERT(Act3Cop, 0x188)
// STUB: LEGO1 0x1003fe30 // STUB: LEGO1 0x1003fe30
@ -8,10 +17,37 @@ Act3Cop::Act3Cop()
// TODO // TODO
} }
// STUB: LEGO1 0x1003ff70 // FUNCTION: LEGO1 0x1003ff70
MxResult Act3Cop::VTable0x94(LegoPathActor*, MxBool) // FUNCTION: BETA10 0x10018526
MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
{ {
// TODO LegoROI* roi = p_actor->GetROI();
if (p_bool && !strncmp(roi->GetName(), "dammo", 5)) {
MxS32 count = -1;
if (sscanf(roi->GetName(), "dammo%d", &count) != 1) {
assert(0);
}
assert(m_world);
((Act3*) m_world)->EatDonut(count);
m_unk0x20 = m_lastTime + 2000;
SetWorldSpeed(6.0);
assert(SoundManager()->GetCacheSoundManager());
SoundManager()->GetCacheSoundManager()->Play("eatdn", NULL, FALSE);
FUN_10040360();
}
else {
if (((Act3*) m_world)->GetBrickster()->GetROI() != roi) {
if (p_bool) {
return Act3Actor::VTable0x94(p_actor, p_bool);
}
}
else {
((Act3*) m_world)->GoodEnding(roi->GetLocal2World());
}
}
return SUCCESS; return SUCCESS;
} }
@ -27,6 +63,13 @@ void Act3Cop::VTable0x70(float p_time)
// TODO // TODO
} }
// STUB: LEGO1 0x10040360
// STUB: BETA10 0x10018c6a
void Act3Cop::FUN_10040360()
{
// TODO
}
// STUB: LEGO1 0x10040d20 // STUB: LEGO1 0x10040d20
MxResult Act3Cop::VTable0x9c() MxResult Act3Cop::VTable0x9c()
{ {

View file

@ -182,6 +182,33 @@ Act3::~Act3()
TickleManager()->UnregisterClient(this); TickleManager()->UnregisterClient(this);
} }
// FUNCTION: LEGO1 0x100727a0
// FUNCTION: BETA10 0x1001570d
void Act3::EatDonut(MxS32 p_index)
{
assert(p_index < MAX_DONUTS);
RemoveDonut(m_donuts[p_index]);
}
// FUNCTION: LEGO1 0x100727d0
// FUNCTION: BETA10 0x10015828
void Act3::RemoveDonut(Act3Ammo& p_p)
{
#ifdef _DEBUG
MxS32 i;
for (i = 0; i < MAX_DONUTS; i++) {
if (&m_donuts[i] == &p_p) {
break;
}
}
assert(i != MAX_DONUTS);
#endif
assert(p_p.IsValid());
p_p.Remove();
}
// FUNCTION: LEGO1 0x100727e0 // FUNCTION: LEGO1 0x100727e0
// FUNCTION: BETA10 0x100158e2 // FUNCTION: BETA10 0x100158e2
MxResult Act3::ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up) MxResult Act3::ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up)
@ -525,6 +552,20 @@ void Act3::FUN_10073430()
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
} }
// STUB: LEGO1 0x10073460
// STUB: BETA10 0x10016bc6
void Act3::GoodEnding(const Matrix4& p_matrix)
{
// TODO
DebugPrintf("In Good Ending...");
}
// FUNCTION: LEGO1 0x10073500
void Act3::DebugPrintf(const char* p_format, ...)
{
// empty
}
// FUNCTION: LEGO1 0x10073a90 // FUNCTION: LEGO1 0x10073a90
void Act3::Enable(MxBool p_enable) void Act3::Enable(MxBool p_enable)
{ {