From 2a6ec829fe8b3bda248f36129e55cd8e360dd15b Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 11 Jun 2015 14:23:19 +0200 Subject: [PATCH] Ndk: Fix inline warnings on GCC Former-commit-id: 4ffe5cd1e821160c60cd2d84f6a0d164aa1326f7 --- SDK/include/NDK/BaseSystem.hpp | 30 +++++----- .../NDK/Components/CameraComponent.hpp | 56 +++++++++---------- SDK/include/NDK/EntityList.hpp | 40 ++++++------- SDK/include/NDK/World.hpp | 26 ++++----- 4 files changed, 76 insertions(+), 76 deletions(-) diff --git a/SDK/include/NDK/BaseSystem.hpp b/SDK/include/NDK/BaseSystem.hpp index 2e8201c80..6d0823aa7 100644 --- a/SDK/include/NDK/BaseSystem.hpp +++ b/SDK/include/NDK/BaseSystem.hpp @@ -22,8 +22,8 @@ namespace Ndk friend World; public: - BaseSystem(SystemIndex systemId); - BaseSystem(const BaseSystem&); + inline BaseSystem(SystemIndex systemId); + inline BaseSystem(const BaseSystem&); BaseSystem(BaseSystem&&) noexcept = default; ~BaseSystem(); @@ -31,11 +31,11 @@ namespace Ndk bool Filters(const Entity* entity) const; - const std::vector& GetEntities() const; - SystemIndex GetIndex() const; - World& GetWorld() const; + inline const std::vector& GetEntities() const; + inline SystemIndex GetIndex() const; + inline World& GetWorld() const; - bool HasEntity(const Entity* entity) const; + inline bool HasEntity(const Entity* entity) const; BaseSystem& operator=(const BaseSystem&) = delete; BaseSystem& operator=(BaseSystem&&) noexcept = default; @@ -43,33 +43,33 @@ namespace Ndk protected: template void Excludes(); template void Excludes(); - void ExcludesComponent(ComponentIndex index); + inline void ExcludesComponent(ComponentIndex index); static SystemIndex GetNextIndex(); template void Requires(); template void Requires(); - void RequiresComponent(ComponentIndex index); + inline void RequiresComponent(ComponentIndex index); template void RequiresAny(); template void RequiresAny(); - void RequiresAnyComponent(ComponentIndex index); + inline void RequiresAnyComponent(ComponentIndex index); private: - void AddEntity(Entity* entity); + inline void AddEntity(Entity* entity); virtual void OnEntityAdded(Entity* entity); virtual void OnEntityRemoved(Entity* entity); virtual void OnEntityValidation(Entity* entity, bool justAdded); - void RemoveEntity(Entity* entity); + inline void RemoveEntity(Entity* entity); - void SetWorld(World& world); + inline void SetWorld(World& world); - void ValidateEntity(Entity* entity, bool justAdded); + inline void ValidateEntity(Entity* entity, bool justAdded); - static bool Initialize(); - static void Uninitialize(); + static inline bool Initialize(); + static inline void Uninitialize(); std::vector m_entities; NzBitset m_entityBits; diff --git a/SDK/include/NDK/Components/CameraComponent.hpp b/SDK/include/NDK/Components/CameraComponent.hpp index 1e72aac74..cd575b40d 100644 --- a/SDK/include/NDK/Components/CameraComponent.hpp +++ b/SDK/include/NDK/Components/CameraComponent.hpp @@ -28,40 +28,40 @@ namespace Ndk void ApplyView() const override; - void EnsureFrustumUpdate() const; - void EnsureProjectionMatrixUpdate() const; - void EnsureViewMatrixUpdate() const; - void EnsureViewportUpdate() const; + inline void EnsureFrustumUpdate() const; + inline void EnsureProjectionMatrixUpdate() const; + inline void EnsureViewMatrixUpdate() const; + inline void EnsureViewportUpdate() const; - float GetAspectRatio() const; - NzVector3f GetEyePosition() const; - NzVector3f GetForward() const; - float GetFOV() const; - const NzFrustumf& GetFrustum() const; - unsigned int GetLayer() const; - const NzMatrix4f& GetProjectionMatrix() const; - const NzRenderTarget* GetTarget() const; - const NzRectf& GetTargetRegion() const; - const NzMatrix4f& GetViewMatrix() const; - const NzRecti& GetViewport() const; - float GetZFar() const; - float GetZNear() const; + inline float GetAspectRatio() const; + inline NzVector3f GetEyePosition() const; + inline NzVector3f GetForward() const; + inline float GetFOV() const; + inline const NzFrustumf& GetFrustum() const; + inline unsigned int GetLayer() const; + inline const NzMatrix4f& GetProjectionMatrix() const; + inline const NzRenderTarget* GetTarget() const; + inline const NzRectf& GetTargetRegion() const; + inline const NzMatrix4f& GetViewMatrix() const; + inline const NzRecti& GetViewport() const; + inline float GetZFar() const; + inline float GetZNear() const; - void SetFOV(float fov); - void SetLayer(unsigned int layer); - void SetTarget(const NzRenderTarget* renderTarget); - void SetTargetRegion(const NzRectf& region); - void SetViewport(const NzRecti& viewport); - void SetZFar(float zFar); - void SetZNear(float zNear); + inline void SetFOV(float fov); + inline void SetLayer(unsigned int layer); + inline void SetTarget(const NzRenderTarget* renderTarget); + inline void SetTargetRegion(const NzRectf& region); + inline void SetViewport(const NzRecti& viewport); + inline void SetZFar(float zFar); + inline void SetZNear(float zNear); static ComponentIndex componentIndex; private: - void InvalidateFrustum() const; - void InvalidateProjectionMatrix() const; - void InvalidateViewMatrix() const; - void InvalidateViewport() const; + inline void InvalidateFrustum() const; + inline void InvalidateProjectionMatrix() const; + inline void InvalidateViewMatrix() const; + inline void InvalidateViewport() const; void OnAttached() override; void OnComponentAttached(BaseComponent& component) override; diff --git a/SDK/include/NDK/EntityList.hpp b/SDK/include/NDK/EntityList.hpp index 753189580..4737cdba7 100644 --- a/SDK/include/NDK/EntityList.hpp +++ b/SDK/include/NDK/EntityList.hpp @@ -21,36 +21,36 @@ namespace Ndk EntityList() = default; ~EntityList() = default; - void Clear(); + inline void Clear(); - bool Has(const Entity* entity); - bool Has(EntityId entity); + inline bool Has(const Entity* entity); + inline bool Has(EntityId entity); - void Insert(Entity* entity); + inline void Insert(Entity* entity); - void Remove(Entity* entity); + inline void Remove(Entity* entity); - // Interface STD - Container::iterator begin(); - Container::const_iterator begin() const; + // STL API + inline Container::iterator begin(); + inline Container::const_iterator begin() const; - Container::const_iterator cbegin() const; - Container::const_iterator cend() const; - Container::const_reverse_iterator crbegin() const; - Container::const_reverse_iterator crend() const; + inline Container::const_iterator cbegin() const; + inline Container::const_iterator cend() const; + inline Container::const_reverse_iterator crbegin() const; + inline Container::const_reverse_iterator crend() const; - bool empty() const; + inline bool empty() const; - Container::iterator end(); - Container::const_iterator end() const; + inline Container::iterator end(); + inline Container::const_iterator end() const; - Container::reverse_iterator rbegin(); - Container::const_reverse_iterator rbegin() const; + inline Container::reverse_iterator rbegin(); + inline Container::const_reverse_iterator rbegin() const; - Container::reverse_iterator rend(); - Container::const_reverse_iterator rend() const; + inline Container::reverse_iterator rend(); + inline Container::const_reverse_iterator rend() const; - Container::size_type size() const; + inline Container::size_type size() const; private: std::vector m_entities; diff --git a/SDK/include/NDK/World.hpp b/SDK/include/NDK/World.hpp index f473ae224..55c06d0ea 100644 --- a/SDK/include/NDK/World.hpp +++ b/SDK/include/NDK/World.hpp @@ -26,42 +26,42 @@ namespace Ndk public: using EntityList = std::vector; - World(bool addDefaultSystems = true); + inline World(bool addDefaultSystems = true); ~World(); void AddDefaultSystems(); - BaseSystem& AddSystem(std::unique_ptr&& system); + inline BaseSystem& AddSystem(std::unique_ptr&& system); template SystemType& AddSystem(Args&&... args); const EntityHandle& CreateEntity(); - EntityList CreateEntities(unsigned int count); + inline EntityList CreateEntities(unsigned int count); void Clear(); const EntityHandle& GetEntity(EntityId id); - const EntityList& GetEntities(); - BaseSystem& GetSystem(SystemIndex index); + inline const EntityList& GetEntities(); + inline BaseSystem& GetSystem(SystemIndex index); template SystemType& GetSystem(); - bool HasSystem(SystemIndex index) const; + inline bool HasSystem(SystemIndex index) const; template bool HasSystem() const; void KillEntity(Entity* entity); - void KillEntities(const EntityList& list); + inline void KillEntities(const EntityList& list); - bool IsEntityValid(const Entity* entity) const; - bool IsEntityIdValid(EntityId id) const; + inline bool IsEntityValid(const Entity* entity) const; + inline bool IsEntityIdValid(EntityId id) const; - void RemoveAllSystems(); - void RemoveSystem(SystemIndex index); + inline void RemoveAllSystems(); + inline void RemoveSystem(SystemIndex index); template void RemoveSystem(); void Update(); private: - void Invalidate(); - void Invalidate(EntityId id); + inline void Invalidate(); + inline void Invalidate(EntityId id); struct EntityBlock {