* 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-861f7616d084
master
Giel van Schijndel 2007-04-09 12:50:48 +00:00
parent d42a6ba8a4
commit 092afb2a01
1 changed files with 10 additions and 17 deletions

View File

@ -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();