aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2011-11-03 00:02:03 +0400
committerVladimir Menshakov2011-11-03 00:02:03 +0400
commit23a9a27a575301ccfd39782feb5d863d14f439c6 (patch)
treefb662dcd058eceb6ba3591038d1af70aef3b42a8 /engines/teenagent
parent33ed1b1d47ce6b2c3e894480b32fe515f4483912 (diff)
downloadscummvm-rg350-23a9a27a575301ccfd39782feb5d863d14f439c6.tar.gz
scummvm-rg350-23a9a27a575301ccfd39782feb5d863d14f439c6.tar.bz2
scummvm-rg350-23a9a27a575301ccfd39782feb5d863d14f439c6.zip
TEENAGENT: Added "animation", "actor_animation" and "call" commands to debug console.
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/console.cpp64
-rw-r--r--engines/teenagent/console.h3
2 files changed, 63 insertions, 4 deletions
diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp
index 5164b44729..9ab6001d54 100644
--- a/engines/teenagent/console.cpp
+++ b/engines/teenagent/console.cpp
@@ -25,10 +25,13 @@
namespace TeenAgent {
Console::Console(TeenAgentEngine *engine) : _engine(engine) {
- DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject));
- DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject));
- DCmd_Register("set_ons", WRAP_METHOD(Console, setOns));
- DCmd_Register("set_music", WRAP_METHOD(Console, setMusic));
+ DCmd_Register("enable_object", WRAP_METHOD(Console, enableObject));
+ DCmd_Register("disable_object", WRAP_METHOD(Console, enableObject));
+ DCmd_Register("set_ons", WRAP_METHOD(Console, setOns));
+ DCmd_Register("set_music", WRAP_METHOD(Console, setMusic));
+ DCmd_Register("animation", WRAP_METHOD(Console, playAnimation));
+ DCmd_Register("actor_animation", WRAP_METHOD(Console, playActorAnimation));
+ DCmd_Register("call", WRAP_METHOD(Console, call));
}
bool Console::enableObject(int argc, const char **argv) {
@@ -97,13 +100,66 @@ bool Console::setMusic(int argc, const char **argv) {
DebugPrintf("usage: %s index(1-11)\n", argv[0]);
return true;
}
+
int index = atoi(argv[1]);
if (index <= 0 || index > 11) {
DebugPrintf("invalid value\n");
return true;
}
+
_engine->setMusic(index);
return true;
}
+bool Console::playAnimation(int argc, const char **argv) {
+ if (argc < 3) {
+ DebugPrintf("usage: %s id slot(0-3)\n", argv[0]);
+ return true;
+ }
+
+ int id = atoi(argv[1]);
+ int slot = atoi(argv[2]);
+ if (id < 0 || slot < 0 || slot > 3) {
+ DebugPrintf("invalid slot or animation id\n");
+ return true;
+ }
+
+ _engine->playAnimation(id, slot);
+ return true;
+}
+
+bool Console::playActorAnimation(int argc, const char **argv) {
+ if (argc < 2) {
+ DebugPrintf("usage: %s id\n", argv[0]);
+ return true;
+ }
+
+ int id = atoi(argv[1]);
+ if (id < 0) {
+ DebugPrintf("invalid animation id\n");
+ return true;
+ }
+
+ _engine->playActorAnimation(id);
+ return true;
+}
+
+bool Console::call(int argc, const char **argv) {
+ if (argc < 2) {
+ DebugPrintf("usage: %s 0xHEXADDR\n", argv[0]);
+ return true;
+ }
+
+ uint addr;
+ if (sscanf(argv[1], "0x%x", &addr) != 1) {
+ DebugPrintf("invalid address\n");
+ return true;
+ }
+
+ if (!_engine->processCallback(addr))
+ DebugPrintf("calling callback %04x failed\n", addr);
+
+ return true;
+}
+
}
diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h
index ab2f068520..4dbdd3fc07 100644
--- a/engines/teenagent/console.h
+++ b/engines/teenagent/console.h
@@ -36,6 +36,9 @@ private:
bool enableObject(int argc, const char **argv);
bool setOns(int argc, const char **argv);
bool setMusic(int argc, const char **argv);
+ bool playAnimation(int argc, const char **argv);
+ bool playActorAnimation(int argc, const char **argv);
+ bool call(int argc, const char **argv);
TeenAgentEngine *_engine;
};