Example #1
0
void Application::initializeInputSubsystem() {
	input = shared_ptr<SDLinput>(new SDLinput(genName(),
	                             this,
	                             joysticks));
	                             
	registerSubscriber(input.get());
}
Example #2
0
void Application::initializeSoundManager() {
	soundSystem = shared_ptr<SoundSystem>(new SoundSystem(genName(), this));
//	soundSystem->playMusic(FileName("data/music/RachelBerkowitz.mp3"));
	soundSystem->setMute(false);
	soundSystem->setSoundEffectVolume(0.7f);
	soundSystem->setMusicVolume(0.0f);
	registerSubscriber(soundSystem.get());
	TRACE("Sound system initialized");
}
Example #3
0
tuple<OBJECT_ID, ActorPtr> ActorSet::create()
{
	ActorFactory &factory = getActorFactory();
	const tuple<OBJECT_ID, ActorPtr> t = factory.create();
	const OBJECT_ID id = t.get<0>();
	const ActorPtr actor = t.get<1>();
	actors.insert(make_pair(id, actor)); // record it in this actor set
	registerSubscriber(actor);           // record it in the blackboard
	actor->setParentBlackBoard(this);
	return t;
}
Example #4
0
void Application::initializeGameWorld() {
	// Create the game world
	world = shared_ptr<World>(new World(genName(),
	                                    this,
	                                    renderer,
	                                    textureFactory,
	                                    &camera));
	                                    
	registerSubscriber(world.get());
	TRACE("Created the game world");
}
Example #5
0
void Application::initializeGameStateMachine() {
	initializeGameWorld();
	
	GameStateMachine *s = new GameStateMachine(genName(),
	  this,
	  g_FrameTimer,
	  kernel,
	  world);
	  
	gameStateMachine = shared_ptr<GameStateMachine>(s);
	registerSubscriber(gameStateMachine.get());
	
	TRACE("Game state machine initialized");
}
Example #6
0
void Application::initializeRenderer() {
	renderer = shared_ptr<Renderer>(new Renderer(genName(), this));
	registerSubscriber(renderer.get());
	TRACE("Renderer initialized");
}