[Scummvm-cvs-logs] scummvm master -> 4ffaf4df376e6d93c1b5c4c820c975fdee64ec8f

bluegr bluegr at gmail.com
Wed Jan 7 10:52:51 CET 2015


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

Summary:
535249389a ZVISION: Add a new command, "dumpimage", to dump any game image to BMP
9420cc2faa ZVISION: Also handle paths in INQUIS.ZIX for the DVD version of ZGI
9f642074ba ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)
5949ab5aa6 ZVISION: Error out when a cursor file can't be found
364b72c29b ZVISION: Fix incorrect reference to cursor file
d70503cc98 ZVISION: Cleanup the ZIX file code
fb135b38ed ZVISION: Cleanup
2d0e9fc74a ZVISION: Move the screen initialization code into a separate function
cdbc06d0f7 ZVISION: Use a common function for loading game animations
e4969a98f8 ZVISION: Fix typo in include
4ffaf4df37 ZVISION: Add stubs for the hires VOB MPEG2 videos of ZGI DVD


Commit: 535249389a16f780fba51dd2c7ca8e1eddf65de9
    https://github.com/scummvm/scummvm/commit/535249389a16f780fba51dd2c7ca8e1eddf65de9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:23+02:00

Commit Message:
ZVISION: Add a new command, "dumpimage", to dump any game image to BMP

Changed paths:
    engines/zvision/core/console.cpp
    engines/zvision/core/console.h



diff --git a/engines/zvision/core/console.cpp b/engines/zvision/core/console.cpp
index b5e542d..65821b1 100644
--- a/engines/zvision/core/console.cpp
+++ b/engines/zvision/core/console.cpp
@@ -53,6 +53,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) {
 	registerCmd("location", WRAP_METHOD(Console, cmdLocation));
 	registerCmd("dumpfile", WRAP_METHOD(Console, cmdDumpFile));
 	registerCmd("dumpfiles", WRAP_METHOD(Console, cmdDumpFiles));
+	registerCmd("dumpimage", WRAP_METHOD(Console, cmdDumpImage));
 }
 
 bool Console::cmdLoadVideo(int argc, const char **argv) {
@@ -269,4 +270,62 @@ bool Console::cmdDumpFiles(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::cmdDumpImage(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Use %s <TGA/TGZ name> to dump a ZVision TGA/TGZ image into a regular BMP image\n", argv[0]);
+		return true;
+	}
+
+	Common::String fileName = argv[1];
+	if (!fileName.hasSuffix(".tga")) {
+		debugPrintf("%s is not an image file", argv[1]);
+	}
+
+	Common::File f;
+	if (!_engine->getSearchManager()->openFile(f, argv[1])) {
+		warning("File not found: %s", argv[1]);
+		return true;
+	}
+
+	Graphics::Surface surface;
+	_engine->getRenderManager()->readImageToSurface(argv[1], surface, false);
+
+	// Open file
+	Common::DumpFile out;
+
+	fileName.setChar('b', fileName.size() - 3);
+	fileName.setChar('m', fileName.size() - 2);
+	fileName.setChar('p', fileName.size() - 1);
+
+	out.open(fileName);
+
+	// Write BMP header
+	out.writeByte('B');
+	out.writeByte('M');
+	out.writeUint32LE(surface.h * surface.pitch + 54);
+	out.writeUint32LE(0);
+	out.writeUint32LE(54);
+	out.writeUint32LE(40);
+	out.writeUint32LE(surface.w);
+	out.writeUint32LE(surface.h);
+	out.writeUint16LE(1);
+	out.writeUint16LE(16);
+	out.writeUint32LE(0);
+	out.writeUint32LE(0);
+	out.writeUint32LE(0);
+	out.writeUint32LE(0);
+	out.writeUint32LE(0);
+	out.writeUint32LE(0);
+
+	// Write pixel data to BMP
+	out.write(surface.getPixels(), surface.pitch * surface.h);
+
+	out.flush();
+	out.close();
+
+	surface.free();
+
+	return true;
+}
+
 } // End of namespace ZVision
