isle/LEGO1/helicopter.cpp
Christian Semmler bc5ca621a4
(Proposal) Introduction of naming convention checker (ncc) (#322)
* Add ncc tool

* Add symlink

* Fixes

* Try this

* Try this

* Try this

* Try this

* Add include path

* Update style

* Update style

* Add more rules

* Fix style

* Update styles

* Fix name parameter

* Fix MxParam p

* Fix m_unk0x pattern

* Allow 4 digits for relative hex

* Add missing offset

* Fix some parameters

* Fix some vtables

* Fix more vtables

* Update rules, fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* Fix last issue

* Update readme

* Update readme

* Update CONTRIBUTING.md

* Fix annotations

* Rename

* Update CONTRIBUTING.md

* Update README.md
2023-12-13 11:48:14 +01:00

78 lines
1.8 KiB
C++

#include "helicopter.h"
#include "act3.h"
#include "legoanimationmanager.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoomni.h"
#include "legoutil.h"
#include "legoworld.h"
DECOMP_SIZE_ASSERT(Helicopter, 0x230)
// FUNCTION: LEGO1 0x10001e60
Helicopter::Helicopter()
{
m_unk0x13c = 60;
}
// FUNCTION: LEGO1 0x10003230
Helicopter::~Helicopter()
{
ControlManager()->Unregister(this);
IslePathActor::Destroy(TRUE);
}
// FUNCTION: LEGO1 0x100032c0
MxResult Helicopter::Create(MxDSObject& p_dsObject)
{
MxResult result = IslePathActor::Create(p_dsObject);
LegoWorld* world = GetCurrentWorld();
SetWorld(world);
if (world->IsA("Act3")) {
((Act3*) GetWorld())->SetUnkown420c(this);
}
world = GetWorld();
if (world)
world->VTable0x58(this);
GetState();
return result;
}
// FUNCTION: LEGO1 0x10003320
void Helicopter::GetState()
{
m_state = (HelicopterState*) GameState()->GetState("HelicopterState");
if (!m_state)
m_state = (HelicopterState*) GameState()->CreateState("HelicopterState");
}
// FUNCTION: LEGO1 0x10003360
void Helicopter::VTable0xe4()
{
if (!GameState()->GetUnknown10()) {
VTable0xe8(0x28, TRUE, 7);
}
IslePathActor::VTable0xe4();
if (!GameState()->GetUnknown10()) {
GameState()->SetUnknown424(0x3c);
if (GetCurrentVehicle()) {
if (GetCurrentVehicle()->IsA("IslePathActor")) {
((IslePathActor*) GetCurrentVehicle())->VTable0xe8(0x37, TRUE, 7);
}
}
}
m_state->SetUnknown8(0);
FUN_1003ee00(m_unk0x22c, 0x16);
FUN_1003ee00(m_unk0x22c, 0x17);
FUN_1003ee00(m_unk0x22c, 0x18);
FUN_1003ee00(m_unk0x22c, 0x19);
FUN_1003ee00(m_unk0x22c, 0x1a);
FUN_1003ee00(m_unk0x22c, 0x1b);
FUN_1003ee00(m_unk0x22c, 0x1c);
FUN_1003ee00(m_unk0x22c, 0x1d);
FUN_1003ee00(m_unk0x22c, 0x1e);
FUN_1003ee00(m_unk0x22c, 0x1f);
AnimationManager()->FUN_1005f6d0(TRUE);
ControlManager()->Unregister(this);
}