1 #ifndef CORE_SYSTEMS_RENDER_HPP
2 #define CORE_SYSTEMS_RENDER_HPP
4 #include <BLIB/Engine/System.hpp>
5 #include <BLIB/Events.hpp>
21 :
public bl::engine::System
22 ,
public bl::event::Listener<event::EntityMoved, event::EntityMoveFinished, event::EntityRotated> {
43 void updateShadow(bl::ecs::Entity entity,
float distance,
float radius);
66 bl::rc::RenderTarget* mainRenderTarget;
67 bl::ecs::ComponentPool<component::Renderable>& pool;
68 bl::ecs::ComponentPool<bl::com::Transform2D>& transformPool;
69 std::vector<std::pair<bl::ecs::Entity, bl::tmap::Direction>> stopRm;
70 std::vector<std::pair<bl::ecs::Entity, bl::tmap::Direction>> stopAdd;
71 std::vector<bl::ecs::Entity> shadowsToRemove;
73 virtual void update(std::mutex& stageMutex,
float dt,
float realDt,
float residual,
74 float realResidual)
override;
75 virtual void init(bl::engine::Engine& engine)
override;
76 virtual void notifyFrameStart()
override;
Core classes and functionality for both the editor and game.
Fired after an entity begins moving from one position to another.
Fired when an entity completes a move from one tile to another.
Fired when an entity rotates without moving.
Basic system that synchronizes animation states based on movement state events.
virtual ~Render()=default
Destroys the render system.
Render(Systems &owner)
Creates the render system.
void setMainRenderTarget(bl::rc::RenderTarget &target)
Sets the main render target. Used by the editor.
void removeShadow(bl::ecs::Entity entity)
Removes the shadow from the given entity.
bl::rc::RenderTarget & getMainRenderTarget()
Returns the engine observer that the main game is rendering to.
void updateShadow(bl::ecs::Entity entity, float distance, float radius)
Adds or updates the shadow of the given entity.
Owns all primary systems and a reference to the engine.