Merge branch 'developer' into feature/Menu

This commit is contained in:
2016-06-20 20:39:00 +02:00
24 changed files with 87 additions and 43 deletions
+9 -4
View File
@@ -3,7 +3,6 @@
#include "Entity.h"
#include "json.h"
#include "Model.h"
#include "CrystalPoint.h"
#include <fstream>
#include <iostream>
#include <algorithm>
@@ -179,9 +178,7 @@ World::World(const std::string &fileName):
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();
music = CrystalPoint::GetSoundSystem().GetSound(music_id);
}
if (!v["portal"].isNull())
@@ -214,6 +211,8 @@ World::World(const std::string &fileName):
World::~World()
{
delete heightmap;
music->Stop();
delete music;
delete skybox;
delete portal;
}
@@ -258,6 +257,12 @@ void World::draw()
void World::update(float elapsedTime)
{
music->SetPos(player->position, Vec3f());
if (music->IsPlaying() == false)
{
music->Play();
}
for (auto &entity : entities)
entity->update(elapsedTime);