Ndk: Fix inline warnings on GCC

Former-commit-id: 4ffe5cd1e821160c60cd2d84f6a0d164aa1326f7
This commit is contained in:
Lynix 2015-06-11 14:23:19 +02:00
parent 3b5551ed7a
commit 2a6ec829fe
4 changed files with 76 additions and 76 deletions

View File

@ -22,8 +22,8 @@ namespace Ndk
friend World; friend World;
public: public:
BaseSystem(SystemIndex systemId); inline BaseSystem(SystemIndex systemId);
BaseSystem(const BaseSystem&); inline BaseSystem(const BaseSystem&);
BaseSystem(BaseSystem&&) noexcept = default; BaseSystem(BaseSystem&&) noexcept = default;
~BaseSystem(); ~BaseSystem();
@ -31,11 +31,11 @@ namespace Ndk
bool Filters(const Entity* entity) const; bool Filters(const Entity* entity) const;
const std::vector<EntityHandle>& GetEntities() const; inline const std::vector<EntityHandle>& GetEntities() const;
SystemIndex GetIndex() const; inline SystemIndex GetIndex() const;
World& GetWorld() 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=(const BaseSystem&) = delete;
BaseSystem& operator=(BaseSystem&&) noexcept = default; BaseSystem& operator=(BaseSystem&&) noexcept = default;
@ -43,33 +43,33 @@ namespace Ndk
protected: protected:
template<typename ComponentType> void Excludes(); template<typename ComponentType> void Excludes();
template<typename ComponentType1, typename ComponentType2, typename... Rest> void Excludes(); template<typename ComponentType1, typename ComponentType2, typename... Rest> void Excludes();
void ExcludesComponent(ComponentIndex index); inline void ExcludesComponent(ComponentIndex index);
static SystemIndex GetNextIndex(); static SystemIndex GetNextIndex();
template<typename ComponentType> void Requires(); template<typename ComponentType> void Requires();
template<typename ComponentType1, typename ComponentType2, typename... Rest> void Requires(); template<typename ComponentType1, typename ComponentType2, typename... Rest> void Requires();
void RequiresComponent(ComponentIndex index); inline void RequiresComponent(ComponentIndex index);
template<typename ComponentType> void RequiresAny(); template<typename ComponentType> void RequiresAny();
template<typename ComponentType1, typename ComponentType2, typename... Rest> void RequiresAny(); template<typename ComponentType1, typename ComponentType2, typename... Rest> void RequiresAny();
void RequiresAnyComponent(ComponentIndex index); inline void RequiresAnyComponent(ComponentIndex index);
private: private:
void AddEntity(Entity* entity); inline void AddEntity(Entity* entity);
virtual void OnEntityAdded(Entity* entity); virtual void OnEntityAdded(Entity* entity);
virtual void OnEntityRemoved(Entity* entity); virtual void OnEntityRemoved(Entity* entity);
virtual void OnEntityValidation(Entity* entity, bool justAdded); 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 inline bool Initialize();
static void Uninitialize(); static inline void Uninitialize();
std::vector<EntityHandle> m_entities; std::vector<EntityHandle> m_entities;
NzBitset<nzUInt64> m_entityBits; NzBitset<nzUInt64> m_entityBits;

View File

@ -28,40 +28,40 @@ namespace Ndk
void ApplyView() const override; void ApplyView() const override;
void EnsureFrustumUpdate() const; inline void EnsureFrustumUpdate() const;
void EnsureProjectionMatrixUpdate() const; inline void EnsureProjectionMatrixUpdate() const;
void EnsureViewMatrixUpdate() const; inline void EnsureViewMatrixUpdate() const;
void EnsureViewportUpdate() const; inline void EnsureViewportUpdate() const;
float GetAspectRatio() const; inline float GetAspectRatio() const;
NzVector3f GetEyePosition() const; inline NzVector3f GetEyePosition() const;
NzVector3f GetForward() const; inline NzVector3f GetForward() const;
float GetFOV() const; inline float GetFOV() const;
const NzFrustumf& GetFrustum() const; inline const NzFrustumf& GetFrustum() const;
unsigned int GetLayer() const; inline unsigned int GetLayer() const;
const NzMatrix4f& GetProjectionMatrix() const; inline const NzMatrix4f& GetProjectionMatrix() const;
const NzRenderTarget* GetTarget() const; inline const NzRenderTarget* GetTarget() const;
const NzRectf& GetTargetRegion() const; inline const NzRectf& GetTargetRegion() const;
const NzMatrix4f& GetViewMatrix() const; inline const NzMatrix4f& GetViewMatrix() const;
const NzRecti& GetViewport() const; inline const NzRecti& GetViewport() const;
float GetZFar() const; inline float GetZFar() const;
float GetZNear() const; inline float GetZNear() const;
void SetFOV(float fov); inline void SetFOV(float fov);
void SetLayer(unsigned int layer); inline void SetLayer(unsigned int layer);
void SetTarget(const NzRenderTarget* renderTarget); inline void SetTarget(const NzRenderTarget* renderTarget);
void SetTargetRegion(const NzRectf& region); inline void SetTargetRegion(const NzRectf& region);
void SetViewport(const NzRecti& viewport); inline void SetViewport(const NzRecti& viewport);
void SetZFar(float zFar); inline void SetZFar(float zFar);
void SetZNear(float zNear); inline void SetZNear(float zNear);
static ComponentIndex componentIndex; static ComponentIndex componentIndex;
private: private:
void InvalidateFrustum() const; inline void InvalidateFrustum() const;
void InvalidateProjectionMatrix() const; inline void InvalidateProjectionMatrix() const;
void InvalidateViewMatrix() const; inline void InvalidateViewMatrix() const;
void InvalidateViewport() const; inline void InvalidateViewport() const;
void OnAttached() override; void OnAttached() override;
void OnComponentAttached(BaseComponent& component) override; void OnComponentAttached(BaseComponent& component) override;

