mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-10 02:31:02 +00:00
GOB: Add the property switchColorMode
To allow the videoplayer (and ultimatively the demoplayer) to switch color modes if necessary. svn-id: r55262
This commit is contained in:
parent
e063ced21a
commit
b451d3b51c
@ -157,6 +157,8 @@ void DemoPlayer::playVideo(const char *fileName) {
|
|||||||
props.x = _rebase0 ? 0 : -1;
|
props.x = _rebase0 ? 0 : -1;
|
||||||
props.y = _rebase0 ? 0 : -1;
|
props.y = _rebase0 ? 0 : -1;
|
||||||
|
|
||||||
|
props.switchColorMode = true;
|
||||||
|
|
||||||
int slot;
|
int slot;
|
||||||
if ((slot = _vm->_vidPlayer->openVideo(true, file, props)) >= 0) {
|
if ((slot = _vm->_vidPlayer->openVideo(true, file, props)) >= 0) {
|
||||||
if (_autoDouble) {
|
if (_autoDouble) {
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
namespace Gob {
|
namespace Gob {
|
||||||
|
|
||||||
VideoPlayer::Properties::Properties() : type(kVideoTypeTry), sprite(Draw::kFrontSurface),
|
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),
|
startFrame(-1), lastFrame(-1), endFrame(-1), forceSeek(false),
|
||||||
breakKey(kShortKeyEscape), palCmd(8), palStart(0), palEnd(255), palFrame(-1),
|
breakKey(kShortKeyEscape), palCmd(8), palStart(0), palEnd(255), palFrame(-1),
|
||||||
fade(false), waitEndFrame(true), canceled(false) {
|
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)))
|
if (!(video->decoder = openVideo(file, properties)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (video->decoder->isPaletted() != !_vm->isTrueColor()) {
|
||||||
|
if (!properties.switchColorMode)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
_vm->setTrueColor(!video->decoder->isPaletted());
|
||||||
|
|
||||||
|
video->decoder->colorModeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
// Set the filename
|
// Set the filename
|
||||||
video->fileName = file;
|
video->fileName = file;
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@ public:
|
|||||||
|
|
||||||
uint32 flags; ///< Video flags.
|
uint32 flags; ///< Video flags.
|
||||||
|
|
||||||
|
bool switchColorMode; ///< Switch between paletted / true color modes?
|
||||||
|
|
||||||
int32 startFrame; ///< Frame to start playback from.
|
int32 startFrame; ///< Frame to start playback from.
|
||||||
int32 lastFrame; ///< Frame to stop playback at.
|
int32 lastFrame; ///< Frame to stop playback at.
|
||||||
int32 endFrame; ///< Last frame of this playback cycle.
|
int32 endFrame; ///< Last frame of this playback cycle.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user