22 #ifndef MTROPOLIS_ELEMENTS_H 23 #define MTROPOLIS_ELEMENTS_H 25 #include "graphics/fontman.h" 26 #include "graphics/palette.h" 28 #include "mtropolis/data.h" 29 #include "mtropolis/runtime.h" 30 #include "mtropolis/render.h" 31 #include "mtropolis/coroutine_protos.h" 46 struct ElementLoaderContext;
51 kMediaStatePlayingLastFrame,
66 void render(
Window *window)
override;
71 #ifdef MTROPOLIS_DEBUG_ENABLE 72 const char *debugGetTypeName()
const override {
return "Graphic Element"; }
73 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusDone; }
103 void activate()
override;
104 void deactivate()
override;
106 bool canAutoPlay()
const override;
107 void queueAutoPlayEvents(
Runtime *runtime,
bool isAutoPlaying)
override;
109 void render(
Window *window)
override;
118 #ifdef MTROPOLIS_DEBUG_ENABLE 119 const char *debugGetTypeName()
const override {
return "Movie Element"; }
120 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusDone; }
122 void debugSkipMovies()
override;
126 void onPauseStateChanged()
override;
127 void onSegmentUnloaded(
int segmentIndex)
override;
130 CORO_DEFINE_RETURN_TYPE(
void);
137 void stopSubtitles();
139 void initFallbackPalette();
150 struct StartPlayingCoroutine {
151 CORO_DEFINE_RETURN_TYPE(
void);
155 struct SeekToTimeCoroutine {
156 CORO_DEFINE_RETURN_TYPE(
void);
162 bool _playEveryFrame;
166 bool _shouldPlayIfNotPaused;
168 MediaState _currentPlayState;
172 uint32 _maxTimestamp;
174 uint32 _currentTimestamp;
202 void activate()
override;
203 void deactivate()
override;
207 void render(
Window *window)
override;
212 #ifdef MTROPOLIS_DEBUG_ENABLE 213 const char *debugGetTypeName()
const override {
return "Image Element"; }
214 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusDone; }
241 void activate()
override;
242 void deactivate()
override;
246 bool canAutoPlay()
const override;
248 void render(
Window *window)
override;
250 bool isMouseCollisionAtPoint(int32 relativeX, int32 relativeY)
const override;
257 #ifdef MTROPOLIS_DEBUG_ENABLE 258 const char *debugGetTypeName()
const override {
return "mToon Element"; }
259 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusDone; }
266 struct MToonConsumeCommandCoroutine {
267 CORO_DEFINE_RETURN_TYPE(
void);
271 struct StartPlayingCoroutine {
272 CORO_DEFINE_RETURN_TYPE(
void);
276 struct StopPlayingCoroutine {
277 CORO_DEFINE_RETURN_TYPE(
void);
281 struct ChangeFrameCoroutine {
282 CORO_DEFINE_RETURN_TYPE(
void);
298 void onPauseStateChanged()
override;
306 int32 _rateTimes100000;
307 int32 _flushPriority;
308 uint32 _celStartTimeMSec;
321 uint32 _renderedFrame;
331 bool _hasIssuedRenderWarning;
339 bool isTextLabel()
const override;
348 void activate()
override;
349 void deactivate()
override;
351 void render(
Window *window)
override;
353 void setTextStyle(uint16 macFontID,
const Common::String &fontFamilyName, uint size, TextAlignment alignment,
const TextStyleFlags &styleFlags);
355 Graphics::FontManager::FontUsage getDefaultUsageForMacFont(uint16 macFontID, uint size);
356 Graphics::FontManager::FontUsage getDefaultUsageForNamedFont(
const Common::String &fontFamilyName, uint size);
361 #ifdef MTROPOLIS_DEBUG_ENABLE 362 const char *debugGetTypeName()
const override {
return "Text Label Element"; }
363 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusPartial; }
369 struct TextLabelLineWriteInterface {
378 bool findLineRange(
size_t lineNum, uint32 &outStartPos, uint32 &outEndPos)
const;
379 size_t countLines()
const;
391 TextAlignment _alignment;
414 void activate()
override;
415 void deactivate()
override;
417 bool canAutoPlay()
const override;
422 bool resolveMediaMarkerLabel(
const Label &label, int32 &outResolution)
const override;
427 #ifdef MTROPOLIS_DEBUG_ENABLE 428 const char *debugGetTypeName()
const override {
return "Sound Element"; }
429 SupportStatus debugGetSupportStatus()
const override {
return kSupportStatusDone; }
436 void initSubtitles();
444 struct SoundElementConsumeCommandCoroutine {
445 CORO_DEFINE_RETURN_TYPE(
void);
449 struct StartPlayingCoroutine {
450 CORO_DEFINE_RETURN_TYPE(
void);
454 struct StopPlayingCoroutine {
455 CORO_DEFINE_RETURN_TYPE(
void);
459 void setLoop(
bool loop);
460 void setVolume(uint16 volume);
461 void setBalance(int16 balance);
473 uint64 _startTimestamp;
474 uint64 _cueCheckTime;
475 bool _shouldPlayIfNotPaused;
Definition: runtime.h:816
Definition: runtime.h:330
Definition: elements.h:91
Definition: elements.h:192
Definition: runtime.h:1575
Definition: element_factory.h:30
Definition: runtime.h:2390
Definition: miniscript.h:421
Definition: runtime.h:2827
Definition: runtime.h:544
Definition: elements.h:402
Definition: runtime.h:351
Definition: elements.h:129
Definition: runtime.h:2118
Definition: elements.h:229
Definition: runtime.h:2994
Definition: elements.h:84
Definition: elements.h:334
Definition: avi_frames.h:36
Definition: elements.h:56
Definition: runtime.h:2472