diff --git a/engines/zvision/core/console.h b/engines/zvision/core/console.h
index a7bd88e..ffce878 100644
--- a/engines/zvision/core/console.h
+++ b/engines/zvision/core/console.h
@@ -47,6 +47,7 @@ private:
 	bool cmdLocation(int argc, const char **argv);
 	bool cmdDumpFile(int argc, const char **argv);
 	bool cmdDumpFiles(int argc, const char **argv);
+	bool cmdDumpImage(int argc, const char **argv);
 };
 
 } // End of namespace ZVision


Commit: 9420cc2faaa54a782084d7386be29e72d97ffcef
    https://github.com/scummvm/scummvm/commit/9420cc2faaa54a782084d7386be29e72d97ffcef
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:24+02:00

Commit Message:
ZVISION: Also handle paths in INQUIS.ZIX for the DVD version of ZGI

Changed paths:
    engines/zvision/file/search_manager.cpp



diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp
index ec250ff6..814393a 100644
--- a/engines/zvision/file/search_manager.cpp
+++ b/engines/zvision/file/search_manager.cpp
@@ -175,6 +175,8 @@ void SearchManager::loadZix(const Common::String &name) {
 			// root folder instead
 			if (path.hasPrefix("zgi\\"))
 				path = Common::String(path.c_str() + 4);
+			if (path.hasPrefix("zgi_e\\"))
+				path = Common::String(path.c_str() + 6);
 
 			Common::Archive *arc;
 			char tempPath[128];


Commit: 9f642074ba8e17aa23b01bcee82b2293fe84f8f1
    https://github.com/scummvm/scummvm/commit/9f642074ba8e17aa23b01bcee82b2293fe84f8f1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:24+02:00

Commit Message:
ZVISION: Remove ActionRestoreGame and loading of r.svr (restart slot)

This is handled internally now, so r.svr isn't needed anymore

Changed paths:
    engines/zvision/scripting/actions.cpp
    engines/zvision/scripting/actions.h
    engines/zvision/scripting/scr_file_handling.cpp
    engines/zvision/scripting/script_manager.cpp
    engines/zvision/scripting/script_manager.h



diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index a61fa26..e41ac90 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -22,14 +22,13 @@
 
 #include "common/scummsys.h"
 
-#include "zvision/scripting/actions.h"
-
 #include "zvision/zvision.h"
 #include "zvision/scripting/script_manager.h"
 #include "zvision/graphics/render_manager.h"
 #include "zvision/sound/zork_raw.h"
 #include "zvision/video/zork_avi_decoder.h"
 #include "zvision/file/save_manager.h"
+#include "zvision/scripting/actions.h"
 #include "zvision/scripting/menu.h"
 #include "zvision/scripting/effects/timer_effect.h"
 #include "zvision/scripting/effects/music_effect.h"
@@ -804,22 +803,6 @@ bool ActionRandom::execute() {
 }
 
 //////////////////////////////////////////////////////////////////////////////
-// ActionRestoreGame
-//////////////////////////////////////////////////////////////////////////////
-
-ActionRestoreGame::ActionRestoreGame(ZVision *engine, int32 slotkey, const Common::String &line) :
-	ResultAction(engine, slotkey) {
-	char buf[128];
-	sscanf(line.c_str(), "%s", buf);
-	_fileName = Common::String(buf);
-}
-
-bool ActionRestoreGame::execute() {
-	_engine->getSaveManager()->loadGame(_fileName);
-	return false;
-}
-
-//////////////////////////////////////////////////////////////////////////////
 // ActionRotateTo
 //////////////////////////////////////////////////////////////////////////////
 
diff --git a/engines/zvision/scripting/actions.h b/engines/zvision/scripting/actions.h
index 8d43309..c2350bc 100644
--- a/engines/zvision/scripting/actions.h
+++ b/engines/zvision/scripting/actions.h
@@ -340,15 +340,6 @@ private:
 	ValueSlot *_max;
 };
 
