Various little fixes (#118)

* Add missing override qualifier

* Mostly shadowing, virtual destructor and other little things
This commit is contained in:
Gawaboumga 2017-02-19 23:15:13 +01:00 committed by Jérôme Leclercq
parent ee9712fdcd
commit c2e4ccaf72
38 changed files with 94 additions and 92 deletions

View File

@ -10,8 +10,8 @@ namespace Ndk
{ {
inline BaseWidget::BaseWidget() : inline BaseWidget::BaseWidget() :
m_canvasIndex(InvalidCanvasIndex), m_canvasIndex(InvalidCanvasIndex),
m_backgroundColor(Nz::Color(230, 230, 230, 255)),
m_canvas(nullptr), m_canvas(nullptr),
m_backgroundColor(Nz::Color(230, 230, 230, 255)),
m_cursor(Nz::SystemCursor_Default), m_cursor(Nz::SystemCursor_Default),
m_contentSize(50.f, 50.f), m_contentSize(50.f, 50.f),
m_widgetParent(nullptr), m_widgetParent(nullptr),

View File

@ -39,6 +39,7 @@ namespace Ndk
inline CameraComponent::CameraComponent(const CameraComponent& camera) : inline CameraComponent::CameraComponent(const CameraComponent& camera) :
Component(camera), Component(camera),
AbstractViewer(camera), AbstractViewer(camera),
HandledObject(camera),
m_visibilityHash(camera.m_visibilityHash), m_visibilityHash(camera.m_visibilityHash),
m_projectionType(camera.m_projectionType), m_projectionType(camera.m_projectionType),
m_targetRegion(camera.m_targetRegion), m_targetRegion(camera.m_targetRegion),

View File

@ -27,7 +27,7 @@ namespace Ndk
//virtual ButtonWidget* Clone() const = 0; //virtual ButtonWidget* Clone() const = 0;
void ResizeToContent(); void ResizeToContent() override;
inline void UpdateText(const Nz::AbstractTextDrawer& drawer); inline void UpdateText(const Nz::AbstractTextDrawer& drawer);

View File

@ -96,23 +96,23 @@ namespace Ndk
entity.BindMethod("AddComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int entity.BindMethod("AddComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int
{ {
LuaBinding::ComponentBinding* binding = m_binding.QueryComponentIndex(instance); LuaBinding::ComponentBinding* bindingComponent = m_binding.QueryComponentIndex(instance);
return binding->adder(instance, handle); return bindingComponent->adder(instance, handle);
}); });
entity.BindMethod("GetComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int entity.BindMethod("GetComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int
{ {
LuaBinding::ComponentBinding* binding = m_binding.QueryComponentIndex(instance); LuaBinding::ComponentBinding* bindingComponent = m_binding.QueryComponentIndex(instance);
return binding->getter(instance, handle->GetComponent(binding->index)); return bindingComponent->getter(instance, handle->GetComponent(bindingComponent->index));
}); });
entity.BindMethod("RemoveComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int entity.BindMethod("RemoveComponent", [this] (Nz::LuaInstance& instance, EntityHandle& handle, std::size_t /*argumentCount*/) -> int
{ {
LuaBinding::ComponentBinding* binding = m_binding.QueryComponentIndex(instance); LuaBinding::ComponentBinding* bindingComponent = m_binding.QueryComponentIndex(instance);
handle->RemoveComponent(binding->index); handle->RemoveComponent(bindingComponent->index);
return 0; return 0;
}); });
} }

View File

