From 59c58a3b68b064fea9c51d9ce6f9c2ce0ae15ce7 Mon Sep 17 00:00:00 2001 From: Ruediger Hanke Date: Sun, 21 Jul 2002 14:31:58 +0000 Subject: Voices were broken in Simon on Big Endian systems ... svn-id: r4612 --- simon/simon.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'simon') 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; } -- cgit v1.2.3