OpenAl Werkt! en Setup enzo

This commit is contained in:
Aaldert
2016-06-05 23:49:06 +02:00
parent 47b4d9570d
commit 117010b9fe
18 changed files with 320 additions and 237 deletions
+11 -1
View File
@@ -7,7 +7,8 @@
#include <fstream>
#include <iostream>
World::World(const std::string &fileName)
World::World(const std::string &fileName):
music_id(-1)
{
//Store player instance
player = Player::getInstance();
@@ -113,6 +114,15 @@ World::World(const std::string &fileName)
enemies.push_back(new Enemy(e["file"].asString(), position, rotation, scale));
}
if (!v["world"]["music"].isNull())
{
music_id = CrystalPoint::GetSoundSystem().LoadSound(v["world"]["music"].asString().c_str(), true);
Sound* music = CrystalPoint::GetSoundSystem().GetSound(music_id);
music->SetPos(Vec3f(), Vec3f());
music->Play();
}
}