diff options
| author | Sven Hesse | 2011-01-16 16:29:19 +0000 | 
|---|---|---|
| committer | Sven Hesse | 2011-01-16 16:29:19 +0000 | 
| commit | b451d3b51c7b9c1db0e4203791793020f330cb07 (patch) | |
| tree | b686fe4f1e175ab14280b24f42e4268784dfe1ed | |
| parent | e063ced21a4522638b901b343710b83ed7424826 (diff) | |
| download | scummvm-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
| -rw-r--r-- | engines/gob/demos/demoplayer.cpp | 2 | ||||
| -rw-r--r-- | engines/gob/videoplayer.cpp | 11 | ||||
| -rw-r--r-- | engines/gob/videoplayer.h | 2 | 
3 files changed, 14 insertions, 1 deletions
| diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index 9013f600a5..715e78adbc 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -157,6 +157,8 @@ void DemoPlayer::playVideo(const char *fileName) {  	props.x = _rebase0 ? 0 : -1;  	props.y = _rebase0 ? 0 : -1; +	props.switchColorMode = true; +  	int slot;  	if ((slot = _vm->_vidPlayer->openVideo(true, file, props)) >= 0) {  		if (_autoDouble) { 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; diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index 45b3a7b82d..bdd6b4f0c5 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -74,6 +74,8 @@ public:  		uint32 flags; ///< Video flags. +		bool switchColorMode; ///< Switch between paletted / true color modes? +  		int32 startFrame; ///< Frame to start playback from.  		int32 lastFrame;  ///< Frame to stop playback at.  		int32 endFrame;   ///< Last frame of this playback cycle. | 
