[Scummvm-git-logs] scummvm master -> 07316afaa423a95308364290554379491317909d

dreammaster dreammaster at scummvm.org
Thu Oct 6 04:44:22 CEST 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:
07316afaa4 TITANIC: Add movie command to the debugger


Commit: 07316afaa423a95308364290554379491317909d
    https://github.com/scummvm/scummvm/commit/07316afaa423a95308364290554379491317909d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-05T22:44:14-04:00

Commit Message:
TITANIC: Add movie command to the debugger

Changed paths:
    engines/titanic/debugger.cpp
    engines/titanic/debugger.h
    engines/titanic/game/movie_tester.h



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index a9da83f..086c6bf 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -23,7 +23,9 @@
 #include "titanic/debugger.h"
 #include "titanic/titanic.h"
 #include "titanic/core/tree_item.h"
+#include "titanic/game/movie_tester.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/support/movie.h"
 
 namespace Titanic {
 
@@ -33,6 +35,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("room",			WRAP_METHOD(Debugger, cmdRoom));
 	registerCmd("pet",			WRAP_METHOD(Debugger, cmdPET));
 	registerCmd("item",			WRAP_METHOD(Debugger, cmdItem));
+	registerCmd("movie",		WRAP_METHOD(Debugger, cmdMovie));
 }
 
 int Debugger::strToInt(const char *s) {
@@ -260,4 +263,35 @@ bool Debugger::cmdItem(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger::cmdMovie(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("movie filename.avi [startFrame endFrame]\n");
+		return true;
+	}
+
+	CViewItem *view = g_vm->_window->_gameManager->getView();
+	CMovieTester *tester = static_cast<CMovieTester *>(
+		view->findChildInstanceOf(CMovieTester::_type));
+	if (!tester) {
+		// No movie tester present, so create one
+		tester = new CMovieTester();
+		tester->addUnder(view);
+	}
+
+	CString filename(argv[1]);
+	if (!filename.hasSuffix(".avi"))
+		filename += ".avi";
+	tester->loadMovie(filename);
+
+	if (argc == 2) {
+		tester->playMovie(MOVIE_STOP_PREVIOUS);
+	} else {
+		uint startFrame = strToInt(argv[2]);
+		uint endFrame = strToInt(argv[2]);
+		tester->playMovie(startFrame, endFrame, MOVIE_STOP_PREVIOUS);
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h
index 5edb7cb..cae8a07 100644
--- a/engines/titanic/debugger.h
+++ b/engines/titanic/debugger.h
@@ -89,6 +89,11 @@ private:
 	 * Item handling
 	 */
 	bool cmdItem(int argc, const char **argv);
+
+	/**
+	 * Shows a movie
+	 */
+	bool cmdMovie(int argc, const char **argv);
 protected:
 	TitanicEngine *_vm;
 public:
diff --git a/engines/titanic/game/movie_tester.h b/engines/titanic/game/movie_tester.h
index 17a7d48..60eacee 100644
--- a/engines/titanic/game/movie_tester.h
+++ b/engines/titanic/game/movie_tester.h
@@ -45,6 +45,14 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Loads a movie
+	 */
+	void loadMovie(const CString &name, bool pendingFlag = true) {
+		CGameObject::loadMovie(name, pendingFlag);
+		_surface->flipVertically();
+	}
 };
 
 } // End of namespace Titanic





More information about the Scummvm-git-logs mailing list