]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_win.c
bump a few limits in DP_SMALLMEMORY (cachedpics was too low for even
[xonotic/darkplaces.git] / snd_win.c
index c27b3772043e945bc0802b87bce1f18de3eba88f..b1c6b58bd0ba4493db73e44d3c7f03deb613f171 100644 (file)
--- a/snd_win.c
+++ b/snd_win.c
@@ -237,7 +237,7 @@ static sndinitstat SndSys_InitDirectSound (const snd_format_t* requested)
                        return SIS_FAILURE;
                }
 
-               pDirectSoundCreate = (void *)GetProcAddress(hInstDS,"DirectSoundCreate");
+               pDirectSoundCreate = (HRESULT (__stdcall *)(GUID *, LPDIRECTSOUND *,IUnknown *))GetProcAddress(hInstDS,"DirectSoundCreate");
 
                if (!pDirectSoundCreate)
                {
@@ -473,7 +473,7 @@ static qboolean SndSys_InitMmsystem (const snd_format_t* requested)
                SndSys_Shutdown ();
                return false;
        }
-       lpData = GlobalLock(hData);
+       lpData = (HPSTR)GlobalLock(hData);
        if (!lpData)
        {
                Con_Print("Sound: Failed to lock.\n");
@@ -737,8 +737,6 @@ Returns the number of sample frames consumed since the sound started
 unsigned int SndSys_GetSoundTime (void)
 {
        unsigned int factor;
-       MMRESULT res;
-       MMTIME mmtime;
 
        factor = snd_renderbuffer->format.width * snd_renderbuffer->format.channels;
 
@@ -759,7 +757,6 @@ unsigned int SndSys_GetSoundTime (void)
 
        if (wav_init)
        {
-               /*
                // Find which sound blocks have completed
                for (;;)
                {
@@ -776,12 +773,20 @@ unsigned int SndSys_GetSoundTime (void)
                }
 
                return (snd_completed * wav_buffer_size) / factor;
-               */
+
+               /*
+                * S_PaintAndSubmit: WARNING: newsoundtime (soundtime (275 < 134217707)
+                * apparently this sound time wraps quite early?
+               {
+               MMRESULT res;
+               MMTIME mmtime;
 
                mmtime.wType = TIME_SAMPLES;
                res = waveOutGetPosition(hWaveOut, &mmtime, sizeof(mmtime));
                if(res == MMSYSERR_NOERROR)
                        return mmtime.u.sample;
+               }
+               */
        }
 
        return 0;
@@ -869,3 +874,15 @@ void SndSys_UnlockRenderBuffer (void)
                IDirectSoundBuffer_Unlock(pDSBuf, dsound_pbuf, dsound_dwSize, dsound_pbuf2, dsound_dwSize2);
 #endif
 }
+
+/*
+====================
+SndSys_SendKeyEvents
+
+Send keyboard events originating from the sound system (e.g. MIDI)
+====================
+*/
+void SndSys_SendKeyEvents(void)
+{
+       // not supported
+}