aboutsummaryrefslogtreecommitdiff
path: root/engines/chewy/console.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2016-09-20 13:00:19 +0300
committerFilippos Karapetis2016-10-03 00:33:32 +0300
commita196bfff57a0fb1a5cca9e242125ed2f5cbd018d (patch)
treef01166a79e47e90a77e891c9f9018db9b0701354 /engines/chewy/console.cpp
parentc6ccd8bbe8da08534a9f1e23258dc4011a60382c (diff)
downloadscummvm-rg350-a196bfff57a0fb1a5cca9e242125ed2f5cbd018d.tar.gz
scummvm-rg350-a196bfff57a0fb1a5cca9e242125ed2f5cbd018d.tar.bz2
scummvm-rg350-a196bfff57a0fb1a5cca9e242125ed2f5cbd018d.zip
CHEWY: Add support for encrypted text resources
These are mainly used for error messages
Diffstat (limited to 'engines/chewy/console.cpp')
-rw-r--r--engines/chewy/console.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index 298e10baf4..8d55651ffc 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -37,6 +37,7 @@ Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound));
registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech));
registerCmd("play_music", WRAP_METHOD(Console, Cmd_PlayMusic));
+ registerCmd("text", WRAP_METHOD(Console, Cmd_Text));
}
Console::~Console() {
@@ -148,4 +149,21 @@ bool Console::Cmd_PlayMusic(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_Text(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Usage: <file> <text number>\n");
+ return true;
+ }
+
+ Common::String filename = argv[1];
+ int resNum = atoi(argv[2]);
+
+ TextResource *res = new TextResource(filename);
+ Common::String str = res->getText(resNum);
+ this->debugPrintf("Text: %s\n", str.c_str());
+ delete res;
+
+ return true;
+}
+
} // End of namespace Chewy