[Scummvm-cvs-logs] SF.net SVN: scummvm:[55262] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Sun Jan 16 17:29:20 CET 2011
Revision: 55262
http://scummvm.svn.sourceforge.net/scummvm/?rev=55262&view=rev
Author: drmccoy
Date: 2011-01-16 16:29:19 +0000 (Sun, 16 Jan 2011)
Log Message:
-----------
GOB: Add the property switchColorMode
To allow the videoplayer (and ultimatively the demoplayer)
to switch color modes if necessary.
Modified Paths:
--------------
scummvm/trunk/engines/gob/demos/demoplayer.cpp
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/engines/gob/videoplayer.h
Modified: scummvm/trunk/engines/gob/demos/demoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/demos/demoplayer.cpp 2011-01-16 16:28:47 UTC (rev 55261)
+++ scummvm/trunk/engines/gob/demos/demoplayer.cpp 2011-01-16 16:29:19 UTC (rev 55262)
@@ -157,6 +157,8 @@
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) {
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-16 16:28:47 UTC (rev 55261)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2011-01-16 16:29:19 UTC (rev 55262)
@@ -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 @@
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;
Modified: scummvm/trunk/engines/gob/videoplayer.h
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.h 2011-01-16 16:28:47 UTC (rev 55261)
+++ scummvm/trunk/engines/gob/videoplayer.h 2011-01-16 16:29:19 UTC (rev 55262)
@@ -74,6 +74,8 @@
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.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list