mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-03-14 00:39:50 -04:00
Implement/match most of MxStillPresenter (#309)
* Implement/match most of MxStillPresenter * Fix merge
This commit is contained in:
parent
260772e374
commit
1485e5df47
13 changed files with 101 additions and 48 deletions
|
@ -34,6 +34,7 @@ public:
|
|||
void CopyMediaSrcPath(const char* p_mediaSrcPath);
|
||||
|
||||
inline MxS32 GetMediaFormat() const { return this->m_mediaFormat; }
|
||||
inline MxS32 GetPaletteManagement() const { return this->m_paletteManagement; }
|
||||
inline MxLong GetSustainTime() const { return this->m_sustainTime; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -42,11 +42,9 @@ void MxFlcPresenter::CreateBitmap()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b3620
|
||||
void MxFlcPresenter::VTable0x70()
|
||||
void MxFlcPresenter::RealizePalette()
|
||||
{
|
||||
MxPalette* pal = m_bitmap->CreatePalette();
|
||||
MVideoManager()->RealizePalette(pal);
|
||||
|
||||
if (pal)
|
||||
delete pal;
|
||||
MxPalette* palette = m_bitmap->CreatePalette();
|
||||
MVideoManager()->RealizePalette(palette);
|
||||
delete palette;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
|
||||
virtual void LoadHeader(MxStreamChunk* p_chunk) override; // vtable+0x5c
|
||||
virtual void CreateBitmap() override; // vtable+0x60
|
||||
virtual void VTable0x70() override; // vtable+0x70
|
||||
virtual void RealizePalette() override; // vtable+0x70
|
||||
|
||||
protected:
|
||||
FLIC_HEADER* m_flicHeader;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "mxpoint32.h"
|
||||
#include "mxsize32.h"
|
||||
|
||||
// SIZE 0x10
|
||||
class MxRect32 {
|
||||
public:
|
||||
MxRect32() {}
|
||||
|
|
|
@ -85,7 +85,7 @@ MxU32 MxSmkPresenter::VTable0x88()
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100b42c0
|
||||
void MxSmkPresenter::VTable0x70()
|
||||
void MxSmkPresenter::RealizePalette()
|
||||
{
|
||||
MxPalette* palette = m_bitmap->CreatePalette();
|
||||
MVideoManager()->RealizePalette(palette);
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
virtual void LoadHeader(MxStreamChunk* p_chunk) override; // vtable+0x5c
|
||||
virtual void CreateBitmap() override; // vtable+0x60
|
||||
virtual void LoadFrame(MxStreamChunk* p_chunk) override; // vtable+0x68
|
||||
virtual void VTable0x70() override; // vtable+0x70
|
||||
virtual void RealizePalette() override; // vtable+0x70
|
||||
virtual MxU32 VTable0x88(); // vtable+0x88
|
||||
|
||||
struct MxSmack {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include "decomp.h"
|
||||
#include "define.h"
|
||||
#include "legoomni.h"
|
||||
#include "mxcompositepresenter.h"
|
||||
#include "mxdsmediaaction.h"
|
||||
#include "mxomni.h"
|
||||
#include "mxvideomanager.h"
|
||||
|
||||
|
@ -83,8 +85,8 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||
|
||||
MxS32 height = GetHeight() - 1;
|
||||
MxS32 width = GetWidth() - 1;
|
||||
MxS32 x = GetLocationX();
|
||||
MxS32 y = GetLocationY();
|
||||
MxS32 x = m_location.m_x;
|
||||
MxS32 y = m_location.m_y;
|
||||
|
||||
MxRect32 rect(x, y, width + x, height + y);
|
||||
MVideoManager()->InvalidateRect(rect);
|
||||
|
@ -98,12 +100,10 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||
m_action->GetFlags() & MxDSAction::Flag_Bit4
|
||||
);
|
||||
|
||||
if (m_alpha)
|
||||
delete m_alpha;
|
||||
delete m_alpha;
|
||||
m_alpha = new AlphaMask(*m_bitmap);
|
||||
|
||||
if (m_bitmap)
|
||||
delete m_bitmap;
|
||||
delete m_bitmap;
|
||||
m_bitmap = NULL;
|
||||
|
||||
if (m_unk58 && unk)
|
||||
|
@ -113,40 +113,88 @@ void MxStillPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100b9f30
|
||||
void MxStillPresenter::VTable0x70()
|
||||
// FUNCTION: LEGO1 0x100b9f30
|
||||
void MxStillPresenter::RealizePalette()
|
||||
{
|
||||
// TODO
|
||||
MxPalette* palette = m_bitmap->CreatePalette();
|
||||
MVideoManager()->RealizePalette(palette);
|
||||
delete palette;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100b9f60
|
||||
// FUNCTION: LEGO1 0x100b9f60
|
||||
void MxStillPresenter::StartingTickle()
|
||||
{
|
||||
// TODO
|
||||
MxVideoPresenter::StartingTickle();
|
||||
|
||||
if (m_currentTickleState == TickleState_Streaming && ((MxDSMediaAction*) m_action)->GetPaletteManagement())
|
||||
RealizePalette();
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100b9f90
|
||||
// FUNCTION: LEGO1 0x100b9f90
|
||||
void MxStillPresenter::StreamingTickle()
|
||||
{
|
||||
// TODO
|
||||
MxStreamChunk* chunk = FUN_100b5650();
|
||||
|
||||
if (chunk && m_action->GetElapsedTime() >= chunk->GetTime()) {
|
||||
m_chunkTime = chunk->GetTime();
|
||||
NextFrame();
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_Repeating;
|
||||
|
||||
if (m_action->GetDuration() == -1 && m_compositePresenter)
|
||||
m_compositePresenter->VTable0x60(this);
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100b9ff0
|
||||
// FUNCTION: LEGO1 0x100b9ff0
|
||||
void MxStillPresenter::RepeatingTickle()
|
||||
{
|
||||
// TODO
|
||||
if (m_action->GetDuration() != -1) {
|
||||
if (m_action->GetElapsedTime() >= m_action->GetStartTime() + m_action->GetDuration()) {
|
||||
m_previousTickleStates |= 1 << (unsigned char) m_currentTickleState;
|
||||
m_currentTickleState = TickleState_unk5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100ba040
|
||||
void MxStillPresenter::VTable0x88(undefined4, undefined4)
|
||||
// FUNCTION: LEGO1 0x100ba040
|
||||
void MxStillPresenter::VTable0x88(MxS32 p_x, MxS32 p_y)
|
||||
{
|
||||
// TODO
|
||||
MxS32 x = m_location.m_x;
|
||||
MxS32 y = m_location.m_y;
|
||||
m_location.m_x = p_x;
|
||||
m_location.m_y = p_y;
|
||||
|
||||
if (IsEnabled()) {
|
||||
MxS32 height = GetHeight() - 1;
|
||||
MxS32 width = GetWidth() - 1;
|
||||
|
||||
MxRect32 rect_a(x, y, width + x, height + y);
|
||||
MxRect32 rect_b(m_location.m_x, m_location.m_y, width + m_location.m_x, height + m_location.m_y);
|
||||
|
||||
MVideoManager()->InvalidateRect(rect_a);
|
||||
MVideoManager()->vtable0x34(rect_a.GetLeft(), rect_a.GetTop(), rect_a.GetWidth(), rect_a.GetHeight());
|
||||
|
||||
MVideoManager()->InvalidateRect(rect_b);
|
||||
MVideoManager()->vtable0x34(rect_b.GetLeft(), rect_b.GetTop(), rect_b.GetWidth(), rect_b.GetHeight());
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100ba140
|
||||
// FUNCTION: LEGO1 0x100ba140
|
||||
void MxStillPresenter::Enable(MxBool p_enable)
|
||||
{
|
||||
// TODO
|
||||
MxVideoPresenter::Enable(p_enable);
|
||||
|
||||
if (MVideoManager() && (m_alpha || m_bitmap)) {
|
||||
MxS32 height = GetHeight();
|
||||
MxS32 width = GetWidth();
|
||||
MxS32 x = m_location.m_x;
|
||||
MxS32 y = m_location.m_y;
|
||||
|
||||
MxRect32 rect(x, y, width + x, height + y);
|
||||
MVideoManager()->InvalidateRect(rect);
|
||||
MVideoManager()->vtable0x34(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight());
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100ba1e0
|
||||
|
|
|
@ -32,14 +32,14 @@ public:
|
|||
virtual void CreateBitmap() override; // vtable+0x60
|
||||
virtual void NextFrame() override; // vtable+0x64
|
||||
virtual void LoadFrame(MxStreamChunk* p_chunk) override; // vtable+0x68
|
||||
virtual void VTable0x70() override; // vtable+0x70
|
||||
virtual void VTable0x88(undefined4, undefined4); // vtable+0x88
|
||||
virtual void RealizePalette() override; // vtable+0x70
|
||||
virtual void VTable0x88(MxS32 p_x, MxS32 p_y); // vtable+0x88
|
||||
virtual MxStillPresenter* Clone(); // vtable+0x8c
|
||||
|
||||
private:
|
||||
void Destroy(MxBool p_fromDestructor);
|
||||
|
||||
undefined4 m_unk64; // 0x64
|
||||
MxLong m_chunkTime; // 0x64
|
||||
MxBITMAPINFO* m_bitmapInfo; // 0x68
|
||||
};
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ public:
|
|||
virtual MxResult Create(MxVideoParam& p_videoParam, MxU32 p_frequencyMS, MxBool p_createThread); // vtable+0x2c
|
||||
|
||||
__declspec(dllexport) void InvalidateRect(MxRect32&);
|
||||
__declspec(dllexport) virtual MxResult RealizePalette(MxPalette*); // vtable+0x30
|
||||
virtual void vtable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height);
|
||||
__declspec(dllexport) virtual MxResult RealizePalette(MxPalette*); // vtable+0x30
|
||||
virtual void vtable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height); // vtable+0x34
|
||||
|
||||
MxResult Init();
|
||||
void Destroy(MxBool p_fromDestructor);
|
||||
|
@ -42,12 +42,12 @@ public:
|
|||
inline MxDisplaySurface* GetDisplaySurface() { return this->m_displaySurface; }
|
||||
|
||||
protected:
|
||||
MxVideoParam m_videoParam;
|
||||
LPDIRECTDRAW m_pDirectDraw;
|
||||
LPDIRECTDRAWSURFACE m_pDDSurface;
|
||||
MxDisplaySurface* m_displaySurface;
|
||||
MxRegion* m_region;
|
||||
MxBool m_unk60;
|
||||
MxVideoParam m_videoParam; // 0x2c
|
||||
LPDIRECTDRAW m_pDirectDraw; // 0x50
|
||||
LPDIRECTDRAWSURFACE m_pDDSurface; // 0x54
|
||||
MxDisplaySurface* m_displaySurface; // 0x58
|
||||
MxRegion* m_region; // 0x5c
|
||||
MxBool m_unk60; // 0x60
|
||||
};
|
||||
|
||||
#endif // MXVIDEOMANAGER_H
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
#include "mxvideoparam.h"
|
||||
|
||||
#include "decomp.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxVideoParam, 0x24);
|
||||
|
||||
// FUNCTION: LEGO1 0x100bec70
|
||||
MxVideoParam::MxVideoParam()
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <ddraw.h>
|
||||
|
||||
// SIZE 0x24
|
||||
class MxVideoParam {
|
||||
public:
|
||||
__declspec(dllexport) MxVideoParam();
|
||||
|
@ -31,12 +32,12 @@ public:
|
|||
inline MxU32 GetBackBuffers() { return this->m_backBuffers; }
|
||||
|
||||
private:
|
||||
MxRect32 m_rect;
|
||||
MxPalette* m_palette;
|
||||
MxU32 m_backBuffers;
|
||||
MxVideoParamFlags m_flags;
|
||||
int m_unk1c;
|
||||
char* m_deviceId;
|
||||
MxRect32 m_rect; // 0x00
|
||||
MxPalette* m_palette; // 0x10
|
||||
MxU32 m_backBuffers; // 0x14
|
||||
MxVideoParamFlags m_flags; // 0x18
|
||||
int m_unk1c; // 0x1c
|
||||
char* m_deviceId; // 0x20
|
||||
};
|
||||
|
||||
#endif // MXVIDEOPARAM_H
|
||||
|
|
|
@ -26,7 +26,7 @@ void MxVideoPresenter::LoadFrame(MxStreamChunk* p_chunk)
|
|||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x1000c730
|
||||
void MxVideoPresenter::VTable0x70()
|
||||
void MxVideoPresenter::RealizePalette()
|
||||
{
|
||||
// Empty
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
virtual void NextFrame(); // vtable+0x64
|
||||
virtual void LoadFrame(MxStreamChunk* p_chunk); // vtable+0x68
|
||||
virtual void VTable0x6c(); // vtable+0x6c
|
||||
virtual void VTable0x70(); // vtable+0x70
|
||||
virtual void RealizePalette(); // vtable+0x70
|
||||
virtual undefined VTable0x74(); // vtable+0x74
|
||||
virtual LPDIRECTDRAWSURFACE VTable0x78(); // vtable+0x78
|
||||
virtual MxBool VTable0x7c(); // vtable+0x7c
|
||||
|
|
Loading…
Reference in a new issue