View File

@ -21,36 +21,36 @@ namespace Ndk
EntityList() = default; EntityList() = default;
~EntityList() = default; ~EntityList() = default;
void Clear(); inline void Clear();
bool Has(const Entity* entity); inline bool Has(const Entity* entity);
bool Has(EntityId 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 // STL API
Container::iterator begin(); inline Container::iterator begin();
Container::const_iterator begin() const; inline Container::const_iterator begin() const;
Container::const_iterator cbegin() const; inline Container::const_iterator cbegin() const;
Container::const_iterator cend() const; inline Container::const_iterator cend() const;
Container::const_reverse_iterator crbegin() const; inline Container::const_reverse_iterator crbegin() const;
Container::const_reverse_iterator crend() const; inline Container::const_reverse_iterator crend() const;
bool empty() const; inline bool empty() const;
Container::iterator end(); inline Container::iterator end();
Container::const_iterator end() const; inline Container::const_iterator end() const;
Container::reverse_iterator rbegin(); inline Container::reverse_iterator rbegin();
Container::const_reverse_iterator rbegin() const; inline Container::const_reverse_iterator rbegin() const;
Container::reverse_iterator rend(); inline Container::reverse_iterator rend();
Container::const_reverse_iterator rend() const; inline Container::const_reverse_iterator rend() const;
Container::size_type size() const; inline Container::size_type size() const;
private: private:
std::vector<EntityHandle> m_entities; std::vector<EntityHandle> m_entities;

View File

@ -26,42 +26,42 @@ namespace Ndk
public: public:
using EntityList = std::vector<EntityHandle>; using EntityList = std::vector<EntityHandle>;
World(bool addDefaultSystems = true); inline World(bool addDefaultSystems = true);
~World(); ~World();
void AddDefaultSystems(); void AddDefaultSystems();
BaseSystem& AddSystem(std::unique_ptr<BaseSystem>&& system); inline BaseSystem& AddSystem(std::unique_ptr<BaseSystem>&& system);
template<typename SystemType, typename... Args> SystemType& AddSystem(Args&&... args); template<typename SystemType, typename... Args> SystemType& AddSystem(Args&&... args);
const EntityHandle& CreateEntity(); const EntityHandle& CreateEntity();
EntityList CreateEntities(unsigned int count); inline EntityList CreateEntities(unsigned int count);
void Clear(); void Clear();
const EntityHandle& GetEntity(EntityId id); const EntityHandle& GetEntity(EntityId id);
const EntityList& GetEntities(); inline const EntityList& GetEntities();
BaseSystem& GetSystem(SystemIndex index); inline BaseSystem& GetSystem(SystemIndex index);
template<typename SystemType> SystemType& GetSystem(); template<typename SystemType> SystemType& GetSystem();
bool HasSystem(SystemIndex index) const; inline bool HasSystem(SystemIndex index) const;
template<typename SystemType> bool HasSystem() const; template<typename SystemType> bool HasSystem() const;
void KillEntity(Entity* entity); void KillEntity(Entity* entity);
void KillEntities(const EntityList& list); inline void KillEntities(const EntityList& list);
bool IsEntityValid(const Entity* entity) const; inline bool IsEntityValid(const Entity* entity) const;
bool IsEntityIdValid(EntityId id) const; inline bool IsEntityIdValid(EntityId id) const;
void RemoveAllSystems(); inline void RemoveAllSystems();
void RemoveSystem(SystemIndex index); inline void RemoveSystem(SystemIndex index);
template<typename SystemType> void RemoveSystem(); template<typename SystemType> void RemoveSystem();
void Update(); void Update();
private: private:
void Invalidate(); inline void Invalidate();
void Invalidate(EntityId id); inline void Invalidate(EntityId id);
struct EntityBlock struct EntityBlock
{ {