From b37129d36872d2d42d861024433c34239b24f6a3 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 31 Jul 2002 05:15:05 +0000 Subject: [PATCH] win32 fixes and some MSVC warnings fixed git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2136 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 10 +++++----- dpvsimpledecode.c | 2 +- snd_win.c | 15 ++++++++------- wavefile.c | 5 +++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 9feb591a..d6655098 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -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; } diff --git a/dpvsimpledecode.c b/dpvsimpledecode.c index bdfcf319..0d30b4f7 100644 --- a/dpvsimpledecode.c +++ b/dpvsimpledecode.c @@ -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 diff --git a/snd_win.c b/snd_win.c index af196ea0..2fed37be 100644 --- 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); } diff --git a/wavefile.c b/wavefile.c index eae62d67..67a4575c 100644 --- a/wavefile.c +++ b/wavefile.c @@ -1,6 +1,7 @@ #include #include +#include #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; -- 2.39.2