From b384bb4a861b08dbbb42b14019f5b991a52a1b0f Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 2 Jun 2011 18:26:37 -0400 Subject: LASTEXPRESS: Replace sprintf() usage with Common::String::format() --- engines/lastexpress/game/sound.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 81ed97481c..63efd182a8 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -821,12 +821,8 @@ void SoundManager::playSoundEvent(EntityIndex entity, byte action, byte a3) { break; } - if (_action) { - sprintf((char *)&filename, "LIB%03d.SND", _action); - - if (flag) - playSoundWithSubtitles((char*)&filename, flag, kEntityPlayer, a3); - } + if (_action && flag) + playSoundWithSubtitles(Common::String::format("LIB%03d.SND", _action), flag, kEntityPlayer, a3); } void SoundManager::playSteam(CityIndex index) { @@ -885,10 +881,8 @@ void SoundManager::playFightSound(byte action, byte a4) { break; } - if (_action) { - sprintf((char *)&filename, "LIB%03d.SND", _action); - playSound(kEntityTrain, (char*)&filename, kFlagDefault, a4); - } + if (_action) + playSound(kEntityTrain, Common::String::format("LIB%03d.SND", _action), kFlagDefault, a4); } void SoundManager::playDialog(EntityIndex entity, EntityIndex entityDialog, FlagType flag, byte a4) { -- cgit v1.2.3