aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-08 21:22:32 +0000
committerVladimir Menshakov2009-11-08 21:22:32 +0000
commitd5bff15b228d229336b0822cd5b7d6b99213db92 (patch)
treee820953d1b17b3e3e01ca2ab88b5740b7d0df77b /engines
parent276ee4a4f89a34a6366fa7009bc40492c3daa67b (diff)
downloadscummvm-rg350-d5bff15b228d229336b0822cd5b7d6b99213db92.tar.gz
scummvm-rg350-d5bff15b228d229336b0822cd5b7d6b99213db92.tar.bz2
scummvm-rg350-d5bff15b228d229336b0822cd5b7d6b99213db92.zip
added set_ons command to console
svn-id: r45761
Diffstat (limited to 'engines')
-rw-r--r--engines/teenagent/console.cpp34
-rw-r--r--engines/teenagent/console.h1
2 files changed, 35 insertions, 0 deletions
diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp
index 21fb834ce0..ef317097a6 100644
--- a/engines/teenagent/console.cpp
+++ b/engines/teenagent/console.cpp
@@ -30,6 +30,7 @@ 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));
}
bool Console::enableObject(int argc, const char **argv) {
@@ -61,4 +62,37 @@ bool Console::enableObject(int argc, const char **argv) {
return true;
}
+bool Console::setOns(int argc, const char **argv) {
+ if (argc < 3) {
+ DebugPrintf("usage: %s index(0-3) value [scene_id]\n", argv[0]);
+ return true;
+ }
+
+ int index = atoi(argv[1]);
+ if (index < 0 || index > 3) {
+ DebugPrintf("index %d is invalid\n", index);
+ return true;
+ }
+
+ int value = 0;
+ value = atoi(argv[2]);
+ if (value < 0) {
+ DebugPrintf("invalid value\n");
+ return true;
+ }
+
+ int scene_id = 0;
+ if (argc > 3) {
+ scene_id = atoi(argv[3]);
+ if (scene_id < 0) {
+ DebugPrintf("scene id %d is invalid\n", scene_id);
+ return true;
+ }
+ }
+
+ _engine->setOns(index, value, scene_id);
+
+ return true;
+}
+
}
diff --git a/engines/teenagent/console.h b/engines/teenagent/console.h
index 83a21f223f..c0cc75da97 100644
--- a/engines/teenagent/console.h
+++ b/engines/teenagent/console.h
@@ -37,6 +37,7 @@ public:
private:
bool enableObject(int argc, const char **argv);
+ bool setOns(int argc, const char **argv);
TeenAgentEngine *_engine;
};