-class ActionRestoreGame : public ResultAction {
-public:
-	ActionRestoreGame(ZVision *engine, int32 slotkey, const Common::String &line);
-	bool execute();
-
-private:
-	Common::String _fileName;
-};
-
 class ActionRotateTo : public ResultAction {
 public:
 	ActionRotateTo(ZVision *engine, int32 slotkey, const Common::String &line);
diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp
index 227c435..7856bf7 100644
--- a/engines/zvision/scripting/scr_file_handling.cpp
+++ b/engines/zvision/scripting/scr_file_handling.cpp
@@ -270,7 +270,9 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
 					// Only used by Zork: Nemesis
 					actionList.push_back(new ActionRegion(_engine, slot, args));
 				} else if (act.matchString("restore_game", true)) {
-					actionList.push_back(new ActionRestoreGame(_engine, slot, args));
+					// Only used by ZGI to load the restart game slot, r.svr.
+					_engine->getScriptManager()->reset();
+					_engine->getScriptManager()->changeLocation('g', 'a', 'r', 'y', 0);
 				} else if (act.matchString("rotate_to", true)) {
 					actionList.push_back(new ActionRotateTo(_engine, slot, args));
 				} else if (act.matchString("save_game", true)) {
diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp
index 464e8bf..ba38d3a 100644
--- a/engines/zvision/scripting/script_manager.cpp
+++ b/engines/zvision/scripting/script_manager.cpp
@@ -686,7 +686,7 @@ void ScriptManager::serialize(Common::WriteStream *stream) {
 		stream->writeSint16LE(getStateValue(i));
 }
 
-void ScriptManager::deserialize(Common::SeekableReadStream *stream) {
+void ScriptManager::reset() {
 	// Clear out the current table values
 	_globalState.clear();
 	_globalStateFlags.clear();
@@ -706,6 +706,10 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) {
 	_activeSideFx.clear();
 
 	_referenceTable.clear();
+}
+
+void ScriptManager::deserialize(Common::SeekableReadStream *stream) {
+	reset();
 
 	if (stream->readUint32BE() != MKTAG('Z', 'N', 'S', 'G') || stream->readUint32LE() != 4) {
 		changeLocation('g', 'a', 'r', 'y', 0);
diff --git a/engines/zvision/scripting/script_manager.h b/engines/zvision/scripting/script_manager.h
index 78c1b77..136b342 100644
--- a/engines/zvision/scripting/script_manager.h
+++ b/engines/zvision/scripting/script_manager.h
@@ -247,6 +247,7 @@ public:
 
 	void serialize(Common::WriteStream *stream);
 	void deserialize(Common::SeekableReadStream *stream);
+	void reset();
 
 	Location getCurrentLocation() const;
 	Location getLastLocation();


Commit: 5949ab5aa6ce6a8b39ea44795e638204393adaf6
    https://github.com/scummvm/scummvm/commit/5949ab5aa6ce6a8b39ea44795e638204393adaf6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:24+02:00

Commit Message:
ZVISION: Error out when a cursor file can't be found

Changed paths:
    engines/zvision/graphics/cursors/cursor.cpp



diff --git a/engines/zvision/graphics/cursors/cursor.cpp b/engines/zvision/graphics/cursors/cursor.cpp
index f32c686..2c01166 100644
--- a/engines/zvision/graphics/cursors/cursor.cpp
+++ b/engines/zvision/graphics/cursors/cursor.cpp
@@ -43,7 +43,7 @@ ZorkCursor::ZorkCursor(ZVision *engine, const Common::String &fileName)
 	  _hotspotY(0) {
 	Common::File file;
 	if (!engine->getSearchManager()->openFile(file, fileName))
-		return;
+		error("Cursor file %s does not exist", fileName.c_str());
 
 	uint32 magic = file.readUint32BE();
 	if (magic != MKTAG('Z', 'C', 'R', '1')) {


Commit: 364b72c29b2f4e9d3cd45f644523966c6564e5d5
    https://github.com/scummvm/scummvm/commit/364b72c29b2f4e9d3cd45f644523966c6564e5d5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:25+02:00

Commit Message:
ZVISION: Fix incorrect reference to cursor file

Changed paths:
    engines/zvision/graphics/cursors/cursor_manager.cpp



diff --git a/engines/zvision/graphics/cursors/cursor_manager.cpp b/engines/zvision/graphics/cursors/cursor_manager.cpp
index c364426..f3a5e73 100644
--- a/engines/zvision/graphics/cursors/cursor_manager.cpp
+++ b/engines/zvision/graphics/cursors/cursor_manager.cpp
@@ -37,7 +37,7 @@ const char *CursorManager::_cursorNames[NUM_CURSORS] = { "active", "arrow", "bac
                                                          "hright", "hup", "idle", "leftarrow", "rightarrow", "suggest_surround", "suggest_tilt", "turnaround", "zuparrow"
                                                        };
 
-const char *CursorManager::_zgiCursorFileNames[NUM_CURSORS] = { "g0gbc011.zcr", "g0gac001.zcr", "g0gac021.zcr", "g0gac031.zcr", "g0gac041.zcr", "g0gac051.zcr", "g0gac061.zcr", "g0gac071.zcr", "g0gac081.zcr",
+const char *CursorManager::_zgiCursorFileNames[NUM_CURSORS] = { "g0gbc011.zcr", "g0gac011.zcr", "g0gac021.zcr", "g0gac031.zcr", "g0gac041.zcr", "g0gac051.zcr", "g0gac061.zcr", "g0gac071.zcr", "g0gac081.zcr",
                                                                 "g0gac091.zcr", "g0gac101.zcr", "g0gac011.zcr", "g0gac111.zcr", "g0gac121.zcr", "g0gac131.zcr", "g0gac141.zcr", "g0gac151.zcr", "g0gac161.zcr"
                                                               };
 


Commit: d70503cc9842059302c73c7861ada557e25a52b5
    https://github.com/scummvm/scummvm/commit/d70503cc9842059302c73c7861ada557e25a52b5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:25+02:00

Commit Message:
ZVISION: Cleanup the ZIX file code

Also, add handling for 3 CDs, for Zork: Nemesis

Changed paths:
    engines/zvision/file/search_manager.cpp



diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp
index 814393a..626c777 100644
--- a/engines/zvision/file/search_manager.cpp
+++ b/engines/zvision/file/search_manager.cpp
@@ -169,44 +169,32 @@ void SearchManager::loadZix(const Common::String &name) {
 		line.trim();
 		if (line.matchString("----------*", true))
 			break;
-		else if (line.matchString("DIR:*", true) || line.matchString("CD0:*", true) || line.matchString("CD1:*", true)) {
+		else if (line.matchString("DIR:*", true) || line.matchString("CD0:*", true) || line.matchString("CD1:*", true) || line.matchString("CD2:*", true)) {
+			Common::Archive *arc;
+
 			Common::String path(line.c_str() + 5);
+			for (uint i = 0; i < path.size(); i++)
+				if (path[i] == '\\')
+					path.setChar('/', i);
+
 			// Check if INQUIS.ZIX refers to the ZGI folder, and check the game
 			// root folder instead
-			if (path.hasPrefix("zgi\\"))
+			if (path.hasPrefix("zgi/"))
 				path = Common::String(path.c_str() + 4);
-			if (path.hasPrefix("zgi_e\\"))
+			if (path.hasPrefix("zgi_e/"))
 				path = Common::String(path.c_str() + 6);
 
-			Common::Archive *arc;
-			char tempPath[128];
-			strcpy(tempPath, path.c_str());
-			for (uint i = 0; i < path.size(); i++)
-				if (tempPath[i] == '\\')
-					tempPath[i] = '/';
-
-			path = Common::String(tempPath);
 			if (path.size() && path[0] == '.')
 				path.deleteChar(0);
 			if (path.size() && path[0] == '/')
 				path.deleteChar(0);
+			if (path.size() && path.hasSuffix("/"))
+				path.deleteLastChar();
 
-			if (path.matchString("*.zfs", true))
+			if (path.matchString("*.zfs", true)) {
 				arc = new ZfsArchive(path);
-			else {
-				if (path.size()) {
-					if (path[path.size() - 1] == '\\' || path[path.size() - 1] == '/')
-						path.deleteLastChar();
-					if (path.size())
-						for (Common::List<Common::String>::iterator it = _dirList.begin(); it != _dirList.end(); ++it)
-							if (path.equalsIgnoreCase(*it)) {
-								path = *it;
-								break;
-							}
-				}
-
+			} else {
 				path = Common::String::format("%s/%s", _root.c_str(), path.c_str());
-
 				arc = new Common::FSDirectory(path);
 			}
 			archives.push_back(arc);


Commit: fb135b38ed25605d7b7bece9180784376e8408cc
    https://github.com/scummvm/scummvm/commit/fb135b38ed25605d7b7bece9180784376e8408cc
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:26+02:00

Commit Message:
ZVISION: Cleanup

Changed paths:
    engines/zvision/text/string_manager.cpp



diff --git a/engines/zvision/text/string_manager.cpp b/engines/zvision/text/string_manager.cpp
index 6b870d0..c62e18f 100644
--- a/engines/zvision/text/string_manager.cpp
+++ b/engines/zvision/text/string_manager.cpp
@@ -51,9 +51,8 @@ void StringManager::initialize(ZVisionGameId gameId) {
 
 void StringManager::loadStrFile(const Common::String &fileName) {
 	Common::File file;
-	if (!_engine->getSearchManager()->openFile(file, fileName)) {
+	if (!_engine->getSearchManager()->openFile(file, fileName))
 		error("%s does not exist. String parsing failed", fileName.c_str());
-	}
 
 	uint lineNumber = 0;
 	while (!file.eos()) {


Commit: 2d0e9fc74afd7578b368794a40afbc06f05c92db
    https://github.com/scummvm/scummvm/commit/2d0e9fc74afd7578b368794a40afbc06f05c92db
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:26+02:00

Commit Message:
ZVISION: Move the screen initialization code into a separate function

Changed paths:
    engines/zvision/zvision.cpp
    engines/zvision/zvision.h



diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 54991ac..b05c790 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -105,15 +105,6 @@ ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
 
 	debug(1, "ZVision::ZVision");
 
-	uint16 workingWindowWidth  = (gameDesc->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH  : ZGI_WORKING_WINDOW_WIDTH;
-	uint16 workingWindowHeight = (gameDesc->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_HEIGHT : ZGI_WORKING_WINDOW_HEIGHT;
-	_workingWindow = Common::Rect(
-						 (WINDOW_WIDTH  -  workingWindowWidth) / 2,
-						 (WINDOW_HEIGHT - workingWindowHeight) / 2,
-						((WINDOW_WIDTH  -  workingWindowWidth) / 2) + workingWindowWidth,
-						((WINDOW_HEIGHT - workingWindowHeight) / 2) + workingWindowHeight
-					 );
-
 	memset(_cheatBuffer, 0, sizeof(_cheatBuffer));
 }
 
@@ -211,7 +202,7 @@ void ZVision::initialize() {
 	} else if (_gameDescription->gameId == GID_NEMESIS)
 		_searchManager->loadZix("NEMESIS.ZIX");
 
-	initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, true, &_screenPixelFormat);
+	initScreen();
 
 	// Register random source
 	_rnd = new Common::RandomSource("zvision");
@@ -358,4 +349,17 @@ void ZVision::fpsTimer() {
 	_renderedFrameCount = 0;
 }
 
+void ZVision::initScreen() {
+	uint16 workingWindowWidth  = (_gameDescription->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_WIDTH  : ZGI_WORKING_WINDOW_WIDTH;
+	uint16 workingWindowHeight = (_gameDescription->gameId == GID_NEMESIS) ? ZNM_WORKING_WINDOW_HEIGHT : ZGI_WORKING_WINDOW_HEIGHT;
+	_workingWindow = Common::Rect(
+						 (WINDOW_WIDTH  -  workingWindowWidth) / 2,
+						 (WINDOW_HEIGHT - workingWindowHeight) / 2,
+						((WINDOW_WIDTH  -  workingWindowWidth) / 2) + workingWindowWidth,
+						((WINDOW_HEIGHT - workingWindowHeight) / 2) + workingWindowHeight
+					 );
+
+	initGraphics(WINDOW_WIDTH, WINDOW_HEIGHT, true, &_screenPixelFormat);
+}
+
 } // End of namespace ZVision
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index ad22dda..a3bcb38 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -194,6 +194,8 @@ public:
 		_clock.stop();
 	}
 
+	void initScreen();
+
 	/**
 	 * Play a video until it is finished. This is a blocking call. It will call
 	 * _clock.stop() when the video starts and _clock.start() when the video finishes.


Commit: cdbc06d0f74453584eac0611fcbe01785c6619c4
    https://github.com/scummvm/scummvm/commit/cdbc06d0f74453584eac0611fcbe01785c6619c4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:26+02:00

Commit Message:
ZVISION: Use a common function for loading game animations

Changed paths:
    engines/zvision/scripting/actions.cpp



diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index e41ac90..4474a88 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -21,12 +21,11 @@
  */
 
 #include "common/scummsys.h"
+#include "video/video_decoder.h"
 
 #include "zvision/zvision.h"
 #include "zvision/scripting/script_manager.h"
 #include "zvision/graphics/render_manager.h"
-#include "zvision/sound/zork_raw.h"
-#include "zvision/video/zork_avi_decoder.h"
 #include "zvision/file/save_manager.h"
 #include "zvision/scripting/actions.h"
 #include "zvision/scripting/menu.h"
@@ -45,10 +44,6 @@
 #include "zvision/graphics/effects/wave.h"
 #include "zvision/graphics/cursors/cursor_manager.h"
 
-#include "common/file.h"
-
-#include "audio/decoders/wave.h"
-
 namespace ZVision {
 
 //////////////////////////////////////////////////////////////////////////////
@@ -915,35 +910,33 @@ ActionStreamVideo::ActionStreamVideo(ZVision *engine, int32 slotkey, const Commo
 }
 
 bool ActionStreamVideo::execute() {
-	ZorkAVIDecoder decoder;
-	Common::File *_file = _engine->getSearchManager()->openFile(_fileName);
+	Video::VideoDecoder *decoder;
+	Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1);
 
-	if (_file) {
-		if (!decoder.loadStream(_file)) {
-			return true;
-		}
+	Common::String subname = _fileName;
+	subname.setChar('s', subname.size() - 3);
+	subname.setChar('u', subname.size() - 2);
+	subname.setChar('b', subname.size() - 1);
 
-		_engine->getCursorManager()->showMouse(false);
+	if (!_engine->getSearchManager()->hasFile(_fileName))
+		return true;
 
-		Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1);
+	decoder = _engine->loadAnimation(_fileName);
 
-		Common::String subname = _fileName;
-		subname.setChar('s', subname.size() - 3);
-		subname.setChar('u', subname.size() - 2);
-		subname.setChar('b', subname.size() - 1);
+	_engine->getCursorManager()->showMouse(false);
 
-		Subtitle *sub = NULL;
+	Subtitle *sub = NULL;
 
-		if (_engine->getSearchManager()->hasFile(subname))
-			sub = new Subtitle(_engine, subname);
+	if (_engine->getSearchManager()->hasFile(subname))
+		sub = new Subtitle(_engine, subname);
 
-		_engine->playVideo(decoder, destRect, _skippable, sub);
+	_engine->playVideo(*decoder, destRect, _skippable, sub);
+	delete decoder;
 
-		_engine->getCursorManager()->showMouse(true);
+	_engine->getCursorManager()->showMouse(true);
 
-		if (sub)
-			delete sub;
-	}
+	if (sub)
+		delete sub;
 
 	return true;
 }


Commit: e4969a98f82f151382106b89f170990cb7eed54b
    https://github.com/scummvm/scummvm/commit/e4969a98f82f151382106b89f170990cb7eed54b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:27+02:00

Commit Message:
ZVISION: Fix typo in include

Changed paths:
    engines/zvision/video/video.cpp



diff --git a/engines/zvision/video/video.cpp b/engines/zvision/video/video.cpp
index 0913b28..3edad7a 100644
--- a/engines/zvision/video/video.cpp
+++ b/engines/zvision/video/video.cpp
@@ -29,7 +29,7 @@
 #include "zvision/zvision.h"
 #include "zvision/core/clock.h"
 #include "zvision/graphics/render_manager.h"
-#include "zvision/scripting//script_manager.h"
+#include "zvision/scripting/script_manager.h"
 #include "zvision/text/subtitles.h"
 #include "zvision/video/rlf_decoder.h"
 #include "zvision/video/zork_avi_decoder.h"


Commit: 4ffaf4df376e6d93c1b5c4c820c975fdee64ec8f
    https://github.com/scummvm/scummvm/commit/4ffaf4df376e6d93c1b5c4c820c975fdee64ec8f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-01-07T11:42:27+02:00

Commit Message:
ZVISION: Add stubs for the hires VOB MPEG2 videos of ZGI DVD

VOB file handling is based on clone2727's work. The lowres videos are
played for now, until AC3 sound handling is implemented

Changed paths:
    engines/zvision/detection.cpp
    engines/zvision/scripting/actions.cpp
    engines/zvision/scripting/script_manager.h
    engines/zvision/video/video.cpp
    engines/zvision/zvision.cpp



diff --git a/engines/zvision/detection.cpp b/engines/zvision/detection.cpp
index 1eaff83..5792377 100644
--- a/engines/zvision/detection.cpp
+++ b/engines/zvision/detection.cpp
@@ -59,6 +59,7 @@ namespace ZVision {
 #define GAMEOPTION_DOUBLE_FPS                 GUIO_GAMEOPTIONS2
 #define GAMEOPTION_ENABLE_VENUS               GUIO_GAMEOPTIONS3
 #define GAMEOPTION_DISABLE_ANIM_WHILE_TURNING GUIO_GAMEOPTIONS4
+#define GAMEOPTION_USE_HIRES_MPEG_MOVIES      GUIO_GAMEOPTIONS5
 
 static const ZVisionGameDescription gameDescriptions[] = {
 
@@ -113,7 +114,7 @@ static const ZVisionGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
-			GUIO3(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING)
+			GUIO4(GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_DOUBLE_FPS, GAMEOPTION_DISABLE_ANIM_WHILE_TURNING, GAMEOPTION_USE_HIRES_MPEG_MOVIES)
 		},
 		GID_GRANDINQUISITOR
 	},
@@ -186,6 +187,16 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 
+	{
+		GAMEOPTION_USE_HIRES_MPEG_MOVIES,
+		{
+			_s("Use the hires MPEG movies"),
+			_s("Use the hires MPEG movies of the DVD version, instead of the lowres AVI ones"),
+			"mpegmovies",
+			true
+		}
+	},
+
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index 4474a88..f60fdbb 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -913,6 +913,19 @@ bool ActionStreamVideo::execute() {
 	Video::VideoDecoder *decoder;
 	Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1);
 
+#ifdef USE_MPEG2
+	Common::String hiresFileName = _fileName;
+	hiresFileName.setChar('d', hiresFileName.size() - 8);
+	hiresFileName.setChar('v', hiresFileName.size() - 3);
+	hiresFileName.setChar('o', hiresFileName.size() - 2);
+	hiresFileName.setChar('b', hiresFileName.size() - 1);
+
+	if (_engine->getScriptManager()->getStateValue(StateKey_MPEGMovies) == 1 &&_engine->getSearchManager()->hasFile(hiresFileName))
+		// TODO: Enable once VOB + AC3 support is implemented
+		//_fileName = hiresFileName;
+		warning("The hires videos of the DVD version of ZGI aren't supported yet, using lowres");
+#endif
+
 	Common::String subname = _fileName;
 	subname.setChar('s', subname.size() - 3);
 	subname.setChar('u', subname.size() - 2);
diff --git a/engines/zvision/scripting/script_manager.h b/engines/zvision/scripting/script_manager.h
index 136b342..a05c112 100644
--- a/engines/zvision/scripting/script_manager.h
+++ b/engines/zvision/scripting/script_manager.h
@@ -87,6 +87,7 @@ enum StateKey {
 	StateKey_JapanFonts = 75,
 	StateKey_ExecScopeStyle = 76,
 	StateKey_Brightness = 77,
+	StateKey_MPEGMovies = 78,
 	StateKey_EF9_R = 91,
 	StateKey_EF9_G = 92,
 	StateKey_EF9_B = 93,
diff --git a/engines/zvision/video/video.cpp b/engines/zvision/video/video.cpp
index 3edad7a..66a567a 100644
--- a/engines/zvision/video/video.cpp
+++ b/engines/zvision/video/video.cpp
@@ -23,6 +23,11 @@
 #include "common/scummsys.h"
 #include "common/system.h"
 #include "video/video_decoder.h"
+// TODO: Enable once VOB + AC3 support is implemented
+#if 0
+//#ifdef USE_MPEG2
+#include "video/mpegps_decoder.h"
+#endif
 #include "engines/util.h"
 #include "graphics/surface.h"
 
@@ -45,6 +50,12 @@ Video::VideoDecoder *ZVision::loadAnimation(const Common::String &fileName) {
 		animation = new RLFDecoder();
 	else if (tmpFileName.hasSuffix(".avi"))
 		animation = new ZorkAVIDecoder();
+// TODO: Enable once VOB + AC3 support is implemented
+#if 0
+//#ifdef USE_MPEG2
+	else if (tmpFileName.hasSuffix(".vob"))
+		animation = new Video::MPEGPSDecoder();
+#endif
 	else
 		error("Unknown suffix for animation %s", fileName.c_str());
 
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index b05c790..1349aaa 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -52,7 +52,7 @@
 
 namespace ZVision {
 
-#define ZVISION_SETTINGS_KEYS_COUNT 11
+#define ZVISION_SETTINGS_KEYS_COUNT 12
 
 struct zvisionIniSettings {
 	const char *name;
@@ -73,7 +73,8 @@ struct zvisionIniSettings {
 	{"panarotatespeed", StateKey_RotateSpeed, 540, false, true},	// checked by universe.scr
 	{"noanimwhileturning", StateKey_NoTurnAnim, -1, false, true},	// toggle playing animations during pana rotation
 	{"venusenabled", StateKey_VenusEnable, -1, true, true},
-	{"subtitles", StateKey_Subtitles, -1, true, true}
+	{"subtitles", StateKey_Subtitles, -1, true, true},
+	{"mpegmovies", StateKey_MPEGMovies, -1, true, true}		// Zork: Grand Inquisitor DVD hi-res MPEG movies (0 = normal, 1 = hires, 2 = disable option)
 };
 
 ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
@@ -230,6 +231,11 @@ void ZVision::initialize() {
 
 	loadSettings();
 
+#ifndef USE_MPEG2
+	// libmpeg2 not loaded, disable the MPEG2 movies option
+	_scriptManager->setStateValue(StateKey_MPEGMovies, 2);
+#endif
+
 	// Create debugger console. It requires GFX to be initialized
 	_console = new Console(this);
 	_doubleFPS = ConfMan.getBool("doublefps");






More information about the Scummvm-git-logs mailing list