Fix a lot of warnings and some errors
This commit is contained in:
parent
267bd74a97
commit
65337c6a38
|
|
@ -17,6 +17,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractLogger() = default;
|
AbstractLogger() = default;
|
||||||
|
AbstractLogger(const AbstractLogger&) = default;
|
||||||
|
AbstractLogger(AbstractLogger&&) noexcept = default;
|
||||||
virtual ~AbstractLogger();
|
virtual ~AbstractLogger();
|
||||||
|
|
||||||
virtual void EnableStdReplication(bool enable) = 0;
|
virtual void EnableStdReplication(bool enable) = 0;
|
||||||
|
|
@ -25,6 +27,9 @@ namespace Nz
|
||||||
|
|
||||||
virtual void Write(const std::string_view& string) = 0;
|
virtual void Write(const std::string_view& string) = 0;
|
||||||
virtual void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr);
|
virtual void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr);
|
||||||
|
|
||||||
|
AbstractLogger& operator=(const AbstractLogger&) = default;
|
||||||
|
AbstractLogger& operator=(AbstractLogger&&) noexcept = default;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileLogger(std::filesystem::path logPath = "NazaraLog.log");
|
FileLogger(std::filesystem::path logPath = "NazaraLog.log");
|
||||||
FileLogger(const FileLogger&) = default;
|
FileLogger(const FileLogger&) = delete;
|
||||||
FileLogger(FileLogger&&) = default;
|
FileLogger(FileLogger&&) noexcept = default;
|
||||||
~FileLogger();
|
~FileLogger();
|
||||||
|
|
||||||
void EnableTimeLogging(bool enable);
|
void EnableTimeLogging(bool enable);
|
||||||
|
|
@ -32,8 +32,8 @@ namespace Nz
|
||||||
void Write(const std::string_view& string) override;
|
void Write(const std::string_view& string) override;
|
||||||
void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
void WriteError(ErrorType type, const std::string_view& error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr) override;
|
||||||
|
|
||||||
FileLogger& operator=(const FileLogger&) = default;
|
FileLogger& operator=(const FileLogger&) = delete;
|
||||||
FileLogger& operator=(FileLogger&&) = default;
|
FileLogger& operator=(FileLogger&&) noexcept = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::fstream m_outputFile;
|
std::fstream m_outputFile;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Nz
|
||||||
inline OpenGLCommandBuffer();
|
inline OpenGLCommandBuffer();
|
||||||
inline OpenGLCommandBuffer(OpenGLCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex);
|
inline OpenGLCommandBuffer(OpenGLCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex);
|
||||||
OpenGLCommandBuffer(const OpenGLCommandBuffer&) = delete;
|
OpenGLCommandBuffer(const OpenGLCommandBuffer&) = delete;
|
||||||
OpenGLCommandBuffer(OpenGLCommandBuffer&&) noexcept = default;
|
OpenGLCommandBuffer(OpenGLCommandBuffer&&) = delete;
|
||||||
~OpenGLCommandBuffer() = default;
|
~OpenGLCommandBuffer() = default;
|
||||||
|
|
||||||
inline void BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color);
|
inline void BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color);
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline OpenGLShaderBinding(OpenGLRenderPipelineLayout& owner, std::size_t poolIndex, std::size_t bindingIndex);
|
inline OpenGLShaderBinding(OpenGLRenderPipelineLayout& owner, std::size_t poolIndex, std::size_t bindingIndex);
|
||||||
OpenGLShaderBinding(const OpenGLShaderBinding&) = default;
|
OpenGLShaderBinding(const OpenGLShaderBinding&) = delete;
|
||||||
OpenGLShaderBinding(OpenGLShaderBinding&&) = default;
|
OpenGLShaderBinding(OpenGLShaderBinding&&) = delete;
|
||||||
~OpenGLShaderBinding() = default;
|
~OpenGLShaderBinding() = default;
|
||||||
|
|
||||||
void Apply(const GL::Context& context) const;
|
void Apply(const GL::Context& context) const;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenGLTexture(OpenGLDevice& device, const TextureInfo& params);
|
OpenGLTexture(OpenGLDevice& device, const TextureInfo& params);
|
||||||
OpenGLTexture(const OpenGLTexture&) = default;
|
OpenGLTexture(const OpenGLTexture&) = delete;
|
||||||
OpenGLTexture(OpenGLTexture&&) noexcept = default;
|
OpenGLTexture(OpenGLTexture&&) = delete;
|
||||||
~OpenGLTexture() = default;
|
~OpenGLTexture() = default;
|
||||||
|
|
||||||
PixelFormat GetFormat() const override;
|
PixelFormat GetFormat() const override;
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OpenGLTextureSampler(OpenGLDevice& device, const TextureSamplerInfo& samplerInfo);
|
OpenGLTextureSampler(OpenGLDevice& device, const TextureSamplerInfo& samplerInfo);
|
||||||
OpenGLTextureSampler(const OpenGLTextureSampler&) = default;
|
OpenGLTextureSampler(const OpenGLTextureSampler&) = delete;
|
||||||
OpenGLTextureSampler(OpenGLTextureSampler&&) noexcept = default;
|
OpenGLTextureSampler(OpenGLTextureSampler&&) = delete;
|
||||||
~OpenGLTextureSampler() = default;
|
~OpenGLTextureSampler() = default;
|
||||||
|
|
||||||
inline const GL::Sampler& GetSampler(bool mipmaps) const;
|
inline const GL::Sampler& GetSampler(bool mipmaps) const;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Nz
|
||||||
void Activate() const override;
|
void Activate() const override;
|
||||||
|
|
||||||
OpenGLWindowFramebuffer& operator=(const OpenGLWindowFramebuffer&) = delete;
|
OpenGLWindowFramebuffer& operator=(const OpenGLWindowFramebuffer&) = delete;
|
||||||
OpenGLWindowFramebuffer& operator=(OpenGLWindowFramebuffer&&) noexcept = default;
|
OpenGLWindowFramebuffer& operator=(OpenGLWindowFramebuffer&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OpenGLRenderWindow& m_renderWindow;
|
OpenGLRenderWindow& m_renderWindow;
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,14 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ShaderAstCloner() = default;
|
ShaderAstCloner() = default;
|
||||||
ShaderAstCloner(const ShaderAstCloner&) = default;
|
ShaderAstCloner(const ShaderAstCloner&) = delete;
|
||||||
ShaderAstCloner(ShaderAstCloner&&) = default;
|
ShaderAstCloner(ShaderAstCloner&&) = delete;
|
||||||
~ShaderAstCloner() = default;
|
~ShaderAstCloner() = default;
|
||||||
|
|
||||||
ShaderNodes::StatementPtr Clone(const ShaderNodes::StatementPtr& statement);
|
ShaderNodes::StatementPtr Clone(const ShaderNodes::StatementPtr& statement);
|
||||||
|
|
||||||
ShaderAstCloner& operator=(const ShaderAstCloner&) = default;
|
ShaderAstCloner& operator=(const ShaderAstCloner&) = delete;
|
||||||
ShaderAstCloner& operator=(ShaderAstCloner&&) = default;
|
ShaderAstCloner& operator=(ShaderAstCloner&&) = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ShaderNodes::ExpressionPtr CloneExpression(const ShaderNodes::ExpressionPtr& expr);
|
ShaderNodes::ExpressionPtr CloneExpression(const ShaderNodes::ExpressionPtr& expr);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,9 @@ namespace Nz
|
||||||
virtual void Visit(ShaderNodes::StatementBlock& node) = 0;
|
virtual void Visit(ShaderNodes::StatementBlock& node) = 0;
|
||||||
virtual void Visit(ShaderNodes::SwizzleOp& node) = 0;
|
virtual void Visit(ShaderNodes::SwizzleOp& node) = 0;
|
||||||
|
|
||||||
|
ShaderAstVisitor& operator=(const ShaderAstVisitor&) = delete;
|
||||||
|
ShaderAstVisitor& operator=(ShaderAstVisitor&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unordered_set<std::string> m_conditions;
|
std::unordered_set<std::string> m_conditions;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ namespace Nz
|
||||||
virtual void Visit(ShaderNodes::OutputVariable& var) = 0;
|
virtual void Visit(ShaderNodes::OutputVariable& var) = 0;
|
||||||
virtual void Visit(ShaderNodes::ParameterVariable& var) = 0;
|
virtual void Visit(ShaderNodes::ParameterVariable& var) = 0;
|
||||||
virtual void Visit(ShaderNodes::UniformVariable& var) = 0;
|
virtual void Visit(ShaderNodes::UniformVariable& var) = 0;
|
||||||
|
|
||||||
|
ShaderVarVisitor& operator=(const ShaderVarVisitor&) = delete;
|
||||||
|
ShaderVarVisitor& operator=(ShaderVarVisitor&&) = delete;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ namespace Nz
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BlockRef(const BlockRef&) = default;
|
BlockRef(const BlockRef&) = default;
|
||||||
BlockRef(BlockRef&&) = default;
|
BlockRef(BlockRef&&) = delete;
|
||||||
~BlockRef() = default;
|
~BlockRef() = default;
|
||||||
|
|
||||||
inline float GetCharacterSpacingOffset() const;
|
inline float GetCharacterSpacingOffset() const;
|
||||||
|
|
@ -196,8 +196,8 @@ namespace Nz
|
||||||
inline void SetStyle(TextStyleFlags style);
|
inline void SetStyle(TextStyleFlags style);
|
||||||
inline void SetText(std::string text);
|
inline void SetText(std::string text);
|
||||||
|
|
||||||
BlockRef& operator=(const BlockRef&) = default;
|
BlockRef& operator=(const BlockRef&) = delete;
|
||||||
BlockRef& operator=(BlockRef&&) = default;
|
BlockRef& operator=(BlockRef&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline BlockRef(RichTextDrawer& drawer, std::size_t index);
|
inline BlockRef(RichTextDrawer& drawer, std::size_t index);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
inline VulkanCommandBuffer(VulkanCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex, Vk::AutoCommandBuffer commandBuffer);
|
inline VulkanCommandBuffer(VulkanCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex, Vk::AutoCommandBuffer commandBuffer);
|
||||||
inline VulkanCommandBuffer(VulkanCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex, std::vector<Vk::AutoCommandBuffer> commandBuffers);
|
inline VulkanCommandBuffer(VulkanCommandPool& owner, std::size_t poolIndex, std::size_t bindingIndex, std::vector<Vk::AutoCommandBuffer> commandBuffers);
|
||||||
VulkanCommandBuffer(const VulkanCommandBuffer&) = delete;
|
VulkanCommandBuffer(const VulkanCommandBuffer&) = delete;
|
||||||
VulkanCommandBuffer(VulkanCommandBuffer&&) noexcept = default;
|
VulkanCommandBuffer(VulkanCommandBuffer&&) = delete;
|
||||||
~VulkanCommandBuffer() = default;
|
~VulkanCommandBuffer() = default;
|
||||||
|
|
||||||
inline std::size_t GetBindingIndex() const;
|
inline std::size_t GetBindingIndex() const;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ namespace Nz
|
||||||
std::vector<Vk::PhysicalDevice> m_physDevices;
|
std::vector<Vk::PhysicalDevice> m_physDevices;
|
||||||
ParameterList m_initializationParameters;
|
ParameterList m_initializationParameters;
|
||||||
Vk::Instance m_instance;
|
Vk::Instance m_instance;
|
||||||
UInt32 m_apiVersion;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline VulkanShaderBinding(VulkanRenderPipelineLayout& owner, std::size_t poolIndex, std::size_t bindingIndex, Vk::DescriptorSet descriptorSet);
|
inline VulkanShaderBinding(VulkanRenderPipelineLayout& owner, std::size_t poolIndex, std::size_t bindingIndex, Vk::DescriptorSet descriptorSet);
|
||||||
VulkanShaderBinding(const VulkanShaderBinding&) = default;
|
VulkanShaderBinding(const VulkanShaderBinding&) = delete;
|
||||||
VulkanShaderBinding(VulkanShaderBinding&&) noexcept = default;
|
VulkanShaderBinding(VulkanShaderBinding&&) = delete;
|
||||||
~VulkanShaderBinding() = default;
|
~VulkanShaderBinding() = default;
|
||||||
|
|
||||||
inline std::size_t GetBindingIndex() const;
|
inline std::size_t GetBindingIndex() const;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
VulkanShaderStage() = default;
|
VulkanShaderStage() = default;
|
||||||
VulkanShaderStage(const VulkanShaderStage&) = delete;
|
VulkanShaderStage(const VulkanShaderStage&) = delete;
|
||||||
VulkanShaderStage(VulkanShaderStage&&) noexcept = default;
|
VulkanShaderStage(VulkanShaderStage&&) = delete;
|
||||||
~VulkanShaderStage() = default;
|
~VulkanShaderStage() = default;
|
||||||
|
|
||||||
bool Create(Vk::Device& device, ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize);
|
bool Create(Vk::Device& device, ShaderStageType type, ShaderLanguage lang, const void* source, std::size_t sourceSize);
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Nz
|
||||||
inline ShaderStageType GetStageType() const;
|
inline ShaderStageType GetStageType() const;
|
||||||
|
|
||||||
VulkanShaderStage& operator=(const VulkanShaderStage&) = delete;
|
VulkanShaderStage& operator=(const VulkanShaderStage&) = delete;
|
||||||
VulkanShaderStage& operator=(VulkanShaderStage&&) noexcept = default;
|
VulkanShaderStage& operator=(VulkanShaderStage&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vk::ShaderModule m_shaderModule;
|
Vk::ShaderModule m_shaderModule;
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
inline VulkanSingleFramebuffer(Vk::Framebuffer renderPass);
|
inline VulkanSingleFramebuffer(Vk::Framebuffer renderPass);
|
||||||
VulkanSingleFramebuffer(const VulkanSingleFramebuffer&) = delete;
|
VulkanSingleFramebuffer(const VulkanSingleFramebuffer&) = delete;
|
||||||
VulkanSingleFramebuffer(VulkanSingleFramebuffer&&) noexcept = default;
|
VulkanSingleFramebuffer(VulkanSingleFramebuffer&&) = delete;
|
||||||
~VulkanSingleFramebuffer() = default;
|
~VulkanSingleFramebuffer() = default;
|
||||||
|
|
||||||
inline Vk::Framebuffer& GetFramebuffer();
|
inline Vk::Framebuffer& GetFramebuffer();
|
||||||
inline const Vk::Framebuffer& GetFramebuffer() const;
|
inline const Vk::Framebuffer& GetFramebuffer() const;
|
||||||
|
|
||||||
VulkanSingleFramebuffer& operator=(const VulkanSingleFramebuffer&) = delete;
|
VulkanSingleFramebuffer& operator=(const VulkanSingleFramebuffer&) = delete;
|
||||||
VulkanSingleFramebuffer& operator=(VulkanSingleFramebuffer&&) noexcept = default;
|
VulkanSingleFramebuffer& operator=(VulkanSingleFramebuffer&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vk::Framebuffer m_framebuffer;
|
Vk::Framebuffer m_framebuffer;
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VulkanTexture(Vk::Device& device, const TextureInfo& params);
|
VulkanTexture(Vk::Device& device, const TextureInfo& params);
|
||||||
VulkanTexture(const VulkanTexture&) = default;
|
VulkanTexture(const VulkanTexture&) = delete;
|
||||||
VulkanTexture(VulkanTexture&&) noexcept = default;
|
VulkanTexture(VulkanTexture&&) = delete;
|
||||||
~VulkanTexture();
|
~VulkanTexture();
|
||||||
|
|
||||||
PixelFormat GetFormat() const override;
|
PixelFormat GetFormat() const override;
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ namespace Nz
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VulkanTextureSampler(Vk::Device& device, TextureSamplerInfo samplerInfo);
|
VulkanTextureSampler(Vk::Device& device, TextureSamplerInfo samplerInfo);
|
||||||
VulkanTextureSampler(const VulkanTextureSampler&) = default;
|
VulkanTextureSampler(const VulkanTextureSampler&) = delete;
|
||||||
VulkanTextureSampler(VulkanTextureSampler&&) noexcept = default;
|
VulkanTextureSampler(VulkanTextureSampler&&) = delete;
|
||||||
~VulkanTextureSampler() = default;
|
~VulkanTextureSampler() = default;
|
||||||
|
|
||||||
inline VkSampler GetSampler() const;
|
inline VkSampler GetSampler() const;
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,13 @@ namespace Nz
|
||||||
{
|
{
|
||||||
if (m_device->vkSetDebugUtilsObjectNameEXT)
|
if (m_device->vkSetDebugUtilsObjectNameEXT)
|
||||||
{
|
{
|
||||||
VkDebugUtilsObjectNameInfoEXT debugName = { VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT };
|
VkDebugUtilsObjectNameInfoEXT debugName = {
|
||||||
debugName.objectType = ObjectType;
|
VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
|
||||||
debugName.pObjectName = name;
|
nullptr,
|
||||||
|
ObjectType,
|
||||||
|
0,
|
||||||
|
name
|
||||||
|
};
|
||||||
|
|
||||||
if constexpr (std::is_pointer_v<VkType>)
|
if constexpr (std::is_pointer_v<VkType>)
|
||||||
debugName.objectHandle = static_cast<UInt64>(reinterpret_cast<std::uintptr_t>(m_handle));
|
debugName.objectHandle = static_cast<UInt64>(reinterpret_cast<std::uintptr_t>(m_handle));
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ namespace Nz
|
||||||
|
|
||||||
for (Block& block : m_blocks)
|
for (Block& block : m_blocks)
|
||||||
{
|
{
|
||||||
UInt64 alignedOffset = block.freeOffset;
|
|
||||||
if (block.freeOffset + size > m_blockSize)
|
if (block.freeOffset + size > m_blockSize)
|
||||||
continue; //< Not enough space
|
continue; //< Not enough space
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler->beginFunc = [](cpArbiter* arb, cpSpace* space, void*) -> cpBool
|
handler->beginFunc = [](cpArbiter*, cpSpace*, void*) -> cpBool
|
||||||
{
|
{
|
||||||
return cpTrue;
|
return cpTrue;
|
||||||
};
|
};
|
||||||
|
|
@ -444,7 +444,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler->separateFunc = [](cpArbiter* arb, cpSpace* space, void*)
|
handler->separateFunc = [](cpArbiter*, cpSpace*, void*)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -472,7 +472,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler->preSolveFunc = [](cpArbiter* arb, cpSpace* space, void* data) -> cpBool
|
handler->preSolveFunc = [](cpArbiter*, cpSpace*, void*) -> cpBool
|
||||||
{
|
{
|
||||||
return cpTrue;
|
return cpTrue;
|
||||||
};
|
};
|
||||||
|
|
@ -498,7 +498,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handler->postSolveFunc = [](cpArbiter* arb, cpSpace* space, void* data)
|
handler->postSolveFunc = [](cpArbiter*, cpSpace*, void*)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
using CallbackType = decltype(callback);
|
using CallbackType = decltype(callback);
|
||||||
|
|
||||||
auto RealCallback = [](cpBody* body, cpArbiter* arbiter, void* data)
|
auto RealCallback = [](cpBody* /*body*/, cpArbiter* arbiter, void* data)
|
||||||
{
|
{
|
||||||
CallbackType& cb = *static_cast<CallbackType*>(data);
|
CallbackType& cb = *static_cast<CallbackType*>(data);
|
||||||
|
|
||||||
|
|
@ -399,7 +399,6 @@ namespace Nz
|
||||||
|
|
||||||
m_geom->GenerateShapes(this, &m_shapes);
|
m_geom->GenerateShapes(this, &m_shapes);
|
||||||
|
|
||||||
cpSpace* space = m_world->GetHandle();
|
|
||||||
for (cpShape* shape : m_shapes)
|
for (cpShape* shape : m_shapes)
|
||||||
cpShapeSetUserData(shape, this);
|
cpShapeSetUserData(shape, this);
|
||||||
|
|
||||||
|
|
@ -643,7 +642,6 @@ namespace Nz
|
||||||
{
|
{
|
||||||
UnregisterFromSpace();
|
UnregisterFromSpace();
|
||||||
|
|
||||||
cpSpace* space = m_world->GetHandle();
|
|
||||||
for (cpShape* shape : m_shapes)
|
for (cpShape* shape : m_shapes)
|
||||||
cpShapeFree(shape);
|
cpShapeFree(shape);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
PhysWorld3D::PhysWorld3D() :
|
PhysWorld3D::PhysWorld3D() :
|
||||||
m_gravity(Vector3f::Zero()),
|
|
||||||
m_maxStepCount(50),
|
m_maxStepCount(50),
|
||||||
|
m_gravity(Vector3f::Zero()),
|
||||||
m_stepSize(0.005f),
|
m_stepSize(0.005f),
|
||||||
m_timestepAccumulator(0.f)
|
m_timestepAccumulator(0.f)
|
||||||
{
|
{
|
||||||
|
|
@ -159,7 +159,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int PhysWorld3D::OnAABBOverlap(const NewtonJoint* const contactJoint, float timestep, int threadIndex)
|
int PhysWorld3D::OnAABBOverlap(const NewtonJoint* const contactJoint, float /*timestep*/, int /*threadIndex*/)
|
||||||
{
|
{
|
||||||
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
|
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
|
||||||
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));
|
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));
|
||||||
|
|
@ -186,7 +186,7 @@ namespace Nz
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysWorld3D::ProcessContact(const NewtonJoint* const contactJoint, float timestep, int threadIndex)
|
void PhysWorld3D::ProcessContact(const NewtonJoint* const contactJoint, float /*timestep*/, int /*threadIndex*/)
|
||||||
{
|
{
|
||||||
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
|
RigidBody3D* bodyA = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint)));
|
||||||
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));
|
RigidBody3D* bodyB = static_cast<RigidBody3D*>(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint)));
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ namespace Nz
|
||||||
|
|
||||||
m_value = Value { resultId };
|
m_value = Value { resultId };
|
||||||
},
|
},
|
||||||
[this](std::monostate)
|
[](std::monostate)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("an internal error occurred");
|
throw std::runtime_error("an internal error occurred");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ namespace Nz
|
||||||
{
|
{
|
||||||
UInt32 resultId = m_writer.AllocateResultId();
|
UInt32 resultId = m_writer.AllocateResultId();
|
||||||
UInt32 pointerType = m_writer.RegisterPointerType(node.exprType, pointer.storage); //< FIXME
|
UInt32 pointerType = m_writer.RegisterPointerType(node.exprType, pointer.storage); //< FIXME
|
||||||
UInt32 typeId = m_writer.GetTypeId(node.exprType);
|
|
||||||
|
|
||||||
m_writer.GetInstructions().AppendVariadic(SpirvOp::OpAccessChain, [&](const auto& appender)
|
m_writer.GetInstructions().AppendVariadic(SpirvOp::OpAccessChain, [&](const auto& appender)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ namespace Nz
|
||||||
for (unsigned int y = 0; y < height; ++y)
|
for (unsigned int y = 0; y < height; ++y)
|
||||||
{
|
{
|
||||||
for (unsigned int x = 0; x < width; ++x)
|
for (unsigned int x = 0; x < width; ++x)
|
||||||
*pixels++ = (data[x/8] & ((1 << (7 - x%8)) ? 255 : 0));
|
*pixels++ = (data[x/8] & ((1 << (7 - x%8) != 0) ? 255 : 0));
|
||||||
|
|
||||||
data += bitmap.pitch;
|
data += bitmap.pitch;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -460,15 +460,15 @@ namespace Nz
|
||||||
|
|
||||||
if (!mesh.faces.empty())
|
if (!mesh.faces.empty())
|
||||||
{
|
{
|
||||||
|
const std::string& matKey = matIt.key();
|
||||||
mesh.name = meshIt.key();
|
mesh.name = meshIt.key();
|
||||||
|
|
||||||
const std::string& matName = matIt.key();
|
auto it = materials.find(matKey);
|
||||||
auto it = materials.find(matName);
|
|
||||||
if (it == materials.end())
|
if (it == materials.end())
|
||||||
{
|
{
|
||||||
mesh.material = index;
|
mesh.material = index;
|
||||||
materials[matName] = index;
|
materials[matKey] = index;
|
||||||
m_materials[index] = matName;
|
m_materials[index] = matKey;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mesh.material = it->second;
|
mesh.material = it->second;
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ namespace Nz
|
||||||
DisconnectFontSlots();
|
DisconnectFontSlots();
|
||||||
|
|
||||||
m_blocks = std::move(drawer.m_blocks);
|
m_blocks = std::move(drawer.m_blocks);
|
||||||
m_bounds = std::move(m_bounds);
|
m_bounds = std::move(drawer.m_bounds);
|
||||||
m_defaultCharacterSize = std::move(drawer.m_defaultCharacterSize);
|
m_defaultCharacterSize = std::move(drawer.m_defaultCharacterSize);
|
||||||
m_defaultCharacterSpacingOffset = std::move(drawer.m_defaultCharacterSpacingOffset);
|
m_defaultCharacterSpacingOffset = std::move(drawer.m_defaultCharacterSpacingOffset);
|
||||||
m_defaultColor = std::move(drawer.m_defaultColor);
|
m_defaultColor = std::move(drawer.m_defaultColor);
|
||||||
|
|
@ -272,12 +272,12 @@ namespace Nz
|
||||||
m_defaultOutlineColor = std::move(drawer.m_defaultOutlineColor);
|
m_defaultOutlineColor = std::move(drawer.m_defaultOutlineColor);
|
||||||
m_defaultOutlineThickness = std::move(drawer.m_defaultOutlineThickness);
|
m_defaultOutlineThickness = std::move(drawer.m_defaultOutlineThickness);
|
||||||
m_defaultStyle = std::move(drawer.m_defaultStyle);
|
m_defaultStyle = std::move(drawer.m_defaultStyle);
|
||||||
m_drawPos = std::move(m_drawPos);
|
m_drawPos = std::move(drawer.m_drawPos);
|
||||||
m_fontIndexes = std::move(drawer.m_fontIndexes);
|
m_fontIndexes = std::move(drawer.m_fontIndexes);
|
||||||
m_fonts = std::move(drawer.m_fonts);
|
m_fonts = std::move(drawer.m_fonts);
|
||||||
m_glyphs = std::move(m_glyphs);
|
m_glyphs = std::move(drawer.m_glyphs);
|
||||||
m_lines = std::move(m_lines);
|
m_lines = std::move(drawer.m_lines);
|
||||||
m_glyphUpdated = std::move(m_glyphUpdated);
|
m_glyphUpdated = std::move(drawer.m_glyphUpdated);
|
||||||
|
|
||||||
drawer.DisconnectFontSlots();
|
drawer.DisconnectFontSlots();
|
||||||
ConnectFontSlots();
|
ConnectFontSlots();
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ namespace Ndk
|
||||||
* \param id Identifier of the entity
|
* \param id Identifier of the entity
|
||||||
*/
|
*/
|
||||||
Entity::Entity(World* world, EntityId id) :
|
Entity::Entity(World* world, EntityId id) :
|
||||||
m_id(id),
|
m_world(world),
|
||||||
m_world(world)
|
m_id(id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,9 +174,10 @@ SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
|
|
||||||
CHECK(!vector.empty());
|
CHECK(!vector.empty());
|
||||||
CHECK(vector.size() == 3);
|
CHECK(vector.size() == 3);
|
||||||
|
{
|
||||||
std::array<int, 3> expectedValues = { 0, 1, 2 };
|
std::array<int, 3> expectedValues = { 0, 1, 2 };
|
||||||
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
||||||
|
}
|
||||||
|
|
||||||
THEN("We resize to five")
|
THEN("We resize to five")
|
||||||
{
|
{
|
||||||
|
|
@ -212,9 +213,11 @@ SCENARIO("StackVector", "[CORE][STACKVECTOR]")
|
||||||
for (std::size_t i = 0; i < vector.size(); ++i)
|
for (std::size_t i = 0; i < vector.size(); ++i)
|
||||||
vector[i] = DestructionCounter(&counter, -5 + int(i));
|
vector[i] = DestructionCounter(&counter, -5 + int(i));
|
||||||
|
|
||||||
std::array<int, 10> expectedValues = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4 };
|
{
|
||||||
CHECK(vector.size() == expectedValues.size());
|
std::array<int, 10> expectedValues = { -5, -4, -3, -2, -1, 0, 1, 2, 3, 4 };
|
||||||
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
CHECK(vector.size() == expectedValues.size());
|
||||||
|
CHECK(std::equal(vector.begin(), vector.end(), expectedValues.begin(), expectedValues.end()));
|
||||||
|
}
|
||||||
|
|
||||||
AND_WHEN("We pop back some elements")
|
AND_WHEN("We pop back some elements")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue