22 #ifndef SCI_GRAPHICS_VIDEO32_H 23 #define SCI_GRAPHICS_VIDEO32_H 26 #include "common/config-manager.h" 28 #include "common/path.h" 29 #include "common/ptr.h" 30 #include "common/rect.h" 31 #include "common/scummsys.h" 32 #include "sci/engine/vm_types.h" 33 #include "sci/video/robot_decoder.h" 34 #include "sci/sound/audio32.h" 35 #include "video/avi_decoder.h" 36 #include "video/subtitles.h" 39 class AdvancedVMDDecoder;
58 kEventFlagEscapeKey = 2,
59 kEventFlagMouseDown = 4,
60 kEventFlagHotRectangle = 8,
61 kEventFlagToFrame = 0x10,
62 kEventFlagYieldToVM = 0x20,
63 kEventFlagReverse = 0x80
66 friend EventFlags operator|(
const EventFlags a,
const EventFlags b) {
67 return static_cast<EventFlags
>((int)a | (
int)b);
74 _currentFrame(
nullptr)
114 if (!ConfMan.getBool(
"enable_hq_video")) {
118 if (_decoder->
getWidth() == _drawRect.width() &&
119 _decoder->
getHeight() == _drawRect.height()) {
141 virtual EventFlags playUntilEvent(
const EventFlags flags,
const uint32 maxSleepMs = 0xFFFFFFFF);
147 virtual EventFlags checkForEvent(
const EventFlags flags);
152 virtual void submitPalette(
const uint8 palette[256 * 3])
const;
163 template <
typename PixelType>
169 void setDrawRect(
const int16 x,
const int16 y,
const int16 width,
const int16 height);
175 void setSubtitlePosition()
const;
208 #pragma mark SEQPlayer 222 void play(
const Common::Path &fileName,
const int16 numTicks,
const int16 x,
const int16 y);
226 #pragma mark AVIPlayer 258 IOStatus init(
const bool doublePixels);
263 IOStatus play(
const int16 from,
const int16 to,
const int16 showStyle,
const bool cue);
265 EventFlags playUntilEvent(
const EventFlags flags,
const uint32 maxSleepMs = 0xFFFFFFFF)
override;
275 IOStatus cue(
const uint16 frameNo);
280 uint16 getDuration()
const;
290 #pragma mark QuickTimePlayer 307 #pragma mark VMDPlayer 328 kPlayFlagDoublePixels = 1,
329 kPlayFlagBlackLines = 4,
330 kPlayFlagBoost = 0x10,
331 kPlayFlagLeaveScreenBlack = 0x20,
332 kPlayFlagLeaveLastFrame = 0x40,
333 kPlayFlagBlackPalette = 0x80,
334 kPlayFlagStretchVertical = 0x100
353 #pragma mark VMDPlayer - Playback 358 IOStatus open(
const Common::Path &fileName,
const OpenFlags flags);
364 void init(int16 x, int16 y,
const PlayFlags flags,
const int16 boostPercent,
const int16 boostStartColor,
const int16 boostEndColor);
374 VMDStatus getStatus()
const;
377 EventFlags kernelPlayUntilEvent(
const EventFlags flags,
const int16 lastFrameNo,
const int16 yieldInterval);
407 int32 _yieldInterval;
413 int _lastYieldedFrameNo;
415 EventFlags playUntilEvent(
const EventFlags flags,
const uint32 = 0xFFFFFFFF)
override;
416 EventFlags checkForEvent(
const EventFlags flags)
override;
419 #pragma mark VMDPlayer - Rendering 430 void setPlane(
const int16 priority,
const reg_t planeId);
441 void submitPalette(
const uint8 palette[256 * 3])
const override;
480 bool _stretchVertical;
491 bool _leaveScreenBlack;
497 bool _leaveLastFrame;
502 bool _ignorePalettes;
513 void fillPalette(
const uint8 rawPalette[256 * 3],
Palette &outPalette)
const;
521 void redrawGameScreen()
const;
531 bool shouldStartHQVideo()
const override {
532 if (!VideoPlayer::shouldStartHQVideo()) {
536 if (_priority != 0 || _leaveLastFrame || _showCursor || _blackLines) {
548 bool shouldUseCompositing()
const {
550 return isNormallyComposited() && !shouldStartHQVideo();
552 return isNormallyComposited();
556 bool isNormallyComposited()
const {
557 return (getSciVersion() == SCI_VERSION_3) ||
559 getSciVersion() >= SCI_VERSION_2_1_LATE);
566 void initComposited();
567 void renderComposited()
const;
568 void closeComposited();
571 #pragma mark VMDPlayer - Blackout 589 Plane *_blackoutPlane;
592 #pragma mark VMDPlayer - Palette 598 void restrictPalette(
const uint8 startColor,
const int16 endColor);
623 #ifdef SCI_VMD_BLACK_PALETTE 628 #pragma mark VMDPlayer - Brightness boost 639 uint8 _boostStartColor;
644 uint8 _boostEndColor;
647 #pragma mark VMDPlayer - Mouse cursor 663 #pragma mark VMDPlayer - Censorship blobs 671 int16 addBlob(int16 blockSize, int16 top, int16 left, int16 bottom, int16 right);
673 void deleteBlob(int16 blobNumber);
695 #pragma mark DuckPlayer 715 void open(
const GuiResourceId resourceId,
const int displayMode,
const int16 x,
const int16 y);
725 void play(
const int lastFrameNo);
738 _decoder->setVolume(_volume);
743 if (!VideoPlayer::shouldStartHQVideo() || _blackLines) {
795 _SEQPlayer(eventMan),
796 _AVIPlayer(eventMan),
797 _QuickTimePlayer(eventMan),
798 _VMDPlayer(eventMan, segMan),
799 _robotPlayer(segMan),
800 _duckPlayer(eventMan, segMan) {}
805 SEQPlayer &getSEQPlayer() {
return _SEQPlayer; }
806 AVIPlayer &getAVIPlayer() {
return _AVIPlayer; }
808 VMDPlayer &getVMDPlayer() {
return _VMDPlayer; }
810 DuckPlayer &getDuckPlayer() {
return _duckPlayer; }
823 #endif // SCI_GRAPHICS_VIDEO32_H Common::ScopedPtr< Video::VideoDecoder > _decoder
Definition: video32.h:89
Common::Rect _drawRect
Definition: video32.h:180
Definition: video32.h:296
Video::Subtitles _subtitles
Definition: video32.h:197
void setDoFrameOut(const bool value)
Definition: video32.h:731
bool shouldStartHQVideo() const override
Definition: video32.h:742
Definition: plane32.h:103
Definition: serializer.h:79
Definition: subtitles.h:61
Definition: video32.h:214
const Graphics::Surface * _currentFrame
Definition: video32.h:192
Definition: video32.h:232
Definition: video32.h:701
Definition: video_decoder.h:53
Common::Platform getPlatform() const
Definition: resource.h:256
bool _needsUpdate
Definition: video32.h:187
Definition: serializer.h:308
virtual uint16 getWidth() const
Definition: seg_manager.h:48
virtual uint16 getHeight() const
Definition: video32.h:314
void setVolume(const uint8 value)
Definition: video32.h:736
Definition: screen_item32.h:53
void setShowCursor(const bool shouldShow)
Definition: video32.h:654
virtual bool shouldStartHQVideo() const
Definition: video32.h:112
Definition: helpers.h:247
Definition: avi_frames.h:36
Definition: vm_types.h:39
void ignorePalettes()
Definition: video32.h:425
Definition: robot_decoder.h:455
void setBlackoutArea(const Common::Rect &rect)
Definition: video32.h:577
Definition: video32.h:792
Definition: atari-screen.h:44