22 #ifndef SCI_GRAPHICS_VIDEO32_H 23 #define SCI_GRAPHICS_VIDEO32_H 25 #include "common/config-manager.h" 26 #include "common/path.h" 27 #include "common/ptr.h" 28 #include "common/rect.h" 29 #include "common/scummsys.h" 30 #include "sci/engine/vm_types.h" 31 #include "sci/video/robot_decoder.h" 32 #include "sci/sound/audio32.h" 33 #include "video/avi_decoder.h" 34 #include "video/subtitles.h" 37 class AdvancedVMDDecoder;
56 kEventFlagEscapeKey = 2,
57 kEventFlagMouseDown = 4,
58 kEventFlagHotRectangle = 8,
59 kEventFlagToFrame = 0x10,
60 kEventFlagYieldToVM = 0x20,
61 kEventFlagReverse = 0x80
64 friend EventFlags operator|(
const EventFlags a,
const EventFlags b) {
65 return static_cast<EventFlags
>((int)a | (
int)b);
72 _currentFrame(
nullptr),
108 if (!ConfMan.getBool(
"enable_hq_video")) {
112 if (_decoder->
getWidth() == _drawRect.width() &&
113 _decoder->
getHeight() == _drawRect.height()) {
132 virtual EventFlags playUntilEvent(
const EventFlags flags,
const uint32 maxSleepMs = 0xFFFFFFFF);
138 virtual EventFlags checkForEvent(
const EventFlags flags);
143 virtual void submitPalette(
const uint8 palette[256 * 3])
const;
160 template <
typename PixelType>
166 void setDrawRect(
const int16 x,
const int16 y,
const int16 width,
const int16 height);
172 void setSubtitlePosition()
const;
178 void showUnsupportedFormatDialog();
209 #pragma mark SEQPlayer 223 void play(
const Common::Path &fileName,
const int16 numTicks,
const int16 x,
const int16 y);
227 #pragma mark AVIPlayer 259 IOStatus init(
const bool doublePixels);
264 IOStatus play(
const int16 from,
const int16 to,
const int16 showStyle,
const bool cue);
266 EventFlags playUntilEvent(
const EventFlags flags,
const uint32 maxSleepMs = 0xFFFFFFFF)
override;
276 IOStatus cue(
const uint16 frameNo);
281 uint16 getDuration()
const;
291 #pragma mark QuickTimePlayer 308 #pragma mark VMDPlayer 329 kPlayFlagDoublePixels = 1,
330 kPlayFlagBlackLines = 4,
331 kPlayFlagBoost = 0x10,
332 kPlayFlagLeaveScreenBlack = 0x20,
333 kPlayFlagLeaveLastFrame = 0x40,
334 kPlayFlagBlackPalette = 0x80,
335 kPlayFlagStretchVertical = 0x100
354 #pragma mark VMDPlayer - Playback 359 IOStatus open(
const Common::Path &fileName,
const OpenFlags flags);
365 void init(int16 x, int16 y,
const PlayFlags flags,
const int16 boostPercent,
const int16 boostStartColor,
const int16 boostEndColor);
375 VMDStatus getStatus()
const;
378 EventFlags kernelPlayUntilEvent(
const EventFlags flags,
const int16 lastFrameNo,
const int16 yieldInterval);
408 int32 _yieldInterval;
414 int _lastYieldedFrameNo;
416 EventFlags playUntilEvent(
const EventFlags flags,
const uint32 = 0xFFFFFFFF)
override;
417 EventFlags checkForEvent(
const EventFlags flags)
override;
420 #pragma mark VMDPlayer - Rendering 431 void setPlane(
const int16 priority,
const reg_t planeId);
442 void submitPalette(
const uint8 palette[256 * 3])
const override;
481 bool _stretchVertical;
492 bool _leaveScreenBlack;
498 bool _leaveLastFrame;
503 bool _ignorePalettes;
514 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) {
547 bool shouldUseCompositing()
const {
548 return isNormallyComposited() && !shouldStartHQVideo();
551 bool isNormallyComposited()
const {
552 return (getSciVersion() == SCI_VERSION_3) ||
554 getSciVersion() >= SCI_VERSION_2_1_LATE);
561 void initComposited();
562 void renderComposited()
const;
563 void closeComposited();
566 #pragma mark VMDPlayer - Blackout 584 Plane *_blackoutPlane;
587 #pragma mark VMDPlayer - Palette 593 void restrictPalette(
const uint8 startColor,
const int16 endColor);
618 #ifdef SCI_VMD_BLACK_PALETTE 623 #pragma mark VMDPlayer - Brightness boost 634 uint8 _boostStartColor;
639 uint8 _boostEndColor;
642 #pragma mark VMDPlayer - Mouse cursor 658 #pragma mark VMDPlayer - Censorship blobs 666 int16 addBlob(int16 blockSize, int16 top, int16 left, int16 bottom, int16 right);
668 void deleteBlob(int16 blobNumber);
690 #pragma mark DuckPlayer 710 void open(
const GuiResourceId resourceId,
const int displayMode,
const int16 x,
const int16 y);
720 void play(
const int lastFrameNo);
733 _decoder->setVolume(_volume);
738 if (!VideoPlayer::shouldStartHQVideo() || _blackLines) {
790 _SEQPlayer(eventMan),
791 _AVIPlayer(eventMan),
792 _QuickTimePlayer(eventMan),
793 _VMDPlayer(eventMan, segMan),
794 _robotPlayer(segMan),
795 _duckPlayer(eventMan, segMan) {}
800 SEQPlayer &getSEQPlayer() {
return _SEQPlayer; }
801 AVIPlayer &getAVIPlayer() {
return _AVIPlayer; }
803 VMDPlayer &getVMDPlayer() {
return _VMDPlayer; }
805 DuckPlayer &getDuckPlayer() {
return _duckPlayer; }
818 #endif // SCI_GRAPHICS_VIDEO32_H Common::ScopedPtr< Video::VideoDecoder > _decoder
Definition: video32.h:84
Common::Rect _drawRect
Definition: video32.h:183
Definition: video32.h:297
Video::Subtitles _subtitles
Definition: video32.h:200
void setDoFrameOut(const bool value)
Definition: video32.h:726
bool shouldStartHQVideo() const override
Definition: video32.h:737
Definition: plane32.h:103
Definition: serializer.h:79
Definition: subtitles.h:78
Definition: video32.h:215
const Graphics::Surface * _currentFrame
Definition: video32.h:195
Definition: video32.h:233
Definition: video32.h:696
Definition: video_decoder.h:53
Common::Platform getPlatform() const
Definition: resource.h:256
bool _needsUpdate
Definition: video32.h:190
bool _hqVideoMode
Definition: video32.h:206
Definition: serializer.h:308
virtual uint16 getWidth() const
Definition: seg_manager.h:48
virtual uint16 getHeight() const
Definition: video32.h:315
void setVolume(const uint8 value)
Definition: video32.h:731
Definition: screen_item32.h:53
void setShowCursor(const bool shouldShow)
Definition: video32.h:649
virtual bool shouldStartHQVideo() const
Definition: video32.h:107
Definition: helpers.h:247
Definition: animation.h:37
Definition: vm_types.h:39
void ignorePalettes()
Definition: video32.h:426
Definition: robot_decoder.h:455
void setBlackoutArea(const Common::Rect &rect)
Definition: video32.h:572
Definition: video32.h:787
Definition: atari-screen.h:42