Merge commit '6774784b37ec185297191c0dd87251a53f3c7e4c' into new-isle-decomp

This commit is contained in:
Anonymous Maarten 2024-06-25 17:46:10 +02:00
commit c1f20a4502
69 changed files with 1671 additions and 482 deletions

View file

@ -177,7 +177,7 @@ void CMainDialog::UpdateInterface()
CheckDlgButton(IDC_CHK_FLIP_VIDEO_MEM_PAGES, currentConfigApp->m_flip_surfaces);
CheckDlgButton(IDC_CHK_3D_VIDEO_MEMORY, currentConfigApp->m_3d_video_ram);
BOOL full_screen = currentConfigApp->m_full_screen;
currentConfigApp->FUN_00403810();
currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus();
if (currentConfigApp->GetHardwareDeviceColorModel()) {
CheckDlgButton(IDC_CHK_DRAW_CURSOR, TRUE);
}
@ -198,8 +198,9 @@ void CMainDialog::UpdateInterface()
CheckDlgButton(IDC_RAD_PALETTE_16BIT, 0);
currentConfigApp->m_display_bit_depth = 0;
}
GetDlgItem(IDC_RAD_PALETTE_256)->EnableWindow(full_screen && currentConfigApp->FUN_004037a0());
GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->FUN_004037e0());
GetDlgItem(IDC_RAD_PALETTE_256)
->EnableWindow(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth());
GetDlgItem(IDC_RAD_PALETTE_16BIT)->EnableWindow(full_screen && currentConfigApp->GetDeviceRenderBitStatus());
CheckDlgButton(IDC_CHK_3DSOUND, currentConfigApp->m_3d_sound);
CheckDlgButton(IDC_CHK_DRAW_CURSOR, currentConfigApp->m_draw_cursor);
switch (currentConfigApp->m_model_quality) {

View file

@ -198,7 +198,7 @@ BOOL CConfigApp::ReadRegInt(LPCSTR p_key, int* p_value) const
}
// FUNCTION: CONFIG 0x004033d0
BOOL CConfigApp::FUN_004033d0() const
BOOL CConfigApp::IsDeviceInBasicRGBMode() const
{
/*
* BUG: should be:
@ -286,7 +286,7 @@ BOOL CConfigApp::ValidateSettings()
m_full_screen = TRUE;
is_modified = TRUE;
}
if (FUN_004033d0()) {
if (IsDeviceInBasicRGBMode()) {
if (m_3d_video_ram) {
m_3d_video_ram = FALSE;
is_modified = TRUE;
@ -340,9 +340,9 @@ BOOL CConfigApp::ValidateSettings()
}
// FUNCTION: CONFIG 0x004037a0
DWORD CConfigApp::FUN_004037a0() const
DWORD CConfigApp::GetConditionalDeviceRenderBitDepth() const
{
if (FUN_004033d0()) {
if (IsDeviceInBasicRGBMode()) {
return 0;
}
if (GetHardwareDeviceColorModel()) {
@ -352,7 +352,7 @@ DWORD CConfigApp::FUN_004037a0() const
}
// FUNCTION: CONFIG 0x004037e0
DWORD CConfigApp::FUN_004037e0() const
DWORD CConfigApp::GetDeviceRenderBitStatus() const
{
if (GetHardwareDeviceColorModel()) {
return m_device->m_HWDesc.dwDeviceRenderBitDepth & 0x400;
@ -363,23 +363,23 @@ DWORD CConfigApp::FUN_004037e0() const
}
// FUNCTION: CONFIG 0x00403810
BOOL CConfigApp::FUN_00403810()
BOOL CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
{
if (m_display_bit_depth == 8) {
if (FUN_004037a0()) {
if (GetConditionalDeviceRenderBitDepth()) {
return FALSE;
}
}
if (m_display_bit_depth == 16) {
if (FUN_004037e0()) {
if (GetDeviceRenderBitStatus()) {
return FALSE;
}
}
if (FUN_004037a0()) {
if (GetConditionalDeviceRenderBitDepth()) {
m_display_bit_depth = 8;
return TRUE;
}
if (FUN_004037e0()) {
if (GetDeviceRenderBitStatus()) {
m_display_bit_depth = 16;
return TRUE;
}

View file

@ -34,14 +34,14 @@ class CConfigApp : public CWinApp {
BOOL ReadReg(LPCSTR p_key, LPCSTR p_value, DWORD p_size) const;
BOOL ReadRegBool(LPCSTR p_key, BOOL* p_bool) const;
BOOL ReadRegInt(LPCSTR p_key, int* p_value) const;
BOOL FUN_004033d0() const;
BOOL IsDeviceInBasicRGBMode() const;
D3DCOLORMODEL GetHardwareDeviceColorModel() const;
BOOL IsPrimaryDriver() const;
BOOL ReadRegisterSettings();
BOOL ValidateSettings();
DWORD FUN_004037a0() const;
DWORD FUN_004037e0() const;
BOOL FUN_00403810();
DWORD GetConditionalDeviceRenderBitDepth() const;
DWORD GetDeviceRenderBitStatus() const;
BOOL AdjustDisplayBitDepthBasedOnRenderStatus();
void CConfigApp::WriteRegisterSettings() const;
//{{AFX_MSG(CConfigApp)

View file

@ -15,7 +15,7 @@ class Act2Actor : public LegoAnimActor {
MxS32 VTable0x68(Vector3&, Vector3&, Vector3&) override; // vtable+0x68
void VTable0x70(float p_und) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94
MxResult WaitForAnimation() override; // vtable+0x9c
MxResult VTable0x9c() override; // vtable+0x9c
MxS32 VTable0xa0() override; // vtable+0xa0
// SYNTHETIC: LEGO1 0x1001a0a0

View file

@ -17,7 +17,7 @@ struct ModelInfo {
struct AnimInfo {
char* m_name; // 0x00
MxU32 m_objectId; // 0x04
MxS16 m_unk0x08; // 0x08
MxS16 m_location; // 0x08
MxBool m_unk0x0a; // 0x0a
MxU8 m_unk0x0b; // 0x0b
MxU8 m_unk0x0c; // 0x0c

View file

@ -24,9 +24,9 @@ class Act1State;
// SIZE 0x140
class Isle : public LegoWorld {
public:
// For g_unk0x100f1198
enum {
c_bit7 = 0x40
c_playCamAnims = 0x20,
c_playMusic = 0x40
};
Isle();

View file

@ -38,7 +38,7 @@ class IslePathActor : public LegoPathActor {
float p_srcScale,
MxS16 p_dest,
float p_destScale,
undefined4 p_unk0x30,
MxU32 p_location,
JukeboxScript::Script p_music
)
{
@ -50,7 +50,7 @@ class IslePathActor : public LegoPathActor {
m_srcScale = p_srcScale;
m_dest = p_dest;
m_destScale = p_destScale;
m_unk0x30 = p_unk0x30;
m_location = p_location;
m_music = p_music;
}
@ -65,7 +65,7 @@ class IslePathActor : public LegoPathActor {
m_srcScale = p_location.m_srcScale;
m_dest = p_location.m_dest;
m_destScale = p_location.m_destScale;
m_unk0x30 = p_location.m_unk0x30;
m_location = p_location.m_location;
m_music = p_location.m_music;
return *this;
}
@ -78,7 +78,7 @@ class IslePathActor : public LegoPathActor {
float m_srcScale; // 0x24
MxS16 m_dest; // 0x28
float m_destScale; // 0x2c
undefined4 m_unk0x30; // 0x30
MxU32 m_location; // 0x30
JukeboxScript::Script m_music; // 0x34
};

View file

@ -30,7 +30,7 @@ class JukeBoxState : public LegoState {
// SYNTHETIC: LEGO1 0x1000f3d0
// JukeBoxState::`scalar deleting destructor'
protected:
// protected:
MxU32 m_state; // 0x08
MxU32 m_active; // 0x0c
};

View file

@ -13,8 +13,10 @@ class LegoAnimPresenter;
class LegoEntity;
class LegoExtraActor;
class LegoFile;
class LegoPathActor;
class LegoPathBoundary;
class LegoROIList;
struct LegoUnknown100db7f4;
class LegoWorld;
struct ModelInfo;
class MxDSAction;
@ -80,11 +82,13 @@ class LegoAnimationManager : public MxCore {
void Suspend();
void Resume();
void FUN_1005f6d0(MxBool p_unk0x400);
void FUN_1005f700(MxBool p_unk0x3a);
void EnableCamAnims(MxBool p_enableCamAnims);
MxResult LoadScriptInfo(MxS32 p_scriptIndex);
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);
void FUN_100604d0(MxBool p_unk0x08);
void FUN_10060540(MxBool p_unk0x29);
void FUN_10060570(MxBool p_unk0x1a);
MxResult StartEntityAction(MxDSAction& p_dsAction, LegoEntity* p_entity);
MxResult FUN_10060dc0(
@ -98,6 +102,7 @@ class LegoAnimationManager : public MxCore {
MxBool p_param8,
MxBool p_param9
);
void CameraTriggerFire(LegoPathActor* p_actor, MxBool, MxU32 p_location, MxBool p_bool);
void FUN_10061010(MxBool p_und);
LegoTranInfo* GetTranInfo(MxU32 p_index);
void FUN_10062770();
@ -149,7 +154,8 @@ class LegoAnimationManager : public MxCore {
MxBool FUN_10063b90(LegoWorld* p_world, LegoExtraActor* p_actor, MxU8 p_unk0x14, MxU32 p_characterId);
void FUN_10063d10();
MxBool FUN_10063fb0(LegoLocation::Boundary* p_boundary, LegoWorld* p_world);
MxBool FUN_10064120(LegoLocation::Boundary* p_boundary, MxBool, MxBool);
MxBool FUN_10064010(LegoPathBoundary* p_boundary, LegoUnknown100db7f4* p_edge, float p_destScale);
MxBool FUN_10064120(LegoLocation::Boundary* p_boundary, MxBool p_bool1, MxBool p_bool2);
MxResult FUN_10064380(
const char* p_name,
const char* p_boundaryName,
@ -179,8 +185,8 @@ class LegoAnimationManager : public MxCore {
MxPresenter* m_unk0x28[2]; // 0x28
MxLong m_unk0x30[2]; // 0x30
MxBool m_unk0x38; // 0x38
MxBool m_unk0x39; // 0x39
MxBool m_unk0x3a; // 0x3a
MxBool m_animRunning; // 0x39
MxBool m_enableCamAnims; // 0x3a
Extra m_extras[40]; // 0x3c
MxU32 m_lastExtraCharacterId; // 0x3fc
MxBool m_unk0x400; // 0x400
@ -195,7 +201,7 @@ class LegoAnimationManager : public MxCore {
undefined4 m_unk0x41c; // 0x41c
AnimState* m_animState; // 0x420
LegoROIList* m_unk0x424; // 0x424
MxBool m_unk0x428; // 0x428
MxBool m_suspendedEnableCamAnims; // 0x428
MxBool m_unk0x429; // 0x429
MxBool m_unk0x42a; // 0x42a
MxBool m_suspended; // 0x42b

View file

@ -54,8 +54,8 @@ class LegoCacheSoundManager {
virtual MxResult Tickle(); // vtable+0x00
LegoCacheSound* FUN_1003d170(const char* p_key);
LegoCacheSound* FUN_1003d290(LegoCacheSound* p_sound);
LegoCacheSound* FindSoundByKey(const char* p_key);
LegoCacheSound* ManageSoundEntry(LegoCacheSound* p_sound);
LegoCacheSound* FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three);
LegoCacheSound* FUN_1003db10(LegoCacheSound* p_one, const char* p_two, MxBool p_three);
void FUN_1003dc40(LegoCacheSound** p_und);

View file

@ -38,8 +38,9 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
void VTable0x70(float p_float) override; // vtable+0x70
MxU32 VTable0x90(float, Matrix4&) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
MxResult WaitForAnimation() override; // vtable+0x9c
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_10080590();

View file

@ -46,8 +46,8 @@ class LegoExtraActor : public virtual LegoAnimActor {
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
MxU32 VTable0x90(float p_float, Matrix4& p_matrix) override; // vtable+0x90
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
MxResult WaitForAnimation() override; // vtable+0x9c
void VTable0xa4(MxU8& p_und1, MxS32& p_und2) override; // vtable+0xa4
MxResult VTable0x9c() override; // vtable+0x9c
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4
void VTable0xc4() override; // vtable+0xc4
virtual MxResult FUN_1002aae0();

View file

@ -47,10 +47,11 @@ class LegoHideAnimPresenter : public LegoLoopingAnimPresenter {
void VTable0x8c() override; // vtable+0x8c
void VTable0x90() override; // vtable+0x90
void FUN_1006db40(LegoTime p_time);
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db40(LegoTime p_time);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);

View file

@ -43,8 +43,9 @@ class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap {
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
MxResult WaitForAnimation() override; // vtable+0x9c
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_100136f0(float p_worldSpeed);

View file

@ -36,8 +36,9 @@ class LegoJetskiRaceActor : public virtual LegoCarRaceActor {
Vector3& p_v3
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
void VTable0x98() override; // vtable+0x98
MxResult WaitForAnimation() override; // vtable+0x9c
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
void VTable0x1c() override; // vtable+0x1c
// SYNTHETIC: LEGO1 0x10081d40

View file

@ -23,7 +23,8 @@ struct LegoLocation {
float m_up[3]; // 0x20
Boundary m_boundaryA; // 0x2c
Boundary m_boundaryB; // 0x44
undefined4 m_unk0x5c; // 0x5c
MxBool m_unk0x5c; // 0x5c
MxU8 m_frequency; // 0x5d
};
extern LegoLocation g_locations[70];

View file

@ -9,7 +9,9 @@
struct LegoEdge;
class LegoPathBoundary;
class LegoPathController;
struct LegoPathEdgeContainer;
struct LegoUnknown100db7f4;
class LegoWEEdge;
// VTABLE: LEGO1 0x100d6e28
// SIZE 0x154
@ -36,7 +38,7 @@ class LegoPathActor : public LegoActor {
}
void ParseAction(char* p_extra) override; // vtable+0x20
virtual MxS32 VTable0x68(Vector3&, Vector3&, Vector3&); // vtable+0x68
virtual MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3); // vtable+0x68
virtual MxU32 VTable0x6c(
LegoPathBoundary* p_boundary,
Vector3& p_v1,
@ -52,7 +54,7 @@ class LegoPathActor : public LegoActor {
virtual void SetUserNavFlag(MxBool p_userNavFlag) { m_userNavFlag = p_userNavFlag; } // vtable+0x78
// FUNCTION: LEGO1 0x10002d30
virtual MxU8 GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
virtual MxBool GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
virtual MxResult VTable0x80(
Vector3& p_point1,
@ -84,13 +86,17 @@ class LegoPathActor : public LegoActor {
// FUNCTION: LEGO1 0x10002d50
virtual MxResult VTable0x94(LegoPathActor*, MxBool) { return 0; } // vtable+0x94
virtual void VTable0x98(); // vtable+0x98
virtual MxResult WaitForAnimation(); // vtable+0x9c
virtual void SwitchBoundary(
LegoPathBoundary*& p_boundary,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
); // vtable+0x98
virtual MxResult VTable0x9c(); // vtable+0x9c
// FUNCTION: LEGO1 0x10002d60
virtual MxS32 VTable0xa0() { return 0; } // vtable+0xa0
virtual void VTable0xa4(MxU8&, MxS32&); // vtable+0xa4
virtual void VTable0xa4(MxBool& p_und1, MxS32& p_und2); // vtable+0xa4
virtual void VTable0xa8(); // vtable+0xa8
// FUNCTION: LEGO1 0x10002d70
@ -129,6 +135,17 @@ class LegoPathActor : public LegoActor {
// LegoPathActor::`scalar deleting destructor'
protected:
inline MxU32 FUN_1002edd0(
list<LegoPathBoundary*>& p_boundaries,
LegoPathBoundary* p_boundary,
Vector3& p_v1,
Vector3& p_v2,
float p_f1,
float p_f2,
Vector3& p_v3,
MxS32 p_und
);
MxFloat m_BADuration; // 0x78
MxFloat m_unk0x7c; // 0x7c
MxFloat m_actorTime; // 0x80
@ -136,13 +153,13 @@ class LegoPathActor : public LegoActor {
LegoPathBoundary* m_boundary; // 0x88
LegoUnknown m_unk0x8c; // 0x8c
MxU32 m_state; // 0xdc
LegoEdge* m_destEdge; // 0xe0
LegoUnknown100db7f4* m_destEdge; // 0xe0
MxFloat m_unk0xe4; // 0xe4
undefined m_unk0xe8; // 0xe8
undefined m_unk0xe9; // 0xe9
MxBool m_userNavFlag; // 0xea
MxMatrix m_unk0xec; // 0xec
undefined* m_unk0x134; // 0x134
LegoPathEdgeContainer* m_grec; // 0x134
LegoPathController* m_controller; // 0x138
MxFloat m_unk0x13c; // 0x13c
MxFloat m_unk0x140; // 0x140
@ -152,4 +169,19 @@ class LegoPathActor : public LegoActor {
MxFloat m_unk0x150; // 0x150
};
// TEMPLATE: LEGO1 0x10018b70
// List<LegoBoundaryEdge>::~List<LegoBoundaryEdge>
// TEMPLATE: LEGO1 0x10018bc0
// list<LegoBoundaryEdge,allocator<LegoBoundaryEdge> >::~list<LegoBoundaryEdge,allocator<LegoBoundaryEdge> >
// TEMPLATE: LEGO1 0x1002ef10
// list<LegoPathBoundary *,allocator<LegoPathBoundary *> >::~list<LegoPathBoundary *,allocator<LegoPathBoundary *> >
// TEMPLATE: LEGO1 0x1002ef80
// list<LegoPathBoundary *,allocator<LegoPathBoundary *> >::insert
// TEMPLATE: LEGO1 0x1002efd0
// List<LegoPathBoundary *>::~List<LegoPathBoundary *>
#endif // LEGOPATHACTOR_H

View file

@ -34,7 +34,19 @@ class LegoPathBoundary : public LegoWEGEdge {
MxResult AddActor(LegoPathActor* p_actor);
MxResult RemoveActor(LegoPathActor* p_actor);
void FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor);
MxU32 Intersect(float p_scale, Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, LegoEdge*& p_edge);
void SwitchBoundary(
LegoPathActor* p_actor,
LegoPathBoundary*& p_boundary,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
);
MxU32 Intersect(
float p_scale,
Vector3& p_point1,
Vector3& p_point2,
Vector3& p_point3,
LegoUnknown100db7f4*& p_edge
);
MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter);
MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter);

View file

@ -9,7 +9,7 @@
#include "mxstl/stlcompat.h"
class LegoAnimPresenter;
struct LegoPathStruct;
class LegoPathStruct;
class LegoWorld;
class MxAtomId;
class Vector3;
@ -103,6 +103,14 @@ class LegoPathController : public MxCore {
LegoPathBoundary* GetPathBoundary(const char* p_name);
void Enable(MxBool p_enable);
void FUN_10046bb0(LegoWorld* p_world);
MxS32 FUN_1004a240(
LegoPathEdgeContainer& p_grec,
Vector3& p_v1,
Vector3& p_v2,
float p_f1,
LegoUnknown100db7f4*& p_edge,
LegoPathBoundary*& p_boundary
);
static MxResult Init();
static MxResult Reset();
@ -177,6 +185,9 @@ class LegoPathController : public MxCore {
// SYNTHETIC: LEGO1 0x10047ae0
// LegoUnknown100db7f4::~LegoUnknown100db7f4
// TEMPLATE: LEGO1 0x10048f70
// list<LegoBoundaryEdge,allocator<LegoBoundaryEdge> >::erase
// TEMPLATE: LEGO1 0x1004a780
// _Construct

View file

@ -0,0 +1,51 @@
#ifndef LEGOPATHEDGECONTAINER_H
#define LEGOPATHEDGECONTAINER_H
#include "mxgeometry/mxgeometry3d.h"
#include "mxstl/stlcompat.h"
#include "mxtypes.h"
class LegoPathBoundary;
struct LegoUnknown100db7f4;
// SIZE 0x08
struct LegoBoundaryEdge {
LegoUnknown100db7f4* m_edge; // 0x00
LegoPathBoundary* m_boundary; // 0x04
int operator==(LegoBoundaryEdge) const { return 0; }
int operator<(LegoBoundaryEdge) const { return 0; }
};
// SIZE 0x3c
struct LegoPathEdgeContainer : public list<LegoBoundaryEdge> {
enum {
c_bit1 = 0x01
};
// FUNCTION: BETA10 0x100118e0
LegoPathEdgeContainer()
{
m_boundary = NULL;
m_flags = 0;
}
void SetBit1(MxU32 p_flag)
{
if (p_flag) {
m_flags |= c_bit1;
}
else {
m_flags &= ~c_bit1;
}
}
MxU32 GetBit1() { return m_flags & c_bit1; }
Mx3DPointFloat m_unk0x0c; // 0x0c
Mx3DPointFloat m_unk0x20; // 0x20
LegoPathBoundary* m_boundary; // 0x34
MxU8 m_flags; // 0x38
};
#endif // LEGOPATHEDGECONTAINER_H

View file

@ -5,13 +5,24 @@
#include "mxatom.h"
#include "mxtypes.h"
class LegoPathActor;
class LegoWorld;
// VTABLE: LEGO1 0x100d7d9c
// SIZE 0x0c
struct LegoPathStructBase {
public:
LegoPathStructBase() : m_name(NULL), m_unk0x08(0) {}
enum {
c_bit1 = 0x01 << 24,
c_bit2 = 0x02 << 24,
c_bit3 = 0x04 << 24,
c_bit4 = 0x08 << 24,
c_bit5 = 0x10 << 24,
c_bit6 = 0x20 << 24,
c_bit7 = 0x40 << 24
};
LegoPathStructBase() : m_name(NULL), m_flags(0) {}
// FUNCTION: LEGO1 0x10047420
virtual ~LegoPathStructBase()
@ -22,24 +33,40 @@ struct LegoPathStructBase {
}
char* m_name; // 0x04
undefined4 m_unk0x08; // 0x08
MxU32 m_flags; // 0x08
};
// VTABLE: LEGO1 0x100d7da0
// SIZE 0x14
struct LegoPathStruct : public LegoPathStructBase {
class LegoPathStruct : public LegoPathStructBase {
public:
enum Trigger {
c_camAnim = 'C',
c_d = 'D',
c_e = 'E',
c_g = 'G',
c_h = 'H',
c_music = 'M',
c_s = 'S',
c_w = 'W'
};
// FUNCTION: LEGO1 0x100473a0
LegoPathStruct() : m_world(NULL) {}
// FUNCTION: LEGO1 0x10047470
~LegoPathStruct() override {}
void VTable0x04(undefined4, undefined4, undefined4); // vtable+0x04
virtual void HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data); // vtable+0x04
inline void SetWorld(LegoWorld* p_world) { m_world = p_world; }
inline void SetAtomId(const MxAtomId& p_atomId) { m_atomId = p_atomId; }
private:
MxBool HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data, MxBool p_bool);
void FUN_1001bc40(const char* p_name, MxU32 p_data, MxBool p_bool);
void PlayMusic(MxBool p_direction, MxU32 p_data);
LegoWorld* m_world; // 0x0c
MxAtomId m_atomId; // 0x10
};

View file

@ -42,8 +42,9 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
) override; // vtable+0x6c
void VTable0x70(float p_float) override; // vtable+0x70
MxResult VTable0x94(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
void VTable0x98() override; // vtable+0x98
MxResult WaitForAnimation() override; // vtable+0x9c
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
virtual void FUN_10012ea0(float p_worldSpeed);
virtual void FUN_10012ff0(float);

View file

@ -23,7 +23,7 @@ struct LegoTranInfo {
m_unk0x08 = NULL;
m_unk0x0c = NULL;
m_unk0x10 = 0;
m_unk0x12 = -1;
m_location = -1;
m_unk0x14 = FALSE;
m_unk0x1c = NULL;
m_unk0x20 = NULL;
@ -42,7 +42,7 @@ struct LegoTranInfo {
LegoROI* m_unk0x08; // 0x08
MxMatrix* m_unk0x0c; // 0x0c
MxU8 m_unk0x10; // 0x10
MxS16 m_unk0x12; // 0x12
MxS16 m_location; // 0x12
MxBool m_unk0x14; // 0x14
MxBool m_unk0x15; // 0x15
MxU32 m_objectId; // 0x18

View file

@ -7,12 +7,12 @@
#include <windows.h>
class IslePathActor;
class MxAtomId;
class LegoEntity;
class LegoFile;
class LegoAnimPresenter;
class LegoNamedTexture;
class LegoPathActor;
class LegoROI;
class LegoTreeNode;
@ -24,10 +24,10 @@ Extra::ActionType MatchActionString(const char*);
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId& p_pAtom, MxS32 p_targetEntityId, LegoEntity* p_sender);
void SetCameraControllerFromIsle();
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
void FUN_1003ecc0(IslePathActor* p_actor, undefined4, undefined4, MxBool);
void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool);
void FUN_1003eda0();
MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool);
void FUN_1003ef00(MxBool p_enable);
void SetAppCursor(WPARAM p_wparam);
MxBool FUN_1003ef60();
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);

View file

@ -94,6 +94,7 @@ class LegoWorld : public LegoEntity {
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; }
inline list<LegoROI*>& GetROIList() { return m_roiList; }
inline LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnimPresenter; }
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }

View file

@ -32,13 +32,13 @@ class SkateBoard : public IslePathActor {
MxU32 VTable0xd4(LegoControlManagerEvent& p_param) override; // vtable+0xd4
void VTable0xe4() override; // vtable+0xe4
void FUN_10010510();
void ActivateSceneActions();
// SYNTHETIC: LEGO1 0x1000ff60
// SkateBoard::`scalar deleting destructor'
private:
void FUN_10010270(MxBool p_enable);
void EnableScenePresentation(MxBool p_enable);
MxBool m_unk0x160; // 0x160
Act1State* m_act1state; // 0x164

View file

@ -22,7 +22,7 @@ MxResult Act2Actor::VTable0x94(LegoPathActor*, MxBool)
}
// STUB: LEGO1 0x10018a20
MxResult Act2Actor::WaitForAnimation()
MxResult Act2Actor::VTable0x9c()
{
// TODO
return SUCCESS;

View file

@ -340,7 +340,7 @@ MxU32 Helicopter::VTable0xd8(LegoEndAnimNotificationParam& p_param)
void Helicopter::VTable0x74(Matrix4& p_transform)
{
if (m_userNavFlag) {
m_roi->FUN_100a46b0(p_transform);
m_roi->UpdateTransformationRelativeToParent(p_transform);
FUN_10010c30();
}
else {

View file

@ -498,10 +498,10 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_und, MxU8 p
LegoVehicleBuildState* state = NULL;
if (p_flags & c_spawnBit1) {
MxBool und = FALSE;
MxBool camAnim = FALSE;
IsleScript::Script anim;
switch (g_spawnLocations[i].m_unk0x30) {
switch (g_spawnLocations[i].m_location) {
case 0x00:
case 0x44:
break;
@ -522,7 +522,7 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_und, MxU8 p
anim = IsleScript::c_irt007in_RunAnim;
break;
default:
und = TRUE;
camAnim = TRUE;
break;
}
@ -530,12 +530,12 @@ void IslePathActor::SpawnPlayer(LegoGameState::Area p_area, MxBool p_und, MxU8 p
if (AnimationManager()->FUN_10060dc0(anim, NULL, TRUE, FALSE, NULL, FALSE, TRUE, TRUE, TRUE) ==
SUCCESS) {
state->m_unk0x4e = TRUE;
und = FALSE;
camAnim = FALSE;
}
}
if (und) {
FUN_1003ecc0(this, 0, g_spawnLocations[i].m_unk0x30, TRUE);
if (camAnim) {
PlayCamAnim(this, FALSE, g_spawnLocations[i].m_location, TRUE);
}
}

View file

@ -98,7 +98,7 @@ MxU32 SkateBoard::VTable0xcc()
ControlManager()->Register(this);
}
FUN_10010270(m_unk0x160);
EnableScenePresentation(m_unk0x160);
Vector3 position = m_roi->GetWorldPosition();
AnimationManager()->FUN_10064670(&position);
@ -122,7 +122,7 @@ MxU32 SkateBoard::VTable0xd4(LegoControlManagerEvent& p_param)
// FUNCTION: LEGO1 0x10010270
// FUNCTION: BETA10 0x100f5366
void SkateBoard::FUN_10010270(MxBool p_enable)
void SkateBoard::EnableScenePresentation(MxBool p_enable)
{
m_act1state = (Act1State*) GameState()->GetState("Act1State");
if (!m_act1state) {
@ -142,12 +142,12 @@ void SkateBoard::FUN_10010270(MxBool p_enable)
// FUNCTION: BETA10 0x100f5472
MxU32 SkateBoard::VTable0xd0()
{
FUN_10010270(m_unk0x160);
EnableScenePresentation(m_unk0x160);
return 1;
}
// FUNCTION: LEGO1 0x10010510
void SkateBoard::FUN_10010510()
void SkateBoard::ActivateSceneActions()
{
if (m_act1state->m_unk0x018 != 3) {
PlayMusic(JukeboxScript::c_BeachBlvd_Music);

View file

@ -61,7 +61,7 @@ MxResult LegoCacheSoundManager::Tickle()
}
// STUB: LEGO1 0x1003d170
LegoCacheSound* LegoCacheSoundManager::FUN_1003d170(const char* p_key)
LegoCacheSound* LegoCacheSoundManager::FindSoundByKey(const char* p_key)
{
// TODO
char* x = new char[strlen(p_key) + 1];
@ -78,7 +78,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003d170(const char* p_key)
}
// FUNCTION: LEGO1 0x1003d290
LegoCacheSound* LegoCacheSoundManager::FUN_1003d290(LegoCacheSound* p_sound)
LegoCacheSound* LegoCacheSoundManager::ManageSoundEntry(LegoCacheSound* p_sound)
{
Set100d6b4c::iterator it = m_set.find(LegoCacheSoundEntry(p_sound));
if (it != m_set.end()) {
@ -107,7 +107,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003d290(LegoCacheSound* p_sound)
LegoCacheSound* LegoCacheSoundManager::FUN_1003dae0(const char* p_one, const char* p_two, MxBool p_three)
{
// DECOMP: Second parameter is LegoRoi::m_name (0xe4)
return FUN_1003db10(FUN_1003d170(p_one), p_two, p_three);
return FUN_1003db10(FindSoundByKey(p_one), p_two, p_three);
}
// FUNCTION: LEGO1 0x1003db10
@ -121,7 +121,7 @@ LegoCacheSound* LegoCacheSoundManager::FUN_1003db10(LegoCacheSound* p_one, const
LegoCacheSound* result = p_one->FUN_10006960();
if (result) {
LegoCacheSound* t = FUN_1003d290(result);
LegoCacheSound* t = ManageSoundEntry(result);
t->FUN_10006a30(p_two, p_three);
return t;
}

View file

@ -79,7 +79,7 @@ MxResult LegoLoadCacheSoundPresenter::PutData()
m_criticalSection.Enter();
if (m_currentTickleState == e_done) {
m_cacheSound = SoundManager()->GetCacheSoundManager()->FUN_1003d290(m_cacheSound);
m_cacheSound = SoundManager()->GetCacheSoundManager()->ManageSoundEntry(m_cacheSound);
m_unk0x7c = 1;
}

View file

@ -298,7 +298,7 @@ void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world)
AdjustHeight(p_index);
MxMatrix mat = roi->GetLocal2World();
mat[3][1] = g_buildingInfo[p_index].m_unk0x014;
roi->FUN_100a46b0(mat);
roi->UpdateTransformationRelativeToParent(mat);
VideoManager()->Get3DManager()->Moved(*roi);
}
}
@ -618,7 +618,7 @@ void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxU32 p_length
m_world = CurrentWorld();
if (p_haveSound) {
m_sound = SoundManager()->GetCacheSoundManager()->FUN_1003d170("bcrash");
m_sound = SoundManager()->GetCacheSoundManager()->FindSoundByKey("bcrash");
m_sound->FUN_10006cb0(35, 60);
}
@ -674,7 +674,7 @@ void LegoBuildingManager::FUN_10030590()
LegoROI* roi = g_buildingInfo[i].m_entity->GetROI();
MxMatrix mat = roi->GetLocal2World();
mat[3][1] = g_buildingInfo[i].m_unk0x014;
roi->FUN_100a46b0(mat);
roi->UpdateTransformationRelativeToParent(mat);
VideoManager()->Get3DManager()->Moved(*roi);
}
}

View file

@ -397,7 +397,7 @@ void LegoAnimationManager::Reset(MxBool p_und)
Init();
m_suspended = suspended;
m_unk0x428 = m_unk0x3a;
m_suspendedEnableCamAnims = m_enableCamAnims;
m_unk0x429 = m_unk0x400;
m_unk0x42a = m_unk0x402;
}
@ -417,7 +417,7 @@ void LegoAnimationManager::Suspend()
if (!m_suspended) {
m_suspended = TRUE;
m_unk0x428 = m_unk0x3a;
m_suspendedEnableCamAnims = m_enableCamAnims;
m_unk0x429 = m_unk0x400;
m_unk0x42a = m_unk0x402;
m_unk0x402 = FALSE;
@ -460,7 +460,7 @@ void LegoAnimationManager::Suspend()
m_unk0x18 = 0;
m_unk0x1a = FALSE;
m_unk0x3a = FALSE;
m_enableCamAnims = FALSE;
m_unk0x400 = FALSE;
m_unk0x414 = 0;
m_unk0x401 = FALSE;
@ -478,7 +478,7 @@ void LegoAnimationManager::Resume()
if (m_suspended) {
m_unk0x408 = m_unk0x40c = m_unk0x404 = Timer()->GetTime();
m_unk0x410 = 5000;
m_unk0x3a = m_unk0x428;
m_enableCamAnims = m_suspendedEnableCamAnims;
m_unk0x400 = m_unk0x429;
m_unk0x402 = m_unk0x42a;
m_suspended = FALSE;
@ -513,8 +513,8 @@ void LegoAnimationManager::Init()
}
m_unk0x38 = FALSE;
m_unk0x39 = FALSE;
m_unk0x3a = TRUE;
m_animRunning = FALSE;
m_enableCamAnims = TRUE;
m_lastExtraCharacterId = 0;
m_unk0x400 = FALSE;
m_unk0x414 = 0;
@ -564,13 +564,13 @@ void LegoAnimationManager::FUN_1005f6d0(MxBool p_unk0x400)
// FUNCTION: LEGO1 0x1005f700
// FUNCTION: BETA10 0x1004024c
void LegoAnimationManager::FUN_1005f700(MxBool p_unk0x3a)
void LegoAnimationManager::EnableCamAnims(MxBool p_enableCamAnims)
{
if (m_suspended) {
m_unk0x428 = p_unk0x3a;
m_suspendedEnableCamAnims = p_enableCamAnims;
}
else {
m_unk0x3a = p_unk0x3a;
m_enableCamAnims = p_enableCamAnims;
}
}
@ -597,7 +597,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
}
m_unk0x38 = FALSE;
m_unk0x39 = FALSE;
m_animRunning = FALSE;
m_unk0x430 = FALSE;
m_unk0x42c = NULL;
@ -681,7 +681,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
m_anims[j].m_unk0x2a[k] = -1;
}
if (m_anims[j].m_unk0x08 == -1) {
if (m_anims[j].m_location == -1) {
for (MxS32 l = 0; l < m_anims[j].m_modelCount; l++) {
MxS32 index = GetCharacterIndex(m_anims[j].m_models[l].m_name);
@ -714,10 +714,10 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex)
m_unk0x402 = TRUE;
if (m_suspended) {
m_unk0x428 = m_unk0x3a;
m_suspendedEnableCamAnims = m_enableCamAnims;
m_unk0x429 = m_unk0x400;
m_unk0x42a = TRUE;
m_unk0x3a = FALSE;
m_enableCamAnims = FALSE;
m_unk0x400 = FALSE;
m_unk0x402 = FALSE;
}
@ -769,7 +769,7 @@ MxResult LegoAnimationManager::ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info)
goto done;
}
if (p_file->Read(&p_info->m_unk0x08, sizeof(p_info->m_unk0x08)) == FAILURE) {
if (p_file->Read(&p_info->m_location, sizeof(p_info->m_location)) == FAILURE) {
goto done;
}
if (p_file->Read(&p_info->m_unk0x0a, sizeof(p_info->m_unk0x0a)) == FAILURE) {
@ -874,11 +874,29 @@ void LegoAnimationManager::DeleteAnimations()
m_suspended = suspended;
}
// FUNCTION: LEGO1 0x100604d0
// FUNCTION: BETA10 0x10041335
void LegoAnimationManager::FUN_100604d0(MxBool p_unk0x08)
{
for (MxS32 i = 0; i < (MxS32) sizeOfArray(g_characters); i++) {
g_characters[i].m_unk0x08 = p_unk0x08;
}
}
// FUNCTION: LEGO1 0x10060540
// FUNCTION: BETA10 0x1004140f
void LegoAnimationManager::FUN_10060540(MxBool p_unk0x29)
{
for (MxS32 i = 0; i < m_animCount; i++) {
m_anims[i].m_unk0x29 = p_unk0x29;
}
}
// FUNCTION: LEGO1 0x10060570
// FUNCTION: BETA10 0x10041463
void LegoAnimationManager::FUN_10060570(MxBool p_unk0x1a)
{
m_unk0x39 = FALSE;
m_animRunning = FALSE;
m_unk0x430 = FALSE;
m_unk0x42c = NULL;
@ -920,7 +938,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
AnimInfo& animInfo = m_anims[p_index];
if (!p_bool1) {
if (m_unk0x39 || !animInfo.m_unk0x29) {
if (m_animRunning || !animInfo.m_unk0x29) {
return FAILURE;
}
@ -940,7 +958,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
tranInfo->m_index = ++m_unk0x1c;
tranInfo->m_unk0x10 = 0;
tranInfo->m_unk0x08 = p_roi;
tranInfo->m_unk0x12 = m_anims[p_index].m_unk0x08;
tranInfo->m_location = m_anims[p_index].m_location;
tranInfo->m_unk0x14 = p_unk0x0a;
tranInfo->m_objectId = animInfo.m_objectId;
tranInfo->m_unk0x15 = p_bool2;
@ -984,7 +1002,7 @@ MxResult LegoAnimationManager::FUN_100605e0(
}
}
m_unk0x39 = TRUE;
m_animRunning = TRUE;
result = SUCCESS;
}
}
@ -1006,7 +1024,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix
info->m_index = ++m_unk0x1c;
info->m_unk0x10 = 0;
info->m_unk0x08 = NULL;
info->m_unk0x12 = -1;
info->m_location = -1;
info->m_unk0x14 = FALSE;
info->m_objectId = p_objectId;
@ -1036,7 +1054,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix
if (StartActionIfUnknown0x13c(action) == SUCCESS) {
BackgroundAudioManager()->LowerVolume();
info->m_flags |= LegoTranInfo::c_bit2;
m_unk0x39 = TRUE;
m_animRunning = TRUE;
m_unk0x404 = Timer()->GetTime();
result = SUCCESS;
}
@ -1133,6 +1151,49 @@ MxResult LegoAnimationManager::FUN_10060dc0(
return result;
}
// FUNCTION: LEGO1 0x10060eb0
// FUNCTION: BETA10 0x1004206c
void LegoAnimationManager::CameraTriggerFire(LegoPathActor* p_actor, MxBool, MxU32 p_location, MxBool p_bool)
{
if (Lego()->m_unk0x13c && m_enableCamAnims && !m_animRunning) {
LegoLocation* location = LegoNavController::GetLocation(p_location);
if (location != NULL) {
if (location->m_frequency == 0) {
return;
}
if (location->m_unk0x5c && location->m_frequency < rand() % 100) {
return;
}
}
MxU16 unk0x0e, unk0x10;
if (FUN_100617c0(p_location, unk0x0e, unk0x10) == SUCCESS) {
MxU16 index = unk0x0e;
MxU32 unk0x22 = -1;
MxBool success = FALSE;
for (MxU16 i = unk0x0e; i <= unk0x10; i++) {
AnimInfo& animInfo = m_anims[i];
if ((p_bool || !FUN_100623a0(animInfo)) && !FUN_10062710(animInfo) && animInfo.m_unk0x29 &&
animInfo.m_unk0x22 < unk0x22 && (animInfo.m_unk0x22 == 0 || *animInfo.m_name != 'i') &&
*animInfo.m_name != 'I') {
index = i;
unk0x22 = animInfo.m_unk0x22;
success = TRUE;
}
}
if (success) {
FUN_100605e0(index, m_anims[index].m_unk0x0a, NULL, TRUE, NULL, FALSE, TRUE, TRUE, TRUE);
location->m_unk0x5c = TRUE;
}
}
}
}
// FUNCTION: LEGO1 0x10061010
// FUNCTION: BETA10 0x100422cc
void LegoAnimationManager::FUN_10061010(MxBool p_und)
@ -1150,7 +1211,7 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
// TODO: Match
MxU32 flags = tranInfo->m_flags;
if (tranInfo->m_unk0x14 && tranInfo->m_unk0x12 != -1 && p_und) {
if (tranInfo->m_unk0x14 && tranInfo->m_location != -1 && p_und) {
LegoAnim* anim;
if (tranInfo->m_presenter->GetPresenter() != NULL &&
@ -1193,7 +1254,7 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
}
}
m_unk0x39 = unk0x39;
m_animRunning = unk0x39;
m_unk0x404 = Timer()->GetTime();
}
@ -1227,18 +1288,18 @@ void LegoAnimationManager::FUN_10061530()
// FUNCTION: LEGO1 0x100617c0
// FUNCTION: BETA10 0x1004240b
MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, MxU16& p_unk0x10)
MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_location, MxU16& p_unk0x0e, MxU16& p_unk0x10)
{
MxResult result = FAILURE;
MxU16 unk0x0e = 0;
MxU16 unk0x10 = 0;
MxBool success = FALSE;
if (p_unk0x08 == -1) {
if (p_location == -1) {
MxS32 i;
for (i = 0; i < m_animCount; i++) {
if (m_anims[i].m_unk0x08 == p_unk0x08) {
if (m_anims[i].m_location == p_location) {
unk0x0e = i;
success = TRUE;
break;
@ -1246,7 +1307,7 @@ MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, M
}
if (success) {
for (; i < m_animCount && m_anims[i].m_unk0x08 == p_unk0x08; i++) {
for (; i < m_animCount && m_anims[i].m_location == p_location; i++) {
unk0x10 = i;
}
}
@ -1254,8 +1315,8 @@ MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, M
else {
MxS32 i;
for (i = 0; m_animCount > i && m_anims[i].m_unk0x08 != -1; i++) {
if (m_anims[i].m_unk0x08 == p_unk0x08) {
for (i = 0; m_animCount > i && m_anims[i].m_location != -1; i++) {
if (m_anims[i].m_location == p_location) {
unk0x0e = i;
success = TRUE;
break;
@ -1263,7 +1324,7 @@ MxResult LegoAnimationManager::FUN_100617c0(MxS32 p_unk0x08, MxU16& p_unk0x0e, M
}
if (success) {
for (; i < m_animCount && m_anims[i].m_unk0x08 == p_unk0x08; i++) {
for (; i < m_animCount && m_anims[i].m_location == p_location; i++) {
unk0x10 = i;
}
}
@ -1322,7 +1383,7 @@ MxLong LegoAnimationManager::Notify(MxParam& p_param)
BackgroundAudioManager()->RaiseVolume();
}
m_unk0x39 = FALSE;
m_animRunning = FALSE;
m_unk0x404 = Timer()->GetTime();
found = TRUE;
@ -1423,7 +1484,7 @@ MxResult LegoAnimationManager::Tickle()
FUN_10064b50(time);
if (!m_unk0x39 && time - m_unk0x404 > 10000 && speed < g_unk0x100f74b0[0][0] && speed > g_unk0x100f74b0[5][0]) {
if (!m_animRunning && time - m_unk0x404 > 10000 && speed < g_unk0x100f74b0[0][0] && speed > g_unk0x100f74b0[5][0]) {
LegoPathBoundary* boundary = actor->GetBoundary();
Mx3DPointFloat position(roi->GetWorldPosition());
@ -1791,7 +1852,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
{
LegoLocation::Boundary* boundary = NULL;
if (p_und || (!m_unk0x39 && m_unk0x400)) {
if (p_und || (!m_animRunning && m_unk0x400)) {
LegoWorld* world = CurrentWorld();
if (world != NULL) {
@ -2059,20 +2120,137 @@ void LegoAnimationManager::FUN_10063d10()
}
}
// STUB: LEGO1 0x10063fb0
// FUNCTION: LEGO1 0x10063fb0
// FUNCTION: BETA10 0x100452a7
MxBool LegoAnimationManager::FUN_10063fb0(LegoLocation::Boundary* p_boundary, LegoWorld* p_world)
{
// TODO
return TRUE;
if (p_boundary->m_name != NULL) {
Mx3DPointFloat vec;
LegoPathBoundary* boundary = p_world->FindPathBoundary(p_boundary->m_name);
LegoUnknown100db7f4* pSrcE = (LegoUnknown100db7f4*) boundary->GetEdges()[p_boundary->m_src];
return FUN_10064010(boundary, pSrcE, p_boundary->m_srcScale);
}
return FALSE;
}
// STUB: LEGO1 0x10064120
// FUNCTION: BETA10 0x100454f5
MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, MxBool, MxBool)
// FUNCTION: LEGO1 0x10064010
// FUNCTION: BETA10 0x100453a5
MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnknown100db7f4* p_edge, float p_destScale)
{
// TODO
Mx3DPointFloat p1;
Vector3* v1 = p_edge->GetOpposingPoint(*p_boundary);
Vector3* v2 = p_edge->CCWVertex(*p_boundary);
p1 = *v2;
((Vector3&) p1).Sub(v1);
((Vector3&) p1).Mul(p_destScale);
((Vector3&) p1).Add(v1);
BoundingBox boundingBox;
Mx3DPointFloat vec(1.0f, 1.0f, 1.0f);
boundingBox.Min() = p1;
boundingBox.Min().Sub(&vec);
boundingBox.Max() = p1;
boundingBox.Max().Add(&vec);
return GetViewManager()->FUN_100a6150(boundingBox) == FALSE;
}
// FUNCTION: LEGO1 0x10064120
// FUNCTION: BETA10 0x100454f5
MxBool LegoAnimationManager::FUN_10064120(LegoLocation::Boundary* p_boundary, MxBool p_bool1, MxBool p_bool2)
{
MxU32 local2c = 12;
float destScale = ((rand() * 0.5) / 32767.0) + 0.25;
IslePathActor* actor = CurrentActor();
if (actor == NULL) {
return FALSE;
}
LegoPathBoundary* boundary = actor->GetBoundary();
if (boundary == NULL) {
return FALSE;
}
Mx3DPointFloat direction = actor->GetWorldDirection();
float local4c = 0.0f;
LegoUnknown100db7f4* local50 = NULL;
LegoS32 numEdges = boundary->GetNumEdges();
Mx3DPointFloat vec;
LegoUnknown100db7f4* e;
MxS32 i;
for (i = 0; i < numEdges; i++) {
e = (LegoUnknown100db7f4*) boundary->GetEdges()[i];
e->FUN_1002ddc0(*boundary, vec);
float dot = vec.Dot(&direction, &vec);
if (dot > local4c) {
local50 = e;
local4c = dot;
}
}
e = local50;
do {
e = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(*boundary);
if (e->GetMask0x03()) {
break;
}
} while (e != local50);
if (e == local50) {
return FALSE;
}
LegoUnknown100db7f4* local34 = e;
LegoUnknown100db7f4* local8 = local50;
while (local2c--) {
if (local34 != NULL) {
if (local34->Unknown(*boundary, LegoWEGEdge::c_bit1) && FUN_10064010(boundary, local34, destScale) &&
(!p_bool2 || FUN_10064010(boundary, local8, destScale))) {
p_boundary->m_srcScale = p_boundary->m_destScale = destScale;
p_boundary->m_name = boundary->GetName();
numEdges = boundary->GetNumEdges();
for (i = 0; i < numEdges; i++) {
LegoUnknown100db7f4* e = (LegoUnknown100db7f4*) boundary->GetEdges()[i];
if (local34 == e) {
p_boundary->m_src = i;
}
else if (local8 == e) {
p_boundary->m_dest = i;
}
}
return TRUE;
}
local8 = local34;
boundary = (LegoPathBoundary*) local34->OtherFace(boundary);
local50 = local34;
do {
if (p_bool1) {
local34 = (LegoUnknown100db7f4*) local34->GetCounterclockwiseEdge(*boundary);
}
else {
local34 = (LegoUnknown100db7f4*) local34->GetClockwiseEdge(*boundary);
}
} while (!local34->GetMask0x03() && local34 != local50);
if (local34 == local50) {
return FALSE;
}
}
}
return FALSE;
}
// FUNCTION: LEGO1 0x10064380

View file

@ -427,7 +427,7 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
LegoROI* viewROI = VideoManager()->GetViewROI();
IslePathActor* actor = CurrentActor();
if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_unk0x12 != -1 && actor != NULL) {
if (m_tranInfo != NULL && m_tranInfo->m_unk0x14 && m_tranInfo->m_location != -1 && actor != NULL) {
if (m_unk0x64 != NULL) {
undefined4 und = 1;

View file

@ -609,7 +609,7 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
lodList = dupLodList;
if (head->GetUnknown0xe0() >= 0) {
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->FUN_100a66a0(head);
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(head);
}
head->SetLODList(lodList);
@ -744,7 +744,7 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
lodList = dupLodList;
if (childROI->GetUnknown0xe0() >= 0) {
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->FUN_100a66a0(childROI);
VideoManager()->Get3DManager()->GetLego3DView()->GetViewManager()->RemoveROIDetailFromScene(childROI);
}
childROI->SetLODList(lodList);

View file

@ -4,6 +4,7 @@
#include "act1state.h"
#include "anim/legoanim.h"
#include "islepathactor.h"
#include "legoanimationmanager.h"
#include "legoanimpresenter.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
@ -19,6 +20,7 @@
#include "mxmisc.h"
#include "mxnotificationmanager.h"
#include "mxstreamer.h"
#include "mxtype19notificationparam.h"
#include "mxtypes.h"
#include "mxutilities.h"
#include "mxvariabletable.h"
@ -340,11 +342,21 @@ void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bO
}
}
// STUB: LEGO1 0x1003ecc0
// FUNCTION: LEGO1 0x1003ecc0
// FUNCTION: BETA10 0x100d4b38
void FUN_1003ecc0(IslePathActor* p_actor, undefined4, undefined4, MxBool)
void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool)
{
// TODO
LegoWorld* world = CurrentWorld();
MxLong result = 0;
if (world != NULL) {
MxType19NotificationParam param(c_notificationType19, p_actor, 0x43, p_location);
result = world->Notify(param);
}
if (result == 0) {
AnimationManager()->CameraTriggerFire(p_actor, p_unused, p_location, p_bool);
}
}
// FUNCTION: LEGO1 0x1003eda0
@ -424,10 +436,16 @@ MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_wor
return FALSE;
}
// STUB: LEGO1 0x1003ef00
void FUN_1003ef00(MxBool)
// FUNCTION: LEGO1 0x1003ef00
void FUN_1003ef00(MxBool p_enable)
{
// TODO (something related to animation manager)
if (p_enable) {
AnimationManager()->Resume();
}
AnimationManager()->FUN_1005f6d0(p_enable);
AnimationManager()->FUN_10060540(p_enable);
AnimationManager()->FUN_100604d0(p_enable);
}
// FUNCTION: LEGO1 0x1003ef40

View file

@ -72,13 +72,13 @@ void LegoCarRaceActor::VTable0x70(float p_float)
}
// STUB: LEGO1 0x10081d20
void LegoCarRaceActor::VTable0x98()
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}
// STUB: LEGO1 0x10081d30
MxResult LegoCarRaceActor::WaitForAnimation()
MxResult LegoCarRaceActor::VTable0x9c()
{
// TODO
return SUCCESS;

View file

@ -130,7 +130,7 @@ void LegoEntity::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
mat
);
m_roi->FUN_100a46b0(mat);
m_roi->UpdateTransformationRelativeToParent(mat);
}
m_roi->SetEntity(this);
@ -170,7 +170,7 @@ void LegoEntity::SetLocation(const Vector3& p_location, const Vector3& p_directi
mat
);
m_roi->FUN_100a46b0(mat);
m_roi->UpdateTransformationRelativeToParent(mat);
VideoManager()->Get3DManager()->GetLego3DView()->Moved(*m_roi);
if (p_und) {

View file

@ -71,13 +71,13 @@ MxResult LegoJetski::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
// STUB: LEGO1 0x100141c0
void LegoJetski::VTable0x98()
void LegoJetski::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}
// STUB: LEGO1 0x10014200
MxResult LegoJetski::WaitForAnimation()
MxResult LegoJetski::VTable0x9c()
{
// TODO
return SUCCESS;

View file

@ -38,13 +38,13 @@ void LegoJetskiRaceActor::VTable0x70(float p_float)
}
// STUB: LEGO1 0x100822d0
void LegoJetskiRaceActor::VTable0x98()
void LegoJetskiRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}
// STUB: LEGO1 0x100822e0
MxResult LegoJetskiRaceActor::WaitForAnimation()
MxResult LegoJetskiRaceActor::VTable0x9c()
{
// TODO
return SUCCESS;

View file

@ -16,9 +16,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{1,
"LCAMBA1",
0.852546,
@ -30,9 +31,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_13", 2, 0.75, 0, 0.25, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
10240},
{"EDG02_13", 2, 0.75, 0, 0.25, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
40},
{2,
"LCAMBA2",
3.505301,
@ -44,9 +46,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_37", 2, 0.75, 0, 0.25, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
5120},
{"EDG02_37", 2, 0.75, 0, 0.25, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
20},
{3,
"LCAMBA3",
-7.472569,
@ -58,9 +61,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_26", 0, 0.75, 2, 0.25, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
5120},
{"EDG02_26", 0, 0.75, 2, 0.25, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
20},
{4,
"LCAMBA4",
38.55205,
@ -72,9 +76,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_146", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
7680},
{"EDG00_146", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
30},
{5,
"LCAMCA1",
-36.778473,
@ -86,8 +91,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"INT01", 2, 0.5, 6, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"INT01", 2, 0.5, 6, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{6,
"LCAMCA2",
@ -100,8 +106,9 @@ LegoLocation g_locations[] = {
0.000446,
0.999999,
-0.001387,
{"EDG00_104", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG00_104", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{7,
"LCAMCA3",
@ -114,8 +121,9 @@ LegoLocation g_locations[] = {
-0.000173,
0.999998,
0.001888,
{"EDG02_58", 2, 0.25, 0, 0.75, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG02_58", 2, 0.25, 0, 0.75, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{8,
"LCAMGS1",
@ -128,9 +136,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_40", 2, 0.25, 0, 0.25, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
17920},
{"EDG02_40", 2, 0.25, 0, 0.25, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
70},
{9,
"LCAMGS2",
25.153421,
@ -142,8 +151,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"INT19", 1, 0.75, 0, 0.75, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"INT19", 1, 0.75, 0, 0.75, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{10,
"LCAMGS3",
@ -156,8 +166,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_74", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG00_74", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{11,
"LCAMHO1",
@ -170,9 +181,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
12800},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
50},
{12,
"LCAMHO2",
90.92687,
@ -184,8 +196,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{13,
"LCAMHO3",
@ -198,8 +211,9 @@ LegoLocation g_locations[] = {
0.005781,
0.999976,
0.003708,
{"EDG02_27", 1, 0.89, 2, 0.89, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG02_27", 1, 0.89, 2, 0.89, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{14,
"LCAMHO4",
@ -212,9 +226,10 @@ LegoLocation g_locations[] = {
-0.034088,
0.999355,
-0.011255,
{"EDG02_27", 1, 0.89, 2, 0.89, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{"EDG02_27", 1, 0.89, 2, 0.89, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{15,
"LCAMIC1",
80.11602,
@ -226,8 +241,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_69", 2, 0.5, 0, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG00_69", 2, 0.5, 0, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{16,
"LCAMIC2",
@ -240,8 +256,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_66", 2, 0.5, 0, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG02_66", 2, 0.5, 0, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{17,
"LCAMIC3",
@ -254,9 +271,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_68", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
5120},
{"EDG02_68", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
20},
{18,
"LCAMJA1",
95.05279,
@ -268,9 +286,10 @@ LegoLocation g_locations[] = {
-0.006372,
0.999977,
-0.002478,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{19,
"LCAMJA2",
97.214066,
@ -282,8 +301,9 @@ LegoLocation g_locations[] = {
-0.010811,
0.999927,
0.005453,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{20,
"LCAMJA3",
@ -296,8 +316,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"INT33", 1, 0.9, 3, 0.9, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"INT33", 1, 0.9, 3, 0.9, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{21,
"LCAMJA4",
@ -310,8 +331,9 @@ LegoLocation g_locations[] = {
-0.001442,
0.999945,
0.010407,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{22,
"LCAMJA5",
@ -324,8 +346,9 @@ LegoLocation g_locations[] = {
-0.007107,
0.999949,
-0.007199,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{23,
"LCAMJS1",
@ -338,9 +361,10 @@ LegoLocation g_locations[] = {
0.000653,
0.999999,
-0.000932,
{"INT26", 0, 0.5, 3, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{"INT26", 0, 0.5, 3, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{24,
"LCAMJS2",
14.753909,
@ -352,9 +376,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{25,
"LCAMJS3",
12.373611,
@ -366,9 +391,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{26,
"LCAMJS4",
27.136557,
@ -380,8 +406,9 @@ LegoLocation g_locations[] = {
-0.000261,
0.999999,
-0.001364,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{27,
"LCAMMT1",
@ -394,9 +421,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
12800},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
50},
{28,
"LCAMMT2",
-58.28056,
@ -408,8 +436,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{29,
"LCAMPK1",
@ -422,9 +451,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_83", 0, 0.9, 2, 0.9, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
12800},
{"EDG00_83", 0, 0.9, 2, 0.9, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
50},
{30,
"LCAMPK2",
63.75,
@ -436,8 +466,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{31,
"LCAMPK4",
@ -450,9 +481,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{32,
"LCAMPO1",
-24.38507,
@ -464,9 +496,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
5120},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
20},
{33,
"LCAMPO2",
-41.35899,
@ -478,8 +511,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_191", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG00_191", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{34,
"LCAMPS1",
@ -492,9 +526,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_40", 0, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{"EDG02_40", 0, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{35,
"LCAMPS2",
70.99095,
@ -506,9 +541,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{36,
"LCAMPS3",
73.92391,
@ -520,9 +556,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_66", 1, 0.15, 2, 0.15, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{"EDG02_66", 1, 0.15, 2, 0.15, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{37,
"LCAMPS4",
61.471172,
@ -534,8 +571,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG02_40", 0, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG02_40", 0, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{38,
"LCAMPZ1",
@ -548,9 +586,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
20480},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
80},
{39,
"LCAMPZ2",
-21.870003,
@ -562,9 +601,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
23040},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
90},
{40,
"LCAMPZ3",
-21.860731,
@ -576,9 +616,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG00_24", 0, 0.9, 2, 0.9, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{"EDG00_24", 0, 0.9, 2, 0.9, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{41,
"LCAMPZ4",
-20.492962,
@ -590,9 +631,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{42,
"LCAMPZ5",
-11.0625,
@ -604,9 +646,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
12800},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
50},
{43,
"LCAMPZ6",
-14.837131,
@ -618,8 +661,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{44,
"LCAMPZ7",
@ -632,8 +676,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{45,
"LCAMRA1",
@ -646,8 +691,9 @@ LegoLocation g_locations[] = {
-0.007751,
0.998685,
-0.050677,
{"EDG00_03", 1, 0.5, 3, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG00_03", 1, 0.5, 3, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{46,
"LCAMRA2",
@ -660,9 +706,10 @@ LegoLocation g_locations[] = {
-0.000078,
1,
0.000105,
{"EDG01_17", 0, 0.5, 3, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{"EDG01_17", 0, 0.5, 3, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{47,
"LCAMRA3",
-57.06778,
@ -674,8 +721,9 @@ LegoLocation g_locations[] = {
-0.000112,
1,
0.000021,
{"EDG01_40", 2, 0.5, 0, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG01_40", 2, 0.5, 0, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{48,
"LCAMRA4",
@ -688,9 +736,10 @@ LegoLocation g_locations[] = {
0.035939,
0.999346,
-0.00388,
{"EDG01_27", 0, 0.5, 2, 0.5, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{"EDG01_27", 0, 0.5, 2, 0.5, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{49,
"LCAMRA5",
-84.27638,
@ -702,9 +751,10 @@ LegoLocation g_locations[] = {
0.024875,
0.999675,
-0.005499,
{"EDG01_08", 2, 0.7, 0, 0.7, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
6400},
{"EDG01_08", 2, 0.7, 0, 0.7, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
25},
{50,
"LCAMRA6",
-86.96998,
@ -716,8 +766,9 @@ LegoLocation g_locations[] = {
0.000378,
1,
0.000009,
{"EDG01_13", 1, 0.2, 0, 0.2, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG01_13", 1, 0.2, 0, 0.2, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{51,
"LCAMRT1",
@ -730,9 +781,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG03_10", 0, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
20480},
{"EDG03_10", 0, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
80},
{52,
"LCAMRT2",
-2.950222,
@ -744,9 +796,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG03_10", 0, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{"EDG03_10", 0, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{53,
"LCAMRT3",
-0.87654,
@ -758,9 +811,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{54,
"LCAMRT4",
0.4375,
@ -772,9 +826,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{55,
"LCAMRT5",
-27.213715,
@ -786,8 +841,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG03_05", 1, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{"EDG03_05", 1, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{56,
"LCAMRT6",
@ -800,9 +856,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"EDG03_10", 0, 0.5, 2, 0.5, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
15360},
{"EDG03_10", 0, 0.5, 2, 0.5, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
60},
{57,
"LCAMST1",
-40.1615,
@ -814,9 +871,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
5120},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
20},
{58,
"LCAMST2",
-48.750553,
@ -828,8 +886,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{59,
"LCAMZG1",
@ -842,8 +901,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{"INT22", 0, 0.4, 2, 0.4, TRUE},
{NULL, 0, 0, 0, 0, FALSE},
{"INT22", 0, 0.4, 2, 0.4, 1},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{60,
"LCAMZI1",
@ -856,9 +916,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{61,
"LCAMZI2",
93.37283,
@ -870,9 +931,10 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{62,
"LCAMZIE",
93.375,
@ -884,8 +946,9 @@ LegoLocation g_locations[] = {
0.254493,
0.967075,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{63,
"LCAMZIN",
@ -898,8 +961,9 @@ LegoLocation g_locations[] = {
0,
0.967203,
0.254006,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{64,
"LCAMZIS",
@ -912,8 +976,9 @@ LegoLocation g_locations[] = {
0,
0.966946,
-0.254982,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{65,
"LCAMZIW",
@ -926,8 +991,9 @@ LegoLocation g_locations[] = {
-0.254493,
0.967075,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{66,
"LCAMZP1",
@ -940,8 +1006,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{67,
"LCAMRT7",
@ -954,8 +1021,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
0},
{68,
"LCAMJS5",
@ -968,8 +1036,9 @@ LegoLocation g_locations[] = {
0,
1,
0,
{NULL, 0, 0, 0, 0, FALSE},
{NULL, 0, 0, 0, 0, FALSE},
25600},
{69, "overhead", 0, 135, 0, 0, -1, 0, 0, 0, 1, {NULL, 0, 0, 0, 0, FALSE}, {NULL, 0, 0, 0, 0, FALSE}, 0}
{NULL, 0, 0, 0, 0, 0},
{NULL, 0, 0, 0, 0, 0},
FALSE,
100},
{69, "overhead", 0, 135, 0, 0, -1, 0, 0, 0, 1, {NULL, 0, 0, 0, 0, 0}, {NULL, 0, 0, 0, 0, 0}, FALSE, 0}
};

View file

@ -109,19 +109,19 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
}
// FUNCTION: LEGO1 0x1002aa90
void LegoExtraActor::VTable0xa4(MxU8& p_und1, MxS32& p_und2)
void LegoExtraActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
{
switch (m_unk0x0c) {
case 1:
p_und1 = 1;
p_und1 = TRUE;
p_und2 = 1;
break;
case 2:
p_und1 = 0;
p_und1 = FALSE;
p_und2 = 1;
break;
default:
p_und1 = 1;
p_und1 = TRUE;
p_und2 = rand() % p_und2 + 1;
break;
}
@ -151,7 +151,7 @@ MxResult LegoExtraActor::FUN_1002aae0()
m_boundary = oldEdge;
}
LegoPathActor::WaitForAnimation();
LegoPathActor::VTable0x9c();
return SUCCESS;
}
@ -280,10 +280,10 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
// FUNCTION: LEGO1 0x1002b290
MxResult LegoExtraActor::WaitForAnimation()
MxResult LegoExtraActor::VTable0x9c()
{
LegoPathBoundary* oldBoundary = m_boundary;
MxResult result = LegoPathActor::WaitForAnimation();
MxResult result = LegoPathActor::VTable0x9c();
if (m_boundary != oldBoundary) {
MxU32 b = FALSE;
@ -400,6 +400,7 @@ void LegoExtraActor::SetWorldSpeed(MxFloat p_worldSpeed)
if (m_curAnim == 0 && p_worldSpeed > 0) {
VTable0xc4();
}
LegoAnimActor::SetWorldSpeed(p_worldSpeed);
}

View file

@ -5,6 +5,7 @@
#include "legocameracontroller.h"
#include "legonavcontroller.h"
#include "legopathboundary.h"
#include "legopathedgecontainer.h"
#include "legosoundmanager.h"
#include "legoworld.h"
#include "misc.h"
@ -15,6 +16,7 @@
#include <vec.h>
DECOMP_SIZE_ASSERT(LegoPathActor, 0x154)
DECOMP_SIZE_ASSERT(LegoPathEdgeContainer, 0x3c)
#ifndef M_PI
#define M_PI 3.1416
@ -40,21 +42,21 @@ LegoPathActor::LegoPathActor()
m_unk0x7c = 0;
m_userNavFlag = FALSE;
m_state = 0;
m_unk0x134 = NULL;
m_grec = NULL;
m_controller = NULL;
m_unk0xe8 = 0;
m_unk0x148 = 0;
m_unk0x14c = 0;
m_unk0x140 = 0.0099999998f;
m_unk0x144 = 0.80000001f;
m_unk0x140 = 0.0099999999f;
m_unk0x144 = 0.8f;
m_unk0x150 = 2.0f;
}
// STUB: LEGO1 0x1002d820
// FUNCTION: LEGO1 0x1002d820
LegoPathActor::~LegoPathActor()
{
if (m_unk0x134) {
delete m_unk0x134;
if (m_grec) {
delete m_grec;
}
}
@ -90,10 +92,10 @@ MxResult LegoPathActor::VTable0x88(
float p_destScale
)
{
Vector3* v1 = p_srcEdge.GetOpposingPoint(p_boundary);
Vector3* v2 = p_srcEdge.GetPoint(p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(p_boundary);
Vector3* v4 = p_destEdge.GetPoint(p_boundary);
Vector3* v1 = p_srcEdge.GetOpposingPoint(*p_boundary);
Vector3* v2 = p_srcEdge.CCWVertex(*p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(*p_boundary);
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
Mx3DPointFloat p1, p2, p3, p4, p5;
@ -135,7 +137,7 @@ MxResult LegoPathActor::VTable0x88(
}
right.EqualsCross(&up, &dir);
m_roi->FUN_100a46b0(matrix);
m_roi->UpdateTransformationRelativeToParent(matrix);
if (!m_cameraFlag || !m_userNavFlag) {
p5.EqualsCross(p_boundary->GetUnknown0x14(), &p3);
@ -167,8 +169,8 @@ MxResult LegoPathActor::VTable0x84(
float p_destScale
)
{
Vector3* v3 = p_destEdge.GetOpposingPoint(p_boundary);
Vector3* v4 = p_destEdge.GetPoint(p_boundary);
Vector3* v3 = p_destEdge.GetOpposingPoint(*p_boundary);
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
Mx3DPointFloat p2, p3, p5;
@ -201,7 +203,7 @@ MxResult LegoPathActor::VTable0x84(
}
right.EqualsCross(&up, &dir);
m_roi->FUN_100a46b0(matrix);
m_roi->UpdateTransformationRelativeToParent(matrix);
if (!m_cameraFlag || !m_userNavFlag) {
p5.EqualsCross(p_boundary->GetUnknown0x14(), &p3);
@ -224,6 +226,7 @@ MxResult LegoPathActor::VTable0x84(
}
// FUNCTION: LEGO1 0x1002e100
// FUNCTION: BETA10 0x100b0520
MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
{
if (m_userNavFlag && m_state == 0) {
@ -263,7 +266,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
LegoPathBoundary* oldBoundary = m_boundary;
if (m_unk0xe9 != 0) {
WaitForAnimation();
VTable0x9c();
if (m_boundary == oldBoundary) {
MxLong time = Timer()->GetTime();
@ -343,7 +346,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
pos2 = pos1;
if (m_unk0xe9 != 0) {
WaitForAnimation();
VTable0x9c();
}
return 0;
@ -414,10 +417,11 @@ void LegoPathActor::VTable0x70(float p_time)
}
}
// STUB: LEGO1 0x1002e8b0
void LegoPathActor::VTable0x98()
// FUNCTION: LEGO1 0x1002e8b0
// FUNCTION: BETA10 0x100af2f7
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
}
// FUNCTION: LEGO1 0x1002e8d0
@ -463,11 +467,77 @@ MxU32 LegoPathActor::VTable0x6c(
return 0;
}
// STUB: LEGO1 0x1002ebe0
MxS32 LegoPathActor::VTable0x68(Vector3&, Vector3&, Vector3&)
// FUNCTION: LEGO1 0x1002ebe0
// FUNCTION: BETA10 0x100af35e
MxS32 LegoPathActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
{
// TODO
Mx3DPointFloat v2(p_v2);
((Vector3&) v2).Sub(&p_v1);
float len = v2.LenSquared();
if (len <= 0.001) {
return 0;
}
len = sqrt(len);
((Vector3&) v2).Div(len);
float radius = m_roi->GetWorldBoundingSphere().Radius();
list<LegoPathBoundary*> boundaries;
return FUN_1002edd0(boundaries, m_boundary, p_v1, v2, len, radius, p_v3, 0);
}
// FUNCTION: LEGO1 0x1002edd0
inline MxU32 LegoPathActor::FUN_1002edd0(
list<LegoPathBoundary*>& p_boundaries,
LegoPathBoundary* p_boundary,
Vector3& p_v1,
Vector3& p_v2,
float p_f1,
float p_f2,
Vector3& p_v3,
MxS32 p_und
)
{
MxU32 result = VTable0x6c(p_boundary, p_v1, p_v2, p_f1, p_f2, p_v3);
if (result == 0) {
p_boundaries.push_back(p_boundary);
if (p_und >= 2) {
return 0;
}
LegoS32 numEdges = p_boundary->GetNumEdges();
for (MxS32 i = 0; i < numEdges; i++) {
LegoUnknown100db7f4* edge = ((LegoUnknown100db7f4*) p_boundary->GetEdges()[i]);
LegoPathBoundary* boundary = (LegoPathBoundary*) edge->OtherFace(p_boundary);
if (boundary != NULL) {
list<LegoPathBoundary*>::iterator it;
for (it = p_boundaries.begin(); it != p_boundaries.end(); it++) {
if ((*it) == boundary) {
break;
}
}
if (it == p_boundaries.end()) {
result = FUN_1002edd0(p_boundaries, boundary, p_v1, p_v2, p_f1, p_f2, p_v3, p_und + 1);
if (result != 0) {
return result;
}
}
}
}
result = 0;
}
return result;
}
// STUB: LEGO1 0x1002f020
@ -476,21 +546,131 @@ void LegoPathActor::ParseAction(char* p_extra)
LegoActor::ParseAction(p_extra);
}
// STUB: LEGO1 0x1002f1b0
MxResult LegoPathActor::WaitForAnimation()
// FUNCTION: LEGO1 0x1002f1b0
// FUNCTION: BETA10 0x100af899
MxResult LegoPathActor::VTable0x9c()
{
// TODO
Mx3DPointFloat local34;
Mx3DPointFloat local48;
MxU32 local1c = 1;
MxU32 local20 = 1;
if (m_grec != NULL) {
if (m_grec->GetBit1()) {
local1c = 0;
local20 = 0;
Mx3DPointFloat vec;
switch (m_controller->FUN_1004a240(*m_grec, local34, local48, m_unk0xe4, m_destEdge, m_boundary)) {
case 0:
case 1:
break;
default:
return FAILURE;
}
}
else {
delete m_grec;
m_grec = NULL;
}
}
if (local1c != 0) {
SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
}
if (local20 != 0) {
Mx3DPointFloat local78;
Vector3& v1 = *m_destEdge->GetOpposingPoint(*m_boundary);
Vector3& v2 = *m_destEdge->CCWVertex(*m_boundary);
LERP3(local34, v1, v2, m_unk0xe4);
m_destEdge->FUN_1002ddc0(*m_boundary, local78);
local48.EqualsCross(m_boundary->GetUnknown0x14(), &local78);
local48.Unitize();
}
Vector3 rightRef(m_unk0xec[0]);
Vector3 upRef(m_unk0xec[1]);
Vector3 dirRef(m_unk0xec[2]);
upRef = *m_boundary->GetUnknown0x14();
rightRef.EqualsCross(&upRef, &dirRef);
rightRef.Unitize();
dirRef.EqualsCross(&rightRef, &upRef);
dirRef.Unitize();
Mx3DPointFloat localc0(m_unk0xec[3]);
Mx3DPointFloat local84(m_unk0xec[2]);
Mx3DPointFloat local70(local34);
((Vector3&) local70).Sub(&localc0);
float len = local70.LenSquared();
if (len >= 0.0f) {
len = sqrt(len);
((Vector3&) local84).Mul(len);
((Vector3&) local48).Mul(len);
}
if (!m_userNavFlag) {
((Vector3&) local84).Mul(-1.0f);
}
if (VTable0x80(localc0, local84, local34, local48) != SUCCESS) {
return FAILURE;
}
m_unk0x7c = 0.0f;
return SUCCESS;
}
// STUB: LEGO1 0x1002f650
void LegoPathActor::VTable0xa4(MxU8&, MxS32&)
// FUNCTION: LEGO1 0x1002f650
// FUNCTION: BETA10 0x100afd67
void LegoPathActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
{
// TODO
switch (GetActorId()) {
case 1:
p_und1 = TRUE;
p_und2 = 2;
break;
case 2:
p_und1 = FALSE;
p_und2 = 1;
break;
case 3:
p_und1 = TRUE;
p_und2 = 1;
break;
case 4:
case 6:
p_und1 = TRUE;
p_und2 = rand() % p_und2 + 1;
break;
case 5:
p_und1 = FALSE;
p_und2 = 2;
break;
default:
p_und1 = TRUE;
p_und2 = 1;
break;
}
}
// STUB: LEGO1 0x1002f700
// FUNCTION: LEGO1 0x1002f700
// FUNCTION: BETA10 0x100afe4c
void LegoPathActor::VTable0xa8()
{
// TODO
m_lastTime = Timer()->GetTime();
m_roi->FUN_100a58f0(m_unk0xec);
m_roi->VTable0x14();
if (m_userNavFlag) {
m_roi->WrappedSetLocalTransform(m_unk0xec);
FUN_10010c30();
}
}

View file

@ -1,7 +1,9 @@
#include "legopathboundary.h"
#include "decomp.h"
#include "geom/legounkown100db7f4.h"
#include "legopathactor.h"
#include "legopathstruct.h"
DECOMP_SIZE_ASSERT(LegoPathBoundary, 0x74)
@ -39,20 +41,299 @@ MxResult LegoPathBoundary::RemoveActor(LegoPathActor* p_actor)
return SUCCESS;
}
// STUB: LEGO1 0x100575b0
// FUNCTION: LEGO1 0x100575b0
// FUNCTION: BETA10 0x100b1598
void LegoPathBoundary::FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor)
{
Vector3* ccwV = NULL;
if (m_unk0x48 > 0 && m_unk0x50 != NULL) {
ccwV = m_edges[0]->CCWVertex(*this);
Mx3DPointFloat v;
v = p_point1;
((Vector3&) v).Sub(ccwV);
float dot1 = v.Dot(&v, m_unk0x50);
v = p_point2;
((Vector3&) v).Sub(ccwV);
float dot2 = v.Dot(&v, m_unk0x50);
if (dot2 > dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
LegoPathStruct* s = m_pathTrigger[i].m_pathStruct;
if (m_pathTrigger[i].m_unk0x08 >= dot1 && m_pathTrigger[i].m_unk0x08 < dot2) {
s->HandleTrigger(p_actor, TRUE, m_pathTrigger[i].m_data);
}
}
}
else if (dot2 < dot1) {
for (MxS32 i = 0; i < m_unk0x48; i++) {
LegoPathStruct* s = m_pathTrigger[i].m_pathStruct;
if (m_pathTrigger[i].m_unk0x08 >= dot2 && m_pathTrigger[i].m_unk0x08 < dot1) {
s->HandleTrigger(p_actor, FALSE, m_pathTrigger[i].m_data);
}
}
}
}
}
// STUB: LEGO1 0x10057950
// FUNCTION: LEGO1 0x10057720
// FUNCTION: BETA10 0x100b17ef
void LegoPathBoundary::SwitchBoundary(
LegoPathActor* p_actor,
LegoPathBoundary*& p_boundary,
LegoUnknown100db7f4*& p_edge,
float& p_unk0xe4
)
{
LegoUnknown100db7f4* e = p_edge;
if (p_edge->Unknown2(*p_boundary)) {
LegoPathBoundary* newBoundary = (LegoPathBoundary*) p_edge->OtherFace(p_boundary);
if (newBoundary == NULL) {
newBoundary = p_boundary;
}
MxS32 local10 = 0;
MxU8 userNavFlag;
if (e->Unknown(*newBoundary, 1)) {
userNavFlag = p_actor->GetUserNavFlag();
}
else {
userNavFlag = TRUE;
}
do {
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
LegoPathBoundary* local20 = (LegoPathBoundary*) p_edge->OtherFace(newBoundary);
if (p_edge->GetMask0x03() && (userNavFlag || p_edge->Unknown(*local20, 1))) {
local10++;
}
} while (p_edge != e);
MxBool localc = TRUE;
MxS32 local8 = local10 - 1;
if (local10 <= 1) {
local8 = 0;
}
else if (local10 == 2) {
local8 = 1;
}
else {
p_actor->VTable0xa4(localc, local8);
}
while (local8 > 0) {
if (localc) {
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
}
else {
p_edge = (LegoUnknown100db7f4*) p_edge->GetClockwiseEdge(*newBoundary);
}
LegoPathBoundary* local20 = (LegoPathBoundary*) p_edge->OtherFace(newBoundary);
if (p_edge->GetMask0x03() && (userNavFlag || p_edge->Unknown(*local20, 1))) {
local8--;
}
}
if (p_edge == e) {
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*newBoundary);
}
if (p_boundary != newBoundary) {
p_boundary->RemoveActor(p_actor);
p_boundary = newBoundary;
p_boundary->AddActor(p_actor);
}
else {
p_unk0xe4 = 1.0 - p_unk0xe4;
}
}
else {
do {
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
if (p_edge->GetMask0x03()) {
break;
}
} while (p_edge != e);
if (p_edge == e) {
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
p_edge = (LegoUnknown100db7f4*) p_edge->GetCounterclockwiseEdge(*p_boundary);
}
p_unk0xe4 = 1.0 - p_unk0xe4;
}
}
// FUNCTION: LEGO1 0x10057950
// FUNCTION: BETA10 0x100b1adc
MxU32 LegoPathBoundary::Intersect(
float p_scale,
Vector3& p_point1,
Vector3& p_point2,
Vector3& p_point3,
LegoEdge*& p_edge
LegoUnknown100db7f4*& p_edge
)
{
LegoUnknown100db7f4* e = NULL;
float localc;
MxU32 local10 = 0;
float len = 0.0f;
Mx3DPointFloat vec;
for (MxS32 i = 0; i < m_numEdges; i++) {
LegoUnknown100db7f4* edge = (LegoUnknown100db7f4*) m_edges[i];
if (p_point2.Dot(&m_edgeNormals[i], &p_point2) + m_edgeNormals[i][3] <= -1e-07) {
if (local10 == 0) {
local10 = 1;
vec = p_point2;
((Vector3&) vec).Sub(&p_point1);
len = vec.LenSquared();
if (len <= 0.0f) {
return 0;
}
len = sqrt(len);
((Vector3&) vec).Div(len);
}
float dot = vec.Dot(&vec, &m_edgeNormals[i]);
if (dot != 0.0f) {
float local34 = (-m_edgeNormals[i][3] - p_point1.Dot(&p_point1, &m_edgeNormals[i])) / dot;
if (local34 >= -0.001 && local34 <= len && (e == NULL || local34 < localc)) {
e = edge;
localc = local34;
}
}
}
}
if (e != NULL) {
if (localc < 0.0f) {
localc = 0.0f;
}
Mx3DPointFloat local50;
Mx3DPointFloat local70;
Vector3* local5c = e->GetOpposingPoint(*this);
p_point3 = vec;
p_point3.Mul(localc);
p_point3.Add(&p_point1);
local50 = p_point2;
((Vector3&) local50).Sub(local5c);
e->FUN_1002ddc0(*this, local70);
float local58 = local50.Dot(&local50, &local70);
LegoUnknown100db7f4* local54 = NULL;
if (local58 < 0.0f) {
Mx3DPointFloat local84;
for (LegoUnknown100db7f4* local88 = (LegoUnknown100db7f4*) e->GetClockwiseEdge(*this); e != local88;
local88 = (LegoUnknown100db7f4*) local88->GetClockwiseEdge(*this)) {
local88->FUN_1002ddc0(*this, local84);
if (local84.Dot(&local84, &local70) <= 0.9) {
break;
}
Vector3* local90 = local88->GetOpposingPoint(*this);
Mx3DPointFloat locala4(p_point3);
((Vector3&) locala4).Sub(local90);
float local8c = locala4.Dot(&locala4, &local84);
if (local8c > local58 && local8c < local88->m_unk0x3c) {
local54 = local88;
local58 = local8c;
local70 = local84;
local5c = local90;
}
}
}
else {
if (e->m_unk0x3c < local58) {
Mx3DPointFloat localbc;
for (LegoUnknown100db7f4* locala8 = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(*this);
e != locala8;
locala8 = (LegoUnknown100db7f4*) locala8->GetCounterclockwiseEdge(*this)) {
locala8->FUN_1002ddc0(*this, localbc);
if (localbc.Dot(&localbc, &local70) <= 0.9) {
break;
}
Vector3* localc4 = locala8->GetOpposingPoint(*this);
Mx3DPointFloat locald8(p_point3);
((Vector3&) locald8).Sub(localc4);
float localc0 = locald8.Dot(&locald8, &localbc);
if (localc0 < local58 && localc0 >= 0.0f) {
local54 = locala8;
local58 = localc0;
local70 = localbc;
local5c = localc4;
}
}
}
}
if (local54 != NULL) {
e = local54;
}
if (local58 <= 0.0f) {
if (!e->GetMask0x03()) {
p_edge = (LegoUnknown100db7f4*) e->GetClockwiseEdge(*this);
}
else {
p_edge = e;
}
p_point3 = *local5c;
return 2;
}
else if (local58 > 0.0f && e->m_unk0x3c > local58) {
p_point3 = local70;
p_point3.Mul(local58);
p_point3.Add(local5c);
p_edge = e;
return 1;
}
else {
p_point3 = *e->CCWVertex(*this);
if (!e->GetMask0x03()) {
p_edge = (LegoUnknown100db7f4*) e->GetCounterclockwiseEdge(*this);
}
else {
p_edge = e;
}
return 2;
}
}
return 0;
}

View file

@ -1,5 +1,6 @@
#include "legopathcontroller.h"
#include "legopathedgecontainer.h"
#include "legopathstruct.h"
#include "misc/legostorage.h"
#include "mxmisc.h"
@ -279,10 +280,10 @@ MxResult LegoPathController::FUN_10046050(
if (edge->GetMask0x03()) {
Mx3DPointFloat vec;
if (((LegoUnknown100db7f4*) edge->GetClockwiseEdge(boundary))->FUN_1002ddc0(*boundary, vec) == SUCCESS &&
if (((LegoUnknown100db7f4*) edge->GetClockwiseEdge(*boundary))->FUN_1002ddc0(*boundary, vec) == SUCCESS &&
vec.Dot(&vec, &p_direction) < 0.0f) {
edge =
(LegoUnknown100db7f4*) edge->GetCounterclockwiseEdge(boundary)->GetCounterclockwiseEdge(boundary);
(LegoUnknown100db7f4*) edge->GetCounterclockwiseEdge(*boundary)->GetCounterclockwiseEdge(*boundary);
}
if (!edge->GetMask0x03()) {
@ -527,7 +528,7 @@ MxResult LegoPathController::ReadStructs(LegoStorage* p_storage)
m_structs[i].m_name[length] = '\0';
}
if (p_storage->Read(&m_structs[i].m_unk0x08, sizeof(m_structs[i].m_unk0x08)) != SUCCESS) {
if (p_storage->Read(&m_structs[i].m_flags, sizeof(m_structs[i].m_flags)) != SUCCESS) {
return FAILURE;
}
}
@ -677,22 +678,24 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage)
if (boundary.m_unk0x48 > 0) {
boundary.m_unk0x50 = new Mx3DPointFloat;
boundary.m_unk0x4c = new LegoWEGEdge::Path[boundary.m_unk0x48];
boundary.m_pathTrigger = new LegoWEGEdge::PathWithTrigger[boundary.m_unk0x48];
for (j = 0; j < boundary.m_unk0x48; j++) {
if (p_storage->Read(&s, sizeof(s)) != SUCCESS) {
return FAILURE;
}
boundary.m_unk0x4c[j].m_unk0x00 = &m_structs[s];
boundary.m_pathTrigger[j].m_pathStruct = &m_structs[s];
if (p_storage->Read(&boundary.m_unk0x4c[j].m_unk0x04, sizeof(boundary.m_unk0x4c[j].m_unk0x04)) !=
if (p_storage->Read(&boundary.m_pathTrigger[j].m_data, sizeof(boundary.m_pathTrigger[j].m_data)) !=
SUCCESS) {
return FAILURE;
}
if (p_storage->Read(&boundary.m_unk0x4c[j].m_unk0x08, sizeof(boundary.m_unk0x4c[j].m_unk0x08)) !=
SUCCESS) {
if (p_storage->Read(
&boundary.m_pathTrigger[j].m_unk0x08,
sizeof(boundary.m_pathTrigger[j].m_unk0x08)
) != SUCCESS) {
return FAILURE;
}
}
@ -727,3 +730,36 @@ MxResult LegoPathController::ReadVector(LegoStorage* p_storage, Mx4DPointFloat&
return SUCCESS;
}
// FUNCTION: LEGO1 0x1004a240
// FUNCTION: BETA10 0x100b9160
MxS32 LegoPathController::FUN_1004a240(
LegoPathEdgeContainer& p_grec,
Vector3& p_v1,
Vector3& p_v2,
float p_f1,
LegoUnknown100db7f4*& p_edge,
LegoPathBoundary*& p_boundary
)
{
if (p_grec.size() == 0) {
p_v1 = p_grec.m_unk0x0c;
p_v2 = p_grec.m_unk0x20;
p_boundary = p_grec.m_boundary;
p_grec.SetBit1(FALSE);
return 1;
}
p_edge = p_grec.front().m_edge;
p_boundary = p_grec.front().m_boundary;
p_grec.pop_front();
Mx3DPointFloat vec;
p_v1 = *p_edge->CCWVertex(*p_boundary);
p_v1.Sub(p_edge->GetOpposingPoint(*p_boundary));
p_v1.Mul(p_f1);
p_v1.Add(p_edge->GetOpposingPoint(*p_boundary));
p_edge->FUN_1002ddc0(*p_boundary, vec);
p_v2.EqualsCross(p_boundary->GetUnknown0x14(), &vec);
return 0;
}

View file

@ -1,11 +1,168 @@
#include "legopathstruct.h"
#include "isle.h"
#include "jukebox_actions.h"
#include "jukeboxstate.h"
#include "legohideanimpresenter.h"
#include "legopathactor.h"
#include "legoutils.h"
#include "misc.h"
#include "mxbackgroundaudiomanager.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
#include "mxtype19notificationparam.h"
#include "scripts.h"
DECOMP_SIZE_ASSERT(LegoPathStructBase, 0x0c)
DECOMP_SIZE_ASSERT(LegoPathStruct, 0x14)
// STUB: LEGO1 0x1001b700
// FUNCTION: BETA10 0x100c26c5
void LegoPathStruct::VTable0x04(undefined4, undefined4, undefined4)
// Flags used in isle.cpp
extern MxU32 g_isleFlags;
// GLOBAL: LEGO1 0x100f119c
MxBool g_unk0x100f119c = FALSE;
// FUNCTION: LEGO1 0x1001b700
void LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data)
{
// TODO
if (!HandleTrigger(p_actor, p_direction, p_data, FALSE) && g_unk0x100f119c) {
HandleTrigger(p_actor, p_direction, p_data, TRUE);
}
}
// FUNCTION: LEGO1 0x1001b740
// FUNCTION: BETA10 0x100c26c5
MxBool LegoPathStruct::HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data, MxBool p_bool)
{
MxBool triggered = FALSE;
MxBool bool2 = p_bool ? !p_direction : p_direction;
MxU32 flags = bool2 ? c_bit5 : c_bit6;
flags |= p_actor->GetCameraFlag() ? c_bit1 : (c_bit2 | c_bit3 | c_bit4);
if ((m_flags & flags & (c_bit5 | c_bit6 | c_bit7)) && (m_flags & flags & (c_bit1 | c_bit2 | c_bit3 | c_bit4))) {
triggered = TRUE;
switch (m_name[2]) {
case c_camAnim:
if (g_isleFlags & Isle::c_playCamAnims) {
PlayCamAnim(p_actor, bool2, p_data, TRUE);
}
break;
case c_d: {
p_actor->VTable0x58(p_data);
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
p_actor->Notify(param);
LegoWorld* world = CurrentWorld();
if (world != NULL) {
NotificationManager()->Send(world, param);
}
break;
}
case c_e:
FUN_1001bc40(m_name, p_data, !(p_bool == FALSE));
break;
case c_g:
break;
case c_h: {
LegoHideAnimPresenter* presenter = m_world->GetHideAnimPresenter();
if (presenter != NULL) {
presenter->FUN_1006db40(p_data * 100);
}
break;
}
case c_music:
if (g_isleFlags & Isle::c_playMusic) {
PlayMusic(p_direction, p_data);
}
break;
case c_s: {
LegoWorld* world = CurrentWorld();
if (world != NULL) {
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
if (world->Notify(param) != 0) {
break;
}
}
FUN_1001bc40(m_name, p_data, p_bool == FALSE);
break;
}
case c_w: {
LegoWorld* world = CurrentWorld();
if (world != NULL) {
MxType19NotificationParam param(c_notificationType19, p_actor, m_name[2], p_data);
NotificationManager()->Send(world, param);
}
break;
}
}
}
return triggered;
}
// FUNCTION: LEGO1 0x1001bc40
// FUNCTION: BETA10 0x100c2a6c
void LegoPathStruct::FUN_1001bc40(const char* p_name, MxU32 p_data, MxBool p_bool)
{
MxDSAction action;
action.SetObjectId(p_data);
action.SetAtomId(m_atomId);
if (p_bool) {
action.SetUnknown24(-1);
Start(&action);
}
else {
action.SetUnknown24(-2);
DeleteObject(action);
}
}
// FUNCTION: LEGO1 0x1001bd10
// FUNCTION: BETA10 0x100c2b4a
void LegoPathStruct::PlayMusic(MxBool p_direction, MxU32 p_data)
{
JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
if (state != NULL && state->m_active) {
return;
}
JukeboxScript::Script music[] = {
JukeboxScript::c_ResidentalArea_Music,
JukeboxScript::c_BeachBlvd_Music,
JukeboxScript::c_Cave_Music,
JukeboxScript::c_CentralRoads_Music,
JukeboxScript::c_Jail_Music,
JukeboxScript::c_Hospital_Music,
JukeboxScript::c_InformationCenter_Music,
JukeboxScript::c_PoliceStation_Music,
JukeboxScript::c_Park_Music,
JukeboxScript::c_CentralNorthRoad_Music,
JukeboxScript::c_GarageArea_Music,
JukeboxScript::c_RaceTrackRoad_Music,
JukeboxScript::c_Beach_Music,
JukeboxScript::c_Quiet_Audio
};
MxS16 triggersReff[24][2] = {{11, 10}, {6, 10}, {3, 1}, {4, 1}, {1, 4}, {1, 4}, {13, 2}, {13, 2},
{13, 2}, {4, 10}, {11, 9}, {9, 7}, {8, 7}, {8, 5}, {5, 2}, {2, 4},
{4, 2}, {4, 5}, {11, 4}, {12, 10}, {10, 12}, {10, 12}, {14, 2}, {14, 2}};
MxDSAction action;
action.SetAtomId(*g_jukeboxScript);
action.SetUnknown24(-1);
if (p_data <= sizeOfArray(triggersReff)) {
action.SetObjectId(music[triggersReff[p_data - 1][p_direction == FALSE] - 1]);
}
if (action.GetObjectId() != -1) {
BackgroundAudioManager()->PlayMusic(action, 5, 4);
}
}

View file

@ -91,13 +91,13 @@ MxResult LegoRaceCar::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
}
// STUB: LEGO1 0x10014550
void LegoRaceCar::VTable0x98()
void LegoRaceCar::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4)
{
// TODO
}
// STUB: LEGO1 0x10014580
MxResult LegoRaceCar::WaitForAnimation()
MxResult LegoRaceCar::VTable0x9c()
{
// TODO
return SUCCESS;

View file

@ -180,7 +180,7 @@ MxResult LegoModelPresenter::CreateROI(MxDSChunk* p_chunk)
Mx3DPointFloat(m_action->GetUp().GetX(), m_action->GetUp().GetY(), m_action->GetUp().GetZ()),
mat
);
m_roi->FUN_100a46b0(mat);
m_roi->UpdateTransformationRelativeToParent(mat);
result = SUCCESS;

View file

@ -38,7 +38,7 @@
DECOMP_SIZE_ASSERT(Isle, 0x140)
// GLOBAL: LEGO1 0x100f1198
undefined4 g_unk0x100f1198 = 0x7f;
MxU32 g_isleFlags = 0x7f;
// FUNCTION: LEGO1 0x10030820
Isle::Isle()
@ -722,18 +722,18 @@ void Isle::Enable(MxBool p_enable)
m_act1state->m_unk0x018 = 8;
AnimationManager()->FUN_1005f6d0(FALSE);
AnimationManager()->FUN_1005f700(FALSE);
AnimationManager()->EnableCamAnims(FALSE);
g_unk0x100f1198 &= ~c_bit7;
g_isleFlags &= ~c_playMusic;
m_towtrack->FUN_1004dab0();
break;
case 9:
m_act1state->m_unk0x018 = 10;
AnimationManager()->FUN_1005f6d0(FALSE);
AnimationManager()->FUN_1005f700(FALSE);
AnimationManager()->EnableCamAnims(FALSE);
g_unk0x100f1198 &= ~c_bit7;
g_isleFlags &= ~c_playMusic;
m_ambulance->FUN_10036e60();
break;
case 11:
@ -940,7 +940,7 @@ MxLong Isle::HandleTransitionEnd()
FUN_10032d30(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
m_skateboard->FUN_10010510();
m_skateboard->ActivateSceneActions();
}
break;
case LegoGameState::e_ambulance:

View file

@ -23,12 +23,12 @@ LegoEdge::~LegoEdge()
}
// FUNCTION: LEGO1 0x1009a4d0
LegoEdge* LegoEdge::GetClockwiseEdge(LegoWEEdge* p_face)
LegoEdge* LegoEdge::GetClockwiseEdge(LegoWEEdge& p_face)
{
if (p_face == m_faceA) {
if (&p_face == m_faceA) {
return m_cwA;
}
else if (p_face == m_faceB) {
else if (&p_face == m_faceB) {
return m_cwB;
}
else {
@ -37,12 +37,12 @@ LegoEdge* LegoEdge::GetClockwiseEdge(LegoWEEdge* p_face)
}
// FUNCTION: LEGO1 0x1009a4f0
LegoEdge* LegoEdge::GetCounterclockwiseEdge(LegoWEEdge* p_face)
LegoEdge* LegoEdge::GetCounterclockwiseEdge(LegoWEEdge& p_face)
{
if (p_face == m_faceA) {
if (&p_face == m_faceA) {
return m_ccwA;
}
else if (p_face == m_faceB) {
else if (&p_face == m_faceB) {
return m_ccwB;
}
else {
@ -51,13 +51,13 @@ LegoEdge* LegoEdge::GetCounterclockwiseEdge(LegoWEEdge* p_face)
}
// FUNCTION: LEGO1 0x1009a510
Vector3* LegoEdge::GetOpposingPoint(LegoWEEdge* p_face)
Vector3* LegoEdge::GetOpposingPoint(LegoWEEdge& p_face)
{
return p_face == m_faceA ? m_pointB : m_pointA;
return &p_face == m_faceA ? m_pointB : m_pointA;
}
// FUNCTION: LEGO1 0x1009a530
Vector3* LegoEdge::GetPoint(LegoWEEdge* p_face)
Vector3* LegoEdge::CCWVertex(LegoWEEdge& p_face)
{
return p_face == m_faceB ? m_pointB : m_pointA;
return &p_face == m_faceB ? m_pointB : m_pointA;
}

View file

@ -12,12 +12,12 @@ struct LegoEdge {
LegoEdge();
virtual ~LegoEdge(); // vtable+0x00
LegoEdge* GetClockwiseEdge(LegoWEEdge* face);
LegoEdge* GetCounterclockwiseEdge(LegoWEEdge* face);
Vector3* GetOpposingPoint(LegoWEEdge* face);
Vector3* GetPoint(LegoWEEdge* face);
LegoEdge* GetClockwiseEdge(LegoWEEdge& p_face);
LegoEdge* GetCounterclockwiseEdge(LegoWEEdge& p_face);
Vector3* GetOpposingPoint(LegoWEEdge& p_face);
Vector3* CCWVertex(LegoWEEdge& p_face);
LegoResult FUN_1002ddc0(LegoWEEdge* p_face, Vector3& p_point);
LegoResult FUN_1002ddc0(LegoWEEdge& p_face, Vector3& p_point);
// SYNTHETIC: LEGO1 0x1009a4a0
// LegoEdge::`scalar deleting destructor'

View file

@ -8,5 +8,5 @@ LegoUnknown100db7f4::LegoUnknown100db7f4()
{
m_flags = 0;
m_unk0x28.Clear();
m_unk0x3c = 0;
m_unk0x3c = 0.0f;
}

View file

@ -2,7 +2,7 @@
#define __LEGOUNKNOWN100DB7F4_H
#include "legoedge.h"
#include "legoweedge.h"
#include "legowegedge.h"
#include "mxgeometry/mxgeometry3d.h"
// VTABLE: LEGO1 0x100db7f4
@ -34,6 +34,30 @@ struct LegoUnknown100db7f4 : public LegoEdge {
return SUCCESS;
}
// FUNCTION: BETA10 0x1004a830
LegoU32 Unknown(LegoWEGEdge& p_face, LegoU8 p_mask)
{
return (p_face.IsEqual(*m_faceB) && (m_flags & c_bit1) && (p_face.GetMask0x03() & p_mask) == p_mask) ||
(p_face.IsEqual(*m_faceA) && (m_flags & c_bit2) && (p_face.GetMask0x03() & p_mask) == p_mask);
}
// FUNCTION: BETA10 0x100b53b0
LegoU32 Unknown2(LegoWEGEdge& p_face)
{
return (p_face.IsEqual(*m_faceA) && (m_flags & c_bit1)) || (p_face.IsEqual(*m_faceB) && (m_flags & c_bit2));
}
// FUNCTION: BETA10 0x1001cbe0
LegoWEEdge* OtherFace(LegoWEEdge* p_other)
{
if (m_faceA == p_other) {
return m_faceB;
}
else {
return m_faceA;
}
}
LegoU32 GetMask0x03() { return m_flags & (c_bit1 | c_bit2); }
// SYNTHETIC: LEGO1 0x1009a6c0
@ -41,7 +65,7 @@ struct LegoUnknown100db7f4 : public LegoEdge {
LegoU16 m_flags; // 0x24
Mx3DPointFloat m_unk0x28; // 0x28
LegoU32 m_unk0x3c; // 0x3c
float m_unk0x3c; // 0x3c
};
#endif // __LEGOUNKNOWN100DB7F4_H

View file

@ -1,7 +1,7 @@
#include "legowegedge.h"
DECOMP_SIZE_ASSERT(LegoWEGEdge, 0x54)
DECOMP_SIZE_ASSERT(LegoWEGEdge::Path, 0x0c)
DECOMP_SIZE_ASSERT(LegoWEGEdge::PathWithTrigger, 0x0c)
// FUNCTION: LEGO1 0x1009a730
LegoWEGEdge::LegoWEGEdge()
@ -12,7 +12,7 @@ LegoWEGEdge::LegoWEGEdge()
m_edgeNormals = NULL;
m_flags = 0;
m_unk0x48 = 0;
m_unk0x4c = NULL;
m_pathTrigger = NULL;
m_unk0x50 = NULL;
}
@ -29,8 +29,8 @@ LegoWEGEdge::~LegoWEGEdge()
if (m_edgeNormals) {
delete[] m_edgeNormals;
}
if (m_unk0x4c) {
delete m_unk0x4c;
if (m_pathTrigger) {
delete m_pathTrigger;
}
if (m_unk0x50) {
delete m_unk0x50;

View file

@ -5,7 +5,7 @@
#include "legoweedge.h"
#include "mxgeometry/mxgeometry3d.h"
struct LegoPathStruct;
class LegoPathStruct;
// might be a struct with public members
// VTABLE: LEGO1 0x100db7f8
@ -13,24 +13,26 @@ struct LegoPathStruct;
class LegoWEGEdge : public LegoWEEdge {
public:
enum {
c_bit1 = 0x01,
c_bit2 = 0x02,
c_bit3 = 0x04,
c_bit5 = 0x10
};
// SIZE 0x0c
struct Path {
struct PathWithTrigger {
// FUNCTION: LEGO1 0x10048280
// FUNCTION: BETA10 0x100bd450
Path()
PathWithTrigger()
{
m_unk0x00 = NULL;
m_unk0x04 = 0;
m_unk0x08 = 0;
m_pathStruct = NULL;
m_data = 0;
m_unk0x08 = 0.0f;
}
LegoPathStruct* m_unk0x00; // 0x00
undefined4 m_unk0x04; // 0x04
undefined4 m_unk0x08; // 0x08
LegoPathStruct* m_pathStruct; // 0x00
unsigned int m_data; // 0x04
float m_unk0x08; // 0x08
};
LegoWEGEdge();
@ -53,12 +55,14 @@ class LegoWEGEdge : public LegoWEEdge {
}
}
inline LegoU8 GetMask0x03() { return m_flags & (c_bit1 | c_bit2); }
// SYNTHETIC: LEGO1 0x1009a7e0
// LegoWEGEdge::`scalar deleting destructor'
friend class LegoPathController;
private:
protected:
LegoU8 m_flags; // 0x0c
LegoU8 m_unk0x0d; // 0x0d
LegoChar* m_name; // 0x10
@ -67,7 +71,7 @@ class LegoWEGEdge : public LegoWEEdge {
Mx3DPointFloat m_unk0x30; // 0x30
LegoU32 m_unk0x44; // 0x44
LegoU8 m_unk0x48; // 0x48
Path* m_unk0x4c; // 0x4c
PathWithTrigger* m_pathTrigger; // 0x4c
Mx3DPointFloat* m_unk0x50; // 0x50
};

View file

@ -27,8 +27,52 @@ void LegoUnknown::FUN_1009a140(Vector3& p_point1, Vector3& p_point2, Vector3& p_
}
}
// STUB: LEGO1 0x1009a1e0
LegoResult LegoUnknown::FUN_1009a1e0(float, Matrix4&, Vector3&, LegoU32)
// FUNCTION: LEGO1 0x1009a1e0
// FUNCTION: BETA10 0x10182d61
LegoResult LegoUnknown::FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, LegoU32 p_und)
{
Vector3 v1(p_mat[3]);
Vector3 v2(p_mat[0]);
Vector3 v3(p_mat[1]);
Vector3 v4(p_mat[2]);
if (p_f1 <= 0.001) {
v1 = m_unk0x00[0];
v4 = m_unk0x00[1];
}
else if (p_f1 >= 0.999) {
v1 = m_unk0x00[0];
((Vector3&) v2).Add(&m_unk0x00[1]);
((Vector3&) v3).Add(&m_unk0x00[2]);
((Vector3&) v4).Add(&m_unk0x00[3]);
for (LegoS32 i = 0; i < 3; i++) {
v4[i] = m_unk0x00[1][i] + m_unk0x00[2][i] * 2.0f + m_unk0x00[3][i] * 3.0f;
}
}
else {
float local30 = p_f1 * p_f1;
float local34 = local30 * p_f1;
for (LegoS32 i = 0; i < 3; i++) {
v1[i] = m_unk0x00[0][i] + m_unk0x00[1][i] * p_f1 + m_unk0x00[2][i] * local30 + m_unk0x00[3][i] * local34;
v4[i] = m_unk0x00[1][i] + m_unk0x00[2][i] * p_f1 * 2.0f + m_unk0x00[3][i] * local30 * 3.0f;
}
}
if (p_und) {
((Vector3&) v4).Mul(-1.0f);
}
if (v4.Unitize() != 0) {
return FAILURE;
}
v2.EqualsCross(&p_v, &v4);
if (v2.Unitize() != 0) {
return FAILURE;
}
v3.EqualsCross(&v4, &v2);
return SUCCESS;
}

View file

@ -13,7 +13,7 @@ class LegoUnknown {
~LegoUnknown();
void FUN_1009a140(Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, Vector3& p_point4);
LegoResult FUN_1009a1e0(float, Matrix4&, Vector3&, LegoU32);
LegoResult FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, LegoU32 p_und);
private:
Mx3DPointFloat m_unk0x00[4]; // 0x00

View file

@ -38,6 +38,7 @@ enum NotificationId {
// SIZE 0x0c
class MxNotificationParam : public MxParam {
public:
inline MxNotificationParam() : m_type(c_notificationType0), m_sender(NULL) {}
inline MxNotificationParam(NotificationId p_type, MxCore* p_sender) : MxParam(), m_type(p_type), m_sender(p_sender)
{
}

View file

@ -28,10 +28,10 @@ class MxRegionCursor : public MxCore {
virtual void Reset(); // vtable+0x3c
private:
void FUN_100c46c0(MxRegionLeftRightList& p_leftRightList);
void ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList);
void UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom);
void FUN_100c4a20(MxRect32& p_rect);
void FUN_100c4b50(MxRect32& p_rect);
void ProcessRectOverlapAscending(MxRect32& p_rect);
void ProcessOverlapWithRect(MxRect32& p_rect);
MxRegion* m_region; // 0x08
MxRect32* m_rect; // 0x0c

View file

@ -64,8 +64,8 @@ struct MxRegionTopBottom {
~MxRegionTopBottom() { delete m_leftRightList; }
MxRegionTopBottom* Clone();
void FUN_100c5280(MxS32 p_left, MxS32 p_right);
MxBool FUN_100c57b0(MxRect32& p_rect);
void MergeOrExpandRegions(MxS32 p_left, MxS32 p_right);
MxBool CheckHorizontalOverlap(MxRect32& p_rect);
inline MxS32 GetTop() { return m_top; }
inline MxS32 GetBottom() { return m_bottom; }

View file

@ -7,9 +7,31 @@
// VTABLE: LEGO1 0x100d6230
// SIZE 0x10
class MxType19NotificationParam : public MxNotificationParam {
public:
MxType19NotificationParam(NotificationId p_type, MxCore* p_sender, MxU8 p_unk0x0e, MxU16 p_unk0x0c)
: MxNotificationParam()
{
m_type = p_type;
m_sender = p_sender;
m_unk0x0c = p_unk0x0c;
m_unk0x0e = p_unk0x0e;
}
// FUNCTION: LEGO1 0x1001bac0
MxNotificationParam* Clone() const override
{
return new MxType19NotificationParam(m_type, m_sender, m_unk0x0e, m_unk0x0c);
} // vtable+0x04
protected:
MxU16 m_unk0x0c; // 0x0c
MxU8 m_unk0x0e; // 0x0e
};
// SYNTHETIC: LEGO1 0x1001bb80
// MxType19NotificationParam::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x1001bbf0
// MxType19NotificationParam::~MxType19NotificationParam
#endif // MXTYPE19NOTIFICATIONPARAM_H

View file

@ -67,12 +67,12 @@ void MxRegion::VTable0x18(MxRect32& p_rect)
MxRegionTopBottom* newTopBottom = topBottom->Clone();
newTopBottom->SetBottom(rect.GetBottom());
topBottom->SetTop(rect.GetBottom());
newTopBottom->FUN_100c5280(rect.GetLeft(), rect.GetRight());
newTopBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight());
cursor.Prepend(newTopBottom);
rect.SetTop(rect.GetBottom());
}
else {
topBottom->FUN_100c5280(rect.GetLeft(), rect.GetRight());
topBottom->MergeOrExpandRegions(rect.GetLeft(), rect.GetRight());
rect.SetTop(topBottom->GetBottom());
}
}
@ -100,7 +100,7 @@ MxBool MxRegion::VTable0x1c(MxRect32& p_rect)
if (topBottom->GetTop() >= p_rect.GetBottom()) {
return FALSE;
}
if (topBottom->GetBottom() > p_rect.GetTop() && topBottom->FUN_100c57b0(p_rect)) {
if (topBottom->GetBottom() > p_rect.GetTop() && topBottom->CheckHorizontalOverlap(p_rect)) {
return TRUE;
}
}
@ -128,7 +128,7 @@ MxRegionTopBottom::MxRegionTopBottom(MxRect32& p_rect)
}
// FUNCTION: LEGO1 0x100c5280
void MxRegionTopBottom::FUN_100c5280(MxS32 p_left, MxS32 p_right)
void MxRegionTopBottom::MergeOrExpandRegions(MxS32 p_left, MxS32 p_right)
{
MxRegionLeftRightListCursor a(m_leftRightList);
MxRegionLeftRightListCursor b(m_leftRightList);
@ -190,7 +190,7 @@ MxRegionTopBottom* MxRegionTopBottom::Clone()
}
// FUNCTION: LEGO1 0x100c57b0
MxBool MxRegionTopBottom::FUN_100c57b0(MxRect32& p_rect)
MxBool MxRegionTopBottom::CheckHorizontalOverlap(MxRect32& p_rect)
{
MxRegionLeftRightListCursor cursor(m_leftRightList);
MxRegionLeftRight* leftRight;

View file

@ -34,7 +34,7 @@ MxRect32* MxRegionCursor::VTable0x18()
MxRegionTopBottom* topBottom;
if (m_topBottomCursor->Current(topBottom)) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
MxRegionLeftRight* leftRight;
m_leftRightCursor->First(leftRight);
@ -55,7 +55,7 @@ MxRect32* MxRegionCursor::VTable0x20()
MxRegionTopBottom* topBottom;
if (m_topBottomCursor->Current(topBottom)) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
MxRegionLeftRight* leftRight;
m_leftRightCursor->Last(leftRight);
@ -83,7 +83,7 @@ MxRect32* MxRegionCursor::VTable0x28()
}
if (m_topBottomCursor->Next(topBottom)) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
m_leftRightCursor->First(leftRight);
UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom());
@ -108,7 +108,7 @@ MxRect32* MxRegionCursor::VTable0x30()
}
if (m_topBottomCursor->Prev(topBottom)) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
m_leftRightCursor->Last(leftRight);
UpdateRect(leftRight->GetLeft(), topBottom->GetTop(), leftRight->GetRight(), topBottom->GetBottom());
@ -123,7 +123,7 @@ MxRect32* MxRegionCursor::VTable0x30()
MxRect32* MxRegionCursor::VTable0x14(MxRect32& p_rect)
{
m_topBottomCursor->Reset();
FUN_100c4a20(p_rect);
ProcessRectOverlapAscending(p_rect);
return m_rect;
}
@ -131,7 +131,7 @@ MxRect32* MxRegionCursor::VTable0x14(MxRect32& p_rect)
MxRect32* MxRegionCursor::VTable0x1c(MxRect32& p_rect)
{
m_topBottomCursor->Reset();
FUN_100c4b50(p_rect);
ProcessOverlapWithRect(p_rect);
return m_rect;
}
@ -150,11 +150,11 @@ MxRect32* MxRegionCursor::VTable0x24(MxRect32& p_rect)
m_rect->Intersect(p_rect);
}
else {
FUN_100c4a20(p_rect);
ProcessRectOverlapAscending(p_rect);
}
}
else {
FUN_100c4a20(p_rect);
ProcessRectOverlapAscending(p_rect);
}
return m_rect;
@ -175,11 +175,11 @@ MxRect32* MxRegionCursor::VTable0x2c(MxRect32& p_rect)
m_rect->Intersect(p_rect);
}
else {
FUN_100c4b50(p_rect);
ProcessOverlapWithRect(p_rect);
}
}
else {
FUN_100c4b50(p_rect);
ProcessOverlapWithRect(p_rect);
}
return m_rect;
@ -202,7 +202,7 @@ void MxRegionCursor::Reset()
}
// FUNCTION: LEGO1 0x100c46c0
void MxRegionCursor::FUN_100c46c0(MxRegionLeftRightList& p_leftRightList)
void MxRegionCursor::ResetAndInitializeCursor(MxRegionLeftRightList& p_leftRightList)
{
if (m_leftRightCursor) {
delete m_leftRightCursor;
@ -225,7 +225,7 @@ void MxRegionCursor::UpdateRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32
}
// FUNCTION: LEGO1 0x100c4a20
void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect)
void MxRegionCursor::ProcessRectOverlapAscending(MxRect32& p_rect)
{
MxRegionTopBottom* topBottom;
while (m_topBottomCursor->Next(topBottom)) {
@ -235,7 +235,7 @@ void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect)
}
if (p_rect.GetTop() < topBottom->GetBottom()) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
MxRegionLeftRight* leftRight;
while (m_leftRightCursor->Next(leftRight)) {
@ -261,7 +261,7 @@ void MxRegionCursor::FUN_100c4a20(MxRect32& p_rect)
}
// FUNCTION: LEGO1 0x100c4b50
void MxRegionCursor::FUN_100c4b50(MxRect32& p_rect)
void MxRegionCursor::ProcessOverlapWithRect(MxRect32& p_rect)
{
MxRegionTopBottom* topBottom;
while (m_topBottomCursor->Prev(topBottom)) {
@ -271,7 +271,7 @@ void MxRegionCursor::FUN_100c4b50(MxRect32& p_rect)
}
if (topBottom->GetTop() < p_rect.GetBottom()) {
FUN_100c46c0(*topBottom->m_leftRightList);
ResetAndInitializeCursor(*topBottom->m_leftRightList);
MxRegionLeftRight* leftRight;
while (m_leftRightCursor->Prev(leftRight)) {

View file

@ -28,7 +28,7 @@ void OrientableROI::WrappedSetLocalTransform(const Matrix4& p_transform)
}
// FUNCTION: LEGO1 0x100a46b0
void OrientableROI::FUN_100a46b0(const Matrix4& p_transform)
void OrientableROI::UpdateTransformationRelativeToParent(const Matrix4& p_transform)
{
MxMatrix mat;

View file

@ -33,7 +33,7 @@ class OrientableROI : public ROI {
virtual void UpdateWorldVelocity(); // vtable+0x2c
void WrappedSetLocalTransform(const Matrix4& p_transform);
void FUN_100a46b0(const Matrix4& p_transform);
void UpdateTransformationRelativeToParent(const Matrix4& p_transform);
void WrappedVTable0x24(const Matrix4& p_transform);
void GetLocalTransform(Matrix4& p_transform);
void FUN_100a58f0(const Matrix4& p_transform);

View file

@ -104,7 +104,7 @@ class Vector2 {
if (sq > 0.0f) {
float root = sqrt(sq);
if (root > 0) {
if (root > 0.0f) {
DivScalarImpl(&root);
return 0;
}

View file

@ -8,6 +8,9 @@
DECOMP_SIZE_ASSERT(ViewManager, 0x1bc)
// GLOBAL: LEGO1 0x100dbc78
int g_unk0x100dbc78[8][3] = {{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {1, 0, 0}, {0, 1, 1}, {1, 0, 1}, {1, 1, 0}, {1, 1, 1}};
// GLOBAL: LEGO1 0x100dbcd8
int g_unk0x100dbcd8[18] = {0, 1, 5, 6, 2, 3, 3, 0, 4, 1, 2, 6, 0, 3, 2, 4, 5, 6};
@ -55,11 +58,35 @@ ViewManager::~ViewManager()
SetPOVSource(NULL);
}
// STUB: LEGO1 0x100a6150
// FUNCTION: LEGO1 0x100a6150
// FUNCTION: BETA10 0x10172164
undefined4 ViewManager::FUN_100a6150(const BoundingBox& p_bounding_box)
unsigned int ViewManager::FUN_100a6150(const BoundingBox& p_bounding_box)
{
return 1;
const Vector3* box[] = {&p_bounding_box.Min(), &p_bounding_box.Max()};
float und[8][3];
int i, j, k;
for (i = 0; i < 8; i++) {
for (j = 0; j < 3; j++) {
und[i][j] = box[g_unk0x100dbc78[i][j]]->operator[](j);
}
}
for (i = 0; i < 6; i++) {
for (k = 0; k < 8; k++) {
if (unk0x150[i][0] * und[k][0] + unk0x150[i][2] * und[k][2] + unk0x150[i][1] * und[k][1] + unk0x150[i][3] >=
0.0f) {
break;
}
}
if (k == 8) {
return FALSE;
}
}
return TRUE;
}
// FUNCTION: LEGO1 0x100a6410
@ -70,7 +97,7 @@ void ViewManager::Remove(ViewROI* p_roi)
rois.erase(it);
if (p_roi->GetUnknown0xe0() >= 0) {
FUN_100a66a0(p_roi);
RemoveROIDetailFromScene(p_roi);
}
const CompoundObject* comp = p_roi->GetComp();
@ -78,7 +105,7 @@ void ViewManager::Remove(ViewROI* p_roi)
if (comp != NULL) {
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
if (((ViewROI*) *it)->GetUnknown0xe0() >= 0) {
FUN_100a66a0((ViewROI*) *it);
RemoveROIDetailFromScene((ViewROI*) *it);
}
}
}
@ -100,7 +127,7 @@ void ViewManager::RemoveAll(ViewROI* p_roi)
}
else {
if (p_roi->GetUnknown0xe0() >= 0) {
FUN_100a66a0(p_roi);
RemoveROIDetailFromScene(p_roi);
}
p_roi->SetUnknown0xe0(-1);
@ -117,7 +144,7 @@ void ViewManager::RemoveAll(ViewROI* p_roi)
}
// FUNCTION: LEGO1 0x100a65b0
void ViewManager::FUN_100a65b0(ViewROI* p_roi, int p_und)
void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und)
{
if (p_roi->GetLODCount() <= p_und) {
p_und = p_roi->GetLODCount() - 1;
@ -170,7 +197,7 @@ void ViewManager::FUN_100a65b0(ViewROI* p_roi, int p_und)
}
// FUNCTION: LEGO1 0x100a66a0
void ViewManager::FUN_100a66a0(ViewROI* p_roi)
void ViewManager::RemoveROIDetailFromScene(ViewROI* p_roi)
{
const ViewLOD* lod = (const ViewLOD*) p_roi->GetLOD(p_roi->GetUnknown0xe0());
@ -191,10 +218,10 @@ void ViewManager::FUN_100a66a0(ViewROI* p_roi)
}
// FUNCTION: LEGO1 0x100a66f0
inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und)
inline void ViewManager::ManageVisibilityAndDetailRecursively(ViewROI* p_roi, int p_und)
{
if (!p_roi->GetVisibility() && p_und != -2) {
FUN_100a66f0(p_roi, -2);
ManageVisibilityAndDetailRecursively(p_roi, -2);
}
else {
const CompoundObject* comp = p_roi->GetComp();
@ -208,7 +235,7 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und)
return;
}
FUN_100a66f0(p_roi, -2);
ManageVisibilityAndDetailRecursively(p_roi, -2);
return;
}
@ -218,19 +245,19 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und)
if (p_und == -2) {
if (p_roi->GetUnknown0xe0() >= 0) {
FUN_100a66a0(p_roi);
RemoveROIDetailFromScene(p_roi);
p_roi->SetUnknown0xe0(-2);
}
if (comp != NULL) {
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
FUN_100a66f0((ViewROI*) *it, p_und);
ManageVisibilityAndDetailRecursively((ViewROI*) *it, p_und);
}
}
}
else if (comp == NULL) {
if (p_roi->GetLODs() != NULL && p_roi->GetLODCount() > 0) {
FUN_100a65b0(p_roi, p_und);
UpdateROIDetailBasedOnLOD(p_roi, p_und);
return;
}
}
@ -238,7 +265,7 @@ inline void ViewManager::FUN_100a66f0(ViewROI* p_roi, int p_und)
p_roi->SetUnknown0xe0(-1);
for (CompoundObject::const_iterator it = comp->begin(); !(it == comp->end()); it++) {
FUN_100a66f0((ViewROI*) *it, p_und);
ManageVisibilityAndDetailRecursively((ViewROI*) *it, p_und);
}
}
}
@ -257,11 +284,11 @@ void ViewManager::Update(float p_previousRenderTime, float)
Unknown();
}
else if (flags & c_bit2) {
FUN_100a6b90();
UpdateViewTransformations();
}
for (CompoundObject::iterator it = rois.begin(); it != rois.end(); it++) {
FUN_100a66f0((ViewROI*) *it, -1);
ManageVisibilityAndDetailRecursively((ViewROI*) *it, -1);
}
stopWatch.Stop();
@ -316,7 +343,7 @@ inline int ViewManager::Unknown()
*unk0x90 = fVar3;
// clang-format on
FUN_100a6b90();
UpdateViewTransformations();
return 0;
}
}
@ -376,7 +403,7 @@ inline int ViewManager::Unknown3(ViewROI* p_roi)
}
// FUNCTION: LEGO1 0x100a6b90
void ViewManager::FUN_100a6b90()
void ViewManager::UpdateViewTransformations()
{
flags &= ~c_bit2;

View file

@ -23,18 +23,18 @@ class ViewManager {
void Remove(ViewROI* p_roi);
void RemoveAll(ViewROI* p_roi);
undefined4 FUN_100a6150(const BoundingBox& p_bounding_box);
void FUN_100a65b0(ViewROI* p_roi, int p_und);
void FUN_100a66a0(ViewROI* p_roi);
unsigned int FUN_100a6150(const BoundingBox& p_bounding_box);
void UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_und);
void RemoveROIDetailFromScene(ViewROI* p_roi);
void SetPOVSource(const OrientableROI* point_of_view);
float ProjectedSize(const BoundingSphere& p_bounding_sphere);
ViewROI* Pick(Tgl::View* p_view, unsigned long x, unsigned long y);
void SetResolution(int width, int height);
void SetFrustrum(float fov, float front, float back);
inline void FUN_100a66f0(ViewROI* p_roi, int p_und);
inline void ManageVisibilityAndDetailRecursively(ViewROI* p_roi, int p_und);
void Update(float p_previousRenderTime, float);
inline int Unknown();
void FUN_100a6b90();
void UpdateViewTransformations();
inline static int Unknown2(float p_und1, float p_und2, ViewROI* p_roi);
inline static int Unknown3(ViewROI* p_roi);