aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorMax Horn2011-03-18 14:42:05 +0100
committerMax Horn2011-06-18 01:36:16 +0200
commitd74e2d3224f7f43daf7bc90018b1b3f40a8c4596 (patch)
treee2b7528d74bcd907db6b2fa87a988cb697f1465c /engines/kyra
parentfcc5580d9f917abf17363a124b07fe8d199bf530 (diff)
downloadscummvm-rg350-d74e2d3224f7f43daf7bc90018b1b3f40a8c4596.tar.gz
scummvm-rg350-d74e2d3224f7f43daf7bc90018b1b3f40a8c4596.tar.bz2
scummvm-rg350-d74e2d3224f7f43daf7bc90018b1b3f40a8c4596.zip
KYRA: Replace vsprintf by Common::String::vformat
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/gui.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index b9477c950a..f58ca0117c 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -643,32 +643,31 @@ void MainMenu::printString(const char *format, int x, int y, int col1, int col2,
if (!format)
return;
- char string[512];
va_list vaList;
va_start(vaList, flags);
- vsprintf(string, format, vaList);
+ Common::String string = Common::String::vformat(format, vaList);
va_end(vaList);
if (flags & 1)
- x -= _screen->getTextWidth(string) >> 1;
+ x -= _screen->getTextWidth(string.c_str()) >> 1;
if (flags & 2)
- x -= _screen->getTextWidth(string);
+ x -= _screen->getTextWidth(string.c_str());
if (_vm->gameFlags().use16ColorMode)
flags &= 3;
if (flags & 4) {
- _screen->printText(string, x - 1, y, _static.altColor, col2);
- _screen->printText(string, x, y + 1, _static.altColor, col2);
+ _screen->printText(string.c_str(), x - 1, y, _static.altColor, col2);
+ _screen->printText(string.c_str(), x, y + 1, _static.altColor, col2);
}
if (flags & 8) {
- _screen->printText(string, x - 1, y, 227, col2);
- _screen->printText(string, x, y + 1, 227, col2);
+ _screen->printText(string.c_str(), x - 1, y, 227, col2);
+ _screen->printText(string.c_str(), x, y + 1, 227, col2);
}
- _screen->printText(string, x, y, col1, col2);
+ _screen->printText(string.c_str(), x, y, col1, col2);
}
} // End of namespace Kyra