aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kyra/kyra.cpp12
-rw-r--r--kyra/resource.cpp2
2 files changed, 3 insertions, 11 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index 4ccce0f99b..84bfd4ca92 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -926,15 +926,9 @@ void KyraEngine::snd_playSoundEffect(int track) {
void KyraEngine::snd_playVoiceFile(int id) {
debug(9, "KyraEngine::snd_playVoiceFile(%d)", id);
- char vocFile[7];
- memset(vocFile, 0, sizeof(char)*7);
- if (id < 10) {
- sprintf(vocFile, "00%d.VOC", id);
- } else if (id < 100) {
- sprintf(vocFile, "0%d.VOC", id);
- } else {
- sprintf(vocFile, "%d.VOC", id);
- }
+ char vocFile[8];
+ assert(id >= 0 && id < 1000);
+ sprintf(vocFile, "%03d.VOC", id);
uint32 fileSize = 0;
byte *fileData = 0;
fileData = _res->fileData(vocFile, &fileSize);
diff --git a/kyra/resource.cpp b/kyra/resource.cpp
index 3a86b945de..88f78b334d 100644
--- a/kyra/resource.cpp
+++ b/kyra/resource.cpp
@@ -159,8 +159,6 @@ uint8* Resource::fileData(const char* file, uint32* size) {
buffer = new uint8[*size];
assert(buffer);
- // TODO: maybe remove this again, this is only
- // because I had problems when using gcc 4.0.1
const uint8 *from = start->_file->getFile(file);
assert(from);