diff options
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/detection.cpp | 5 | ||||
-rw-r--r-- | engines/saga/objectmap.cpp | 6 | ||||
-rw-r--r-- | engines/saga/script.cpp | 18 | ||||
-rw-r--r-- | engines/saga/sfuncs.cpp | 11 | ||||
-rw-r--r-- | engines/saga/sfuncs_ihnm.cpp | 5 |
5 files changed, 19 insertions, 26 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 4e544e4e5d..23bdc73666 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -223,11 +223,8 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const { int SagaMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES - 1; } void SagaMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".s%02d", slot); - Common::String filename = target; - filename += extension; + filename += Common::String::format(".s%02d", slot);; g_system->getSavefileManager()->removeSavefile(filename); } diff --git a/engines/saga/objectmap.cpp b/engines/saga/objectmap.cpp index b9594625e1..b300a247e9 100644 --- a/engines/saga/objectmap.cpp +++ b/engines/saga/objectmap.cpp @@ -191,7 +191,7 @@ void ObjectMap::clear() { #ifdef SAGA_DEBUG void ObjectMap::draw(const Point& testPoint, int color, int color2) { int hitZoneIndex; - char txtBuf[32]; + Common::String txtBuf; Point pickPoint; Point textPoint; Location pickLocation; @@ -210,10 +210,10 @@ void ObjectMap::draw(const Point& testPoint, int color, int color2) { } if (hitZoneIndex != -1) { - snprintf(txtBuf, sizeof(txtBuf), "hitZone %d", hitZoneIndex); + txtBuf = Common::String::format("hitZone %d", hitZoneIndex); textPoint.x = 2; textPoint.y = 2; - _vm->_font->textDraw(kKnownFontSmall, txtBuf, textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline); + _vm->_font->textDraw(kKnownFontSmall, txtBuf.c_str(), textPoint, kITEColorBrightWhite, kITEColorBlack, kFontOutline); } } #endif diff --git a/engines/saga/script.cpp b/engines/saga/script.cpp index 9502631f37..f4902b6c11 100644 --- a/engines/saga/script.cpp +++ b/engines/saga/script.cpp @@ -1154,7 +1154,7 @@ void Script::showVerb(int statusColor) { const char *verbName; const char *object1Name; const char *object2Name; - char statusString[STATUS_TEXT_LEN]; + Common::String statusString; if (_leftButtonVerb == getVerbType(kVerbNone)) { _vm->_interface->setStatusText(""); @@ -1174,8 +1174,8 @@ void Script::showVerb(int statusColor) { object1Name = _vm->getObjectName(_currentObject[0]); if (!_secondObjectNeeded) { - snprintf(statusString, STATUS_TEXT_LEN, "%s %s", verbName, object1Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format("%s %s", verbName, object1Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); return; } @@ -1187,15 +1187,15 @@ void Script::showVerb(int statusColor) { } if (_leftButtonVerb == getVerbType(kVerbGive)) { - snprintf(statusString, STATUS_TEXT_LEN, _vm->getTextString(kTextGiveTo), object1Name, object2Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format(_vm->getTextString(kTextGiveTo), object1Name, object2Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } else { if (_leftButtonVerb == getVerbType(kVerbUse)) { - snprintf(statusString, STATUS_TEXT_LEN, _vm->getTextString(kTextUseWidth), object1Name, object2Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format(_vm->getTextString(kTextUseWidth), object1Name, object2Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } else { - snprintf(statusString, STATUS_TEXT_LEN, "%s %s", verbName, object1Name); - _vm->_interface->setStatusText(statusString, statusColor); + statusString = Common::String::format("%s %s", verbName, object1Name); + _vm->_interface->setStatusText(statusString.c_str(), statusColor); } } } diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 70f987a129..c623349b7a 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -1553,18 +1553,15 @@ void Script::sfNull(SCRIPTFUNC_PARAMS) { } void Script::sfStub(const char *name, ScriptThread *thread, int nArgs) { - char buf[256], buf1[100]; - - snprintf(buf, 256, "STUB: %s(", name); + debugN(0, "STUB: %s(", name); for (int i = 0; i < nArgs; i++) { - snprintf(buf1, 100, "%d", thread->pop()); - strncat(buf, buf1, sizeof(buf) - strlen(buf) - 1); + debugN(0, "%d", thread->pop()); if (i + 1 < nArgs) - strncat(buf, ", ", sizeof(buf) - strlen(buf) - 1); + debugN(0, ", "); } - debug(0, "%s)", buf); + debug(0, ")"); } } // End of namespace Saga diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index 1a73677846..3fbf3b6e67 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -389,11 +389,10 @@ void Script::sfSetSpeechBox(SCRIPTFUNC_PARAMS) { void Script::sfDebugShowData(SCRIPTFUNC_PARAMS) { int16 param = thread->pop(); - char buf[50]; - snprintf(buf, 50, "Reached breakpoint %d", param); + Common::String buf = Common::String::format("Reached breakpoint %d", param); - _vm->_interface->setStatusText(buf); + _vm->_interface->setStatusText(buf.c_str()); } void Script::sfWaitFramesEsc(SCRIPTFUNC_PARAMS) { |