* remove sound_CheckSample: only contained asserts, makes debugging difficult if you don't know where the assert really came from
* moved asserts to only two callees of sound_CheckSample git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1403 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
d42a6ba8a4
commit
092afb2a01
|
@ -50,11 +50,6 @@ static SDWORD g_iMaxSameSamples;
|
|||
static BOOL g_bSystemActive = FALSE;
|
||||
static AUDIO_CALLBACK g_pStopTrackCallback = NULL;
|
||||
|
||||
//*
|
||||
//
|
||||
// Function prototypes
|
||||
static void sound_CheckSample( AUDIO_SAMPLE *psSample );
|
||||
|
||||
//*
|
||||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
|
@ -215,16 +210,6 @@ SDWORD sound_GetNumPlaying( SDWORD iTrack )
|
|||
return g_apTrack[iTrack]->iNumPlaying;
|
||||
}
|
||||
|
||||
//*
|
||||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
static void sound_CheckSample( AUDIO_SAMPLE *psSample )
|
||||
{
|
||||
ASSERT( psSample != NULL, "sound_CheckSample: sample pointer invalid\n" );
|
||||
ASSERT( psSample->iSample != (ALuint)SAMPLE_NOT_ALLOCATED, "sound_CheckSample: sample %u out of range", psSample->iSample );
|
||||
}
|
||||
|
||||
//*
|
||||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
|
@ -337,11 +322,17 @@ BOOL sound_Play3DTrack( AUDIO_SAMPLE *psSample )
|
|||
//
|
||||
void sound_StopTrack( AUDIO_SAMPLE *psSample )
|
||||
{
|
||||
sound_CheckSample( psSample );
|
||||
ASSERT( psSample != NULL, "sound_StopTrack: sample pointer invalid\n" );
|
||||
ASSERT( psSample->iSample != (ALuint)SAMPLE_NOT_ALLOCATED, "sound_StopTrack: sample %u out of range", psSample->iSample );
|
||||
|
||||
if ( psSample->iSample != (ALuint)SAMPLE_NOT_ALLOCATED )
|
||||
{
|
||||
sound_StopSample( psSample->iSample );
|
||||
}
|
||||
else
|
||||
{
|
||||
debug( LOG_SOUND, "sound_StopTrack: sample %u out of range\n", psSample->iSample );
|
||||
}
|
||||
|
||||
// do stopped callback
|
||||
if ( g_pStopTrackCallback != NULL && psSample->psObj != NULL )
|
||||
|
@ -368,7 +359,9 @@ void sound_PauseTrack( AUDIO_SAMPLE *psSample )
|
|||
//
|
||||
void sound_FinishedCallback( AUDIO_SAMPLE *psSample )
|
||||
{
|
||||
sound_CheckSample( psSample );
|
||||
ASSERT( psSample != NULL, "sound_FinishedCallback: sample pointer invalid\n" );
|
||||
ASSERT( psSample->iSample != (ALuint)SAMPLE_NOT_ALLOCATED, "sound_FinishedCallback: sample %u out of range", psSample->iSample );
|
||||
|
||||
if ( g_apTrack[psSample->iTrack] != NULL )
|
||||
{
|
||||
g_apTrack[psSample->iTrack]->iTimeLastFinished = sound_GetGameTime();
|
||||
|
|
Loading…
Reference in New Issue