Fix WindowsTransition (#495)

This commit is contained in:
Anders Jenbo 2025-07-03 04:57:57 +02:00 committed by GitHub
parent be73b40ae8
commit 605163b755
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,17 +469,42 @@ void MxTransitionManager::WindowsTransition()
MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
memset(line, 0, ddsd.lPitch);
if (bytesPerPixel == 4) {
MxU32* pixels = (MxU32*) line;
for (int i = 0; i < 640; i++) {
pixels[i] = 0xFF000000;
}
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer; i++) {
line += ddsd.lPitch;
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer - 1; i++) {
line += ddsd.lPitch;
pixels = (MxU32*) line;
pixels[m_animationTimer] = 0xFF000000;
pixels[639 - m_animationTimer] = 0xFF000000;
}
memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
memset(line + 640 + (-1 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
if (m_animationTimer < 240 - 1) {
line += ddsd.lPitch;
pixels = (MxU32*) line;
for (int i = 0; i < 640; i++) {
pixels[i] = 0xFF000000;
}
}
}
else {
memset(line, 0, 640 * bytesPerPixel);
line += ddsd.lPitch;
memset(line, 0, ddsd.lPitch);
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer - 1; i++) {
line += ddsd.lPitch;
memset(line + m_animationTimer * bytesPerPixel, 0, bytesPerPixel);
memset(line + (639 - m_animationTimer) * bytesPerPixel, 0, bytesPerPixel);
}
if (m_animationTimer < 240 - 1) {
line += ddsd.lPitch;
memset(line, 0, 640 * bytesPerPixel);
}
}
SetupCopyRect(&ddsd);
m_ddSurface->Unlock(ddsd.lpSurface);