From f361a7d624091132d1684907f35b9be693ab38f4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 23 Nov 2012 02:50:20 +0100 Subject: KYRA: Make Sound::hasSoundFile const again. --- engines/kyra/sound.cpp | 2 +- engines/kyra/sound.h | 4 ++-- engines/kyra/sound_adlib.cpp | 2 +- engines/kyra/sound_adlib.h | 4 ++-- engines/kyra/sound_amiga.cpp | 2 +- engines/kyra/sound_intern.h | 16 ++++++++-------- engines/kyra/sound_midi.cpp | 2 +- engines/kyra/sound_towns.cpp | 6 +++--- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 7b1b4d82f4..32d175bdb0 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -205,7 +205,7 @@ void MixedSoundDriver::selectAudioResourceSet(int set) { _sfx->selectAudioResourceSet(set); } -bool MixedSoundDriver::hasSoundFile(uint file) { +bool MixedSoundDriver::hasSoundFile(uint file) const { return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); } diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 3418c8a4aa..057eb48b64 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -128,7 +128,7 @@ public: * @param track track number * @return true if available, false otherwise */ - virtual bool hasSoundFile(uint file) = 0; + virtual bool hasSoundFile(uint file) const = 0; /** * Load a specifc sound file for use of @@ -309,7 +309,7 @@ public: virtual void initAudioResourceInfo(int set, void *info); virtual void selectAudioResourceSet(int set); - virtual bool hasSoundFile(uint file); + virtual bool hasSoundFile(uint file) const; virtual void loadSoundFile(uint file); virtual void loadSoundFile(Common::String file); diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 3d4ad1f852..958cfcbcb4 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -2434,7 +2434,7 @@ void SoundAdLibPC::selectAudioResourceSet(int set) { } } -bool SoundAdLibPC::hasSoundFile(uint file) { +bool SoundAdLibPC::hasSoundFile(uint file) const { if (file < res()->fileListSize) return (res()->fileList[file] != 0); return false; diff --git a/engines/kyra/sound_adlib.h b/engines/kyra/sound_adlib.h index 99e1f154c5..f78d812670 100644 --- a/engines/kyra/sound_adlib.h +++ b/engines/kyra/sound_adlib.h @@ -71,7 +71,7 @@ public: virtual void initAudioResourceInfo(int set, void *info); virtual void selectAudioResourceSet(int set); - virtual bool hasSoundFile(uint file); + virtual bool hasSoundFile(uint file) const; virtual void loadSoundFile(uint file); virtual void loadSoundFile(Common::String file); @@ -90,7 +90,7 @@ private: void play(uint8 track, uint8 volume); - const SoundResourceInfo_PC *res() {return _resInfo[_currentResourceSet]; } + const SoundResourceInfo_PC *res() const {return _resInfo[_currentResourceSet]; } SoundResourceInfo_PC *_resInfo[3]; int _currentResourceSet; diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index f633a429f8..7292541594 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -63,7 +63,7 @@ void SoundAmiga::selectAudioResourceSet(int set) { // this doesn't matter much. } -bool SoundAmiga::hasSoundFile(uint file) { +bool SoundAmiga::hasSoundFile(uint file) const { if (file < 3) return true; return false; diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h index 94f596f402..c5cf2658aa 100644 --- a/engines/kyra/sound_intern.h +++ b/engines/kyra/sound_intern.h @@ -64,7 +64,7 @@ public: void initAudioResourceInfo(int set, void *info); void selectAudioResourceSet(int set); - bool hasSoundFile(uint file); + bool hasSoundFile(uint file) const; void loadSoundFile(uint file); void loadSoundFile(Common::String file); void loadSfxFile(Common::String file); @@ -95,7 +95,7 @@ private: MidiParser *_music; MidiParser *_sfx[3]; - const SoundResourceInfo_PC *res() {return _resInfo[_currentResourceSet]; } + const SoundResourceInfo_PC *res() const {return _resInfo[_currentResourceSet]; } SoundResourceInfo_PC *_resInfo[3]; int _currentResourceSet; @@ -122,7 +122,7 @@ public: void initAudioResourceInfo(int set, void *info); void selectAudioResourceSet(int set); - bool hasSoundFile(uint file); + bool hasSoundFile(uint file) const; void loadSoundFile(uint file); void loadSoundFile(Common::String) {} @@ -155,7 +155,7 @@ private: bool _cdaPlaying; - const SoundResourceInfo_Towns *res() {return _resInfo[_currentResourceSet]; } + const SoundResourceInfo_Towns *res() const {return _resInfo[_currentResourceSet]; } SoundResourceInfo_Towns *_resInfo[3]; int _currentResourceSet; @@ -176,7 +176,7 @@ public: void process() {} void initAudioResourceInfo(int set, void *info); void selectAudioResourceSet(int set); - bool hasSoundFile(uint file); + bool hasSoundFile(uint file) const; void loadSoundFile(uint file); void loadSoundFile(Common::String file); @@ -212,7 +212,7 @@ public: void initAudioResourceInfo(int set, void *info); void selectAudioResourceSet(int set); - bool hasSoundFile(uint file); + bool hasSoundFile(uint file) const; void loadSoundFile(uint file) {} void loadSoundFile(Common::String file); @@ -234,7 +234,7 @@ private: uint8 *_sfxTrackData; TownsPC98_AudioDriver *_driver; - const SoundResourceInfo_TownsPC98V2 *res() {return _resInfo[_currentResourceSet]; } + const SoundResourceInfo_TownsPC98V2 *res() const {return _resInfo[_currentResourceSet]; } SoundResourceInfo_TownsPC98V2 *_resInfo[3]; int _currentResourceSet; }; @@ -329,7 +329,7 @@ public: void initAudioResourceInfo(int set, void *info); void selectAudioResourceSet(int set); - bool hasSoundFile(uint file); + bool hasSoundFile(uint file) const; void loadSoundFile(uint file); void loadSoundFile(Common::String) {} diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index fe40cb163a..a54c52612b 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -605,7 +605,7 @@ void SoundMidiPC::selectAudioResourceSet(int set) { } } -bool SoundMidiPC::hasSoundFile(uint file) { +bool SoundMidiPC::hasSoundFile(uint file) const { if (file < res()->fileListSize) return (res()->fileList[file] != 0); return false; diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 6f57ebfcbb..ee2ea6b6e4 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -134,7 +134,7 @@ void SoundTowns::selectAudioResourceSet(int set) { } } -bool SoundTowns::hasSoundFile(uint file) { +bool SoundTowns::hasSoundFile(uint file) const { if (file < res()->fileListSize) return (res()->fileList[file] != 0); return false; @@ -423,7 +423,7 @@ void SoundPC98::selectAudioResourceSet(int set) { } } -bool SoundPC98::hasSoundFile(uint file) { +bool SoundPC98::hasSoundFile(uint file) const { return true; } @@ -564,7 +564,7 @@ void SoundTownsPC98_v2::selectAudioResourceSet(int set) { } } -bool SoundTownsPC98_v2::hasSoundFile(uint file) { +bool SoundTownsPC98_v2::hasSoundFile(uint file) const { if (file < res()->fileListSize) return (res()->fileList[file] != 0); return false; -- cgit v1.2.3