From ae908a74cc58c35d2fa2fa191edda4ee089f7db6 Mon Sep 17 00:00:00 2001 From: MS Date: Sat, 21 Oct 2023 19:47:48 -0400 Subject: [PATCH] Copy constructor for MxVideoPresenter::AlphaMask (#229) --- LEGO1/mxvideopresenter.cpp | 14 +++++++++++++- LEGO1/mxvideopresenter.h | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/LEGO1/mxvideopresenter.cpp b/LEGO1/mxvideopresenter.cpp index 5abef00d..f48a0f8b 100644 --- a/LEGO1/mxvideopresenter.cpp +++ b/LEGO1/mxvideopresenter.cpp @@ -67,7 +67,7 @@ MxS32 MxVideoPresenter::GetHeight() } // OFFSET: LEGO1 0x100b24f0 -MxVideoPresenter::AlphaMask::AlphaMask(MxBitmap &p_bitmap) +MxVideoPresenter::AlphaMask::AlphaMask(const MxBitmap &p_bitmap) { m_width = p_bitmap.GetBmiWidth(); // DECOMP: ECX becomes word-sized if these are not two separate actions. @@ -147,6 +147,18 @@ MxVideoPresenter::AlphaMask::AlphaMask(MxBitmap &p_bitmap) } } +// OFFSET: LEGO1 0x100b2670 +MxVideoPresenter::AlphaMask::AlphaMask(const MxVideoPresenter::AlphaMask &p_alpha) +{ + m_width = p_alpha.m_width; + m_height = p_alpha.m_height; + + MxS32 size = ((m_width * m_height) / 8) + 1; + m_bitmask = new MxU8[size]; + memcpy(m_bitmask, p_alpha.m_bitmask, size); +} + + // OFFSET: LEGO1 0x100b26d0 MxVideoPresenter::AlphaMask::~AlphaMask() { diff --git a/LEGO1/mxvideopresenter.h b/LEGO1/mxvideopresenter.h index 4f66075c..61a1027c 100644 --- a/LEGO1/mxvideopresenter.h +++ b/LEGO1/mxvideopresenter.h @@ -55,7 +55,8 @@ class MxVideoPresenter : public MxMediaPresenter MxU16 m_width; MxU16 m_height; - AlphaMask(MxBitmap &); + AlphaMask(const MxBitmap &); + AlphaMask(const AlphaMask &); virtual ~AlphaMask(); };