aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-01-05 00:47:49 +0000
committerTravis Howell2003-01-05 00:47:49 +0000
commit98578cbfffe268cce9cdae2b46857357975385cf (patch)
tree2780061260331dfc09195658e96090507ce1696f /simon
parentc2f816b246e13ea0c97d73cfd3952ed88f650987 (diff)
downloadscummvm-rg350-98578cbfffe268cce9cdae2b46857357975385cf.tar.gz
scummvm-rg350-98578cbfffe268cce9cdae2b46857357975385cf.tar.bz2
scummvm-rg350-98578cbfffe268cce9cdae2b46857357975385cf.zip
Small cleanup
svn-id: r6333
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp26
-rw-r--r--simon/simon.h1
2 files changed, 6 insertions, 21 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 16ad0fb352..4e6d5b1062 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -828,46 +828,32 @@ void SimonState::loadTablesIntoMem(uint subr_id)
warning("loadTablesIntoMem: didn't find %d", subr_id);
}
-bool SimonState::readSting(uint a)
+void SimonState::playSting(uint a)
{
+ if (!midi._midi_sfx_toggle)
+ return;
+
char filename[11];
uint16 size;
_mus_file = new File();
-
- sprintf(filename, "stings%i.mus", a);
-
+ sprintf(filename, "STINGS%i.MUS", a);
_mus_file->open(filename, _gameDataPath);
-
if (!_mus_file->isOpen()) {
warning("Can't load sound effect from '%s'", filename);
- return false;
+ return;
}
size = _mus_file->readUint16LE();
-
_mus_offsets = (uint16 *)malloc(size);
_mus_file->seek(0, SEEK_SET);
-
if (_mus_file->read(_mus_offsets, size) != size)
error("Cannot read offsets");
- return true;
-}
-
-void SimonState::playSting(uint a)
-{
- if (!midi._midi_sfx_toggle)
- return;
-
- if (!readSting(_midi_sfx))
- return;
-
midi.shutdown();
_mus_file->seek(_mus_offsets[a], SEEK_SET);
midi.read_all_songs_old(_mus_file, a, _mus_offsets[a+1] - _mus_offsets[a]);
-
midi.initialize();
midi.play();
}
diff --git a/simon/simon.h b/simon/simon.h
index 079e1ac8b8..11bf50b67b 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -103,7 +103,6 @@ public:
File *_mus_file;
uint16 *_mus_offsets;
- bool readSting(uint a);
void playSting(uint a);
byte *_vc_ptr; /* video code ptr */