diff options
Diffstat (limited to 'sword1')
-rw-r--r-- | sword1/animation.cpp | 4 | ||||
-rw-r--r-- | sword1/animation.h | 6 | ||||
-rw-r--r-- | sword1/credits.cpp | 4 | ||||
-rw-r--r-- | sword1/credits.h | 9 | ||||
-rw-r--r-- | sword1/logic.cpp | 2 | ||||
-rw-r--r-- | sword1/logic.h | 4 | ||||
-rw-r--r-- | sword1/music.cpp | 6 | ||||
-rw-r--r-- | sword1/music.h | 8 | ||||
-rw-r--r-- | sword1/sound.cpp | 14 | ||||
-rw-r--r-- | sword1/sound.h | 8 | ||||
-rw-r--r-- | sword1/sword1.cpp | 4 |
11 files changed, 38 insertions, 31 deletions
diff --git a/sword1/animation.cpp b/sword1/animation.cpp index e0c9794f85..18082374a3 100644 --- a/sword1/animation.cpp +++ b/sword1/animation.cpp @@ -32,7 +32,7 @@ namespace Sword1 { -AnimationState::AnimationState(Screen *scr, SoundMixer *snd, OSystem *sys) +AnimationState::AnimationState(Screen *scr, Audio::Mixer *snd, OSystem *sys) : BaseAnimationState(snd, sys, 640, 400), _scr(scr) { } @@ -80,7 +80,7 @@ AudioStream *AnimationState::createAudioStream(const char *name, void *arg) { return AudioStream::openStreamFile(name); } -MoviePlayer::MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys) +MoviePlayer::MoviePlayer(Screen *scr, Audio::Mixer *snd, OSystem *sys) : _scr(scr), _snd(snd), _sys(sys) { for (uint8 cnt = 0; cnt < INTRO_LOGO_OVLS; cnt++) _logoOvls[cnt] = NULL; diff --git a/sword1/animation.h b/sword1/animation.h index bb931af50a..73f46efe59 100644 --- a/sword1/animation.h +++ b/sword1/animation.h @@ -61,7 +61,7 @@ private: Screen *_scr; public: - AnimationState(Screen *scr, SoundMixer *snd, OSystem *sys); + AnimationState(Screen *scr, Audio::Mixer *snd, OSystem *sys); ~AnimationState(); void updateScreen(); OverlayColor *giveRgbBuffer(void); @@ -80,7 +80,7 @@ protected: class MoviePlayer { public: - MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys); + MoviePlayer(Screen *scr, Audio::Mixer *snd, OSystem *sys); ~MoviePlayer(void); void play(uint32 id); private: @@ -88,7 +88,7 @@ private: void processFrame(uint32 animId, AnimationState *anim, uint32 frameNo); bool initOverlays(uint32 id); Screen *_scr; - SoundMixer *_snd; + Audio::Mixer *_snd; OSystem *_sys; static const char *_sequenceList[20]; diff --git a/sword1/credits.cpp b/sword1/credits.cpp index 511dd37e42..d207c7b4db 100644 --- a/sword1/credits.cpp +++ b/sword1/credits.cpp @@ -66,7 +66,7 @@ enum { }; -CreditsPlayer::CreditsPlayer(OSystem *pSystem, SoundMixer *pMixer) { +CreditsPlayer::CreditsPlayer(OSystem *pSystem, Audio::Mixer *pMixer) { _system = pSystem; _mixer = pMixer; _smlFont = _bigFont = NULL; @@ -113,7 +113,7 @@ void CreditsPlayer::play(void) { // everything's initialized, time to render and show the credits. SoundHandle bgSound; - _mixer->playInputStream(SoundMixer::kMusicSoundType, &bgSound, bgSoundStream, 0); + _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &bgSound, bgSoundStream, 0); int relDelay = 0; uint16 scrollY = 0; diff --git a/sword1/credits.h b/sword1/credits.h index c64985df58..159475eaa7 100644 --- a/sword1/credits.h +++ b/sword1/credits.h @@ -23,7 +23,10 @@ #define BS1CREDITS_H #include "common/util.h" -class SoundMixer; + +namespace Audio { + class Mixer; +} class OSystem; namespace Sword1 { @@ -44,7 +47,7 @@ private: class CreditsPlayer { public: - CreditsPlayer(OSystem *pSystem, SoundMixer *pMixer); + CreditsPlayer(OSystem *pSystem, Audio::Mixer *pMixer); void play(void); private: void generateFonts(ArcFile *arcFile); @@ -58,7 +61,7 @@ private: uint8 _numChars; OSystem *_system; - SoundMixer *_mixer; + Audio::Mixer *_mixer; uint8 *_smlFont, *_bigFont; }; diff --git a/sword1/logic.cpp b/sword1/logic.cpp index 9151a8d05e..9206007616 100644 --- a/sword1/logic.cpp +++ b/sword1/logic.cpp @@ -48,7 +48,7 @@ namespace Sword1 { uint32 Logic::_scriptVars[NUM_SCRIPT_VARS]; -Logic::Logic(ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, SoundMixer *mixer) { +Logic::Logic(ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer) { _objMan = pObjMan; _resMan = resMan; _screen = pScreen; diff --git a/sword1/logic.h b/sword1/logic.h index 37fbc82319..62f750ea0f 100644 --- a/sword1/logic.h +++ b/sword1/logic.h @@ -47,7 +47,7 @@ typedef int (Logic::*BSMcodeTable)(Object *, int32, int32, int32, int32, int32, class Logic { public: - Logic(ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, SoundMixer *mixer); + Logic(ObjectMan *pObjMan, ResMan *resMan, Screen *pScreen, Mouse *pMouse, Sound *pSound, Music *pMusic, Menu *pMenu, OSystem *system, Audio::Mixer *mixer); ~Logic(void); void initialize(void); void newScreen(uint32 screen); @@ -62,7 +62,7 @@ public: private: ObjectMan *_objMan; OSystem *_system; - SoundMixer *_mixer; + Audio::Mixer *_mixer; ResMan *_resMan; Screen *_screen; Sound *_sound; diff --git a/sword1/music.cpp b/sword1/music.cpp index f8b60bca5b..f0b70f5731 100644 --- a/sword1/music.cpp +++ b/sword1/music.cpp @@ -48,12 +48,12 @@ WaveAudioStream::WaveAudioStream(Common::File *source, uint32 pSize) { _sampleBuf = (uint8*)malloc(SMP_BUFSIZE); _sourceFile->incRef(); if (_sourceFile->isOpen() && loadWAVFromStream(*_sourceFile, size, rate, flags)) { - _isStereo = (flags & SoundMixer::FLAG_STEREO) != 0; + _isStereo = (flags & Audio::Mixer::FLAG_STEREO) != 0; _rate = rate; if (pSize && (int)pSize < size) size = pSize; assert((uint32)size <= (source->size() - source->pos())); - _bitsPerSample = ((flags & SoundMixer::FLAG_16BITS) != 0) ? 16 : 8; + _bitsPerSample = ((flags & Audio::Mixer::FLAG_16BITS) != 0) ? 16 : 8; _samplesLeft = (size * 8) / _bitsPerSample; if ((_bitsPerSample != 16) && (_bitsPerSample != 8)) error("WaveAudioStream: unknown wave type"); @@ -251,7 +251,7 @@ void MusicHandle::stop() { _looping = false; } -Music::Music(SoundMixer *pMixer) { +Music::Music(Audio::Mixer *pMixer) { _mixer = pMixer; _sampleRate = pMixer->getOutputRate(); _converter[0] = NULL; diff --git a/sword1/music.h b/sword1/music.h index 53873c87cc..5628cbce40 100644 --- a/sword1/music.h +++ b/sword1/music.h @@ -28,7 +28,9 @@ #include "sound/audiostream.h" #include "sound/rate.h" -class SoundMixer; +namespace Audio { + class Mixer; +} namespace Sword1 { @@ -84,7 +86,7 @@ public: class Music : public AudioStream { public: - Music(SoundMixer *pMixer); + Music(Audio::Mixer *pMixer); ~Music(); void startMusic(int32 tuneId, int32 loopFlag); void fadeDown(); @@ -104,7 +106,7 @@ private: st_volume_t _volumeL, _volumeR; MusicHandle _handles[2]; RateConverter *_converter[2]; - SoundMixer *_mixer; + Audio::Mixer *_mixer; uint32 _sampleRate; Common::Mutex _mutex; diff --git a/sword1/sound.cpp b/sword1/sound.cpp index cde9e867dc..2673c9fc92 100644 --- a/sword1/sound.cpp +++ b/sword1/sound.cpp @@ -33,9 +33,9 @@ namespace Sword1 { #define SOUND_SPEECH_ID 1 -#define SPEECH_FLAGS (SoundMixer::FLAG_16BITS | SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LITTLE_ENDIAN) +#define SPEECH_FLAGS (Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_LITTLE_ENDIAN) -Sound::Sound(const char *searchPath, SoundMixer *mixer, ResMan *pResMan) { +Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) { strcpy(_filePath, searchPath); _mixer = mixer; _resMan = pResMan; @@ -161,11 +161,11 @@ void Sound::playSample(QueueElement *elem) { uint32 size = READ_LE_UINT32(sampleData + 0x28); uint8 flags; if (READ_LE_UINT16(sampleData + 0x22) == 16) - flags = SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN; + flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN; else - flags = SoundMixer::FLAG_UNSIGNED; + flags = Audio::Mixer::FLAG_UNSIGNED; if (READ_LE_UINT16(sampleData + 0x16) == 2) - flags |= SoundMixer::FLAG_STEREO; + flags |= Audio::Mixer::FLAG_STEREO; _mixer->playRaw(&elem->handle, sampleData + 0x2C, size, 11025, flags, elem->id, volume, pan); } } else @@ -195,7 +195,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { #ifdef USE_MAD else if (_cowMode == CowMp3) { _cowFile.seek(index); - _mixer->playInputStream(SoundMixer::kSFXSoundType, &_speechHandle, makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, makeMP3Stream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); // with compressed audio, we can't calculate the wave volume. // so default to talking. for (int cnt = 0; cnt < 480; cnt++) @@ -206,7 +206,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { #ifdef USE_VORBIS else if (_cowMode == CowVorbis) { _cowFile.seek(index); - _mixer->playInputStream(SoundMixer::kSFXSoundType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speechHandle, makeVorbisStream(&_cowFile, sampleSize), SOUND_SPEECH_ID, speechVol, speechPan); for (int cnt = 0; cnt < 480; cnt++) _waveVolume[cnt] = true; _waveVolPos = 0; diff --git a/sword1/sound.h b/sword1/sound.h index 8a65f0dcf0..5b2469aa81 100644 --- a/sword1/sound.h +++ b/sword1/sound.h @@ -28,7 +28,9 @@ #include "sound/mixer.h" #include "common/util.h" -class SoundMixer; +namespace Audio { + class Mixer; +} namespace Sword1 { @@ -67,7 +69,7 @@ enum CowMode { class Sound { public: - Sound(const char *searchPath, SoundMixer *mixer, ResMan *pResMan); + Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan); ~Sound(void); void setSpeechVol(uint8 volL, uint8 volR) { _speechVolL = volL; _speechVolR = volR; }; void setSfxVol(uint8 volL, uint8 volR) { _sfxVolL = volL; _sfxVolR = volR; }; @@ -106,7 +108,7 @@ private: QueueElement _fxQueue[MAX_FXQ_LENGTH]; uint8 _endOfQueue; - SoundMixer *_mixer; + Audio::Mixer *_mixer; ResMan *_resMan; char _filePath[100]; static const char _musicList[270]; diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp index aa08e352d0..87c9d3d46e 100644 --- a/sword1/sword1.cpp +++ b/sword1/sword1.cpp @@ -166,8 +166,8 @@ int SwordEngine::init(GameDetector &detector) { _resMan = new ResMan("swordres.rif"); debug(5, "Starting object manager"); _objectMan = new ObjectMan(_resMan); - _mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, SoundMixer::kMaxMixerVolume); - _mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, SoundMixer::kMaxMixerVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, Audio::Mixer::kMaxMixerVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume); _mouse = new Mouse(_system, _resMan, _objectMan); _screen = new Screen(_system, _resMan, _objectMan); _music = new Music(_mixer); |