Isle
Loading...
Searching...
No Matches
mxloopingflcpresenter.cpp
Go to the documentation of this file.
2
3#include "decomp.h"
4#include "mxdsaction.h"
5#include "mxdssubscriber.h"
6
8
9// FUNCTION: LEGO1 0x100b4310
11{
12 Init();
13}
14
15// FUNCTION: LEGO1 0x100b43b0
17{
19}
20
21// FUNCTION: LEGO1 0x100b4410
22void MxLoopingFlcPresenter::Init()
23{
24 this->m_elapsedDuration = 0;
27}
28
29// FUNCTION: LEGO1 0x100b4430
30void MxLoopingFlcPresenter::Destroy(MxBool p_fromDestructor)
31{
33 Init();
35
36 if (!p_fromDestructor) {
38 }
39}
40
41// FUNCTION: LEGO1 0x100b4470
43{
44 MxStreamChunk* chunk = NextChunk();
45
48 }
49 else {
50 LoadFrame(chunk);
51 LoopChunk(chunk);
52 m_elapsedDuration += m_flcHeader->speed;
53 }
54
56}
57
58// FUNCTION: LEGO1 0x100b44c0
60{
61 if (m_action->GetDuration() < m_elapsedDuration) {
63 }
64 else {
65 MxStreamChunk* chunk;
67 LoadFrame(chunk);
68 m_elapsedDuration += m_flcHeader->speed;
69 }
70}
71
72// FUNCTION: LEGO1 0x100b4520
74{
75 for (MxS16 i = 0; i < m_unk0x5c; i++) {
77 MxStreamChunk* chunk;
79
80 cursor.Last(chunk);
81 MxLong time = chunk->GetTime();
82
83 cursor.First(chunk);
84
85 time -= chunk->GetTime();
86 time += m_flcHeader->speed;
87
88 cursor.Reset();
89 while (cursor.Next(chunk)) {
90 chunk->SetTime(chunk->GetTime() + time);
91 }
92
94 }
95
96 MxStreamChunk* chunk;
98
99 if (m_action->GetElapsedTime() < chunk->GetTime()) {
100 break;
101 }
102
103 VTable0x88();
104
106
108 break;
109 }
110 }
111}
112
113// FUNCTION: LEGO1 0x100b4860
115{
116 MxResult result = FAILURE;
117 MxBool locked = FALSE;
118
121 locked = TRUE;
122 result = SUCCESS;
123 }
124
125 if (locked) {
127 }
128
129 return result;
130}
131
132// FUNCTION: LEGO1 0x100b48a0
134{
135 Destroy(FALSE);
136}
void Enter()
[AI] Acquires/gains entry to the critical section or mutex, blocking if not available.
void Leave()
[AI] Releases/leaves the critical section or mutex.
virtual MxLong GetDuration()
[AI] Gets the duration for which this action is intended to run.
Definition: mxdsaction.cpp:39
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
Definition: mxdsaction.cpp:159
MxLong GetTime()
[AI] Returns the time (timestamp or tick) associated with this chunk. [AI]
Definition: mxdschunk.h:102
MxU16 GetChunkFlags()
[AI] Returns the chunk's flag bitfield. [AI]
Definition: mxdschunk.h:96
void SetTime(MxLong p_time)
[AI] Sets the time (timestamp/tick/frame) associated with this chunk.
Definition: mxdschunk.h:85
void FreeDataChunk(MxStreamChunk *p_chunk)
[AI] Frees (deletes) a data chunk if it's found in the consumed data list; also forcibly deletes sing...
FLIC_HEADER * m_flcHeader
[AI] Internal cached FLIC header for video decoding and playback.
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...
MxBool Next()
[AI]
MxBool Last(T &p_obj)
[AI]
MxBool Current(T &p_obj)
[AI]
void Reset()
[AI]
Definition: mxlist.h:269
MxBool HasMatch()
[AI]
Definition: mxlist.h:242
MxBool First(T &p_obj)
[AI]
[AI] Presents a looping FLC (Autodesk Animator FLIC) animation, extending the core FLC presenter to s...
void RepeatingTickle() override
[AI] Called during the repeating tickle state in the tickle loop to handle animation looping logic.
MxResult AddToManager() override
[AI] Adds this presenter to the tickle manager for updates.
virtual void VTable0x88()
[AI] Custom virtual function at vtable offset 0x88, responsible for updating current looping frame or...
~MxLoopingFlcPresenter() override
[AI] Destructor.
void NextFrame() override
[AI] Loads and advances to the next animation frame, updating loop counters and timing.
void Destroy() override
[AI] Destroys the presenter, cleaning up resources and unregistering from tickle managers if needed.
MxLoopingFlcPresenter()
[AI] Constructs the looping FLC presenter and initializes internal state.
MxStreamChunk * NextChunk()
[AI] Returns the next data chunk in the stream, removing it from the stream queue.
void Destroy() override
[AI] Cleans up internal resources and resets the presenter to an uninitialized state.
MxStreamChunkList * m_loopingChunks
[AI] Linked list of all chunks available for looping/repeating playback.
virtual void LoopChunk(MxStreamChunk *p_chunk)
[AI] Adds a chunk to the looping chunk list, making it available for repeated playback.
MxStreamChunkListCursor * m_loopingChunkCursor
[AI] Cursor used to iterate through the loopingChunk list during repeat mode.
MxDSSubscriber * m_subscriber
[AI] Subscriber that provides the stream data (e.g., audio/video chunks) for this presenter.
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
Definition: mxpresenter.h:72
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
TickleState m_currentTickleState
[AI] Current state in the tickle lifecycle.
Definition: mxpresenter.h:199
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
@ e_freezing
[AI] Temporarily suspending updates or playback.
Definition: mxpresenter.h:29
MxCriticalSection m_criticalSection
[AI] Thread synchronization for presenter state and data.
Definition: mxpresenter.h:214
virtual MxResult AddToManager()
[AI] Optional registration with a manager (such as TickleManager); by default does nothing.
Definition: mxpresenter.h:84
[AI] Cursor for iterating over a MxStreamChunkList.
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
void SetBit2(BOOL p_e)
void SetBit1(BOOL p_e)
MxS16 m_unk0x5c
Loop/advance/frame decode counter. [AI].
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
#define DS_CHUNK_END_OF_STREAM
[AI] Flag bit indicating this chunk is the last in its stream.
Definition: mxdschunk.h:14
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
DWORD speed
[AI] Playback speed—time between frames in milliseconds. [AI]
Definition: flic.h:48