mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
match MxTransitionManager::MosaicTransition() (#658)
This commit is contained in:
@@ -258,8 +258,9 @@ void MxTransitionManager::MosaicTransition()
|
|||||||
EndTransition(TRUE);
|
EndTransition(TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (m_animationTimer == 0) {
|
if (m_animationTimer == 0) {
|
||||||
|
|
||||||
// Same init/shuffle steps as the dissolve transition, except that
|
// Same init/shuffle steps as the dissolve transition, except that
|
||||||
// we are using big blocky pixels and only need 64 columns.
|
// we are using big blocky pixels and only need 64 columns.
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
@@ -305,7 +306,7 @@ void MxTransitionManager::MosaicTransition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (MxS32 row = 0; row < 48; row++) {
|
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
|
// 10x10 pixel blocks. At the chosen block, we sample the top-leftmost
|
||||||
// color and set the other 99 pixels to that value.
|
// 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 each of the 10 rows in the 10x10 square:
|
||||||
for (MxS32 k = 10 * row; k < 10 * row + 10; k++) {
|
for (MxS32 k = 10 * row; k < 10 * row + 10; k++) {
|
||||||
if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) {
|
if (ddsd.ddpfPixelFormat.dwRGBBitCount == 8) {
|
||||||
MxU8* pos = (MxU8*) ddsd.lpSurface + k * ddsd.lPitch + xShift;
|
// Optimization: If the pixel is only one byte, we can use memset
|
||||||
|
MxU16* pos = (MxU16*) ((MxU8*) ddsd.lpSurface + k * ddsd.lPitch + xShift);
|
||||||
for (MxS32 tt = 0; tt < 10; tt++) {
|
memset(pos, sample, 10);
|
||||||
pos[tt] = sample;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Need to double xShift because it measures pixels not bytes
|
// Need to double xShift because it measures pixels not bytes
|
||||||
@@ -353,6 +352,7 @@ void MxTransitionManager::MosaicTransition()
|
|||||||
m_animationTimer++;
|
m_animationTimer++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1004c170
|
// FUNCTION: LEGO1 0x1004c170
|
||||||
void MxTransitionManager::WipeDownTransition()
|
void MxTransitionManager::WipeDownTransition()
|
||||||
|
|||||||
Reference in New Issue
Block a user