Implement MxDisplaySurface::CopySurface

100% match
This commit is contained in:
Misha 2024-03-15 14:22:38 -04:00
parent 03428a2ac2
commit 433a5d2382
No known key found for this signature in database
GPG Key ID: 8441D12AEF33FED8
3 changed files with 25 additions and 6 deletions

View File

@ -92,7 +92,7 @@ class MxDisplaySurface : public MxCore {
void ClearScreen(); void ClearScreen();
static LPDIRECTDRAWSURFACE CreateCursorSurface(); static LPDIRECTDRAWSURFACE CreateCursorSurface();
static LPDIRECTDRAWSURFACE FUN_100bbfb0(LPDIRECTDRAWSURFACE p_und); static LPDIRECTDRAWSURFACE CopySurface(LPDIRECTDRAWSURFACE p_src);
inline LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return this->m_ddSurface1; } inline LPDIRECTDRAWSURFACE GetDirectDrawSurface1() { return this->m_ddSurface1; }
inline LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return this->m_ddSurface2; } inline LPDIRECTDRAWSURFACE GetDirectDrawSurface2() { return this->m_ddSurface2; }

View File

@ -701,11 +701,30 @@ LPDIRECTDRAWSURFACE MxDisplaySurface::VTable0x44(
return surface; return surface;
} }
// STUB: LEGO1 0x100bbfb0 // FUNCTION: LEGO1 0x100bbfb0
LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bbfb0(LPDIRECTDRAWSURFACE p_und) LPDIRECTDRAWSURFACE MxDisplaySurface::CopySurface(LPDIRECTDRAWSURFACE p_src)
{ {
// TODO LPDIRECTDRAWSURFACE newSurface = NULL;
IDirectDraw* draw = MVideoManager()->GetDirectDraw();
DDSURFACEDESC ddsd;
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
p_src->GetSurfaceDesc(&ddsd);
if (draw->CreateSurface(&ddsd, &newSurface, NULL) != DD_OK) {
return NULL; return NULL;
}
RECT rect = {0, 0, ddsd.dwWidth, ddsd.dwHeight};
if (newSurface->BltFast(0, 0, p_src, &rect, 16) != DD_OK) {
newSurface->Release();
return NULL;
}
return newSurface;
} }
// FUNCTION: LEGO1 0x100bc070 // FUNCTION: LEGO1 0x100bc070

View File

@ -249,7 +249,7 @@ MxStillPresenter* MxStillPresenter::Clone()
} }
if (m_unk0x58) { if (m_unk0x58) {
presenter->m_unk0x58 = MxDisplaySurface::FUN_100bbfb0(m_unk0x58); presenter->m_unk0x58 = MxDisplaySurface::CopySurface(m_unk0x58);
} }
if (m_alpha) { if (m_alpha) {