Merge remote-tracking branch 'origin/master' into water
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "CTemplate.h"
|
||||
#include "Core/ConfigFile.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Input/InputSystem.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CPointLight.h"
|
||||
@@ -176,6 +177,9 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::InkBlasterBrick>();
|
||||
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>(
|
||||
[this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::LevelSystem>();
|
||||
@@ -257,9 +261,10 @@ public:
|
||||
m_LastTime = currentTime;
|
||||
|
||||
// Update input
|
||||
m_EventBroker->Swap();
|
||||
m_InputManager->Update(dt);
|
||||
// Swap event queues to get fresh input data in the read queue
|
||||
//m_EventBroker->Swap();
|
||||
//m_EventBroker->Process<Systems::InputSystem>();
|
||||
m_EventBroker->Swap();
|
||||
|
||||
//ResourceManager::Update();
|
||||
if (m_GameIsRunning) {
|
||||
@@ -284,6 +289,7 @@ public:
|
||||
m_EventBroker->Process<Engine>();
|
||||
// Swap event queues
|
||||
m_EventBroker->Swap();
|
||||
m_EventBroker->Clear();
|
||||
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ public:
|
||||
int Process();
|
||||
int Process(std::string contextTypeName);
|
||||
void Swap();
|
||||
void Clear();
|
||||
void Unsubscribe(BaseEventRelay &relay);
|
||||
|
||||
private:
|
||||
|
||||
@@ -47,6 +47,10 @@ public:
|
||||
private:
|
||||
bool m_Pause = false;
|
||||
EntityID m_Template;
|
||||
Events::Lifebuoy m_SavedEvent;
|
||||
bool m_Lifebuoy = false;
|
||||
float m_Timer;
|
||||
float m_WaitingTime = 0.4;
|
||||
|
||||
dd::EventRelay<LifebuoySystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<LifebuoySystem, dd::Events::Pause> m_EPause;
|
||||
@@ -58,6 +62,7 @@ private:
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnResume(const dd::Events::Resume &event);
|
||||
bool OnLifebuoy(const dd::Events::Lifebuoy &event);
|
||||
bool Lifebuoy(const dd::Events::Lifebuoy &event);
|
||||
bool OnLifebuoyHit(const dd::Events::LifebuoyHit &event);
|
||||
|
||||
struct LifebuoyInfo
|
||||
|
||||
Reference in New Issue
Block a user