mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-12 10:41:15 +00:00
Use pitch instead of trying to calculate it (#308)
This commit is contained in:
parent
975764dc17
commit
43a261b945
@ -388,12 +388,11 @@ void MxTransitionManager::WipeDownTransition()
|
||||
|
||||
// For each of the 240 animation ticks, blank out two scanlines
|
||||
// starting at the top of the screen.
|
||||
// (dwRGBBitCount / 8) will tell how many bytes are used per pixel.
|
||||
MxU8* line = (MxU8*) ddsd.lpSurface + 2 * ddsd.lPitch * m_animationTimer;
|
||||
memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(line, 0, ddsd.lPitch);
|
||||
|
||||
line += ddsd.lPitch;
|
||||
memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(line, 0, ddsd.lPitch);
|
||||
|
||||
SetupCopyRect(&ddsd);
|
||||
m_ddSurface->Unlock(ddsd.lpSurface);
|
||||
@ -427,9 +426,8 @@ void MxTransitionManager::WindowsTransition()
|
||||
MxU8* line = (MxU8*) ddsd.lpSurface + m_animationTimer * ddsd.lPitch;
|
||||
|
||||
MxS32 bytesPerPixel = ddsd.ddpfPixelFormat.dwRGBBitCount / 8;
|
||||
MxS32 bytesPerLine = bytesPerPixel * 640;
|
||||
|
||||
memset(line, 0, bytesPerLine);
|
||||
memset(line, 0, ddsd.lPitch);
|
||||
|
||||
for (MxS32 i = m_animationTimer + 1; i < 480 - m_animationTimer; i++) {
|
||||
line += ddsd.lPitch;
|
||||
@ -439,7 +437,7 @@ void MxTransitionManager::WindowsTransition()
|
||||
}
|
||||
|
||||
line += ddsd.lPitch;
|
||||
memset(line, 0, bytesPerLine);
|
||||
memset(line, 0, ddsd.lPitch);
|
||||
|
||||
SetupCopyRect(&ddsd);
|
||||
m_ddSurface->Unlock(ddsd.lpSurface);
|
||||
|
||||
@ -459,7 +459,7 @@ void LegoVideoManager::DrawFPS()
|
||||
char* ptr = (char*) surfaceDesc.lpSurface;
|
||||
|
||||
for (i = 0; i < surfaceDesc.dwHeight; i++) {
|
||||
memset(ptr, 0, surfaceDesc.dwWidth * surfaceDesc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(ptr, 0, surfaceDesc.lPitch);
|
||||
ptr += surfaceDesc.lPitch;
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@ void LegoVideoManager::DrawFPS()
|
||||
char* ptr = (char*) surfaceDesc.lpSurface;
|
||||
|
||||
for (i = 0; i < surfaceDesc.dwHeight; i++) {
|
||||
memset(ptr, 0, surfaceDesc.dwWidth * surfaceDesc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(ptr, 0, surfaceDesc.lPitch);
|
||||
ptr += surfaceDesc.lPitch;
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ BOOL MxDirect3D::D3DSetMode()
|
||||
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
||||
|
||||
for (int i = 0; i < mode.height; i++) {
|
||||
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(surface, 0, desc.lPitch);
|
||||
surface += desc.lPitch;
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ BOOL MxDirect3D::D3DSetMode()
|
||||
unsigned char* surface = (unsigned char*) desc.lpSurface;
|
||||
|
||||
for (int i = 0; i < mode.height; i++) {
|
||||
memset(surface, 0, mode.width * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(surface, 0, desc.lPitch);
|
||||
surface += desc.lPitch;
|
||||
}
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ void MxDisplaySurface::ClearScreen()
|
||||
MxS32 height = m_videoParam.GetRect().GetHeight();
|
||||
|
||||
while (height--) {
|
||||
memset(surface, 0, m_videoParam.GetRect().GetWidth() * desc.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(surface, 0, desc.lPitch);
|
||||
surface += desc.lPitch;
|
||||
}
|
||||
|
||||
@ -854,7 +854,7 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p
|
||||
MxS32 height = m_videoParam.GetRect().GetHeight();
|
||||
|
||||
for (MxU32 i = 0; i < ddsd.dwHeight; i++) {
|
||||
memset(surface, 0, ddsd.dwWidth * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||
memset(surface, 0, ddsd.lPitch);
|
||||
surface += ddsd.lPitch;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user