Merge branch 'isledecomp:master' into master

This commit is contained in:
MasterTimeThief 2025-07-03 17:17:25 -04:00 committed by GitHub
commit e123ed8e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
45 changed files with 221 additions and 219 deletions

View File

@ -129,7 +129,7 @@ class Act3 : public LegoWorld {
void RemoveDonut(Act3Ammo& p_p);
MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
void FUN_10072ad0(undefined4 p_param1);
void TriggerHitSound(undefined4 p_param1);
MxResult FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2);
MxResult FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2);
void SetBrickster(Act3Brickster* p_brickster);
@ -168,12 +168,12 @@ class Act3 : public LegoWorld {
Helicopter* m_copter; // 0x420c
Act3Shark* m_shark; // 0x4210
MxFloat m_time; // 0x4214
MxU8 m_unk0x4218; // 0x4218
MxU8 m_unk0x4219; // 0x4219
MxU8 m_unk0x421a; // 0x421a
MxU8 m_unk0x421b; // 0x421b
MxU8 m_unk0x421c; // 0x421c
MxU8 m_unk0x421d; // 0x421d
MxU8 m_pizzaHitSound; // 0x4218
MxU8 m_pizzaMissSound; // 0x4219
MxU8 m_copDonutSound; // 0x421a
MxU8 m_donutMissSound; // 0x421b
MxU8 m_islanderSound; // 0x421c
MxU8 m_bricksterDonutSound; // 0x421d
undefined m_unk0x421e; // 0x421e
Act3List m_unk0x4220; // 0x4220
MxPresenter* m_helicopterDots[15]; // 0x4230

View File

@ -52,13 +52,13 @@ class CarRace : public LegoRace {
return !strcmp(p_name, CarRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxLong HandleType0Notification(MxNotificationParam&) override; // vtable+0x78
// FUNCTION: BETA10 0x100cd060
RaceSkel* GetSkeleton() { return m_skeleton; }

View File

@ -123,7 +123,7 @@ class Hospital : public LegoWorld {
MxLong m_copLedAnimTimer; // 0x11c
MxLong m_pizzaLedAnimTimer; // 0x120
MxLong m_time; // 0x124
undefined m_unk0x128; // 0x128
MxBool m_exited; // 0x128
};
#endif // HOSPITAL_H

View File

@ -29,12 +29,12 @@ class JetskiRace : public LegoRace {
return !strcmp(p_name, JetskiRace::ClassName()) || LegoRace::IsA(p_name);
}
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleClick(LegoEventNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
void ReadyWorld() override; // vtable+0x50
MxBool Escape() override; // vtable+0x64
MxLong HandleControl(LegoControlManagerNotificationParam&) override; // vtable+0x6c
MxLong HandlePathStruct(LegoPathStructNotificationParam&) override; // vtable+0x70
MxLong HandleEndAction(MxEndActionNotificationParam&) override; // vtable+0x74
void FUN_10016930(MxS32 p_param1, MxS16 p_param2);

View File

@ -121,7 +121,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
void SubstituteVariables();
void FUN_1006b900(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, Matrix4* p_matrix);
void FUN_1006c8a0(MxBool p_bool);
void SetDisabled(MxBool p_disabled);
LegoAnim* m_anim; // 0x64
LegoROI** m_roiMap; // 0x68

View File

@ -78,7 +78,7 @@ class LegoBuildingManager : public MxCore {
MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
MxBool DecrementCounter(LegoEntity* p_entity);
MxBool DecrementCounter(MxS32 p_index);
MxBool DecrementCounter(LegoBuildingInfo* p_data);

View File

@ -86,7 +86,7 @@ class LegoCharacterManager {
MxBool SwitchMove(LegoROI* p_roi);
MxBool SwitchMood(LegoROI* p_roi);
MxU32 GetAnimationId(LegoROI* p_roi);
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_und);
MxU32 GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood);
MxU8 GetMood(LegoROI* p_roi);
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
MxResult UpdateBoundingSphereAndBox(LegoROI* p_roi);

View File

@ -28,7 +28,7 @@ class LegoEntity : public MxEntity {
};
enum {
c_altBit1 = 0x01
c_disabled = 0x01
};
LegoEntity() { Init(); }
@ -68,13 +68,13 @@ class LegoEntity : public MxEntity {
// FUNCTION: BETA10 0x10013260
virtual void SetWorldSpeed(MxFloat p_worldSpeed) { m_worldSpeed = p_worldSpeed; } // vtable+0x30
virtual void ClickSound(MxBool p_und); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
virtual void ClickSound(MxBool p_basedOnMood); // vtable+0x34
virtual void ClickAnimation(); // vtable+0x38
virtual void SwitchVariant(); // vtable+0x3c
virtual void SwitchSound(); // vtable+0x40
virtual void SwitchMove(); // vtable+0x44
virtual void SwitchColor(LegoROI* p_roi); // vtable+0x48
virtual void SwitchMood(); // vtable+0x4c
void FUN_10010c30();
void SetType(MxU8 p_type);
@ -83,7 +83,7 @@ class LegoEntity : public MxEntity {
Mx3DPointFloat GetWorldUp();
Mx3DPointFloat GetWorldPosition();
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
MxBool IsInteraction(MxU8 p_flag) { return m_interaction & p_flag; }
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
MxU8 GetFlags() { return m_flags; }
@ -101,14 +101,14 @@ class LegoEntity : public MxEntity {
void SetFlags(MxU8 p_flags) { m_flags = p_flags; }
void SetFlag(MxU8 p_flag) { m_flags |= p_flag; }
void ClearFlag(MxU8 p_flag) { m_flags &= ~p_flag; }
void SetUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 |= p_flag; }
void ClearUnknown0x10Flag(MxU8 p_flag) { m_unk0x10 &= ~p_flag; }
void SetInteractionFlag(MxU8 p_flag) { m_interaction |= p_flag; }
void ClearInteractionFlag(MxU8 p_flag) { m_interaction &= ~p_flag; }
protected:
void Init();
void SetWorld();
MxU8 m_unk0x10; // 0x10
MxU8 m_interaction; // 0x10
MxU8 m_flags; // 0x11
Mx3DPointFloat m_worldLocation; // 0x14
Mx3DPointFloat m_worldDirection; // 0x28

View File

@ -13,7 +13,7 @@ struct LegoPathEdgeContainer;
struct LegoOrientedEdge;
class LegoWEEdge;
extern MxLong g_unk0x100f3308;
extern MxLong g_timeLastHitSoundPlayed;
extern const char* g_strHIT_WALL_SOUND;
// VTABLE: LEGO1 0x100d6e28

View File

@ -49,7 +49,7 @@ class LegoPlantManager : public MxCore {
MxBool SwitchMove(LegoEntity* p_entity);
MxBool SwitchMood(LegoEntity* p_entity);
MxU32 GetAnimationId(LegoEntity* p_entity);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood);
LegoPlantInfo* GetInfoArray(MxS32& p_length);
LegoEntity* CreatePlant(MxS32 p_index, LegoWorld* p_world, LegoOmni::World p_worldId);
MxBool DecrementCounter(LegoEntity* p_entity);

View File

@ -11,7 +11,7 @@
#include "mxtypes.h"
class Act1State;
class LegoEventNotificationParam;
class LegoControlManagerNotificationParam;
class LegoPathActor;
class MxEndActionNotificationParam;
class MxNotificationParam;
@ -117,7 +117,7 @@ class LegoRace : public LegoWorld {
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
virtual MxLong HandleClick(LegoEventNotificationParam&) = 0; // vtable+0x6c
virtual MxLong HandleControl(LegoControlManagerNotificationParam&) = 0; // vtable+0x6c
// FUNCTION: LEGO1 0x10015b70
virtual MxLong HandlePathStruct(LegoPathStructNotificationParam&) { return 0; } // vtable+0x70

View File

@ -144,10 +144,10 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
MxResult VTable0x9c() override; // vtable+0x9c
virtual void SetMaxLinearVelocity(float p_maxLinearVelocity);
virtual void FUN_10012ff0(float p_param);
virtual void KickCamera(float p_param);
virtual MxU32 HandleSkeletonKicks(float p_param1);
static void FUN_10012de0();
static void InitYouCantStopSound();
static void InitSoundIndices();
// SYNTHETIC: LEGO1 0x10014240
@ -155,7 +155,7 @@ class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap {
private:
undefined m_userState; // 0x54
float m_unk0x58; // 0x58
float m_kickStart; // 0x58
Mx3DPointFloat m_unk0x5c; // 0x5c
// Names verified by BETA10 0x100cb4a9

View File

@ -44,8 +44,11 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
Vector3& p_v3
) override; // vtable+0x6c
void Animate(float p_time) override; // vtable+0x70
void SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
override; // vtable+0x98
void SwitchBoundary(
LegoPathBoundary*& p_boundary,
LegoOrientedEdge*& p_edge,
float& p_unk0xe4
) override; // vtable+0x98
MxResult VTable0x9c() override; // vtable+0x9c
// LegoCarRaceActor vtable
@ -83,7 +86,7 @@ class LegoCarRaceActor : public virtual LegoRaceActor {
protected:
MxFloat m_unk0x08; // 0x08
MxU8 m_unk0x0c; // 0x0c
MxU8 m_animState; // 0x0c
// Could be a multiplier for the maximum speed when going straight
MxFloat m_unk0x10; // 0x10

View File

@ -579,7 +579,7 @@ void Act3Brickster::Animate(float p_time)
}
if (m_unk0x54 < p_time) {
((Act3*) m_world)->FUN_10072ad0(5);
((Act3*) m_world)->TriggerHitSound(5);
m_unk0x54 = p_time + 15000.0f;
}
@ -595,7 +595,7 @@ void Act3Brickster::Animate(float p_time)
assert(SoundManager()->GetCacheSoundManager());
if (m_unk0x58 >= 8) {
((Act3*) m_world)->FUN_10072ad0(6);
((Act3*) m_world)->TriggerHitSound(6);
}
else {
SoundManager()->GetCacheSoundManager()->Play("eatpz", NULL, FALSE);

View File

@ -378,11 +378,11 @@ void Act3Ammo::Animate(float p_time)
if (IsBit4()) {
if (IsPizza()) {
m_world->RemovePizza(*this);
m_world->FUN_10072ad0(2);
m_world->TriggerHitSound(2);
}
else {
m_world->RemoveDonut(*this);
m_world->FUN_10072ad0(4);
m_world->TriggerHitSound(4);
}
}
else {

View File

@ -199,10 +199,10 @@ LegoBuildingInfo g_buildingInfoInit[16] = {
MxU32 LegoBuildingManager::g_maxSound = 6;
// GLOBAL: LEGO1 0x100f373c
MxU32 g_unk0x100f373c = 0x3c;
MxU32 g_buildingSoundIdOffset = 0x3c;
// GLOBAL: LEGO1 0x100f3740
MxU32 g_unk0x100f3740 = 0x42;
MxU32 g_buildingSoundIdMoodOffset = 0x42;
// clang-format off
// GLOBAL: LEGO1 0x100f3788
@ -227,6 +227,8 @@ LegoBuildingInfo g_buildingInfo[16];
// GLOBAL: LEGO1 0x100f3748
MxS32 LegoBuildingManager::g_maxMove[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 0};
#define HAUS1_INDEX 12
// FUNCTION: LEGO1 0x1002f8b0
void LegoBuildingManager::configureLegoBuildingManager(MxS32 p_buildingManagerConfig)
{
@ -461,7 +463,7 @@ MxBool LegoBuildingManager::SwitchVariant(LegoEntity* p_entity)
roi->SetVisibility(FALSE);
info->m_variant = g_buildingInfoVariants[m_nextVariant];
CreateBuilding(12, CurrentWorld());
CreateBuilding(HAUS1_INDEX, CurrentWorld());
if (info->m_entity != NULL) {
info->m_entity->GetROI()->SetVisibility(TRUE);
@ -548,7 +550,7 @@ MxU32 LegoBuildingManager::GetAnimationId(LegoEntity* p_entity)
// FUNCTION: LEGO1 0x1002ff40
// FUNCTION: BETA10 0x10064398
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
{
LegoBuildingInfo* info = GetInfo(p_entity);
@ -556,12 +558,12 @@ MxU32 LegoBuildingManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
return 0;
}
if (p_state) {
return info->m_mood + g_unk0x100f3740;
if (p_basedOnMood) {
return info->m_mood + g_buildingSoundIdMoodOffset;
}
if (info != NULL) {
return info->m_sound + g_unk0x100f373c;
return info->m_sound + g_buildingSoundIdOffset;
}
return 0;

View File

@ -37,10 +37,10 @@ MxU32 g_characterAnimationId = 10;
char* LegoCharacterManager::g_customizeAnimFile = NULL;
// GLOBAL: LEGO1 0x100fc4d8
MxU32 g_soundIdOffset = 50;
MxU32 g_characterSoundIdOffset = 50;
// GLOBAL: LEGO1 0x100fc4dc
MxU32 g_soundIdMoodOffset = 66;
MxU32 g_characterSoundIdMoodOffset = 66;
// GLOBAL: LEGO1 0x100fc4e8
MxU32 g_headTextureCounter = 0;
@ -931,16 +931,16 @@ MxU32 LegoCharacterManager::GetAnimationId(LegoROI* p_roi)
// FUNCTION: LEGO1 0x10085140
// FUNCTION: BETA10 0x10076855
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_und)
MxU32 LegoCharacterManager::GetSoundId(LegoROI* p_roi, MxBool p_basedOnMood)
{
LegoActorInfo* info = GetActorInfo(p_roi);
if (p_und) {
return info->m_mood + g_soundIdMoodOffset;
if (p_basedOnMood) {
return info->m_mood + g_characterSoundIdMoodOffset;
}
if (info != NULL) {
return info->m_sound + g_soundIdOffset;
return info->m_sound + g_characterSoundIdOffset;
}
else {
return 0;

View File

@ -40,10 +40,10 @@ MxU8 g_counters[] = {1, 2, 2, 3};
MxU32 LegoPlantManager::g_maxSound = 8;
// GLOBAL: LEGO1 0x100f3160
MxU32 g_unk0x100f3160 = 56;
MxU32 g_plantSoundIdOffset = 56;
// GLOBAL: LEGO1 0x100f3164
MxU32 g_unk0x100f3164 = 66;
MxU32 g_plantSoundIdMoodOffset = 66;
// GLOBAL: LEGO1 0x100f3168
MxS32 LegoPlantManager::g_maxMove[4] = {3, 3, 3, 3};
@ -513,16 +513,16 @@ MxU32 LegoPlantManager::GetAnimationId(LegoEntity* p_entity)
// FUNCTION: LEGO1 0x10026ba0
// FUNCTION: BETA10 0x100c61ba
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_state)
MxU32 LegoPlantManager::GetSoundId(LegoEntity* p_entity, MxBool p_basedOnMood)
{
LegoPlantInfo* info = GetInfo(p_entity);
if (p_state) {
return (info->m_mood & 1) + g_unk0x100f3164;
if (p_basedOnMood) {
return (info->m_mood & 1) + g_plantSoundIdMoodOffset;
}
if (info != NULL) {
return info->m_sound + g_unk0x100f3160;
return info->m_sound + g_plantSoundIdOffset;
}
return 0;

View File

@ -507,7 +507,7 @@ MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id)
}
else {
if (((MxPresenter*) object)->GetAction()) {
FUN_100b7220(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE);
ApplyMask(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE);
}
((MxPresenter*) object)->EndAction();
@ -536,7 +536,7 @@ MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_wor
}
else {
if (((MxPresenter*) object)->GetAction()) {
FUN_100b7220(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE);
ApplyMask(((MxPresenter*) object)->GetAction(), MxDSAction::c_world, FALSE);
}
((MxPresenter*) object)->EndAction();
@ -705,14 +705,14 @@ void WriteDefaultTexture(LegoStorage* p_storage, const char* p_name)
if (image != NULL) {
if (desc.dwWidth == desc.lPitch) {
memcpy(desc.lpSurface, image->GetBits(), desc.dwWidth * desc.dwHeight);
memcpy(image->GetBits(), desc.lpSurface, desc.dwWidth * desc.dwHeight);
}
else {
MxU8* surface = (MxU8*) desc.lpSurface;
const LegoU8* bits = image->GetBits();
LegoU8* bits = image->GetBits();
for (MxS32 i = 0; i < desc.dwHeight; i++) {
memcpy(surface, bits, desc.dwWidth);
memcpy(bits, surface, desc.dwWidth);
surface += desc.lPitch;
bits += desc.dwWidth;
}

View File

@ -44,7 +44,7 @@ MxResult MxControlPresenter::StartAction(MxStreamController* p_controller, MxDSA
{
MxResult result = MxCompositePresenter::StartAction(p_controller, p_action);
FUN_100b7220(m_action, MxDSAction::c_world | MxDSAction::c_looping, TRUE);
ApplyMask(m_action, MxDSAction::c_world | MxDSAction::c_looping, TRUE);
ParseExtra();
MxS16 i = 0;

View File

@ -18,7 +18,7 @@ LegoActor::LegoActor()
m_frequencyFactor = 0.0f;
m_sound = NULL;
m_unk0x70 = 0.0f;
m_unk0x10 = 0;
m_interaction = 0;
m_actorId = 0;
}

View File

@ -29,7 +29,7 @@ void LegoEntity::Init()
m_roi = NULL;
m_cameraFlag = FALSE;
m_siFile = NULL;
m_unk0x10 = 0;
m_interaction = 0;
m_flags = 0;
m_actionType = Extra::ActionType::e_unknown;
m_targetEntityId = -1;
@ -263,23 +263,23 @@ void LegoEntity::ParseAction(char* p_extra)
// FUNCTION: LEGO1 0x10010f10
// FUNCTION: BETA10 0x1007ee87
void LegoEntity::ClickSound(MxBool p_und)
void LegoEntity::ClickSound(MxBool p_basedOnMood)
{
if (!GetUnknown0x10IsSet(c_altBit1)) {
if (!IsInteraction(c_disabled)) {
MxU32 objectId = 0;
const char* name = m_roi->GetName();
switch (m_type) {
case e_actor:
objectId = CharacterManager()->GetSoundId(m_roi, p_und);
objectId = CharacterManager()->GetSoundId(m_roi, p_basedOnMood);
break;
case e_unk1:
break;
case e_plant:
objectId = PlantManager()->GetSoundId(this, p_und);
objectId = PlantManager()->GetSoundId(this, p_basedOnMood);
break;
case e_building:
objectId = BuildingManager()->GetSoundId(this, p_und);
objectId = BuildingManager()->GetSoundId(this, p_basedOnMood);
break;
}
@ -297,7 +297,7 @@ void LegoEntity::ClickSound(MxBool p_und)
// FUNCTION: BETA10 0x1007f062
void LegoEntity::ClickAnimation()
{
if (!GetUnknown0x10IsSet(c_altBit1)) {
if (!IsInteraction(c_disabled)) {
MxU32 objectId = 0;
MxDSAction action;
const char* name = m_roi->GetName();
@ -329,7 +329,7 @@ void LegoEntity::ClickAnimation()
action.SetObjectId(objectId);
action.AppendExtra(strlen(extra) + 1, extra);
LegoOmni::GetInstance()->GetAnimationManager()->StartEntityAction(action, this);
m_unk0x10 |= c_altBit1;
m_interaction |= c_disabled;
}
}
}

View File

@ -691,7 +691,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
for (MxS32 i = 0; i < numPlants; i++) {
LegoEntity* entity = plantMgr->CreatePlant(i, NULL, LegoOmni::e_act1);
if (entity != NULL && !entity->GetUnknown0x10IsSet(LegoEntity::c_altBit1)) {
if (entity != NULL && !entity->IsInteraction(LegoEntity::c_disabled)) {
LegoROI* roi = entity->GetROI();
if (roi != NULL && roi->GetVisibility()) {

View File

@ -120,12 +120,12 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
animPresenter->DecrementUnknown0xd4();
if (animPresenter->GetUnknown0xd4() == 0) {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}
else {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}
@ -141,7 +141,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
MxDSAction* action = presenter->GetAction();
if (action) {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}
@ -157,7 +157,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
MxDSAction* action = presenter->GetAction();
if (action) {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}

View File

@ -36,7 +36,7 @@ const char* g_strHIT_WALL_SOUND = "HIT_WALL_SOUND";
// GLOBAL: LEGO1 0x100f3308
// GLOBAL: BETA10 0x101f1e1c
MxLong g_unk0x100f3308 = 0;
MxLong g_timeLastHitSoundPlayed = 0;
// FUNCTION: LEGO1 0x1002d700
// FUNCTION: BETA10 0x100ae6e0
@ -291,8 +291,8 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
if (m_boundary == oldBoundary) {
MxLong time = Timer()->GetTime();
if (time - g_unk0x100f3308 > 1000) {
g_unk0x100f3308 = time;
if (time - g_timeLastHitSoundPlayed > 1000) {
g_timeLastHitSoundPlayed = time;
const char* var = VariableTable()->GetVariable(g_strHIT_WALL_SOUND);
if (var && var[0] != 0) {

View File

@ -244,7 +244,7 @@ MxLong CarRace::HandlePathStruct(LegoPathStructNotificationParam& p_param)
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
NavController()->SetDeadZone(NavController()->GetDefaultDeadZone());
NavController()->SetTrackDefault(1);
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_raceState->m_unk0x28 = 2;
RaceState::Entry* raceState = m_raceState->GetState(GameState()->GetActorId());
@ -333,12 +333,10 @@ MxLong CarRace::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x10017650
MxLong CarRace::HandleClick(LegoEventNotificationParam& p_param)
MxLong CarRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
LegoControlManagerNotificationParam* param = (LegoControlManagerNotificationParam*) &p_param;
if (param->m_unk0x28 == 1) {
switch (param->m_clickedObjectId) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case 3:
InvokeAction(Extra::e_stop, *g_carraceScript, CarraceScript::c_irtx08ra_PlayWav, NULL);
m_act1State->m_unk0x018 = 0;
@ -346,7 +344,7 @@ MxLong CarRace::HandleClick(LegoEventNotificationParam& p_param)
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
NavController()->SetDeadZone(NavController()->GetDefaultDeadZone());
NavController()->SetTrackDefault(1);
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
GameState()->GetBackgroundColor()->SetValue("reset");
@ -358,7 +356,7 @@ MxLong CarRace::HandleClick(LegoEventNotificationParam& p_param)
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
NavController()->SetDeadZone(NavController()->GetDefaultDeadZone());
NavController()->SetTrackDefault(1);
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_destLocation = LegoGameState::e_carraceExterior;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
GameState()->GetBackgroundColor()->SetValue("reset");
@ -422,7 +420,7 @@ MxBool CarRace::Escape()
NavController()->SetDeadZone(NavController()->GetDefaultDeadZone());
NavController()->SetTrackDefault(1);
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
GameState()->GetBackgroundColor()->SetValue("reset");
m_destLocation = LegoGameState::e_infomain;

View File

@ -120,17 +120,17 @@ MxLong JetskiRace::HandleEndAction(MxEndActionNotificationParam& p_param)
}
// FUNCTION: LEGO1 0x100165a0
MxLong JetskiRace::HandleClick(LegoEventNotificationParam& p_param)
MxLong JetskiRace::HandleControl(LegoControlManagerNotificationParam& p_param)
{
MxLong result = 0;
if (((LegoControlManagerNotificationParam*) &p_param)->m_unk0x28 == 1) {
switch (((LegoControlManagerNotificationParam*) &p_param)->m_clickedObjectId) {
if (p_param.m_unk0x28 == 1) {
switch (p_param.m_clickedObjectId) {
case JetraceScript::c_JetskiArms_Ctl:
m_act1State->m_unk0x018 = 0;
VariableTable()->SetVariable(g_raceState, "");
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_destLocation = LegoGameState::e_jetraceExterior;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
break;
@ -138,7 +138,7 @@ MxLong JetskiRace::HandleClick(LegoEventNotificationParam& p_param)
m_act1State->m_unk0x018 = 0;
VariableTable()->SetVariable(g_raceState, "");
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_destLocation = LegoGameState::e_infomain;
result = 1;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
@ -191,7 +191,7 @@ MxLong JetskiRace::HandlePathStruct(LegoPathStructNotificationParam& p_param)
VariableTable()->SetVariable(g_raceState, "");
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
m_raceState->m_unk0x28 = 2;
RaceState::Entry* raceStateEntry = m_raceState->GetState(GameState()->GetActorId());
@ -292,6 +292,6 @@ MxBool JetskiRace::Escape()
VariableTable()->SetVariable(g_raceState, "");
VariableTable()->SetVariable(g_strHIT_WALL_SOUND, "");
m_destLocation = LegoGameState::e_infomain;
LegoRaceCar::FUN_10012de0();
LegoRaceCar::InitYouCantStopSound();
return TRUE;
}

View File

@ -82,8 +82,8 @@ MxLong LegoRace::Notify(MxParam& p_param)
case c_notificationEndAction:
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
break;
case c_notificationClick:
result = HandleClick((LegoEventNotificationParam&) p_param);
case c_notificationControl:
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
break;
case c_notificationPathStruct:
result = HandlePathStruct((LegoPathStructNotificationParam&) p_param);

View File

@ -31,8 +31,8 @@ MxS32 LegoRaceActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
if (m_userNavFlag && result) {
MxLong time = Timer()->GetTime();
if (time - g_unk0x100f3308 > 1000) {
g_unk0x100f3308 = time;
if (time - g_timeLastHitSoundPlayed > 1000) {
g_timeLastHitSoundPlayed = time;
const char* soundKey = VariableTable()->GetVariable(g_strHIT_ACTOR_SOUND);
if (soundKey && *soundKey) {

View File

@ -175,7 +175,7 @@ LegoRaceCar::LegoRaceCar()
m_skelKick1Anim = 0;
m_skelKick2Anim = 0;
m_unk0x5c.Clear();
m_unk0x58 = 0;
m_kickStart = 0;
m_kick1B = 0;
m_kick2B = 0;
NotificationManager()->Register(this);
@ -198,10 +198,10 @@ MxLong LegoRaceCar::Notify(MxParam& p_param)
// Initialized at LEGO1 0x10012db0
// GLOBAL: LEGO1 0x10102af0
// GLOBAL: BETA10 0x102114c0
Mx3DPointFloat g_unk0x10102af0 = Mx3DPointFloat(0.0f, 2.0f, 0.0f);
Mx3DPointFloat g_hitOffset = Mx3DPointFloat(0.0f, 2.0f, 0.0f);
// FUNCTION: LEGO1 0x10012de0
void LegoRaceCar::FUN_10012de0()
void LegoRaceCar::InitYouCantStopSound()
{
// Init to TRUE so we don't play "you can't stop in the middle of the race!" before the player ever moves
g_playedYouCantStopSound = TRUE;
@ -226,7 +226,7 @@ void LegoRaceCar::InitSoundIndices()
void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed)
{
if (!m_userNavFlag) {
if (!LegoCarRaceActor::m_unk0x0c) {
if (!LegoCarRaceActor::m_animState) {
m_maxLinearVel = p_worldSpeed;
}
LegoAnimActor::SetWorldSpeed(p_worldSpeed);
@ -241,7 +241,7 @@ void LegoRaceCar::SetWorldSpeed(MxFloat p_worldSpeed)
void LegoRaceCar::SetMaxLinearVelocity(float p_maxLinearVelocity)
{
if (p_maxLinearVelocity < 0) {
LegoCarRaceActor::m_unk0x0c = 2;
LegoCarRaceActor::m_animState = 2;
m_maxLinearVel = 0;
SetWorldSpeed(0);
}
@ -296,7 +296,7 @@ void LegoRaceCar::ParseAction(char* p_extra)
// FUNCTION: LEGO1 0x10012ff0
// FUNCTION: BETA10 0x100cb60e
void LegoRaceCar::FUN_10012ff0(float p_param)
void LegoRaceCar::KickCamera(float p_param)
{
LegoAnimActorStruct* a; // called `a` in BETA10
float deltaTime;
@ -312,7 +312,7 @@ void LegoRaceCar::FUN_10012ff0(float p_param)
assert(a && a->GetAnimTreePtr() && a->GetAnimTreePtr()->GetCamAnim());
if (a->GetAnimTreePtr()) {
deltaTime = p_param - m_unk0x58;
deltaTime = p_param - m_kickStart;
if (a->GetDuration() <= deltaTime || deltaTime < 0.0) {
if (m_userState == LEGORACECAR_KICK1) {
@ -387,7 +387,7 @@ MxU32 LegoRaceCar::HandleSkeletonKicks(float p_param1)
return FALSE;
}
m_unk0x58 = p_param1;
m_kickStart = p_param1;
SoundManager()->GetCacheSoundManager()->Play(g_soundSkel3, NULL, FALSE);
return TRUE;
@ -398,7 +398,7 @@ MxU32 LegoRaceCar::HandleSkeletonKicks(float p_param1)
void LegoRaceCar::Animate(float p_time)
{
if (m_userNavFlag && (m_userState == LEGORACECAR_KICK1 || m_userState == LEGORACECAR_KICK2)) {
FUN_10012ff0(p_time);
KickCamera(p_time);
return;
}
@ -410,7 +410,7 @@ void LegoRaceCar::Animate(float p_time)
}
}
if (LegoCarRaceActor::m_unk0x0c == 1) {
if (LegoCarRaceActor::m_animState == 1) {
FUN_1005d4b0();
if (!m_userNavFlag) {
@ -468,7 +468,7 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
assert(roi);
matr = roi->GetLocal2World();
Vector3(matr[3]) += g_unk0x10102af0;
Vector3(matr[3]) += g_hitOffset;
roi->SetLocal2World(matr);
p_actor->SetActorState(c_two);
@ -513,7 +513,7 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
if (soundKey) {
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
g_timeLastRaceCarSoundPlayed = g_unk0x100f3308 = time;
g_timeLastRaceCarSoundPlayed = g_timeLastHitSoundPlayed = time;
}
}
@ -579,7 +579,7 @@ void LegoJetski::InitSoundIndices()
void LegoJetski::SetWorldSpeed(MxFloat p_worldSpeed)
{
if (!m_userNavFlag) {
if (!LegoCarRaceActor::m_unk0x0c) {
if (!LegoCarRaceActor::m_animState) {
m_maxLinearVel = p_worldSpeed;
}
LegoAnimActor::SetWorldSpeed(p_worldSpeed);
@ -594,7 +594,7 @@ void LegoJetski::SetWorldSpeed(MxFloat p_worldSpeed)
void LegoJetski::FUN_100136f0(float p_worldSpeed)
{
if (p_worldSpeed < 0) {
LegoCarRaceActor::m_unk0x0c = 2;
LegoCarRaceActor::m_animState = 2;
m_maxLinearVel = 0;
SetWorldSpeed(0);
}
@ -609,7 +609,7 @@ void LegoJetski::Animate(float p_time)
{
LegoJetskiRaceActor::Animate(p_time);
if (LegoCarRaceActor::m_unk0x0c == 1) {
if (LegoCarRaceActor::m_animState == 1) {
FUN_1005d4b0();
if (!m_userNavFlag) {
@ -682,7 +682,7 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
LegoROI* roi = p_actor->GetROI();
matr = roi->GetLocal2World();
Vector3(matr[3]) += g_unk0x10102af0;
Vector3(matr[3]) += g_hitOffset;
roi->SetLocal2World(matr);
p_actor->SetActorState(c_two);
@ -711,7 +711,7 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
if (soundKey) {
SoundManager()->GetCacheSoundManager()->Play(soundKey, NULL, FALSE);
g_timeLastJetskiSoundPlayed = g_unk0x100f3308 = time;
g_timeLastJetskiSoundPlayed = g_timeLastHitSoundPlayed = time;
}
}

View File

@ -44,7 +44,7 @@ LegoCarRaceActor::LegoCarRaceActor()
{
m_unk0x08 = 1.0f;
m_unk0x70 = 0.0f;
m_unk0x0c = 0;
m_animState = 0;
m_maxLinearVel = 0.0f;
m_frequencyFactor = 1.0f;
m_unk0x1c = 0;
@ -223,18 +223,18 @@ void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOriente
// FUNCTION: BETA10 0x100cdbae
void LegoCarRaceActor::Animate(float p_time)
{
// m_unk0x0c is not an MxBool, there are places where it is set to 2 or higher
if (m_unk0x0c == 0) {
// m_animState is not an MxBool, there are places where it is set to 2 or higher
if (m_animState == 0) {
const char* value = VariableTable()->GetVariable(g_raceState);
if (strcmpi(value, g_racing) == 0) {
m_unk0x0c = 1;
m_animState = 1;
m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time;
}
}
if (m_unk0x0c == 1) {
if (m_animState == 1) {
LegoAnimActor::Animate(p_time);
}
}
@ -398,10 +398,10 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
// FUNCTION: LEGO1 0x10081550
void LegoJetskiRaceActor::Animate(float p_time)
{
if (m_unk0x0c == 0) {
if (m_animState == 0) {
const LegoChar* raceState = VariableTable()->GetVariable(g_raceState);
if (!stricmp(raceState, g_racing)) {
m_unk0x0c = 1;
m_animState = 1;
m_lastTime = p_time - 1.0f;
m_unk0x1c = p_time;
}
@ -410,7 +410,7 @@ void LegoJetskiRaceActor::Animate(float p_time)
}
}
if (m_unk0x0c == 1) {
if (m_animState == 1) {
LegoAnimActor::Animate(p_time);
}
}

View File

@ -790,7 +790,7 @@ void LegoAnimPresenter::StartingTickle()
}
FUN_10069b10();
FUN_1006c8a0(TRUE);
SetDisabled(TRUE);
if (m_unk0x78 == NULL) {
if (fabs(m_action->GetDirection()[0]) >= 0.00000047683716F ||
@ -1090,7 +1090,7 @@ void LegoAnimPresenter::EndAction()
}
}
FUN_1006c8a0(FALSE);
SetDisabled(FALSE);
FUN_1006ab70();
VTable0x90();
@ -1151,18 +1151,18 @@ void LegoAnimPresenter::VTable0x90()
}
// FUNCTION: LEGO1 0x1006c8a0
void LegoAnimPresenter::FUN_1006c8a0(MxBool p_bool)
void LegoAnimPresenter::SetDisabled(MxBool p_disabled)
{
if (m_roiMapSize != 0 && m_roiMap != NULL) {
for (MxU32 i = 1; i <= m_roiMapSize; i++) {
LegoEntity* entity = m_roiMap[i]->GetEntity();
if (entity != NULL) {
if (p_bool) {
entity->SetUnknown0x10Flag(LegoEntity::c_altBit1);
if (p_disabled) {
entity->SetInteractionFlag(LegoEntity::c_disabled);
}
else {
entity->ClearUnknown0x10Flag(LegoEntity::c_altBit1);
entity->ClearInteractionFlag(LegoEntity::c_disabled);
}
}
}

View File

@ -187,7 +187,7 @@ MxResult LegoPartPresenter::Read(MxDSChunk& p_chunk)
}
if (j == 0) {
if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) {
if (surplusLODs != 0 && lod->IsExtraLOD()) {
numLODs++;
surplusLODs--;
}

View File

@ -31,7 +31,7 @@ DECOMP_SIZE_ASSERT(Act3ListElement, 0x0c)
DECOMP_SIZE_ASSERT(Act3List, 0x10)
// GLOBAL: LEGO1 0x100d94f8
Act3Script::Script g_unk0x100d94f8[] = {
Act3Script::Script g_pizzaHitSounds[] = {
Act3Script::c_sns02xni_PlayWav,
Act3Script::c_sns03xni_PlayWav,
Act3Script::c_sns04xni_PlayWav,
@ -51,7 +51,7 @@ Act3Script::Script g_unk0x100d94f8[] = {
};
// GLOBAL: LEGO1 0x100d9538
Act3Script::Script g_unk0x100d9538[] = {
Act3Script::Script g_pizzaMissSounds[] = {
Act3Script::c_sns19xni_PlayWav,
Act3Script::c_sns20xni_PlayWav,
Act3Script::c_sns22xni_PlayWav,
@ -61,7 +61,7 @@ Act3Script::Script g_unk0x100d9538[] = {
};
// GLOBAL: LEGO1 0x100d9550
Act3Script::Script g_unk0x100d9550[] = {
Act3Script::Script g_copDonutSounds[] = {
Act3Script::c_sns25xni_PlayWav,
Act3Script::c_sns26xni_PlayWav,
Act3Script::c_sns27xni_PlayWav,
@ -73,7 +73,7 @@ Act3Script::Script g_unk0x100d9550[] = {
};
// GLOBAL: LEGO1 0x100d9570
Act3Script::Script g_unk0x100d9570[] = {
Act3Script::Script g_donutMissSounds[] = {
Act3Script::c_sns30xni_PlayWav,
Act3Script::c_sns31xni_PlayWav,
Act3Script::c_sns32xni_PlayWav,
@ -83,7 +83,7 @@ Act3Script::Script g_unk0x100d9570[] = {
};
// GLOBAL: LEGO1 0x100d9588
Act3Script::Script g_unk0x100d9588[] = {
Act3Script::Script g_islanderSounds[] = {
Act3Script::c_sns43xma_PlayWav, Act3Script::c_sns46xin_PlayWav, Act3Script::c_sns60xna_PlayWav,
Act3Script::c_sns52xro_PlayWav, Act3Script::c_sns58xna_PlayWav, Act3Script::c_sns68xbu_PlayWav,
Act3Script::c_sns59xna_PlayWav, Act3Script::c_sns51xin_PlayWav, Act3Script::c_sns61xva_PlayWav,
@ -94,7 +94,7 @@ Act3Script::Script g_unk0x100d9588[] = {
};
// GLOBAL: LEGO1 0x100d95d8
Act3Script::Script g_unk0x100d95d8[] = {
Act3Script::Script g_bricksterDonutSounds[] = {
Act3Script::c_tns080br_PlayWav,
Act3Script::c_tnsx07br_PlayWav,
Act3Script::c_snsxx2br_PlayWav,
@ -403,58 +403,58 @@ MxResult Act3::ShootDonut(LegoPathController* p_controller, Vector3& p_location,
// FUNCTION: LEGO1 0x10072ad0
// FUNCTION: BETA10 0x10015eec
void Act3::FUN_10072ad0(undefined4 p_param1)
void Act3::TriggerHitSound(undefined4 p_param1)
{
float time = Timer()->GetTime();
Act3Script::Script objectId;
switch (p_param1) {
case 1: {
if (m_unk0x4218 >= sizeOfArray(g_unk0x100d94f8)) {
m_unk0x4218 = 0;
if (m_pizzaHitSound >= sizeOfArray(g_pizzaHitSounds)) {
m_pizzaHitSound = 0;
}
objectId = g_unk0x100d94f8[m_unk0x4218++];
objectId = g_pizzaHitSounds[m_pizzaHitSound++];
break;
}
case 2: {
if (m_unk0x4219 >= sizeOfArray(g_unk0x100d9538) - 1) {
m_unk0x4219 = 0;
if (m_pizzaMissSound >= sizeOfArray(g_pizzaMissSounds) - 1) {
m_pizzaMissSound = 0;
}
objectId = g_unk0x100d9538[m_unk0x4219++];
objectId = g_pizzaMissSounds[m_pizzaMissSound++];
break;
}
case 3: {
if (m_unk0x421a >= sizeOfArray(g_unk0x100d9550)) {
m_unk0x421a = 0;
if (m_copDonutSound >= sizeOfArray(g_copDonutSounds)) {
m_copDonutSound = 0;
}
objectId = g_unk0x100d9550[m_unk0x421a++];
objectId = g_copDonutSounds[m_copDonutSound++];
break;
}
case 4: {
if (m_unk0x421b >= sizeOfArray(g_unk0x100d9570)) {
m_unk0x421b = 0;
if (m_donutMissSound >= sizeOfArray(g_donutMissSounds)) {
m_donutMissSound = 0;
}
objectId = g_unk0x100d9570[m_unk0x421b++];
objectId = g_donutMissSounds[m_donutMissSound++];
break;
}
case 5: {
if (m_unk0x421c >= sizeOfArray(g_unk0x100d9588)) {
m_unk0x421c = 0;
if (m_islanderSound >= sizeOfArray(g_islanderSounds)) {
m_islanderSound = 0;
}
objectId = g_unk0x100d9588[m_unk0x421c++];
objectId = g_islanderSounds[m_islanderSound++];
break;
}
case 6: {
if (m_unk0x421d >= sizeOfArray(g_unk0x100d95d8)) {
m_unk0x421d = 0;
if (m_bricksterDonutSound >= sizeOfArray(g_bricksterDonutSounds)) {
m_bricksterDonutSound = 0;
}
m_unk0x4220.Insert(g_unk0x100d95d8[m_unk0x421d++], 1);
m_unk0x4220.Insert(g_bricksterDonutSounds[m_bricksterDonutSound++], 1);
return;
}
default:
@ -575,13 +575,12 @@ MxLong Act3::Notify(MxParam& p_param)
m_cop2->VTable0xa8();
m_brickster->VTable0xa8();
m_unk0x4218 = 0;
m_unk0x4219 = 0;
m_unk0x421a = 0;
m_unk0x421b = 0;
m_unk0x421c = 0;
m_unk0x421d = 0;
m_pizzaHitSound = 0;
m_pizzaMissSound = 0;
m_copDonutSound = 0;
m_donutMissSound = 0;
m_islanderSound = 0;
m_bricksterDonutSound = 0;
MxS32 length;
LegoBuildingInfo* info = BuildingManager()->GetInfoArray(length);
@ -701,7 +700,7 @@ MxResult Act3::FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2)
{
assert(m_brickster);
m_brickster->FUN_100417a0(p_ammo, p_param2);
FUN_10072ad0(1);
TriggerHitSound(1);
return SUCCESS;
}
@ -718,7 +717,7 @@ MxResult Act3::FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2)
m_cop2->FUN_10040350(p_ammo, p_param2);
}
FUN_10072ad0(3);
TriggerHitSound(3);
g_unk0x100f7814++;
return SUCCESS;
}

View File

@ -46,7 +46,7 @@ Hospital::Hospital()
m_flashingLeds = 0;
m_copLedAnimTimer = 0;
m_pizzaLedAnimTimer = 0;
m_unk0x128 = 0;
m_exited = FALSE;
NotificationManager()->Register(this);
}
@ -367,8 +367,8 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
act1State = (Act1State*) GameState()->GetState("Act1State");
act1State->SetUnknown18(9);
case HospitalState::e_exitToFront:
if (m_unk0x128 == 0) {
m_unk0x128 = 1;
if (m_exited == FALSE) {
m_exited = TRUE;
m_destLocation = LegoGameState::e_hospitalExited;
DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim);
@ -376,8 +376,8 @@ MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
}
break;
case HospitalState::e_exitToInfocenter:
if (m_unk0x128 == 0) {
m_unk0x128 = 1;
if (m_exited == FALSE) {
m_exited = TRUE;
m_destLocation = LegoGameState::e_infomain;
DeleteObjects(&m_atomId, HospitalScript::c_hho002cl_RunAnim, HospitalScript::c_hho006cl_RunAnim);
@ -410,8 +410,8 @@ MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
m_interactionMode = 3;
if (m_hospitalState->m_state == HospitalState::e_explainQuestShort) {
if (m_unk0x128 == 0) {
m_unk0x128 = 1;
if (m_exited == FALSE) {
m_exited = TRUE;
TickleManager()->UnregisterClient(this);
@ -566,8 +566,8 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
m_currentAction = HospitalScript::c_hho016cl_RunAnim;
m_setWithCurrentAction = 1;
}
else if (m_unk0x128 == 0) {
m_unk0x128 = 1;
else if (m_exited == FALSE) {
m_exited = TRUE;
m_hospitalState->m_state = HospitalState::e_exitImmediately;
m_destLocation = LegoGameState::e_infomain;
@ -587,8 +587,8 @@ MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
m_currentAction = HospitalScript::c_hho016cl_RunAnim;
m_setWithCurrentAction = 1;
}
else if (m_unk0x128 == 0) {
m_unk0x128 = 1;
else if (m_exited == FALSE) {
m_exited = TRUE;
m_hospitalState->m_state = HospitalState::e_exitImmediately;
m_destLocation = LegoGameState::e_hospitalExited;

View File

@ -1450,7 +1450,7 @@ void Infocenter::StartCredits()
MxDSAction* action = presenter->GetAction();
if (action) {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}
@ -1466,7 +1466,7 @@ void Infocenter::StartCredits()
MxDSAction* action = presenter->GetAction();
if (action) {
FUN_100b7220(action, MxDSAction::c_world, FALSE);
ApplyMask(action, MxDSAction::c_world, FALSE);
presenter->EndAction();
}
}

View File

@ -69,11 +69,11 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
LegoU32 i, indexBackwards, indexForwards, tempNumVertsAndNormals;
unsigned char paletteEntries[256];
if (p_storage->Read(&m_unk0x08, sizeof(undefined4)) != SUCCESS) {
if (p_storage->Read(&m_flags, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
if (GetUnknown0x08Test4()) {
if (SkipReadingData()) {
return SUCCESS;
}
@ -84,11 +84,11 @@ LegoResult LegoLOD::Read(Tgl::Renderer* p_renderer, LegoTextureContainer* p_text
}
if (m_numMeshes == 0) {
ClearFlag(c_bit4);
ClearFlag(c_hasMesh);
return SUCCESS;
}
SetFlag(c_bit4);
SetFlag(c_hasMesh);
m_melems = new Mesh[m_numMeshes];
memset(m_melems, 0, sizeof(*m_melems) * m_numMeshes);
@ -315,7 +315,7 @@ LegoLOD* LegoLOD::Clone(Tgl::Renderer* p_renderer)
dupLod->m_melems[i].m_textured = m_melems[i].m_textured;
}
dupLod->m_unk0x08 = m_unk0x08;
dupLod->m_flags = m_flags;
dupLod->m_numMeshes = m_numMeshes;
dupLod->m_numVertices = m_numVertices;
dupLod->m_numPolys = m_numPolys;

View File

@ -259,7 +259,7 @@ LegoResult LegoROI::Read(
}
if (j == 0) {
if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) {
if (surplusLODs != 0 && lod->IsExtraLOD()) {
numLODs++;
}
}
@ -276,7 +276,7 @@ LegoResult LegoROI::Read(
}
if (i == 0) {
if (surplusLODs != 0 && lod->GetUnknown0x08Test8()) {
if (surplusLODs != 0 && lod->IsExtraLOD()) {
numLODs++;
}
}

View File

@ -75,7 +75,7 @@ void MakeSourceName(char*, const char*);
void OmniError(const char* p_message, MxS32 p_status);
void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32));
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter);
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
void ApplyMask(MxDSAction* p_action, MxU32 p_mask, MxBool p_setFlags);
MxBool KeyValueStringParse(char*, const char*, const char*);
// TEMPLATE: BETA10 0x1012dfd0

View File

@ -71,7 +71,7 @@ class MxWavePresenter : public MxSoundPresenter {
void Destroy(MxBool p_fromDestructor);
MxS8 GetPlayedChunks();
MxBool FUN_100b1ba0();
MxBool ReadyForNextChunk();
void WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length);
WaveFormat* m_waveFormat; // 0x54

View File

@ -67,7 +67,7 @@ MxS8 MxWavePresenter::GetPlayedChunks()
}
// FUNCTION: LEGO1 0x100b1ba0
MxBool MxWavePresenter::FUN_100b1ba0()
MxBool MxWavePresenter::ReadyForNextChunk()
{
return !m_started || GetPlayedChunks() != m_writtenChunks;
}
@ -248,7 +248,7 @@ MxResult MxWavePresenter::PutData()
if (IsEnabled()) {
switch (m_currentTickleState) {
case e_streaming:
if (m_currentChunk && FUN_100b1ba0()) {
if (m_currentChunk && ReadyForNextChunk()) {
WriteToSoundBuffer(m_currentChunk->GetData(), m_currentChunk->GetLength());
m_subscriber->FreeDataChunk(m_currentChunk);
m_currentChunk = NULL;

View File

@ -150,16 +150,16 @@ void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32))
// FUNCTION: LEGO1 0x100b7220
// FUNCTION: BETA10 0x10136f37
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags)
void ApplyMask(MxDSAction* p_action, MxU32 p_mask, MxBool p_setFlags)
{
MxU32 oldFlags = p_action->GetFlags();
MxU32 newFlags;
if (p_setFlags) {
newFlags = oldFlags | p_newFlags;
newFlags = oldFlags | p_mask;
}
else {
newFlags = oldFlags & ~p_newFlags;
newFlags = oldFlags & ~p_mask;
}
p_action->SetFlags(newFlags);
@ -169,7 +169,7 @@ void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags)
MxDSAction* action;
while (cursor.Next(action)) {
FUN_100b7220(action, p_newFlags, p_setFlags);
ApplyMask(action, p_mask, p_setFlags);
}
}
}

View File

@ -861,7 +861,7 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p
DDBLTFX data;
memset(&data, 0, sizeof(data));
data.dwSize = sizeof(data);
data.dwDDFX = 8;
data.dwDDFX = DDBLTFX_NOTEARING;
if (m_ddSurface1->Blt((LPRECT) &b, m_ddSurface2, (LPRECT) &a, 0, &data) == DDERR_SURFACELOST) {
m_ddSurface1->Restore();

View File

@ -14,10 +14,10 @@
class ViewLOD : public LODObject {
public:
enum {
c_bit4 = 0x10
c_hasMesh = 0x10
};
ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_unk0x08(3) {}
ViewLOD(Tgl::Renderer* pRenderer) : m_meshBuilder(NULL), m_flags(3) {}
~ViewLOD() override;
// FUNCTION: LEGO1 0x100a6f30
@ -28,19 +28,19 @@ class ViewLOD : public LODObject {
Tgl::MeshBuilder* GetMeshBuilder() { return m_meshBuilder; }
const Tgl::MeshBuilder* GetMeshBuilder() const { return m_meshBuilder; }
undefined4 GetUnknown0x08() { return m_unk0x08; }
unsigned char GetUnknown0x08Test4() { return m_unk0x08 & 0xffffff04; }
unsigned char GetUnknown0x08Test8() { return m_unk0x08 & 0xffffff08; }
unsigned int GetFlags() { return m_flags; }
unsigned char SkipReadingData() { return m_flags & 0xffffff04; }
unsigned char IsExtraLOD() { return m_flags & 0xffffff08; }
void SetFlag(unsigned char p_flag) { m_unk0x08 |= p_flag; }
void ClearFlag(unsigned char p_flag) { m_unk0x08 &= ~p_flag; }
void SetFlag(unsigned char p_flag) { m_flags |= p_flag; }
void ClearFlag(unsigned char p_flag) { m_flags &= ~p_flag; }
// SYNTHETIC: LEGO1 0x100a6f60
// ViewLOD::`scalar deleting destructor'
protected:
Tgl::MeshBuilder* m_meshBuilder; // 0x04
undefined4 m_unk0x08; // 0x08
unsigned int m_flags; // 0x08
};
#endif // VIEWLOD_H

View File

@ -165,7 +165,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel)
if (lodLevel < 0) {
lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel);
if (lod->GetUnknown0x08() & ViewLOD::c_bit4) {
if (lod->GetFlags() & ViewLOD::c_hasMesh) {
scene->Add((Tgl::MeshBuilder*) group);
SetAppData(p_roi, reinterpret_cast<LPD3DRM_APPDATA>(p_roi));
}
@ -184,7 +184,7 @@ void ViewManager::UpdateROIDetailBasedOnLOD(ViewROI* p_roi, int p_lodLevel)
lod = (ViewLOD*) p_roi->GetLOD(p_lodLevel);
}
if (lod->GetUnknown0x08() & ViewLOD::c_bit4) {
if (lod->GetFlags() & ViewLOD::c_hasMesh) {
meshBuilder = lod->GetMeshBuilder();
if (meshBuilder != NULL) {
@ -389,7 +389,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi)
const LODListBase* lods = p_roi->GetLODs();
if (lods != NULL && lods->Size() > 0) {
if (((ViewLOD*) p_roi->GetLOD(0))->GetUnknown0x08Test8()) {
if (((ViewLOD*) p_roi->GetLOD(0))->IsExtraLOD()) {
return 1;
}
else {
@ -404,7 +404,7 @@ inline int ViewManager::GetFirstLODIndex(ViewROI* p_roi)
const LODListBase* lods = ((ViewROI*) *it)->GetLODs();
if (lods != NULL && lods->Size() > 0) {
if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->GetUnknown0x08Test8()) {
if (((ViewLOD*) ((ViewROI*) *it)->GetLOD(0))->IsExtraLOD()) {
return 1;
}
else {