Update of /cvsroot/epfl/tggame
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15083
Modified Files:
Makefile.OSX game.cc game.h
Log Message:
SoundManager ajoute
Index: game.cc
===================================================================
RCS file: /cvsroot/epfl/tggame/game.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** game.cc 30 Sep 2004 10:31:42 -0000 1.5
--- game.cc 2 Oct 2004 22:47:06 -0000 1.6
***************
*** 8,11 ****
--- 8,17 ----
pTimer = new Timer ();
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);
***************
*** 29,32 ****
--- 35,51 ----
pWorld->Add(pSceneManager);
_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");
}
***************
*** 80,83 ****
--- 99,112 ----
void Game::PreFrame ()
{
+ Camera* myCam = pSceneManager->GetCamera();
+
+ Vector3 position = myCam->GetPosition();
+
+ Vector3 forward = myCam->GetForward();
+ Vector3 up = myCam->GetUp();
+
+ 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++)
Index: game.h
===================================================================
RCS file: /cvsroot/epfl/tggame/game.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** game.h 26 Sep 2004 14:44:55 -0000 1.3
--- game.h 2 Oct 2004 22:47:06 -0000 1.4
***************
*** 14,17 ****
--- 14,19 ----
#include "world.h"
+ #include "SoundManager.h"
+
using namespace tg;
***************
*** 64,67 ****
--- 66,72 ----
Timer* pTimer;
SceneManager* pSceneManager;
+
+ SoundManager* pSoundManager;
+
//le controller qui recevra les événements locaux (clavier + souris)
Controller* pLocalController;
Index: Makefile.OSX
===================================================================
RCS file: /cvsroot/epfl/tggame/Makefile.OSX,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile.OSX 27 Sep 2004 22:13:27 -0000 1.3
--- Makefile.OSX 2 Oct 2004 22:47:06 -0000 1.4
***************
*** 3,7 ****
INCLUDEPATH = -I/sw/include/SDL -I./ -I../tgengine-0.1
LINKPATH = -L../tgengine-0.1/out
! LIBS = `sdl-config --libs` -ltgengine -ljpeg -lm -lSDL_image
OBJ_EXT = o
OBJSRC = $(wildcard *.cc)
--- 3,7 ----
INCLUDEPATH = -I/sw/include/SDL -I./ -I../tgengine-0.1
LINKPATH = -L../tgengine-0.1/out
! LIBS = `sdl-config --libs` -framework OpenAL -lSDL_image -ltgengine -ljpeg -lm
OBJ_EXT = o
OBJSRC = $(wildcard *.cc)
|