Isle
Loading...
Searching...
No Matches
mxvideopresenter.h
Go to the documentation of this file.
1#ifndef MXVIDEOPRESENTER_H
2#define MXVIDEOPRESENTER_H
3
4#include "decomp.h"
5#include "mxbitmap.h"
6#include "mxgeometry.h"
7#include "mxmediapresenter.h"
8
9#include <ddraw.h>
10
11// VTABLE: LEGO1 0x100d4be8
12// SIZE 0x64
13
19public:
24 MxVideoPresenter() { Init(); }
25
31 virtual void LoadHeader(MxStreamChunk* p_chunk) {} // vtable+0x5c
32
37 virtual void CreateBitmap() {} // vtable+0x60
38
43 virtual void NextFrame(); // vtable+0x64
44
50 virtual void LoadFrame(MxStreamChunk* p_chunk) {} // vtable+0x68
51
56 virtual void PutFrame(); // vtable+0x6c
57
62 virtual void RealizePalette() {} // vtable+0x70
63
68 virtual undefined VTable0x74(); // vtable+0x74
69
74 ~MxVideoPresenter() override { Destroy(TRUE); } // vtable+0x00
75
80 void Destroy() override { Destroy(FALSE); } // vtable+0x38
81
87 virtual LPDIRECTDRAWSURFACE VTable0x78() { return m_unk0x58; } // vtable+0x78
88
94 virtual MxBool VTable0x7c() { return m_frameBitmap != NULL || m_alpha != NULL; } // vtable+0x7c
95
100 virtual MxS32 GetWidth() { return m_alpha ? m_alpha->GetWidth() : m_frameBitmap->GetBmiWidth(); } // vtable+0x80
101
106 virtual MxS32 GetHeight()
107 {
109 } // vtable+0x84
110
115 static const char* HandlerClassName()
116 {
117 // STRING: LEGO1 0x100f0760
118 return "MxVideoPresenter";
119 }
120
125 const char* ClassName() const override // vtable+0x0c
126 {
127 return HandlerClassName();
128 }
129
136 MxBool IsA(const char* p_name) const override // vtable+0x10
137 {
138 return !strcmp(p_name, MxVideoPresenter::ClassName()) || MxMediaPresenter::IsA(p_name);
139 }
140
145 void ReadyTickle() override; // vtable+0x18
146
151 void StartingTickle() override; // vtable+0x1c
152
157 void StreamingTickle() override; // vtable+0x20
158
163 void RepeatingTickle() override; // vtable+0x24
164
169 void FreezingTickle() override; // vtable+0x28
170
176 MxResult AddToManager() override; // vtable+0x34
177
182 void EndAction() override; // vtable+0x40
183
188 MxResult PutData() override; // vtable+0x4c
189
197 MxBool IsHit(MxS32 p_x, MxS32 p_y) override; // vtable+0x50
198
199 // VTABLE: LEGO1 0x100dc2bc
200 // SIZE 0x0c
205 class AlphaMask {
206 public:
211 AlphaMask(const MxBitmap&);
212
217 AlphaMask(const AlphaMask&);
218
223 virtual ~AlphaMask();
224
232 MxS32 IsHit(MxU32 p_x, MxU32 p_y);
233
237 MxS32 GetWidth() const { return m_width; }
241 MxS32 GetHeight() const { return m_height; }
242
243 private:
244 MxU8* m_bitmask;
245 MxU16 m_width;
246 MxU16 m_height;
247 };
248
256 inline MxS32 PrepareRects(RECT& p_rectDest, RECT& p_rectSrc);
257
263
269
277 MxU8* GetBitmapStart(MxS32 p_left, MxS32 p_top) { return m_frameBitmap->GetStart(p_left, p_top); }
278
284 void SetBit0(BOOL p_e) { m_flags.m_bit0 = p_e; }
285 void SetBit1(BOOL p_e) { m_flags.m_bit1 = p_e; }
286 void SetBit2(BOOL p_e) { m_flags.m_bit2 = p_e; }
287 void SetBit3(BOOL p_e) { m_flags.m_bit3 = p_e; }
288 void SetBit4(BOOL p_e) { m_flags.m_bit4 = p_e; }
289
294 BYTE GetBit0() { return m_flags.m_bit0; }
295 BYTE GetBit1() { return m_flags.m_bit1; }
296 BYTE GetBit2() { return m_flags.m_bit2; }
297 BYTE GetBit3() { return m_flags.m_bit3; }
298 BYTE GetBit4() { return m_flags.m_bit4; }
299
300private:
305 void Init();
306
307protected:
313 void Destroy(MxBool p_fromDestructor);
314
321};
322
323#endif // MXVIDEOPRESENTER_H
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bit...
Definition: mxbitmap.h:55
MxLong GetBmiHeightAbs() const
[AI] Returns the absolute value of the bitmap's height.
Definition: mxbitmap.h:242
MxU8 * GetStart(MxS32 p_left, MxS32 p_top) const
[AI] Returns a pointer to the starting address of the pixel data at the specified coordinates.
Definition: mxbitmap.h:288
MxLong GetBmiWidth() const
[AI] Fetches the width (in pixels) encoded in this bitmap's header.
Definition: mxbitmap.h:224
[AI] Abstract base class for presenters that play back continuous media streams such as video or audi...
MxBool IsA(const char *p_name) const override
[AI] Returns TRUE if the provided class name matches this class or any of its parents.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
Opaque mask used for efficient hit testing against video transparency.
MxS32 IsHit(MxU32 p_x, MxU32 p_y)
Checks whether the specified local coordinate is visible in the mask.
MxS32 GetHeight() const
[AI] Height of the alpha mask in pixels.
MxS32 GetWidth() const
[AI] Width of the alpha mask in pixels.
virtual ~AlphaMask()
Frees the bitmask memory.
Derived video presenter responsible for displaying video frames using DirectDraw surfaces.
virtual void LoadHeader(MxStreamChunk *p_chunk)
Loads and processes header information from a video stream chunk.
MxBool IsHit(MxS32 p_x, MxS32 p_y) override
Determines if a point is inside the non-transparent region of frame/alpha.
MxBitmap * GetBitmap()
Returns the frame bitmap currently used for this presenter.
BYTE GetBit0()
Gets internal miscellaneous state flags (bits 0-4).
virtual MxBool VTable0x7c()
Checks if this presenter has either a video frame bitmap or alpha mask available.
void StartingTickle() override
Advance logic for the "starting" tickle state (frame setup).
const char * ClassName() const override
Returns the run-time class name of this presenter instance.
void FreezingTickle() override
Advance logic for the "freezing" tickle state (sustain after playback).
void SetBit2(BOOL p_e)
MxS32 PrepareRects(RECT &p_rectDest, RECT &p_rectSrc)
Utility function to adjust source/dest rectangles to stay within allowed bounds.
MxBitmap * m_frameBitmap
Bitmap for current video frame. [AI].
virtual MxS32 GetHeight()
Returns the height of the current bitmap or alpha mask in pixels.
void ReadyTickle() override
Advance logic for the "ready" tickle state.
virtual MxS32 GetWidth()
Returns the width of the current bitmap or alpha mask in pixels.
void EndAction() override
Signals the end of the current playback action.
virtual undefined VTable0x74()
Unknown/potentially format-specific method (VTable0x74).
virtual void RealizePalette()
Loads or establishes the palette for display from the current video format or media.
MxLong m_unk0x60
Last freeze time/start of sustain interval. [AI].
void SetBit3(BOOL p_e)
FlagBitfield m_flags
Miscellaneous flags for object and UI state. [AI].
~MxVideoPresenter() override
Destroys the MxVideoPresenter, releasing owned resources and unregistering from the manager.
virtual void NextFrame()
Advances video playback to the next frame, handling decoding and playback progression.
virtual void CreateBitmap()
Allocates and sets up the display bitmap for video frame data.
AlphaMask * GetAlphaMask()
Returns this presenter's alpha mask for hit testing.
void SetBit0(BOOL p_e)
Sets internal miscellaneous state flags.
static const char * HandlerClassName()
Returns the class name string for this presenter type.
MxBool IsA(const char *p_name) const override
Determines if this object is or derives from a class with the given name.
LPDIRECTDRAWSURFACE m_unk0x58
DirectDraw surface for hardware video rendering. [AI].
void StreamingTickle() override
Advance logic for the "streaming" tickle state (typical video playback).
virtual void PutFrame()
Presents the current frame using the chosen output mechanism (e.g., blitting to screen).
void SetBit1(BOOL p_e)
virtual void LoadFrame(MxStreamChunk *p_chunk)
Loads and processes frame data from a video stream chunk.
MxS16 m_unk0x5c
Loop/advance/frame decode counter. [AI].
virtual LPDIRECTDRAWSURFACE VTable0x78()
Retrieves the DirectDraw surface used for hardware-accelerated rendering.
void RepeatingTickle() override
Advance logic for the "repeating" tickle state (media looping).
MxResult PutData() override
Writes the frame to the display device if appropriate.
MxU8 * GetBitmapStart(MxS32 p_left, MxS32 p_top)
Provides a pointer to the start of frame bitmap data at a given coordinate.
AlphaMask * m_alpha
Alpha mask for hit testing. May be null. [AI].
MxVideoPresenter()
Constructs a new MxVideoPresenter and initializes internal state.
MxResult AddToManager() override
Adds this presenter to the global video manager.
void Destroy() override
Destroys internal resources for the presenter.
void SetBit4(BOOL p_e)
#define override
Definition: compat.h:21
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
struct IDirectDrawSurface FAR * LPDIRECTDRAWSURFACE
Definition: ddraw.h:74
unsigned char undefined
Definition: decomp.h:26
typedef BOOL(FAR PASCAL *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
[AI] Union that provides a convenient bit field view of a byte for flag manipulation.
Definition: mxtypes.h:169
MxU8 m_bit0
[AI] Least significant bit of the flag byte.
Definition: mxtypes.h:171
MxU8 m_bit4
[AI]
Definition: mxtypes.h:175
MxU8 m_bit3
[AI]
Definition: mxtypes.h:174
MxU8 m_bit2
[AI]
Definition: mxtypes.h:173
MxU8 m_bit1
[AI]
Definition: mxtypes.h:172