From: Ryan C. Gordon Date: Fri, 12 Aug 2005 02:41:08 +0000 (+0000) Subject: Added pitch to fix slomo. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=cb32f6030c30cfd6b32f3f622da1cf148b68af8d;p=lugaru.git Added pitch to fix slomo. --- diff --git a/Source/openal_wrapper.cpp b/Source/openal_wrapper.cpp index c717e00..bc80c0b 100644 --- a/Source/openal_wrapper.cpp +++ b/Source/openal_wrapper.cpp @@ -437,6 +437,18 @@ signed char F_API OPENAL_Sample_SetMinMaxDistance(FSOUND_SAMPLE *sptr, float min signed char F_API OPENAL_SetFrequency(int channel, int freq) { if (!initialized) return FALSE; + if (channel == FSOUND_ALL) + { + for (int i = 0; i < num_channels; i++) + OPENAL_SetFrequency(i, freq); + return TRUE; + } + + if ((channel < 0) || (channel >= num_channels)) return FALSE; + if (freq == 8012) // hack + alSourcef(channels[channel].sid, AL_PITCH, 8012.0f / 44100.0f); + else + alSourcef(channels[channel].sid, AL_PITCH, 1.0f); return TRUE; // ignore this for now... }