Merge branch 'master' of https://github.com/teamfisk/AgileBreakOut
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "CTemplate.h"
|
#include "CTemplate.h"
|
||||||
#include "Core/ConfigFile.h"
|
#include "Core/ConfigFile.h"
|
||||||
#include "Core/EventBroker.h"
|
#include "Core/EventBroker.h"
|
||||||
|
#include "Input/InputSystem.h"
|
||||||
#include "Rendering/CModel.h"
|
#include "Rendering/CModel.h"
|
||||||
#include "Rendering/CSprite.h"
|
#include "Rendering/CSprite.h"
|
||||||
#include "Rendering/CPointLight.h"
|
#include "Rendering/CPointLight.h"
|
||||||
@@ -176,6 +177,9 @@ public:
|
|||||||
m_World->ComponentFactory.Register<Components::InkBlasterBrick>();
|
m_World->ComponentFactory.Register<Components::InkBlasterBrick>();
|
||||||
m_World->ComponentFactory.Register<Components::KrakenAttackBrick>();
|
m_World->ComponentFactory.Register<Components::KrakenAttackBrick>();
|
||||||
|
|
||||||
|
//m_World->SystemFactory.Register<Systems::InputSystem>(
|
||||||
|
// [this]() { return new Systems::InputSystem(m_World.get(), m_EventBroker); });
|
||||||
|
//m_World->AddSystem<Systems::InputSystem>();
|
||||||
m_World->SystemFactory.Register<Systems::LevelSystem>(
|
m_World->SystemFactory.Register<Systems::LevelSystem>(
|
||||||
[this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); });
|
[this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); });
|
||||||
m_World->AddSystem<Systems::LevelSystem>();
|
m_World->AddSystem<Systems::LevelSystem>();
|
||||||
@@ -257,9 +261,10 @@ public:
|
|||||||
m_LastTime = currentTime;
|
m_LastTime = currentTime;
|
||||||
|
|
||||||
// Update input
|
// Update input
|
||||||
|
m_EventBroker->Swap();
|
||||||
m_InputManager->Update(dt);
|
m_InputManager->Update(dt);
|
||||||
// Swap event queues to get fresh input data in the read queue
|
//m_EventBroker->Process<Systems::InputSystem>();
|
||||||
//m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
|
|
||||||
//ResourceManager::Update();
|
//ResourceManager::Update();
|
||||||
if (m_GameIsRunning) {
|
if (m_GameIsRunning) {
|
||||||
@@ -284,6 +289,7 @@ public:
|
|||||||
m_EventBroker->Process<Engine>();
|
m_EventBroker->Process<Engine>();
|
||||||
// Swap event queues
|
// Swap event queues
|
||||||
m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
|
m_EventBroker->Clear();
|
||||||
|
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public:
|
|||||||
int Process();
|
int Process();
|
||||||
int Process(std::string contextTypeName);
|
int Process(std::string contextTypeName);
|
||||||
void Swap();
|
void Swap();
|
||||||
|
void Clear();
|
||||||
void Unsubscribe(BaseEventRelay &relay);
|
void Unsubscribe(BaseEventRelay &relay);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -91,8 +91,11 @@ int dd::EventBroker::Process(std::string contextTypeName)
|
|||||||
void dd::EventBroker::Swap()
|
void dd::EventBroker::Swap()
|
||||||
{
|
{
|
||||||
std::swap(m_EventQueueRead, m_EventQueueWrite);
|
std::swap(m_EventQueueRead, m_EventQueueWrite);
|
||||||
m_EventQueueWrite->clear();
|
}
|
||||||
|
|
||||||
|
void dd::EventBroker::Clear()
|
||||||
|
{
|
||||||
|
m_EventQueueWrite->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void dd::EventBroker::subscribeImmediate(dd::BaseEventRelay& relay)
|
void dd::EventBroker::subscribeImmediate(dd::BaseEventRelay& relay)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ void dd::Systems::PadSystem::Initialize()
|
|||||||
cModel->ModelFile = "Models/Ship/Ship.obj";
|
cModel->ModelFile = "Models/Ship/Ship.obj";
|
||||||
|
|
||||||
auto pad = m_World->AddComponent<Components::Pad>(ent);
|
auto pad = m_World->AddComponent<Components::Pad>(ent);
|
||||||
|
pad->SlowdownModifier = 10.f;
|
||||||
m_World->CommitEntity(ent);
|
m_World->CommitEntity(ent);
|
||||||
|
|
||||||
m_Edge = 3.2 - (ctransform->Scale.x / 2);
|
m_Edge = 3.2 - (ctransform->Scale.x / 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user