[Scummvm-cvs-logs] SF.net SVN: scummvm: [29872] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sun Dec 16 09:14:14 CET 2007
Revision: 29872
http://scummvm.svn.sourceforge.net/scummvm/?rev=29872&view=rev
Author: dreammaster
Date: 2007-12-16 00:14:14 -0800 (Sun, 16 Dec 2007)
Log Message:
-----------
Added a debugger method to show a specified entry in the string table
Modified Paths:
--------------
scummvm/trunk/engines/lure/debugger.cpp
scummvm/trunk/engines/lure/debugger.h
Modified: scummvm/trunk/engines/lure/debugger.cpp
===================================================================
--- scummvm/trunk/engines/lure/debugger.cpp 2007-12-16 08:11:52 UTC (rev 29871)
+++ scummvm/trunk/engines/lure/debugger.cpp 2007-12-16 08:14:14 UTC (rev 29872)
@@ -48,6 +48,7 @@
DCmd_Register("hotspot", WRAP_METHOD(Debugger, cmd_hotspot));
DCmd_Register("room", WRAP_METHOD(Debugger, cmd_room));
DCmd_Register("showanim", WRAP_METHOD(Debugger, cmd_showAnim));
+ DCmd_Register("strings", WRAP_METHOD(Debugger, cmd_saveStrings));
}
static int strToInt(const char *s) {
@@ -542,4 +543,37 @@
return true;
}
+bool Debugger::cmd_saveStrings(int argc, const char **argv) {
+ StringData &strings = StringData::getReference();
+ char buffer[32768];
+
+ if (argc != 2) {
+ DebugPrintf("strings <stringId>\n");
+ return true;
+ }
+
+ uint16 id = strToInt(argv[1]);
+ strings.getString(id, buffer, NULL, NULL);
+ DebugPrintf("%s\n", buffer);
+
+/* Commented out code for saving all text strings - note that 0x1000 is chosen
+ * arbitrarily, so there'll be a bunch of garbage at the end, or the game will crash
+
+ // Save all the strings to a text file - this
+
+ FILE *f = fopen("strings.txt", "w");
+
+ for (int index = 0; index < 0x1000; ++index) {
+ strings.getString(index, buffer);
+ fprintf(f, "%.4xh - %s\n", index, buffer);
+ }
+
+ fclose(f);
+
+ DebugPrintf("Done\n");
+*/
+ return true;
+}
+
+
} // End of namespace Lure
Modified: scummvm/trunk/engines/lure/debugger.h
===================================================================
--- scummvm/trunk/engines/lure/debugger.h 2007-12-16 08:11:52 UTC (rev 29871)
+++ scummvm/trunk/engines/lure/debugger.h 2007-12-16 08:14:14 UTC (rev 29872)
@@ -46,6 +46,7 @@
bool cmd_hotspot(int argc, const char **argv);
bool cmd_room(int argc, const char **argv);
bool cmd_showAnim(int argc, const char **argv);
+ bool cmd_saveStrings(int argc, const char **argv);
};
} // End of namespace Lure
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