From 3894d58efc25004e51c7eb6662ab320a196a533a Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 3 Jul 2025 04:06:45 +0200 Subject: [PATCH] Fix disolve and wipe transitions on 32bit (#492) --- .../src/common/mxtransitionmanager.cpp | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp index d54563ab..9e052430 100644 --- a/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/mxtransitionmanager.cpp @@ -248,7 +248,7 @@ void MxTransitionManager::DissolveTransition() } else { MxU8* surf = (MxU8*) ddsd.lpSurface + ddsd.lPitch * row + xShift * 4; - *(MxU32*) surf = 0; + *(MxU32*) surf = 0xFF000000; } } } @@ -416,10 +416,25 @@ void MxTransitionManager::WipeDownTransition() // For each of the 240 animation ticks, blank out two scanlines // starting at the top of the screen. MxU8* line = (MxU8*) ddsd.lpSurface + 2 * ddsd.lPitch * m_animationTimer; - memset(line, 0, ddsd.lPitch); - line += ddsd.lPitch; - memset(line, 0, ddsd.lPitch); + if (ddsd.ddpfPixelFormat.dwRGBBitCount == 32) { + MxU32* pixels = (MxU32*) line; + int pixelsPerLine = ddsd.lPitch / 4; + for (int i = 0; i < pixelsPerLine; i++) { + pixels[i] = 0xFF000000; + } + line += ddsd.lPitch; + pixels = (MxU32*) line; + for (int i = 0; i < pixelsPerLine; i++) { + pixels[i] = 0xFF000000; + } + } + else { + memset(line, 0, ddsd.lPitch); + + line += ddsd.lPitch; + memset(line, 0, ddsd.lPitch); + } SetupCopyRect(&ddsd); m_ddSurface->Unlock(ddsd.lpSurface);