diff options
author | Cameron Cawley | 2019-09-29 21:12:55 +0100 |
---|---|---|
committer | David Turner | 2019-09-30 03:59:22 +0100 |
commit | 3fdb8e6542fa7655279b26d8d0d43e80356fff0b (patch) | |
tree | 2ec85b366f0b1c997ba509a8d8ab0909e5941cbe /engines/bladerunner/ui | |
parent | 730a89ddc52c2ad89bfeb51636d2ac100a6055af (diff) | |
download | scummvm-rg350-3fdb8e6542fa7655279b26d8d0d43e80356fff0b.tar.gz scummvm-rg350-3fdb8e6542fa7655279b26d8d0d43e80356fff0b.tar.bz2 scummvm-rg350-3fdb8e6542fa7655279b26d8d0d43e80356fff0b.zip |
BLADERUNNER: Replace use of sprintf with Common::String::format
Diffstat (limited to 'engines/bladerunner/ui')
-rw-r--r-- | engines/bladerunner/ui/kia_section_crimes.cpp | 10 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_suspects.cpp | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/bladerunner/ui/kia_section_crimes.cpp b/engines/bladerunner/ui/kia_section_crimes.cpp index 2b335e4793..4eedd8c284 100644 --- a/engines/bladerunner/ui/kia_section_crimes.cpp +++ b/engines/bladerunner/ui/kia_section_crimes.cpp @@ -167,7 +167,7 @@ void KIASectionCrimes::draw(Graphics::Surface &surface) { surface.vLine(267, 304, 315, surface.format.RGBToColor(88, 80, 96)); surface.hLine(267, 316, 267, surface.format.RGBToColor(72, 64, 72)); - char generatedText[64]; + Common::String generatedText; if (_suspectSelected == -1) { text = _vm->_textKIA->getText(22); } else { @@ -175,11 +175,11 @@ void KIASectionCrimes::draw(Graphics::Surface &surface) { if (_suspectsWithIdentity[_suspectSelected]) { text = suspectName; } else if (_vm->_suspectsDatabase->get(_suspectSelected)->getSex()) { - sprintf(generatedText, "%s %s", _vm->_textKIA->getText(20), _vm->_kia->scrambleSuspectsName(suspectName)); - text = generatedText; + generatedText = Common::String::format("%s %s", _vm->_textKIA->getText(20), _vm->_kia->scrambleSuspectsName(suspectName)); + text = generatedText.c_str(); } else { - sprintf(generatedText, "%s %s", _vm->_textKIA->getText(21), _vm->_kia->scrambleSuspectsName(suspectName)); - text = generatedText; + generatedText = Common::String::format("%s %s", _vm->_textKIA->getText(21), _vm->_kia->scrambleSuspectsName(suspectName)); + text = generatedText.c_str(); } } _vm->_mainFont->drawString(&surface, text, 201 - _vm->_mainFont->getStringWidth(text) / 2, 306, surface.w, surface.format.RGBToColor(136, 168, 255)); diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp index 962d0a332f..93895a7d5b 100644 --- a/engines/bladerunner/ui/kia_section_suspects.cpp +++ b/engines/bladerunner/ui/kia_section_suspects.cpp @@ -203,7 +203,7 @@ void KIASectionSuspects::draw(Graphics::Surface &surface) { surface.vLine(251, 134, 145, surface.format.RGBToColor(88, 80, 96)); surface.hLine(251, 146, 251, surface.format.RGBToColor(72, 64, 72)); - char generatedText[64]; + Common::String generatedText; if (_suspectSelected == -1) { text = _vm->_textKIA->getText(22); } else { @@ -211,11 +211,11 @@ void KIASectionSuspects::draw(Graphics::Surface &surface) { if (_suspectsWithIdentity[_suspectSelected]) { text = suspectName; } else if (_vm->_suspectsDatabase->get(_suspectSelected)->getSex()) { - sprintf(generatedText, "%s %s", _vm->_textKIA->getText(20), _vm->_kia->scrambleSuspectsName(suspectName)); - text = generatedText; + generatedText = Common::String::format("%s %s", _vm->_textKIA->getText(20), _vm->_kia->scrambleSuspectsName(suspectName)); + text = generatedText.c_str(); } else { - sprintf(generatedText, "%s %s", _vm->_textKIA->getText(21), _vm->_kia->scrambleSuspectsName(suspectName)); - text = generatedText; + generatedText = Common::String::format("%s %s", _vm->_textKIA->getText(21), _vm->_kia->scrambleSuspectsName(suspectName)); + text = generatedText.c_str(); } } |