isle/LEGO1/omni/include/mxvideopresenter.h

135 lines
3.9 KiB
C
Raw Normal View History

#ifndef MXVIDEOPRESENTER_H
#define MXVIDEOPRESENTER_H
Implement MxObjectFactory::{MxObjectFactory,Create} + match sizes of Mx.*Presenter objects created by it (#59) * Get Isle building on MinGW32 (#63) * Add MxUnknown100dc6b0::~MxUnknown100dc6b0 stub * Declare destructor of MxOmni and MxTransitionManager in class * inline attribute must go first * Stub LegoState::Vtable0x14 for Act3State * MxStreamer::VTable0x14 is not an override * Stub MxEntity::Destroy for LegoState::Destroy * Stub MxUnknown100dc6e0 for MxSoundManager * ::ClassName and ::IsA are const methods * methods in the class body don't need a namespace * MxSoundManager subclasses MxUnknown100dc6e0 * LegoInputManager subclasses MxPresenter * NotificationId is an enum, and does not need __declspec(dllexport) * Fix final #endif of legoomni.h and mxobjectfactory.h * Add const alternative for LegoOmni::Create and MxVideoParam, only available for MinGW * Alternative approach to MinGW compatibility * MinGW on Linux is case sensitve * Don't delete a member variable. C++ automatically destructs member variables --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> * MxatomId: implement inline operator== * Add decomp.h header, containing macro's only used when matching the original binaries * Add in-line constructor of MxPresenter * MxMediaPresenter: add members to match size * MxVideoPresenter: add members to match size * MxCompositePresenter: add members to match size * MxFlcPresenter: add members to match size * MxSmkPresenter: add members to match size * MxStillPresenter: add members to match size * MxAudioPresenter: add members to match size * MxWavePresenter: add members to match size * MxMIDIPresenter: add members to match size * MxEventPresenter: add members to match size * MxLoopingFlcPresenter: add members to match size * MxLoopingSmkPresenter: add members to match size * MxLoopingMIDIPresenter: add check for size * Implement MxObjectFactory::{MxObjectFactory,Create} Matching of MxObjectFactory::Create is not good, because none of the other objects have been implemented. * Implement a few MxPresenter methods * Fix size of LegoInputManager * Fix name of first padding member of legoinputmanager.h * add DECOMP_SIZE_ASSERT macro * Use DECOMP_SIZE_ASSERT macro + convert to hexadecimal * fixed minor typos --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> Co-authored-by: itsmattkc <itsmattkc@gmail.com>
2023-07-02 03:00:28 -04:00
#include "decomp.h"
2023-10-24 19:38:27 -04:00
#include "mxbitmap.h"
#include "mxmediapresenter.h"
#include "mxrect32.h"
Implement MxObjectFactory::{MxObjectFactory,Create} + match sizes of Mx.*Presenter objects created by it (#59) * Get Isle building on MinGW32 (#63) * Add MxUnknown100dc6b0::~MxUnknown100dc6b0 stub * Declare destructor of MxOmni and MxTransitionManager in class * inline attribute must go first * Stub LegoState::Vtable0x14 for Act3State * MxStreamer::VTable0x14 is not an override * Stub MxEntity::Destroy for LegoState::Destroy * Stub MxUnknown100dc6e0 for MxSoundManager * ::ClassName and ::IsA are const methods * methods in the class body don't need a namespace * MxSoundManager subclasses MxUnknown100dc6e0 * LegoInputManager subclasses MxPresenter * NotificationId is an enum, and does not need __declspec(dllexport) * Fix final #endif of legoomni.h and mxobjectfactory.h * Add const alternative for LegoOmni::Create and MxVideoParam, only available for MinGW * Alternative approach to MinGW compatibility * MinGW on Linux is case sensitve * Don't delete a member variable. C++ automatically destructs member variables --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> * MxatomId: implement inline operator== * Add decomp.h header, containing macro's only used when matching the original binaries * Add in-line constructor of MxPresenter * MxMediaPresenter: add members to match size * MxVideoPresenter: add members to match size * MxCompositePresenter: add members to match size * MxFlcPresenter: add members to match size * MxSmkPresenter: add members to match size * MxStillPresenter: add members to match size * MxAudioPresenter: add members to match size * MxWavePresenter: add members to match size * MxMIDIPresenter: add members to match size * MxEventPresenter: add members to match size * MxLoopingFlcPresenter: add members to match size * MxLoopingSmkPresenter: add members to match size * MxLoopingMIDIPresenter: add check for size * Implement MxObjectFactory::{MxObjectFactory,Create} Matching of MxObjectFactory::Create is not good, because none of the other objects have been implemented. * Implement a few MxPresenter methods * Fix size of LegoInputManager * Fix name of first padding member of legoinputmanager.h * add DECOMP_SIZE_ASSERT macro * Use DECOMP_SIZE_ASSERT macro + convert to hexadecimal * fixed minor typos --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> Co-authored-by: itsmattkc <itsmattkc@gmail.com>
2023-07-02 03:00:28 -04:00
#include <ddraw.h>
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// VTABLE: LEGO1 0x100d4be8
// SIZE 0x64
2023-10-24 19:38:27 -04:00
class MxVideoPresenter : public MxMediaPresenter {
public:
MxVideoPresenter() { Init(); }
// FUNCTION: LEGO1 0x1000c740
~MxVideoPresenter() override { Destroy(TRUE); } // vtable+0x00
// FUNCTION: BETA10 0x100551b0
static const char* HandlerClassName()
2023-10-24 19:38:27 -04:00
{
// STRING: LEGO1 0x100f0760
2023-10-24 19:38:27 -04:00
return "MxVideoPresenter";
}
// FUNCTION: LEGO1 0x1000c820
// FUNCTION: BETA10 0x10055180
inline const char* ClassName() const override // vtable+0x0c
{
return HandlerClassName();
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x1000c830
inline MxBool IsA(const char* p_name) const override // vtable+0x10
2023-10-24 19:38:27 -04:00
{
return !strcmp(p_name, MxVideoPresenter::ClassName()) || MxMediaPresenter::IsA(p_name);
2023-10-24 19:38:27 -04:00
}
Implement MxObjectFactory::{MxObjectFactory,Create} + match sizes of Mx.*Presenter objects created by it (#59) * Get Isle building on MinGW32 (#63) * Add MxUnknown100dc6b0::~MxUnknown100dc6b0 stub * Declare destructor of MxOmni and MxTransitionManager in class * inline attribute must go first * Stub LegoState::Vtable0x14 for Act3State * MxStreamer::VTable0x14 is not an override * Stub MxEntity::Destroy for LegoState::Destroy * Stub MxUnknown100dc6e0 for MxSoundManager * ::ClassName and ::IsA are const methods * methods in the class body don't need a namespace * MxSoundManager subclasses MxUnknown100dc6e0 * LegoInputManager subclasses MxPresenter * NotificationId is an enum, and does not need __declspec(dllexport) * Fix final #endif of legoomni.h and mxobjectfactory.h * Add const alternative for LegoOmni::Create and MxVideoParam, only available for MinGW * Alternative approach to MinGW compatibility * MinGW on Linux is case sensitve * Don't delete a member variable. C++ automatically destructs member variables --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> * MxatomId: implement inline operator== * Add decomp.h header, containing macro's only used when matching the original binaries * Add in-line constructor of MxPresenter * MxMediaPresenter: add members to match size * MxVideoPresenter: add members to match size * MxCompositePresenter: add members to match size * MxFlcPresenter: add members to match size * MxSmkPresenter: add members to match size * MxStillPresenter: add members to match size * MxAudioPresenter: add members to match size * MxWavePresenter: add members to match size * MxMIDIPresenter: add members to match size * MxEventPresenter: add members to match size * MxLoopingFlcPresenter: add members to match size * MxLoopingSmkPresenter: add members to match size * MxLoopingMIDIPresenter: add check for size * Implement MxObjectFactory::{MxObjectFactory,Create} Matching of MxObjectFactory::Create is not good, because none of the other objects have been implemented. * Implement a few MxPresenter methods * Fix size of LegoInputManager * Fix name of first padding member of legoinputmanager.h * add DECOMP_SIZE_ASSERT macro * Use DECOMP_SIZE_ASSERT macro + convert to hexadecimal * fixed minor typos --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> Co-authored-by: itsmattkc <itsmattkc@gmail.com>
2023-07-02 03:00:28 -04:00
void ReadyTickle() override; // vtable+0x18
void StartingTickle() override; // vtable+0x1c
void StreamingTickle() override; // vtable+0x20
void RepeatingTickle() override; // vtable+0x24
void FreezingTickle() override; // vtable+0x28
MxResult AddToManager() override; // vtable+0x34
// FUNCTION: LEGO1 0x1000c7a0
void Destroy() override { Destroy(FALSE); } // vtable+0x38
void EndAction() override; // vtable+0x40
MxResult PutData() override; // vtable+0x4c
MxBool IsHit(MxS32 p_x, MxS32 p_y) override; // vtable+0x50
// FUNCTION: LEGO1 0x1000c700
2024-02-25 09:14:39 -05:00
virtual void LoadHeader(MxStreamChunk* p_chunk) {} // vtable+0x5c
// FUNCTION: LEGO1 0x1000c710
2024-02-25 09:14:39 -05:00
virtual void CreateBitmap() {} // vtable+0x60
virtual void NextFrame(); // vtable+0x64
// FUNCTION: LEGO1 0x1000c720
2024-02-25 09:14:39 -05:00
virtual void LoadFrame(MxStreamChunk* p_chunk) {} // vtable+0x68
virtual void PutFrame(); // vtable+0x6c
// FUNCTION: LEGO1 0x1000c730
2024-02-25 09:14:39 -05:00
virtual void RealizePalette() {} // vtable+0x70
2024-01-12 19:34:38 -05:00
virtual undefined VTable0x74(); // vtable+0x74
// FUNCTION: LEGO1 0x1000c7b0
virtual LPDIRECTDRAWSURFACE VTable0x78() { return m_unk0x58; } // vtable+0x78
// FUNCTION: LEGO1 0x1000c7c0
virtual MxBool VTable0x7c() { return m_frameBitmap != NULL || m_alpha != NULL; } // vtable+0x7c
// FUNCTION: LEGO1 0x1000c7e0
virtual MxS32 GetWidth() { return m_alpha ? m_alpha->m_width : m_frameBitmap->GetBmiWidth(); } // vtable+0x80
// FUNCTION: LEGO1 0x1000c800
virtual MxS32 GetHeight() { return m_alpha ? m_alpha->m_height : m_frameBitmap->GetBmiHeightAbs(); } // vtable+0x84
Implement MxObjectFactory::{MxObjectFactory,Create} + match sizes of Mx.*Presenter objects created by it (#59) * Get Isle building on MinGW32 (#63) * Add MxUnknown100dc6b0::~MxUnknown100dc6b0 stub * Declare destructor of MxOmni and MxTransitionManager in class * inline attribute must go first * Stub LegoState::Vtable0x14 for Act3State * MxStreamer::VTable0x14 is not an override * Stub MxEntity::Destroy for LegoState::Destroy * Stub MxUnknown100dc6e0 for MxSoundManager * ::ClassName and ::IsA are const methods * methods in the class body don't need a namespace * MxSoundManager subclasses MxUnknown100dc6e0 * LegoInputManager subclasses MxPresenter * NotificationId is an enum, and does not need __declspec(dllexport) * Fix final #endif of legoomni.h and mxobjectfactory.h * Add const alternative for LegoOmni::Create and MxVideoParam, only available for MinGW * Alternative approach to MinGW compatibility * MinGW on Linux is case sensitve * Don't delete a member variable. C++ automatically destructs member variables --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> * MxatomId: implement inline operator== * Add decomp.h header, containing macro's only used when matching the original binaries * Add in-line constructor of MxPresenter * MxMediaPresenter: add members to match size * MxVideoPresenter: add members to match size * MxCompositePresenter: add members to match size * MxFlcPresenter: add members to match size * MxSmkPresenter: add members to match size * MxStillPresenter: add members to match size * MxAudioPresenter: add members to match size * MxWavePresenter: add members to match size * MxMIDIPresenter: add members to match size * MxEventPresenter: add members to match size * MxLoopingFlcPresenter: add members to match size * MxLoopingSmkPresenter: add members to match size * MxLoopingMIDIPresenter: add check for size * Implement MxObjectFactory::{MxObjectFactory,Create} Matching of MxObjectFactory::Create is not good, because none of the other objects have been implemented. * Implement a few MxPresenter methods * Fix size of LegoInputManager * Fix name of first padding member of legoinputmanager.h * add DECOMP_SIZE_ASSERT macro * Use DECOMP_SIZE_ASSERT macro + convert to hexadecimal * fixed minor typos --------- Co-authored-by: MattKC <34096995+itsmattkc@users.noreply.github.com> Co-authored-by: itsmattkc <itsmattkc@gmail.com>
2023-07-02 03:00:28 -04:00
// VTABLE: LEGO1 0x100dc2bc
// SIZE 0x0c
2023-10-24 19:38:27 -04:00
struct AlphaMask {
MxU8* m_bitmask;
MxU16 m_width;
MxU16 m_height;
2023-10-24 19:38:27 -04:00
AlphaMask(const MxBitmap&);
AlphaMask(const AlphaMask&);
virtual ~AlphaMask();
MxS32 IsHit(MxU32 p_x, MxU32 p_y);
// SYNTHETIC: LEGO1 0x100b2650
// MxVideoPresenter::AlphaMask::`scalar deleting destructor'
2023-10-24 19:38:27 -04:00
};
inline MxS32 PrepareRects(RECT& p_rectDest, RECT& p_rectSrc);
inline MxBitmap* GetBitmap() { return m_frameBitmap; }
inline AlphaMask* GetAlphaMask() { return m_alpha; }
2023-11-25 14:08:10 -05:00
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
// MxVideoPresenter::`scalar deleting destructor'
2023-11-25 14:08:10 -05:00
private:
void Init();
protected:
void Destroy(MxBool p_fromDestructor);
MxBitmap* m_frameBitmap; // 0x50
AlphaMask* m_alpha; // 0x54
LPDIRECTDRAWSURFACE m_unk0x58; // 0x58
MxS16 m_unk0x5c; // 0x5c
FlagBitfield m_flags; // 0x5e
MxLong m_unk0x60; // 0x60
};
#endif // MXVIDEOPRESENTER_H