[Scummvm-git-logs] scummvm master -> 2eea7dc9615b665ffcae881f8cf921a295399453

csnover csnover at users.noreply.github.com
Sat Nov 5 02:46:26 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2eea7dc961 SCI32: Implement kPlayVMDIgnorePalettes


Commit: 2eea7dc9615b665ffcae881f8cf921a295399453
    https://github.com/scummvm/scummvm/commit/2eea7dc9615b665ffcae881f8cf921a295399453
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-11-04T20:45:45-05:00

Commit Message:
SCI32: Implement kPlayVMDIgnorePalettes

Used in Shivers room 35170 when pressing the play button.

Changed paths:
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kvideo.cpp
    engines/sci/graphics/video32.cpp
    engines/sci/graphics/video32.h



diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index cce9a22..03c8a67 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -466,6 +466,7 @@ reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDOpen(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDInit(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDClose(EngineState *s, int argc, reg_t *argv);
+reg_t kPlayVMDIgnorePalettes(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDGetStatus(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDPlayUntilEvent(EngineState *s, int argc, reg_t *argv);
 reg_t kPlayVMDShowCursor(EngineState *s, int argc, reg_t *argv);
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 6e88112..8093147 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -466,6 +466,7 @@ static const SciKernelMapSubEntry kPlayVMD_subops[] = {
 	{ SIG_SINCE_SCI21,     0, MAP_CALL(PlayVMDOpen),               "r(i)(i)",              NULL },
 	{ SIG_SINCE_SCI21,     1, MAP_CALL(PlayVMDInit),               "ii(i)(i)(ii)",         NULL },
 	{ SIG_SINCE_SCI21,     6, MAP_CALL(PlayVMDClose),              "",                     NULL },
+	{ SIG_SINCE_SCI21,     7, MAP_CALL(PlayVMDIgnorePalettes),     "",                     NULL },
 	{ SIG_SINCE_SCI21,    10, MAP_CALL(PlayVMDGetStatus),          "",                     NULL },
 	{ SIG_SINCE_SCI21,    14, MAP_CALL(PlayVMDPlayUntilEvent),     "i(i)(i)",              NULL },
 	{ SIG_SINCE_SCI21,    16, MAP_CALL(PlayVMDShowCursor),         "i",                    NULL },
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index 83a0288..11378d7 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -428,6 +428,11 @@ reg_t kPlayVMDClose(EngineState *s, int argc, reg_t *argv) {
 	return make_reg(0, g_sci->_video32->getVMDPlayer().close());
 }
 
+reg_t kPlayVMDIgnorePalettes(EngineState *s, int argc, reg_t *argv) {
+	g_sci->_video32->getVMDPlayer().ignorePalettes();
+	return s->r_acc;
+}
+
 reg_t kPlayVMDGetStatus(EngineState *s, int argc, reg_t *argv) {
 	return make_reg(0, g_sci->_video32->getVMDPlayer().getStatus());
 }
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 8e267f9..bf0c990 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -503,6 +503,7 @@ VMDPlayer::VMDPlayer(SegManager *segMan, EventManager *eventMan) :
 	_blackLines(false),
 	_leaveScreenBlack(false),
 	_leaveLastFrame(false),
+	_ignorePalettes(false),
 
 	_blackoutPlane(nullptr),
 
@@ -566,6 +567,7 @@ VMDPlayer::IOStatus VMDPlayer::close() {
 	_decoder->close();
 	_isOpen = false;
 	_isInitialized = false;
+	_ignorePalettes = false;
 
 	if (!_planeIsOwned && _screenItem != nullptr) {
 		g_sci->_gfxFrameout->deleteScreenItem(*_screenItem);
@@ -827,7 +829,7 @@ void VMDPlayer::renderFrame() const {
 	// we are just submitting it directly here because the decoder exposes
 	// this information a little bit differently than the one in SSCI
 	const bool dirtyPalette = _decoder->hasDirtyPalette();
-	if (dirtyPalette) {
+	if (dirtyPalette && !_ignorePalettes) {
 		Palette palette;
 		palette.timestamp = g_sci->getTickCount();
 		for (uint16 i = 0; i < _startColor; ++i) {
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index c3ae891..4fc627e 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -353,6 +353,13 @@ private:
 
 #pragma mark -
 #pragma mark VMDPlayer - Rendering
+public:
+	/**
+	 * Causes the VMD player to ignore all palettes in
+	 * the currently playing video.
+	 */
+	void ignorePalettes() { _ignorePalettes = true; }
+
 private:
 	/**
 	 * The location of the VMD plane, in game script
@@ -414,6 +421,11 @@ private:
 	bool _leaveLastFrame;
 
 	/**
+	 * Whether or not palettes from the VMD should be ignored.
+	 */
+	bool _ignorePalettes;
+
+	/**
 	 * Renders a frame of video to the output bitmap.
 	 */
 	void renderFrame() const;





More information about the Scummvm-git-logs mailing list