aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/gui.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-20 09:27:39 -0400
committerMatthew Hoops2011-07-20 09:27:39 -0400
commitad293b249e74dd1cfbdbd721d02145efbdaf9eca (patch)
treee568d96f6d7f64c5e58b4c7cd1c4fda7e649bfc7 /engines/kyra/gui.cpp
parentd7411acc2b1c7702280dbff1c3e1bafee528184b (diff)
parente25e85fbb047fef895ede97c3c2c73451631052c (diff)
downloadscummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.gz
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.tar.bz2
scummvm-rg350-ad293b249e74dd1cfbdbd721d02145efbdaf9eca.zip
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'engines/kyra/gui.cpp')
-rw-r--r--engines/kyra/gui.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index b9477c950a..29cbe20b23 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -375,7 +375,7 @@ void GUI::updateSaveList(bool excludeQuickSaves) {
s1 = (*i)[i->size()-3];
s2 = (*i)[i->size()-2];
s3 = (*i)[i->size()-1];
- if (!isdigit(s1) || !isdigit(s2) || !isdigit(s3))
+ if (!isdigit(static_cast<unsigned char>(s1)) || !isdigit(static_cast<unsigned char>(s2)) || !isdigit(static_cast<unsigned char>(s3)))
continue;
s1 -= '0';
s2 -= '0';
@@ -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