[Scummvm-cvs-logs] SF.net SVN: scummvm:[42093] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jul 4 17:22:43 CEST 2009


Revision: 42093
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42093&view=rev
Author:   thebluegr
Date:     2009-07-04 15:22:42 +0000 (Sat, 04 Jul 2009)

Log Message:
-----------
Added a new console command, "selector", which attempts to find a selector by name

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/console.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2009-07-04 15:21:12 UTC (rev 42092)
+++ scummvm/trunk/engines/sci/console.cpp	2009-07-04 15:22:42 UTC (rev 42093)
@@ -67,6 +67,7 @@
 	// Kernel
 //	DCmd_Register("classes",			WRAP_METHOD(Console, cmdClasses));	// TODO
 	DCmd_Register("opcodes",			WRAP_METHOD(Console, cmdOpcodes));
+	DCmd_Register("selector",			WRAP_METHOD(Console, cmdSelector));
 	DCmd_Register("selectors",			WRAP_METHOD(Console, cmdSelectors));
 	DCmd_Register("functions",			WRAP_METHOD(Console, cmdKernelFunctions));
 	DCmd_Register("class_table",		WRAP_METHOD(Console, cmdClassTable));
@@ -239,6 +240,7 @@
 	DebugPrintf("Kernel:\n");
 	DebugPrintf(" opcodes - Lists the opcode names\n");
 	DebugPrintf(" selectors - Lists the selector names\n");
+	DebugPrintf(" selector - Attempts to find the requested selector by name\n");
 	DebugPrintf(" functions - Lists the kernel functions\n");
 	DebugPrintf(" class_table - Shows the available classes\n");
 	DebugPrintf("\n");
@@ -392,6 +394,25 @@
 	return true;
 }
 
+bool Console::cmdSelector(int argc, const char **argv) {
+	if (argc < 2) {
+		DebugPrintf("Attempts to find the requested selector by name.\n");
+		DebugPrintf("Usage: %s <selector name>\n", argv[0]);
+		return true;
+	}
+
+	for (uint seeker = 0; seeker < _vm->_gamestate->_kernel->getSelectorNamesSize(); seeker++) {
+		if (!scumm_stricmp(_vm->_gamestate->_kernel->getSelectorName(seeker).c_str(), argv[1])) {
+			DebugPrintf("Selector %s found at %03x\n", _vm->_gamestate->_kernel->getSelectorName(seeker).c_str(), seeker);
+			return true;
+		}
+	}
+
+	DebugPrintf("Selector %s wasn't found\n", argv[1]);
+
+	return true;
+}
+
 bool Console::cmdSelectors(int argc, const char **argv) {
 	DebugPrintf("Selector names in numeric order:\n");
 	for (uint seeker = 0; seeker < _vm->_gamestate->_kernel->getSelectorNamesSize(); seeker++) {

Modified: scummvm/trunk/engines/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h	2009-07-04 15:21:12 UTC (rev 42092)
+++ scummvm/trunk/engines/sci/console.h	2009-07-04 15:22:42 UTC (rev 42093)
@@ -52,6 +52,7 @@
 	// Kernel
 //	bool cmdClasses(int argc, const char **argv);	// TODO
 	bool cmdOpcodes(int argc, const char **argv);
+	bool cmdSelector(int argc, const char **argv);
 	bool cmdSelectors(int argc, const char **argv);
 	bool cmdKernelFunctions(int argc, const char **argv);
 	bool cmdClassTable(int argc, const char **argv);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list