Fixed some warnings

Former-commit-id: d7db2b471afac2d16f44a67e79842f8a7fc2100e
This commit is contained in:
Lynix 2015-06-28 13:48:22 +02:00
parent 8648258ef7
commit 318da0d960
8 changed files with 21 additions and 7 deletions

View File

@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp // For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <Nazara/Core/Error.hpp> #include <Nazara/Core/Error.hpp>
#include <Nazara/Math/Algorithm.hpp>
namespace Ndk namespace Ndk
{ {
@ -130,7 +131,7 @@ namespace Ndk
inline void CameraComponent::SetFOV(float fov) inline void CameraComponent::SetFOV(float fov)
{ {
NazaraAssert(fov != 0.f, "FOV must be different from zero"); NazaraAssert(!NzNumberEquals(fov, 0.f), "FOV must be different from zero");
m_fov = fov; m_fov = fov;
InvalidateProjectionMatrix(); InvalidateProjectionMatrix();

View File

@ -26,6 +26,8 @@ namespace Ndk
void RenderSystem::OnEntityValidation(Entity* entity, bool justAdded) void RenderSystem::OnEntityValidation(Entity* entity, bool justAdded)
{ {
NazaraUnused(justAdded);
if (entity->HasComponent<CameraComponent>() && entity->HasComponent<NodeComponent>()) if (entity->HasComponent<CameraComponent>() && entity->HasComponent<NodeComponent>())
{ {
m_cameras.Insert(entity); m_cameras.Insert(entity);
@ -50,6 +52,8 @@ namespace Ndk
void RenderSystem::OnUpdate(float elapsedTime) void RenderSystem::OnUpdate(float elapsedTime)
{ {
NazaraUnused(elapsedTime);
for (const Ndk::EntityHandle& camera : m_cameras) for (const Ndk::EntityHandle& camera : m_cameras)
{ {
CameraComponent& camComponent = camera->GetComponent<CameraComponent>(); CameraComponent& camComponent = camera->GetComponent<CameraComponent>();

View File

@ -52,6 +52,9 @@ inline void NzForwardRenderTechnique::SendLightUniforms(const NzShader* shader,
inline float NzForwardRenderTechnique::ComputeDirectionalLightScore(const NzSpheref& object, const NzAbstractRenderQueue::DirectionalLight& light) inline float NzForwardRenderTechnique::ComputeDirectionalLightScore(const NzSpheref& object, const NzAbstractRenderQueue::DirectionalLight& light)
{ {
NazaraUnused(object);
NazaraUnused(light);
///TODO: Compute a score depending on the light luminosity ///TODO: Compute a score depending on the light luminosity
return 0.f; return 0.f;
} }
@ -70,6 +73,9 @@ inline float NzForwardRenderTechnique::ComputeSpotLightScore(const NzSpheref& ob
inline bool NzForwardRenderTechnique::IsDirectionalLightSuitable(const NzSpheref& object, const NzAbstractRenderQueue::DirectionalLight& light) inline bool NzForwardRenderTechnique::IsDirectionalLightSuitable(const NzSpheref& object, const NzAbstractRenderQueue::DirectionalLight& light)
{ {
NazaraUnused(object);
NazaraUnused(light);
// Directional light are always suitables // Directional light are always suitables
return true; return true;
} }

View File

@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
inline NzInstancedRenderable::NzInstancedRenderable(const NzInstancedRenderable& renderable) : inline NzInstancedRenderable::NzInstancedRenderable(const NzInstancedRenderable& renderable) :
NzRefCounted(),
m_boundingVolume(renderable.m_boundingVolume), m_boundingVolume(renderable.m_boundingVolume),
m_boundingVolumeUpdated(renderable.m_boundingVolumeUpdated) m_boundingVolumeUpdated(renderable.m_boundingVolumeUpdated)
{ {

View File

@ -24,6 +24,8 @@ void NzAbstractRenderQueue::AddSpotLight(const SpotLight& light)
void NzAbstractRenderQueue::Clear(bool fully) void NzAbstractRenderQueue::Clear(bool fully)
{ {
NazaraUnused(fully);
directionalLights.clear(); directionalLights.clear();
pointLights.clear(); pointLights.clear();
spotLights.clear(); spotLights.clear();

View File

@ -52,10 +52,10 @@ m_mass(0.f)
NzPhysObject::NzPhysObject(NzPhysObject&& object) : NzPhysObject::NzPhysObject(NzPhysObject&& object) :
m_matrix(std::move(object.m_matrix)), m_matrix(std::move(object.m_matrix)),
m_geom(std::move(object.m_geom)),
m_forceAccumulator(std::move(object.m_forceAccumulator)), m_forceAccumulator(std::move(object.m_forceAccumulator)),
m_torqueAccumulator(std::move(object.m_torqueAccumulator)), m_torqueAccumulator(std::move(object.m_torqueAccumulator)),
m_body(object.m_body), m_body(object.m_body),
m_geom(std::move(object.m_geom)),
m_world(object.m_world), m_world(object.m_world),
m_gravityFactor(object.m_gravityFactor), m_gravityFactor(object.m_gravityFactor),
m_mass(object.m_mass) m_mass(object.m_mass)

View File

@ -41,7 +41,7 @@ bool NzRenderWindow::CopyToImage(NzAbstractImage* image, const NzVector3ui& dstP
} }
#endif #endif
return CopyToImage(image, NzRectui(NzVector2ui(0U), GetSize())); return CopyToImage(image, NzRectui(NzVector2ui(0U), GetSize()), dstPos);
} }
bool NzRenderWindow::CopyToImage(NzAbstractImage* image, const NzRectui& rect, const NzVector3ui& dstPos) const bool NzRenderWindow::CopyToImage(NzAbstractImage* image, const NzRectui& rect, const NzVector3ui& dstPos) const

View File

@ -104,12 +104,12 @@ bool NzOBJParser::Parse()
std::unordered_map<NzString, std::unordered_map<NzString, MatPair>> meshes; std::unordered_map<NzString, std::unordered_map<NzString, MatPair>> meshes;
unsigned int matIndex = 0; unsigned int matIndex = 0;
auto GetMaterial = [&meshes, &matIndex] (const NzString& meshName, const NzString& matName) -> FaceVec* auto GetMaterial = [&meshes, &matIndex] (const NzString& mesh, const NzString& material) -> FaceVec*
{ {
auto& map = meshes[meshName]; auto& map = meshes[mesh];
auto it = map.find(matName); auto it = map.find(material);
if (it == map.end()) if (it == map.end())
it = map.insert(std::make_pair(matName, MatPair(FaceVec(), matIndex++))).first; it = map.insert(std::make_pair(material, MatPair(FaceVec(), matIndex++))).first;
return &(it->second.first); return &(it->second.first);
}; };