diff options
author | Eugene Sandulenko | 2019-08-27 16:27:19 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-13 22:07:08 +0100 |
commit | 022b6316ddb06c94ea2fce2f3301cb8bd8f332bb (patch) | |
tree | 9b21e699fd5fc1678d58832e03efc925b95bae94 /engines/griffon/engine.cpp | |
parent | b444a9ffc4ee9209c76f1d1bda481c9c7308f257 (diff) | |
download | scummvm-rg350-022b6316ddb06c94ea2fce2f3301cb8bd8f332bb.tar.gz scummvm-rg350-022b6316ddb06c94ea2fce2f3301cb8bd8f332bb.tar.bz2 scummvm-rg350-022b6316ddb06c94ea2fce2f3301cb8bd8f332bb.zip |
GRIFFON: Unstubbed more sound functionality
Diffstat (limited to 'engines/griffon/engine.cpp')
-rw-r--r-- | engines/griffon/engine.cpp | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp index de70152bfa..3085fdcba4 100644 --- a/engines/griffon/engine.cpp +++ b/engines/griffon/engine.cpp @@ -97,12 +97,44 @@ namespace Griffon { */ // stubs -void Mix_Volume(int channel, int volume) {} -int Mix_PlayChannel(Audio::SeekableAudioStream *chunk, int par3) { return 0; } -void Mix_Pause(int channel) {} -void Mix_HaltChannel(int channel) {} -void Mix_Resume(int channel) {} -bool Mix_Playing(int channel) { return true; } +void GriffonEngine::Mix_Volume(int channel, int volume) {} + +int GriffonEngine::Mix_getHandle() { + for (uint i = 0; i < SOUND_HANDLES; i++) { + if (!_mixer->isSoundHandleActive(_handles[i])) { + return i; + } + } + + error("Mix_getHandle(): Too many sound handles"); + + return -1; +} + +int GriffonEngine::Mix_PlayChannel(Audio::SeekableAudioStream *chunk, int par3) { + int ch = Mix_getHandle(); + + _mixer->playStream(Audio::Mixer::kSFXSoundType, &_handles[ch], chunk, -1, Audio::Mixer::kMaxChannelVolume, + 0, DisposeAfterUse::NO, false, false); + + return ch; +} + +void GriffonEngine::Mix_Pause(int channel) { + _mixer->pauseHandle(_handles[channel], true); +} + +void GriffonEngine::Mix_HaltChannel(int channel) { + _mixer->stopHandle(_handles[channel]); +} + +void GriffonEngine::Mix_Resume(int channel) { + _mixer->pauseHandle(_handles[channel], false); +} + +bool GriffonEngine::Mix_Playing(int channel) { + return _mixer->isSoundHandleActive(_handles[channel]); +} Audio::SeekableAudioStream *Mix_LoadWAV(const char *name) { Common::File file; @@ -5045,7 +5077,7 @@ void GriffonEngine::game_saveloadnew() { rcDest.left = 108; if (curcol == 2) rcDest.left = 170; - + // CHECKME: Useless code? or temporary commented? // rcDest.left = rcDest.left; // + 2 + 2 * sin(-3.14159 * 2 * itemyloc / 16) |