aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/video32.h
diff options
context:
space:
mode:
authorColin Snover2017-07-05 14:34:33 -0500
committerColin Snover2017-07-06 19:12:39 -0500
commit3f0e061eaa272c3f6bc284d8e837870e132d9dcc (patch)
treeabaeac691659b8564bbceefb7a1c7a9aabcd3885 /engines/sci/graphics/video32.h
parentf15f9e3b7c9dd7594a60aa230fed05b965a7a587 (diff)
downloadscummvm-rg350-3f0e061eaa272c3f6bc284d8e837870e132d9dcc.tar.gz
scummvm-rg350-3f0e061eaa272c3f6bc284d8e837870e132d9dcc.tar.bz2
scummvm-rg350-3f0e061eaa272c3f6bc284d8e837870e132d9dcc.zip
SCI32: Refactor DuckPlayer to use common video playback code
This lets DuckPlayer support configurable black-lined video and configurable high-quality scaling.
Diffstat (limited to 'engines/sci/graphics/video32.h')
-rw-r--r--engines/sci/graphics/video32.h52
1 files changed, 25 insertions, 27 deletions
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index bf3cc84123..5c213484d3 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -608,6 +608,10 @@ private:
#pragma mark -
#pragma mark DuckPlayer
+/**
+ * DuckPlayer is used to play Duck TrueMotion videos.
+ * Used by Phantasmagoria 2.
+ */
class DuckPlayer : public VideoPlayer {
public:
enum DuckStatus {
@@ -617,9 +621,7 @@ public:
kDuckPaused = 3
};
- DuckPlayer(SegManager *segMan, EventManager *eventMan);
-
- ~DuckPlayer();
+ DuckPlayer(EventManager *eventMan, SegManager *segMan);
/**
* Opens a stream to a Duck resource.
@@ -637,9 +639,8 @@ public:
void play(const int lastFrameNo);
/**
- * Sets a flag indicating that an opaque plane should be added
- * to the graphics manager underneath the video surface during
- * playback.
+ * Sets a flag indicating that an opaque plane should be added to the
+ * graphics manager underneath the video surface during playback.
*/
void setDoFrameOut(const bool value) { _doFrameOut = value; }
@@ -647,17 +648,24 @@ public:
* Sets the volume of the decoder.
*/
void setVolume(const uint8 value) {
- _volume = (uint)value * Audio::Mixer::kMaxChannelVolume / Audio32::kMaxVolume;
+ _volume = value * Audio::Mixer::kMaxChannelVolume / Audio32::kMaxVolume;
_decoder->setVolume(_volume);
}
-private:
- EventManager *_eventMan;
- Video::AVIDecoder *_decoder;
+protected:
+ virtual bool shouldStartHQVideo() const override {
+ if (!VideoPlayer::shouldStartHQVideo() || _blackLines) {
+ return false;
+ }
+ return true;
+ }
+
+ virtual void renderFrame(const Graphics::Surface &nextFrame) const override;
+
+private:
/**
- * An empty plane drawn behind the video when the doFrameOut
- * flag is true.
+ * An empty plane drawn behind the video when the doFrameOut flag is true.
*/
Plane *_plane;
@@ -667,11 +675,6 @@ private:
DuckStatus _status;
/**
- * The screen rect where the video should be drawn.
- */
- Common::Rect _drawRect;
-
- /**
* The playback volume for the player.
*/
uint8 _volume;
@@ -683,19 +686,14 @@ private:
bool _doFrameOut;
/**
- * If true, the video will be pixel doubled during playback.
- */
- bool _pixelDouble;
-
- /**
- * The buffer used to perform scaling of the video.
+ * Whether or not the video should be pixel doubled.
*/
- byte *_scaleBuffer;
+ bool _doublePixels;
/**
- * Renders the current frame to the system video buffer.
+ * Whether or not black lines should be rendered across the video.
*/
- void renderFrame() const;
+ bool _blackLines;
};
#pragma mark -
@@ -711,7 +709,7 @@ public:
_AVIPlayer(eventMan),
_VMDPlayer(eventMan, segMan),
_robotPlayer(segMan),
- _duckPlayer(segMan, eventMan) {}
+ _duckPlayer(eventMan, segMan) {}
void beforeSaveLoadWithSerializer(Common::Serializer &ser);
virtual void saveLoadWithSerializer(Common::Serializer &ser);