aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-10-13 16:59:15 -0400
committerPaul Gilbert2014-10-13 16:59:15 -0400
commit7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc (patch)
tree21605e8bde1cd1b732268c630eaae40c35d58803 /engines
parentffe58e058c40de73e6fe45aa87745f3fe9e48cf1 (diff)
downloadscummvm-rg350-7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc.tar.gz
scummvm-rg350-7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc.tar.bz2
scummvm-rg350-7f7e144dd2867bf87d4724f4c72c0a6ebe1b77fc.zip
MADS: Add debugger commands for playing text and anim cutscenes
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/debugger.cpp43
-rw-r--r--engines/mads/debugger.h2
-rw-r--r--engines/mads/nebular/menu_nebular.cpp2
3 files changed, 47 insertions, 0 deletions
diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp
index 6bc6cf572d..ee967cb17e 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 351eb13615..c8fee5f5b2 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 d5d7021d76..355cef60a4 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;