|
From: Seb <whi...@us...> - 2004-10-13 23:13:02
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3910 Modified Files: Makefile.OSX soundmanager.cc Log Message: Qq modif pour le soundmanager (entre autre pour le cvarmanager) Index: Makefile.OSX =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/Makefile.OSX,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.OSX 2 Oct 2004 22:45:46 -0000 1.5 --- Makefile.OSX 13 Oct 2004 23:12:52 -0000 1.6 *************** *** 6,10 **** OBJSRC = $(wildcard *.cc) OBJS = $(addsuffix .${OBJ_EXT}, $(basename $(OBJSRC))) ! CFLAGS = -DTGOSX -O3 -DDEBUG CC = g++ --- 6,10 ---- OBJSRC = $(wildcard *.cc) OBJS = $(addsuffix .${OBJ_EXT}, $(basename $(OBJSRC))) ! CFLAGS = -DTGOSX -O3 -DDEBUG -DSOUND_DEBUG CC = g++ Index: soundmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** soundmanager.cc 13 Oct 2004 19:05:42 -0000 1.3 --- soundmanager.cc 13 Oct 2004 23:12:52 -0000 1.4 *************** *** 98,102 **** { #ifdef SOUND_DEBUG ! cout << "OpenAL:: SetListenerPosition (" << x << "," << y << "," << z << ")" << endl; #endif --- 98,102 ---- { #ifdef SOUND_DEBUG ! //cout << "OpenAL:: SetListenerPosition (" << x << "," << y << "," << z << ")" << endl; #endif *************** *** 109,113 **** { #ifdef SOUND_DEBUG ! cout << "OpenAL:: SetListenerOrientation" << endl; #endif --- 109,113 ---- { #ifdef SOUND_DEBUG ! //cout << "OpenAL:: SetListenerOrientation" << endl; #endif *************** *** 502,513 **** // Sound properties (position and velocity) void SoundManager::SetSoundProperties(string name, float x, float y, float z, float vx, float vy, float vz) ! { ! #ifdef SOUND_DEBUG ! cout << "OpenAL:: SetSoundProperties: " << name << "(" << x << "," << y << "," << z << ")" << endl; ! #endif ! //set the sounds position and velocity if(CheckSound(name)) ! { alSource3f(SoundList[name],AL_POSITION,x/100,y/100,z/100); alSource3f(SoundList[name],AL_VELOCITY,vx,vy,vz); --- 502,513 ---- // Sound properties (position and velocity) void SoundManager::SetSoundProperties(string name, float x, float y, float z, float vx, float vy, float vz) ! { //set the sounds position and velocity if(CheckSound(name)) ! { ! #ifdef SOUND_DEBUG ! cout << "OpenAL:: SetSoundProperties: " << name << "(" << x << "," << y << "," << z << ")" << endl; ! #endif ! alSource3f(SoundList[name],AL_POSITION,x/100,y/100,z/100); alSource3f(SoundList[name],AL_VELOCITY,vx,vy,vz); *************** *** 517,528 **** // Sound volume void SoundManager::SetSoundVolume(string name, float x) ! { ! #ifdef SOUND_DEBUG ! cout << "OpenAL:: SetSoundVolume: " << name << "(" << x << ")" << endl; ! #endif ! //set the sounds volume if(CheckSound(name)) alSourcef (SoundList[name], AL_GAIN,x); } --- 517,530 ---- // Sound volume void SoundManager::SetSoundVolume(string name, float x) ! { //set the sounds volume if(CheckSound(name)) + { + #ifdef SOUND_DEBUG + cout << "OpenAL:: SetSoundVolume: " << name << "(" << x << ")" << endl; + #endif + alSourcef (SoundList[name], AL_GAIN,x); + } } *************** *** 530,550 **** void SoundManager::PlaySound(string name) { - #ifdef SOUND_DEBUG - cout << "OpenAL:: PlaySound: " << name << endl; - #endif - if(CheckSound(name)) alSourcePlay(SoundList[name]); } // Stop a sound void SoundManager::StopSound(string name) ! { ! #ifdef SOUND_DEBUG ! cout << "OpenAL:: StopSound: " << name << endl; ! #endif ! if(CheckSound(name)) alSourceStop(SoundList[name]); } --- 532,556 ---- void SoundManager::PlaySound(string name) { if(CheckSound(name)) + { + #ifdef SOUND_DEBUG + cout << "OpenAL:: PlaySound: " << name << endl; + #endif + alSourcePlay(SoundList[name]); + } } // Stop a sound void SoundManager::StopSound(string name) ! { if(CheckSound(name)) + { + #ifdef SOUND_DEBUG + cout << "OpenAL:: StopSound: " << name << endl; + #endif + alSourceStop(SoundList[name]); + } } *************** *** 553,563 **** { ALint state; - - #ifdef SOUND_DEBUG - cout << "OpenAL:: SoundStatus: " << name << endl; - #endif if(CheckSound(name)) { alGetSourcei(SoundList[name], AL_SOURCE_STATE, &state); --- 559,569 ---- { ALint state; if(CheckSound(name)) { + #ifdef SOUND_DEBUG + cout << "OpenAL:: SoundStatus: " << name << endl; + #endif + alGetSourcei(SoundList[name], AL_SOURCE_STATE, &state); |