Пример #1
0
/*
* SF_RegisterSound
*/
sfx_t *SF_RegisterSound( const char *name )
{
	sfx_t *sfx;

	assert( name );

	sfx = S_FindBuffer( name );
	S_IssueLoadSfxCmd( s_cmdPipe, sfx->id );
	sfx->used = trap_Milliseconds();
	sfx->registration_sequence = s_registration_sequence;
	return sfx;
}
Пример #2
0
/*
* SF_RegisterSound
*/
sfx_t *SF_RegisterSound( const char *name )
{
	sfx_t *sfx;
	int sfxnum;

	assert( name );

	sfx = SF_FindName( name );
	if( sfx->registration_sequence != s_registration_sequence ) {
		sfx->registration_sequence = s_registration_sequence;

		// evenly balance the load between two threads during registration
		sfxnum = sfx - known_sfx;
		if( !s_registering || sfxnum & 1 ) {
			S_IssueLoadSfxCmd( s_cmdPipe, sfxnum );
		}
		else {
			S_LoadSound( sfx );
		}
	}
	return sfx;
}