mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-04-07 04:04:26 -04:00
Merge commit '8113a17167e92133f5a0793967bf1e485dafd07a' into new-isle-decomp
This commit is contained in:
commit
554a679dc0
91 changed files with 3227 additions and 531 deletions
CMakeLists.txt
LEGO1
lego/legoomni
include
ambulance.hbike.hcarrace.hdunebuggy.helevatorbottom.hgasstation.hhelicopter.hhospital.hinfocenter.hinfocenterdoor.hisle.hisleactor.hislepathactor.hjetski.hjetskirace.hjukebox.hlegoanimationmanager.hlegobuildingmanager.hlegocharactermanager.hlegocontrolmanager.hlegomain.hlegonavcontroller.hlegopathboundary.hlegopathcontroller.hlegopathstruct.hlegoplantmanager.hlegoplants.hlegorace.hlegovariables.hlegoworld.hmotorcycle.hmxcontrolpresenter.hpizza.hpizzeria.hpolice.hradio.hregistrationbook.hscore.hskateboard.htowtrack.h
src
actors
ambulance.cppbike.cppdunebuggy.cpphelicopter.cppisleactor.cppislepathactor.cppjetski.cppmotorcycle.cpppizza.cpppizzeria.cppradio.cppskateboard.cpptowtrack.cpp
common
legoanimationmanager.cpplegobuildingmanager.cpplegocharactermanager.cpplegoobjectfactory.cpplegoplantmanager.cpplegoplants.cpplegoutils.cpplegovariables.cppmxcontrolpresenter.cpp
control
entity
main
paths
race
worlds
mxdirectx
omni
tgl/d3drm
viewmanager
|
@ -374,6 +374,7 @@ add_library(lego1 SHARED
|
|||
LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
|
||||
LEGO1/lego/legoomni/src/common/legophoneme.cpp
|
||||
LEGO1/lego/legoomni/src/common/legoplantmanager.cpp
|
||||
LEGO1/lego/legoomni/src/common/legoplants.cpp
|
||||
LEGO1/lego/legoomni/src/common/legostate.cpp
|
||||
LEGO1/lego/legoomni/src/common/legotextureinfo.cpp
|
||||
LEGO1/lego/legoomni/src/common/legoutils.cpp
|
||||
|
@ -468,6 +469,7 @@ target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi geo
|
|||
|
||||
foreach(tgt IN LISTS lego1_targets)
|
||||
target_link_libraries(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5> SDL3::SDL3)
|
||||
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>)
|
||||
endforeach()
|
||||
|
||||
# Make sure filenames are ALL CAPS
|
||||
|
|
|
@ -122,15 +122,15 @@ public:
|
|||
return !strcmp(p_name, Ambulance::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
|
||||
void VTable0x70(float p_time) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
virtual MxLong HandleButtonDown(LegoControlManagerEvent& p_param); // vtable+0xf0
|
||||
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
|
||||
void VTable0x70(float p_time) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
virtual MxLong HandleButtonDown(LegoControlManagerNotificationParam& p_param); // vtable+0xf0
|
||||
virtual MxLong HandleEndAction(MxEndActionNotificationParam& p_param); // vtable+0xf4
|
||||
|
||||
void CreateState();
|
||||
void FUN_10036e60();
|
||||
|
|
|
@ -23,12 +23,12 @@ public:
|
|||
return !strcmp(p_name, Bike::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
void FUN_10076b60();
|
||||
void ActivateSceneActions();
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10076880
|
||||
// Bike::`scalar deleting destructor'
|
||||
|
|
|
@ -44,13 +44,13 @@ public:
|
|||
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
|
||||
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0x70
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10016c70
|
||||
// CarRace::`scalar deleting destructor'
|
||||
|
|
|
@ -23,12 +23,12 @@ public:
|
|||
return !strcmp(p_name, DuneBuggy::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
void FUN_10068350();
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "legogamestate.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d5f20
|
||||
// SIZE 0xfc
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
private:
|
||||
LegoGameState::Area m_destLocation; // 0xf8
|
||||
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
};
|
||||
|
||||
#endif // ELEVATORBOTTOM_H
|
||||
|
|
|
@ -75,12 +75,12 @@ public:
|
|||
return !strcmp(p_name, GasStation::ClassName()) || LegoWorld::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool VTable0x5c() override; // vtable+0x5c
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
void Enable(MxBool p_enable) override; // vtable+0x68
|
||||
virtual MxLong HandleControl(LegoControlManagerEvent& p_param); // vtable+0x6c
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool VTable0x5c() override; // vtable+0x5c
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
void Enable(MxBool p_enable) override; // vtable+0x68
|
||||
virtual MxLong HandleControl(LegoControlManagerNotificationParam& p_param); // vtable+0x6c
|
||||
|
||||
inline void PlayAction(MxU32 p_objectId);
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
private:
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleKeyPress(MxS8 p_key);
|
||||
MxLong HandleButtonDown(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleButtonDown(LegoControlManagerNotificationParam& p_param);
|
||||
|
||||
MxS16 m_currentActorId; // 0xf8
|
||||
undefined2 m_unk0xfa; // 0xfa
|
||||
|
|
|
@ -65,13 +65,13 @@ public:
|
|||
return !strcmp(p_name, Helicopter::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10003210
|
||||
// Helicopter::`scalar deleting destructor'
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "legostate.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class MxEndActionNotificationParam;
|
||||
class MxStillPresenter;
|
||||
|
||||
|
@ -89,8 +89,8 @@ public:
|
|||
private:
|
||||
MxLong HandleKeyPress(MxS8 p_key);
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleButtonDown(LegoControlManagerEvent& p_param);
|
||||
MxBool HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleButtonDown(LegoControlManagerNotificationParam& p_param);
|
||||
MxBool HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
|
||||
MxS16 m_currentActorId; // 0xf8
|
||||
LegoGameState::Area m_destLocation; // 0xfc
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
class MxNotificationParam;
|
||||
class MxStillPresenter;
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d93a8
|
||||
// SIZE 0x94
|
||||
|
@ -129,7 +129,7 @@ private:
|
|||
MxLong HandleKeyPress(MxS8 p_key);
|
||||
MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y);
|
||||
MxU8 HandleButtonUp(MxS32 p_x, MxS32 p_y);
|
||||
MxU8 HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxU8 HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleNotification0(MxNotificationParam& p_param);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "legogamestate.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d72d8
|
||||
// SIZE 0xfc
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
private:
|
||||
LegoGameState::Area m_destLocation; // 0xf8
|
||||
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
};
|
||||
|
||||
#endif // INFOCENTERDOOR_H
|
||||
|
|
|
@ -15,7 +15,7 @@ class Jetski;
|
|||
class JukeBoxEntity;
|
||||
class LegoNamedTexture;
|
||||
class Motocycle;
|
||||
class LegoPathStructEvent;
|
||||
class LegoPathStructNotificationParam;
|
||||
class Pizza;
|
||||
class Pizzeria;
|
||||
class RaceCar;
|
||||
|
@ -198,8 +198,8 @@ public:
|
|||
|
||||
protected:
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandlePathStruct(LegoPathStructEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param);
|
||||
MxLong HandleTransitionEnd();
|
||||
void HandleElevatorEndAction();
|
||||
void UpdateGlobe();
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "legoactor.h"
|
||||
|
||||
class LegoControlManagerNotificationParam;
|
||||
class LegoPathStructNotificationParam;
|
||||
class LegoWorld;
|
||||
class MxEndActionNotificationParam;
|
||||
class MxNotificationParam;
|
||||
|
@ -29,25 +31,25 @@ public:
|
|||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e5f0
|
||||
virtual undefined4 HandleClick() { return 0; } // vtable+0x68
|
||||
virtual MxLong HandleClick() { return 0; } // vtable+0x68
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e600
|
||||
virtual undefined4 VTable0x6c() { return 0; } // vtable+0x6c
|
||||
virtual MxLong VTable0x6c() { return 0; } // vtable+0x6c
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e610
|
||||
virtual undefined4 VTable0x70() { return 0; } // vtable+0x70
|
||||
virtual MxLong HandleEndAnim() { return 0; } // vtable+0x70
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e620
|
||||
virtual undefined4 HandleEndAction(MxEndActionNotificationParam&) { return 0; } // vtable+0x74
|
||||
virtual MxLong HandleEndAction(MxEndActionNotificationParam&) { return 0; } // vtable+0x74
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e630
|
||||
virtual undefined4 HandleButtonDown(MxNotificationParam&) { return 0; } // vtable+0x78
|
||||
virtual MxLong HandleButtonDown(LegoControlManagerNotificationParam&) { return 0; } // vtable+0x78
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e640
|
||||
virtual undefined4 HandleButtonUp(MxNotificationParam&) { return 0; } // vtable+0x7c
|
||||
virtual MxLong HandleButtonUp(LegoControlManagerNotificationParam&) { return 0; } // vtable+0x7c
|
||||
|
||||
// FUNCTION: LEGO1 0x1000e650
|
||||
virtual undefined4 VTable0x80(MxParam&) { return 0; } // vtable+0x80
|
||||
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0x80
|
||||
|
||||
protected:
|
||||
LegoWorld* m_world; // 0x78
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
#include "mxtypes.h"
|
||||
#include "roi/legoroi.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class LegoEndAnimNotificationParam;
|
||||
class LegoWorld;
|
||||
class LegoPathStructEvent;
|
||||
class LegoPathStructNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d4398
|
||||
// SIZE 0x160
|
||||
|
@ -113,13 +113,13 @@ public:
|
|||
virtual MxLong HandleNotification0() { return 0; } // vtable+0xd0
|
||||
|
||||
// FUNCTION: LEGO1 0x10002e80
|
||||
virtual MxLong HandleControl(LegoControlManagerEvent&) { return 0; } // vtable+0xd4
|
||||
virtual MxLong HandleControl(LegoControlManagerNotificationParam&) { return 0; } // vtable+0xd4
|
||||
|
||||
// FUNCTION: LEGO1 0x10002e90
|
||||
virtual MxLong HandleEndAnim(LegoEndAnimNotificationParam&) { return 0; } // vtable+0xd8
|
||||
|
||||
// FUNCTION: LEGO1 0x10002e00
|
||||
virtual MxLong HandlePathStruct(LegoPathStructEvent&) { return 0; } // vtable+0xdc
|
||||
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0xdc
|
||||
|
||||
virtual void Enter(); // vtable+0xe0
|
||||
virtual void Exit(); // vtable+0xe4
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "decomp.h"
|
||||
#include "islepathactor.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d9ec8
|
||||
// SIZE 0x164
|
||||
|
@ -25,11 +25,11 @@ public:
|
|||
return !strcmp(p_name, Jetski::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent&) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
void FUN_1007e990();
|
||||
|
||||
|
|
|
@ -48,12 +48,12 @@ public:
|
|||
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
|
||||
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0x70
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void ReadyWorld() override; // vtable+0x50
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
};
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1000f530
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "legostate.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d4a90
|
||||
// SIZE 0x10
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
// JukeBox::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
MxBool HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxBool HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
|
||||
LegoGameState::Area m_destLocation; // 0xf8
|
||||
JukeBoxState* m_state; // 0xfc
|
||||
|
|
|
@ -71,22 +71,23 @@ public:
|
|||
MxBool SetFlag() override; // vtable+0x18
|
||||
MxResult Serialize(LegoFile* p_file) override; // vtable+0x1c
|
||||
|
||||
void FUN_100651d0(MxU32, AnimInfo*, MxU32&);
|
||||
void FUN_10065240(MxU32, AnimInfo*, MxU32);
|
||||
void CopyToAnims(MxU32, AnimInfo* p_anims, MxU32& p_outExtraCharacterId);
|
||||
void InitFromAnims(MxU32 p_animsLength, AnimInfo* p_anims, MxU32 p_extraCharacterId);
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10065130
|
||||
// AnimState::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
undefined4 m_unk0x08; // 0x08
|
||||
MxU32 m_extraCharacterId; // 0x08
|
||||
|
||||
// appears to store the length of m_unk0x10
|
||||
undefined4 m_unk0x0c; // 0x0c
|
||||
// dynamically sized array of two-byte elements
|
||||
undefined2* m_unk0x10; // 0x10
|
||||
// appears to store the length of m_unk0x18
|
||||
undefined4 m_unk0x14; // 0x14
|
||||
// dynamically sized array of one-byte elements
|
||||
undefined* m_unk0x18; // 0x18
|
||||
MxU32 m_unk0x0c; // 0x0c
|
||||
// dynamically sized array of MxU16, corresponding to AnimInfo::m_unk0x22
|
||||
MxU16* m_unk0x10; // 0x10
|
||||
|
||||
MxU32 m_locationsFlagsLength; // 0x14
|
||||
// dynamically sized array of bools, corresponding to LegoLocation.m_unk0x5c
|
||||
MxBool* m_locationsFlags; // 0x18
|
||||
};
|
||||
|
||||
// VTABLE: LEGO1 0x100d8c18
|
||||
|
@ -95,7 +96,7 @@ class LegoAnimationManager : public MxCore {
|
|||
public:
|
||||
// SIZE 0x18
|
||||
struct Character {
|
||||
char* m_name; // 0x00
|
||||
const char* m_name; // 0x00
|
||||
MxBool m_inExtras; // 0x04
|
||||
MxS8 m_vehicleId; // 0x05
|
||||
undefined m_unk0x06; // 0x06 (unused?)
|
||||
|
@ -111,9 +112,9 @@ public:
|
|||
|
||||
// SIZE 0x08
|
||||
struct Vehicle {
|
||||
char* m_name; // 0x00
|
||||
MxBool m_unk0x04; // 0x04
|
||||
MxBool m_unk0x05; // 0x05
|
||||
const char* m_name; // 0x00
|
||||
MxBool m_unk0x04; // 0x04
|
||||
MxBool m_unk0x05; // 0x05
|
||||
};
|
||||
|
||||
// SIZE 0x18
|
||||
|
@ -151,7 +152,7 @@ public:
|
|||
void Resume();
|
||||
void FUN_1005f6d0(MxBool p_unk0x400);
|
||||
void EnableCamAnims(MxBool p_enableCamAnims);
|
||||
MxResult LoadScriptInfo(MxS32 p_scriptIndex);
|
||||
MxResult LoadWorldInfo(MxS32 p_worldId);
|
||||
MxBool FindVehicle(const char* p_name, MxU32& p_index);
|
||||
MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info);
|
||||
MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info);
|
||||
|
@ -244,7 +245,7 @@ private:
|
|||
void FUN_100648f0(LegoTranInfo* p_tranInfo, MxLong p_unk0x404);
|
||||
void FUN_10064b50(MxLong p_time);
|
||||
|
||||
MxS32 m_scriptIndex; // 0x08
|
||||
MxS32 m_worldId; // 0x08
|
||||
MxU16 m_animCount; // 0x0c
|
||||
MxU16 m_unk0x0e; // 0x0e
|
||||
MxU16 m_unk0x10; // 0x10
|
||||
|
|
|
@ -22,12 +22,12 @@ struct LegoBuildingInfo {
|
|||
};
|
||||
|
||||
LegoEntity* m_entity; // 0x00
|
||||
const char* m_hausName; // 0x04
|
||||
const char* m_variant; // 0x04
|
||||
MxU32 m_sound; // 0x08
|
||||
MxU32 m_move; // 0x0c
|
||||
MxU8 m_mood; // 0x10
|
||||
MxS8 m_unk0x11; // 0x11
|
||||
MxS8 m_initialUnk0x11; // 0x12 = initial value loaded to m_unk0x11
|
||||
MxS8 m_initialUnk0x11; // 0x12 - initial value loaded to m_unk0x11
|
||||
MxU8 m_flags; // 0x13
|
||||
float m_unk0x014; // 0x14
|
||||
const char* m_unk0x18; // 0x18
|
||||
|
@ -66,9 +66,9 @@ public:
|
|||
static void SetCustomizeAnimFile(const char* p_value);
|
||||
|
||||
void Init();
|
||||
void FUN_1002fa00();
|
||||
void UpdatePosition(MxS32 p_index, LegoWorld* p_world);
|
||||
void FUN_1002fb30();
|
||||
void LoadWorldInfo();
|
||||
void CreateBuilding(MxS32 p_index, LegoWorld* p_world);
|
||||
void Reset();
|
||||
MxResult Write(LegoStorage* p_storage);
|
||||
MxResult Read(LegoStorage* p_storage);
|
||||
LegoBuildingInfo* GetInfo(LegoEntity* p_entity);
|
||||
|
@ -76,8 +76,8 @@ public:
|
|||
MxBool SwitchSound(LegoEntity* p_entity);
|
||||
MxBool SwitchMove(LegoEntity* p_entity);
|
||||
MxBool SwitchMood(LegoEntity* p_entity);
|
||||
MxU32 GetBuildingEntityId(LegoEntity* p_entity);
|
||||
MxU32 FUN_1002ff40(LegoEntity* p_entity, MxBool);
|
||||
MxU32 GetAnimationId(LegoEntity* p_entity);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
|
||||
MxBool FUN_10030000(LegoEntity* p_entity);
|
||||
MxBool FUN_10030030(MxS32 p_index);
|
||||
MxBool FUN_10030110(LegoBuildingInfo* p_data);
|
||||
|
|
|
@ -74,10 +74,11 @@ public:
|
|||
MxBool SwitchSound(LegoROI* p_roi);
|
||||
MxBool SwitchMove(LegoROI* p_roi);
|
||||
MxBool SwitchMood(LegoROI* p_roi);
|
||||
MxU32 FUN_10085120(LegoROI* p_roi);
|
||||
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
||||
MxU32 GetAnimationId(LegoROI* p_roi);
|
||||
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_und);
|
||||
MxU8 GetMood(LegoROI* p_roi);
|
||||
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||
MxResult FUN_10085870(LegoROI* p_roi);
|
||||
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||
|
||||
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
|
||||
|
@ -86,7 +87,6 @@ private:
|
|||
LegoROI* CreateActorROI(const char* p_key);
|
||||
void RemoveROI(LegoROI* p_roi);
|
||||
LegoROI* FindChildROI(LegoROI* p_roi, const char* p_name);
|
||||
MxResult FUN_10085870(LegoROI* p_roi);
|
||||
|
||||
static char* g_customizeAnimFile;
|
||||
static MxU32 g_maxMove;
|
||||
|
|
|
@ -10,9 +10,9 @@ class MxControlPresenter;
|
|||
|
||||
// VTABLE: LEGO1 0x100d6a98
|
||||
// SIZE 0x2c
|
||||
class LegoControlManagerEvent : public LegoEventNotificationParam {
|
||||
class LegoControlManagerNotificationParam : public LegoEventNotificationParam {
|
||||
public:
|
||||
inline LegoControlManagerEvent() : LegoEventNotificationParam()
|
||||
inline LegoControlManagerNotificationParam() : LegoEventNotificationParam()
|
||||
{
|
||||
m_clickedObjectId = -1;
|
||||
m_clickedAtom = NULL;
|
||||
|
@ -34,10 +34,10 @@ public:
|
|||
};
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10028bf0
|
||||
// LegoControlManagerEvent::`scalar deleting destructor'
|
||||
// LegoControlManagerNotificationParam::`scalar deleting destructor'
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10028c60
|
||||
// LegoControlManagerEvent::~LegoControlManagerEvent
|
||||
// LegoControlManagerNotificationParam::~LegoControlManagerNotificationParam
|
||||
|
||||
// VTABLE: LEGO1 0x100d6a80
|
||||
class LegoControlManager : public MxCore {
|
||||
|
@ -84,13 +84,13 @@ public:
|
|||
// LegoControlManager::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
undefined4 m_unk0x08; // 0x08
|
||||
undefined4 m_unk0x0c; // 0x0c
|
||||
MxBool m_unk0x10; // 0x10
|
||||
MxPresenter* m_unk0x14; // 0x14
|
||||
LegoControlManagerEvent m_event; // 0x18
|
||||
MxPresenterList* m_presenterList; // 0x44
|
||||
LegoNotifyList m_notifyList; // 0x48
|
||||
undefined4 m_unk0x08; // 0x08
|
||||
undefined4 m_unk0x0c; // 0x0c
|
||||
MxBool m_unk0x10; // 0x10
|
||||
MxPresenter* m_unk0x14; // 0x14
|
||||
LegoControlManagerNotificationParam m_event; // 0x18
|
||||
MxPresenterList* m_presenterList; // 0x44
|
||||
LegoNotifyList m_notifyList; // 0x48
|
||||
};
|
||||
|
||||
#endif // LEGOCONTROLMANAGER_H
|
||||
|
|
|
@ -38,17 +38,17 @@ public:
|
|||
};
|
||||
|
||||
// SIZE 0x1c
|
||||
struct ScriptContainer {
|
||||
struct WorldContainer {
|
||||
// FUNCTION: LEGO1 0x1005ac40
|
||||
ScriptContainer()
|
||||
WorldContainer()
|
||||
{
|
||||
m_index = -1;
|
||||
m_id = -1;
|
||||
m_atomId = NULL;
|
||||
}
|
||||
|
||||
ScriptContainer(MxS32 p_index, const char* p_key, MxAtomId* p_atomId)
|
||||
WorldContainer(MxS32 p_id, const char* p_key, MxAtomId* p_atomId)
|
||||
{
|
||||
m_index = p_index;
|
||||
m_id = p_id;
|
||||
|
||||
if (p_key) {
|
||||
strcpy(m_key, p_key);
|
||||
|
@ -58,18 +58,18 @@ public:
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005ac50
|
||||
ScriptContainer& operator=(const ScriptContainer& p_container)
|
||||
WorldContainer& operator=(const WorldContainer& p_container)
|
||||
{
|
||||
m_index = p_container.m_index;
|
||||
m_id = p_container.m_id;
|
||||
strcpy(m_key, p_container.m_key);
|
||||
m_atomId = p_container.m_atomId;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline MxS32 GetIndex() { return m_index; }
|
||||
inline MxS32 GetId() { return m_id; }
|
||||
inline const char* GetKey() { return m_key; }
|
||||
|
||||
MxS32 m_index; // 0x00
|
||||
MxS32 m_id; // 0x00
|
||||
char m_key[20]; // 0x04
|
||||
MxAtomId* m_atomId; // 0x18
|
||||
};
|
||||
|
@ -110,10 +110,10 @@ public:
|
|||
void FUN_1005b4f0(MxBool p_disable, MxU16 p_flags);
|
||||
void CreateBackgroundAudio();
|
||||
void RemoveWorld(const MxAtomId& p_atom, MxLong p_objectId);
|
||||
MxResult RegisterScripts();
|
||||
const char* GetScriptName(MxU32 p_index);
|
||||
MxAtomId* GetScriptAtom(MxU32 p_index);
|
||||
MxS32 GetScriptIndex(const char* p_key);
|
||||
MxResult RegisterWorlds();
|
||||
const char* GetWorldName(MxU32 p_id);
|
||||
MxAtomId* GetWorldAtom(MxU32 p_id);
|
||||
MxS32 GetWorldId(const char* p_key);
|
||||
void DeleteAction();
|
||||
|
||||
static MxS32 GetCurrPathInfo(LegoPathBoundary**, MxS32&);
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
// LegoOmni::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
ScriptContainer* m_scripts; // 0x68
|
||||
WorldContainer* m_worlds; // 0x68
|
||||
ViewLODListManager* m_viewLODListManager; // 0x6c
|
||||
LegoInputManager* m_inputManager; // 0x70
|
||||
LegoTextureContainer* m_textureContainer; // 0x74
|
||||
|
|
|
@ -74,6 +74,7 @@ public:
|
|||
);
|
||||
static MxResult UpdateLocation(MxU32 p_location);
|
||||
static MxResult UpdateLocation(const char* p_location);
|
||||
static MxS32 GetNumLocations();
|
||||
static LegoLocation* GetLocation(MxU32 p_location);
|
||||
|
||||
inline void SetLinearVel(MxFloat p_linearVel) { m_linearVel = p_linearVel; }
|
||||
|
|
|
@ -7,17 +7,23 @@
|
|||
#include "mxstl/stlcompat.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
#define COMPARE_POINTER_TYPE MxS32
|
||||
#else
|
||||
#define COMPARE_POINTER_TYPE MxS32*
|
||||
#endif
|
||||
|
||||
struct LegoPathActorSetCompare {
|
||||
MxU32 operator()(const LegoPathActor* p_lhs, const LegoPathActor* p_rhs) const
|
||||
{
|
||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
||||
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||
}
|
||||
};
|
||||
|
||||
struct LegoAnimPresenterSetCompare {
|
||||
MxBool operator()(const LegoAnimPresenter* p_lhs, const LegoAnimPresenter* p_rhs) const
|
||||
{
|
||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
||||
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -14,6 +14,12 @@ class LegoWorld;
|
|||
class MxAtomId;
|
||||
class Vector3;
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
#define COMPARE_POINTER_TYPE MxS32
|
||||
#else
|
||||
#define COMPARE_POINTER_TYPE MxS32*
|
||||
#endif
|
||||
|
||||
// VTABLE: LEGO1 0x100d7da8
|
||||
// SIZE 0x40
|
||||
struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
|
||||
|
@ -21,7 +27,7 @@ struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {};
|
|||
struct LegoPathCtrlEdgeCompare {
|
||||
MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const
|
||||
{
|
||||
return (MxS32) p_lhs < (MxS32) p_rhs;
|
||||
return (COMPARE_POINTER_TYPE) p_lhs < (COMPARE_POINTER_TYPE) p_rhs;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -11,9 +11,10 @@ class LegoWorld;
|
|||
|
||||
// VTABLE: LEGO1 0x100d6230
|
||||
// SIZE 0x10
|
||||
class LegoPathStructEvent : public MxNotificationParam {
|
||||
class LegoPathStructNotificationParam : public MxNotificationParam {
|
||||
public:
|
||||
LegoPathStructEvent(NotificationId p_type, MxCore* p_sender, MxU8 p_trigger, MxS16 p_data) : MxNotificationParam()
|
||||
LegoPathStructNotificationParam(NotificationId p_type, MxCore* p_sender, MxU8 p_trigger, MxS16 p_data)
|
||||
: MxNotificationParam()
|
||||
{
|
||||
m_type = p_type;
|
||||
m_sender = p_sender;
|
||||
|
@ -24,7 +25,7 @@ public:
|
|||
// FUNCTION: LEGO1 0x1001bac0
|
||||
MxNotificationParam* Clone() const override
|
||||
{
|
||||
return new LegoPathStructEvent(m_type, m_sender, m_trigger, m_data);
|
||||
return new LegoPathStructNotificationParam(m_type, m_sender, m_trigger, m_data);
|
||||
} // vtable+0x04
|
||||
|
||||
inline MxU8 GetTrigger() { return m_trigger; }
|
||||
|
@ -99,10 +100,10 @@ private:
|
|||
};
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1001bb80
|
||||
// LegoPathStructEvent::`scalar deleting destructor'
|
||||
// LegoPathStructNotificationParam::`scalar deleting destructor'
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1001bbf0
|
||||
// LegoPathStructEvent::~LegoPathStructEvent
|
||||
// LegoPathStructNotificationParam::~LegoPathStructNotificationParam
|
||||
|
||||
// SYNTHETIC: LEGO1 0x10047440
|
||||
// LegoPathStructBase::`scalar deleting destructor'
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
#include "mxcore.h"
|
||||
|
||||
class LegoEntity;
|
||||
class LegoPathBoundary;
|
||||
struct LegoPlantInfo;
|
||||
class LegoROI;
|
||||
class LegoStorage;
|
||||
class LegoWorld;
|
||||
|
||||
// VTABLE: LEGO1 0x100d6758
|
||||
// SIZE 0x2c
|
||||
|
@ -25,18 +28,18 @@ public:
|
|||
}
|
||||
|
||||
void Init();
|
||||
void FUN_10026360(MxS32 p_scriptIndex);
|
||||
void FUN_100263a0(undefined4 p_und);
|
||||
void Write(LegoStorage* p_storage);
|
||||
void LoadWorldInfo(MxS32 p_worldId);
|
||||
void Reset(MxS32 p_worldId);
|
||||
MxResult Write(LegoStorage* p_storage);
|
||||
MxResult Read(LegoStorage* p_storage);
|
||||
MxBool SwitchColor(LegoEntity* p_entity);
|
||||
MxBool SwitchVariant(LegoEntity* p_entity);
|
||||
MxBool SwitchSound(LegoEntity* p_entity);
|
||||
MxBool SwitchMove(LegoEntity* p_entity);
|
||||
MxBool SwitchMood(LegoEntity* p_entity);
|
||||
MxU32 FUN_10026b70(LegoEntity* p_entity);
|
||||
MxU32 FUN_10026ba0(LegoEntity* p_entity, MxBool);
|
||||
void FUN_10026c50(LegoEntity* p_entity);
|
||||
MxU32 GetAnimationId(LegoEntity* p_entity);
|
||||
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
|
||||
MxBool FUN_10026c50(LegoEntity* p_entity);
|
||||
void FUN_10027120();
|
||||
|
||||
static void SetCustomizeAnimFile(const char* p_value);
|
||||
|
@ -46,9 +49,21 @@ public:
|
|||
// LegoPlantManager::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
static char* g_customizeAnimFile;
|
||||
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, MxS32 p_worldId);
|
||||
void RemovePlant(MxS32 p_index, MxS32 p_worldId);
|
||||
void FUN_10026860(MxS32 p_index);
|
||||
LegoPlantInfo* GetInfo(LegoEntity* p_entity);
|
||||
MxBool FUN_10026c80(MxS32 p_index);
|
||||
|
||||
undefined m_unk0x08[0x24]; // 0x08
|
||||
static char* g_customizeAnimFile;
|
||||
static MxS32 g_maxMove[4];
|
||||
static MxU32 g_maxSound;
|
||||
|
||||
MxS32 m_worldId; // 0x08
|
||||
undefined m_unk0x0c; // 0x0c
|
||||
undefined* m_unk0x10[5]; // 0x10
|
||||
MxS8 m_unk0x24; // 0x24
|
||||
undefined4 m_unk0x28; // 0x28
|
||||
};
|
||||
|
||||
#endif // LEGOPLANTMANAGER_H
|
||||
|
|
59
LEGO1/lego/legoomni/include/legoplants.h
Normal file
59
LEGO1/lego/legoomni/include/legoplants.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
#ifndef LEGOPLANTS_H
|
||||
#define LEGOPLANTS_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
class LegoEntity;
|
||||
class LegoPathBoundary;
|
||||
|
||||
// SIZE 0x54
|
||||
struct LegoPlantInfo {
|
||||
// See LegoOmni::RegisterWorlds for IDs
|
||||
enum World {
|
||||
c_act1 = 1 << 0,
|
||||
c_imain = 1 << 1,
|
||||
c_ielev = 1 << 4,
|
||||
c_iisle = 1 << 5,
|
||||
c_act2 = 1 << 15,
|
||||
c_act3 = 1 << 16
|
||||
};
|
||||
|
||||
enum Variant {
|
||||
e_flower = 0,
|
||||
e_tree,
|
||||
e_bush,
|
||||
e_palm
|
||||
};
|
||||
|
||||
enum Color {
|
||||
e_white = 0,
|
||||
e_black,
|
||||
e_yellow,
|
||||
e_red,
|
||||
e_green
|
||||
};
|
||||
|
||||
LegoEntity* m_entity; // 0x00
|
||||
MxU32 m_worlds; // 0x04 - see enum for possible bit flags
|
||||
MxU8 m_variant; // 0x08 - see enum for possible values
|
||||
MxU32 m_sound; // 0x0c
|
||||
MxU32 m_move; // 0x10
|
||||
MxU8 m_mood; // 0x14
|
||||
MxU8 m_color; // 0x15 - see enum for possible values
|
||||
MxS8 m_unk0x16; // 0x16
|
||||
MxS8 m_initialUnk0x16; // 0x17 - initial value loaded to m_unk0x16
|
||||
const char* m_name; // 0x18
|
||||
undefined4 m_unk0x1c; // 0x1c
|
||||
float m_x; // 0x20
|
||||
float m_y; // 0x24
|
||||
float m_z; // 0x28
|
||||
LegoPathBoundary* m_boundary; // 0x2c
|
||||
float m_position[3]; // 0x30
|
||||
float m_direction[3]; // 0x3c
|
||||
float m_up[3]; // 0x48
|
||||
};
|
||||
|
||||
extern LegoPlantInfo g_plantInfoInit[81];
|
||||
|
||||
#endif // LEGOPLANTS_H
|
|
@ -13,7 +13,7 @@ class LegoEventNotificationParam;
|
|||
class LegoPathActor;
|
||||
class MxEndActionNotificationParam;
|
||||
class MxNotificationParam;
|
||||
class LegoPathStructEvent;
|
||||
class LegoPathStructNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d5e30
|
||||
// SIZE 0x2c
|
||||
|
@ -114,11 +114,11 @@ public:
|
|||
// FUNCTION: LEGO1 0x1000dae0
|
||||
MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
|
||||
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
void Enable(MxBool p_enable) override; // vtable+0x68
|
||||
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
|
||||
virtual MxLong HandlePathStruct(LegoPathStructEvent&); // vtable+0x70
|
||||
virtual MxLong HandleEndAction(MxEndActionNotificationParam&); // vtable+0x74
|
||||
MxBool Escape() override; // vtable+0x64
|
||||
void Enable(MxBool p_enable) override; // vtable+0x68
|
||||
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
|
||||
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&); // vtable+0x70
|
||||
virtual MxLong HandleEndAction(MxEndActionNotificationParam&); // vtable+0x74
|
||||
|
||||
// FUNCTION: LEGO1 0x1000dab0
|
||||
virtual MxLong HandleType0Notification(MxNotificationParam&) { return 0; } // vtable+0x78
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "mxvariable.h"
|
||||
|
||||
extern const char* g_varMOTOSPEED;
|
||||
extern const char* g_varMOTOFUEL;
|
||||
extern const char* g_varAMBULSPEED;
|
||||
extern const char* g_varAMBULFUEL;
|
||||
extern const char* g_varTOWFUEL;
|
||||
|
|
|
@ -12,8 +12,17 @@ class LegoEntityList;
|
|||
class LegoPathBoundary;
|
||||
class LegoHideAnimPresenter;
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
#define COMPARE_POINTER_TYPE MxS32
|
||||
#else
|
||||
#define COMPARE_POINTER_TYPE MxS32*
|
||||
#endif
|
||||
|
||||
struct CoreSetCompare {
|
||||
MxS32 operator()(MxCore* const& p_a, MxCore* const& p_b) const { return (MxS32) p_a < (MxS32) p_b; }
|
||||
MxS32 operator()(MxCore* const& p_a, MxCore* const& p_b) const
|
||||
{
|
||||
return (COMPARE_POINTER_TYPE) p_a < (COMPARE_POINTER_TYPE) p_b;
|
||||
}
|
||||
};
|
||||
|
||||
typedef set<MxCore*, CoreSetCompare> MxCoreSet;
|
||||
|
@ -90,12 +99,12 @@ public:
|
|||
|
||||
inline LegoCameraController* GetCamera() { return m_cameraController; }
|
||||
inline LegoEntityList* GetEntityList() { return m_entityList; }
|
||||
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
|
||||
inline MxS32 GetWorldId() { return m_worldId; }
|
||||
inline MxBool GetUnknown0xd0Empty() { return m_set0xd0.empty(); }
|
||||
inline list<LegoROI*>& GetROIList() { return m_roiList; }
|
||||
inline LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnimPresenter; }
|
||||
|
||||
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }
|
||||
inline void SetWorldId(MxS32 p_worldId) { m_worldId = p_worldId; }
|
||||
|
||||
// SYNTHETIC: LEGO1 0x1001dee0
|
||||
// LegoWorld::`scalar deleting destructor'
|
||||
|
@ -111,7 +120,7 @@ protected:
|
|||
MxPresenterList m_controlPresenters; // 0xb8
|
||||
MxCoreSet m_set0xd0; // 0xd0
|
||||
list<LegoROI*> m_roiList; // 0xe0
|
||||
MxS32 m_scriptIndex; // 0xec
|
||||
MxS32 m_worldId; // 0xec
|
||||
LegoHideAnimPresenter* m_hideAnimPresenter; // 0xf0
|
||||
MxS16 m_startupTicks; // 0xf4
|
||||
MxBool m_worldStarted; // 0xf6
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef MOTOCYCLE_H
|
||||
#define MOTOCYCLE_H
|
||||
#ifndef MOTORCYCLE_H
|
||||
#define MOTORCYCLE_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "islepathactor.h"
|
||||
|
@ -23,22 +23,22 @@ public:
|
|||
return !strcmp(p_name, Motocycle::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructEvent&) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_time) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
void FUN_10035e10();
|
||||
void ActivateSceneActions();
|
||||
|
||||
// SYNTHETIC: LEGO1 0x100359d0
|
||||
// Motocycle::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
undefined m_unk0x160[4];
|
||||
MxFloat m_unk0x164;
|
||||
undefined m_unk0x168[4];
|
||||
undefined m_unk0x160[4]; // 0x160
|
||||
MxFloat m_fuel; // 0x164
|
||||
MxFloat m_time; // 0x168
|
||||
};
|
||||
|
||||
#endif // MOTOCYCLE_H
|
||||
#endif // MOTORCYCLE_H
|
|
@ -4,7 +4,7 @@
|
|||
#include "decomp.h"
|
||||
#include "mxcompositepresenter.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class MxVideoPresenter;
|
||||
|
||||
// VTABLE: LEGO1 0x100d7b88
|
||||
|
@ -39,7 +39,7 @@ public:
|
|||
virtual void VTable0x68(MxBool p_unk0x50); // vtable+0x68
|
||||
virtual void VTable0x6c(MxS16 p_unk0x4e); // vtable+0x6c
|
||||
|
||||
MxBool FUN_10044480(LegoControlManagerEvent* p_event, MxPresenter* p_presenter);
|
||||
MxBool FUN_10044480(LegoControlManagerNotificationParam* p_param, MxPresenter* p_presenter);
|
||||
MxBool FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter* p_presenter);
|
||||
|
||||
inline MxS16 GetUnknown0x4e() { return m_unk0x4e; }
|
||||
|
|
|
@ -99,9 +99,9 @@ public:
|
|||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
undefined4 HandleClick() override; // vtable+0x68
|
||||
undefined4 HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
undefined4 VTable0x80(MxParam&) override; // vtable+0x80
|
||||
MxLong HandleClick() override; // vtable+0x68
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x80
|
||||
|
||||
void CreateState();
|
||||
void FUN_10038220(MxU32 p_objectId);
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
undefined4 HandleClick() override; // vtable+0x68
|
||||
MxLong HandleClick() override; // vtable+0x68
|
||||
|
||||
void CreateState();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "legoworld.h"
|
||||
#include "radio.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class LegoEventNotificationParam;
|
||||
class MxDSAction;
|
||||
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
// Police::`scalar deleting destructor'
|
||||
|
||||
private:
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleKeyPress(LegoEventNotificationParam& p_param);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "legostate.h"
|
||||
#include "mxcore.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class MxAtomId;
|
||||
class MxEndActionNotificationParam;
|
||||
|
||||
|
@ -84,7 +84,7 @@ private:
|
|||
MxBool m_audioEnabled; // 0x0d
|
||||
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
};
|
||||
|
||||
#endif // RADIO_H
|
||||
|
|
|
@ -7,7 +7,7 @@ class InfocenterState;
|
|||
class MxControlPresenter;
|
||||
class MxEndActionNotificationParam;
|
||||
class MxStillPresenter;
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d9928
|
||||
// SIZE 0x2d0
|
||||
|
@ -64,7 +64,7 @@ private:
|
|||
|
||||
MxLong HandleEndAction(MxEndActionNotificationParam& p_param);
|
||||
MxLong HandleKeyPress(MxU8 p_key);
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param);
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param);
|
||||
MxLong HandleNotification19(MxParam& p_param);
|
||||
void FUN_100775c0(MxS16 p_playerIndex);
|
||||
void WriteInfocenterLetters(MxS16);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "legostate.h"
|
||||
#include "legoworld.h"
|
||||
|
||||
class LegoControlManagerEvent;
|
||||
class LegoControlManagerNotificationParam;
|
||||
class MxEndActionNotificationParam;
|
||||
|
||||
// VTABLE: LEGO1 0x100d53f8
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
|
||||
void Paint();
|
||||
MxLong FUN_10001510(MxEndActionNotificationParam& p_param);
|
||||
MxLong FUN_100016d0(LegoControlManagerEvent& p_param);
|
||||
MxLong FUN_100016d0(LegoControlManagerNotificationParam& p_param);
|
||||
void FillArea(MxU32 i_activity, MxU32 i_actor, MxS16 score);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -26,11 +26,11 @@ public:
|
|||
return !strcmp(p_name, SkateBoard::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleNotification0() override; // vtable+0xd0
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleNotification0() override; // vtable+0xd0
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
inline void SetUnknown0x160(MxBool p_unk0x160) { m_unk0x160 = p_unk0x160; }
|
||||
|
||||
|
|
|
@ -82,14 +82,14 @@ public:
|
|||
return !strcmp(p_name, TowTrack::ClassName()) || IslePathActor::IsA(p_name);
|
||||
}
|
||||
|
||||
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerEvent& p_param) override; // vtable+0xd4
|
||||
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
||||
MxLong HandlePathStruct(LegoPathStructEvent& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
MxLong Notify(MxParam& p_param) override; // vtable+0x04
|
||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||
void VTable0x70(float p_float) override; // vtable+0x70
|
||||
MxLong HandleClick() override; // vtable+0xcc
|
||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
||||
MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0xdc
|
||||
void Exit() override; // vtable+0xe4
|
||||
|
||||
void CreateState();
|
||||
void FUN_1004dab0();
|
||||
|
|
|
@ -139,16 +139,16 @@ MxLong Ambulance::Notify(MxParam& p_param)
|
|||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
result = HandleButtonDown((LegoControlManagerEvent&) p_param);
|
||||
result = HandleButtonDown((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationClick:
|
||||
result = HandleClick();
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
|
|||
|
||||
// FUNCTION: LEGO1 0x100367c0
|
||||
// FUNCTION: BETA10 0x100230bf
|
||||
MxLong Ambulance::HandleButtonDown(LegoControlManagerEvent& p_param)
|
||||
MxLong Ambulance::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (m_unk0x170 == 1) {
|
||||
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
|
||||
|
@ -266,7 +266,7 @@ MxLong Ambulance::HandleButtonDown(LegoControlManagerEvent& p_param)
|
|||
|
||||
// FUNCTION: LEGO1 0x10036860
|
||||
// FUNCTION: BETA10 0x100231bf
|
||||
MxLong Ambulance::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
MxLong Ambulance::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||
{
|
||||
// 0x168 corresponds to the path at the gas station
|
||||
if (p_param.GetData() == 0x168) {
|
||||
|
@ -437,7 +437,7 @@ void Ambulance::Leave()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10036f90
|
||||
MxLong Ambulance::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Ambulance::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
#include "bike.h"
|
||||
|
||||
#include "isle.h"
|
||||
#include "isle_actions.h"
|
||||
#include "jukebox_actions.h"
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legoutils.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxsoundpresenter.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
#include "scripts.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Bike, 0x164)
|
||||
|
@ -13,9 +18,9 @@ DECOMP_SIZE_ASSERT(Bike, 0x164)
|
|||
// FUNCTION: LEGO1 0x10076670
|
||||
Bike::Bike()
|
||||
{
|
||||
this->m_maxLinearVel = 20.0;
|
||||
this->m_unk0x150 = 3.0;
|
||||
this->m_unk0x148 = 1;
|
||||
m_maxLinearVel = 20.0;
|
||||
m_unk0x150 = 3.0;
|
||||
m_unk0x148 = 1;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100768f0
|
||||
|
@ -44,22 +49,75 @@ void Bike::Exit()
|
|||
ControlManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100769a0
|
||||
// FUNCTION: LEGO1 0x100769a0
|
||||
MxLong Bike::HandleClick()
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
if (FUN_1003ef60()) {
|
||||
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
|
||||
FUN_10015820(TRUE, 0);
|
||||
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_bike);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::TransitionType::e_mosaic, 50, FALSE, TRUE);
|
||||
|
||||
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
Enter();
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_BikeDashboard, NULL);
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
|
||||
Vector3 position = m_roi->GetWorldPosition();
|
||||
AnimationManager()->FUN_10064670(&position);
|
||||
AnimationManager()->FUN_10064740(&position);
|
||||
ControlManager()->Register(this);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10076aa0
|
||||
MxLong Bike::HandleControl(LegoControlManagerEvent& p_param)
|
||||
// FUNCTION: LEGO1 0x10076aa0
|
||||
MxLong Bike::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
MxLong result = 0;
|
||||
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
case IsleScript::c_BikeArms_Ctl:
|
||||
Exit();
|
||||
GameState()->m_currentArea = LegoGameState::e_unk66;
|
||||
result = 1;
|
||||
break;
|
||||
case IsleScript::c_BikeInfo_Ctl:
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
Exit();
|
||||
result = 1;
|
||||
break;
|
||||
case IsleScript::c_BikeHorn_Ctl:
|
||||
MxSoundPresenter* presenter =
|
||||
(MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "BikeHorn_Sound");
|
||||
presenter->Enable(p_param.GetUnknown0x28());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10076b60
|
||||
void Bike::FUN_10076b60()
|
||||
// FUNCTION: LEGO1 0x10076b60
|
||||
void Bike::ActivateSceneActions()
|
||||
{
|
||||
// TODO
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
|
||||
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
|
||||
if (!act1state->m_unk0x022) {
|
||||
act1state->m_unk0x022 = TRUE;
|
||||
|
||||
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
|
||||
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);
|
||||
|
||||
AnimationManager()
|
||||
->FUN_10060dc0(IsleScript::c_sns006in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,14 +38,14 @@ MxLong DuneBuggy::HandleClick()
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x100681b0
|
||||
MxLong DuneBuggy::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong DuneBuggy::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10068270
|
||||
MxLong DuneBuggy::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
MxLong DuneBuggy::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
|
|
@ -152,7 +152,7 @@ MxLong Helicopter::HandleClick()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100035e0
|
||||
MxLong Helicopter::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxU32 ret = 0;
|
||||
MxAtomId script;
|
||||
|
|
|
@ -37,19 +37,19 @@ MxLong IsleActor::Notify(MxParam& p_param)
|
|||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationButtonUp:
|
||||
result = HandleButtonUp((MxNotificationParam&) p_param);
|
||||
result = HandleButtonUp((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
result = HandleButtonDown((MxNotificationParam&) p_param);
|
||||
result = HandleButtonDown((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationClick:
|
||||
result = HandleClick();
|
||||
break;
|
||||
case c_notificationEndAnim:
|
||||
result = VTable0x70();
|
||||
result = HandleEndAnim();
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = VTable0x80(p_param);
|
||||
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,13 +58,13 @@ MxLong IslePathActor::Notify(MxParam& p_param)
|
|||
result = HandleClick();
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationEndAnim:
|
||||
result = HandleEndAnim((LegoEndAnimNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ MxLong Jetski::HandleClick()
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x1007e8e0
|
||||
MxLong Jetski::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Jetski::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
|
|
@ -1,58 +1,163 @@
|
|||
#include "motocycle.h"
|
||||
#include "motorcycle.h"
|
||||
|
||||
#include "isle.h"
|
||||
#include "isle_actions.h"
|
||||
#include "jukebox_actions.h"
|
||||
#include "legoanimationmanager.h"
|
||||
#include "legocontrolmanager.h"
|
||||
#include "legonavcontroller.h"
|
||||
#include "legopathstruct.h"
|
||||
#include "legoutils.h"
|
||||
#include "legovariables.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxtimer.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
#include "mxvariabletable.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Motocycle, 0x16c)
|
||||
|
||||
// FUNCTION: LEGO1 0x100357b0
|
||||
Motocycle::Motocycle()
|
||||
{
|
||||
this->m_maxLinearVel = 40.0;
|
||||
this->m_unk0x150 = 1.75;
|
||||
this->m_unk0x148 = 1;
|
||||
this->m_unk0x164 = 1.0;
|
||||
m_maxLinearVel = 40.0;
|
||||
m_unk0x150 = 1.75;
|
||||
m_unk0x148 = 1;
|
||||
m_fuel = 1.0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035a40
|
||||
// FUNCTION: LEGO1 0x10035a40
|
||||
MxResult Motocycle::Create(MxDSAction& p_dsAction)
|
||||
{
|
||||
// TODO
|
||||
return SUCCESS;
|
||||
MxResult result = IslePathActor::Create(p_dsAction);
|
||||
m_world = CurrentWorld();
|
||||
|
||||
if (m_world) {
|
||||
m_world->Add(this);
|
||||
}
|
||||
|
||||
VariableTable()->SetVariable(g_varMOTOFUEL, "1.0");
|
||||
m_fuel = 1.0;
|
||||
m_time = Timer()->GetTime();
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035ad0
|
||||
void Motocycle::VTable0x70(float p_float)
|
||||
// FUNCTION: LEGO1 0x10035ad0
|
||||
void Motocycle::VTable0x70(float p_time)
|
||||
{
|
||||
// TODO
|
||||
IslePathActor::VTable0x70(p_time);
|
||||
|
||||
if (UserActor() == this) {
|
||||
char buf[200];
|
||||
float speed = abs(m_worldSpeed);
|
||||
float maxLinearVel = NavController()->GetMaxLinearVel();
|
||||
|
||||
sprintf(buf, "%g", speed / maxLinearVel);
|
||||
VariableTable()->SetVariable(g_varMOTOSPEED, buf);
|
||||
|
||||
m_fuel += (p_time - m_time) * -3.333333333e-06f;
|
||||
if (m_fuel < 0) {
|
||||
m_fuel = 0;
|
||||
}
|
||||
|
||||
m_time = p_time;
|
||||
|
||||
sprintf(buf, "%g", m_fuel);
|
||||
VariableTable()->SetVariable(g_varMOTOFUEL, buf);
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035bc0
|
||||
// FUNCTION: LEGO1 0x10035bc0
|
||||
void Motocycle::Exit()
|
||||
{
|
||||
// TODO
|
||||
IslePathActor::Exit();
|
||||
GameState()->m_currentArea = LegoGameState::e_motocycle;
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_MotoBikeDashboard_Bitmap);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_MotoBikeArms_Ctl);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_MotoBikeInfo_Ctl);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_MotoBikeSpeedMeter);
|
||||
RemoveFromCurrentWorld(*g_isleScript, IsleScript::c_MotoBikeFuelMeter);
|
||||
ControlManager()->Unregister(this);
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035c50
|
||||
// FUNCTION: LEGO1 0x10035c50
|
||||
MxLong Motocycle::HandleClick()
|
||||
{
|
||||
// TODO
|
||||
if (!FUN_1003ef60()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
FUN_10015820(TRUE, 0);
|
||||
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::Area::e_motocycle);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::TransitionType::e_mosaic, 50, FALSE, TRUE);
|
||||
|
||||
if (GameState()->GetActorId() != UserActor()->GetActorId()) {
|
||||
((IslePathActor*) UserActor())->Exit();
|
||||
}
|
||||
|
||||
m_time = Timer()->GetTime();
|
||||
|
||||
Enter();
|
||||
InvokeAction(Extra::ActionType::e_start, *g_isleScript, IsleScript::c_MotoBikeDashboard, NULL);
|
||||
GetCurrentAction().SetObjectId(-1);
|
||||
|
||||
Vector3 position = m_roi->GetWorldPosition();
|
||||
AnimationManager()->FUN_10064670(&position);
|
||||
AnimationManager()->FUN_10064740(&position);
|
||||
ControlManager()->Register(this);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10035d70
|
||||
MxLong Motocycle::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
case IsleScript::c_MotoBikeArms_Ctl:
|
||||
Exit();
|
||||
GameState()->m_currentArea = LegoGameState::e_unk66;
|
||||
result = 1;
|
||||
break;
|
||||
case IsleScript::c_MotoBikeInfo_Ctl:
|
||||
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||
Exit();
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10035df0
|
||||
MxLong Motocycle::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||
{
|
||||
// 0x168 corresponds to the path at the gas station
|
||||
if (p_param.GetData() == 0x168) {
|
||||
m_fuel = 1.0f;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10035d70
|
||||
MxLong Motocycle::HandleControl(LegoControlManagerEvent& p_param)
|
||||
// FUNCTION: LEGO1 0x10035e10
|
||||
void Motocycle::ActivateSceneActions()
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
PlayMusic(JukeboxScript::c_PoliceStation_Music);
|
||||
|
||||
// STUB: LEGO1 0x10035df0
|
||||
MxLong Motocycle::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
|
||||
if (!act1state->m_unk0x022) {
|
||||
act1state->m_unk0x022 = TRUE;
|
||||
|
||||
// STUB: LEGO1 0x10035e10
|
||||
void Motocycle::FUN_10035e10()
|
||||
{
|
||||
// TODO
|
||||
MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
|
||||
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);
|
||||
|
||||
AnimationManager()
|
||||
->FUN_10060dc0(IsleScript::c_sns006in_RunAnim, &mat, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,14 +72,14 @@ void Pizza::FUN_10038380()
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x100383f0
|
||||
undefined4 Pizza::HandleClick()
|
||||
MxLong Pizza::HandleClick()
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100384f0
|
||||
undefined4 Pizza::VTable0x80(MxParam&)
|
||||
MxLong Pizza::HandlePathStruct(LegoPathStructNotificationParam&)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
@ -93,7 +93,7 @@ MxResult Pizza::Tickle()
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x10038b10
|
||||
undefined4 Pizza::HandleEndAction(MxEndActionNotificationParam&)
|
||||
MxLong Pizza::HandleEndAction(MxEndActionNotificationParam&)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
|
|
@ -46,7 +46,7 @@ void Pizzeria::CreateState()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10017a50
|
||||
undefined4 Pizzeria::HandleClick()
|
||||
MxLong Pizzeria::HandleClick()
|
||||
{
|
||||
if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) {
|
||||
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
||||
|
|
|
@ -91,7 +91,7 @@ MxLong Radio::Notify(MxParam& p_param)
|
|||
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ void Radio::Stop()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1002cbc0
|
||||
MxLong Radio::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Radio::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxDSAction action; // Unused
|
||||
MxS32 objectId = p_param.GetClickedObjectId();
|
||||
|
|
|
@ -106,7 +106,7 @@ MxLong SkateBoard::HandleClick()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10010230
|
||||
MxLong SkateBoard::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong SkateBoard::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxU32 result = 0;
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ MxLong TowTrack::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x1004d330
|
||||
MxLong TowTrack::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
MxLong TowTrack::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
@ -109,7 +109,7 @@ void TowTrack::Exit()
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x1004d9e0
|
||||
MxLong TowTrack::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong TowTrack::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
|
|
@ -415,8 +415,8 @@ void LegoAnimationManager::Suspend()
|
|||
m_animState = (AnimState*) GameState()->CreateState("AnimState");
|
||||
}
|
||||
|
||||
if (m_scriptIndex == 0) {
|
||||
m_animState->FUN_10065240(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
if (m_worldId == 0) {
|
||||
m_animState->InitFromAnims(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
}
|
||||
|
||||
if (!m_suspended) {
|
||||
|
@ -494,7 +494,7 @@ void LegoAnimationManager::Resume()
|
|||
void LegoAnimationManager::Init()
|
||||
{
|
||||
m_unk0x402 = FALSE;
|
||||
m_scriptIndex = -1;
|
||||
m_worldId = -1;
|
||||
m_animCount = 0;
|
||||
m_anims = NULL;
|
||||
m_unk0x18 = 0;
|
||||
|
@ -579,12 +579,12 @@ void LegoAnimationManager::EnableCamAnims(MxBool p_enableCamAnims)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005f720
|
||||
MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
|
||||
MxResult LegoAnimationManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
{
|
||||
MxResult result = FAILURE;
|
||||
MxS32 i, j, k;
|
||||
|
||||
if (m_scriptIndex != p_scriptIndex) {
|
||||
if (m_worldId != p_worldId) {
|
||||
if (m_tranInfoList != NULL) {
|
||||
delete m_tranInfoList;
|
||||
m_tranInfoList = NULL;
|
||||
|
@ -614,22 +614,22 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
|
|||
m_animState = (AnimState*) GameState()->CreateState("AnimState");
|
||||
}
|
||||
|
||||
if (m_scriptIndex == 0) {
|
||||
m_animState->FUN_10065240(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
if (m_worldId == 0) {
|
||||
m_animState->InitFromAnims(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
}
|
||||
|
||||
DeleteAnimations();
|
||||
|
||||
LegoFile file;
|
||||
|
||||
if (p_scriptIndex == -1) {
|
||||
if (p_worldId == -1) {
|
||||
result = SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
|
||||
char filename[128];
|
||||
char path[1024];
|
||||
sprintf(filename, "lego\\data\\%sinf.dta", Lego()->GetScriptName(p_scriptIndex));
|
||||
sprintf(filename, "lego\\data\\%sinf.dta", Lego()->GetWorldName(p_worldId));
|
||||
sprintf(path, "%s", MxOmni::GetHD());
|
||||
|
||||
if (path[strlen(path) - 1] != '\\') {
|
||||
|
@ -708,7 +708,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
|
|||
}
|
||||
}
|
||||
|
||||
m_scriptIndex = p_scriptIndex;
|
||||
m_worldId = p_worldId;
|
||||
m_tranInfoList = new LegoTranInfoList();
|
||||
m_tranInfoList2 = new LegoTranInfoList();
|
||||
|
||||
|
@ -726,8 +726,8 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
|
|||
m_unk0x402 = FALSE;
|
||||
}
|
||||
|
||||
if (p_scriptIndex == 0) {
|
||||
m_animState->FUN_100651d0(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
if (p_worldId == 0) {
|
||||
m_animState->CopyToAnims(m_animCount, m_anims, m_lastExtraCharacterId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -934,7 +934,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
|
|||
{
|
||||
MxResult result = FAILURE;
|
||||
|
||||
if (m_scriptIndex != -1 && p_index < m_animCount && m_tranInfoList != NULL) {
|
||||
if (m_worldId != -1 && p_index < m_animCount && m_tranInfoList != NULL) {
|
||||
PurgeExtra(FALSE);
|
||||
FUN_10062770();
|
||||
|
||||
|
@ -983,7 +983,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
|
|||
char buf[256];
|
||||
sprintf(buf, "%s:%d", g_strANIMMAN_ID, tranInfo->m_index);
|
||||
|
||||
action.SetAtomId(*Lego()->GetScriptAtom(m_scriptIndex));
|
||||
action.SetAtomId(*Lego()->GetWorldAtom(m_worldId));
|
||||
action.SetObjectId(animInfo.m_objectId);
|
||||
action.SetUnknown24(-1);
|
||||
action.AppendExtra(strlen(buf) + 1, buf);
|
||||
|
@ -1050,7 +1050,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix
|
|||
char buf[256];
|
||||
sprintf(buf, "%s:%d", g_strANIMMAN_ID, info->m_index);
|
||||
|
||||
action.SetAtomId(*Lego()->GetScriptAtom(m_scriptIndex));
|
||||
action.SetAtomId(*Lego()->GetWorldAtom(m_worldId));
|
||||
action.SetObjectId(p_objectId);
|
||||
action.SetUnknown24(-1);
|
||||
action.AppendExtra(strlen(buf) + 1, buf);
|
||||
|
@ -2828,26 +2828,59 @@ AnimState::AnimState()
|
|||
{
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x10 = NULL;
|
||||
m_unk0x14 = 0;
|
||||
m_unk0x18 = NULL;
|
||||
m_locationsFlagsLength = 0;
|
||||
m_locationsFlags = NULL;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10065150
|
||||
// FUNCTION: LEGO1 0x10065150
|
||||
AnimState::~AnimState()
|
||||
{
|
||||
// TODO
|
||||
delete[] m_unk0x10;
|
||||
delete[] m_locationsFlags;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100651d0
|
||||
void AnimState::FUN_100651d0(MxU32, AnimInfo*, MxU32&)
|
||||
// FUNCTION: LEGO1 0x100651d0
|
||||
void AnimState::CopyToAnims(MxU32, AnimInfo* p_anims, MxU32& p_outExtraCharacterId)
|
||||
{
|
||||
// TODO
|
||||
if (m_unk0x10 != NULL) {
|
||||
for (MxS32 i = 0; i < m_unk0x0c; i++) {
|
||||
p_anims[i].m_unk0x22 = m_unk0x10[i];
|
||||
}
|
||||
|
||||
p_outExtraCharacterId = m_extraCharacterId;
|
||||
|
||||
for (MxS32 j = 0; j < m_locationsFlagsLength; j++) {
|
||||
LegoLocation* location = LegoNavController::GetLocation(j);
|
||||
if (location != NULL) {
|
||||
location->m_unk0x5c = m_locationsFlags[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10065240
|
||||
void AnimState::FUN_10065240(MxU32, AnimInfo*, MxU32)
|
||||
// FUNCTION: LEGO1 0x10065240
|
||||
void AnimState::InitFromAnims(MxU32 p_animsLength, AnimInfo* p_anims, MxU32 p_extraCharacterId)
|
||||
{
|
||||
// TODO
|
||||
if (m_unk0x10 == NULL) {
|
||||
m_unk0x0c = p_animsLength;
|
||||
m_unk0x10 = new MxU16[p_animsLength];
|
||||
MxS32 numLocations = LegoNavController::GetNumLocations();
|
||||
m_locationsFlagsLength = numLocations;
|
||||
m_locationsFlags = new MxBool[numLocations];
|
||||
}
|
||||
|
||||
m_extraCharacterId = p_extraCharacterId;
|
||||
|
||||
for (MxS32 i = 0; i < m_unk0x0c; i++) {
|
||||
m_unk0x10[i] = p_anims[i].m_unk0x22;
|
||||
}
|
||||
|
||||
for (MxS32 j = 0; j < m_locationsFlagsLength; j++) {
|
||||
LegoLocation* location = LegoNavController::GetLocation(j);
|
||||
if (location != NULL) {
|
||||
m_locationsFlags[j] = location->m_unk0x5c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100652d0
|
||||
|
@ -2864,57 +2897,77 @@ MxResult AnimState::Serialize(LegoFile* p_file)
|
|||
}
|
||||
|
||||
if (p_file->IsReadMode()) {
|
||||
Read(p_file, &m_unk0x08);
|
||||
Read(p_file, &m_extraCharacterId);
|
||||
|
||||
// m_unk0x10_len and m_unk0x10
|
||||
if (m_unk0x10) {
|
||||
delete[] m_unk0x10;
|
||||
}
|
||||
|
||||
Read(p_file, &m_unk0x0c);
|
||||
if (m_unk0x0c != 0) {
|
||||
m_unk0x10 = new undefined2[m_unk0x0c];
|
||||
m_unk0x10 = new MxU16[m_unk0x0c];
|
||||
}
|
||||
else {
|
||||
m_unk0x10 = NULL;
|
||||
}
|
||||
|
||||
for (MxS32 i = 0; i < m_unk0x0c; i++) {
|
||||
Read(p_file, &m_unk0x10[i]);
|
||||
}
|
||||
|
||||
// m_unk0x18_len and m_unk0x18
|
||||
// Note that here we read first and then free memory in contrast to above
|
||||
Read(p_file, &m_unk0x14);
|
||||
if (m_unk0x18) {
|
||||
delete[] m_unk0x18;
|
||||
Read(p_file, &m_locationsFlagsLength);
|
||||
|
||||
if (m_locationsFlags) {
|
||||
delete[] m_locationsFlags;
|
||||
}
|
||||
if (m_unk0x14 != 0) {
|
||||
m_unk0x18 = new undefined[m_unk0x14];
|
||||
|
||||
if (m_locationsFlagsLength != 0) {
|
||||
m_locationsFlags = new MxBool[m_locationsFlagsLength];
|
||||
}
|
||||
else {
|
||||
m_unk0x18 = NULL;
|
||||
m_locationsFlags = NULL;
|
||||
}
|
||||
for (MxS32 j = 0; j < m_unk0x14; j++) {
|
||||
Read(p_file, &m_unk0x18[j]);
|
||||
|
||||
for (MxS32 j = 0; j < m_locationsFlagsLength; j++) {
|
||||
Read(p_file, &m_locationsFlags[j]);
|
||||
}
|
||||
}
|
||||
else if (p_file->IsWriteMode()) {
|
||||
Write(p_file, m_unk0x08);
|
||||
Write(p_file, m_extraCharacterId);
|
||||
|
||||
Write(p_file, m_unk0x0c);
|
||||
for (MxS32 i = 0; i < m_unk0x0c; i++) {
|
||||
Write(p_file, m_unk0x10[i]);
|
||||
}
|
||||
Write(p_file, m_unk0x14);
|
||||
for (MxS32 j = 0; j < m_unk0x14; j++) {
|
||||
Write(p_file, m_unk0x18[j]);
|
||||
|
||||
Write(p_file, m_locationsFlagsLength);
|
||||
for (MxS32 j = 0; j < m_locationsFlagsLength; j++) {
|
||||
Write(p_file, m_locationsFlags[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100654f0
|
||||
// FUNCTION: LEGO1 0x100654f0
|
||||
MxBool AnimState::SetFlag()
|
||||
{
|
||||
// TODO
|
||||
if (m_unk0x10 != NULL) {
|
||||
m_extraCharacterId = NULL;
|
||||
|
||||
for (MxS32 i = 0; i < m_unk0x0c; i++) {
|
||||
m_unk0x10[i] = 0;
|
||||
}
|
||||
|
||||
for (MxS32 j = 0; j < m_locationsFlagsLength; j++) {
|
||||
if (LegoNavController::GetLocation(j) != NULL) {
|
||||
m_locationsFlags[j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ DECOMP_SIZE_ASSERT(LegoBuildingInfo, 0x2c)
|
|||
DECOMP_SIZE_ASSERT(LegoBuildingManager::AnimEntry, 0x14)
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3410
|
||||
const char* g_buildingInfoHausName[5] = {
|
||||
const char* g_buildingInfoVariants[5] = {
|
||||
"haus1",
|
||||
"haus4",
|
||||
"haus5",
|
||||
|
@ -196,14 +196,14 @@ LegoBuildingInfo g_buildingInfoInit[16] = {
|
|||
MxU32 LegoBuildingManager::g_maxSound = 6;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f373c
|
||||
MxU32 g_cycleLengthOffset1 = 0x3c;
|
||||
MxU32 g_unk0x100f373c = 0x3c;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3740
|
||||
MxU32 g_cycleLengthOffset3 = 0x42;
|
||||
MxU32 g_unk0x100f3740 = 0x42;
|
||||
|
||||
// clang-format off
|
||||
// GLOBAL: LEGO1 0x100f3788
|
||||
MxU32 g_buildingEntityId[16] = {
|
||||
MxU32 g_buildingAnimationId[16] = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x46, 0x49, 0x4c,
|
||||
|
@ -238,7 +238,7 @@ LegoBuildingManager::LegoBuildingManager()
|
|||
// FUNCTION: LEGO1 0x1002f960
|
||||
LegoBuildingManager::~LegoBuildingManager()
|
||||
{
|
||||
delete g_customizeAnimFile;
|
||||
delete[] g_customizeAnimFile;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1002f9d0
|
||||
|
@ -257,25 +257,25 @@ void LegoBuildingManager::Init()
|
|||
|
||||
// FUNCTION: LEGO1 0x1002fa00
|
||||
// FUNCTION: BETA10 0x10063ad1
|
||||
void LegoBuildingManager::FUN_1002fa00()
|
||||
void LegoBuildingManager::LoadWorldInfo()
|
||||
{
|
||||
MxS32 i;
|
||||
LegoWorld* world = CurrentWorld();
|
||||
|
||||
for (i = 0; i < sizeOfArray(g_buildingInfo); i++) {
|
||||
UpdatePosition(i, world);
|
||||
CreateBuilding(i, world);
|
||||
}
|
||||
|
||||
if (g_buildingManagerConfig <= 1) {
|
||||
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingInfoHausName[0]);
|
||||
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingInfoVariants[0]);
|
||||
if (entity) {
|
||||
entity->GetROI()->SetVisibility(TRUE);
|
||||
m_unk0x09 = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < sizeOfArray(g_buildingInfoHausName); i++) {
|
||||
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingInfoHausName[i]);
|
||||
for (i = 0; i < sizeOfArray(g_buildingInfoVariants); i++) {
|
||||
LegoEntity* entity = (LegoEntity*) world->Find("MxEntity", g_buildingInfoVariants[i]);
|
||||
if (entity) {
|
||||
entity->GetROI()->SetVisibility(m_nextVariant == i);
|
||||
}
|
||||
|
@ -287,9 +287,9 @@ void LegoBuildingManager::FUN_1002fa00()
|
|||
|
||||
// FUNCTION: LEGO1 0x1002fa90
|
||||
// FUNCTION: BETA10 0x10063b88
|
||||
void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world)
|
||||
void LegoBuildingManager::CreateBuilding(MxS32 p_index, LegoWorld* p_world)
|
||||
{
|
||||
LegoEntity* entity = (LegoEntity*) p_world->Find("MxEntity", g_buildingInfo[p_index].m_hausName);
|
||||
LegoEntity* entity = (LegoEntity*) p_world->Find("MxEntity", g_buildingInfo[p_index].m_variant);
|
||||
|
||||
if (entity) {
|
||||
entity->SetType(LegoEntity::e_building);
|
||||
|
@ -304,7 +304,7 @@ void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1002fb30
|
||||
void LegoBuildingManager::FUN_1002fb30()
|
||||
void LegoBuildingManager::Reset()
|
||||
{
|
||||
MxU32 i;
|
||||
|
||||
|
@ -451,13 +451,13 @@ MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity)
|
|||
|
||||
if (info != NULL && info->m_flags & LegoBuildingInfo::c_hasVariants && info->m_unk0x11 == -1) {
|
||||
LegoROI* roi = p_entity->GetROI();
|
||||
if (++m_nextVariant >= sizeOfArray(g_buildingInfoHausName)) {
|
||||
if (++m_nextVariant >= sizeOfArray(g_buildingInfoVariants)) {
|
||||
m_nextVariant = 0;
|
||||
}
|
||||
|
||||
roi->SetVisibility(FALSE);
|
||||
info->m_hausName = g_buildingInfoHausName[m_nextVariant];
|
||||
UpdatePosition(12, CurrentWorld());
|
||||
info->m_variant = g_buildingInfoVariants[m_nextVariant];
|
||||
CreateBuilding(12, CurrentWorld());
|
||||
|
||||
if (info->m_entity != NULL) {
|
||||
info->m_entity->GetROI()->SetVisibility(TRUE);
|
||||
|
@ -531,12 +531,12 @@ MxBool LegoBuildingManager::SwitchMood(LegoEntity* p_entity)
|
|||
|
||||
// FUNCTION: LEGO1 0x1002ff00
|
||||
// FUNCTION: BETA10 0x1006432d
|
||||
MxU32 LegoBuildingManager::GetBuildingEntityId(LegoEntity* p_entity)
|
||||
MxU32 LegoBuildingManager::GetAnimationId(LegoEntity* p_entity)
|
||||
{
|
||||
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info != NULL && info->m_flags & LegoBuildingInfo::c_hasMoves) {
|
||||
return g_buildingEntityId[info - g_buildingInfo] + info->m_move;
|
||||
return g_buildingAnimationId[info - g_buildingInfo] + info->m_move;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -544,7 +544,7 @@ MxU32 LegoBuildingManager::GetBuildingEntityId(LegoEntity* p_entity)
|
|||
|
||||
// FUNCTION: LEGO1 0x1002ff40
|
||||
// FUNCTION: BETA10 0x10064398
|
||||
MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state)
|
||||
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
|
||||
{
|
||||
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||
|
||||
|
@ -553,11 +553,11 @@ MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state)
|
|||
}
|
||||
|
||||
if (p_state) {
|
||||
return info->m_mood + g_cycleLengthOffset3;
|
||||
return info->m_mood + g_unk0x100f3740;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_sound + g_cycleLengthOffset1;
|
||||
return info->m_sound + g_unk0x100f373c;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -28,7 +28,7 @@ MxU32 LegoCharacterManager::g_maxMove = 4;
|
|||
MxU32 LegoCharacterManager::g_maxSound = 9;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e0
|
||||
MxU32 g_unk0x100fc4e0 = 10;
|
||||
MxU32 g_characterAnimationId = 10;
|
||||
|
||||
// GLOBAL: LEGO1 0x100fc4e4
|
||||
char* LegoCharacterManager::g_customizeAnimFile = NULL;
|
||||
|
@ -884,19 +884,19 @@ MxBool LegoCharacterManager::SwitchMood(LegoROI* p_roi)
|
|||
|
||||
// FUNCTION: LEGO1 0x10085120
|
||||
// FUNCTION: BETA10 0x1007680c
|
||||
MxU32 LegoCharacterManager::FUN_10085120(LegoROI* p_roi)
|
||||
MxU32 LegoCharacterManager::GetAnimationId(LegoROI* p_roi)
|
||||
{
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_move + g_unk0x100fc4e0;
|
||||
return info->m_move + g_characterAnimationId;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085140
|
||||
MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
||||
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_und)
|
||||
{
|
||||
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#include "legoworld.h"
|
||||
#include "legoworldpresenter.h"
|
||||
#include "misc.h"
|
||||
#include "motocycle.h"
|
||||
#include "motorcycle.h"
|
||||
#include "mxcompositemediapresenter.h"
|
||||
#include "mxcontrolpresenter.h"
|
||||
#include "pizza.h"
|
||||
|
|
|
@ -1,104 +1,430 @@
|
|||
#include "legoplantmanager.h"
|
||||
|
||||
#include "3dmanager/lego3dmanager.h"
|
||||
#include "legocharactermanager.h"
|
||||
#include "legoentity.h"
|
||||
#include "legoplants.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "misc/legostorage.h"
|
||||
#include "scripts.h"
|
||||
#include "sndanim_actions.h"
|
||||
#include "viewmanager/viewmanager.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoPlantManager, 0x2c)
|
||||
|
||||
// GLOBAL: LEGO1 0x100f1660
|
||||
const char* g_plantLodNames[4][5] = {
|
||||
{"flwrwht", "flwrblk", "flwryel", "flwrred", "flwrgrn"},
|
||||
{"treewht", "treeblk", "treeyel", "treered", "tree"},
|
||||
{"bushwht", "bushblk", "bushyel", "bushred", "bush"},
|
||||
{"palmwht", "palmblk", "palmyel", "palmred", "palm"}
|
||||
};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f16b0
|
||||
float g_unk0x100f16b0[] = {0.1f, 0.7f, 0.5f, 0.9f};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f16c0
|
||||
MxU8 g_unk0x100f16c0[] = {1, 2, 2, 3};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f315c
|
||||
MxU32 LegoPlantManager::g_maxSound = 8;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3160
|
||||
MxU32 g_unk0x100f3160 = 56;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3164
|
||||
MxU32 g_unk0x100f3164 = 66;
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3168
|
||||
MxS32 LegoPlantManager::g_maxMove[4] = {3, 3, 3, 3};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3178
|
||||
MxU32 g_plantAnimationId[4] = {30, 33, 36, 39};
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3188
|
||||
char* LegoPlantManager::g_customizeAnimFile = NULL;
|
||||
|
||||
// GLOBAL: LEGO1 0x10103180
|
||||
LegoPlantInfo g_plantInfo[81];
|
||||
|
||||
// FUNCTION: LEGO1 0x10026220
|
||||
LegoPlantManager::LegoPlantManager()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100262c0
|
||||
// FUNCTION: LEGO1 0x100262c0
|
||||
LegoPlantManager::~LegoPlantManager()
|
||||
{
|
||||
// TODO
|
||||
delete[] g_customizeAnimFile;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026330
|
||||
// FUNCTION: LEGO1 0x10026330
|
||||
// FUNCTION: BETA10 0x100c4f90
|
||||
void LegoPlantManager::Init()
|
||||
{
|
||||
// TODO
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
g_plantInfo[i] = g_plantInfoInit[i];
|
||||
}
|
||||
|
||||
m_worldId = -1;
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x24 = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026360
|
||||
void LegoPlantManager::FUN_10026360(MxS32 p_scriptIndex)
|
||||
// FUNCTION: LEGO1 0x10026360
|
||||
// FUNCTION: BETA10 0x100c5032
|
||||
void LegoPlantManager::LoadWorldInfo(MxS32 p_worldId)
|
||||
{
|
||||
// TODO
|
||||
m_worldId = p_worldId;
|
||||
LegoWorld* world = CurrentWorld();
|
||||
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
CreatePlant(i, world, p_worldId);
|
||||
}
|
||||
|
||||
m_unk0x0c = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100263a0
|
||||
void LegoPlantManager::FUN_100263a0(undefined4 p_und)
|
||||
// FUNCTION: LEGO1 0x100263a0
|
||||
void LegoPlantManager::Reset(MxS32 p_worldId)
|
||||
{
|
||||
// TODO
|
||||
MxU32 i;
|
||||
DeleteObjects(g_sndAnimScript, SndanimScript::c_AnimC1, SndanimScript::c_AnimBld18);
|
||||
|
||||
for (i = 0; i < m_unk0x24; i++) {
|
||||
delete m_unk0x10[i];
|
||||
}
|
||||
|
||||
m_unk0x24 = 0;
|
||||
|
||||
for (i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
RemovePlant(i, p_worldId);
|
||||
}
|
||||
|
||||
m_worldId = -1;
|
||||
m_unk0x0c = 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026720
|
||||
void LegoPlantManager::Write(LegoStorage* p_storage)
|
||||
// FUNCTION: LEGO1 0x10026590
|
||||
// FUNCTION: BETA10 0x100c561e
|
||||
LegoEntity* LegoPlantManager::CreatePlant(MxS32 p_index, LegoWorld* p_world, MxS32 p_worldId)
|
||||
{
|
||||
// TODO
|
||||
LegoEntity* entity = NULL;
|
||||
|
||||
if (p_index < sizeOfArray(g_plantInfo)) {
|
||||
MxU32 world = 1 << (MxU8) p_worldId;
|
||||
|
||||
if (g_plantInfo[p_index].m_worlds & world && g_plantInfo[p_index].m_unk0x16 != 0) {
|
||||
if (g_plantInfo[p_index].m_entity == NULL) {
|
||||
char name[256];
|
||||
char lodName[256];
|
||||
|
||||
sprintf(name, "plant%d", p_index);
|
||||
sprintf(lodName, "%s", g_plantLodNames[g_plantInfo[p_index].m_variant][g_plantInfo[p_index].m_color]);
|
||||
|
||||
LegoROI* roi = CharacterManager()->CreateAutoROI(name, lodName, TRUE);
|
||||
roi->SetVisibility(TRUE);
|
||||
|
||||
entity = roi->GetEntity();
|
||||
entity->SetLocation(
|
||||
g_plantInfo[p_index].m_position,
|
||||
g_plantInfo[p_index].m_direction,
|
||||
g_plantInfo[p_index].m_up,
|
||||
FALSE
|
||||
);
|
||||
entity->SetType(LegoEntity::e_plant);
|
||||
g_plantInfo[p_index].m_entity = entity;
|
||||
}
|
||||
else {
|
||||
entity = g_plantInfo[p_index].m_entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100267b0
|
||||
// FUNCTION: LEGO1 0x100266c0
|
||||
// FUNCTION: BETA10 0x100c5859
|
||||
void LegoPlantManager::RemovePlant(MxS32 p_index, MxS32 p_worldId)
|
||||
{
|
||||
if (p_index < sizeOfArray(g_plantInfo)) {
|
||||
MxU32 world = 1 << (MxU8) p_worldId;
|
||||
|
||||
if (g_plantInfo[p_index].m_worlds & world && g_plantInfo[p_index].m_entity != NULL) {
|
||||
CharacterManager()->ReleaseAutoROI(g_plantInfo[p_index].m_entity->GetROI());
|
||||
g_plantInfo[p_index].m_entity = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10026720
|
||||
// FUNCTION: BETA10 0x100c5918
|
||||
MxResult LegoPlantManager::Write(LegoStorage* p_storage)
|
||||
{
|
||||
MxResult result = FAILURE;
|
||||
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
LegoPlantInfo* info = &g_plantInfo[i];
|
||||
|
||||
if (p_storage->Write(&info->m_variant, sizeof(info->m_variant)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_move, sizeof(info->m_move)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_color, sizeof(info->m_color)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&info->m_initialUnk0x16, sizeof(info->m_initialUnk0x16)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
result = SUCCESS;
|
||||
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100267b0
|
||||
// FUNCTION: BETA10 0x100c5a76
|
||||
MxResult LegoPlantManager::Read(LegoStorage* p_storage)
|
||||
{
|
||||
return SUCCESS;
|
||||
MxResult result = FAILURE;
|
||||
|
||||
for (MxS32 i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
LegoPlantInfo* info = &g_plantInfo[i];
|
||||
|
||||
if (p_storage->Read(&info->m_variant, sizeof(info->m_variant)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_move, sizeof(info->m_move)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_color, sizeof(info->m_color)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&info->m_unk0x16, sizeof(info->m_unk0x16)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
info->m_initialUnk0x16 = info->m_unk0x16;
|
||||
FUN_10026860(i);
|
||||
}
|
||||
|
||||
result = SUCCESS;
|
||||
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026920
|
||||
// FUNCTION: LEGO1 0x10026860
|
||||
// FUNCTION: BETA10 0x100c5be0
|
||||
void LegoPlantManager::FUN_10026860(MxS32 p_index)
|
||||
{
|
||||
MxU8 variant = g_plantInfo[p_index].m_variant;
|
||||
|
||||
if (g_plantInfo[p_index].m_unk0x16 >= 0) {
|
||||
float value = g_unk0x100f16c0[variant] - g_plantInfo[p_index].m_unk0x16;
|
||||
g_plantInfo[p_index].m_position[1] = g_plantInfoInit[p_index].m_position[1] - value * g_unk0x100f16b0[variant];
|
||||
}
|
||||
else {
|
||||
g_plantInfo[p_index].m_position[1] = g_plantInfoInit[p_index].m_position[1];
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100268e0
|
||||
// FUNCTION: BETA10 0x100c5c95
|
||||
LegoPlantInfo* LegoPlantManager::GetInfo(LegoEntity* p_entity)
|
||||
{
|
||||
MxS32 i;
|
||||
|
||||
for (i = 0; i < sizeOfArray(g_plantInfo); i++) {
|
||||
if (g_plantInfo[i].m_entity == p_entity) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < sizeOfArray(g_plantInfo)) {
|
||||
return &g_plantInfo[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10026920
|
||||
// FUNCTION: BETA10 0x100c5dc9
|
||||
MxBool LegoPlantManager::SwitchColor(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LegoROI* roi = p_entity->GetROI();
|
||||
info->m_color++;
|
||||
|
||||
if (info->m_color > LegoPlantInfo::e_green) {
|
||||
info->m_color = LegoPlantInfo::e_white;
|
||||
}
|
||||
|
||||
ViewLODList* lodList = GetViewLODListManager()->Lookup(g_plantLodNames[info->m_variant][info->m_color]);
|
||||
|
||||
if (roi->GetUnknown0xe0() >= 0) {
|
||||
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(roi);
|
||||
}
|
||||
|
||||
roi->SetLODList(lodList);
|
||||
lodList->Release();
|
||||
CharacterManager()->FUN_10085870(roi);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100269e0
|
||||
// FUNCTION: LEGO1 0x100269e0
|
||||
// FUNCTION: BETA10 0x100c5ee2
|
||||
MxBool LegoPlantManager::SwitchVariant(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info == NULL || info->m_unk0x16 != -1) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LegoROI* roi = p_entity->GetROI();
|
||||
info->m_variant++;
|
||||
|
||||
if (info->m_variant > LegoPlantInfo::e_palm) {
|
||||
info->m_variant = LegoPlantInfo::e_flower;
|
||||
}
|
||||
|
||||
ViewLODList* lodList = GetViewLODListManager()->Lookup(g_plantLodNames[info->m_variant][info->m_color]);
|
||||
|
||||
if (roi->GetUnknown0xe0() >= 0) {
|
||||
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(roi);
|
||||
}
|
||||
|
||||
roi->SetLODList(lodList);
|
||||
lodList->Release();
|
||||
CharacterManager()->FUN_10085870(roi);
|
||||
|
||||
if (info->m_move != 0 && info->m_move >= g_maxMove[info->m_variant]) {
|
||||
info->m_move = g_maxMove[info->m_variant] - 1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026ad0
|
||||
// FUNCTION: LEGO1 0x10026ad0
|
||||
// FUNCTION: BETA10 0x100c6049
|
||||
MxBool LegoPlantManager::SwitchSound(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
MxBool result = FALSE;
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_sound++;
|
||||
|
||||
if (info->m_sound >= g_maxSound) {
|
||||
info->m_sound = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026b00
|
||||
// FUNCTION: LEGO1 0x10026b00
|
||||
// FUNCTION: BETA10 0x100c60a7
|
||||
MxBool LegoPlantManager::SwitchMove(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
MxBool result = FALSE;
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_move++;
|
||||
|
||||
if (info->m_move >= g_maxMove[info->m_variant]) {
|
||||
info->m_move = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026b40
|
||||
// FUNCTION: LEGO1 0x10026b40
|
||||
// FUNCTION: BETA10 0x100c610e
|
||||
MxBool LegoPlantManager::SwitchMood(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
return FALSE;
|
||||
MxBool result = FALSE;
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info != NULL) {
|
||||
info->m_mood++;
|
||||
|
||||
if (info->m_mood > 3) {
|
||||
info->m_mood = 0;
|
||||
}
|
||||
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026b70
|
||||
MxU32 LegoPlantManager::FUN_10026b70(LegoEntity* p_entity)
|
||||
// FUNCTION: LEGO1 0x10026b70
|
||||
// FUNCTION: BETA10 0x100c6168
|
||||
MxU32 LegoPlantManager::GetAnimationId(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info != NULL) {
|
||||
return g_plantAnimationId[info->m_variant] + info->m_move;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026ba0
|
||||
MxU32 LegoPlantManager::FUN_10026ba0(LegoEntity* p_entity, MxBool)
|
||||
// FUNCTION: LEGO1 0x10026ba0
|
||||
// FUNCTION: BETA10 0x100c61ba
|
||||
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
|
||||
{
|
||||
// TODO
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (p_state) {
|
||||
return (info->m_mood & 1) + g_unk0x100f3164;
|
||||
}
|
||||
|
||||
if (info != NULL) {
|
||||
return info->m_sound + g_unk0x100f3160;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10026be0
|
||||
// FUNCTION: BETA10 0x100c62bc
|
||||
void LegoPlantManager::SetCustomizeAnimFile(const char* p_value)
|
||||
{
|
||||
if (g_customizeAnimFile != NULL) {
|
||||
|
@ -117,17 +443,66 @@ void LegoPlantManager::SetCustomizeAnimFile(const char* p_value)
|
|||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026c50
|
||||
void LegoPlantManager::FUN_10026c50(LegoEntity* p_entity)
|
||||
// FUNCTION: LEGO1 0x10026c50
|
||||
// FUNCTION: BETA10 0x100c6349
|
||||
MxBool LegoPlantManager::FUN_10026c50(LegoEntity* p_entity)
|
||||
{
|
||||
// TODO
|
||||
LegoPlantInfo* info = GetInfo(p_entity);
|
||||
|
||||
if (info == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FUN_10026c80(info - g_plantInfo);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10026c80
|
||||
// FUNCTION: BETA10 0x100c63eb
|
||||
MxBool LegoPlantManager::FUN_10026c80(MxS32 p_index)
|
||||
{
|
||||
if (p_index >= sizeOfArray(g_plantInfo)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LegoPlantInfo* info = &g_plantInfo[p_index];
|
||||
|
||||
if (info == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MxBool result = TRUE;
|
||||
|
||||
if (info->m_unk0x16 < 0) {
|
||||
info->m_unk0x16 = g_unk0x100f16c0[info->m_variant];
|
||||
}
|
||||
|
||||
if (info->m_unk0x16 > 0) {
|
||||
LegoROI* roi = info->m_entity->GetROI();
|
||||
info->m_unk0x16--;
|
||||
|
||||
if (info->m_unk0x16 == 1) {
|
||||
info->m_unk0x16 = 0;
|
||||
}
|
||||
|
||||
if (info->m_unk0x16 == 0) {
|
||||
roi->SetVisibility(FALSE);
|
||||
}
|
||||
else {
|
||||
FUN_10026860(info - g_plantInfo);
|
||||
info->m_entity->SetLocation(info->m_position, info->m_direction, info->m_up, FALSE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = FALSE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026e00
|
||||
MxResult LegoPlantManager::Tickle()
|
||||
{
|
||||
// TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
1951
LEGO1/lego/legoomni/src/common/legoplants.cpp
Normal file
1951
LEGO1/lego/legoomni/src/common/legoplants.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -368,7 +368,7 @@ void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBo
|
|||
MxLong result = 0;
|
||||
|
||||
if (world != NULL) {
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, LegoPathStruct::c_camAnim, p_location);
|
||||
LegoPathStructNotificationParam param(c_notificationPathStruct, p_actor, LegoPathStruct::c_camAnim, p_location);
|
||||
result = world->Notify(param);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,14 @@ DECOMP_SIZE_ASSERT(CursorVariable, 0x24)
|
|||
DECOMP_SIZE_ASSERT(WhoAmIVariable, 0x24)
|
||||
DECOMP_SIZE_ASSERT(CustomizeAnimFileVariable, 0x24)
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3994
|
||||
// STRING: LEGO1 0x100f3988
|
||||
const char* g_varMOTOSPEED = "motoSPEED";
|
||||
|
||||
// GLOBAL: LEGO1 0x100f3998
|
||||
// STRING: LEGO1 0x100f397c
|
||||
const char* g_varMOTOFUEL = "motoFUEL";
|
||||
|
||||
// GLOBAL: LEGO1 0x100f39b8
|
||||
// STRING: LEGO1 0x100f39ac
|
||||
const char* g_varAMBULSPEED = "ambulSPEED";
|
||||
|
|
|
@ -175,27 +175,27 @@ MxBool MxControlPresenter::FUN_10044270(MxS32 p_x, MxS32 p_y, MxVideoPresenter*
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10044480
|
||||
MxBool MxControlPresenter::FUN_10044480(LegoControlManagerEvent* p_event, MxPresenter* p_presenter)
|
||||
MxBool MxControlPresenter::FUN_10044480(LegoControlManagerNotificationParam* p_param, MxPresenter* p_presenter)
|
||||
{
|
||||
if (IsEnabled()) {
|
||||
switch (p_event->GetNotification()) {
|
||||
switch (p_param->GetNotification()) {
|
||||
case c_notificationButtonUp:
|
||||
if (m_unk0x4c == 0 || m_unk0x4c == 2 || m_unk0x4c == 3) {
|
||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
p_param->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_param->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
VTable0x6c(0);
|
||||
p_event->SetNotification(c_notificationControl);
|
||||
p_event->SetUnknown0x28(m_unk0x4e);
|
||||
p_param->SetNotification(c_notificationControl);
|
||||
p_param->SetUnknown0x28(m_unk0x4e);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
if (FUN_10044270(p_event->GetX(), p_event->GetY(), (MxVideoPresenter*) p_presenter)) {
|
||||
p_event->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_event->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
if (FUN_10044270(p_param->GetX(), p_param->GetY(), (MxVideoPresenter*) p_presenter)) {
|
||||
p_param->SetClickedObjectId(m_action->GetObjectId());
|
||||
p_param->SetClickedAtom(m_action->GetAtomId().GetInternal());
|
||||
VTable0x6c(m_unk0x56);
|
||||
p_event->SetNotification(c_notificationControl);
|
||||
p_event->SetUnknown0x28(m_unk0x4e);
|
||||
p_param->SetNotification(c_notificationControl);
|
||||
p_param->SetUnknown0x28(m_unk0x4e);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "mxticklemanager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoControlManager, 0x60)
|
||||
DECOMP_SIZE_ASSERT(LegoControlManagerEvent, 0x2c)
|
||||
DECOMP_SIZE_ASSERT(LegoControlManagerNotificationParam, 0x2c)
|
||||
|
||||
// FUNCTION: LEGO1 0x10028520
|
||||
LegoControlManager::LegoControlManager()
|
||||
|
|
|
@ -256,15 +256,15 @@ void LegoEntity::ClickSound(MxBool p_und)
|
|||
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
objectId = CharacterManager()->FUN_10085140(m_roi, p_und);
|
||||
objectId = CharacterManager()->GetSoundId(m_roi, p_und);
|
||||
break;
|
||||
case e_unk1:
|
||||
break;
|
||||
case e_plant:
|
||||
objectId = PlantManager()->FUN_10026ba0(this, p_und);
|
||||
objectId = PlantManager()->GetSoundId(this, p_und);
|
||||
break;
|
||||
case e_building:
|
||||
objectId = BuildingManager()->FUN_1002ff40(this, p_und);
|
||||
objectId = BuildingManager()->GetSoundId(this, p_und);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -290,19 +290,19 @@ void LegoEntity::ClickAnimation()
|
|||
|
||||
switch (m_type) {
|
||||
case e_actor:
|
||||
objectId = LegoOmni::GetInstance()->GetCharacterManager()->FUN_10085120(m_roi);
|
||||
objectId = LegoOmni::GetInstance()->GetCharacterManager()->GetAnimationId(m_roi);
|
||||
action.SetAtomId(MxAtomId(LegoCharacterManager::GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:actor_01:%s", name);
|
||||
break;
|
||||
case e_unk1:
|
||||
break;
|
||||
case e_plant:
|
||||
objectId = LegoOmni::GetInstance()->GetPlantManager()->FUN_10026b70(this);
|
||||
objectId = LegoOmni::GetInstance()->GetPlantManager()->GetAnimationId(this);
|
||||
action.SetAtomId(MxAtomId(LegoPlantManager::GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:bush:%s:tree:%s:flwrred:%s:palm:%s", name, name, name, name);
|
||||
break;
|
||||
case e_building:
|
||||
objectId = LegoOmni::GetInstance()->GetBuildingManager()->GetBuildingEntityId(this);
|
||||
objectId = LegoOmni::GetInstance()->GetBuildingManager()->GetAnimationId(this);
|
||||
action.SetAtomId(MxAtomId(BuildingManager()->GetCustomizeAnimFile(), e_lowerCase2));
|
||||
sprintf(extra, "SUBST:haus1:%s", name);
|
||||
break;
|
||||
|
|
|
@ -482,6 +482,12 @@ LegoLocation* LegoNavController::GetLocation(MxU32 p_location)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10055740
|
||||
MxS32 LegoNavController::GetNumLocations()
|
||||
{
|
||||
return sizeOfArray(g_locations);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10055750
|
||||
MxResult LegoNavController::ProcessJoystickInput(MxBool& p_und)
|
||||
{
|
||||
|
|
|
@ -100,7 +100,7 @@ MxResult LegoWorld::Create(MxDSAction& p_dsAction)
|
|||
}
|
||||
|
||||
SetIsWorldActive(TRUE);
|
||||
m_scriptIndex = -1;
|
||||
m_worldId = -1;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -177,9 +177,9 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
|
|||
}
|
||||
}
|
||||
|
||||
if (m_scriptIndex != -1 && m_set0xd0.empty()) {
|
||||
PlantManager()->FUN_100263a0(m_scriptIndex);
|
||||
BuildingManager()->FUN_1002fb30();
|
||||
if (m_worldId != -1 && m_set0xd0.empty()) {
|
||||
PlantManager()->Reset(m_worldId);
|
||||
BuildingManager()->Reset();
|
||||
}
|
||||
|
||||
if (m_entityList) {
|
||||
|
@ -691,10 +691,10 @@ void LegoWorld::Enable(MxBool p_enable)
|
|||
Lego()->SetNavController(m_cameraController->GetNavController());
|
||||
}
|
||||
|
||||
if (m_scriptIndex != -1) {
|
||||
PlantManager()->FUN_10026360(m_scriptIndex);
|
||||
AnimationManager()->LoadScriptInfo(m_scriptIndex);
|
||||
BuildingManager()->FUN_1002fa00();
|
||||
if (m_worldId != -1) {
|
||||
PlantManager()->LoadWorldInfo(m_worldId);
|
||||
AnimationManager()->LoadWorldInfo(m_worldId);
|
||||
BuildingManager()->LoadWorldInfo();
|
||||
AnimationManager()->Resume();
|
||||
}
|
||||
|
||||
|
@ -714,9 +714,9 @@ void LegoWorld::Enable(MxBool p_enable)
|
|||
AnimationManager()->Reset(FALSE);
|
||||
m_set0xd0.insert(this);
|
||||
|
||||
if (m_scriptIndex != -1) {
|
||||
PlantManager()->FUN_100263a0(m_scriptIndex);
|
||||
BuildingManager()->FUN_1002fb30();
|
||||
if (m_worldId != -1) {
|
||||
PlantManager()->Reset(m_worldId);
|
||||
BuildingManager()->Reset();
|
||||
}
|
||||
|
||||
MxPresenterListCursor controlPresenterCursor(&m_controlPresenters);
|
||||
|
|
|
@ -54,10 +54,10 @@ LegoWorldPresenter::~LegoWorldPresenter()
|
|||
{
|
||||
MxBool result = FALSE;
|
||||
if (m_entity) {
|
||||
MxS32 scriptIndex = ((LegoWorld*) m_entity)->GetScriptIndex();
|
||||
PlantManager()->FUN_10026360(scriptIndex);
|
||||
AnimationManager()->LoadScriptInfo(scriptIndex);
|
||||
BuildingManager()->FUN_1002fa00();
|
||||
MxS32 worldId = ((LegoWorld*) m_entity)->GetWorldId();
|
||||
PlantManager()->LoadWorldInfo(worldId);
|
||||
AnimationManager()->LoadWorldInfo(worldId);
|
||||
BuildingManager()->LoadWorldInfo();
|
||||
result = ((LegoWorld*) m_entity)->VTable0x5c();
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ void LegoWorldPresenter::ParseExtra()
|
|||
if (KeyValueStringParse(output, g_strWORLD, extraCopy)) {
|
||||
char* worldKey = strtok(output, g_parseExtraTokens);
|
||||
LoadWorld(worldKey, (LegoWorld*) m_entity);
|
||||
((LegoWorld*) m_entity)->SetScriptIndex(Lego()->GetScriptIndex(worldKey));
|
||||
((LegoWorld*) m_entity)->SetWorldId(Lego()->GetWorldId(worldKey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "viewmanager/viewmanager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoOmni, 0x140)
|
||||
DECOMP_SIZE_ASSERT(LegoOmni::ScriptContainer, 0x1c)
|
||||
DECOMP_SIZE_ASSERT(LegoOmni::WorldContainer, 0x1c)
|
||||
DECOMP_SIZE_ASSERT(LegoWorldList, 0x18)
|
||||
DECOMP_SIZE_ASSERT(LegoWorldListCursor, 0x10)
|
||||
|
||||
|
@ -58,7 +58,7 @@ LegoOmni::~LegoOmni()
|
|||
void LegoOmni::Init()
|
||||
{
|
||||
MxOmni::Init();
|
||||
m_scripts = NULL;
|
||||
m_worlds = NULL;
|
||||
m_inputManager = NULL;
|
||||
m_viewLODListManager = NULL;
|
||||
m_textureContainer = NULL;
|
||||
|
@ -145,8 +145,8 @@ void LegoOmni::Destroy()
|
|||
m_action.ClearAtom();
|
||||
DestroyScripts();
|
||||
|
||||
if (m_scripts) {
|
||||
delete[] m_scripts;
|
||||
if (m_worlds) {
|
||||
delete[] m_worlds;
|
||||
}
|
||||
|
||||
MxOmni::Destroy();
|
||||
|
@ -235,7 +235,7 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
|
|||
|
||||
CreateScripts();
|
||||
IslePathActor::RegisterSpawnLocations();
|
||||
result = RegisterScripts();
|
||||
result = RegisterWorlds();
|
||||
|
||||
if (result != SUCCESS) {
|
||||
goto done;
|
||||
|
@ -264,33 +264,33 @@ done:
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005a5f0
|
||||
MxResult LegoOmni::RegisterScripts()
|
||||
MxResult LegoOmni::RegisterWorlds()
|
||||
{
|
||||
m_scripts = new ScriptContainer[19];
|
||||
m_worlds = new WorldContainer[19];
|
||||
|
||||
if (!m_scripts) {
|
||||
if (!m_worlds) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_scripts[0] = ScriptContainer();
|
||||
m_scripts[1] = ScriptContainer(0, "ACT1", g_isleScript);
|
||||
m_scripts[2] = ScriptContainer(1, "IMAIN", g_infomainScript);
|
||||
m_scripts[3] = ScriptContainer(2, "ICUBE", g_infoscorScript);
|
||||
m_scripts[4] = ScriptContainer(3, "IREG", g_regbookScript);
|
||||
m_scripts[5] = ScriptContainer(4, "IELEV", g_elevbottScript);
|
||||
m_scripts[6] = ScriptContainer(5, "IISLE", g_infodoorScript);
|
||||
m_scripts[7] = ScriptContainer(6, "HOSP", g_hospitalScript);
|
||||
m_scripts[8] = ScriptContainer(7, "POLICE", g_policeScript);
|
||||
m_scripts[9] = ScriptContainer(8, "GMAIN", g_garageScript);
|
||||
m_scripts[10] = ScriptContainer(9, "BLDH", g_copterScript);
|
||||
m_scripts[11] = ScriptContainer(10, "BLDD", g_dunecarScript);
|
||||
m_scripts[12] = ScriptContainer(11, "BLDJ", g_jetskiScript);
|
||||
m_scripts[13] = ScriptContainer(12, "BLDR", g_racecarScript);
|
||||
m_scripts[14] = ScriptContainer(13, "RACC", g_carraceScript);
|
||||
m_scripts[15] = ScriptContainer(14, "RACJ", g_jetraceScript);
|
||||
m_scripts[16] = ScriptContainer(15, "ACT2", g_act2mainScript);
|
||||
m_scripts[17] = ScriptContainer(16, "ACT3", g_act3Script);
|
||||
m_scripts[18] = ScriptContainer(17, "TEST", g_testScript);
|
||||
m_worlds[0] = WorldContainer();
|
||||
m_worlds[1] = WorldContainer(0, "ACT1", g_isleScript);
|
||||
m_worlds[2] = WorldContainer(1, "IMAIN", g_infomainScript);
|
||||
m_worlds[3] = WorldContainer(2, "ICUBE", g_infoscorScript);
|
||||
m_worlds[4] = WorldContainer(3, "IREG", g_regbookScript);
|
||||
m_worlds[5] = WorldContainer(4, "IELEV", g_elevbottScript);
|
||||
m_worlds[6] = WorldContainer(5, "IISLE", g_infodoorScript);
|
||||
m_worlds[7] = WorldContainer(6, "HOSP", g_hospitalScript);
|
||||
m_worlds[8] = WorldContainer(7, "POLICE", g_policeScript);
|
||||
m_worlds[9] = WorldContainer(8, "GMAIN", g_garageScript);
|
||||
m_worlds[10] = WorldContainer(9, "BLDH", g_copterScript);
|
||||
m_worlds[11] = WorldContainer(10, "BLDD", g_dunecarScript);
|
||||
m_worlds[12] = WorldContainer(11, "BLDJ", g_jetskiScript);
|
||||
m_worlds[13] = WorldContainer(12, "BLDR", g_racecarScript);
|
||||
m_worlds[14] = WorldContainer(13, "RACC", g_carraceScript);
|
||||
m_worlds[15] = WorldContainer(14, "RACJ", g_jetraceScript);
|
||||
m_worlds[16] = WorldContainer(15, "ACT2", g_act2mainScript);
|
||||
m_worlds[17] = WorldContainer(16, "ACT3", g_act3Script);
|
||||
m_worlds[18] = WorldContainer(17, "TEST", g_testScript);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -474,11 +474,11 @@ MxS32 LegoOmni::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b430
|
||||
const char* LegoOmni::GetScriptName(MxU32 p_index)
|
||||
const char* LegoOmni::GetWorldName(MxU32 p_id)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if (m_scripts[i].m_index == p_index) {
|
||||
return m_scripts[i].m_key;
|
||||
if (m_worlds[i].m_id == p_id) {
|
||||
return m_worlds[i].m_key;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -486,11 +486,11 @@ const char* LegoOmni::GetScriptName(MxU32 p_index)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b460
|
||||
MxAtomId* LegoOmni::GetScriptAtom(MxU32 p_index)
|
||||
MxAtomId* LegoOmni::GetWorldAtom(MxU32 p_id)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if (m_scripts[i].m_index == p_index) {
|
||||
return m_scripts[i].m_atomId;
|
||||
if (m_worlds[i].m_id == p_id) {
|
||||
return m_worlds[i].m_atomId;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,11 +498,11 @@ MxAtomId* LegoOmni::GetScriptAtom(MxU32 p_index)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005b490
|
||||
MxS32 LegoOmni::GetScriptIndex(const char* p_key)
|
||||
MxS32 LegoOmni::GetWorldId(const char* p_key)
|
||||
{
|
||||
for (MxS32 i = 0; i < 19; i++) {
|
||||
if ((MxS32) &m_scripts[i] != -4 && !strcmpi(m_scripts[i].GetKey(), p_key)) {
|
||||
return m_scripts[i].GetIndex();
|
||||
if ((MxS32) &m_worlds[i] != -4 && !strcmpi(m_worlds[i].GetKey(), p_key)) {
|
||||
return m_worlds[i].GetId();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
|||
case c_d: {
|
||||
p_actor->VTable0x58(p_data);
|
||||
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
LegoPathStructNotificationParam param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
p_actor->Notify(param);
|
||||
|
||||
LegoWorld* world = CurrentWorld();
|
||||
|
@ -80,7 +80,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
|||
case c_s: {
|
||||
LegoWorld* world = CurrentWorld();
|
||||
if (world != NULL) {
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
LegoPathStructNotificationParam param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
|
||||
if (world->Notify(param) != 0) {
|
||||
break;
|
||||
|
@ -93,7 +93,7 @@ MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction,
|
|||
case c_w: {
|
||||
LegoWorld* world = CurrentWorld();
|
||||
if (world != NULL) {
|
||||
LegoPathStructEvent param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
LegoPathStructNotificationParam param(c_notificationPathStruct, p_actor, m_name[2], p_data);
|
||||
NotificationManager()->Send(world, param);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -32,7 +32,7 @@ MxLong CarRace::HandleEndAction(MxEndActionNotificationParam&)
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x100170e0
|
||||
MxLong CarRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
MxLong CarRace::HandlePathStruct(LegoPathStructNotificationParam&)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
|
|
|
@ -26,7 +26,7 @@ MxLong JetskiRace::HandleClick(LegoEventNotificationParam&)
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x100166a0
|
||||
MxLong JetskiRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
MxLong JetskiRace::HandlePathStruct(LegoPathStructNotificationParam&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ LegoRace::LegoRace()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10015b70
|
||||
MxLong LegoRace::HandlePathStruct(LegoPathStructEvent&)
|
||||
MxLong LegoRace::HandlePathStruct(LegoPathStructNotificationParam&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ MxLong LegoRace::Notify(MxParam& p_param)
|
|||
result = HandleClick((LegoEventNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
|
|
@ -60,7 +60,7 @@ MxLong ElevatorBottom::Notify(MxParam& p_param)
|
|||
if (m_worldStarted) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationControl:
|
||||
ret = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
ret = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
@ -80,7 +80,7 @@ void ElevatorBottom::ReadyWorld()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100181d0
|
||||
MxLong ElevatorBottom::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong ElevatorBottom::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
|
@ -135,7 +135,7 @@ void ElevatorBottom::Enable(MxBool p_enable)
|
|||
// FUNCTION: LEGO1 0x10018310
|
||||
MxBool ElevatorBottom::Escape()
|
||||
{
|
||||
DeleteObjects(&m_atom, 500, 999);
|
||||
DeleteObjects(&m_atom, ElevbottScript::c_iica31in_PlayWav, 999);
|
||||
m_destLocation = LegoGameState::e_infomain;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -111,10 +111,10 @@ MxLong GasStation::Notify(MxParam& p_param)
|
|||
result = HandleKeyPress((((LegoEventNotificationParam&) p_param)).GetKey());
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
result = HandleButtonDown(((LegoControlManagerEvent&) p_param));
|
||||
result = HandleButtonDown(((LegoControlManagerNotificationParam&) p_param));
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
@ -306,14 +306,14 @@ MxLong GasStation::HandleKeyPress(MxS8 p_key)
|
|||
}
|
||||
|
||||
// STUB: LEGO1 0x10005960
|
||||
MxLong GasStation::HandleButtonDown(LegoControlManagerEvent& p_param)
|
||||
MxLong GasStation::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10005b20
|
||||
MxLong GasStation::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong GasStation::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
MxDSAction action;
|
||||
|
|
|
@ -15,9 +15,9 @@ DECOMP_SIZE_ASSERT(HistoryBook, 0x3e4)
|
|||
// FUNCTION: LEGO1 0x100822f0
|
||||
HistoryBook::HistoryBook()
|
||||
{
|
||||
memset(m_alphabet, NULL, sizeof(m_alphabet));
|
||||
memset(m_names, NULL, sizeof(m_names));
|
||||
memset(m_scores, NULL, sizeof(m_scores));
|
||||
memset(m_alphabet, 0, sizeof(m_alphabet));
|
||||
memset(m_names, 0, sizeof(m_names));
|
||||
memset(m_scores, 0, sizeof(m_scores));
|
||||
NotificationManager()->Register(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -120,10 +120,10 @@ MxLong Hospital::Notify(MxParam& p_param)
|
|||
result = HandleKeyPress((((LegoEventNotificationParam&) p_param)).GetKey());
|
||||
break;
|
||||
case c_notificationButtonDown:
|
||||
result = HandleButtonDown(((LegoControlManagerEvent&) p_param));
|
||||
result = HandleButtonDown(((LegoControlManagerNotificationParam&) p_param));
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
if (m_destLocation != LegoGameState::e_undefined) {
|
||||
|
@ -396,7 +396,7 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10075710
|
||||
MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
|
||||
MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (m_unk0x100 == 1) {
|
||||
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
|
||||
|
@ -552,7 +552,7 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerEvent& p_param)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10075f90
|
||||
MxBool Hospital::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
|
|
|
@ -254,7 +254,7 @@ MxLong Infocenter::Notify(MxParam& p_param)
|
|||
);
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
StopBookAnimation();
|
||||
|
@ -952,7 +952,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10070370
|
||||
MxU8 Infocenter::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxU8 Infocenter::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
m_infoManDialogueTimer = 0;
|
||||
|
|
|
@ -69,7 +69,7 @@ MxLong InfocenterDoor::Notify(MxParam& p_param)
|
|||
}
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
@ -90,12 +90,12 @@ void InfocenterDoor::ReadyWorld()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10037a90
|
||||
MxLong InfocenterDoor::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong InfocenterDoor::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
DeleteObjects(&m_atom, 500, 510);
|
||||
DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510);
|
||||
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
case InfodoorScript::c_LeftArrow_Ctl:
|
||||
|
@ -167,7 +167,7 @@ void InfocenterDoor::Enable(MxBool p_enable)
|
|||
// FUNCTION: LEGO1 0x10037cd0
|
||||
MxBool InfocenterDoor::Escape()
|
||||
{
|
||||
DeleteObjects(&m_atom, 500, 510);
|
||||
DeleteObjects(&m_atom, InfodoorScript::c_iic037in_PlayWav, 510);
|
||||
m_destLocation = LegoGameState::e_infomain;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "legovariables.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "misc.h"
|
||||
#include "motocycle.h"
|
||||
#include "motorcycle.h"
|
||||
#include "mxactionnotificationparam.h"
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxmisc.h"
|
||||
|
@ -152,7 +152,7 @@ MxLong Isle::Notify(MxParam& p_param)
|
|||
}
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationEndAnim:
|
||||
switch (m_act1state->m_unk0x018) {
|
||||
|
@ -168,7 +168,7 @@ MxLong Isle::Notify(MxParam& p_param)
|
|||
}
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = HandlePathStruct((LegoPathStructEvent&) p_param);
|
||||
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationType20:
|
||||
Enable(TRUE);
|
||||
|
@ -287,7 +287,7 @@ void Isle::ReadyWorld()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10031030
|
||||
MxLong Isle::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
MxDSAction action;
|
||||
|
@ -469,7 +469,7 @@ void Isle::UpdateGlobe()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100315f0
|
||||
MxLong Isle::HandlePathStruct(LegoPathStructEvent& p_param)
|
||||
MxLong Isle::HandlePathStruct(LegoPathStructNotificationParam& p_param)
|
||||
{
|
||||
MxLong result = 0;
|
||||
|
||||
|
@ -990,7 +990,7 @@ MxLong Isle::HandleTransitionEnd()
|
|||
FUN_10032d30(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
||||
|
||||
if (!m_act1state->m_unk0x01f) {
|
||||
m_bike->FUN_10076b60();
|
||||
m_bike->ActivateSceneActions();
|
||||
}
|
||||
break;
|
||||
case LegoGameState::e_dunecar:
|
||||
|
@ -1006,7 +1006,7 @@ MxLong Isle::HandleTransitionEnd()
|
|||
FUN_10032d30(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
||||
|
||||
if (!m_act1state->m_unk0x01f) {
|
||||
m_motocycle->FUN_10035e10();
|
||||
m_motocycle->ActivateSceneActions();
|
||||
}
|
||||
break;
|
||||
case LegoGameState::e_copter:
|
||||
|
|
|
@ -76,7 +76,7 @@ MxLong JukeBox::Notify(MxParam& p_param)
|
|||
if (m_worldStarted) {
|
||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
@ -123,7 +123,7 @@ void JukeBox::ReadyWorld()
|
|||
|
||||
// FUNCTION: LEGO1 0x1005da70
|
||||
// FUNCTION: BETA10 0x10037f6d
|
||||
MxBool JukeBox::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxBool JukeBox::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxStillPresenter* presenter;
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ MxLong Police::Notify(MxParam& p_param)
|
|||
result = HandleKeyPress(((LegoEventNotificationParam&) p_param));
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
GameState()->SwitchArea(m_destLocation);
|
||||
|
@ -103,7 +103,7 @@ void Police::ReadyWorld()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1005e550
|
||||
MxLong Police::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong Police::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
|
|
|
@ -115,7 +115,7 @@ MxLong RegistrationBook::Notify(MxParam& p_param)
|
|||
m_registerDialogueTimer = Timer()->GetTime();
|
||||
break;
|
||||
case c_notificationControl:
|
||||
result = HandleControl((LegoControlManagerEvent&) p_param);
|
||||
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationPathStruct:
|
||||
result = HandleNotification19(p_param);
|
||||
|
@ -210,7 +210,7 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100774a0
|
||||
MxLong RegistrationBook::HandleControl(LegoControlManagerEvent& p_param)
|
||||
MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxS16 unk0x28 = p_param.GetUnknown0x28();
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ MxLong Score::Notify(MxParam& p_param)
|
|||
ret = 1;
|
||||
break;
|
||||
case c_notificationControl:
|
||||
ret = FUN_100016d0((LegoControlManagerEvent&) p_param);
|
||||
ret = FUN_100016d0((LegoControlManagerNotificationParam&) p_param);
|
||||
break;
|
||||
case c_notificationTransitioned:
|
||||
DeleteObjects(g_infoscorScript, InfoscorScript::c_LegoBox1_Flc, InfoscorScript::c_LegoBox3_Flc);
|
||||
|
@ -166,7 +166,7 @@ void Score::ReadyWorld()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100016d0
|
||||
MxLong Score::FUN_100016d0(LegoControlManagerEvent& p_param)
|
||||
MxLong Score::FUN_100016d0(LegoControlManagerNotificationParam& p_param)
|
||||
{
|
||||
MxS16 unk0x28 = p_param.GetUnknown0x28();
|
||||
|
||||
|
|
|
@ -1054,6 +1054,7 @@ int MxDeviceEnumerate::SupportsCPUID()
|
|||
{
|
||||
int has_cpuid;
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_M_IX86)
|
||||
__asm {
|
||||
xor eax, eax ; Zero EAX register
|
||||
pushfd ; Push EFLAGS register value on the stack
|
||||
|
@ -1065,7 +1066,13 @@ int MxDeviceEnumerate::SupportsCPUID()
|
|||
popfd ; Push EFLAGS register value on the stack (again, and makes sure the stack remains the same)
|
||||
mov has_cpuid, eax ; Save eax into C variable
|
||||
}
|
||||
#elif defined(_M_X64)
|
||||
has_cpuid = 1;
|
||||
#else
|
||||
has_cpuid = 0;
|
||||
#endif
|
||||
#else
|
||||
#if defined(__i386__)
|
||||
__asm__("xorl %%eax, %%eax\n\t" // Zero EAX register
|
||||
"pushfl\n\t" // Push EFLAGS register value on the stack
|
||||
"orl $0x200000, (%%esp)\n\t" // Set bit 0x200000: Able to use CPUID instruction (Pentium+)
|
||||
|
@ -1076,6 +1083,11 @@ int MxDeviceEnumerate::SupportsCPUID()
|
|||
"popfl" // Push EFLAGS register value on the stack (again, and makes sure the stack remains the same)
|
||||
: "=a"(has_cpuid) // has_cpuid == EAX
|
||||
);
|
||||
#elif defined(__x86_64__) || defined(__amd64__)
|
||||
has_cpuid = 1;
|
||||
#else
|
||||
has_cpuid = 0;
|
||||
#endif
|
||||
#endif
|
||||
return has_cpuid;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
#include <mmsystem.h>
|
||||
// clang-format on
|
||||
|
||||
#if defined(_M_IX86) || defined(__i386__)
|
||||
#define MXIO_MINFO_MFILE
|
||||
#endif
|
||||
|
||||
// SIZE 0x48
|
||||
class MXIOINFO {
|
||||
public:
|
||||
|
@ -29,6 +33,9 @@ public:
|
|||
// NOTE: In MXIOINFO, the `hmmio` member of MMIOINFO is used like
|
||||
// an HFILE (int) instead of an HMMIO (WORD).
|
||||
MMIOINFO m_info;
|
||||
#ifndef MXIO_MINFO_MFILE
|
||||
HFILE m_file;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // MXIO_H
|
||||
|
|
|
@ -9,6 +9,16 @@
|
|||
// but this assert will enforce the size if we decide to change that.
|
||||
DECOMP_SIZE_ASSERT(MXIOINFO, sizeof(MMIOINFO));
|
||||
|
||||
#ifdef MXIO_MINFO_MFILE
|
||||
#define ASSIGN_M_FILE(X) m_info.hmmio = (HMMIO) (X)
|
||||
#define M_FILE (HFILE)(m_info.hmmio)
|
||||
#define RAW_M_FILE m_info.hmmio
|
||||
#else
|
||||
#define ASSIGN_M_FILE(X) m_file = (X)
|
||||
#define M_FILE (m_file)
|
||||
#define RAW_M_FILE m_file
|
||||
#endif
|
||||
|
||||
// FUNCTION: LEGO1 0x100cc800
|
||||
// FUNCTION: BETA10 0x1015e140
|
||||
MXIOINFO::MXIOINFO()
|
||||
|
@ -33,9 +43,10 @@ MxU16 MXIOINFO::Open(const char* p_filename, MxULong p_flags)
|
|||
m_info.lDiskOffset = m_info.lBufOffset = 0;
|
||||
|
||||
// DECOMP: Cast of p_flags to u16 forces the `movzx` instruction
|
||||
m_info.hmmio = (HMMIO) OpenFile(p_filename, &unused, (MxU16) p_flags);
|
||||
// original: m_info.hmmio = OpenFile(p_filename, &unused, (MxU16) p_flags);
|
||||
ASSIGN_M_FILE(OpenFile(p_filename, &unused, (MxU16) p_flags));
|
||||
|
||||
if ((HFILE) m_info.hmmio != HFILE_ERROR) {
|
||||
if (M_FILE != HFILE_ERROR) {
|
||||
m_info.dwFlags = p_flags;
|
||||
if (m_info.dwFlags & MMIO_ALLOCBUF) {
|
||||
|
||||
|
@ -75,10 +86,10 @@ MxU16 MXIOINFO::Close(MxLong p_unused)
|
|||
{
|
||||
MxU16 result = 0;
|
||||
|
||||
if (m_info.hmmio) {
|
||||
if (RAW_M_FILE) {
|
||||
result = Flush(0);
|
||||
_lclose((HFILE) m_info.hmmio);
|
||||
m_info.hmmio = 0;
|
||||
_lclose(M_FILE);
|
||||
ASSIGN_M_FILE(0);
|
||||
|
||||
if (m_info.dwFlags & MMIO_ALLOCBUF) {
|
||||
delete[] m_info.pchBuffer;
|
||||
|
@ -127,12 +138,12 @@ MxLong MXIOINFO::Read(void* p_buf, MxLong p_len)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_info.hmmio && p_len > 0) {
|
||||
bytesRead = _hread((HFILE) m_info.hmmio, p_buf, p_len);
|
||||
else if (RAW_M_FILE && p_len > 0) {
|
||||
bytesRead = _hread(M_FILE, p_buf, p_len);
|
||||
|
||||
if (bytesRead == -1) {
|
||||
bytesRead = 0;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesRead;
|
||||
|
@ -180,12 +191,12 @@ MxLong MXIOINFO::Write(void* p_buf, MxLong p_len)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_info.hmmio && p_len > 0) {
|
||||
bytesWritten = _hwrite((HFILE) m_info.hmmio, (const char*) p_buf, p_len);
|
||||
else if (RAW_M_FILE && p_len > 0) {
|
||||
bytesWritten = _hwrite(M_FILE, (const char*) p_buf, p_len);
|
||||
|
||||
if (bytesWritten == -1) {
|
||||
bytesWritten = 0;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesWritten;
|
||||
|
@ -234,11 +245,11 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin)
|
|||
}
|
||||
else {
|
||||
// we have to read another chunk from disk.
|
||||
if (m_info.hmmio && !Flush(0)) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, p_offset, p_origin);
|
||||
if (RAW_M_FILE && !Flush(0)) {
|
||||
m_info.lDiskOffset = _llseek(M_FILE, p_offset, p_origin);
|
||||
|
||||
if (m_info.lDiskOffset == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -248,10 +259,10 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin)
|
|||
// do we need to seek again?
|
||||
// (i.e. are we already aligned to buffer size?)
|
||||
if (p_offset != m_info.lBufOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, m_info.lBufOffset, SEEK_SET);
|
||||
|
||||
if (m_info.lDiskOffset == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,10 +270,10 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin)
|
|||
// is the file open for writing only?
|
||||
if ((m_info.dwFlags & MMIO_RWMODE) == 0 || (m_info.dwFlags & MMIO_RWMODE) == MMIO_READWRITE) {
|
||||
// We can read from the file. Fill the buffer.
|
||||
bytesRead = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, m_info.cchBuffer);
|
||||
bytesRead = _hread(M_FILE, m_info.pchBuffer, m_info.cchBuffer);
|
||||
|
||||
if (bytesRead == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesRead;
|
||||
|
@ -283,19 +294,19 @@ MxLong MXIOINFO::Seek(MxLong p_offset, MxLong p_origin)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (m_info.hmmio) {
|
||||
else if (RAW_M_FILE) {
|
||||
// No buffer so just seek the file directly (if we have a valid handle)
|
||||
// i.e. if we just want to get the current file position
|
||||
if (p_origin == SEEK_CUR && p_offset == 0) {
|
||||
return m_info.lDiskOffset;
|
||||
}
|
||||
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, p_offset, p_origin);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, p_offset, p_origin);
|
||||
|
||||
result = m_info.lDiskOffset;
|
||||
|
||||
if (result == -1) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -334,25 +345,25 @@ MxU16 MXIOINFO::Flush(MxU16 p_unused)
|
|||
// if we have allocated an IO buffer
|
||||
if (m_info.pchBuffer) {
|
||||
// if we have a file open for writing
|
||||
if (m_info.hmmio && (m_info.dwFlags & MMIO_RWMODE)) {
|
||||
if (RAW_M_FILE && (m_info.dwFlags & MMIO_RWMODE)) {
|
||||
// DECOMP: pulling this value out into a variable forces it into EBX
|
||||
MxLong cchBuffer = m_info.cchBuffer;
|
||||
if (cchBuffer > 0) {
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
// Was the previous seek (if required) successful?
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
bytesWritten = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cchBuffer);
|
||||
bytesWritten = _hwrite(M_FILE, m_info.pchBuffer, cchBuffer);
|
||||
|
||||
if (bytesWritten == -1 || bytesWritten != cchBuffer) {
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesWritten;
|
||||
|
@ -392,19 +403,19 @@ MxU16 MXIOINFO::Advance(MxU16 p_option)
|
|||
((p_option & MMIO_WRITE) || (rwmode == MMIO_READWRITE)) && cch > 0) {
|
||||
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
bytesCounter = _hwrite((HFILE) m_info.hmmio, m_info.pchBuffer, cch);
|
||||
bytesCounter = _hwrite(M_FILE, m_info.pchBuffer, cch);
|
||||
|
||||
if (bytesCounter == -1 || bytesCounter != cch) {
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesCounter;
|
||||
|
@ -418,20 +429,20 @@ MxU16 MXIOINFO::Advance(MxU16 p_option)
|
|||
m_info.lBufOffset += cch;
|
||||
if ((!rwmode || rwmode == MMIO_READWRITE) && cch > 0) {
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, m_info.lBufOffset, SEEK_SET);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, m_info.lBufOffset, SEEK_SET);
|
||||
}
|
||||
|
||||
// if previous seek failed
|
||||
if (m_info.lBufOffset != m_info.lDiskOffset) {
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
bytesCounter = _hread((HFILE) m_info.hmmio, m_info.pchBuffer, cch);
|
||||
bytesCounter = _hread(M_FILE, m_info.pchBuffer, cch);
|
||||
|
||||
if (bytesCounter == -1) {
|
||||
result = MMIOERR_CANNOTREAD;
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset += bytesCounter;
|
||||
|
@ -574,11 +585,11 @@ MxU16 MXIOINFO::Ascend(MMCKINFO* p_chunkInfo, MxU16 p_ascend)
|
|||
m_info.dwFlags |= MMIO_DIRTY;
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, ofs, SEEK_SET);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, ofs, SEEK_SET);
|
||||
|
||||
if (m_info.lDiskOffset == ofs) {
|
||||
if (_lwrite((HFILE) m_info.hmmio, (char*) &size, 4) != 4) {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
if (_lwrite(M_FILE, (char*) &size, 4) != 4) {
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
result = MMIOERR_CANNOTWRITE;
|
||||
}
|
||||
else {
|
||||
|
@ -586,7 +597,7 @@ MxU16 MXIOINFO::Ascend(MMCKINFO* p_chunkInfo, MxU16 p_ascend)
|
|||
}
|
||||
}
|
||||
else {
|
||||
m_info.lDiskOffset = _llseek((HFILE) m_info.hmmio, 0, SEEK_CUR);
|
||||
m_info.lDiskOffset = _llseek(M_FILE, 0, SEEK_CUR);
|
||||
result = MMIOERR_CANNOTSEEK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
#include <d3drm.h>
|
||||
|
||||
#ifdef DIRECTX5_SDK
|
||||
typedef DWORD LPD3DRM_APPDATA;
|
||||
#else
|
||||
typedef LPVOID LPD3DRM_APPDATA;
|
||||
#endif
|
||||
|
||||
// Forward declare D3D types
|
||||
struct IDirect3DRM2;
|
||||
struct IDirect3DRMDevice2;
|
||||
|
|
|
@ -15,16 +15,16 @@ void TextureDestroyCallback(IDirect3DRMObject* pObject, void* pArg);
|
|||
// FUNCTION: LEGO1 0x100a12a0
|
||||
Result TextureImpl::SetImage(IDirect3DRMTexture* pSelf, TglD3DRMIMAGE* pImage)
|
||||
{
|
||||
unsigned long appData;
|
||||
void* appData;
|
||||
Result result;
|
||||
|
||||
appData = reinterpret_cast<unsigned long>(pImage);
|
||||
appData = pImage;
|
||||
|
||||
// This is here because in the original code they asserted
|
||||
// on the return value being NULL.
|
||||
TextureGetImage(pSelf);
|
||||
|
||||
result = ResultVal(pSelf->SetAppData(appData));
|
||||
result = ResultVal(pSelf->SetAppData((LPD3DRM_APPDATA) appData));
|
||||
if (Succeeded(result) && pImage) {
|
||||
result = ResultVal(pSelf->AddDestroyCallback(TextureDestroyCallback, NULL));
|
||||
if (!Succeeded(result)) {
|
||||
|
|
|
@ -50,7 +50,7 @@ Result ViewImpl::ViewportCreateAppData(IDirect3DRM2* pDevice, IDirect3DRMViewpor
|
|||
{
|
||||
ViewportAppData* data = new ViewportAppData(pDevice);
|
||||
data->m_pCamera = pCamera;
|
||||
Result result = ResultVal(pView->SetAppData(reinterpret_cast<unsigned long>(data)));
|
||||
Result result = ResultVal(pView->SetAppData(reinterpret_cast<LPD3DRM_APPDATA>(data)));
|
||||
if (Succeeded(result)) {
|
||||
result = ResultVal(pView->AddDestroyCallback(ViewportDestroyCallback, data));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ float g_unk0x1010105c = 0.000125F;
|
|||
// GLOBAL: LEGO1 0x10101060
|
||||
float g_elapsedSeconds = 0;
|
||||
|
||||
inline void SetAppData(ViewROI* p_roi, DWORD data);
|
||||
inline void SetAppData(ViewROI* p_roi, LPD3DRM_APPDATA data);
|
||||
inline undefined4 GetD3DRM(IDirect3DRM2*& d3drm, Tgl::Renderer* pRenderer);
|
||||
inline undefined4 GetFrame(IDirect3DRMFrame2*& frame, Tgl::Group* scene);
|
||||
|
||||
|
@ -165,7 +165,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und)
|
|||
|
||||
if (lod->GetUnknown0x08() & ViewLOD::c_bit4) {
|
||||
scene->Add((Tgl::MeshBuilder*) group);
|
||||
SetAppData(p_roi, (DWORD) p_roi);
|
||||
SetAppData(p_roi, reinterpret_cast<LPD3DRM_APPDATA>(p_roi));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -187,7 +187,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und)
|
|||
|
||||
if (meshBuilder != NULL) {
|
||||
group->Add(meshBuilder);
|
||||
SetAppData(p_roi, (DWORD) p_roi);
|
||||
SetAppData(p_roi, reinterpret_cast<LPD3DRM_APPDATA>(p_roi));
|
||||
p_roi->SetUnknown0xe0(p_und);
|
||||
return;
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ ViewROI* ViewManager::Pick(Tgl::View* p_view, unsigned long x, unsigned long y)
|
|||
return result;
|
||||
}
|
||||
|
||||
inline void SetAppData(ViewROI* p_roi, DWORD data)
|
||||
inline void SetAppData(ViewROI* p_roi, LPD3DRM_APPDATA data)
|
||||
{
|
||||
IDirect3DRMFrame2* frame = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue