aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2018-10-25 02:53:57 +0300
committerFilippos Karapetis2018-10-25 02:55:35 +0300
commit6a32f07ee8b32a947472220ff47942a332de61fc (patch)
tree91b284b4867d7057a3ab485265167b3987c129e2 /engines
parent609b9e7d2768d1c9226a4692213b0156b1972455 (diff)
downloadscummvm-rg350-6a32f07ee8b32a947472220ff47942a332de61fc.tar.gz
scummvm-rg350-6a32f07ee8b32a947472220ff47942a332de61fc.tar.bz2
scummvm-rg350-6a32f07ee8b32a947472220ff47942a332de61fc.zip
SCI32: Add support for upscaling VMD videos
This feature can be used for the Windows version of KQ7, as well as PQ:SWAT
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/video32.cpp24
-rw-r--r--engines/sci/graphics/video32.h2
2 files changed, 19 insertions, 7 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 8d68c8e3bb..8849e985c6 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -570,11 +570,26 @@ VMDPlayer::IOStatus VMDPlayer::open(const Common::String &fileName, const OpenFl
return kIOError;
}
-void VMDPlayer::init(int16 x, const int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor) {
+void VMDPlayer::init(int16 x, int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor) {
+ const int16 screenWidth = g_sci->_gfxFrameout->getScreenWidth();
+ const int16 screenHeight = g_sci->_gfxFrameout->getScreenHeight();
+ const bool upscaleVideos = ConfMan.getBool("enable_video_upscale");
+
+ _doublePixels = (flags & kPlayFlagDoublePixels) || upscaleVideos;
+ _stretchVertical = flags & kPlayFlagStretchVertical;
+
+ const int16 width = _decoder->getWidth() << _doublePixels;
+ const int16 height = _decoder->getHeight() << (_doublePixels || _stretchVertical);
+
if (getSciVersion() < SCI_VERSION_3) {
x &= ~1;
}
- _doublePixels = flags & kPlayFlagDoublePixels;
+
+ if (upscaleVideos) {
+ x = (screenWidth - width) / 2;
+ y = (screenHeight - height) / 2;
+ }
+
_blackLines = ConfMan.getBool("enable_black_lined_video") && (flags & kPlayFlagBlackLines);
// If ScummVM has been configured to disable black lines on video playback,
// the boosts need to be ignored too or else the brightness of the video
@@ -587,11 +602,8 @@ void VMDPlayer::init(int16 x, const int16 y, const PlayFlags flags, const int16
#ifdef SCI_VMD_BLACK_PALETTE
_blackPalette = flags & kPlayFlagBlackPalette;
#endif
- _stretchVertical = flags & kPlayFlagStretchVertical;
- setDrawRect(x, y,
- (_decoder->getWidth() << _doublePixels),
- (_decoder->getHeight() << (_doublePixels || _stretchVertical)));
+ setDrawRect(x, y, width, height);
}
VMDPlayer::IOStatus VMDPlayer::close() {
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index ce5e4ba883..d418c58b86 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -319,7 +319,7 @@ public:
* Initializes the VMD rendering parameters for the current VMD. This must
* be called after `open`.
*/
- void init(const int16 x, const int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor);
+ void init(int16 x, int16 y, const PlayFlags flags, const int16 boostPercent, const int16 boostStartColor, const int16 boostEndColor);
/**
* Stops playback and closes the currently open VMD stream.