@ -43,27 +43,27 @@ namespace Nz
bool Create(SoundStream* soundStream); bool Create(SoundStream* soundStream);
void Destroy(); void Destroy();
void EnableLooping(bool loop); void EnableLooping(bool loop) override;
UInt32 GetDuration() const; UInt32 GetDuration() const override;
AudioFormat GetFormat() const; AudioFormat GetFormat() const;
UInt32 GetPlayingOffset() const; UInt32 GetPlayingOffset() const override;
UInt64 GetSampleCount() const; UInt64 GetSampleCount() const;
UInt32 GetSampleRate() const; UInt32 GetSampleRate() const;
SoundStatus GetStatus() const; SoundStatus GetStatus() const override;
bool IsLooping() const; bool IsLooping() const override;
bool OpenFromFile(const String& filePath, const MusicParams& params = MusicParams()); bool OpenFromFile(const String& filePath, const MusicParams& params = MusicParams());
bool OpenFromMemory(const void* data, std::size_t size, const MusicParams& params = MusicParams()); bool OpenFromMemory(const void* data, std::size_t size, const MusicParams& params = MusicParams());
bool OpenFromStream(Stream& stream, const MusicParams& params = MusicParams()); bool OpenFromStream(Stream& stream, const MusicParams& params = MusicParams());
void Pause(); void Pause() override;
void Play(); void Play() override;
void SetPlayingOffset(UInt32 offset); void SetPlayingOffset(UInt32 offset);
void Stop(); void Stop() override;
Music& operator=(const Music&) = delete; Music& operator=(const Music&) = delete;
Music& operator=(Music&&) = delete; ///TODO Music& operator=(Music&&) = delete; ///TODO

View File

@ -23,14 +23,14 @@ namespace Nz
Sound(Sound&&) = default; Sound(Sound&&) = default;
~Sound(); ~Sound();
void EnableLooping(bool loop); void EnableLooping(bool loop) override;
const SoundBuffer* GetBuffer() const; const SoundBuffer* GetBuffer() const;
UInt32 GetDuration() const; UInt32 GetDuration() const override;
UInt32 GetPlayingOffset() const; UInt32 GetPlayingOffset() const override;
SoundStatus GetStatus() const; SoundStatus GetStatus() const override;
bool IsLooping() const; bool IsLooping() const override;
bool IsPlayable() const; bool IsPlayable() const;
bool IsPlaying() const; bool IsPlaying() const;
@ -38,13 +38,13 @@ namespace Nz
bool LoadFromMemory(const void* data, std::size_t size, const SoundBufferParams& params = SoundBufferParams()); bool LoadFromMemory(const void* data, std::size_t size, const SoundBufferParams& params = SoundBufferParams());
bool LoadFromStream(Stream& stream, const SoundBufferParams& params = SoundBufferParams()); bool LoadFromStream(Stream& stream, const SoundBufferParams& params = SoundBufferParams());
void Pause(); void Pause() override;
void Play(); void Play() override;
void SetBuffer(const SoundBuffer* buffer); void SetBuffer(const SoundBuffer* buffer);
void SetPlayingOffset(UInt32 offset); void SetPlayingOffset(UInt32 offset);
void Stop(); void Stop() override;
Sound& operator=(const Sound&) = delete; ///TODO? Sound& operator=(const Sound&) = delete; ///TODO?
Sound& operator=(Sound&&) = default; Sound& operator=(Sound&&) = default;

View File

@ -24,7 +24,7 @@ namespace Nz
ByteStream(const void* ptr, Nz::UInt64 size); ByteStream(const void* ptr, Nz::UInt64 size);
ByteStream(const ByteStream&) = delete; ByteStream(const ByteStream&) = delete;
inline ByteStream(ByteStream&& stream); inline ByteStream(ByteStream&& stream);
~ByteStream(); virtual ~ByteStream();
inline Endianness GetDataEndianness() const; inline Endianness GetDataEndianness() const;
inline Nz::UInt64 GetSize() const; inline Nz::UInt64 GetSize() const;

View File

