summaryrefslogtreecommitdiff
path: root/source/snd_wave.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
commitbbefa87db18f5b76dc67efa00b7cc798361480f3 (patch)
treeefc130fe3b4fe22f111154a8720491b756daa7bd /source/snd_wave.c
parentd65e02496cd9873f5bb0297661b19762b44ddfec (diff)
Hacked the source to get it compile on Windows Mobile using CeGCC toolchain.
Fixed nasty memory corruption bug in UI scripts loading code. Fixed software refresh compilation issues on Windows. Inactive MVD channels are now completely destroyed and recreated once they are active again, and they are no longer allowed to stay in waiting state forever. Fixed delay buffer overflow resulting in fatal connection error. Preserve MVD stream flags in demos recorded on GTV server, and handle `inuse' flag correctly on players when writing gamestate. Updated documentation and Debian package descriptions.
Diffstat (limited to 'source/snd_wave.c')
-rw-r--r--source/snd_wave.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/snd_wave.c b/source/snd_wave.c
index f036b83..084807d 100644
--- a/source/snd_wave.c
+++ b/source/snd_wave.c
@@ -141,9 +141,9 @@ static sndinitstat_t WAVE_Init (void) {
}
if (MessageBox (NULL,
- __TEXT("The sound hardware is in use by another app.\n\n")
- __TEXT("Select Retry to try to start sound again or Cancel to run ") __TEXT("q2pro") __TEXT(" with no sound."),
- __TEXT("Sound not available"),
+ _T("The sound hardware is in use by another app.\n\n")
+ _T("Select Retry to try to start sound again or Cancel to run ") _T("q2pro") _T(" with no sound."),
+ _T("Sound not available"),
MB_RETRYCANCEL | MB_SETFOREGROUND | MB_ICONEXCLAMATION) != IDRETRY)
{
Com_DPrintf ("hw in use\n" );
@@ -160,10 +160,10 @@ static sndinitstat_t WAVE_Init (void) {
*/
Com_DPrintf ("...allocating waveform buffer: ");
gSndBufSize = WAV_BUFFERS*WAV_BUFFER_SIZE;
- hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, gSndBufSize);
+ hData = GlobalAlloc(GMEM_MOVEABLE /*| GMEM_SHARE*/, gSndBufSize);
if (!hData)
{
- Com_DPrintf( " failed\n" );
+ Com_DPrintf( " failed with error %#lx\n", GetLastError() );
WAVE_Shutdown();
return SIS_FAILURE;
}
@@ -173,7 +173,7 @@ static sndinitstat_t WAVE_Init (void) {
lpData = GlobalLock(hData);
if (!lpData)
{
- Com_DPrintf( " failed\n" );
+ Com_DPrintf( " failed with error %#lx\n", GetLastError() );
WAVE_Shutdown();
return SIS_FAILURE;
}
@@ -186,12 +186,11 @@ static sndinitstat_t WAVE_Init (void) {
* GMEM_SHARE flags.
*/
Com_DPrintf ("...allocating waveform header: ");
- hWaveHdr = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE,
+ hWaveHdr = GlobalAlloc(GMEM_MOVEABLE /*| GMEM_SHARE*/,
(DWORD) sizeof(WAVEHDR) * WAV_BUFFERS);
-
if (hWaveHdr == NULL)
{
- Com_DPrintf( "failed\n" );
+ Com_DPrintf( "failed with error %#lx\n", GetLastError() );
WAVE_Shutdown();
return SIS_FAILURE;
}
@@ -199,10 +198,9 @@ static sndinitstat_t WAVE_Init (void) {
Com_DPrintf ("...locking waveform header: ");
lpWaveHdr = (LPWAVEHDR) GlobalLock(hWaveHdr);
-
if (lpWaveHdr == NULL)
{
- Com_DPrintf( "failed\n" );
+ Com_DPrintf( "failed with error %#lx\n", GetLastError() );
WAVE_Shutdown();
return SIS_FAILURE;
}