mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
Additional isle functions (#335)
* additional Isle functions * fix * Update isle.cpp * add notify + fix typo * Update legoutil.h * Match Isle::Create --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
177
LEGO1/isle.cpp
177
LEGO1/isle.cpp
@@ -1,27 +1,178 @@
|
||||
#include "isle.h"
|
||||
|
||||
#include "act1state.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legoinputmanager.h"
|
||||
#include "legoomni.h"
|
||||
#include "legoutil.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Isle, 0x140);
|
||||
|
||||
// FUNCTION: LEGO1 0x10030820
|
||||
Isle::Isle()
|
||||
{
|
||||
m_unk0xfc = 0;
|
||||
m_unk0x100 = 0;
|
||||
m_unk0x104 = 0;
|
||||
m_unk0x108 = 0;
|
||||
m_unk0x10c = 0;
|
||||
m_unk0x110 = 0;
|
||||
m_unk0x114 = 0;
|
||||
m_unk0x118 = 0;
|
||||
m_unk0x11c = 0;
|
||||
m_unk0x120 = 0;
|
||||
m_unk0x124 = 0;
|
||||
m_unk0x128 = 0;
|
||||
m_unk0xf8 = 0;
|
||||
m_pizza = NULL;
|
||||
m_pizzeria = NULL;
|
||||
m_towtrack = NULL;
|
||||
m_ambulance = NULL;
|
||||
m_jukebox = NULL;
|
||||
m_helicopter = NULL;
|
||||
m_bike = NULL;
|
||||
m_dunebuggy = NULL;
|
||||
m_motorcycle = NULL;
|
||||
m_skateboard = NULL;
|
||||
m_racecar = NULL;
|
||||
m_jetski = NULL;
|
||||
m_act1state = 0;
|
||||
m_unk0x13c = 0;
|
||||
|
||||
NotificationManager()->Register(this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10030a50
|
||||
Isle::~Isle()
|
||||
{
|
||||
TransitionManager()->SetWaitIndicator(NULL);
|
||||
ControlManager()->Unregister(this);
|
||||
|
||||
if (InputManager()->GetWorld() == this) {
|
||||
InputManager()->ClearWorld();
|
||||
}
|
||||
|
||||
if (GetCurrentVehicle() != NULL) {
|
||||
VTable0x6c((MxCore*) GetCurrentVehicle());
|
||||
}
|
||||
|
||||
NotificationManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10030b20
|
||||
MxResult Isle::Create(MxDSObject& p_dsObject)
|
||||
{
|
||||
GameState()->FUN_1003ceb0();
|
||||
|
||||
MxResult result = LegoWorld::SetAsCurrentWorld(p_dsObject);
|
||||
if (result == SUCCESS) {
|
||||
ControlManager()->Register(this);
|
||||
InputManager()->SetWorld(this);
|
||||
GameState()->FUN_1003a720(0);
|
||||
|
||||
switch (GameState()->GetCurrentAct()) {
|
||||
case 1:
|
||||
GameState()->FUN_1003a720(0x2e);
|
||||
break;
|
||||
case 2:
|
||||
GameState()->FUN_1003a720(0x2e);
|
||||
break;
|
||||
case -1:
|
||||
m_unk0x13c = 2;
|
||||
}
|
||||
|
||||
if (GameState()->GetUnknown424() == 1) {
|
||||
GameState()->SetUnknown424(0);
|
||||
}
|
||||
|
||||
LegoGameState* gameState = GameState();
|
||||
Act1State* state = (Act1State*) gameState->GetState("Act1State");
|
||||
if (state == NULL) {
|
||||
state = (Act1State*) gameState->CreateState("Act1State");
|
||||
}
|
||||
m_act1state = state;
|
||||
|
||||
FUN_1003ef00(TRUE);
|
||||
GameState()->SetDirty(TRUE);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10030c10
|
||||
MxLong Isle::Notify(MxParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10030fc0
|
||||
void Isle::Stop()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10031820
|
||||
void Isle::VTable0x68(MxBool p_add)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10032f10
|
||||
void Isle::VTable0x58(MxCore* p_object)
|
||||
{
|
||||
LegoWorld::VTable0x58(p_object);
|
||||
|
||||
if (p_object->IsA("Pizza")) {
|
||||
m_pizza = (Pizza*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Pizzeria")) {
|
||||
m_pizzeria = (Pizzeria*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("TowTrack")) {
|
||||
m_towtrack = (TowTrack*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Ambulance")) {
|
||||
m_ambulance = (Ambulance*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("JukeBoxEntity")) {
|
||||
m_jukebox = (JukeBoxEntity*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Helicopter")) {
|
||||
m_helicopter = (Helicopter*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Bike")) {
|
||||
m_bike = (Bike*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("DuneBuggy")) {
|
||||
m_dunebuggy = (DuneBuggy*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Motorcycle")) {
|
||||
m_motorcycle = (Motorcycle*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("SkateBoard")) {
|
||||
m_skateboard = (SkateBoard*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("Jetski")) {
|
||||
m_jetski = (Jetski*) p_object;
|
||||
}
|
||||
else if (p_object->IsA("RaceCar")) {
|
||||
m_racecar = (RaceCar*) p_object;
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10033050
|
||||
void Isle::VTable0x6c(MxCore* p_object)
|
||||
{
|
||||
LegoWorld::EndAction(p_object);
|
||||
|
||||
if (p_object->IsA("Helicopter")) {
|
||||
m_helicopter = NULL;
|
||||
}
|
||||
else if (p_object->IsA("DuneBuggy")) {
|
||||
m_dunebuggy = NULL;
|
||||
}
|
||||
else if (p_object->IsA("Jetski")) {
|
||||
m_jetski = 0;
|
||||
}
|
||||
else if (p_object->IsA("RaceCar")) {
|
||||
m_racecar = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10033180
|
||||
MxBool Isle::VTable0x64()
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user