aboutsummaryrefslogtreecommitdiff
path: root/engines/simon/midi.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-08-27 05:02:48 +0000
committerTravis Howell2006-08-27 05:02:48 +0000
commit57bdecb4c6dc6f35a69120201e0b0f2654ac4c65 (patch)
treec58f07364ae5ba3aa6b5a36d5c7b12eac3684752 /engines/simon/midi.cpp
parentb964c889ed96fede5137fb065ef607126ca1d90a (diff)
downloadscummvm-rg350-57bdecb4c6dc6f35a69120201e0b0f2654ac4c65.tar.gz
scummvm-rg350-57bdecb4c6dc6f35a69120201e0b0f2654ac4c65.tar.bz2
scummvm-rg350-57bdecb4c6dc6f35a69120201e0b0f2654ac4c65.zip
Update error messages and always report an error if data file load fails
svn-id: r23772
Diffstat (limited to 'engines/simon/midi.cpp')
-rw-r--r--engines/simon/midi.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/engines/simon/midi.cpp b/engines/simon/midi.cpp
index f139f1fa2e..2d85983ad4 100644
--- a/engines/simon/midi.cpp
+++ b/engines/simon/midi.cpp
@@ -522,26 +522,21 @@ void MidiPlayer::loadXMIDI(Common::File *in, bool sfx) {
in->read(&buf[2], 2);
}
if (memcmp(buf, "CAT ", 4)) {
- warning("Could not find 'CAT ' tag to determine resource size");
- return;
+ error("Could not find 'CAT ' tag to determine resource size");
}
size += 4 + in->readUint32BE();
in->seek(pos, 0);
p->data = (byte *)calloc(size, 1);
in->read(p->data, size);
} else {
- warning("Expected 'FORM' tag but found '%c%c%c%c' instead", buf[0], buf[1], buf[2], buf[3]);
- return;
+ error("Expected 'FORM' tag but found '%c%c%c%c' instead", buf[0], buf[1], buf[2], buf[3]);
}
MidiParser *parser = MidiParser::createParser_XMIDI();
parser->setMidiDriver(this);
parser->setTimerRate(_driver->getBaseTempo());
- if (!parser->loadMusic(p->data, size)) {
- warning("Error reading track");
- delete parser;
- parser = 0;
- }
+ if (!parser->loadMusic(p->data, size))
+ error("Error reading track");
if (!sfx) {
_currentTrack = 255;
@@ -557,8 +552,7 @@ void MidiPlayer::loadS1D(Common::File *in, bool sfx) {
uint16 size = in->readUint16LE();
if (size != in->size() - 2) {
- warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long)in->size() - 2, (int)size);
- return;
+ error("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long)in->size() - 2, (int)size);
}
p->data = (byte *)calloc(size, 1);
@@ -567,11 +561,8 @@ void MidiPlayer::loadS1D(Common::File *in, bool sfx) {
MidiParser *parser = MidiParser_createS1D();
parser->setMidiDriver(this);
parser->setTimerRate(_driver->getBaseTempo());
- if (!parser->loadMusic(p->data, size)) {
- warning("Error reading track");
- delete parser;
- parser = 0;
- }
+ if (!parser->loadMusic(p->data, size))
+ error("Error reading track");
if (!sfx) {
_currentTrack = 255;