diff options
author | Benjamin Haisch | 2008-05-12 19:29:46 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-05-12 19:29:46 +0000 |
commit | 3e133f3a9fedbd597d88108853570dc08288cf26 (patch) | |
tree | c3b7caae8761a0b2ca6e0b4f4271b8feaaebf27c /engines/made | |
parent | 13b60eeb32fa2ee42c2f38c940eb74ea8763e805 (diff) | |
download | scummvm-rg350-3e133f3a9fedbd597d88108853570dc08288cf26.tar.gz scummvm-rg350-3e133f3a9fedbd597d88108853570dc08288cf26.tar.bz2 scummvm-rg350-3e133f3a9fedbd597d88108853570dc08288cf26.zip |
Fixed o1_DRAWTEXT in LGOP2
svn-id: r32070
Diffstat (limited to 'engines/made')
-rw-r--r-- | engines/made/scriptfuncs_lgop2.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/engines/made/scriptfuncs_lgop2.cpp b/engines/made/scriptfuncs_lgop2.cpp index 14014873fa..73fbd7fb45 100644 --- a/engines/made/scriptfuncs_lgop2.cpp +++ b/engines/made/scriptfuncs_lgop2.cpp @@ -370,9 +370,32 @@ int16 ScriptFunctionsLgop2::o1_FONT(int16 argc, int16 *argv) { } int16 ScriptFunctionsLgop2::o1_DRAWTEXT(int16 argc, int16 *argv) { - // TODO: Needs vsprintf to get the correct text + const char *text = _vm->_dat->getString(argv[argc - 1]); - _vm->_screen->printText(text); + + char finalText[1024]; + switch (argc) { + case 1: + snprintf(finalText, 1024, "%s", text); + break; + case 2: + snprintf(finalText, 1024, text, argv[0]); + break; + case 3: + snprintf(finalText, 1024, text, argv[1], argv[0]); + break; + case 4: + snprintf(finalText, 1024, text, argv[2], argv[1], argv[0]); + break; + case 5: + snprintf(finalText, 1024, text, argv[3], argv[2], argv[1], argv[0]); + break; + default: + finalText[0] = '\0'; + break; + } + + _vm->_screen->printText(finalText); return 0; } |