diff options
Diffstat (limited to 'backends/platform/wince')
-rw-r--r-- | backends/platform/wince/wince-sdl.cpp | 32 | ||||
-rw-r--r-- | backends/platform/wince/wince-sdl.h | 5 |
2 files changed, 17 insertions, 20 deletions
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 8bf3772db6..e359ba1744 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -783,16 +783,16 @@ void OSystem_WINCE3::setupMixer() { SDL_AudioSpec desired; int thread_priority; - compute_sample_rate(); - if (_sampleRate == 0) - warning("setSoundCallback called with 0 _sampleRate - audio will not work"); - else if (_mixer && _mixer->getOutputRate() == _sampleRate) { + uint32 sampleRate = compute_sample_rate(); + if (sampleRate == 0) + warning("setSoundCallback called with sample rate 0 - audio will not work"); + else if (_mixer && _mixer->getOutputRate() == sampleRate) { debug(1, "Skipping sound mixer re-init: samplerate is good"); return; } memset(&desired, 0, sizeof(desired)); - desired.freq = _sampleRate; + desired.freq = sampleRate; desired.format = AUDIO_S16SYS; desired.channels = 2; desired.samples = 128; @@ -817,7 +817,7 @@ void OSystem_WINCE3::setupMixer() { _mixer->setReady(false); } else { - debug(1, "Sound opened OK, mixing at %d Hz", _sampleRate); + debug(1, "Sound opened OK, mixing at %d Hz", sampleRate); // Re-create mixer to match the output rate int vol1 = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType); @@ -830,7 +830,7 @@ void OSystem_WINCE3::setupMixer() { _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol2); _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol3); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, vol4); - _mixer->setOutputRate(_sampleRate); + _mixer->setOutputRate(sampleRate); _mixer->setReady(true); SDL_PauseAudio(0); } @@ -875,7 +875,9 @@ bool OSystem_WINCE3::checkOggHighSampleRate() { } #endif -void OSystem_WINCE3::compute_sample_rate() { +uint32 OSystem_WINCE3::compute_sample_rate() { + uint32 sampleRate; + // Force at least medium quality FM synthesis for FOTAQ Common::String gameid(ConfMan.get("gameid")); if (gameid == "queen") { @@ -887,24 +889,22 @@ void OSystem_WINCE3::compute_sample_rate() { } // See if the output frequency is forced by the game if (gameid == "ft" || gameid == "dig" || gameid == "comi" || gameid == "queen" || gameid == "sword" || gameid == "agi") - _sampleRate = SAMPLES_PER_SEC_NEW; + sampleRate = SAMPLES_PER_SEC_NEW; else { if (ConfMan.hasKey("high_sample_rate") && ConfMan.getBool("high_sample_rate")) - _sampleRate = SAMPLES_PER_SEC_NEW; + sampleRate = SAMPLES_PER_SEC_NEW; else - _sampleRate = SAMPLES_PER_SEC_OLD; + sampleRate = SAMPLES_PER_SEC_OLD; } #ifdef USE_VORBIS // Modify the sample rate on the fly if OGG is involved - if (_sampleRate == SAMPLES_PER_SEC_OLD) + if (sampleRate == SAMPLES_PER_SEC_OLD) if (checkOggHighSampleRate()) - _sampleRate = SAMPLES_PER_SEC_NEW; + sampleRate = SAMPLES_PER_SEC_NEW; #endif -} -int OSystem_WINCE3::getOutputSampleRate() const { - return _sampleRate; + return sampleRate; } void OSystem_WINCE3::engineInit() { diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index 1aff930989..bbe601983e 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -132,7 +132,6 @@ protected: int getDefaultGraphicsMode() const; bool openCD(int drive); - int getOutputSampleRate() const; bool hasFeature(Feature f); void setFeatureState(Feature f, bool enable); @@ -153,7 +152,7 @@ private: void create_toolbar(); void update_game_settings(); void check_mappings(); - void compute_sample_rate(); + uint32 compute_sample_rate(); void retrieve_mouse_location(int &x, int &y); @@ -163,8 +162,6 @@ private: SDL_Surface *_toolbarHigh; // toolbar 640x80 bool _toolbarHighDrawn; // cache toolbar 640x80 - uint16 _sampleRate; // current audio sample rate - bool _freeLook; // freeLook mode (do not send mouse button events) bool _forceHideMouse; // force invisible mouse cursor |