No moar rebuild pls.
This commit is contained in:
@@ -3,13 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio 2012
|
# Visual Studio 2012
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Escape-the-Dawn", "Escape-the-Dawn\Escape-the-Dawn.vcxproj", "{FE405CFA-8FCE-4867-92CF-797E73B36482}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Escape-the-Dawn", "Escape-the-Dawn\Escape-the-Dawn.vcxproj", "{FE405CFA-8FCE-4867-92CF-797E73B36482}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests", "Tests\Tests.vcxproj", "{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}"
|
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{A9755CAA-62DC-442D-B82C-F548546CFD38} = {A9755CAA-62DC-442D-B82C-F548546CFD38}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Executable", "Executable\Executable.vcxproj", "{A9755CAA-62DC-442D-B82C-F548546CFD38}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
@@ -20,14 +13,6 @@ Global
|
|||||||
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Debug|Win32.Build.0 = Debug|Win32
|
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Release|Win32.ActiveCfg = Release|Win32
|
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Release|Win32.Build.0 = Release|Win32
|
{FE405CFA-8FCE-4867-92CF-797E73B36482}.Release|Win32.Build.0 = Release|Win32
|
||||||
{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
{A9755CAA-62DC-442D-B82C-F548546CFD38}.Debug|Win32.ActiveCfg = Debug|Win32
|
|
||||||
{A9755CAA-62DC-442D-B82C-F548546CFD38}.Debug|Win32.Build.0 = Debug|Win32
|
|
||||||
{A9755CAA-62DC-442D-B82C-F548546CFD38}.Release|Win32.ActiveCfg = Release|Win32
|
|
||||||
{A9755CAA-62DC-442D-B82C-F548546CFD38}.Release|Win32.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<AdditionalDependencies>opengl32.lib;glu32.lib;glew32sd.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>OpenAL32.lib;opengl32.lib;glu32.lib;SOIL.lib;glew32sd.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent />
|
<PostBuildEvent />
|
||||||
<PostBuildEvent />
|
<PostBuildEvent />
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>opengl32.lib;glu32.lib;glew32s.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>OpenAL32.lib;opengl32.lib;glu32.lib;SOIL.lib;glew32s.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Lib>
|
<Lib>
|
||||||
<AdditionalDependencies>OpenAL32.lib;opengl32.lib;glu32.lib;SOIL.lib;glew32s.lib;glfw3.lib;</AdditionalDependencies>
|
<AdditionalDependencies>OpenAL32.lib;opengl32.lib;glu32.lib;SOIL.lib;glew32s.lib;glfw3.lib;</AdditionalDependencies>
|
||||||
@@ -101,7 +101,9 @@
|
|||||||
<ClCompile Include="Engine.h" />
|
<ClCompile Include="Engine.h" />
|
||||||
<ClCompile Include="Frame.cpp" />
|
<ClCompile Include="Frame.cpp" />
|
||||||
<ClCompile Include="GameFrame.cpp" />
|
<ClCompile Include="GameFrame.cpp" />
|
||||||
|
<ClCompile Include="GameWorld.cpp" />
|
||||||
<ClCompile Include="GUIManager.cpp" />
|
<ClCompile Include="GUIManager.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
<ClCompile Include="MenuFrame.cpp" />
|
<ClCompile Include="MenuFrame.cpp" />
|
||||||
<ClCompile Include="Model.cpp" />
|
<ClCompile Include="Model.cpp" />
|
||||||
<ClCompile Include="OBJ.cpp" />
|
<ClCompile Include="OBJ.cpp" />
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="Camera.cpp" />
|
<ClCompile Include="Camera.cpp" />
|
||||||
<ClCompile Include="OBJ.cpp" />
|
<ClCompile Include="OBJ.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
<ClCompile Include="GameWorld.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Component.h" />
|
<ClInclude Include="Component.h" />
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
#include "GameWorld.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void GameWorld::Update(double dt)
|
||||||
|
{
|
||||||
|
World::Update(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameWorld::RegisterComponents()
|
||||||
|
{
|
||||||
|
m_ComponentFactory.Register("Bounds", []() { return new Components::Bounds(); });
|
||||||
|
m_ComponentFactory.Register("Camera", []() { return new Components::Camera(); });
|
||||||
|
m_ComponentFactory.Register("Collision", []() { return new Components::Collision(); });
|
||||||
|
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
|
||||||
|
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
|
||||||
|
m_ComponentFactory.Register("Model", []() { return new Components::Model(); });
|
||||||
|
m_ComponentFactory.Register("ParticleEmitter", []() { return new Components::ParticleEmitter(); });
|
||||||
|
m_ComponentFactory.Register("PointLight", []() { return new Components::PointLight(); });
|
||||||
|
m_ComponentFactory.Register("PowerUp", []() { return new Components::PowerUp(); });
|
||||||
|
m_ComponentFactory.Register("SoundEmitter", []() { return new Components::SoundEmitter(); });
|
||||||
|
m_ComponentFactory.Register("Sprite", []() { return new Components::Sprite(); });
|
||||||
|
m_ComponentFactory.Register("Stat", []() { return new Components::Stat(); });
|
||||||
|
m_ComponentFactory.Register("Template", []() { return new Components::Template(); });
|
||||||
|
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameWorld::RegisterSystems()
|
||||||
|
{
|
||||||
|
//m_SystemFactory.Register("LevelGenerationSystem", [this]() { return new Systems::LevelGenerationSystem(this); });
|
||||||
|
m_SystemFactory.Register("InputSystem", [this]() { return new Systems::InputSystem(this, m_Renderer); });
|
||||||
|
//m_SystemFactory.Register("CollisionSystem", [this]() { return new Systems::CollisionSystem(this); });
|
||||||
|
//m_SystemFactory.Register("ParticleSystem", [this]() { return new Systems::ParticleSystem(this); });
|
||||||
|
m_SystemFactory.Register("PlayerSystem", [this]() { return new Systems::PlayerSystem(this); });
|
||||||
|
m_SystemFactory.Register("SoundSystem", [this]() { return new Systems::SoundSystem(this); });
|
||||||
|
m_SystemFactory.Register("RenderSystem", [this]() { return new Systems::RenderSystem(this, m_Renderer); });
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameWorld::Initialize()
|
||||||
|
{
|
||||||
|
World::Initialize();
|
||||||
|
|
||||||
|
//AddSystem("LevelGenerationSystem");
|
||||||
|
AddSystem("InputSystem");
|
||||||
|
//AddSystem("CollisionSystem");
|
||||||
|
//AddSystem("ParticleSystem");
|
||||||
|
AddSystem("PlayerSystem");
|
||||||
|
AddSystem("SoundSystem");
|
||||||
|
AddSystem("RenderSystem");
|
||||||
|
|
||||||
|
std::shared_ptr<Components::Transform> transform;
|
||||||
|
std::shared_ptr<Components::Model> model;
|
||||||
|
std::shared_ptr<Components::Camera> camera;
|
||||||
|
EntityID ent;
|
||||||
|
|
||||||
|
ent = CreateEntity();
|
||||||
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
|
transform->Position = glm::vec3(0.f, 0.f, 0.f);
|
||||||
|
model = AddComponent<Components::Model>(ent, "Model");
|
||||||
|
model->ModelFile = "ship.obj";
|
||||||
|
auto soundEmitter = AddComponent<Components::SoundEmitter>(ent, "SoundEmitter");
|
||||||
|
soundEmitter->Gain = 1;
|
||||||
|
soundEmitter->MaxDistance = FLT_MAX;
|
||||||
|
soundEmitter->ReferenceDistance = 10;
|
||||||
|
soundEmitter->Loop = true;
|
||||||
|
|
||||||
|
soundEmitter->Pitch = 1;
|
||||||
|
GetSystem<Systems::SoundSystem>("SoundSystem")->PlaySound(soundEmitter, "Sounds/hallelujah.wav");
|
||||||
|
|
||||||
|
|
||||||
|
ent = CreateEntity();
|
||||||
|
SetProperty(ent, "Name", std::string("Camera"));
|
||||||
|
transform = AddComponent<Components::Transform>(ent, "Transform");
|
||||||
|
AddComponent<Components::Input>(ent, "Input");
|
||||||
|
transform->Position = glm::vec3(0.f, 2.f, 10.f);
|
||||||
|
camera = AddComponent<Components::Camera>(ent, "Camera");
|
||||||
|
camera->FOV = 45.f;
|
||||||
|
camera->FarClip = 1000.f;
|
||||||
|
camera->NearClip = 0.01f;
|
||||||
|
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
|
||||||
|
}
|
||||||
|
|
||||||
|
GameWorld::GameWorld(std::shared_ptr<Renderer> renderer) : m_Renderer(renderer), World()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,88 +42,4 @@ private:
|
|||||||
std::shared_ptr<Renderer> m_Renderer;
|
std::shared_ptr<Renderer> m_Renderer;
|
||||||
};
|
};
|
||||||
|
|
||||||
GameWorld::GameWorld(std::shared_ptr<Renderer> renderer)
|
|
||||||
: m_Renderer(renderer), World()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameWorld::Initialize()
|
|
||||||
{
|
|
||||||
World::Initialize();
|
|
||||||
|
|
||||||
//AddSystem("LevelGenerationSystem");
|
|
||||||
AddSystem("InputSystem");
|
|
||||||
//AddSystem("CollisionSystem");
|
|
||||||
//AddSystem("ParticleSystem");
|
|
||||||
AddSystem("PlayerSystem");
|
|
||||||
AddSystem("SoundSystem");
|
|
||||||
AddSystem("RenderSystem");
|
|
||||||
|
|
||||||
std::shared_ptr<Components::Transform> transform;
|
|
||||||
std::shared_ptr<Components::Model> model;
|
|
||||||
std::shared_ptr<Components::Camera> camera;
|
|
||||||
EntityID ent;
|
|
||||||
|
|
||||||
ent = CreateEntity();
|
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
|
||||||
transform->Position = glm::vec3(0.f, 0.f, 0.f);
|
|
||||||
model = AddComponent<Components::Model>(ent, "Model");
|
|
||||||
model->ModelFile = "ship.obj";
|
|
||||||
auto soundEmitter = AddComponent<Components::SoundEmitter>(ent, "SoundEmitter");
|
|
||||||
soundEmitter->Gain = 1;
|
|
||||||
soundEmitter->MaxDistance = FLT_MAX;
|
|
||||||
soundEmitter->ReferenceDistance = 10;
|
|
||||||
soundEmitter->Loop = true;
|
|
||||||
|
|
||||||
soundEmitter->Pitch = 1;
|
|
||||||
GetSystem<Systems::SoundSystem>("SoundSystem")->PlaySound(soundEmitter, "Sounds/hallelujah.wav");
|
|
||||||
|
|
||||||
|
|
||||||
ent = CreateEntity();
|
|
||||||
SetProperty(ent, "Name", std::string("Camera"));
|
|
||||||
transform = AddComponent<Components::Transform>(ent, "Transform");
|
|
||||||
AddComponent<Components::Input>(ent, "Input");
|
|
||||||
transform->Position = glm::vec3(0.f, 2.f, 10.f);
|
|
||||||
camera = AddComponent<Components::Camera>(ent, "Camera");
|
|
||||||
camera->FOV = 45.f;
|
|
||||||
camera->FarClip = 1000.f;
|
|
||||||
camera->NearClip = 0.01f;
|
|
||||||
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameWorld::RegisterSystems()
|
|
||||||
{
|
|
||||||
//m_SystemFactory.Register("LevelGenerationSystem", [this]() { return new Systems::LevelGenerationSystem(this); });
|
|
||||||
m_SystemFactory.Register("InputSystem", [this]() { return new Systems::InputSystem(this, m_Renderer); });
|
|
||||||
//m_SystemFactory.Register("CollisionSystem", [this]() { return new Systems::CollisionSystem(this); });
|
|
||||||
//m_SystemFactory.Register("ParticleSystem", [this]() { return new Systems::ParticleSystem(this); });
|
|
||||||
m_SystemFactory.Register("PlayerSystem", [this]() { return new Systems::PlayerSystem(this); });
|
|
||||||
m_SystemFactory.Register("SoundSystem", [this]() { return new Systems::SoundSystem(this); });
|
|
||||||
m_SystemFactory.Register("RenderSystem", [this]() { return new Systems::RenderSystem(this, m_Renderer); });
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameWorld::RegisterComponents()
|
|
||||||
{
|
|
||||||
m_ComponentFactory.Register("Bounds", []() { return new Components::Bounds(); });
|
|
||||||
m_ComponentFactory.Register("Camera", []() { return new Components::Camera(); });
|
|
||||||
m_ComponentFactory.Register("Collision", []() { return new Components::Collision(); });
|
|
||||||
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
|
|
||||||
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
|
|
||||||
m_ComponentFactory.Register("Model", []() { return new Components::Model(); });
|
|
||||||
m_ComponentFactory.Register("ParticleEmitter", []() { return new Components::ParticleEmitter(); });
|
|
||||||
m_ComponentFactory.Register("PointLight", []() { return new Components::PointLight(); });
|
|
||||||
m_ComponentFactory.Register("PowerUp", []() { return new Components::PowerUp(); });
|
|
||||||
m_ComponentFactory.Register("SoundEmitter", []() { return new Components::SoundEmitter(); });
|
|
||||||
m_ComponentFactory.Register("Sprite", []() { return new Components::Sprite(); });
|
|
||||||
m_ComponentFactory.Register("Stat", []() { return new Components::Stat(); });
|
|
||||||
m_ComponentFactory.Register("Template", []() { return new Components::Template(); });
|
|
||||||
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
|
|
||||||
}
|
|
||||||
|
|
||||||
void GameWorld::Update(double dt)
|
|
||||||
{
|
|
||||||
World::Update(dt);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // GameWorld_h__
|
#endif // GameWorld_h__
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{A9755CAA-62DC-442D-B82C-F548546CFD38}</ProjectGuid>
|
|
||||||
<RootNamespace>Executable</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<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>
|
|
||||||
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
|
||||||
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<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>
|
|
||||||
<TargetName>$(SolutionName)-$(Configuration)</TargetName>
|
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
|
||||||
<LibraryPath>$(BOOST_ROOT)\lib32-msvc-11.0;$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);</LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;DEBUG;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="main.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Escape-the-Dawn\Escape-the-Dawn.vcxproj">
|
|
||||||
<Project>{fe405cfa-8fce-4867-92cf-797e73b36482}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Source Files">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Resource Files">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="main.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,107 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{B9A8F4AA-BE85-45EA-84DD-652D13DD22BE}</ProjectGuid>
|
|
||||||
<RootNamespace>Tests</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<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>
|
|
||||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<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>
|
|
||||||
<OutDir>$(ProjectDir)$(Configuration)\</OutDir>
|
|
||||||
<IntDir>$(SolutionDir)obj\$(ProjectName)\</IntDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<AdditionalDependencies>boost_unit_test_framework-vc110-gd-1_55.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<PostBuildEvent />
|
|
||||||
<PostBuildEvent />
|
|
||||||
<PreBuildEvent />
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>"$(OutDir)$(TargetName)$(TargetExt)" --log_level=test_suite</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Message>Running tests</Message>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>boost_unit_test_framework-vc110-1_55.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<PreBuildEvent />
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Command>"$(OutDir)$(TargetName)$(TargetExt)" --log_level=test_suite</Command>
|
|
||||||
</PostBuildEvent>
|
|
||||||
<PostBuildEvent>
|
|
||||||
<Message>Running tests</Message>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="main.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Escape-the-Dawn\Escape-the-Dawn.vcxproj">
|
|
||||||
<Project>{fe405cfa-8fce-4867-92cf-797e73b36482}</Project>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="Source Files">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Header Files">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="Resource Files">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="main.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
#include "logging.h"
|
|
||||||
|
|
||||||
#include "World.h"
|
|
||||||
#include "GameWorld.h"
|
|
||||||
#include "Components/Transform.h"
|
|
||||||
|
|
||||||
#define BOOST_TEST_MODULE World
|
|
||||||
#define BOOST_TEST_DYN_LINK
|
|
||||||
#include <boost/test/unit_test.hpp>
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(Parenting)
|
|
||||||
{
|
|
||||||
World world;
|
|
||||||
|
|
||||||
// Parenting
|
|
||||||
EntityID ent1 = world.CreateEntity();
|
|
||||||
BOOST_CHECK(ent1 != 0); // 0 is reserved for world
|
|
||||||
BOOST_CHECK(ent1 == 1);
|
|
||||||
BOOST_CHECK(world.GetEntityParent(ent1) == 0);
|
|
||||||
EntityID ent2 = world.CreateEntity(ent1);
|
|
||||||
BOOST_CHECK(ent2 != 0);
|
|
||||||
BOOST_CHECK(ent2 == ent1 + 1);
|
|
||||||
BOOST_CHECK(world.GetEntityParent(ent2) == ent1);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(SceneGraphTraversal)
|
|
||||||
{
|
|
||||||
std::shared_ptr<Renderer> renderer(new Renderer());
|
|
||||||
renderer->Initialize();
|
|
||||||
GameWorld world(renderer);
|
|
||||||
|
|
||||||
EntityID ent1 = world.CreateEntity();
|
|
||||||
auto t1 = world.AddComponent<Components::Transform>(ent1, "Transform");
|
|
||||||
BOOST_REQUIRE(t1 != nullptr);
|
|
||||||
t1->Position[0] = 1.0f;
|
|
||||||
t1->Position[1] = 1.0f;
|
|
||||||
t1->Position[2] = 1.0f;
|
|
||||||
EntityID ent2 = world.CreateEntity(ent1);
|
|
||||||
auto t2 = world.AddComponent<Components::Transform>(ent2, "Transform");
|
|
||||||
BOOST_REQUIRE(t2 != nullptr);
|
|
||||||
t2->Position[0] = 1.0f;
|
|
||||||
t2->Position[1] = 1.0f;
|
|
||||||
t2->Position[2] = 1.0f;
|
|
||||||
|
|
||||||
world.Update(0.0);
|
|
||||||
|
|
||||||
LOG_INFO("ent1: %f %f %f", t1->Position[0], t1->Position[1], t1->Position[2]);
|
|
||||||
LOG_INFO("ent2: %f %f %f", t2->Position[0], t2->Position[1], t2->Position[2]);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(Recycling)
|
|
||||||
{
|
|
||||||
World world;
|
|
||||||
|
|
||||||
// EntityID recycling
|
|
||||||
EntityID ent11 = world.CreateEntity(); // 1
|
|
||||||
world.RemoveEntity(ent11);
|
|
||||||
EntityID ent12 = world.CreateEntity(); // 1
|
|
||||||
BOOST_REQUIRE(ent11 == ent12);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(ComponentCreation)
|
|
||||||
{
|
|
||||||
World world;
|
|
||||||
|
|
||||||
EntityID ent = world.CreateEntity();
|
|
||||||
BOOST_CHECK(world.AddComponent(ent, "Transform") != nullptr);
|
|
||||||
BOOST_CHECK(world.AddComponent(ent, "Input") != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(Properties)
|
|
||||||
{
|
|
||||||
World world;
|
|
||||||
|
|
||||||
EntityID ent = world.CreateEntity();
|
|
||||||
|
|
||||||
world.SetProperty(ent, "String", std::string("derpfish"));
|
|
||||||
world.SetProperty(ent, "Integer", 123);
|
|
||||||
world.SetProperty(ent, "Float", 0.04f);
|
|
||||||
|
|
||||||
BOOST_CHECK(world.GetProperty<std::string>(ent, "String") == "derpfish");
|
|
||||||
BOOST_CHECK(world.GetProperty<int>(ent, "Integer") == 123);
|
|
||||||
BOOST_CHECK(world.GetProperty<float>(ent, "Float") == 0.04f);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user