mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement MxTransitionManager::SubmitCopyRect (#160)
* Implement MxTransitionManager::SubmitCopyRect * MxTransitionManager::SubmitCopyRect Amendments * Fix MxTransitionManager::EndTransition * Fix MxDSAction::SetLoopCount
This commit is contained in:
@@ -13,9 +13,9 @@ MxTransitionManager::MxTransitionManager()
|
||||
m_animationTimer = 0;
|
||||
m_transitionType = NOT_TRANSITIONING;
|
||||
m_ddSurface = NULL;
|
||||
m_unk08 = 0;
|
||||
m_unk1c = 0;
|
||||
m_unk20.bit0 = FALSE;
|
||||
m_waitIndicator = NULL;
|
||||
m_copyBuffer = NULL;
|
||||
m_copyFlags.bit0 = FALSE;
|
||||
m_unk28.bit0 = FALSE;
|
||||
m_unk24 = 0;
|
||||
}
|
||||
@@ -23,11 +23,11 @@ MxTransitionManager::MxTransitionManager()
|
||||
// OFFSET: LEGO1 0x1004ba00
|
||||
MxTransitionManager::~MxTransitionManager()
|
||||
{
|
||||
free(m_unk1c);
|
||||
free(m_copyBuffer);
|
||||
|
||||
if (m_unk08 != NULL) {
|
||||
delete m_unk08->m_unk1c;
|
||||
delete m_unk08;
|
||||
if (m_waitIndicator != NULL) {
|
||||
delete m_waitIndicator->GetAction();
|
||||
delete m_waitIndicator;
|
||||
}
|
||||
|
||||
TickleManager()->UnregisterClient(this);
|
||||
@@ -47,7 +47,7 @@ void MxTransitionManager::EndTransition(MxBool p_notifyWorld)
|
||||
if (m_transitionType != NOT_TRANSITIONING) {
|
||||
m_transitionType = NOT_TRANSITIONING;
|
||||
|
||||
m_unk20.bit0 = FALSE;
|
||||
m_copyFlags.bit0 = FALSE;
|
||||
|
||||
TickleManager()->UnregisterClient(this);
|
||||
|
||||
@@ -104,7 +104,7 @@ void MxTransitionManager::Transition_Dissolve()
|
||||
}
|
||||
|
||||
if (res == DD_OK) {
|
||||
FUN_1004c4d0(ddsd);
|
||||
SubmitCopyRect(ddsd);
|
||||
|
||||
for (MxS32 i = 0; i < 640; i++) {
|
||||
// Select 16 columns on each tick
|
||||
@@ -129,7 +129,7 @@ void MxTransitionManager::Transition_Dissolve()
|
||||
}
|
||||
}
|
||||
|
||||
FUN_1004c580(ddsd);
|
||||
SetupCopyRect(ddsd);
|
||||
m_ddSurface->Unlock(ddsd.lpSurface);
|
||||
|
||||
if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) {
|
||||
@@ -141,24 +141,6 @@ void MxTransitionManager::Transition_Dissolve()
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c470 STUB
|
||||
void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *videoPresenter)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c4d0 STUB
|
||||
void MxTransitionManager::FUN_1004c4d0(DDSURFACEDESC &ddsc)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c580 STUB
|
||||
void MxTransitionManager::FUN_1004c580(DDSURFACEDESC &ddsc)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004baa0
|
||||
MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14
|
||||
{
|
||||
@@ -169,7 +151,7 @@ MxResult MxTransitionManager::GetDDrawSurfaceFromVideoManager() // vtable+0x14
|
||||
|
||||
// OFFSET: LEGO1 0x1004bb70
|
||||
MxResult MxTransitionManager::StartTransition(TransitionType p_animationType, MxS32 p_speed,
|
||||
MxBool p_unk, MxBool p_playMusicInAnim)
|
||||
MxBool p_doCopy, MxBool p_playMusicInAnim)
|
||||
{
|
||||
if (this->m_transitionType == NOT_TRANSITIONING) {
|
||||
if (!p_playMusicInAnim) {
|
||||
@@ -179,14 +161,14 @@ MxResult MxTransitionManager::StartTransition(TransitionType p_animationType, Mx
|
||||
|
||||
this->m_transitionType = p_animationType;
|
||||
|
||||
m_unk20.bit0 = p_unk;
|
||||
m_copyFlags.bit0 = p_doCopy;
|
||||
|
||||
if (m_unk20.bit0 && m_unk08 != NULL) {
|
||||
m_unk08->vtable54(1);
|
||||
if (m_copyFlags.bit0 && m_waitIndicator != NULL) {
|
||||
m_waitIndicator->Enable(TRUE);
|
||||
|
||||
MxTransitionManagerUnknownSubclass2 *iVar2 = m_unk08->m_unk1c;
|
||||
iVar2->m_unk3c = 10000;
|
||||
iVar2->m_unk30 |= 0x200;
|
||||
MxDSAction *action = m_waitIndicator->GetAction();
|
||||
action->SetLoopCount(10000);
|
||||
action->SetFlags(action->GetFlags() | MxDSAction::Flag_Bit9);
|
||||
}
|
||||
|
||||
MxU32 time = timeGetTime();
|
||||
@@ -209,3 +191,47 @@ MxResult MxTransitionManager::StartTransition(TransitionType p_animationType, Mx
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c470 STUB
|
||||
void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *videoPresenter)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c4d0
|
||||
void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
|
||||
{
|
||||
// Check if the copy rect is setup
|
||||
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Copy the copy rect onto the surface
|
||||
char *dst;
|
||||
|
||||
DWORD bytesPerPixel = ddsc.ddpfPixelFormat.dwRGBBitCount / 8;
|
||||
|
||||
const char *src = (const char *)m_copyBuffer;
|
||||
|
||||
LONG copyPitch;
|
||||
copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
|
||||
|
||||
LONG y;
|
||||
dst = (char *)ddsc.lpSurface + (ddsc.lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
|
||||
|
||||
for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) {
|
||||
memcpy(dst, src, copyPitch);
|
||||
src += copyPitch;
|
||||
dst += ddsc.lPitch;
|
||||
}
|
||||
|
||||
// Free the copy buffer
|
||||
free(m_copyBuffer);
|
||||
m_copyBuffer = NULL;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1004c580 STUB
|
||||
void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
Reference in New Issue
Block a user