summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/snd_local.h1
-rw-r--r--source/snd_main.c8
-rw-r--r--source/snd_mem.c10
3 files changed, 12 insertions, 7 deletions
diff --git a/source/snd_local.h b/source/snd_local.h
index 1204cfe..b0e72fa 100644
--- a/source/snd_local.h
+++ b/source/snd_local.h
@@ -44,6 +44,7 @@ typedef struct sfx_s
int registration_sequence;
sfxcache_t *cache;
char *truename;
+ qerror_t error;
} sfx_t;
// a playsound_t will be generated by each call to S_StartSound,
diff --git a/source/snd_main.c b/source/snd_main.c
index 11c15f0..29e739b 100644
--- a/source/snd_main.c
+++ b/source/snd_main.c
@@ -112,7 +112,8 @@ static void S_SoundList_f( void ) {
if( sfx->name[0] == '*' )
Com_Printf( " placeholder : %s\n", sfx->name );
else
- Com_Printf( " not loaded : %s\n", sfx->name );
+ Com_Printf( " not loaded : %s (%s)\n",
+ sfx->name, Q_ErrorString( sfx->error ) );
}
}
Com_Printf( "Total resident: %i\n", total );
@@ -363,9 +364,7 @@ qhandle_t S_RegisterSound( const char *name ) {
sfx = S_FindName( name );
if( !s_registering ) {
- if( !S_LoadSound( sfx ) ) {
- /*return 0;*/
- }
+ S_LoadSound( sfx );
}
return ( sfx - known_sfx ) + 1;
@@ -405,6 +404,7 @@ static sfx_t *S_RegisterSexedSound( int entnum, const char *base ) {
// no, revert to the male sound in the pak0.pak
Q_concat( buffer, sizeof( buffer ),
"player/male/", base + 1, NULL );
+ sfx->error = Q_ERR_SUCCESS;
sfx->truename = S_CopyString( buffer );
}
diff --git a/source/snd_mem.c b/source/snd_mem.c
index 3b81a08..a884f07 100644
--- a/source/snd_mem.c
+++ b/source/snd_mem.c
@@ -277,12 +277,10 @@ static qboolean GetWavinfo( void ) {
}
samples = iff_chunk_len / s_info.width;
-#if 0
if( !samples ) {
Com_DPrintf( "%s has zero length\n", s_info.name );
return qfalse;
}
-#endif
if( s_info.samples ) {
if( samples < s_info.samples ) {
@@ -319,6 +317,10 @@ sfxcache_t *S_LoadSound (sfx_t *s) {
if (sc)
return sc;
+// don't retry after error
+ if (s->error)
+ return NULL;
+
// load it in
if (s->truename)
name = s->truename;
@@ -364,9 +366,11 @@ sfxcache_t *S_LoadSound (sfx_t *s) {
fail2:
FS_FreeFile( data );
fail1:
- if( ret && ret != Q_ERR_NOENT ) {
+ // don't spam about missing or invalid sounds (action mod hack)
+ if( ret && ret != Q_ERR_NOENT && ret != Q_ERR_INVALID_FORMAT ) {
Com_EPrintf( "Couldn't load %s: %s\n", namebuffer, Q_ErrorString( ret ) );
}
+ s->error = ret;
return sc;
}