Hello everyone,
Attached are two patches for the current SVN. The first one fixes
compilation with g++ for me (it is not reversing rev. 50), and the
second lets the game actually run even if the sound device is busy.
cybersphinx
--
No matter how cynical you get, it's impossible to keep up.
Index: lib/ivis_opengl/screen.c
===================================================================
--- lib/ivis_opengl/screen.c (revision 50)
+++ lib/ivis_opengl/screen.c (working copy)
@@ -701,7 +701,7 @@
typedef struct {
struct jpeg_destination_mgr pub;
- struct PHYSFS_File* file;
+ PHYSFS_file* file;
JOCTET * buffer;
} my_jpeg_destination_mgr;
Thu Mar 16 22:20:52 CET 2006 [EMAIL PROTECTED]
* Fix audio initalisation
* Make the game actually run without audio
* In the process, remove some useless code
diff -rN -u -Bbud old-wz/lib/sound/audio.c new-wz/lib/sound/audio.c
--- old-wz/lib/sound/audio.c 2006-03-19 13:04:38.438060225 +0100
+++ new-wz/lib/sound/audio.c 2006-03-19 13:04:39.402922976 +0100
@@ -71,18 +71,10 @@
//
=======================================================================================================================
//
=======================================================================================================================
//
-BOOL audio_Init( HWND hWnd, BOOL bEnabled, AUDIO_CALLBACK pStopTrackCallback )
+BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback )
{
- // if audio not enabled return TRUE to carry on game without audio
- if ( bEnabled == FALSE )
- {
- g_bAudioEnabled = FALSE;
- return TRUE;
- }
-
// init audio system
- g_bAudioEnabled = sound_Init( hWnd, MAX_SAME_SAMPLES );
- if ( g_bAudioEnabled == TRUE )
+ if (g_bAudioEnabled = sound_Init(MAX_SAME_SAMPLES))
{
// allocate sample heap
if ( !HEAP_CREATE(&g_psSampleHeap, AUDIO_SAMPLE_HEAP_INIT,
AUDIO_SAMPLE_HEAP_EXT, sizeof(AUDIO_SAMPLE)) )
@@ -92,18 +84,8 @@
}
sound_SetStoppedCallback( pStopTrackCallback );
-
- // ifdef WIN32 //Not needed ?--Qamly
- //
- // InitializeCriticalSection( &critSecAudio );
- //
- // endif
- return TRUE;
- }
- else
- {
- return FALSE;
}
+ return g_bAudioEnabled;
}
//*
diff -rN -u -Bbud old-wz/lib/sound/audio.h new-wz/lib/sound/audio.h
--- old-wz/lib/sound/audio.h 2006-03-19 13:04:38.436060510 +0100
+++ new-wz/lib/sound/audio.h 2006-03-19 13:04:39.402922976 +0100
@@ -11,8 +11,7 @@
/***************************************************************************/
-extern BOOL audio_Init( HWND hWnd, BOOL bEnabled,
- AUDIO_CALLBACK
pStopTrackCallback );
+extern BOOL audio_Init( AUDIO_CALLBACK pStopTrackCallback );
extern BOOL audio_Update();
extern BOOL audio_Shutdown();
extern BOOL audio_Disabled( void );
diff -rN -u -Bbud old-wz/lib/sound/track.c new-wz/lib/sound/track.c
--- old-wz/lib/sound/track.c 2006-03-19 13:04:38.435060652 +0100
+++ new-wz/lib/sound/track.c 2006-03-19 13:04:39.514907046 +0100
@@ -63,7 +63,7 @@
//
=======================================================================================================================
//
=======================================================================================================================
//
-BOOL sound_Init( HWND hWnd, SDWORD iMaxSameSamples )
+BOOL sound_Init( SDWORD iMaxSameSamples )
{
//~~~~~~~~~~~~~
#ifdef USE_COMPRESSED_SPEECH
diff -rN -u -Bbud old-wz/lib/sound/track.h new-wz/lib/sound/track.h
--- old-wz/lib/sound/track.h 2006-03-19 13:04:38.435060652 +0100
+++ new-wz/lib/sound/track.h 2006-03-19 13:04:39.407922264 +0100
@@ -87,7 +87,7 @@
/* functions
*/
-BOOL sound_Init( HWND hWnd, SDWORD iMaxSameSamples );
+BOOL sound_Init( SDWORD iMaxSameSamples );
BOOL sound_Shutdown();
BOOL sound_LoadTrackFromFile( signed char szFileName[] );
diff -rN -u -Bbud old-wz/src/init.c new-wz/src/init.c
--- old-wz/src/init.c 2006-03-19 13:04:38.435060652 +0100
+++ new-wz/src/init.c 2006-03-19 13:04:39.456915295 +0100
@@ -1123,13 +1123,9 @@
return FALSE;
}
- #ifdef AUDIO_DISABLED
- if (!audio_Init(frameGetWinHandle(), FALSE, droidAudioTrackStopped))
// audio.
- #else
- if (!audio_Init((HWND) frameGetWinHandle(), TRUE,
droidAudioTrackStopped))
- #endif
+ if (!audio_Init(droidAudioTrackStopped))
{
- DBERROR( ("Couldn't initialise audio system: continuing without
audio\n") );
+ DBPRINTF( ("Couldn't initialise audio system: continuing
without audio\n") );
}
if (war_GetPlayAudioCDs()) {
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev