[Opentnl-cvs] tnl/zap game.h,1.15,1.16 sfx.cpp,1.17,1.18
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-05-08 23:00:07
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3925/zap Modified Files: game.h sfx.cpp Log Message: bumped RC label for game string changed SFX code to better manage leaking buffers Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** game.h 8 May 2004 00:03:51 -0000 1.15 --- game.h 8 May 2004 22:59:58 -0000 1.16 *************** *** 213,217 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.0 rc 1" }; --- 213,217 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.2.0 rc 2" }; Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** sfx.cpp 8 May 2004 00:26:32 -0000 1.17 --- sfx.cpp 8 May 2004 22:59:58 -0000 1.18 *************** *** 185,189 **** { "ship_explode.wav", false, 1.0, false, 300, 1000 }, { "ship_heal.wav", false, 1.0, false, 300, 1000 }, ! { "ship_turbo.wav", false, 0.15, true, 150, 500 }, { "flag_capture.wav", true, 0.45f, false, 0, 0 }, { "flag_drop.wav", true, 0.45f, false, 0, 0 }, --- 185,189 ---- { "ship_explode.wav", false, 1.0, false, 300, 1000 }, { "ship_heal.wav", false, 1.0, false, 300, 1000 }, ! { "ship_turbo.wav", false, 0.15f, true, 150, 500 }, { "flag_capture.wav", true, 0.45f, false, 0, 0 }, { "flag_drop.wav", true, 0.45f, false, 0, 0 }, *************** *** 341,344 **** --- 341,347 ---- if(mSourceIndex != -1) { + if(!gVoiceFreeBuffers.size()) + return; + ALuint source = gSources[mSourceIndex]; ALuint buffer = gVoiceFreeBuffers.first(); *************** *** 359,362 **** --- 362,370 ---- mInitialBuffer->getBufferSize(), 8000); alSourceQueueBuffers(source, 1, &buffer); + + ALint state; + alGetSourcei(mSourceIndex, AL_SOURCE_STATE, &state); + if(state == AL_STOPPED) + alSourcePlay(mSourceIndex); } else *************** *** 372,375 **** --- 380,386 ---- if(mInitialBuffer.isValid()) { + if(!gVoiceFreeBuffers.size()) + return; + ALuint buffer = gVoiceFreeBuffers.first(); gVoiceFreeBuffers.pop_front(); *************** *** 533,536 **** --- 544,548 ---- { ALint state; + unqueueBuffers(i); alGetSourcei(gSources[i], AL_SOURCE_STATE, &state); gSourceActive[i] = state != AL_STOPPED && state != AL_INITIAL; *************** *** 539,543 **** { SFXHandle &s = gPlayList[i]; - unqueueBuffers(s->mSourceIndex); if(s->mSourceIndex != -1 && !gSourceActive[s->mSourceIndex]) --- 551,554 ---- |