From e609924e4cf3a24040d300079240cef2bb50add8 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 29 Feb 2024 21:42:50 -0500 Subject: [PATCH] Match MxDisplaySurface::Display (#607) --- LEGO1/omni/src/video/mxdisplaysurface.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/LEGO1/omni/src/video/mxdisplaysurface.cpp b/LEGO1/omni/src/video/mxdisplaysurface.cpp index 0cb88f6d..4f4a8030 100644 --- a/LEGO1/omni/src/video/mxdisplaysurface.cpp +++ b/LEGO1/omni/src/video/mxdisplaysurface.cpp @@ -518,28 +518,23 @@ void MxDisplaySurface::Display(MxS32 p_left, MxS32 p_top, MxS32 p_left2, MxS32 p m_ddSurface1->Flip(NULL, DDFLIP_WAIT); } else { - POINT point = {0, 0}; - ClientToScreen(MxOmni::GetInstance()->GetWindowHandle(), &point); + MxPoint32 point(0, 0); + ClientToScreen(MxOmni::GetInstance()->GetWindowHandle(), (LPPOINT) &point); - // TODO: Match - RECT rect1, rect2; - rect1.left = p_left2 + m_videoParam.GetRect().GetLeft() + point.x; - rect2.left = p_left; - rect1.top = p_top2 + m_videoParam.GetRect().GetTop() + point.y; - rect2.right = p_left + p_width; - rect2.top = p_top; - rect2.bottom = p_top + p_height; - rect1.right = rect1.left + p_width; - rect1.bottom = rect1.top + p_height; + p_left2 += m_videoParam.GetRect().GetLeft() + point.GetX(); + p_top2 += m_videoParam.GetRect().GetTop() + point.GetY(); + + MxRect32 a(MxPoint32(p_left, p_top), MxSize32(p_width + 1, p_height + 1)); + MxRect32 b(MxPoint32(p_left2, p_top2), MxSize32(p_width + 1, p_height + 1)); DDBLTFX data; memset(&data, 0, sizeof(data)); data.dwSize = sizeof(data); data.dwDDFX = 8; - if (m_ddSurface1->Blt(&rect1, m_ddSurface2, &rect2, 0, &data) == DDERR_SURFACELOST) { + if (m_ddSurface1->Blt((LPRECT) &b, m_ddSurface2, (LPRECT) &a, 0, &data) == DDERR_SURFACELOST) { m_ddSurface1->Restore(); - m_ddSurface1->Blt(&rect1, m_ddSurface2, &rect2, 0, &data); + m_ddSurface1->Blt((LPRECT) &b, m_ddSurface2, (LPRECT) &a, 0, &data); } } }