From dd9354ec0c3787673783d3c29631b6d18d9c003e Mon Sep 17 00:00:00 2001 From: disinvite Date: Sat, 7 Oct 2023 12:08:44 -0400 Subject: [PATCH] MxTypes in TransitionManager. Remove stub marker (oops) --- LEGO1/mxtransitionmanager.cpp | 22 +++++++++++----------- LEGO1/mxtransitionmanager.h | 2 +- LEGO1/mxvideopresenter.cpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LEGO1/mxtransitionmanager.cpp b/LEGO1/mxtransitionmanager.cpp index 479dfa41..e108bbce 100644 --- a/LEGO1/mxtransitionmanager.cpp +++ b/LEGO1/mxtransitionmanager.cpp @@ -318,17 +318,17 @@ void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc) } // Copy the copy rect onto the surface - char *dst; + MxU8 *dst; - DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; + MxU32 bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; - const char *src = (const char *)m_copyBuffer; + const MxU8 *src = (const MxU8 *)m_copyBuffer; - LONG copyPitch; + MxS32 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); + MxS32 y; + dst = (MxU8 *)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); @@ -355,8 +355,8 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) // Check if wait indicator has started if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) { // Setup the copy rect - DWORD copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously - DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; + MxU32 copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously + MxU32 bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8; m_copyRect.left = m_waitIndicator->GetLocationX(); m_copyRect.top = m_waitIndicator->GetLocationY(); @@ -368,14 +368,14 @@ void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc) m_copyRect.bottom = m_copyRect.top + height - 1; // Allocate the copy buffer - const char *src = (const char*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left; + const MxU8 *src = (const MxU8*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left; - m_copyBuffer = new char[bytesPerPixel * width * height]; + m_copyBuffer = new MxU8[bytesPerPixel * width * height]; if (!m_copyBuffer) return; // Copy into the copy buffer - char *dst = (char*)m_copyBuffer; + MxU8 *dst = m_copyBuffer; for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++) { diff --git a/LEGO1/mxtransitionmanager.h b/LEGO1/mxtransitionmanager.h index 7f1d4ead..aa58b5ec 100644 --- a/LEGO1/mxtransitionmanager.h +++ b/LEGO1/mxtransitionmanager.h @@ -57,7 +57,7 @@ class MxTransitionManager : public MxCore MxVideoPresenter *m_waitIndicator; RECT m_copyRect; - void *m_copyBuffer; + MxU8 *m_copyBuffer; flag_bitfield m_copyFlags; undefined4 m_unk24; diff --git a/LEGO1/mxvideopresenter.cpp b/LEGO1/mxvideopresenter.cpp index c1cdd4e8..42dc34f3 100644 --- a/LEGO1/mxvideopresenter.cpp +++ b/LEGO1/mxvideopresenter.cpp @@ -57,7 +57,7 @@ MxS32 MxVideoPresenter::GetWidth() : m_bitmap->GetBmiHeader()->biWidth; } -// OFFSET: LEGO1 0x1000c800 STUB +// OFFSET: LEGO1 0x1000c800 MxS32 MxVideoPresenter::GetHeight() { return m_unk54 ? m_unk54->height