match MxTransitionManager::MosaicTransition() (#658)

This commit is contained in:
Ramen2X
2024-03-11 17:33:43 -04:00
committed by GitHub
parent 7659db49e7
commit 121708a574

View File

@@ -258,8 +258,9 @@ void MxTransitionManager::MosaicTransition()
EndTransition(TRUE);
return;
}
else {
if (m_animationTimer == 0) {
// Same init/shuffle steps as the dissolve transition, except that
// we are using big blocky pixels and only need 64 columns.
MxS32 i;
@@ -305,7 +306,7 @@ void MxTransitionManager::MosaicTransition()
}
for (MxS32 row = 0; row < 48; row++) {
// To do the pixelation, we subdivide the 640x480 surface into
// To do the mosaic effect, we subdivide the 640x480 surface into
// 10x10 pixel blocks. At the chosen block, we sample the top-leftmost
// color and set the other 99 pixels to that value.
@@ -324,11 +325,9 @@ void MxTransitionManager::MosaicTransition()
// For each of the 10 rows in the 10x10 square:
for (MxS32 k = 10 * row; k < 10 * row + 10; k++) {
if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) {
MxU8* pos = (MxU8*) ddsd.lpSurface + k * ddsd.lPitch + xShift;
for (MxS32 tt = 0; tt < 10; tt++) {
pos[tt] = sample;
}
// Optimization: If the pixel is only one byte, we can use memset
MxU16* pos = (MxU16*) ((MxU8*) ddsd.lpSurface + k * ddsd.lPitch + xShift);
memset(pos, sample, 10);
}
else {
// Need to double xShift because it measures pixels not bytes
@@ -352,6 +351,7 @@ void MxTransitionManager::MosaicTransition()
m_animationTimer++;
}
}
}
// FUNCTION: LEGO1 0x1004c170