mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 17:04:17 +00:00
Improve FUN_10061010, other fixes (#1634)
Co-authored-by: jonschz <jonschz@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "legoworld.h"
|
||||
#include "misc.h"
|
||||
#include "mxbackgroundaudiomanager.h"
|
||||
#include "mxdebug.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxnotificationmanager.h"
|
||||
#include "mxticklemanager.h"
|
||||
@@ -1225,12 +1226,10 @@ void LegoAnimationManager::CameraTriggerFire(LegoPathActor* p_actor, MxBool, MxU
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10061010
|
||||
#ifdef BETA10
|
||||
// FUNCTION: BETA10 0x100422cc
|
||||
void LegoAnimationManager::FUN_10061010(MxBool p_und)
|
||||
{
|
||||
MxBool unk0x39 = FALSE;
|
||||
|
||||
FUN_10064b50(-1);
|
||||
|
||||
if (m_tranInfoList != NULL) {
|
||||
@@ -1238,17 +1237,47 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
|
||||
LegoTranInfo* tranInfo;
|
||||
|
||||
while (cursor.Next(tranInfo)) {
|
||||
if (tranInfo->m_presenter != NULL) {
|
||||
// TODO: Match
|
||||
MxU32 flags = tranInfo->m_flags;
|
||||
if (tranInfo->m_unk0x14 && tranInfo->m_location != -1) {
|
||||
MxTrace("Releasing user from %d\n", tranInfo->m_objectId);
|
||||
|
||||
if (tranInfo->m_presenter != NULL) {
|
||||
tranInfo->m_presenter->FUN_1004b8c0();
|
||||
}
|
||||
|
||||
tranInfo->m_unk0x14 = FALSE;
|
||||
}
|
||||
else {
|
||||
MxTrace("Stopping %d\n", tranInfo->m_objectId);
|
||||
|
||||
if (tranInfo->m_presenter != NULL) {
|
||||
tranInfo->m_presenter->FUN_1004b840();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_animRunning = FALSE;
|
||||
m_unk0x404 = Timer()->GetTime();
|
||||
}
|
||||
#else
|
||||
// FUNCTION: LEGO1 0x10061010
|
||||
void LegoAnimationManager::FUN_10061010(MxBool p_und)
|
||||
{
|
||||
MxBool animRunning = FALSE;
|
||||
FUN_10064b50(-1);
|
||||
|
||||
if (m_tranInfoList != NULL) {
|
||||
LegoTranInfoListCursor cursor(m_tranInfoList);
|
||||
LegoTranInfo* tranInfo;
|
||||
|
||||
while (cursor.Next(tranInfo)) {
|
||||
if (tranInfo->m_presenter) {
|
||||
// LINE: LEGO1 0x100610e6
|
||||
if (tranInfo->m_unk0x14 && tranInfo->m_location != -1 && p_und) {
|
||||
LegoAnim* anim;
|
||||
|
||||
if (tranInfo->m_presenter->GetPresenter() != NULL &&
|
||||
(anim = tranInfo->m_presenter->GetPresenter()->GetAnimation()) != NULL &&
|
||||
anim->GetCamAnim() != NULL) {
|
||||
if (flags & LegoTranInfo::c_bit2) {
|
||||
if (tranInfo->m_presenter->GetPresenter() &&
|
||||
tranInfo->m_presenter->GetPresenter()->GetAnimation() &&
|
||||
tranInfo->m_presenter->GetPresenter()->GetAnimation()->GetCamAnim()) {
|
||||
if (tranInfo->m_flags & LegoTranInfo::c_bit2) {
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
|
||||
}
|
||||
@@ -1257,37 +1286,43 @@ void LegoAnimationManager::FUN_10061010(MxBool p_und)
|
||||
tranInfo->m_unk0x14 = FALSE;
|
||||
}
|
||||
else {
|
||||
MxTrace("Releasing user from %d\n", tranInfo->m_objectId);
|
||||
// LINE: LEGO1 0x10061137
|
||||
tranInfo->m_presenter->FUN_1004b8c0();
|
||||
animRunning = TRUE;
|
||||
tranInfo->m_unk0x14 = FALSE;
|
||||
unk0x39 = TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (flags & LegoTranInfo::c_bit2) {
|
||||
if (tranInfo->m_flags & LegoTranInfo::c_bit2) {
|
||||
// LINE: LEGO1 0x10061150
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
tranInfo->m_flags &= ~LegoTranInfo::c_bit2;
|
||||
}
|
||||
|
||||
MxTrace("Stopping %d\n", tranInfo->m_objectId);
|
||||
tranInfo->m_presenter->FUN_1004b840();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (m_tranInfoList2 != NULL) {
|
||||
LegoTranInfoListCursor cursor(m_tranInfoList2);
|
||||
|
||||
if (!cursor.Find(tranInfo)) {
|
||||
// TODO: For some reason, the embedded `MxListEntry` constructor is not inlined.
|
||||
// This may be the key for getting this function to match correctly.
|
||||
m_tranInfoList2->Append(tranInfo);
|
||||
}
|
||||
}
|
||||
|
||||
unk0x39 = TRUE;
|
||||
animRunning = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_animRunning = unk0x39;
|
||||
m_animRunning = animRunning;
|
||||
m_unk0x404 = Timer()->GetTime();
|
||||
}
|
||||
#endif
|
||||
|
||||
// FUNCTION: LEGO1 0x10061530
|
||||
void LegoAnimationManager::FUN_10061530()
|
||||
|
||||
@@ -425,6 +425,21 @@ MxBool LegoAnimMMPresenter::FUN_1004b6b0(MxLong p_time)
|
||||
// FUNCTION: BETA10 0x1004ce18
|
||||
MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
|
||||
{
|
||||
#ifdef BETA10
|
||||
switch (m_unk0x58) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
LegoROI* viewROI = VideoManager()->GetViewROI();
|
||||
LegoPathActor* actor = UserActor();
|
||||
|
||||
@@ -455,9 +470,13 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
|
||||
m_world->PlaceActor(actor);
|
||||
}
|
||||
|
||||
#ifdef BETA10
|
||||
actor->VTable0xa8();
|
||||
#else
|
||||
if (m_tranInfo->m_unk0x29) {
|
||||
actor->VTable0xa8();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
actor->SetActorState(LegoPathActor::c_initial);
|
||||
@@ -491,9 +510,11 @@ void LegoAnimMMPresenter::FUN_1004b840()
|
||||
FUN_1004b6d0(0);
|
||||
EndAction();
|
||||
|
||||
#ifndef BETA10
|
||||
if (action != NULL) {
|
||||
Streamer()->FUN_100b98f0(action);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1004b8b0
|
||||
|
||||
@@ -286,6 +286,7 @@ MxResult LegoWorld::PlaceActor(
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001fa70
|
||||
// FUNCTION: BETA10 0x100da328
|
||||
MxResult LegoWorld::PlaceActor(LegoPathActor* p_actor)
|
||||
{
|
||||
LegoPathControllerListCursor cursor(&m_pathControllerList);
|
||||
@@ -301,6 +302,7 @@ MxResult LegoWorld::PlaceActor(LegoPathActor* p_actor)
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1001fb70
|
||||
// FUNCTION: BETA10 0x100da3f1
|
||||
MxResult LegoWorld::PlaceActor(
|
||||
LegoPathActor* p_actor,
|
||||
LegoAnimPresenter* p_presenter,
|
||||
|
||||
Reference in New Issue
Block a user