mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Refactor act 3 actors into act3actors.cpp
(#1210)
This commit is contained in:

committed by
GitHub

parent
c05ff6ff4a
commit
598d6dd10c
@@ -1,8 +1,21 @@
|
||||
#include "act3actors.h"
|
||||
|
||||
#include "act3.h"
|
||||
#include "act3ammo.h"
|
||||
#include "define.h"
|
||||
#include "legocachesoundmanager.h"
|
||||
#include "legolocomotionanimpresenter.h"
|
||||
#include "legosoundmanager.h"
|
||||
#include "misc.h"
|
||||
#include "mxutilities.h"
|
||||
#include "roi/legoroi.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
DECOMP_SIZE_ASSERT(Act3Actor, 0x178)
|
||||
DECOMP_SIZE_ASSERT(Act3Cop, 0x188)
|
||||
DECOMP_SIZE_ASSERT(Act3Brickster, 0x1b4)
|
||||
DECOMP_SIZE_ASSERT(Act3Shark, 0x1a8)
|
||||
|
||||
// Initialized at LEGO1 0x1003fa20
|
||||
// GLOBAL: LEGO1 0x10104ef0
|
||||
@@ -85,3 +98,176 @@ MxResult Act3Actor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1003fe30
|
||||
Act3Cop::Act3Cop()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1003ff70
|
||||
// FUNCTION: BETA10 0x10018526
|
||||
MxResult Act3Cop::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10040060
|
||||
void Act3Cop::ParseAction(char* p_extra)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100401f0
|
||||
void Act3Cop::VTable0x70(float p_time)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10040360
|
||||
// STUB: BETA10 0x10018c6a
|
||||
void Act3Cop::FUN_10040360()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10040d20
|
||||
MxResult Act3Cop::VTable0x9c()
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10040e10
|
||||
Act3Brickster::Act3Brickster()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10040f20
|
||||
Act3Brickster::~Act3Brickster()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10040ff0
|
||||
void Act3Brickster::ParseAction(char* p_extra)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10041050
|
||||
void Act3Brickster::VTable0x70(float p_time)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100416b0
|
||||
MxResult Act3Brickster::VTable0x94(LegoPathActor*, MxBool)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100417c0
|
||||
// STUB: BETA10 0x1001a407
|
||||
MxResult Act3Brickster::FUN_100417c0()
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10042990
|
||||
void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100429d0
|
||||
MxResult Act3Brickster::VTable0x9c()
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10042ab0
|
||||
Act3Shark::Act3Shark()
|
||||
{
|
||||
m_unk0x2c = 0.0f;
|
||||
m_unk0x28 = 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10042ce0
|
||||
MxResult Act3Shark::FUN_10042ce0(Act3Ammo* p_ammo)
|
||||
{
|
||||
p_ammo->SetBit5(TRUE);
|
||||
m_unk0x1c.push_back(p_ammo);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10042d40
|
||||
void Act3Shark::VTable0x70(float p_time)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10042f30
|
||||
void Act3Shark::ParseAction(char* p_extra)
|
||||
{
|
||||
LegoPathActor::ParseAction(p_extra);
|
||||
|
||||
m_world = (LegoWorld*) CurrentWorld();
|
||||
|
||||
char value[256];
|
||||
if (KeyValueStringParse(value, g_strANIMATION, p_extra)) {
|
||||
char* token = strtok(value, g_parseExtraTokens);
|
||||
|
||||
while (token != NULL) {
|
||||
LegoLocomotionAnimPresenter* presenter =
|
||||
(LegoLocomotionAnimPresenter*) m_world->Find("LegoAnimPresenter", token);
|
||||
|
||||
if (presenter != NULL) {
|
||||
token = strtok(NULL, g_parseExtraTokens);
|
||||
|
||||
if (token != NULL) {
|
||||
presenter->FUN_1006d680(this, atof(token));
|
||||
}
|
||||
}
|
||||
|
||||
token = strtok(NULL, g_parseExtraTokens);
|
||||
}
|
||||
}
|
||||
|
||||
((Act3*) m_world)->SetShark(this);
|
||||
m_unk0x34 = m_animMaps[0];
|
||||
m_unk0x38 = m_unk0x34->m_roiMap[1];
|
||||
m_unk0x38->SetVisibility(FALSE);
|
||||
m_world->PlaceActor(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user