void InvalidateBuffers( SNDOBJ *pSO ) { int j; for( j = 0; j < MAX_DUP_BUFFERS; j++ ) { if (pSO->Dup_3DBuffer[ j ]) { IDirectSound3DBuffer_Release(pSO->Dup_3DBuffer[ j ]); pSO->Dup_3DBuffer[ j ] = NULL; } if (pSO->Dup_Buffer[ j ]) { SoundBufferRelease(&pSO->Dup_Buffer[ j ]); pSO->Dup_Buffer[ j ] = NULL; } } }
void SndObjDestroy(SNDOBJ *pSO) { int i; if (pSO) { for (i = 0; i < MAX_DUP_BUFFERS; i++) { if (pSO->Dup_3DBuffer[i]) { IDirectSound3DBuffer_Release(pSO->Dup_3DBuffer[i]); pSO->Dup_3DBuffer[i] = NULL; } if (pSO->Dup_Buffer[i]) { SoundBufferRelease(&pSO->Dup_Buffer[i]); pSO->Dup_Buffer[i] = NULL; } } free(pSO); } }
void I2_KillSource(sndsource_t *src) { if(src->source3D) IDirectSound3DBuffer_Release(src->source3D); if(src->source) IDirectSoundBuffer_Release(src->source); memset(src, 0, sizeof(*src)); }