Isle
Loading...
Searching...
No Matches
legoflctexturepresenter.cpp
Go to the documentation of this file.
2
3#include "misc.h"
5#include "mxdsaction.h"
6
8
9// FUNCTION: LEGO1 0x1005de80
11{
12 Init();
13}
14
15// FUNCTION: LEGO1 0x1005df70
16void LegoFlcTexturePresenter::Init()
17{
18 m_rectCount = 0;
19 m_texture = NULL;
20}
21
22// FUNCTION: LEGO1 0x1005df80
23// FUNCTION: BETA10 0x100833a7
25{
26 MxU16 extraLength;
27 char* pp;
28 char extraCopy[128];
29 m_action->GetExtra(extraLength, pp);
30
31 if (pp != NULL) {
32 strcpy(extraCopy, pp);
33 strcat(extraCopy, ".gif");
34 m_texture = TextureContainer()->Get(extraCopy);
35 }
36
38}
39
40// FUNCTION: LEGO1 0x1005e0c0
41// FUNCTION: BETA10 0x100834ce
43{
44 MxU8* data = p_chunk->GetData();
45
46 m_rectCount = *(MxS32*) data;
47 data += sizeof(MxS32);
48
49 MxRect32* rects = (MxRect32*) data;
50 data += m_rectCount * sizeof(MxRect32);
51
52 MxBool decodedColorMap;
57 (FLIC_FRAME*) data,
58 &decodedColorMap
59 );
60}
61
62// FUNCTION: LEGO1 0x1005e100
63// FUNCTION: BETA10 0x10083562
65{
66 if (m_texture != NULL && m_rectCount != 0) {
67 m_texture->FUN_10066010(m_frameBitmap->GetImage());
68 m_rectCount = 0;
69 }
70}
T * Get(const char *p_name)
Retrieve the element mapped to the given name, or nullptr if missing.
Definition: legocontainer.h:92
[AI] Presenter for rendering FLC animation frames as textures in the LEGO engine.
void LoadFrame(MxStreamChunk *p_chunk) override
[AI] Decodes an FLC animation frame from a chunk, extracting both dirty rects and animation data.
void StartingTickle() override
[AI] Called on transition to 'Starting' tickle state.
void PutFrame() override
[AI] Uploads the newly decoded FLC frame to the associated LegoTextureInfo, updating the active textu...
LegoResult FUN_10066010(const LegoU8 *p_bits)
[AI] Updates the pixel bits for the current surface/texture with the provided bitmap data.
MxBITMAPINFO * GetBitmapInfo() const
[AI] Retrieves the pointer to the underlying MxBITMAPINFO struct (header and palette).
Definition: mxbitmap.h:254
MxU8 * GetImage() const
[AI] Retrieves the pointer to the image pixel data.
Definition: mxbitmap.h:248
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
MxU8 * GetData()
[AI] Returns a pointer to the start of the data payload. [AI]
Definition: mxdschunk.h:108
FLIC_HEADER * m_flcHeader
[AI] Internal cached FLIC header for video decoding and playback.
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
virtual void StartingTickle()
[AI] Handles actions required when first starting presentation. Advances to streaming state.
Definition: mxpresenter.h:52
[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
MxBitmap * m_frameBitmap
Bitmap for current video frame. [AI].
#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
LegoTextureContainer * TextureContainer()
[AI] Accessor for the texture container used for global texture management. [AI]
Definition: misc.cpp:130
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned short MxU16
[AI]
Definition: mxtypes.h:20
[AI] Structure describing the header of a FLIC animation frame, used to organize frame subchunks and ...
Definition: flic.h:58
BITMAPINFOHEADER m_bmiHeader
[AI] Standard DIB bitmap header (size 0x28 bytes).
Definition: mxbitmap.h:26