aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index b2e71a54ac..ef8957cb66 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4613,15 +4613,15 @@ void SimonState::initSound()
_effects_offsets = NULL;
_effects_file = fopen_maybe_lowercase(e);
- if (_effects_file == NULL)
- return;
-
- _effects_offsets = (uint32 *)malloc(gss->NUM_EFFECTS_RESOURCES * sizeof(uint32));
- if (_effects_offsets == NULL)
- error("Out of memory for effects offsets");
+ if (_effects_file != NULL)
+ {
+ _effects_offsets = (uint32 *)malloc(gss->NUM_EFFECTS_RESOURCES * sizeof(uint32));
+ if (_effects_offsets == NULL)
+ error("Out of memory for effects offsets");
- if (fread(_effects_offsets, gss->NUM_EFFECTS_RESOURCES * sizeof(uint32), 1, _effects_file) != 1)
- error("Cannot read effects offsets");
+ if (fread(_effects_offsets, gss->NUM_EFFECTS_RESOURCES * sizeof(uint32), 1, _effects_file) != 1)
+ error("Cannot read effects offsets");
+ }
#if defined(SCUMM_BIG_ENDIAN)
for (int r = 0; r < gss->NUM_VOICE_RESOURCES; r++)
@@ -4688,7 +4688,6 @@ void SimonState::playVoice(uint voice)
|| wave_hdr.fmt != MKID('fmt ') || READ_LE_UINT16(&wave_hdr.format_tag) != 1
|| READ_LE_UINT16(&wave_hdr.channels) != 1
|| READ_LE_UINT16(&wave_hdr.bits_per_sample) != 8) {
- warning("playVoice(%d): cannot read RIFF header", voice);
return;
}