|
From: Seb <whi...@us...> - 2004-11-22 18:07:05
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13105 Modified Files: soundmanager.cc soundmanager.h Log Message: Remplace le facteur de mise a l'echelle par un define (plus pratique pour tester differentes echelles) Index: soundmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** soundmanager.cc 20 Nov 2004 16:08:26 -0000 1.19 --- soundmanager.cc 22 Nov 2004 18:06:41 -0000 1.20 *************** *** 98,101 **** --- 98,102 ---- #endif + // Bool to enable the soundmanager enable = true; } *************** *** 105,113 **** { #ifdef SOUND_DEBUG ! //cout << "[OpenAL] SetListenerPosition (" << x << "," << y << "," << z << ")" << endl; #endif //set the position using 3 seperate floats ! alListener3f(AL_POSITION, x/100,y/100,z/100); } --- 106,114 ---- { #ifdef SOUND_DEBUG ! //cout << "[OpenAL] SetListenerPosition (" << x/FACT << "," << y/FACT << "," << z/FACT << ")" << endl; #endif //set the position using 3 seperate floats ! alListener3f(AL_POSITION, x/FACT,y/FACT,z/FACT); } *************** *** 498,505 **** { #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); } --- 499,506 ---- { #ifdef SOUND_DEBUG ! cout << "[OpenAL] SetSoundProperties: " << name << "(" << x/FACT << "," << y/FACT << "," << z/FACT << ")" << endl; #endif ! alSource3f(SoundList[name],AL_POSITION,x/FACT,y/FACT,z/FACT); alSource3f(SoundList[name],AL_VELOCITY,vx,vy,vz); } *************** *** 650,653 **** --- 651,655 ---- } + // To avoid seg fault, return a undefined SoundNode return (new SoundNode("undefined")); } Index: soundmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** soundmanager.h 20 Nov 2004 16:08:27 -0000 1.10 --- soundmanager.h 22 Nov 2004 18:06:41 -0000 1.11 *************** *** 26,29 **** --- 26,30 ---- #define BUFFER_SIZE 32768 // 32 KB buffers + #define FACT 100 // Divide each coordinate by FACT using std::string; *************** *** 70,73 **** --- 71,77 ---- void DisableSoundManager(); + void ParseSoundFile (char* filename); // Parse a file to load sounds + + // To enable/disable the soundmanager by registering two function to the console enum { *************** *** 91,97 **** void Init(); ! ! static int MainLoop(void* arg); ! string GetALErrorString(ALenum err); string GetALCErrorString(ALenum err); --- 95,99 ---- void Init(); ! string GetALErrorString(ALenum err); string GetALCErrorString(ALenum err); *************** *** 107,112 **** void LoadOGG(char *fileName, vector<char> &buffer, ALenum &format, ALsizei &freq); - void ParseSoundFile (char* filename); - vector<string> LoadedFiles; // Holds loaded file paths temporarily. vector<ALuint> Buffers; // Holds all loaded buffers. --- 109,112 ---- |