[Scummvm-cvs-logs] SF.net SVN: scummvm: [32070] scummvm/trunk/engines/made/scriptfuncs_lgop2. cpp
john_doe at users.sourceforge.net
john_doe at users.sourceforge.net
Mon May 12 21:29:46 CEST 2008
Revision: 32070
http://scummvm.svn.sourceforge.net/scummvm/?rev=32070&view=rev
Author: john_doe
Date: 2008-05-12 12:29:46 -0700 (Mon, 12 May 2008)
Log Message:
-----------
Fixed o1_DRAWTEXT in LGOP2
Modified Paths:
--------------
scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp
Modified: scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp 2008-05-12 19:29:14 UTC (rev 32069)
+++ scummvm/trunk/engines/made/scriptfuncs_lgop2.cpp 2008-05-12 19:29:46 UTC (rev 32070)
@@ -370,9 +370,32 @@
}
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;
}
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