2023-06-29 04:10:08 -04:00
|
|
|
#include "mxtransitionmanager.h"
|
2023-09-29 12:42:15 -04:00
|
|
|
#include "legoutil.h"
|
2023-09-29 12:09:46 -04:00
|
|
|
#include "legovideomanager.h"
|
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(MxTransitionManager, 0x900);
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
// OFFSET: LEGO1 0x1004b8d0
|
2023-06-29 04:10:08 -04:00
|
|
|
MxTransitionManager::MxTransitionManager()
|
|
|
|
{
|
2023-10-01 20:18:16 -04:00
|
|
|
m_animationTimer = 0;
|
|
|
|
m_transitionType = NOT_TRANSITIONING;
|
|
|
|
m_ddSurface = NULL;
|
|
|
|
m_unk08 = 0;
|
|
|
|
m_unk1c = 0;
|
|
|
|
m_unk20.bit0 = FALSE;
|
|
|
|
m_unk28.bit0 = FALSE;
|
|
|
|
m_unk24 = 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
// OFFSET: LEGO1 0x1004ba00
|
2023-06-29 04:10:08 -04:00
|
|
|
MxTransitionManager::~MxTransitionManager()
|
|
|
|
{
|
2023-10-01 20:18:16 -04:00
|
|
|
free(m_unk1c);
|
|
|
|
|
|
|
|
if (m_unk08 != NULL) {
|
|
|
|
delete m_unk08->m_unk1c;
|
|
|
|
delete m_unk08;
|
|
|
|
}
|
|
|
|
|
|
|
|
TickleManager()->UnregisterClient(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1004bac0 STUB
|
2023-09-21 14:51:24 -04:00
|
|
|
MxResult MxTransitionManager::Tickle()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2023-06-30 14:34:39 -04:00
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1004c470 STUB
|
|
|
|
void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *videoPresenter)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
2023-09-29 12:09:46 -04:00
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1004baa0
|
|
|
|
MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14
|
|
|
|
{
|
|
|
|
LegoVideoManager *videoManager = VideoManager();
|
|
|
|
this->m_ddSurface = videoManager->GetDisplaySurface()->GetDirectDrawSurface2();
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x1004bb70
|
|
|
|
MxResult MxTransitionManager::StartTransition(TransitionType p_animationType, MxS32 p_speed,
|
2023-10-01 20:18:16 -04:00
|
|
|
MxBool p_unk, MxBool p_playMusicInAnim)
|
2023-09-29 12:09:46 -04:00
|
|
|
{
|
|
|
|
if (this->m_transitionType == NOT_TRANSITIONING) {
|
|
|
|
if (!p_playMusicInAnim) {
|
|
|
|
MxBackgroundAudioManager *backgroundAudioManager = BackgroundAudioManager();
|
|
|
|
backgroundAudioManager->Stop();
|
|
|
|
}
|
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
this->m_transitionType = p_animationType;
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
m_unk20.bit0 = p_unk;
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
if (m_unk20.bit0 && m_unk08 != NULL) {
|
|
|
|
m_unk08->vtable54(1);
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
MxTransitionManagerUnknownSubclass2 *iVar2 = m_unk08->m_unk1c;
|
|
|
|
iVar2->m_unk3c = 10000;
|
|
|
|
iVar2->m_unk30 |= 0x200;
|
|
|
|
}
|
|
|
|
|
|
|
|
MxU32 time = timeGetTime();
|
|
|
|
this->m_systemTime = time;
|
|
|
|
|
|
|
|
this->m_animationSpeed = p_speed;
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
MxTickleManager *tickleManager = TickleManager();
|
|
|
|
tickleManager->RegisterClient(this, p_speed);
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
LegoInputManager *inputManager = InputManager();
|
2023-10-03 13:53:22 -04:00
|
|
|
inputManager->m_unk0x88 = TRUE;
|
|
|
|
inputManager->m_unk0x336 = FALSE;
|
2023-09-29 12:09:46 -04:00
|
|
|
|
2023-10-01 20:18:16 -04:00
|
|
|
LegoVideoManager *videoManager = VideoManager();
|
|
|
|
videoManager->SetUnkE4(FALSE);
|
|
|
|
|
|
|
|
SetAppCursor(1);
|
|
|
|
return SUCCESS;
|
2023-09-29 12:09:46 -04:00
|
|
|
}
|
|
|
|
return FAILURE;
|
2023-10-01 20:18:16 -04:00
|
|
|
}
|