aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
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/agos
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/agos')
-rw-r--r--engines/agos/script_pn.cpp8
-rw-r--r--engines/agos/string.cpp12
2 files changed, 8 insertions, 12 deletions
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index bde59b71b8..3bd8ce19a3 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -465,8 +465,8 @@ void AGOSEngine_PN::opn_opcode35() {
void AGOSEngine_PN::opn_opcode36() {
for (int i = 0; i < _dataBase[57] + 1; ++i)
_wordcp[i] = 0;
- if (isspace(*_inpp))
- while ((*_inpp) && (isspace(*_inpp)))
+ if (isspace(static_cast<unsigned char>(*_inpp)))
+ while ((*_inpp) && (isspace(static_cast<unsigned char>(*_inpp))))
_inpp++;
if (*_inpp == 0) {
setScriptReturn(false);
@@ -480,7 +480,7 @@ void AGOSEngine_PN::opn_opcode36() {
}
int ct = 1;
- while ((*_inpp != '.') && (*_inpp != ',') && (!isspace(*_inpp)) && (*_inpp != '\0') &&
+ while ((*_inpp != '.') && (*_inpp != ',') && (!isspace(static_cast<unsigned char>(*_inpp))) && (*_inpp != '\0') &&
(*_inpp!='"')) {
if (ct < _dataBase[57])
_wordcp[ct++] = *_inpp;
@@ -580,7 +580,7 @@ void AGOSEngine_PN::opn_opcode46() {
return;
}
x++;
- while ((*x != '.') && (*x != ',') && (*x != '"') && (!isspace(*x)) && (*x != '\0'))
+ while ((*x != '.') && (*x != ',') && (*x != '"') && (!isspace(static_cast<unsigned char>(*x))) && (*x != '\0'))
pcf(*x++);
setScriptReturn(true);
}
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index 1cdd7f6d81..410fd5a1ce 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -517,8 +517,7 @@ void AGOSEngine::printScreenText(uint vgaSpriteId, uint color, const char *strin
y -= textHeight;
} else
pos = stringLength;
- padding = (lettersPerRow - pos) % 2 ?
- (lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2;
+ padding = ((lettersPerRow - pos) % 2) ? (lettersPerRow - pos) / 2 + 1 : (lettersPerRow - pos) / 2;
while (padding--)
*convertedString2++ = ' ';
stringLength -= pos;
@@ -621,7 +620,7 @@ void AGOSEngine_PuzzlePack::printInfoText(const char *itemText) {
itemName = " Gem: ";
}
break;
-
+
case 82:
if (_variableArray[flag]) {
if (_variableArray[flag] == 201 || _variableArray[flag] == 211)
@@ -723,11 +722,9 @@ void AGOSEngine_Feeble::printScreenText(uint vgaSpriteId, uint color, const char
const char *string2 = string;
int16 height, talkDelay;
int stringLength = strlen(string);
- int lettersPerRow;
const int textHeight = 15;
height = textHeight;
- lettersPerRow = width / 6;
talkDelay = (stringLength + 3) / 3;
if (_variableArray[86] == 0)
@@ -840,13 +837,12 @@ void AGOSEngine_Feeble::printInteractText(uint16 num, const char *string) {
void AGOSEngine_Feeble::sendInteractText(uint16 num, const char *fmt, ...) {
va_list arglist;
- char string[256];
va_start(arglist, fmt);
- vsprintf(string, fmt, arglist);
+ Common::String string = Common::String::vformat(fmt, arglist);
va_end(arglist);
- printInteractText(num, string);
+ printInteractText(num, string.c_str());
}
#endif