Isle
Loading...
Searching...
No Matches
mxflcpresenter.cpp
Go to the documentation of this file.
1#include "mxflcpresenter.h"
2
3#include "decomp.h"
4#include "mxbitmap.h"
5#include "mxdsmediaaction.h"
6#include "mxmisc.h"
7#include "mxpalette.h"
8#include "mxvideomanager.h"
9
11
12// FUNCTION: LEGO1 0x100b3310
14{
18}
19
20// FUNCTION: LEGO1 0x100b3420
22{
23 if (this->m_flcHeader) {
24 delete this->m_flcHeader;
25 }
26}
27
28// FUNCTION: LEGO1 0x100b3490
30{
31 m_flcHeader = (FLIC_HEADER*) new MxU8[p_chunk->GetLength()];
32 memcpy(m_flcHeader, p_chunk->GetData(), p_chunk->GetLength());
33}
34
35// FUNCTION: LEGO1 0x100b34d0
37{
38 if (m_frameBitmap) {
39 delete m_frameBitmap;
40 }
41
44}
45
46// FUNCTION: LEGO1 0x100b3570
47// FUNCTION: BETA10 0x1013a10f
49{
50 MxU8* data = p_chunk->GetData();
51
52 MxS32 rectCount = *(MxS32*) data;
53 data += sizeof(MxS32);
54
55 MxRect32* rects = (MxRect32*) data;
56 data += rectCount * sizeof(MxRect32);
57
58 MxBool decodedColorMap;
63 (FLIC_FRAME*) data,
64 &decodedColorMap
65 );
66
67 if (((MxDSMediaAction*) m_action)->GetPaletteManagement() && decodedColorMap) {
69 }
70
71 for (MxS32 i = 0; i < rectCount; i++) {
72 MxRect32 rect(rects[i]);
73 rect += m_location;
75 }
76}
77
78// FUNCTION: LEGO1 0x100b3620
80{
82 MVideoManager()->RealizePalette(palette);
83 delete palette;
84}
[AI] Represents an 8bpp or high color device-independent bitmap (DIB) and provides operations for bit...
Definition: mxbitmap.h:55
MxBITMAPINFO * GetBitmapInfo() const
[AI] Retrieves the pointer to the underlying MxBITMAPINFO struct (header and palette).
Definition: mxbitmap.h:254
virtual MxPalette * CreatePalette()
[AI] Allocates or clones the current palette for the bitmap.
Definition: mxbitmap.cpp:352
virtual MxResult SetSize(MxS32 p_width, MxS32 p_height, MxPalette *p_palette, MxBool)
[AI] Allocates the bitmap to a specified width and height, attaches a palette, and configures bit dep...
Definition: mxbitmap.cpp:43
MxU8 * GetImage() const
[AI] Retrieves the pointer to the image pixel data.
Definition: mxbitmap.h:248
MxU32 GetLength()
[AI] Returns the length in bytes of the data payload. [AI]
Definition: mxdschunk.h:105
MxU8 * GetData()
[AI] Returns a pointer to the start of the data payload. [AI]
Definition: mxdschunk.h:108
MxDSMediaAction extends MxDSAction to add media-specific playback properties and management.
Implements playback and presentation of Autodesk FLIC (FLC) video streams.
FLIC_HEADER * m_flcHeader
[AI] Internal cached FLIC header for video decoding and playback.
~MxFlcPresenter() override
Cleans up FLIC presenter and associated resources (including FLIC header memory).
void LoadFrame(MxStreamChunk *p_chunk) override
[AI] Decodes a FLIC frame from the stream chunk, applies it to the bitmap, and triggers any palette/r...
void RealizePalette() override
[AI] Realizes the palette for the current frame by creating a palette object (MxPalette) and updating...
void CreateBitmap() override
[AI] Creates a bitmap sized from FLIC header for decoded frame output.
MxFlcPresenter()
Constructs a FLIC presenter and initializes state.
void LoadHeader(MxStreamChunk *p_chunk) override
[AI] Loads FLIC header data from a stream chunk into memory for subsequent decoding.
[AI] Encapsulates a DirectDraw 8-bit (256 color) palette for use with DirectX rendering.
Definition: mxpalette.h:17
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
MxPoint32 m_location
[AI] 2D display location for the presenter.
Definition: mxpresenter.h:205
[AI] Rectangle using 32-bit signed integer coordinates.
Definition: mxgeometry.h:706
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
virtual MxResult RealizePalette(MxPalette *p_palette)
[AI] Applies (realizes) the palette to both MxVideoParam and hardware palette, and updates the displa...
void InvalidateRect(MxRect32 &p_rect)
[AI] Invalidates a rectangular region in the display; marks it for redraw on next tick.
void SetBit2(BOOL p_e)
MxBitmap * m_frameBitmap
Bitmap for current video frame. [AI].
void SetBit1(BOOL p_e)
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
void DecodeFLCFrame(LPBITMAPINFOHEADER p_bitmapHeader, BYTE *p_pixelData, FLIC_HEADER *p_flcHeader, FLIC_FRAME *p_flcFrame, BYTE *p_decodedColorMap)
[AI] Decodes a single FLIC (FLI/FLC) animation frame and updates the pixel data and palette.
Definition: flic.cpp:457
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
MxVideoManager * MVideoManager()
[AI] Returns the video manager used for video/cutscene presenter management.
Definition: mxmisc.cpp:65
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
[AI] Structure describing the header of a FLIC animation frame, used to organize frame subchunks and ...
Definition: flic.h:58
[AI] Structure for the main header of a FLIC animation file.
Definition: flic.h:42
WORD width
[AI] Image width in pixels for the animation. [AI]
Definition: flic.h:44
WORD height
[AI] Image height in pixels for the animation. [AI]
Definition: flic.h:45
BITMAPINFOHEADER m_bmiHeader
[AI] Standard DIB bitmap header (size 0x28 bytes).
Definition: mxbitmap.h:26