From ffc26bfe308faa7255e6ab36cc355f6b329214b0 Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 18 Sep 2008 21:20:04 +0000 Subject: [PATCH] stop() and velocity(0) in source reset git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2700 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/sound.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 27ebf865..738d61c9 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -86,13 +86,17 @@ struct source priority = SP_NORMAL; // restore default settings - rewind(); + + stop(); buffer(NULL); - gain(1.0f); + pitch(1.0f); - position(0.0, 0.0, 0.0); - sourcerelative(false); + gain(1.0f); + position(0.0f, 0.0f, 0.0f); + velocity(0.0f, 0.0f, 0.0f); + looping(false); + sourcerelative(false); // fit into distance model alSourcef(id, AL_REFERENCE_DISTANCE, al_referencedistance/100.0f); @@ -194,6 +198,13 @@ struct source return !alerr(); } + bool velocity(float x, float y, float z) + { + alclearerr(); + alSource3f(id, AL_VELOCITY, x, y, z); + return !alerr(); + } + vec position() { alclearerr();