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"
37class 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);
108 if (!ConfMan.getBool(
"enable_hq_video")) {
132 virtual EventFlags
playUntilEvent(
const EventFlags flags,
const uint32 maxSleepMs = 0xFFFFFFFF);
160 template <
typename PixelType>
166 void setDrawRect(
const int16 x,
const int16 y,
const int16 width,
const int16 height);
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);
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
365 void init(int16 x, int16 y,
const PlayFlags flags,
const int16 boostPercent,
const int16 boostStartColor,
const int16 boostEndColor);
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
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 {
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
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);
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; }
@ kMaxChannelVolume
Definition: mixer.h:82
Definition: serializer.h:352
Definition: serializer.h:80
Definition: atari-screen.h:42
Definition: video32.h:233
IOStatus cue(const uint16 frameNo)
IOStatus play(const int16 from, const int16 to, const int16 showStyle, const bool cue)
uint16 getDuration() const
EventFlags playUntilEvent(const EventFlags flags, const uint32 maxSleepMs=0xFFFFFFFF) override
IOStatus init(const bool doublePixels)
IOStatus open(const Common::Path &fileName)
@ kMaxVolume
Definition: audio32.h:185
Definition: video32.h:696
void play(const int lastFrameNo)
void setDoFrameOut(const bool value)
Definition: video32.h:726
void setVolume(const uint8 value)
Definition: video32.h:731
void renderFrame(const Graphics::Surface &nextFrame) const override
bool shouldStartHQVideo() const override
Definition: video32.h:737
void open(const GuiResourceId resourceId, const int displayMode, const int16 x, const int16 y)
Definition: plane32.h:103
Definition: video32.h:297
void play(const Common::Path &fileName)
Definition: resource.h:256
Definition: robot_decoder.h:455
Definition: video32.h:215
void play(const Common::Path &fileName, const int16 numTicks, const int16 x, const int16 y)
Common::Platform getPlatform() const
Definition: screen_item32.h:53
Definition: seg_manager.h:48
Definition: video32.h:315
void setBlackoutArea(const Common::Rect &rect)
Definition: video32.h:572
void restrictPalette(const uint8 startColor, const int16 endColor)
int16 addBlob(int16 blockSize, int16 top, int16 left, int16 bottom, int16 right)
void renderFrame(const Graphics::Surface &nextFrame) const override
void init(int16 x, int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor)
IOStatus open(const Common::Path &fileName, const OpenFlags flags)
void setPlane(const int16 priority, const reg_t planeId)
void setShowCursor(const bool shouldShow)
Definition: video32.h:649
void submitPalette(const uint8 palette[256 *3]) const override
VMDStatus getStatus() const
void ignorePalettes()
Definition: video32.h:426
Definition: video32.h:787
bool _hqVideoMode
Definition: video32.h:206
bool startHQVideo(const Graphics::PixelFormat &format)
virtual EventFlags playUntilEvent(const EventFlags flags, const uint32 maxSleepMs=0xFFFFFFFF)
void renderLQToSurfaceDouble(Graphics::Surface &out, const Graphics::Surface &nextFrame, int lineCount) const
void showUnsupportedFormatDialog()
virtual bool shouldStartHQVideo() const
Definition: video32.h:107
bool _needsUpdate
Definition: video32.h:190
virtual EventFlags checkForEvent(const EventFlags flags)
void setSubtitlePosition() const
const Graphics::Surface * _currentFrame
Definition: video32.h:195
virtual void submitPalette(const uint8 palette[256 *3]) const
void renderLQToSurface(Graphics::Surface &out, const Graphics::Surface &nextFrame, const bool doublePixels, const bool blackLines) const
bool open(const Common::Path &fileName)
void setDrawRect(const int16 x, const int16 y, const int16 width, const int16 height)
Video::Subtitles _subtitles
Definition: video32.h:200
virtual void renderFrame(const Graphics::Surface &nextFrame) const
Common::ScopedPtr< Video::VideoDecoder > _decoder
Definition: video32.h:84
Common::Rect _drawRect
Definition: video32.h:183
Definition: subtitles.h:78
Definition: video_decoder.h:53
virtual uint16 getHeight() const
void setVolume(byte volume)
virtual uint16 getWidth() const
T height() const
Definition: rect.h:218
T width() const
Definition: rect.h:217
Definition: helpers.h:247
Definition: vm_types.h:39