Merge branch 'master' of github.com:sippeangelo/Escape-the-Dawn
Conflicts: Escape-the-Dawn/Escape-the-Dawn.vcxproj
This commit is contained in:
@@ -10,7 +10,6 @@ namespace Components
|
|||||||
|
|
||||||
struct SoundEmitter : Component
|
struct SoundEmitter : Component
|
||||||
{
|
{
|
||||||
std::string SoundFile;
|
|
||||||
float Volume;
|
float Volume;
|
||||||
float MaxRange;
|
float MaxRange;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,14 +40,14 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LibraryPath>$(SolutionDir)\Libraries\SOIL\lib\Debug;$(SolutionDir)\Libraries\glew-1.10.0\lib\Debug\Win32;$(SolutionDir)\Libraries\glfw-3.0.4\lib\Debug;$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\lib\Win32;$(SolutionDir)\Libraries\SOIL\lib\Debug;$(SolutionDir)\Libraries\glew-1.10.0\lib\Debug\Win32;$(SolutionDir)\Libraries\glfw-3.0.4\lib\Debug;$(LibraryPath)</LibraryPath>
|
||||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
||||||
<TargetName>$(ProjectName)-$(Configuration)</TargetName>
|
<TargetName>$(ProjectName)-$(Configuration)</TargetName>
|
||||||
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LibraryPath>$(SolutionDir)\Libraries\SOIL\lib\Release;$(SolutionDir)\Libraries\glew-1.10.0\lib\Release\Win32;$(SolutionDir)\Libraries\glfw-3.0.4\lib\Release;$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(SolutionDir)\Libraries\SOIL\lib\Release;$(SolutionDir)\Libraries\glew-1.10.0\lib\Release\Win32;$(SolutionDir)\Libraries\glfw-3.0.4\lib\Release;$(LibraryPath)</LibraryPath>
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#ifndef SoundEmitter_h__
|
||||||
|
#define SoundEmitter_h__
|
||||||
|
|
||||||
|
#include "AL/al.h"
|
||||||
|
#include "AL/alc.h"
|
||||||
|
|
||||||
|
#include "System.h"
|
||||||
|
#include "Components/SoundEmitter.h"
|
||||||
|
|
||||||
|
namespace Systems
|
||||||
|
{
|
||||||
|
|
||||||
|
class SoundSystem : public System
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SoundSystem(World* world);
|
||||||
|
|
||||||
|
void Update(double dt) override;
|
||||||
|
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||||
|
void OnComponentCreated(std::string type, std::shared_ptr<Component> component) override;
|
||||||
|
void PlaySound(std::shared_ptr<Components::SoundEmitter> emitter, std::string fileName);
|
||||||
|
void LoadFile(std::string fileName);
|
||||||
|
private:
|
||||||
|
ALCcontext* context;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // !SoundEmitter_h__
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#include "SoundSystem.h"
|
||||||
|
#include "World.h"
|
||||||
|
#include <AL/al.h>
|
||||||
|
#include <AL/alc.h>
|
||||||
|
|
||||||
|
Systems::SoundSystem::SoundSystem(World* world)
|
||||||
|
: System(world)
|
||||||
|
{
|
||||||
|
ALCdevice* Device = alcOpenDevice(nullptr);
|
||||||
|
|
||||||
|
if(Device)
|
||||||
|
{
|
||||||
|
context = alcCreateContext(Device, nullptr);
|
||||||
|
alcMakeContextCurrent(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Systems::SoundSystem::Update(double dt)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||||
|
{
|
||||||
|
auto soundEmitter = m_World->GetComponent<Components::SoundEmitter>(entity, "SoundEmitter");
|
||||||
|
if(soundEmitter == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Systems::SoundSystem::PlaySound(std::shared_ptr<Components::SoundEmitter> emitter, std::string fileName)
|
||||||
|
{
|
||||||
|
LoadFile(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Systems::SoundSystem::LoadFile(std::string fileName)
|
||||||
|
{
|
||||||
|
//loadWavFile()
|
||||||
|
}
|
||||||
@@ -39,13 +39,13 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\SOIL\src;\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||||
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\SOIL\src;\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||||
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
||||||
|
|||||||
+4
-4
@@ -39,13 +39,13 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Escape-the-Dawn;$(SolutionDir)\Libraries\SOIL\src;\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath)</LibraryPath>
|
||||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<IncludePath>$(BOOST_ROOT);$(SolutionDir)\Escape-the-Dawn;$(SolutionDir)\Libraries\SOIL\src;\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Escape-the-Dawn;$(BOOST_ROOT);$(SolutionDir)\Libraries\openal-soft-1.15.1-bin\include;$(SolutionDir)\Libraries\SOIL\src;$(ProjectDir);$(SolutionDir)\Libraries;$(SolutionDir)\Libraries\glew-1.10.0\include;$(SolutionDir)\Libraries\glfw-3.0.4\include;$(SolutionDir)\Libraries\glm-0.9.5.2;$(IncludePath)</IncludePath>
|
||||||
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath)</LibraryPath>
|
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(LibraryPath)</LibraryPath>
|
||||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<PostBuildEvent />
|
<PostBuildEvent />
|
||||||
<PreBuildEvent />
|
<PreBuildEvent />
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>$(OutDir)$(TargetName)$(TargetExt) --log_level=test_suite</Command>
|
<Command>"$(OutDir)$(TargetName)$(TargetExt)" --log_level=test_suite</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Message>Running tests</Message>
|
<Message>Running tests</Message>
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
</Link>
|
</Link>
|
||||||
<PreBuildEvent />
|
<PreBuildEvent />
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>$(OutDir)$(TargetName)$(TargetExt) --log_level=test_suite</Command>
|
<Command>"$(OutDir)$(TargetName)$(TargetExt)" --log_level=test_suite</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Message>Running tests</Message>
|
<Message>Running tests</Message>
|
||||||
|
|||||||
Reference in New Issue
Block a user