@ -25,7 +25,7 @@ namespace Nz
{ {
FunctorWithoutArgs(F func); FunctorWithoutArgs(F func);
void Run(); void Run() override;
private: private:
F m_func; F m_func;
@ -36,7 +36,7 @@ namespace Nz
{ {
FunctorWithArgs(F func, Args&&... args); FunctorWithArgs(F func, Args&&... args);
void Run(); void Run() override;
private: private:
F m_func; F m_func;
@ -48,7 +48,7 @@ namespace Nz
{ {
MemberWithoutArgs(void (C::*func)(), C* object); MemberWithoutArgs(void (C::*func)(), C* object);
void Run(); void Run() override;
private: private:
void (C::*m_func)(); void (C::*m_func)();

View File

@ -26,9 +26,9 @@ namespace Nz
ColorBackground(const ColorBackground&) = default; ColorBackground(const ColorBackground&) = default;
ColorBackground(ColorBackground&&) = delete; ColorBackground(ColorBackground&&) = delete;
void Draw(const AbstractViewer* viewer) const; void Draw(const AbstractViewer* viewer) const override;
BackgroundType GetBackgroundType() const; BackgroundType GetBackgroundType() const override;
Color GetColor() const; Color GetColor() const;
void SetColor(const Color& color); void SetColor(const Color& color);

View File

@ -29,8 +29,8 @@ namespace Nz
float GetBrightThreshold() const; float GetBrightThreshold() const;
Texture* GetTexture(unsigned int i) const; Texture* GetTexture(unsigned int i) const;
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
bool Resize(const Vector2ui& dimensions); bool Resize(const Vector2ui& dimensions) override;
void SetBlurPassCount(unsigned int passCount); void SetBlurPassCount(unsigned int passCount);
void SetBrightLuminance(float luminance); void SetBrightLuminance(float luminance);

View File

@ -23,8 +23,8 @@ namespace Nz
DeferredDOFPass(); DeferredDOFPass();
virtual ~DeferredDOFPass(); virtual ~DeferredDOFPass();
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
bool Resize(const Vector2ui& dimensions); bool Resize(const Vector2ui& dimensions) override;
protected: protected:
RenderTexture m_dofRTT; RenderTexture m_dofRTT;

View File

@ -21,7 +21,7 @@ namespace Nz
DeferredFXAAPass(); DeferredFXAAPass();
virtual ~DeferredFXAAPass(); virtual ~DeferredFXAAPass();
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
protected: protected:
RenderStates m_states; RenderStates m_states;

View File

@ -21,7 +21,7 @@ namespace Nz
DeferredFinalPass(); DeferredFinalPass();
virtual ~DeferredFinalPass(); virtual ~DeferredFinalPass();
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
protected: protected:
RenderStates m_states; RenderStates m_states;

View File

@ -21,7 +21,7 @@ namespace Nz
DeferredFogPass(); DeferredFogPass();
virtual ~DeferredFogPass(); virtual ~DeferredFogPass();
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
protected: protected:
RenderStates m_states; RenderStates m_states;

View File

@ -20,8 +20,8 @@ namespace Nz
DeferredForwardPass(); DeferredForwardPass();
virtual ~DeferredForwardPass(); virtual ~DeferredForwardPass();
void Initialize(DeferredRenderTechnique* technique); void Initialize(DeferredRenderTechnique* technique) override;
bool Process(const SceneData& sceneData, unsigned int workTexture, unsigned int sceneTexture) const; bool Process(const SceneData& sceneData, unsigned int workTexture, unsigned int sceneTexture) const override;
protected: protected:
const ForwardRenderTechnique* m_forwardTechnique; const ForwardRenderTechnique* m_forwardTechnique;

View File

@ -21,8 +21,8 @@ namespace Nz
DeferredGeometryPass(); DeferredGeometryPass();
virtual ~DeferredGeometryPass(); virtual ~DeferredGeometryPass();
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
bool Resize(const Vector2ui& dimensions); bool Resize(const Vector2ui& dimensions) override;
protected: protected:
struct ShaderUniforms; struct ShaderUniforms;

View File

@ -28,7 +28,7 @@ namespace Nz
bool IsLightMeshesDrawingEnabled() const; bool IsLightMeshesDrawingEnabled() const;
bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const; bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
protected: protected:
LightUniforms m_directionalLightUniforms; LightUniforms m_directionalLightUniforms;

View File

@ -24,9 +24,9 @@ namespace Nz
public: public:
TextureBackground(TextureRef texture = TextureRef()); TextureBackground(TextureRef texture = TextureRef());
void Draw(const AbstractViewer* viewer) const; void Draw(const AbstractViewer* viewer) const override;
BackgroundType GetBackgroundType() const; BackgroundType GetBackgroundType() const override;
inline const TextureRef& GetTexture() const; inline const TextureRef& GetTexture() const;
inline void SetTexture(TextureRef texture); inline void SetTexture(TextureRef texture);

View File

@ -15,7 +15,7 @@ namespace Nz
{ {
public: public:
MixerBase(); MixerBase();
~MixerBase() = default; virtual ~MixerBase() = default;
virtual float Get(float x, float y, float scale) const = 0; virtual float Get(float x, float y, float scale) const = 0;
virtual float Get(float x, float y, float z, float scale) const = 0; virtual float Get(float x, float y, float z, float scale) const = 0;

View File

@ -19,7 +19,7 @@ namespace Nz
{ {
public: public:
NoiseBase(unsigned int seed = 0); NoiseBase(unsigned int seed = 0);
~NoiseBase() = default; virtual ~NoiseBase() = default;
virtual float Get(float x, float y, float scale) const = 0; virtual float Get(float x, float y, float scale) const = 0;
virtual float Get(float x, float y, float z, float scale) const = 0; virtual float Get(float x, float y, float z, float scale) const = 0;

View File

@ -18,7 +18,7 @@ namespace Nz
UberShaderInstancePreprocessor(const Shader* shader); UberShaderInstancePreprocessor(const Shader* shader);
virtual ~UberShaderInstancePreprocessor(); virtual ~UberShaderInstancePreprocessor();
bool Activate() const; bool Activate() const override;
}; };
} }

View File

@ -29,7 +29,7 @@ namespace Nz
UberShaderPreprocessor() = default; UberShaderPreprocessor() = default;
~UberShaderPreprocessor(); ~UberShaderPreprocessor();
UberShaderInstance* Get(const ParameterList& parameters) const; UberShaderInstance* Get(const ParameterList& parameters) const override;
void SetShader(ShaderStageType stage, const String& source, const String& shaderFlags, const String& requiredFlags = String()); void SetShader(ShaderStageType stage, const String& source, const String& shaderFlags, const String& requiredFlags = String());
bool SetShaderFromFile(ShaderStageType stage, const String& filePath, const String& shaderFlags, const String& requiredFlags = String()); bool SetShaderFromFile(ShaderStageType stage, const String& filePath, const String& shaderFlags, const String& requiredFlags = String());

View File

@ -8,7 +8,8 @@
namespace Nz namespace Nz
{ {
inline EventHandler::EventHandler(const EventHandler&) inline EventHandler::EventHandler(const EventHandler& other) :
HandledObject(other)
{ {
} }

View File

@ -78,18 +78,18 @@ namespace Nz
bool FlipVertically(); bool FlipVertically();
const UInt8* GetConstPixels(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0, UInt8 level = 0) const; const UInt8* GetConstPixels(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0, UInt8 level = 0) const;
unsigned int GetDepth(UInt8 level = 0) const; unsigned int GetDepth(UInt8 level = 0) const override;
PixelFormatType GetFormat() const; PixelFormatType GetFormat() const override;
unsigned int GetHeight(UInt8 level = 0) const; unsigned int GetHeight(UInt8 level = 0) const override;
UInt8 GetLevelCount() const; UInt8 GetLevelCount() const override;
UInt8 GetMaxLevel() const; UInt8 GetMaxLevel() const override;
std::size_t GetMemoryUsage() const; std::size_t GetMemoryUsage() const override;
std::size_t GetMemoryUsage(UInt8 level) const; std::size_t GetMemoryUsage(UInt8 level) const override;
Color GetPixelColor(unsigned int x, unsigned int y = 0, unsigned int z = 0) const; Color GetPixelColor(unsigned int x, unsigned int y = 0, unsigned int z = 0) const;
UInt8* GetPixels(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0, UInt8 level = 0); UInt8* GetPixels(unsigned int x = 0, unsigned int y = 0, unsigned int z = 0, UInt8 level = 0);
Vector3ui GetSize(UInt8 level = 0) const; Vector3ui GetSize(UInt8 level = 0) const override;
ImageType GetType() const; ImageType GetType() const override;
unsigned int GetWidth(UInt8 level = 0) const; unsigned int GetWidth(UInt8 level = 0) const override;
bool HasAlpha() const; bool HasAlpha() const;
@ -126,9 +126,9 @@ namespace Nz
void SetLevelCount(UInt8 levelCount); void SetLevelCount(UInt8 levelCount);
bool SetPixelColor(const Color& color, unsigned int x, unsigned int y = 0, unsigned int z = 0); bool SetPixelColor(const Color& color, unsigned int x, unsigned int y = 0, unsigned int z = 0);
bool Update(const UInt8* pixels, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0); bool Update(const UInt8* pixels, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0) override;
bool Update(const UInt8* pixels, const Boxui& box, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0); bool Update(const UInt8* pixels, const Boxui& box, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0) override;
bool Update(const UInt8* pixels, const Rectui& rect, unsigned int z = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0); bool Update(const UInt8* pixels, const Rectui& rect, unsigned int z = 0, unsigned int srcWidth = 0, unsigned int srcHeight = 0, UInt8 level = 0) override;
Image& operator=(const Image& image); Image& operator=(const Image& image);

View File

@ -35,7 +35,7 @@ namespace Nz
void SetName(const String& name); void SetName(const String& name);
private: private:
void InvalidateNode(); void InvalidateNode() override;
void UpdateSkinningMatrix() const; void UpdateSkinningMatrix() const;
Matrix4f m_inverseBindMatrix; Matrix4f m_inverseBindMatrix;

View File

@ -29,13 +29,13 @@ namespace Nz
void Destroy(); void Destroy();
const Boxf& GetAABB() const override; const Boxf& GetAABB() const override;
AnimationType GetAnimationType() const final; AnimationType GetAnimationType() const final override;
const IndexBuffer* GetIndexBuffer() const override; const IndexBuffer* GetIndexBuffer() const override;
VertexBuffer* GetVertexBuffer(); VertexBuffer* GetVertexBuffer();
const VertexBuffer* GetVertexBuffer() const; const VertexBuffer* GetVertexBuffer() const;
unsigned int GetVertexCount() const override; unsigned int GetVertexCount() const override;
bool IsAnimated() const final; bool IsAnimated() const final override;
bool IsValid() const; bool IsValid() const;
void SetAABB(const Boxf& aabb); void SetAABB(const Boxf& aabb);

View File

@ -32,13 +32,13 @@ namespace Nz
bool GenerateAABB(); bool GenerateAABB();
const Boxf& GetAABB() const override; const Boxf& GetAABB() const override;
AnimationType GetAnimationType() const final; AnimationType GetAnimationType() const final override;
const IndexBuffer* GetIndexBuffer() const override; const IndexBuffer* GetIndexBuffer() const override;
VertexBuffer* GetVertexBuffer(); VertexBuffer* GetVertexBuffer();
const VertexBuffer* GetVertexBuffer() const; const VertexBuffer* GetVertexBuffer() const;
unsigned int GetVertexCount() const override; unsigned int GetVertexCount() const override;
bool IsAnimated() const final; bool IsAnimated() const final override;
bool IsValid() const; bool IsValid() const;
void SetAABB(const Boxf& aabb); void SetAABB(const Boxf& aabb);

View File

@ -141,12 +141,12 @@ bool Load(Mesh* mesh, Stream& stream, const MeshParams& parameters)
{ {
for (unsigned int i = 0; i < scene->mNumMeshes; ++i) for (unsigned int i = 0; i < scene->mNumMeshes; ++i)
{ {
aiMesh* mesh = scene->mMeshes[i]; aiMesh* currentMesh = scene->mMeshes[i];
if (mesh->HasBones()) // Inline functions can be safely called if (currentMesh->HasBones()) // Inline functions can be safely called
{ {
animatedMesh = true; animatedMesh = true;
for (unsigned int j = 0; j < mesh->mNumBones; ++j) for (unsigned int j = 0; j < currentMesh->mNumBones; ++j)
joints.insert(mesh->mBones[j]->mName.C_Str()); joints.insert(currentMesh->mBones[j]->mName.C_Str());
} }
} }
} }

View File

@ -312,9 +312,9 @@ namespace Nz
while (!remainingRects.empty()) while (!remainingRects.empty())
{ {
// Stores the penalty score of the best rectangle placement - bigger=worse, smaller=better. // Stores the penalty score of the best rectangle placement - bigger=worse, smaller=better.
bool bestFlipped; bool bestFlipped = false;
std::size_t bestFreeRect; std::size_t bestFreeRect = m_freeRectangles.size();
std::size_t bestRect; std::size_t bestRect = std::numeric_limits<int>::min();
int bestScore = std::numeric_limits<int>::max(); int bestScore = std::numeric_limits<int>::max();
for (std::size_t i = 0; i < m_freeRectangles.size(); ++i) for (std::size_t i = 0; i < m_freeRectangles.size(); ++i)

View File

@ -413,9 +413,9 @@ namespace Nz
while (ptr != &s_list) while (ptr != &s_list)
{ {
if (ptr->file) if (ptr->file)
std::fprintf(log, "-0x%p -> %zu bytes allocated at %s:%u\n", reinterpret_cast<UInt8*>(ptr) + sizeof(Block), ptr->size, ptr->file, ptr->line); std::fprintf(log, "-0x%s -> %zu bytes allocated at %s:%u\n", reinterpret_cast<UInt8*>(ptr) + sizeof(Block), ptr->size, ptr->file, ptr->line);
else else
std::fprintf(log, "-0x%p -> %zu bytes allocated at unknown position\n", reinterpret_cast<UInt8*>(ptr) + sizeof(Block), ptr->size); std::fprintf(log, "-0x%s -> %zu bytes allocated at unknown position\n", reinterpret_cast<UInt8*>(ptr) + sizeof(Block), ptr->size);
void* pointer = ptr; void* pointer = ptr;
ptr = ptr->next; ptr = ptr->next;

View File

@ -39,9 +39,9 @@ namespace Nz
*/ */
ParticleGroup::ParticleGroup(unsigned int maxParticleCount, ParticleDeclarationConstRef declaration) : ParticleGroup::ParticleGroup(unsigned int maxParticleCount, ParticleDeclarationConstRef declaration) :
m_declaration(std::move(declaration)),
m_maxParticleCount(maxParticleCount), m_maxParticleCount(maxParticleCount),
m_particleCount(0), m_particleCount(0),
m_declaration(std::move(declaration)),
m_processing(false) m_processing(false)
{ {
// In case of error, the constructor can only throw an exception // In case of error, the constructor can only throw an exception
@ -60,13 +60,13 @@ namespace Nz
ParticleGroup::ParticleGroup(const ParticleGroup& system) : ParticleGroup::ParticleGroup(const ParticleGroup& system) :
Renderable(system), Renderable(system),
m_maxParticleCount(system.m_maxParticleCount),
m_particleCount(system.m_particleCount),
m_particleSize(system.m_particleSize),
m_controllers(system.m_controllers), m_controllers(system.m_controllers),
m_generators(system.m_generators), m_generators(system.m_generators),
m_declaration(system.m_declaration), m_declaration(system.m_declaration),
m_renderer(system.m_renderer), m_renderer(system.m_renderer),
m_maxParticleCount(system.m_maxParticleCount),
m_particleCount(system.m_particleCount),
m_particleSize(system.m_particleSize),
m_processing(false) m_processing(false)
{ {
ErrorFlags flags(ErrorFlag_ThrowException, true); ErrorFlags flags(ErrorFlag_ThrowException, true);

View File

@ -129,7 +129,7 @@ namespace Nz
if (s_useAnisotropicFilter) if (s_useAnisotropicFilter)
{ {
for (const std::pair<UInt32, GLuint>& pair : s_samplers) for (const std::pair<const UInt32, GLuint>& pair : s_samplers)
{ {
if (((pair.first >> 5) & 0xFF) == 0) if (((pair.first >> 5) & 0xFF) == 0)
glSamplerParameterf(pair.second, GL_TEXTURE_MAX_ANISOTROPY_EXT, static_cast<float>(anisotropyLevel)); glSamplerParameterf(pair.second, GL_TEXTURE_MAX_ANISOTROPY_EXT, static_cast<float>(anisotropyLevel));
@ -149,7 +149,7 @@ namespace Nz
s_defaultFilterMode = filterMode; s_defaultFilterMode = filterMode;
for (const std::pair<UInt32, GLuint>& pair : s_samplers) for (const std::pair<const UInt32, GLuint>& pair : s_samplers)
{ {
if (((pair.first >> 1) & 0x3) == SamplerFilter_Default) if (((pair.first >> 1) & 0x3) == SamplerFilter_Default)
{ {
@ -204,7 +204,7 @@ namespace Nz
s_defaultWrapMode = wrapMode; s_defaultWrapMode = wrapMode;
GLenum wrapEnum = OpenGL::SamplerWrapMode[wrapMode]; GLenum wrapEnum = OpenGL::SamplerWrapMode[wrapMode];
for (const std::pair<UInt32, GLuint>& pair : s_samplers) for (const std::pair<const UInt32, GLuint>& pair : s_samplers)
{ {
if (((pair.first >> 3) & 0x3) == SamplerWrap_Default) if (((pair.first >> 3) & 0x3) == SamplerWrap_Default)
{ {
@ -380,7 +380,7 @@ namespace Nz
if (!s_samplers.empty()) if (!s_samplers.empty())
{ {
Context::EnsureContext(); Context::EnsureContext();
for (const std::pair<UInt32, GLuint>& pair : s_samplers) for (const std::pair<const UInt32, GLuint>& pair : s_samplers)
OpenGL::DeleteSampler(pair.second); OpenGL::DeleteSampler(pair.second);
s_samplers.clear(); s_samplers.clear();

View File

@ -369,7 +369,7 @@ namespace Nz
if (!m_glyphs.empty()) if (!m_glyphs.empty())
{ {
Glyph& lastGlyph = m_glyphs.back(); Glyph& lastGlyph = m_glyphs.back();
m_lines.back().bounds.ExtendTo(glyph.bounds); m_lines.back().bounds.ExtendTo(lastGlyph.bounds);
} }
// Reset cursor // Reset cursor

View File

@ -53,9 +53,9 @@ void EventState::AddEvent(const Nz::WindowEvent& event)
m_events.push_back(Nz::String::Number(m_count) + " - " + ToString(event)); m_events.push_back(Nz::String::Number(m_count) + " - " + ToString(event));
Nz::String content; Nz::String content;
for (auto&& event : m_events) for (auto&& currentEvent : m_events)
{ {
content += event + "\n"; content += currentEvent + "\n";
} }
content += "\nM for Menu"; content += "\nM for Menu";
m_text.SetContent(content, 36); m_text.SetContent(content, 36);

View File

@ -46,7 +46,7 @@ void KeyState::DrawMenu()
m_text.SetContent("Clic on a key, this text should change !\nN for alternating event\nM for Menu"); m_text.SetContent("Clic on a key, this text should change !\nN for alternating event\nM for Menu");
} }
void KeyState::ManageInput(KeyStatus isKeyPressed, const Nz::WindowEvent::KeyEvent& key, Ndk::StateMachine& fsm) void KeyState::ManageInput(KeyStatus /*isKeyPressed*/, const Nz::WindowEvent::KeyEvent& key, Ndk::StateMachine& fsm)
{ {
if (key.code == Nz::Keyboard::Key::M && key.shift) if (key.code == Nz::Keyboard::Key::M && key.shift)
fsm.ChangeState(StateFactory::Get(EventStatus::Menu)); fsm.ChangeState(StateFactory::Get(EventStatus::Menu));

View File

@ -58,7 +58,7 @@ void MouseClickState::DrawMenu()
m_text.SetContent("Click in the windows, this text should change !\nM for Menu"); m_text.SetContent("Click in the windows, this text should change !\nM for Menu");
} }
void MouseClickState::ManageInput(MouseStatus mouseStatus, const Nz::WindowEvent::MouseButtonEvent& mouse, Ndk::StateMachine& fsm) void MouseClickState::ManageInput(MouseStatus mouseStatus, const Nz::WindowEvent::MouseButtonEvent& mouse, Ndk::StateMachine& /*fsm*/)
{ {
Nz::String content; Nz::String content;
if (mouseStatus == MouseStatus::Pressed) if (mouseStatus == MouseStatus::Pressed)

View File

@ -11,7 +11,7 @@ Text::Text(StateContext& stateContext) :
m_context(stateContext) m_context(stateContext)
{ {
m_text = m_context.world.CreateEntity(); m_text = m_context.world.CreateEntity();
Ndk::NodeComponent& nodeComponent = m_text->AddComponent<Ndk::NodeComponent>(); m_text->AddComponent<Ndk::NodeComponent>();
Ndk::GraphicsComponent& graphicsComponent = m_text->AddComponent<Ndk::GraphicsComponent>(); Ndk::GraphicsComponent& graphicsComponent = m_text->AddComponent<Ndk::GraphicsComponent>();
m_textSprite = Nz::TextSprite::New(); m_textSprite = Nz::TextSprite::New();

View File

@ -16,8 +16,8 @@ SCENARIO("EntityList", "[NDK][ENTITYLIST]")
THEN("These results are expected") THEN("These results are expected")
{ {
REQUIRE(entityList.Has(entity->GetId())); REQUIRE(entityList.Has(entity->GetId()));
const Ndk::EntityHandle& entity = world.CreateEntity(); const Ndk::EntityHandle& newEntity = world.CreateEntity();
REQUIRE(!entityList.Has(entity->GetId())); REQUIRE(!entityList.Has(newEntity->GetId()));
} }
} }