mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
Implement/match MxStillPresenter::Clone (#502)
* Implement/match MxStillPresenter::Clone * Fix
This commit is contained in:

committed by
GitHub

parent
445084f4b0
commit
96234ddc23
@@ -41,7 +41,7 @@ LegoMeterPresenter::LegoMeterPresenter()
|
|||||||
m_unk0x6c = 0;
|
m_unk0x6c = 0;
|
||||||
m_unk0x84 = 0;
|
m_unk0x84 = 0;
|
||||||
m_type = 1;
|
m_type = 1;
|
||||||
m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10043780
|
// FUNCTION: LEGO1 0x10043780
|
||||||
|
@@ -92,6 +92,7 @@ public:
|
|||||||
|
|
||||||
void ClearScreen();
|
void ClearScreen();
|
||||||
static LPDIRECTDRAWSURFACE CreateCursorSurface();
|
static LPDIRECTDRAWSURFACE CreateCursorSurface();
|
||||||
|
static LPDIRECTDRAWSURFACE FUN_100bbfb0(LPDIRECTDRAWSURFACE p_und);
|
||||||
|
|
||||||
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; }
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
class MxStillPresenter : public MxVideoPresenter {
|
class MxStillPresenter : public MxVideoPresenter {
|
||||||
public:
|
public:
|
||||||
MxStillPresenter() { m_bitmapInfo = NULL; }
|
MxStillPresenter() { m_bitmapInfo = NULL; }
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10043550
|
// FUNCTION: LEGO1 0x10043550
|
||||||
virtual ~MxStillPresenter() override { Destroy(TRUE); }; // vtable+0x00
|
virtual ~MxStillPresenter() override { Destroy(TRUE); }; // vtable+0x00
|
||||||
|
|
||||||
|
@@ -10,14 +10,6 @@
|
|||||||
// SIZE 0x64
|
// SIZE 0x64
|
||||||
class MxVideoPresenter : public MxMediaPresenter {
|
class MxVideoPresenter : public MxMediaPresenter {
|
||||||
public:
|
public:
|
||||||
enum {
|
|
||||||
c_bit1 = 0x01,
|
|
||||||
c_bit2 = 0x02,
|
|
||||||
c_bit3 = 0x04,
|
|
||||||
c_bit4 = 0x08,
|
|
||||||
c_bit5 = 0x10,
|
|
||||||
};
|
|
||||||
|
|
||||||
MxVideoPresenter() { Init(); }
|
MxVideoPresenter() { Init(); }
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1000c740
|
// FUNCTION: LEGO1 0x1000c740
|
||||||
@@ -100,6 +92,18 @@ public:
|
|||||||
inline MxS32 PrepareRects(MxRect32& p_rectDest, MxRect32& p_rectSrc);
|
inline MxS32 PrepareRects(MxRect32& p_rectDest, MxRect32& p_rectSrc);
|
||||||
inline MxBitmap* GetBitmap() { return m_bitmap; }
|
inline MxBitmap* GetBitmap() { return m_bitmap; }
|
||||||
|
|
||||||
|
inline void SetBit0(BOOL p_e) { m_flags.m_bit0 = p_e; }
|
||||||
|
inline void SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }
|
||||||
|
inline void SetBit2(BOOL p_e) { m_flags.m_bit2 = p_e; }
|
||||||
|
inline void SetBit3(BOOL p_e) { m_flags.m_bit3 = p_e; }
|
||||||
|
inline void SetBit4(BOOL p_e) { m_flags.m_bit4 = p_e; }
|
||||||
|
|
||||||
|
inline BYTE GetBit0() { return m_flags.m_bit0; }
|
||||||
|
inline BYTE GetBit1() { return m_flags.m_bit1; }
|
||||||
|
inline BYTE GetBit2() { return m_flags.m_bit2; }
|
||||||
|
inline BYTE GetBit3() { return m_flags.m_bit3; }
|
||||||
|
inline BYTE GetBit4() { return m_flags.m_bit4; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1000c910
|
// SYNTHETIC: LEGO1 0x1000c910
|
||||||
// MxVideoPresenter::`scalar deleting destructor'
|
// MxVideoPresenter::`scalar deleting destructor'
|
||||||
|
|
||||||
@@ -113,7 +117,7 @@ protected:
|
|||||||
AlphaMask* m_alpha; // 0x54
|
AlphaMask* m_alpha; // 0x54
|
||||||
LPDIRECTDRAWSURFACE m_unk0x58; // 0x58
|
LPDIRECTDRAWSURFACE m_unk0x58; // 0x58
|
||||||
MxS16 m_unk0x5c; // 0x5c
|
MxS16 m_unk0x5c; // 0x5c
|
||||||
MxU8 m_flags; // 0x5e
|
FlagBitfield m_flags; // 0x5e
|
||||||
MxLong m_unk0x60; // 0x60
|
MxLong m_unk0x60; // 0x60
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -679,6 +679,13 @@ done:
|
|||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STUB: LEGO1 0x100bbfb0
|
||||||
|
LPDIRECTDRAWSURFACE MxDisplaySurface::FUN_100bbfb0(LPDIRECTDRAWSURFACE p_und)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100bc070
|
// FUNCTION: LEGO1 0x100bc070
|
||||||
LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
LPDIRECTDRAWSURFACE MxDisplaySurface::CreateCursorSurface()
|
||||||
{
|
{
|
||||||
|
@@ -12,9 +12,9 @@ DECOMP_SIZE_ASSERT(MxFlcPresenter, 0x68);
|
|||||||
// FUNCTION: LEGO1 0x100b3310
|
// FUNCTION: LEGO1 0x100b3310
|
||||||
MxFlcPresenter::MxFlcPresenter()
|
MxFlcPresenter::MxFlcPresenter()
|
||||||
{
|
{
|
||||||
this->m_flcHeader = NULL;
|
m_flcHeader = NULL;
|
||||||
this->m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
this->m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b3420
|
// FUNCTION: LEGO1 0x100b3420
|
||||||
|
@@ -20,8 +20,8 @@ MxLoopingFlcPresenter::~MxLoopingFlcPresenter()
|
|||||||
void MxLoopingFlcPresenter::Init()
|
void MxLoopingFlcPresenter::Init()
|
||||||
{
|
{
|
||||||
this->m_elapsedDuration = 0;
|
this->m_elapsedDuration = 0;
|
||||||
this->m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
this->m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b4430
|
// FUNCTION: LEGO1 0x100b4430
|
||||||
|
@@ -20,9 +20,9 @@ MxLoopingSmkPresenter::~MxLoopingSmkPresenter()
|
|||||||
// FUNCTION: LEGO1 0x100b49b0
|
// FUNCTION: LEGO1 0x100b49b0
|
||||||
void MxLoopingSmkPresenter::Init()
|
void MxLoopingSmkPresenter::Init()
|
||||||
{
|
{
|
||||||
this->m_elapsedDuration = 0;
|
m_elapsedDuration = 0;
|
||||||
this->m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
this->m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b49d0
|
// FUNCTION: LEGO1 0x100b49d0
|
||||||
|
@@ -23,8 +23,8 @@ void MxSmkPresenter::Init()
|
|||||||
{
|
{
|
||||||
m_currentFrame = 0;
|
m_currentFrame = 0;
|
||||||
memset(&m_mxSmack, 0, sizeof(m_mxSmack));
|
memset(&m_mxSmack, 0, sizeof(m_mxSmack));
|
||||||
m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b3900
|
// FUNCTION: LEGO1 0x100b3900
|
||||||
|
@@ -75,12 +75,12 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||||||
MxRect32 rect(x, y, width + x, height + y);
|
MxRect32 rect(x, y, width + x, height + y);
|
||||||
MVideoManager()->InvalidateRect(rect);
|
MVideoManager()->InvalidateRect(rect);
|
||||||
|
|
||||||
if (m_flags & c_bit2) {
|
if (GetBit1()) {
|
||||||
undefined4 und = 0;
|
undefined4 und = 0;
|
||||||
m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44(
|
m_unk0x58 = MxOmni::GetInstance()->GetVideoManager()->GetDisplaySurface()->VTable0x44(
|
||||||
m_bitmap,
|
m_bitmap,
|
||||||
&und,
|
&und,
|
||||||
(m_flags & c_bit4) / 8,
|
GetBit3(),
|
||||||
m_action->GetFlags() & MxDSAction::c_bit4
|
m_action->GetFlags() & MxDSAction::c_bit4
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -91,9 +91,9 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||||||
m_bitmap = NULL;
|
m_bitmap = NULL;
|
||||||
|
|
||||||
if (m_unk0x58 && und)
|
if (m_unk0x58 && und)
|
||||||
m_flags |= c_bit3;
|
SetBit2(TRUE);
|
||||||
else
|
else
|
||||||
m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ void MxStillPresenter::ParseExtra()
|
|||||||
MxPresenter::ParseExtra();
|
MxPresenter::ParseExtra();
|
||||||
|
|
||||||
if (m_action->GetFlags() & MxDSAction::c_bit5)
|
if (m_action->GetFlags() & MxDSAction::c_bit5)
|
||||||
m_flags |= c_bit4;
|
SetBit3(TRUE);
|
||||||
|
|
||||||
MxU32 len = m_action->GetExtraLength();
|
MxU32 len = m_action->GetExtraLength();
|
||||||
|
|
||||||
@@ -207,15 +207,52 @@ void MxStillPresenter::ParseExtra()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (KeyValueStringParse(output, g_strBmpIsmap, buf)) {
|
if (KeyValueStringParse(output, g_strBmpIsmap, buf)) {
|
||||||
m_flags |= c_bit5;
|
SetBit4(TRUE);
|
||||||
m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100ba2c0
|
// FUNCTION: LEGO1 0x100ba2c0
|
||||||
MxStillPresenter* MxStillPresenter::Clone()
|
MxStillPresenter* MxStillPresenter::Clone()
|
||||||
{
|
{
|
||||||
// TODO
|
MxResult result = FAILURE;
|
||||||
return NULL;
|
MxStillPresenter* presenter = new MxStillPresenter;
|
||||||
|
|
||||||
|
if (presenter) {
|
||||||
|
if (presenter->AddToManager() == SUCCESS) {
|
||||||
|
MxDSAction* action = presenter->GetAction()->Clone();
|
||||||
|
|
||||||
|
if (action && presenter->StartAction(NULL, action) == SUCCESS) {
|
||||||
|
presenter->SetBit0(GetBit0());
|
||||||
|
presenter->SetBit1(GetBit1());
|
||||||
|
presenter->SetBit2(GetBit2());
|
||||||
|
presenter->SetBit3(GetBit3());
|
||||||
|
presenter->SetBit4(GetBit4());
|
||||||
|
|
||||||
|
if (m_bitmap) {
|
||||||
|
presenter->m_bitmap = new MxBitmap;
|
||||||
|
|
||||||
|
if (!presenter->m_bitmap || presenter->m_bitmap->ImportBitmap(m_bitmap) != SUCCESS)
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_unk0x58)
|
||||||
|
presenter->m_unk0x58 = MxDisplaySurface::FUN_100bbfb0(m_unk0x58);
|
||||||
|
|
||||||
|
if (m_alpha)
|
||||||
|
presenter->m_alpha = new MxVideoPresenter::AlphaMask(*m_alpha);
|
||||||
|
|
||||||
|
result = SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
if (result != SUCCESS) {
|
||||||
|
delete presenter;
|
||||||
|
presenter = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return presenter;
|
||||||
}
|
}
|
||||||
|
@@ -117,16 +117,16 @@ void MxVideoPresenter::Init()
|
|||||||
m_unk0x5c = 1;
|
m_unk0x5c = 1;
|
||||||
m_unk0x58 = NULL;
|
m_unk0x58 = NULL;
|
||||||
m_unk0x60 = -1;
|
m_unk0x60 = -1;
|
||||||
m_flags &= ~c_bit1;
|
SetBit0(FALSE);
|
||||||
|
|
||||||
if (MVideoManager() != NULL) {
|
if (MVideoManager() != NULL) {
|
||||||
MVideoManager();
|
MVideoManager();
|
||||||
m_flags |= c_bit2;
|
SetBit1(TRUE);
|
||||||
m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_flags &= ~c_bit4;
|
SetBit3(FALSE);
|
||||||
m_flags &= ~c_bit5;
|
SetBit4(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100b27b0
|
// FUNCTION: LEGO1 0x100b27b0
|
||||||
@@ -138,8 +138,8 @@ void MxVideoPresenter::Destroy(MxBool p_fromDestructor)
|
|||||||
if (m_unk0x58) {
|
if (m_unk0x58) {
|
||||||
m_unk0x58->Release();
|
m_unk0x58->Release();
|
||||||
m_unk0x58 = NULL;
|
m_unk0x58 = NULL;
|
||||||
m_flags &= ~c_bit2;
|
SetBit1(FALSE);
|
||||||
m_flags &= ~c_bit3;
|
SetBit2(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MVideoManager() && (m_alpha || m_bitmap)) {
|
if (MVideoManager() && (m_alpha || m_bitmap)) {
|
||||||
@@ -230,8 +230,7 @@ MxBool MxVideoPresenter::IsHit(MxS32 p_x, MxS32 p_y)
|
|||||||
pixel = m_bitmap->GetBmiStride() * height + m_bitmap->GetBitmapData();
|
pixel = m_bitmap->GetBmiStride() * height + m_bitmap->GetBitmapData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DECOMP: m_flags is 1 byte, so no enum here
|
if (GetBit4())
|
||||||
if (m_flags & 0x10)
|
|
||||||
return (MxBool) *pixel;
|
return (MxBool) *pixel;
|
||||||
|
|
||||||
if ((GetAction()->GetFlags() & MxDSAction::c_bit4) && *pixel == 0)
|
if ((GetAction()->GetFlags() & MxDSAction::c_bit4) && *pixel == 0)
|
||||||
@@ -429,13 +428,13 @@ void MxVideoPresenter::StreamingTickle()
|
|||||||
LoadFrame(m_currentChunk);
|
LoadFrame(m_currentChunk);
|
||||||
m_subscriber->DestroyChunk(m_currentChunk);
|
m_subscriber->DestroyChunk(m_currentChunk);
|
||||||
m_currentChunk = NULL;
|
m_currentChunk = NULL;
|
||||||
m_flags |= c_bit1;
|
SetBit0(TRUE);
|
||||||
|
|
||||||
if (m_currentTickleState != e_streaming)
|
if (m_currentTickleState != e_streaming)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_flags & c_bit1)
|
if (GetBit0())
|
||||||
m_unk0x5c = 5;
|
m_unk0x5c = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -467,13 +466,13 @@ void MxVideoPresenter::RepeatingTickle()
|
|||||||
|
|
||||||
LoadFrame(m_currentChunk);
|
LoadFrame(m_currentChunk);
|
||||||
m_currentChunk = NULL;
|
m_currentChunk = NULL;
|
||||||
m_flags |= c_bit1;
|
SetBit0(TRUE);
|
||||||
|
|
||||||
if (m_currentTickleState != e_repeating)
|
if (m_currentTickleState != e_repeating)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_flags & c_bit1)
|
if (GetBit0())
|
||||||
m_unk0x5c = 5;
|
m_unk0x5c = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user