SetupCopyRect PR Amends

This commit is contained in:
Regan Green 2023-10-05 04:33:03 -04:00
parent 45c2058e46
commit 5a78e8ef34
4 changed files with 24 additions and 23 deletions

View File

@ -174,7 +174,7 @@ void MxDisplaySurface::SetPalette(MxPalette *p_palette)
}
// OFFSET: LEGO1 0x100bc200 STUB
void MxDisplaySurface::vtable24(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
void MxDisplaySurface::vtable24(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
{
}
@ -186,7 +186,7 @@ MxBool MxDisplaySurface::vtable28(undefined4, undefined4, undefined4, undefined4
}
// OFFSET: LEGO1 0x100bc630 STUB
MxBool MxDisplaySurface::vtable2c(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
MxBool MxDisplaySurface::vtable2c(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
{
return 0;
}

View File

@ -23,9 +23,9 @@ class MxDisplaySurface : public MxCore
virtual MxResult Create(MxVideoParam &p_videoParam);
virtual void Clear();
virtual void SetPalette(MxPalette *p_palette);
virtual void vtable24(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual void vtable24(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual MxBool vtable2c(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
virtual MxBool vtable2c(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);

View File

@ -104,7 +104,7 @@ void MxTransitionManager::Transition_Dissolve()
}
if (res == DD_OK) {
SubmitCopyRect(ddsd);
SubmitCopyRect(&ddsd);
for (MxS32 i = 0; i < 640; i++) {
// Select 16 columns on each tick
@ -129,7 +129,7 @@ void MxTransitionManager::Transition_Dissolve()
}
}
SetupCopyRect(ddsd);
SetupCopyRect(&ddsd);
m_ddSurface->Unlock(ddsd.lpSurface);
if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) {
@ -213,7 +213,7 @@ void MxTransitionManager::Transition_Wipe()
}
if (res == DD_OK) {
SubmitCopyRect(ddsd);
SubmitCopyRect(&ddsd);
// For each of the 240 animation ticks, blank out two scanlines
// starting at the top of the screen.
@ -224,7 +224,7 @@ void MxTransitionManager::Transition_Wipe()
line += ddsd.lPitch;
memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
SetupCopyRect(ddsd);
SetupCopyRect(&ddsd);
m_ddSurface->Unlock(ddsd.lpSurface);
m_animationTimer++;
@ -252,15 +252,16 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *p_waitIndicator)
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::TickleState_Streaming) {
m_waitIndicator->Tickle();
}
return;
}
// Disable copy rect
m_copyFlags.bit0 = FALSE;
else
{
// Disable copy rect
m_copyFlags.bit0 = FALSE;
}
}
// OFFSET: LEGO1 0x1004c4d0
void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc)
{
// Check if the copy rect is setup
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) {
@ -270,7 +271,7 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
// Copy the copy rect onto the surface
char *dst;
DWORD bytesPerPixel = ddsc.ddpfPixelFormat.dwRGBBitCount / 8;
DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
const char *src = (const char *)m_copyBuffer;
@ -278,12 +279,12 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
LONG y;
dst = (char *)ddsc.lpSurface + (ddsc.lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
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;
dst += ddsc->lPitch;
}
// Free the copy buffer
@ -292,7 +293,7 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
}
// OFFSET: LEGO1 0x1004c580
void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
{
// Check if the copy rect is setup
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL) {
@ -305,8 +306,8 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &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;
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;
m_copyRect.left = m_waitIndicator->GetLocation().m_x;
m_copyRect.top = m_waitIndicator->GetLocation().m_y;
@ -318,7 +319,7 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &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 char *src = (const char*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left;
m_copyBuffer = malloc(bytesPerPixel * width * height);
if (!m_copyBuffer)
@ -330,7 +331,7 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++)
{
memcpy(dst, src, copyPitch);
src += ddsc.lPitch;
src += ddsc->lPitch;
dst += copyPitch;
}
}

View File

@ -46,8 +46,8 @@ class MxTransitionManager : public MxCore
void EndTransition(MxBool p_notifyWorld);
void Transition_Dissolve();
void Transition_Wipe();
void SubmitCopyRect(DDSURFACEDESC &);
void SetupCopyRect(DDSURFACEDESC &);
void SubmitCopyRect(LPDDSURFACEDESC ddsc);
void SetupCopyRect(LPDDSURFACEDESC ddsc);
MxVideoPresenter *m_waitIndicator;
RECT m_copyRect;