diff options
author | RichieSams | 2013-09-15 16:26:49 -0500 |
---|---|---|
committer | RichieSams | 2013-09-15 16:26:49 -0500 |
commit | d82ff7aea8d866bf5be2accfab321c39dd727c66 (patch) | |
tree | 8ab0c3fe9052a4f84841069d5fc7dc7549d7c3f3 /engines | |
parent | c312b147fa7f5a28491975ae0bcc4b419e7e126a (diff) | |
download | scummvm-rg350-d82ff7aea8d866bf5be2accfab321c39dd727c66.tar.gz scummvm-rg350-d82ff7aea8d866bf5be2accfab321c39dd727c66.tar.bz2 scummvm-rg350-d82ff7aea8d866bf5be2accfab321c39dd727c66.zip |
ZVISION: Create Console method to render text
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/console.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/console.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index 4ea4a8e963..3969aa1f14 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -32,6 +32,7 @@ #include "zvision/zvision.h" #include "zvision/script_manager.h" #include "zvision/render_manager.h" +#include "zvision/string_manager.h" #include "zvision/zork_avi_decoder.h" #include "zvision/zork_raw.h" #include "zvision/utility.h" @@ -52,6 +53,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { DCmd_Register("changelocation", WRAP_METHOD(Console, cmdChangeLocation)); DCmd_Register("dumpfile", WRAP_METHOD(Console, cmdDumpFile)); DCmd_Register("parseallscrfiles", WRAP_METHOD(Console, cmdParseAllScrFiles)); + DCmd_Register("rendertext", WRAP_METHOD(Console, cmdRenderText)); } bool Console::cmdLoadImage(int argc, const char **argv) { @@ -198,4 +200,14 @@ bool Console::cmdParseAllScrFiles(int argc, const char **argv) { return true; } +bool Console::cmdRenderText(int argc, const char **argv) { + if (argc != 7) { + DebugPrintf("Use rendertext <text> <fontNumber> <destX> <destY> <maxWidth> <1 or 0: wrap> to render text\n"); + return true; + } + + StringManager::TextStyle style = _engine->getStringManager()->getTextStyle(atoi(argv[2])); + _engine->getRenderManager()->renderTextToWorkingWindow(Common::String(argv[1]), style.font, atoi(argv[3]), atoi(argv[4]), style.color, atoi(argv[5]), -1, Graphics::kTextAlignLeft, atoi(argv[6]) == 0 ? false : true); +} + } // End of namespace ZVision diff --git a/engines/zvision/console.h b/engines/zvision/console.h index fdb20642e9..0ca1b8cc70 100644 --- a/engines/zvision/console.h +++ b/engines/zvision/console.h @@ -48,6 +48,7 @@ private: bool cmdChangeLocation(int argc, const char **argv); bool cmdDumpFile(int argc, const char **argv); bool cmdParseAllScrFiles(int argc, const char **argv); + bool cmdRenderText(int argc, const char **argv); }; } // End of namespace ZVision |