[Scummvm-cvs-logs] scummvm master -> 7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc

dreammaster dreammaster at scummvm.org
Mon Oct 13 23:00:05 CEST 2014


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:
7f7e144dd2 MADS: Add debugger commands for playing text and anim cutscenes


Commit: 7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc
    https://github.com/scummvm/scummvm/commit/7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-10-13T16:59:15-04:00

Commit Message:
MADS: Add debugger commands for playing text and anim cutscenes

Changed paths:
    engines/mads/debugger.cpp
    engines/mads/debugger.h
    engines/mads/nebular/menu_nebular.cpp



diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp
index 6bc6cf5..ee967cb 100644
--- a/engines/mads/debugger.cpp
+++ b/engines/mads/debugger.cpp
@@ -24,6 +24,7 @@
 #include "mads/compression.h"
 #include "mads/mads.h"
 #include "mads/debugger.h"
+#include "mads/nebular/menu_nebular.h"
 
 namespace MADS {
 
@@ -46,6 +47,8 @@ Debugger::Debugger(MADSEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("show_item", WRAP_METHOD(Debugger, Cmd_ShowItem));
 	registerCmd("dump_items", WRAP_METHOD(Debugger, Cmd_DumpItems));
 	registerCmd("item", WRAP_METHOD(Debugger, Cmd_Item));
+	registerCmd("play_anim", WRAP_METHOD(Debugger, Cmd_PlayAnim));
+	registerCmd("play_text", WRAP_METHOD(Debugger, Cmd_PlayText));
 }
 
 static int strToInt(const char *s) {
@@ -348,4 +351,44 @@ bool Debugger::Cmd_Item(int argc, const char **argv) {
 	}
 }
 
+bool Debugger::Cmd_PlayAnim(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Usage: %s <anim name>\n", argv[0]);
+		return true;
+	} else {
+		Common::String resName = argv[1];
+		if (resName.hasPrefix("@"))
+			resName.deleteChar(0);
+
+		Common::File f;
+		if (f.exists(resName) || f.exists(resName + ".res")) {
+			Nebular::AnimationView::execute(_vm, resName);
+			return false;
+		} else {
+			debugPrintf("Could not find resource file\n");
+			return true;
+		}
+	}
+}
+
+bool Debugger::Cmd_PlayText(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Usage: %s <text name>\n", argv[0]);
+		return true;
+	} else {
+		Common::String resName = argv[1];
+		if (resName.hasPrefix("@"))
+			resName.deleteChar(0);
+
+		Common::File f;
+		if (f.exists(resName) || f.exists(resName + ".res")) {
+			Nebular::TextView::execute(_vm, resName);
+			return false;
+		} else {
+			debugPrintf("Could not find resource file\n");
+			return true;
+		}
+	}
+}
+
 } // End of namespace MADS
diff --git a/engines/mads/debugger.h b/engines/mads/debugger.h
index 351eb13..c8fee5f 100644
--- a/engines/mads/debugger.h
+++ b/engines/mads/debugger.h
@@ -49,6 +49,8 @@ protected:
 	bool Cmd_ShowItem(int argc, const char **argv);
 	bool Cmd_DumpItems(int argc, const char **argv);
 	bool Cmd_Item(int argc, const char **argv);
+	bool Cmd_PlayAnim(int argc, const char **argv);
+	bool Cmd_PlayText(int argc, const char **argv);
 public:
 	bool _showMousePos;
 public:
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index d5d7021..355cef6 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -793,6 +793,8 @@ void AnimationView::execute(MADSEngine *vm, const Common::String &resName) {
 }
 
 AnimationView::AnimationView(MADSEngine *vm) : MenuView(vm) {
+	_redrawFlag = false;
+
 	_soundDriverLoaded = false;
 	_previousUpdate = 0;
 	_screenId = -1;






More information about the Scummvm-git-logs mailing list