mirror of
https://github.com/isledecomp/isle.git
synced 2025-03-27 23:20:32 -04:00
MxVideoPresenter functions (#187)
* mxvideopresenter * Update mxvideopresenter.cpp * use inline getter for rectange width/height * Update mxvideopresenter.cpp * Match MxVideoPresenter::Destroy to ~88% --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
b95656a735
commit
3dee6eae7a
5 changed files with 94 additions and 30 deletions
|
@ -17,6 +17,16 @@ public:
|
|||
MxS32 m_top;
|
||||
MxS32 m_right;
|
||||
MxS32 m_bottom;
|
||||
|
||||
inline MxS32 GetWidth()
|
||||
{
|
||||
return (m_right - m_left) + 1;
|
||||
}
|
||||
|
||||
inline MxS32 GetHeight()
|
||||
{
|
||||
return (m_bottom - m_top) + 1;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MXRECT32_H
|
||||
|
|
|
@ -298,3 +298,9 @@ done:
|
|||
|
||||
return status;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100be270
|
||||
void MxVideoManager::vtable0x34(MxU32 p_x, MxU32 p_y, MxU32 p_width, MxU32 p_height)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "mxregion.h"
|
||||
#include "mxmediamanager.h"
|
||||
#include "mxvideoparam.h"
|
||||
#include "mxrect32.h"
|
||||
|
||||
// VTABLE 0x100dc810
|
||||
// SIZE 0x64
|
||||
|
@ -29,6 +30,7 @@ public:
|
|||
|
||||
__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);
|
||||
|
||||
MxVideoManager();
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#include "mxvideopresenter.h"
|
||||
#include "MxVideoManager.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxVideoPresenter, 0x64);
|
||||
DECOMP_SIZE_ASSERT(MxVideoPresenter::UnkStruct, 0xc);
|
||||
|
||||
// OFFSET: LEGO1 0x1000c700 STUB
|
||||
void MxVideoPresenter::VTable0x5c()
|
||||
// OFFSET: LEGO1 0x1000c700
|
||||
void MxVideoPresenter::VTable0x5c(undefined4 p_unknown1)
|
||||
{
|
||||
// TODO
|
||||
// Empty
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c710
|
||||
|
@ -14,16 +16,16 @@ void MxVideoPresenter::VTable0x60()
|
|||
// Empty
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c720 STUB
|
||||
void MxVideoPresenter::VTable0x68()
|
||||
// OFFSET: LEGO1 0x1000c720
|
||||
void MxVideoPresenter::VTable0x68(undefined4 p_unknown1)
|
||||
{
|
||||
// TODO
|
||||
// Empty
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c730 STUB
|
||||
// OFFSET: LEGO1 0x1000c730
|
||||
void MxVideoPresenter::VTable0x70()
|
||||
{
|
||||
// TODO
|
||||
// Empty
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c740
|
||||
|
@ -32,16 +34,16 @@ MxVideoPresenter::~MxVideoPresenter()
|
|||
Destroy(TRUE);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c7a0 STUB
|
||||
// OFFSET: LEGO1 0x1000c7a0
|
||||
void MxVideoPresenter::Destroy()
|
||||
{
|
||||
// TODO
|
||||
Destroy(FALSE);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c7b0 STUB
|
||||
void MxVideoPresenter::VTable0x78()
|
||||
// OFFSET: LEGO1 0x1000c7b0
|
||||
LPDIRECTDRAWSURFACE MxVideoPresenter::VTable0x78()
|
||||
{
|
||||
// TODO
|
||||
return m_unk58;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x1000c7c0
|
||||
|
@ -64,16 +66,58 @@ MxS32 MxVideoPresenter::GetHeight()
|
|||
: m_bitmap->GetBmiHeader()->biHeight;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b2760 STUB
|
||||
// OFFSET: LEGO1 0x100b2760
|
||||
void MxVideoPresenter::Init()
|
||||
{
|
||||
// TODO
|
||||
m_bitmap = NULL;
|
||||
m_unk54 = NULL;
|
||||
m_unk5c = 1;
|
||||
m_unk58 = NULL;
|
||||
m_unk60 = -1;
|
||||
m_flags = m_flags & 0xfe;
|
||||
|
||||
if (MVideoManager() != NULL) {
|
||||
MVideoManager();
|
||||
m_flags = m_flags | 2;
|
||||
m_flags = m_flags & 0xfb;
|
||||
}
|
||||
|
||||
m_flags = m_flags & 0xf7;
|
||||
m_flags = m_flags & 0xef;
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b27b0 STUB
|
||||
// OFFSET: LEGO1 0x100b27b0
|
||||
void MxVideoPresenter::Destroy(MxBool p_fromDestructor)
|
||||
{
|
||||
// TODO
|
||||
if (MVideoManager() != NULL)
|
||||
MVideoManager()->RemovePresenter(*this);
|
||||
|
||||
if (m_unk58) {
|
||||
m_unk58->Release();
|
||||
m_unk58 = NULL;
|
||||
m_flags = m_flags & 0xfd;
|
||||
m_flags = m_flags & 0xfb;
|
||||
}
|
||||
|
||||
if (MVideoManager() && (m_unk54 || m_bitmap)) {
|
||||
MxS32 height = GetHeight();
|
||||
MxS32 width = GetWidth();
|
||||
|
||||
MxS32 x = GetLocationX();
|
||||
MxS32 y = GetLocationY();
|
||||
MxRect32 rect(x, y, x + width, y + height);
|
||||
|
||||
MVideoManager()->InvalidateRect(rect);
|
||||
MVideoManager()->vtable0x34(rect.m_left, rect.m_top, rect.GetWidth(), rect.GetHeight());
|
||||
}
|
||||
|
||||
delete m_bitmap;
|
||||
delete m_unk54;
|
||||
|
||||
Init();
|
||||
|
||||
if (!p_fromDestructor)
|
||||
MxMediaPresenter::Destroy(FALSE);
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b28b0 STUB
|
||||
|
@ -88,8 +132,8 @@ void MxVideoPresenter::VTable0x6c()
|
|||
// TODO
|
||||
}
|
||||
|
||||
// OFFSET: LEGO1 0x100b3300 STUB
|
||||
void MxVideoPresenter::VTable0x74()
|
||||
// OFFSET: LEGO1 0x100b3300
|
||||
undefined MxVideoPresenter::VTable0x74()
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -35,32 +35,34 @@ public:
|
|||
|
||||
virtual void Destroy() override; // vtable+0x38
|
||||
|
||||
virtual void VTable0x5c(); // vtable+0x5c
|
||||
virtual void VTable0x5c(undefined4 p_unknown1); // vtable+0x5c
|
||||
virtual void VTable0x60(); // vtable+0x60
|
||||
virtual void VTable0x64(); // vtable+0x64
|
||||
virtual void VTable0x68(); // vtable+0x68
|
||||
virtual void VTable0x68(undefined4 p_unknown1); // vtable+0x68
|
||||
virtual void VTable0x6c(); // vtable+0x6c
|
||||
virtual void VTable0x70(); // vtable+0x70
|
||||
virtual void VTable0x74(); // vtable+0x74
|
||||
virtual void VTable0x78(); // vtable+0x78
|
||||
virtual undefined VTable0x74(); // vtable+0x74
|
||||
virtual LPDIRECTDRAWSURFACE VTable0x78(); // vtable+0x78
|
||||
virtual MxBool VTable0x7c(); // vtable+0x7c
|
||||
virtual MxS32 GetWidth(); // vtable+0x80
|
||||
virtual MxS32 GetHeight(); // vtable+0x84
|
||||
|
||||
// TODO: Not sure what this is. Seems to have size of 12 bytes
|
||||
// based on 0x100b9e9a. Values are copied from the bitmap header.
|
||||
typedef struct {
|
||||
undefined unk0[8];
|
||||
struct UnkStruct {
|
||||
undefined unk0[4];
|
||||
MxU16 width;
|
||||
MxU16 height;
|
||||
} unknown_meta_struct;
|
||||
|
||||
virtual ~UnkStruct() {}
|
||||
};
|
||||
|
||||
MxBitmap *m_bitmap;
|
||||
unknown_meta_struct *m_unk54;
|
||||
undefined4 m_unk58;
|
||||
UnkStruct *m_unk54;
|
||||
LPDIRECTDRAWSURFACE m_unk58;
|
||||
undefined2 m_unk5c;
|
||||
unsigned char m_flags; // 0x5e
|
||||
undefined4 m_unk60;
|
||||
MxLong m_unk60;
|
||||
};
|
||||
|
||||
#endif // MXVIDEOPRESENTER_H
|
||||
|
|
Loading…
Add table
Reference in a new issue