]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
win32 fixes and some MSVC warnings fixed
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Jul 2002 05:15:05 +0000 (05:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 31 Jul 2002 05:15:05 +0000 (05:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2136 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
dpvsimpledecode.c
snd_win.c
wavefile.c

index 9feb591a2f27d5b7452513721ca1e5d58b83d6de..d66550984709680c57e980f1c577e7537b01adee 100644 (file)
@@ -590,14 +590,14 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags)
        dq->scalex = 0;
        dq->scaley = 0;
        p = (void *)(dq + 1);
-       m = p;p += sizeof(drawqueuemesh_t);
+       m = p;(qbyte *)p += sizeof(drawqueuemesh_t);
        m->numindices = mesh->numindices;
        m->numvertices = mesh->numvertices;
        m->texture = mesh->texture;
-       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numindices  * sizeof(int     ));p += m->numindices  * sizeof(int     );
-       m->vertices  = p;memcpy(m->vertices , mesh->vertices , m->numvertices * sizeof(float[3]));p += m->numvertices * sizeof(float[3]);
-       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[2]));p += m->numvertices * sizeof(float[2]);
-       m->colors    = p;memcpy(m->colors   , mesh->colors   , m->numvertices * sizeof(float[4]));p += m->numvertices * sizeof(float[4]);
+       m->indices   = p;memcpy(m->indices  , mesh->indices  , m->numindices  * sizeof(int     ));(qbyte *)p += m->numindices  * sizeof(int     );
+       m->vertices  = p;memcpy(m->vertices , mesh->vertices , m->numvertices * sizeof(float[3]));(qbyte *)p += m->numvertices * sizeof(float[3]);
+       m->texcoords = p;memcpy(m->texcoords, mesh->texcoords, m->numvertices * sizeof(float[2]));(qbyte *)p += m->numvertices * sizeof(float[2]);
+       m->colors    = p;memcpy(m->colors   , mesh->colors   , m->numvertices * sizeof(float[4]));(qbyte *)p += m->numvertices * sizeof(float[4]);
        r_refdef.drawqueuesize += dq->size;
 }
 
index bdfcf319b0dfaf96aeb592e4af9083e15fe6c634..0d30b4f703e1a3dec7e85a82191886a9f4ff30a4 100644 (file)
@@ -178,7 +178,7 @@ int hz_bitstream_read_bit(hz_bitstream_readblocks_t *blocks)
        return (blocks->store >> blocks->count) & 1;
 }
 
-unsigned int hz_bitstream_read_bits(hz_bitstream_readblocks_t *blocks, unsigned int size)
+unsigned int hz_bitstream_read_bits(hz_bitstream_readblocks_t *blocks, int size)
 {
        unsigned int num = 0;
        // we can only handle about 24 bits at a time safely
index af196ea0c0deae10f25c947fbabf8a9b054d66c7..2fed37be8279b8dda4ac6dcdf30e56f7e9a7f2ae 100644 (file)
--- a/snd_win.c
+++ b/snd_win.c
@@ -729,20 +729,20 @@ void SNDDMA_Shutdown(void)
        FreeSound ();
 }
 
-
+DWORD dsound_dwSize;
+DWORD dsound_dwSize2;
+DWORD *dsound_pbuf;
+DWORD *dsound_pbuf2;
 void *S_LockBuffer(void)
 {
        int reps;
-       DWORD dwSize,dwSize2;
-       DWORD *pbuf;
-       DWORD *pbuf2;
        HRESULT hresult;
 
        if (pDSBuf)
        {
                reps = 0;
 
-               while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pbuf, &dwSize, &pbuf2, &dwSize2, 0)) != DS_OK)
+               while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &dsound_pbuf, &dsound_dwSize, &dsound_pbuf2, &dsound_dwSize2, 0)) != DS_OK)
                {
                        if (hresult != DSERR_BUFFERLOST)
                        {
@@ -760,14 +760,15 @@ void *S_LockBuffer(void)
                                return NULL;
                        }
                }
+               return dsound_pbuf;
        }
        else
                return shm->buffer;
 }
 
-void S_UnlockBuffer(void)
+void S_UnlockBuffer()
 {
        if (pDSBuf)
-               pDSBuf->lpVtbl->Unlock(pDSBuf, pbuf, dwSize, NULL, 0);
+               pDSBuf->lpVtbl->Unlock(pDSBuf, dsound_pbuf, dsound_dwSize, dsound_pbuf2, dsound_dwSize2);
 }
 
index eae62d67dd72daa38452adba073a9a41b8bc5c00..67a4575cf71f593da824319ac9dd16a8035df723 100644 (file)
@@ -1,6 +1,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include "wavefile.h"
 
 wavefile_t *waveopen(char *filename, char **errorstring)
@@ -130,8 +131,8 @@ void waveclose(wavefile_t *f)
 
 unsigned int waveread16stereo(wavefile_t *w, short *soundbuffer, unsigned int samples)
 {
-       int i;
-       int length;
+       unsigned int i;
+       unsigned int length;
        unsigned char *in;
        short *out;
        length = samples;