Update of /cvsroot/epfl/tggame
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21578
Modified Files:
game.cc
Log Message:
Sound manager
Index: game.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/game.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** game.cc 10 Oct 2004 21:18:41 -0000 1.9
--- game.cc 13 Oct 2004 18:39:09 -0000 1.10
***************
*** 9,18 ****
pEngine = new Engine (pTimer);
! if (pEngine->pEndian->bLittle == true)
! pSoundManager = new SoundManager(true);
! else
! pSoundManager = new SoundManager(false);
Engine::pEngine = pEngine;
pSceneManager = new SceneManager (pTimer);
pPhysicEngine = new PhysicEngine ();
--- 9,19 ----
pEngine = new Engine (pTimer);
! //On cree un nouveau soundmanager
! pSoundManager = new SoundManager();
Engine::pEngine = pEngine;
+
+ SoundManager::pSoundManager = pSoundManager;
+
pSceneManager = new SceneManager (pTimer);
pPhysicEngine = new PhysicEngine ();
***************
*** 36,51 ****
_CreatePlayers ();
! //pSoundManager->AddWAV("bubbles",false,true);
! //pSoundManager->AddOGG("Music",true,true);
! /*Vector3 soundtestpos = pWorld->GetPointLightPos(9);
! //pSoundManager->SetSoundProperties("fire",soundtestpos.x,soundtestpos.y,soundtestpos.z,0.0,0.0,0.0);
! pSoundManager->SetSoundProperties("bubbles",0,70,0,0,0,0);
pSoundManager->SetSoundVolume("Music",0.5);
! pSoundManager->PlaySound("bubbles");
! pSoundManager->PlaySound("Music");*/
}
--- 37,69 ----
_CreatePlayers ();
! /*
! //On ajoute les sons que l'on veut. On fixe "Music" relatif au Listener.
! //FIXME: Chargement d'une musique d'ambiance au format ogg prend plus de temps qu'avec le format wav...
! pSoundManager->AddWAV("fire",false,true);
! pSoundManager->AddWAV("thunder",false,true);
! pSoundManager->AddWAV("Music",true,true);
! pSoundManager->AddWAV("step",true,true);
! pSoundManager->AddWAV("gun",true,false);
!
! //On prend les coordonnees de la tete de mort avec la lumiere rose
! Vector3 soundtestpos = pWorld->GetPointLightPos(5);
+ //On ajoute le son de feu a cette position
+ pSoundManager->SetSoundProperties("fire",soundtestpos.x,soundtestpos.y,soundtestpos.z,0.0,0.0,0.0);
+
+ //On ajoute le son wind a la position 0,70,0
+ pSoundManager->SetSoundProperties("thunder",0,70,0,0,0,0);
+
+ //On baisse le volume de la musique d'ambiance
pSoundManager->SetSoundVolume("Music",0.5);
! //On joue les sons
! pSoundManager->PlaySound("fire");
! pSoundManager->PlaySound("thunder");
! pSoundManager->PlaySound("Music");
!
! */
}
***************
*** 107,111 ****
void Game::PreFrame ()
{
! /* Camera* myCam = pSceneManager->GetCamera();
Vector3 position = myCam->GetPosition();
--- 125,131 ----
void Game::PreFrame ()
{
! /*
!
! Camera* myCam = pSceneManager->GetCamera();
Vector3 position = myCam->GetPosition();
***************
*** 115,119 ****
pSoundManager->SetListenerPosition(position.x,position.y,position.z);
! pSoundManager->SetListenerOrientation(forward.x,forward.y,forward.z,up.x,up.y,up.z);*/
float t = pTimer->GetFrameInterval ();
for (unsigned int i=0; i<vControllers.size(); i++)
--- 135,142 ----
pSoundManager->SetListenerPosition(position.x,position.y,position.z);
! pSoundManager->SetListenerOrientation(forward.x,forward.y,forward.z,up.x,up.y,up.z);
!
! */
!
float t = pTimer->GetFrameInterval ();
for (unsigned int i=0; i<vControllers.size(); i++)
|