From c6e0ce9eb7d917211369dd0123dc7d68e2656c9e Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Sat, 18 Feb 2023 15:54:31 +0000 Subject: [PATCH] Fix clang compilation --- include/ecs_system.hpp | 2 +- include/event_system.hpp | 6 ++++++ include/gfx.hpp | 4 ++++ include/systems/collisions.hpp | 9 +++++++++ src/resources/shader.cpp | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/ecs_system.hpp b/include/ecs_system.hpp index 8dbb7bb..e2cae6d 100644 --- a/include/ecs_system.hpp +++ b/include/ecs_system.hpp @@ -52,7 +52,7 @@ namespace engine { public: System(Scene* scene, std::set requiredComponentHashes); - ~System() {} + virtual ~System() {} System(const System&) = delete; System& operator=(const System&) = delete; diff --git a/include/event_system.hpp b/include/event_system.hpp index 1582516..d90d12a 100644 --- a/include/event_system.hpp +++ b/include/event_system.hpp @@ -23,6 +23,7 @@ namespace engine { // Event queue interface to allow for different type queues to be in the map class IEventQueue { public: + virtual ~IEventQueue() {} virtual void dispatchEvents() = 0; }; @@ -61,6 +62,11 @@ namespace engine { std::unordered_map*> m_subscribers; struct QueuedEvent { + + QueuedEvent(EventHandler* handler, T event) : + handler(handler), + event(event) {} + EventHandler* handler; T event; }; diff --git a/include/gfx.hpp b/include/gfx.hpp index c5e6325..e863760 100644 --- a/include/gfx.hpp +++ b/include/gfx.hpp @@ -46,6 +46,10 @@ namespace engine::gfx { }; struct VertexAttribDescription { + VertexAttribDescription(uint32_t location, VertexAttribFormat format, uint32_t offset) : + location(location), + format(format), + offset(offset) {} uint32_t location; VertexAttribFormat format; uint32_t offset; diff --git a/include/systems/collisions.hpp b/include/systems/collisions.hpp index 294ec8d..f4b9b36 100644 --- a/include/systems/collisions.hpp +++ b/include/systems/collisions.hpp @@ -33,6 +33,15 @@ namespace engine { std::vector> m_dynamicAABBs{}; struct PossibleCollision { + + PossibleCollision(uint32_t staticEntity, AABB staticAABB, bool staticTrigger, uint32_t dynamicEntity, AABB dynamicAABB, bool dynamicTrigger) : + staticEntity(staticEntity), + staticAABB(staticAABB), + staticTrigger(staticTrigger), + dynamicEntity(dynamicEntity), + dynamicAABB(dynamicAABB), + dynamicTrigger(dynamicTrigger) {} + uint32_t staticEntity; AABB staticAABB; bool staticTrigger; diff --git a/src/resources/shader.cpp b/src/resources/shader.cpp index 4018b60..25c3f7e 100644 --- a/src/resources/shader.cpp +++ b/src/resources/shader.cpp @@ -11,7 +11,7 @@ namespace engine::resources { Shader::Shader(GFXDevice* gfx, const char* vertPath, const char* fragPath, const VertexParams& vertexParams, bool alphaBlending, bool cullBackFace) : m_gfx(gfx) { - int index = 0; + uint32_t index = 0; uint32_t stride = 0; gfx::VertexFormat vertFormat{};