From 433999f80f28275c48cf621ea3907b5c93a70570 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 19 Jan 2024 09:34:57 -0500 Subject: [PATCH] Fixes --- LEGO1/lego/legoomni/include/infocenterstate.h | 2 +- LEGO1/omni/src/video/mxbitmap.cpp | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/LEGO1/lego/legoomni/include/infocenterstate.h b/LEGO1/lego/legoomni/include/infocenterstate.h index 4f92b508..8314529f 100644 --- a/LEGO1/lego/legoomni/include/infocenterstate.h +++ b/LEGO1/lego/legoomni/include/infocenterstate.h @@ -3,7 +3,7 @@ #include "decomp.h" #include "legostate.h" -#include "mxstillpresenter.h"; +#include "mxstillpresenter.h" // VTABLE: LEGO1 0x100d93a8 // SIZE 0x94 diff --git a/LEGO1/omni/src/video/mxbitmap.cpp b/LEGO1/omni/src/video/mxbitmap.cpp index 053143ab..0d83bba2 100644 --- a/LEGO1/omni/src/video/mxbitmap.cpp +++ b/LEGO1/omni/src/video/mxbitmap.cpp @@ -219,12 +219,13 @@ void MxBitmap::BitBlt( MxS32 p_height ) { - MxLong dstHeight = AbsFlipped(m_bmiHeader->biHeight); - MxLong srcHeight = AbsFlipped(p_src->m_bmiHeader->biHeight); + MxLong dstHeight = GetBmiHeightAbs(); + MxLong srcHeight = p_src->GetBmiHeightAbs(); + if (GetRectIntersection( - p_src->m_bmiHeader->biWidth, + p_src->GetBmiWidth(), srcHeight, - m_bmiHeader->biWidth, + GetBmiWidth(), dstHeight, &p_srcLeft, &p_srcTop, @@ -237,7 +238,8 @@ void MxBitmap::BitBlt( MxU8* dstStart = GetStart(p_dstLeft, p_dstTop); MxLong srcStride = p_src->GetAdjustedStride(); MxLong dstStride = GetAdjustedStride(); - for (; p_height; --p_height) { + + while (p_height--) { memcpy(dstStart, srcStart, p_width); dstStart += dstStride; srcStart += srcStride; @@ -256,12 +258,13 @@ void MxBitmap::BitBltTransparent( MxS32 p_height ) { - MxLong dstHeight = AbsFlipped(m_bmiHeader->biHeight); - MxLong srcHeight = AbsFlipped(p_src->m_bmiHeader->biHeight); + MxLong dstHeight = GetBmiHeightAbs(); + MxLong srcHeight = p_src->GetBmiHeightAbs(); + if (GetRectIntersection( - p_src->m_bmiHeader->biWidth, + p_src->GetBmiWidth(), srcHeight, - m_bmiHeader->biWidth, + GetBmiWidth(), dstHeight, &p_srcLeft, &p_srcTop, @@ -274,6 +277,7 @@ void MxBitmap::BitBltTransparent( MxU8* dstStart = GetStart(p_dstLeft, p_dstTop); MxLong srcStride = p_src->GetAdjustedStride() - p_width; MxLong dstStride = GetAdjustedStride() - p_width; + for (MxS32 h = 0; h < p_height; h++) { for (MxS32 w = 0; w < p_width; w++) { if (*srcStart) @@ -281,6 +285,7 @@ void MxBitmap::BitBltTransparent( srcStart++; dstStart++; } + srcStart += srcStride; dstStart += dstStride; }