aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/videoplayer.cpp
diff options
context:
space:
mode:
authorSven Hesse2011-01-16 16:29:19 +0000
committerSven Hesse2011-01-16 16:29:19 +0000
commitb451d3b51c7b9c1db0e4203791793020f330cb07 (patch)
treeb686fe4f1e175ab14280b24f42e4268784dfe1ed /engines/gob/videoplayer.cpp
parente063ced21a4522638b901b343710b83ed7424826 (diff)
downloadscummvm-rg350-b451d3b51c7b9c1db0e4203791793020f330cb07.tar.gz
scummvm-rg350-b451d3b51c7b9c1db0e4203791793020f330cb07.tar.bz2
scummvm-rg350-b451d3b51c7b9c1db0e4203791793020f330cb07.zip
GOB: Add the property switchColorMode
To allow the videoplayer (and ultimatively the demoplayer) to switch color modes if necessary. svn-id: r55262
Diffstat (limited to 'engines/gob/videoplayer.cpp')
-rw-r--r--engines/gob/videoplayer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 7448c85ef1..1b1ed9eb2f 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -37,7 +37,7 @@
namespace Gob {
VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(Draw::kFrontSurface),
- x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface),
+ x(-1), y(-1), width(-1), height(-1), flags(kFlagFrontSurface), switchColorMode(false),
startFrame(-1), lastFrame(-1), endFrame(-1), forceSeek(false),
breakKey(kShortKeyEscape), palCmd(8), palStart(0), palEnd(255), palFrame(-1),
fade(false), waitEndFrame(true), canceled(false) {
@@ -112,6 +112,15 @@ int VideoPlayer::openVideo(bool primary, const Common::String &file, Properties
if (!(video->decoder = openVideo(file, properties)))
return -1;
+ if (video->decoder->isPaletted() != !_vm->isTrueColor()) {
+ if (!properties.switchColorMode)
+ return -1;
+
+ _vm->setTrueColor(!video->decoder->isPaletted());
+
+ video->decoder->colorModeChanged();
+ }
+
// Set the filename
video->fileName = file;