]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_coreaudio.c
added indirection cube map for shadowmapping and revised filtering modes
[xonotic/darkplaces.git] / snd_coreaudio.c
index cb653f0447090953bc792784d52f8db44c9b748c..bbc97c07a92094ed0657bf0143aa36449660649a 100644 (file)
@@ -55,7 +55,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice,
 {
        float *outBuffer;
        unsigned int frameCount, factor, sampleIndex;
-       const float scale = 1.0f / SHRT_MAX;
+       float scale = 1.0f / SHRT_MAX;
 
        outBuffer = (float*)outOutputData->mBuffers[0].mData;
        factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width;
@@ -73,6 +73,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice,
                if (snd_usethreadedmixing)
                {
                        S_MixToBuffer(mixbuffer, submissionChunk);
+                       sampleCount = submissionChunk * snd_renderbuffer->format.channels;
                        for (sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++)
                                outBuffer[sampleIndex] = mixbuffer[sampleIndex] * scale;
                        // unlock the mutex now
@@ -239,7 +240,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested)
                return false;
        }
 
-       if(streamDesc.mFormatID != kAudioFormatLinearPCM)
+       if(streamDesc.mFormatID == kAudioFormatLinearPCM)
        {
                // Add the callback function
                status = AudioDeviceAddIOProc(outputDeviceID, audioDeviceIOProc, NULL);
@@ -384,3 +385,15 @@ void SndSys_UnlockRenderBuffer (void)
 {
        pthread_mutex_unlock(&coreaudio_mutex);
 }
+
+/*
+====================
+SndSys_SendKeyEvents
+
+Send keyboard events originating from the sound system (e.g. MIDI)
+====================
+*/
+void SndSys_SendKeyEvents(void)
+{
+       // not supported
+}