[Scummvm-cvs-logs] SF.net SVN: scummvm: [31632] scummvm/trunk/engines/kyra
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon Apr 21 00:24:24 CEST 2008
Revision: 31632
http://scummvm.svn.sourceforge.net/scummvm/?rev=31632&view=rev
Author: lordhoto
Date: 2008-04-20 15:24:24 -0700 (Sun, 20 Apr 2008)
Log Message:
-----------
Committed patch removing Audio::Mixer::SoundType alias in Kyra::SoundDigital.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_v3.cpp
scummvm/trunk/engines/kyra/sound.h
scummvm/trunk/engines/kyra/sound_digital.cpp
Modified: scummvm/trunk/engines/kyra/kyra_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-20 20:33:02 UTC (rev 31631)
+++ scummvm/trunk/engines/kyra/kyra_v3.cpp 2008-04-20 22:24:24 UTC (rev 31632)
@@ -36,6 +36,8 @@
#include "common/system.h"
#include "common/config-manager.h"
+#include "sound/mixer.h"
+
namespace Kyra {
KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags) {
_soundDigital = 0;
@@ -335,7 +337,7 @@
if (_soundDigital->isPlaying(_musicSoundChannel))
return;
- _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, SoundDigital::kSoundTypeMusic);
+ _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType);
}
void KyraEngine_v3::playMusicTrack(int track, int force) {
@@ -356,7 +358,7 @@
if (_musicSoundChannel == -1) {
assert(track < _soundListSize && track >= 0);
- _musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, SoundDigital::kSoundTypeMusic);
+ _musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, Audio::Mixer::kMusicSoundType);
}
_curMusicTrack = track;
@@ -415,7 +417,7 @@
snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]);
uint8 priority = _sfxFileMap[item*2+1];
- _soundDigital->playSound(filename, priority, SoundDigital::kSoundTypeSfx, volume);
+ _soundDigital->playSound(filename, priority, Audio::Mixer::kSFXSoundType, volume);
}
}
@@ -429,7 +431,7 @@
char filename[16];
snprintf(filename, 16, "%u.AUD", (uint)file);
- _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, SoundDigital::kSoundTypeSpeech, 255);
+ _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255);
}
bool KyraEngine_v3::snd_voiceIsPlaying() {
Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h 2008-04-20 20:33:02 UTC (rev 31631)
+++ scummvm/trunk/engines/kyra/sound.h 2008-04-20 22:24:24 UTC (rev 31632)
@@ -504,12 +504,6 @@
bool init() { return true; }
- enum kSoundTypes {
- kSoundTypeMusic,
- kSoundTypeSfx,
- kSoundTypeSpeech
- };
-
/**
* Plays a sound.
*
@@ -522,7 +516,7 @@
*
* @return channel playing the sound
*/
- int playSound(const char *filename, uint8 priority, kSoundTypes type, int volume = 255, bool loop = false, int channel = -1);
+ int playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume = 255, bool loop = false, int channel = -1);
/**
* Checks if a given channel is playing a sound.
Modified: scummvm/trunk/engines/kyra/sound_digital.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_digital.cpp 2008-04-20 20:33:02 UTC (rev 31631)
+++ scummvm/trunk/engines/kyra/sound_digital.cpp 2008-04-20 22:24:24 UTC (rev 31632)
@@ -329,7 +329,7 @@
stopSound(i);
}
-int SoundDigital::playSound(const char *filename, uint8 priority, kSoundTypes type, int volume, bool loop, int channel) {
+int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume, bool loop, int channel) {
Sound *use = 0;
if (channel != -1 && channel < ARRAYSIZE(_sounds)) {
stopSound(channel);
@@ -383,12 +383,7 @@
volume = 255;
volume = (volume * Audio::Mixer::kMaxChannelVolume) / 255;
- if (type == kSoundTypeMusic)
- _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &use->handle, use->stream, -1, volume);
- else if (type == kSoundTypeSfx)
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &use->handle, use->stream, -1, volume);
- else if (type == kSoundTypeSpeech)
- _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &use->handle, use->stream, -1, volume);
+ _mixer->playInputStream(type, &use->handle, use->stream, -1, volume);
return use - _sounds;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list