[Scummvm-cvs-logs] scummvm master -> 23a9a27a575301ccfd39782feb5d863d14f439c6

whoozle whoozle at yandex.ru
Wed Nov 2 21:30:29 CET 2011


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:
23a9a27a57 TEENAGENT: Added "animation", "actor_animation" and "call" commands to debug console.


Commit: 23a9a27a575301ccfd39782feb5d863d14f439c6
    https://github.com/scummvm/scummvm/commit/23a9a27a575301ccfd39782feb5d863d14f439c6
Author: Vladimir Menshakov (whoozle at yandex.ru)
Date: 2011-11-02T13:02:03-07:00

Commit Message:
TEENAGENT: Added "animation", "actor_animation" and "call" commands to debug console.

Changed paths:
    engines/teenagent/console.cpp
    engines/teenagent/console.h



diff --git a/engines/teenagent/console.cpp b/engines/teenagent/console.cpp
index 5164b44..9ab6001 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 ab2f068..4dbdd3f 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;
 };






More information about the Scummvm-git-logs mailing list