Merge branch 'master' into OctTree

# Conflicts:
#	src/Engine/CMakeLists.txt
#	src/Game/Game.cpp
This commit is contained in:
William Moberg
2015-12-15 17:11:11 +01:00
73 changed files with 2615 additions and 756 deletions
+9 -4
View File
@@ -9,11 +9,15 @@
#include "GUI/Frame.h"
#include "Core/World.h"
#include "Rendering/RenderQueueFactory.h"
#include "Input/InputProxy.h"
#include "Input/KeyboardInputHandler.h"
#include "Input/MouseInputHandler.h"
#include "Core/EKeyDown.h"
#include "Core/EntityXMLFile.h"
#include "Core/SystemPipeline.h"
#include "RaptorCopterSystem.h"
#include "PlayerSystem.h"
#include "Editor/EditorSystem.h"
class Game
{
@@ -30,16 +34,17 @@ private:
EventBroker* m_EventBroker;
IRenderer* m_Renderer;
InputManager* m_InputManager;
InputProxy* m_InputProxy;
GUI::Frame* m_FrameStack;
World* m_World;
SystemPipeline* m_SystemPipeline;
RenderQueueFactory* m_RenderQueueFactory;
EventRelay<Game, Events::KeyUp> m_EKeyUp;
bool testOnKeyUp(const Events::KeyUp& e);
EventRelay<Game, Events::InputCommand> m_EInputCommand;
bool debugOnInputCommand(const Events::InputCommand& e);
void testIntialize();
void testTick(double dt);
void debugInitialize();
void debugTick(double dt);
};
#endif
+3 -3
View File
@@ -19,11 +19,11 @@ struct KeyInput
bool Right = false;
};
class PlayerSystem : public System
class PlayerSystem : public PureSystem
{
public:
PlayerSystem(EventBroker* eventBroker)
: System(eventBroker, "Player")
: PureSystem(eventBroker, "Player")
{
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PlayerSystem::OnKeyDown);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PlayerSystem::OnKeyUp);
@@ -32,7 +32,7 @@ public:
EVENT_SUBSCRIBE_MEMBER(m_ELeave, &PlayerSystem::OnLeave);
}
virtual void Update(World* world, ComponentWrapper& player, double dt) override;
virtual void UpdateComponent(World* world, ComponentWrapper& player, double dt) override;
private:
float m_Speed = 5;
+3 -5
View File
@@ -1,16 +1,14 @@
#include "Common.h"
#include "Core/System.h"
class RaptorCopterSystem : public System
class RaptorCopterSystem : public PureSystem
{
public:
RaptorCopterSystem(EventBroker* eventBroker)
: System(eventBroker, "RaptorCopter")
: PureSystem(eventBroker, "RaptorCopter")
{ }
virtual void Initialize() { }
virtual void Update(World* world, ComponentWrapper& raptorCopter, double dt) override
virtual void UpdateComponent(World* world, ComponentWrapper& raptorCopter, double dt) override
{
ComponentWrapper& transform = world->GetComponent(raptorCopter.EntityID, "Transform");
(glm::vec3&)transform["Orientation"] += (float)(double)raptorCopter["Speed"] * (float)dt * (glm::vec3)raptorCopter["Axis"];