Ndk: Fixed warnings
Former-commit-id: 64509f0d59d83f4c04a09fe7e7913d94a940f191
This commit is contained in:
parent
385b7fc3fd
commit
5e954113ef
|
|
@ -13,7 +13,7 @@ namespace Ndk
|
|||
static_assert(N-1 <= sizeof(ComponentId), "Name too long for this size of component id");
|
||||
|
||||
ComponentId componentId = 0;
|
||||
for (int i = 0; i < N; ++i)
|
||||
for (unsigned int i = 0; i < N; ++i)
|
||||
componentId |= static_cast<ComponentId>(name[i]) << i*8;
|
||||
|
||||
return componentId;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Ndk
|
|||
~ListenerComponent() = default;
|
||||
|
||||
bool IsActive() const;
|
||||
bool SetActive(bool active = true);
|
||||
void SetActive(bool active = true);
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Ndk
|
|||
return m_isActive;
|
||||
}
|
||||
|
||||
inline bool ListenerComponent::SetActive(bool active)
|
||||
inline void ListenerComponent::SetActive(bool active)
|
||||
{
|
||||
m_isActive = active;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ namespace Ndk
|
|||
friend bool operator>=(const Entity& lhs, const EntityHandle& rhs);
|
||||
friend bool operator>=(const EntityHandle& lhs, const Entity& rhs);
|
||||
|
||||
static const EntityHandle InvalidHandle;
|
||||
|
||||
private:
|
||||
void OnEntityDestroyed();
|
||||
void OnEntityMoved(Entity* newEntity);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ namespace Ndk
|
|||
|
||||
// On effectue l'échange
|
||||
std::swap(m_entity, handle.m_entity);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline EntityHandle::operator bool() const
|
||||
|
|
@ -106,16 +107,22 @@ namespace Ndk
|
|||
inline EntityHandle& EntityHandle::operator=(Entity* entity)
|
||||
{
|
||||
Reset(entity);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline EntityHandle& EntityHandle::operator=(const EntityHandle& handle)
|
||||
{
|
||||
Reset(handle);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline EntityHandle& EntityHandle::operator=(EntityHandle&& handle)
|
||||
{
|
||||
Reset(handle);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline void EntityHandle::OnEntityDestroyed()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#include <NDK/EntityHandle.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
const EntityHandle EntityHandle::InvalidHandle;
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ namespace Ndk
|
|||
else
|
||||
{
|
||||
NazaraError("Invalid ID");
|
||||
return EntityHandle();
|
||||
return EntityHandle::InvalidHandle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue