aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/sound.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2012-11-11 19:54:48 +1100
committerPaul Gilbert2012-11-11 19:54:48 +1100
commit1844e4faa24bd31da89db49751ee80b201d061e9 (patch)
tree8621f22b9f7374d7363af30d3366bfbb8b9666ad /engines/hopkins/sound.cpp
parent0ef8703833c556ab8ace5db7abf7c7087a299587 (diff)
downloadscummvm-rg350-1844e4faa24bd31da89db49751ee80b201d061e9.tar.gz
scummvm-rg350-1844e4faa24bd31da89db49751ee80b201d061e9.tar.bz2
scummvm-rg350-1844e4faa24bd31da89db49751ee80b201d061e9.zip
HOPKINS: Clean up of un-needed sound structure fields
Diffstat (limited to 'engines/hopkins/sound.cpp')
-rw-r--r--engines/hopkins/sound.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index 00da0ffb64..7aaa373d45 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -296,6 +296,7 @@ void SoundManager::LOAD_MUSIC(const Common::String &file) {
Common::String filename = Common::String::format("%s_%s.WAV", file.c_str(), &s[0]);
LOAD_MSAMPLE(mwavIndex, filename);
+ assert(destIndex < MUSIC_WAVE_COUNT);
Music._mwavIndexes[destIndex++] = mwavIndex;
}
} while (!breakFlag);
@@ -305,10 +306,6 @@ void SoundManager::LOAD_MUSIC(const Common::String &file) {
Music._active = true;
Music._isPlaying = false;
Music._currentIndex = -1;
- Music.fieldE0 = 0;
- Music.fieldE4 = 0;
- Music.fieldE8 = 0;
- Music.fieldF0 = 3;
}
void SoundManager::PLAY_MUSIC() {
@@ -332,10 +329,6 @@ void SoundManager::DEL_MUSIC() {
Music._isPlaying = false;
Music._string = " ";
Music._currentIndex = -1;
- Music.fieldE0 = 0;
- Music.fieldE4 = 0;
- Music.fieldE8 = 0;
- Music.fieldF0 = 0;
}
void SoundManager::checkMusic() {
@@ -599,7 +592,7 @@ void SoundManager::STOP_VOICE(int voiceIndex) {
Voice[voiceIndex]._status = 0;
wavIndex = Voice[voiceIndex]._wavIndex;
if (Swav[wavIndex]._active) {
- if (Swav[wavIndex].field24 == 1)
+ if (Swav[wavIndex].freeSample)
DEL_SAMPLE_SDL(wavIndex);
}
}
@@ -622,7 +615,7 @@ void SoundManager::PLAY_VOICE_SDL() {
if (!Voice[2]._status) {
int wavIndex = Voice[2]._wavIndex;
- if (Swav[wavIndex]._active && Swav[wavIndex].field24 == 1)
+ if (Swav[wavIndex]._active && Swav[wavIndex].freeSample)
DEL_SAMPLE_SDL(wavIndex);
}
@@ -654,13 +647,13 @@ bool SoundManager::SDL_LoadVoice(const Common::String &filename, size_t fileOffs
return true;
}
-void SoundManager::LOAD_SAMPLE2_SDL(int wavIndex, const Common::String &filename, int field24) {
+void SoundManager::LOAD_SAMPLE2_SDL(int wavIndex, const Common::String &filename, bool freeSample) {
if (Swav[wavIndex]._active)
DEL_SAMPLE_SDL(wavIndex);
SDL_LoadVoice(filename, 0, 0, Swav[wavIndex]);
Swav[wavIndex]._active = true;
- Swav[wavIndex].field24 = field24;
+ Swav[wavIndex].freeSample = freeSample;
}
void SoundManager::LOAD_NWAV(const Common::String &file, int wavIndex) {
@@ -694,7 +687,7 @@ void SoundManager::PLAY_SAMPLE_SDL(int voiceIndex, int wavIndex) {
if (!Swav[wavIndex]._active)
warning("Bad handle");
- if (Voice[voiceIndex]._status == 1 && Swav[wavIndex]._active && Swav[wavIndex].field24 == 1)
+ if (Voice[voiceIndex]._status == 1 && Swav[wavIndex]._active && Swav[wavIndex].freeSample)
DEL_SAMPLE_SDL(wavIndex);
Voice[voiceIndex].fieldC = 0;