Fix disolve and wipe transitions on 32bit (#492)

This commit is contained in:
Anders Jenbo 2025-07-03 04:06:45 +02:00 committed by GitHub
parent 04b0e9a470
commit 3894d58efc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);