aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2011-10-29 00:46:47 +0200
committerJohannes Schickel2011-10-29 01:00:18 +0200
commit9d9837f217599fa238d5a9098b65994f089ece6b (patch)
tree9e6d84db6b5325777b8c6502856685d6d2d2ac22 /engines/kyra
parent951cb8ea71a6fc62fd9a247cbf407559e9935ec8 (diff)
downloadscummvm-rg350-9d9837f217599fa238d5a9098b65994f089ece6b.tar.gz
scummvm-rg350-9d9837f217599fa238d5a9098b65994f089ece6b.tar.bz2
scummvm-rg350-9d9837f217599fa238d5a9098b65994f089ece6b.zip
KYRA: Prefer Common::String over plain char arrays in Sound.
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/sound.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index e8d010480a..af50f0f5cb 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -60,13 +60,13 @@ bool Sound::isPlaying() const {
}
bool Sound::isVoicePresent(const char *file) const {
- char filenamebuffer[25];
+ Common::String filename;
for (int i = 0; _supportedCodecs[i].fileext; ++i) {
- strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodecs[i].fileext);
+ filename = file;
+ filename += _supportedCodecs[i].fileext;
- if (_vm->resource()->exists(filenamebuffer))
+ if (_vm->resource()->exists(filename.c_str()))
return true;
}
@@ -86,14 +86,14 @@ int32 Sound::voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volum
}
Audio::SeekableAudioStream *Sound::getVoiceStream(const char *file) const {
- char filenamebuffer[25];
+ Common::String filename;
Audio::SeekableAudioStream *audioStream = 0;
for (int i = 0; _supportedCodecs[i].fileext; ++i) {
- strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodecs[i].fileext);
+ filename = file;
+ filename += _supportedCodecs[i].fileext;
- Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filenamebuffer);
+ Common::SeekableReadStream *stream = _vm->resource()->createReadStream(filename);
if (!stream)
continue;