diff options
author | Eugene Sandulenko | 2008-04-05 14:18:32 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2008-04-05 14:18:32 +0000 |
commit | c8061850ed9a823c8f3fe1592c00a36a21d190d9 (patch) | |
tree | 95144d8736fb991edbf15c36870a6da150a7165a | |
parent | a52c6e0ba247bbdfda24248fd9cff4830d4e8300 (diff) | |
download | scummvm-rg350-c8061850ed9a823c8f3fe1592c00a36a21d190d9.tar.gz scummvm-rg350-c8061850ed9a823c8f3fe1592c00a36a21d190d9.tar.bz2 scummvm-rg350-c8061850ed9a823c8f3fe1592c00a36a21d190d9.zip |
Simplify code
svn-id: r31409
-rw-r--r-- | engines/saga/music.cpp | 5 | ||||
-rw-r--r-- | engines/saga/sndres.cpp | 21 |
2 files changed, 4 insertions, 22 deletions
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index e5264df43d..1cbc38dfb5 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -550,10 +550,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) { // Load the external music file for Mac IHNM Common::File musicFile; char musicFileName[40]; - if (resourceId <= 16) // F in hex (1 char in hex) - sprintf(musicFileName, "Music/Music0%x", resourceId); - else - sprintf(musicFileName, "Music/Music%x", resourceId); + sprintf(musicFileName, "Music/Music%02x", resourceId); musicFile.open(musicFileName); resourceSize = musicFile.size(); resourceData = new byte[resourceSize]; diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 7b96308a41..2a5c319140 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -192,29 +192,14 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff dirIndex = floor((float)(resourceId / 64)); if (_voiceSerial == 0) { - if (resourceId <= 16) // F in hex (1 char in hex) - sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS00%x", dirIndex, resourceId); - else if (resourceId <= 255) // FF in hex (2 chars in hex) - sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS0%x", dirIndex, resourceId); - else - sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS%x", dirIndex, resourceId); + sprintf(soundFileName, "Voices/VoicesS/Voices%d/VoicesS%03x", dirIndex, resourceId); } else { - if (resourceId <= 16) // F in hex (1 char in hex) - sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d00%x", _voiceSerial, dirIndex, _voiceSerial, resourceId); - else if (resourceId <= 255) // FF in hex (2 chars in hex) - sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d0%x", _voiceSerial, dirIndex, _voiceSerial, resourceId); - else - sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d%x", _voiceSerial, dirIndex, _voiceSerial, resourceId); + sprintf(soundFileName, "Voices/Voices%d/Voices%d/Voices%d%03x", _voiceSerial, dirIndex, _voiceSerial, resourceId); } } else { dirIndex = floor((float)(resourceId / 64)); - if (resourceId <= 16) // F in hex (1 char in hex) - sprintf(soundFileName, "SFX/SFX%d/SFX00%x", dirIndex, resourceId); - else if (resourceId <= 255) // FF in hex (2 chars in hex) - sprintf(soundFileName, "SFX/SFX%d/SFX0%x", dirIndex, resourceId); - else - sprintf(soundFileName, "SFX/SFX%d/SFX%x", dirIndex, resourceId); + sprintf(soundFileName, "SFX/SFX%d/SFX%02x", dirIndex, resourceId); } soundFile.open(soundFileName); soundResourceLength = soundFile.size(); |