[Scummvm-cvs-logs] scummvm master -> 3430757bf44fa53ef12f5dd10f80a5fea83cc39c

eriktorbjorn eriktorbjorn at telia.com
Sun Aug 30 06:50:01 CEST 2015


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ce2ba7ddc7 SHERLOCK: Add "listfiles" debugger command
3430757bf4 DEBUGGER: Add clarifying comment


Commit: ce2ba7ddc75cddaba4db04987e39cf681f19d8ae
    https://github.com/scummvm/scummvm/commit/ce2ba7ddc75cddaba4db04987e39cf681f19d8ae
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-08-30T06:41:30+02:00

Commit Message:
SHERLOCK: Add "listfiles" debugger command

To make it easier to use the "dumpfile" command. There is little-
to-no sanity checking in this one...

Changed paths:
    engines/sherlock/debugger.cpp
    engines/sherlock/debugger.h



diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index b3c64e8..50293db 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -47,6 +47,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("scene",         WRAP_METHOD(Debugger, cmdScene));
 	registerCmd("song",          WRAP_METHOD(Debugger, cmdSong));
 	registerCmd("songs",         WRAP_METHOD(Debugger, cmdListSongs));
+	registerCmd("listfiles",     WRAP_METHOD(Debugger, cmdListFiles));
 	registerCmd("dumpfile",      WRAP_METHOD(Debugger, cmdDumpFile));
 	registerCmd("locations",     WRAP_METHOD(Debugger, cmdLocations));
 }
@@ -114,6 +115,17 @@ bool Debugger::cmdListSongs(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger::cmdListFiles(int argc, const char **argv) {
+	if (argc != 2) {
+		debugPrintf("Format: listfiles <resource file>\n");
+		return true;
+	}
+	Common::StringArray files;
+	_vm->_res->getResourceNames(Common::String(argv[1]), files);
+	debugPrintColumns(files);
+	return true;
+}
+
 bool Debugger::cmdDumpFile(int argc, const char **argv) {
 	if (argc != 2) {
 		debugPrintf("Format: dumpfile <resource name>\n");
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index 622098c..bcc4448 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -55,6 +55,11 @@ private:
 	bool cmdListSongs(int argc, const char **argv);
 
 	/**
+	 * Lists all files in a library (use at your own risk)
+	 */
+	bool cmdListFiles(int argc, const char **argv);
+
+	/**
 	 * Dumps a file to disk
 	 */
 	bool cmdDumpFile(int argc, const char **argv);


Commit: 3430757bf44fa53ef12f5dd10f80a5fea83cc39c
    https://github.com/scummvm/scummvm/commit/3430757bf44fa53ef12f5dd10f80a5fea83cc39c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-08-30T06:49:16+02:00

Commit Message:
DEBUGGER: Add clarifying comment

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 209a787..c9b4359 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -132,7 +132,8 @@ void Debugger::debugPrintColumns(const Common::StringArray &list) {
 	if (list.size() % columns)
 		lines++;
 
-
+	// This won't always use all available columns, but even if it did the
+	// number of lines should be the same so that's good enough.
 	for (i = 0; i < lines; i++) {
 		for (j = 0; j < columns; j++) {
 			uint pos = i + j * lines;






More information about the Scummvm-git-logs mailing list