mirror of
https://github.com/id-Software/Wolf3D-iOS.git
synced 2026-03-20 00:49:35 +01:00
Source release of Wolfenstein 3D Classic Platinum for iOS, 1.2
This commit is contained in:
36
wolf3d/code/env/sound_sfx_id.c
vendored
36
wolf3d/code/env/sound_sfx_id.c
vendored
@@ -248,33 +248,57 @@ PUBLIC void Sound_BeginRegistration( void )
|
||||
s_registering = true;
|
||||
}
|
||||
|
||||
|
||||
PUBLIC sfx_t *Sound_RegisterSound( const char *name )
|
||||
{
|
||||
sfx_t *sfx;
|
||||
bool isSpearSound = false;
|
||||
|
||||
if( ! sound_initialized )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if( g_version->value == 1 )
|
||||
|
||||
if( g_version->value == SPEAROFDESTINY && currentMap.episode >= 6 && strncmp(name, "iphone", 6) && currentMap.episode < 9)//added the episode & iphone check... gsh
|
||||
{
|
||||
isSpearSound = true;
|
||||
|
||||
char tempname[ 256 ];
|
||||
|
||||
my_snprintf( tempname, sizeof( tempname ), "sod%s", name );
|
||||
|
||||
sfx = Sound_FindSound( tempname );
|
||||
|
||||
//gsh
|
||||
//Com_Printf("Finding Sound: %s\n", tempname);
|
||||
}
|
||||
else
|
||||
{
|
||||
sfx = Sound_FindSound( name );
|
||||
|
||||
//gsh
|
||||
//Com_Printf("Finding Sound: %s\n", name);
|
||||
}
|
||||
|
||||
/*
|
||||
//original
|
||||
if( ! s_registering )
|
||||
{
|
||||
Sound_LoadSound( sfx );
|
||||
}
|
||||
|
||||
*/
|
||||
//gsh
|
||||
if( ! s_registering )
|
||||
{
|
||||
//if it couldn't be found and we tried finding it in sod
|
||||
//then it might exist in wolf3d
|
||||
if( !Sound_LoadSound( sfx ) && isSpearSound)
|
||||
{
|
||||
sfx = Sound_FindSound( name );
|
||||
//Com_Printf("Finding Sound Again: %s\n", name);
|
||||
|
||||
if( ! s_registering )
|
||||
Sound_LoadSound( sfx ); //try loading again
|
||||
}
|
||||
}
|
||||
|
||||
return sfx;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user