]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_win.c
PF_traceline/PF_tracebox can now use world as the edict
[xonotic/darkplaces.git] / snd_win.c
index 23c9009182735e41b18865f3f68fa867c01225b3..835063791b2c3ebe4076c303038ecd828fb76734 100644 (file)
--- a/snd_win.c
+++ b/snd_win.c
@@ -18,7 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 #include "quakedef.h"
-#include "winquake.h"
+#include <windows.h>
+#include <dsound.h>
+
+extern HWND mainwindow;
 
 #define iDirectSoundCreate(a,b,c)      pDirectSoundCreate(a,b,c)
 
@@ -190,10 +193,7 @@ sndinitstat SNDDMA_InitDirect (void)
        int                             reps;
        int i;
 
-       memset ((void *)&sn, 0, sizeof (sn));
-
-       shm = &sn;
-
+       memset((void *)shm, 0, sizeof(*shm));
        shm->channels = 2;
        shm->samplebits = 16;
        i = COM_CheckParm ("-sndspeed"); // LordHavoc: -sndspeed option
@@ -370,7 +370,7 @@ sndinitstat SNDDMA_InitDirect (void)
 // initialize the buffer
        reps = 0;
 
-       while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &lpData, &dwSize, NULL, NULL, 0)) != DS_OK)
+       while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, (LPVOID*)&lpData, &dwSize, NULL, NULL, 0)) != DS_OK)
        {
                if (hresult != DSERR_BUFFERLOST)
                {
@@ -399,11 +399,8 @@ sndinitstat SNDDMA_InitDirect (void)
        pDSBuf->lpVtbl->GetCurrentPosition(pDSBuf, &mmstarttime.u.sample, &dwWrite);
        pDSBuf->lpVtbl->Play(pDSBuf, 0, 0, DSBPLAY_LOOPING);
 
-       shm->soundalive = true;
-       shm->splitbuffer = false;
        shm->samples = gSndBufSize/(shm->samplebits/8);
        shm->samplepos = 0;
-       shm->submission_chunk = 1;
        shm->buffer = (unsigned char *) lpData;
        sample16 = (shm->samplebits/8) - 1;
 
@@ -429,8 +426,7 @@ qboolean SNDDMA_InitWav (void)
        snd_sent = 0;
        snd_completed = 0;
 
-       shm = &sn;
-
+       memset((void *)shm, 0, sizeof(*shm));
        shm->channels = 2;
        shm->samplebits = 16;
        i = COM_CheckParm ("-sndspeed"); // LordHavoc: -sndspeed option
@@ -537,11 +533,8 @@ qboolean SNDDMA_InitWav (void)
                }
        }
 
-       shm->soundalive = true;
-       shm->splitbuffer = false;
        shm->samples = gSndBufSize/(shm->samplebits/8);
        shm->samplepos = 0;
-       shm->submission_chunk = 1;
        shm->buffer = (unsigned char *) lpData;
        sample16 = (shm->samplebits/8) - 1;
 
@@ -742,7 +735,7 @@ void *S_LockBuffer(void)
        {
                reps = 0;
 
-               while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &dsound_pbuf, &dsound_dwSize, &dsound_pbuf2, &dsound_dwSize2, 0)) != DS_OK)
+               while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, (LPVOID*)&dsound_pbuf, &dsound_dwSize, (LPVOID*)&dsound_pbuf2, &dsound_dwSize2, 0)) != DS_OK)
                {
                        if (hresult != DSERR_BUFFERLOST)
                        {
@@ -772,10 +765,3 @@ void S_UnlockBuffer(void)
                pDSBuf->lpVtbl->Unlock(pDSBuf, dsound_pbuf, dsound_dwSize, dsound_pbuf2, dsound_dwSize2);
 }
 
-void S_Open(void)
-{
-}
-
-void S_Close(void)
-{
-}