mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-27 10:11:15 +00:00
SetupCopyRect PR Amends
This commit is contained in:
parent
45c2058e46
commit
5a78e8ef34
@ -174,7 +174,7 @@ void MxDisplaySurface::SetPalette(MxPalette *p_palette)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100bc200 STUB
|
// OFFSET: LEGO1 0x100bc200 STUB
|
||||||
void MxDisplaySurface::vtable24(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
void MxDisplaySurface::vtable24(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ MxBool MxDisplaySurface::vtable28(undefined4, undefined4, undefined4, undefined4
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100bc630 STUB
|
// OFFSET: LEGO1 0x100bc630 STUB
|
||||||
MxBool MxDisplaySurface::vtable2c(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
|
MxBool MxDisplaySurface::vtable2c(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,9 +23,9 @@ class MxDisplaySurface : public MxCore
|
|||||||
virtual MxResult Create(MxVideoParam &p_videoParam);
|
virtual MxResult Create(MxVideoParam &p_videoParam);
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
virtual void SetPalette(MxPalette *p_palette);
|
virtual void SetPalette(MxPalette *p_palette);
|
||||||
virtual void vtable24(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
virtual void vtable24(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||||
virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
virtual MxBool vtable28(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||||
virtual MxBool vtable2c(DDSURFACEDESC&, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
virtual MxBool vtable2c(LPDDSURFACEDESC, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
||||||
virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
virtual MxBool vtable30(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, undefined4, MxBool);
|
||||||
virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
virtual undefined4 vtable34(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||||
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
virtual void Display(undefined4, undefined4, undefined4, undefined4, undefined4, undefined4);
|
||||||
|
|||||||
@ -104,7 +104,7 @@ void MxTransitionManager::Transition_Dissolve()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res == DD_OK) {
|
if (res == DD_OK) {
|
||||||
SubmitCopyRect(ddsd);
|
SubmitCopyRect(&ddsd);
|
||||||
|
|
||||||
for (MxS32 i = 0; i < 640; i++) {
|
for (MxS32 i = 0; i < 640; i++) {
|
||||||
// Select 16 columns on each tick
|
// Select 16 columns on each tick
|
||||||
@ -129,7 +129,7 @@ void MxTransitionManager::Transition_Dissolve()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupCopyRect(ddsd);
|
SetupCopyRect(&ddsd);
|
||||||
m_ddSurface->Unlock(ddsd.lpSurface);
|
m_ddSurface->Unlock(ddsd.lpSurface);
|
||||||
|
|
||||||
if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) {
|
if (VideoManager()->GetVideoParam().flags().GetFlipSurfaces()) {
|
||||||
@ -213,7 +213,7 @@ void MxTransitionManager::Transition_Wipe()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res == DD_OK) {
|
if (res == DD_OK) {
|
||||||
SubmitCopyRect(ddsd);
|
SubmitCopyRect(&ddsd);
|
||||||
|
|
||||||
// For each of the 240 animation ticks, blank out two scanlines
|
// For each of the 240 animation ticks, blank out two scanlines
|
||||||
// starting at the top of the screen.
|
// starting at the top of the screen.
|
||||||
@ -224,7 +224,7 @@ void MxTransitionManager::Transition_Wipe()
|
|||||||
line += ddsd.lPitch;
|
line += ddsd.lPitch;
|
||||||
memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
memset(line, 0, 640 * ddsd.ddpfPixelFormat.dwRGBBitCount / 8);
|
||||||
|
|
||||||
SetupCopyRect(ddsd);
|
SetupCopyRect(&ddsd);
|
||||||
m_ddSurface->Unlock(ddsd.lpSurface);
|
m_ddSurface->Unlock(ddsd.lpSurface);
|
||||||
|
|
||||||
m_animationTimer++;
|
m_animationTimer++;
|
||||||
@ -252,15 +252,16 @@ void MxTransitionManager::SetWaitIndicator(MxVideoPresenter *p_waitIndicator)
|
|||||||
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::TickleState_Streaming) {
|
if (m_waitIndicator->GetCurrentTickleState() < MxPresenter::TickleState_Streaming) {
|
||||||
m_waitIndicator->Tickle();
|
m_waitIndicator->Tickle();
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// Disable copy rect
|
{
|
||||||
m_copyFlags.bit0 = FALSE;
|
// Disable copy rect
|
||||||
|
m_copyFlags.bit0 = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1004c4d0
|
// OFFSET: LEGO1 0x1004c4d0
|
||||||
void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
|
void MxTransitionManager::SubmitCopyRect(LPDDSURFACEDESC ddsc)
|
||||||
{
|
{
|
||||||
// Check if the copy rect is setup
|
// Check if the copy rect is setup
|
||||||
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) {
|
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL || m_copyBuffer == NULL) {
|
||||||
@ -270,7 +271,7 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
// Copy the copy rect onto the surface
|
// Copy the copy rect onto the surface
|
||||||
char *dst;
|
char *dst;
|
||||||
|
|
||||||
DWORD bytesPerPixel = ddsc.ddpfPixelFormat.dwRGBBitCount / 8;
|
DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
|
||||||
|
|
||||||
const char *src = (const char *)m_copyBuffer;
|
const char *src = (const char *)m_copyBuffer;
|
||||||
|
|
||||||
@ -278,12 +279,12 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
|
copyPitch = ((m_copyRect.right - m_copyRect.left) + 1) * bytesPerPixel;
|
||||||
|
|
||||||
LONG y;
|
LONG y;
|
||||||
dst = (char *)ddsc.lpSurface + (ddsc.lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
|
dst = (char *)ddsc->lpSurface + (ddsc->lPitch * m_copyRect.top) + (bytesPerPixel * m_copyRect.left);
|
||||||
|
|
||||||
for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) {
|
for (y = 0; y < m_copyRect.bottom - m_copyRect.top + 1; ++y) {
|
||||||
memcpy(dst, src, copyPitch);
|
memcpy(dst, src, copyPitch);
|
||||||
src += copyPitch;
|
src += copyPitch;
|
||||||
dst += ddsc.lPitch;
|
dst += ddsc->lPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the copy buffer
|
// Free the copy buffer
|
||||||
@ -292,7 +293,7 @@ void MxTransitionManager::SubmitCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1004c580
|
// OFFSET: LEGO1 0x1004c580
|
||||||
void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
|
void MxTransitionManager::SetupCopyRect(LPDDSURFACEDESC ddsc)
|
||||||
{
|
{
|
||||||
// Check if the copy rect is setup
|
// Check if the copy rect is setup
|
||||||
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL) {
|
if (m_copyFlags.bit0 == FALSE || m_waitIndicator == NULL) {
|
||||||
@ -305,8 +306,8 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
// Check if wait indicator has started
|
// Check if wait indicator has started
|
||||||
if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) {
|
if (m_waitIndicator->GetCurrentTickleState() >= MxPresenter::TickleState_Streaming) {
|
||||||
// Setup the copy rect
|
// Setup the copy rect
|
||||||
DWORD copyPitch = (ddsc.ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously
|
DWORD copyPitch = (ddsc->ddpfPixelFormat.dwRGBBitCount / 8) * (m_copyRect.right - m_copyRect.left + 1); // This uses m_copyRect, seemingly erroneously
|
||||||
DWORD bytesPerPixel = ddsc.ddpfPixelFormat.dwRGBBitCount / 8;
|
DWORD bytesPerPixel = ddsc->ddpfPixelFormat.dwRGBBitCount / 8;
|
||||||
|
|
||||||
m_copyRect.left = m_waitIndicator->GetLocation().m_x;
|
m_copyRect.left = m_waitIndicator->GetLocation().m_x;
|
||||||
m_copyRect.top = m_waitIndicator->GetLocation().m_y;
|
m_copyRect.top = m_waitIndicator->GetLocation().m_y;
|
||||||
@ -318,7 +319,7 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
m_copyRect.bottom = m_copyRect.top + height - 1;
|
m_copyRect.bottom = m_copyRect.top + height - 1;
|
||||||
|
|
||||||
// Allocate the copy buffer
|
// Allocate the copy buffer
|
||||||
const char *src = (const char*)ddsc.lpSurface + m_copyRect.top * ddsc.lPitch + bytesPerPixel * m_copyRect.left;
|
const char *src = (const char*)ddsc->lpSurface + m_copyRect.top * ddsc->lPitch + bytesPerPixel * m_copyRect.left;
|
||||||
|
|
||||||
m_copyBuffer = malloc(bytesPerPixel * width * height);
|
m_copyBuffer = malloc(bytesPerPixel * width * height);
|
||||||
if (!m_copyBuffer)
|
if (!m_copyBuffer)
|
||||||
@ -330,7 +331,7 @@ void MxTransitionManager::SetupCopyRect(DDSURFACEDESC &ddsc)
|
|||||||
for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++)
|
for (MxS32 i = 0; i < (m_copyRect.bottom - m_copyRect.top + 1); i++)
|
||||||
{
|
{
|
||||||
memcpy(dst, src, copyPitch);
|
memcpy(dst, src, copyPitch);
|
||||||
src += ddsc.lPitch;
|
src += ddsc->lPitch;
|
||||||
dst += copyPitch;
|
dst += copyPitch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,8 +46,8 @@ class MxTransitionManager : public MxCore
|
|||||||
void EndTransition(MxBool p_notifyWorld);
|
void EndTransition(MxBool p_notifyWorld);
|
||||||
void Transition_Dissolve();
|
void Transition_Dissolve();
|
||||||
void Transition_Wipe();
|
void Transition_Wipe();
|
||||||
void SubmitCopyRect(DDSURFACEDESC &);
|
void SubmitCopyRect(LPDDSURFACEDESC ddsc);
|
||||||
void SetupCopyRect(DDSURFACEDESC &);
|
void SetupCopyRect(LPDDSURFACEDESC ddsc);
|
||||||
|
|
||||||
MxVideoPresenter *m_waitIndicator;
|
MxVideoPresenter *m_waitIndicator;
|
||||||
RECT m_copyRect;
|
RECT m_copyRect;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user