From 68708c54f784d12be0faa02bef5b434dfb5c68f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Mon, 4 Oct 2021 09:24:42 +0200 Subject: [PATCH] Minor stuff --- include/Nazara/Core/Color.inl | 2 +- include/Nazara/OpenGLRenderer/OpenGLCommandBuffer.inl | 2 +- .../Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.hpp | 2 +- include/Nazara/Utility/SimpleTextDrawer.hpp | 2 +- include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.hpp | 4 ++-- include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl | 8 ++++---- src/Nazara/OpenGLRenderer/OpenGLCommandBuffer.cpp | 4 ++-- src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp | 2 +- src/Nazara/Shader/Ast/SanitizeVisitor.cpp | 2 +- src/Nazara/Shader/ShaderLangParser.cpp | 2 +- src/Nazara/Utility/Formats/OBJLoader.cpp | 2 +- src/Nazara/Utility/SimpleTextDrawer.cpp | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/Nazara/Core/Color.inl b/include/Nazara/Core/Color.inl index 75a82b80e..53f431bbf 100644 --- a/include/Nazara/Core/Color.inl +++ b/include/Nazara/Core/Color.inl @@ -12,7 +12,7 @@ namespace Nz { /*! * \ingroup core - * \class Nz::Color + * \class Color * \brief Core class that represents a color */ diff --git a/include/Nazara/OpenGLRenderer/OpenGLCommandBuffer.inl b/include/Nazara/OpenGLRenderer/OpenGLCommandBuffer.inl index 2a5276458..7bf7fe4aa 100644 --- a/include/Nazara/OpenGLRenderer/OpenGLCommandBuffer.inl +++ b/include/Nazara/OpenGLRenderer/OpenGLCommandBuffer.inl @@ -24,7 +24,7 @@ namespace Nz { } - inline void OpenGLCommandBuffer::BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color) + inline void OpenGLCommandBuffer::BeginDebugRegion(const std::string_view& regionName, const Color& color) { BeginDebugRegionData beginDebugRegion; beginDebugRegion.color = color; diff --git a/include/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.hpp b/include/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.hpp index 4a371cf10..074fdc5c9 100644 --- a/include/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.hpp +++ b/include/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.hpp @@ -23,7 +23,7 @@ namespace Nz OpenGLCommandBufferBuilder(OpenGLCommandBufferBuilder&&) noexcept = default; ~OpenGLCommandBufferBuilder() = default; - void BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color) override; + void BeginDebugRegion(const std::string_view& regionName, const Color& color) override; void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, const Recti& renderRect, const ClearValues* clearValues, std::size_t clearValueCount) override; void BindIndexBuffer(const AbstractBuffer& indexBuffer, UInt64 offset = 0) override; diff --git a/include/Nazara/Utility/SimpleTextDrawer.hpp b/include/Nazara/Utility/SimpleTextDrawer.hpp index b0a0fd92b..5fcd91650 100644 --- a/include/Nazara/Utility/SimpleTextDrawer.hpp +++ b/include/Nazara/Utility/SimpleTextDrawer.hpp @@ -74,7 +74,7 @@ namespace Nz inline void ConnectFontSlots(); inline void DisconnectFontSlots(); - bool GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Nz::Color color, int renderOrder, int* advance) const; + bool GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Color color, int renderOrder, int* advance) const; void GenerateGlyphs(const std::string_view& text) const; inline float GetLineHeight(const Font::SizeInfo& sizeInfo) const; diff --git a/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.hpp b/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.hpp index 0bda704dc..68b3b6075 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.hpp +++ b/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.hpp @@ -35,7 +35,7 @@ namespace Nz inline bool Begin(VkCommandBufferUsageFlags flags, bool occlusionQueryEnable, VkQueryControlFlags queryFlags, VkQueryPipelineStatisticFlags pipelineStatistics); inline void BeginDebugRegion(const char* label); - inline void BeginDebugRegion(const char* label, Nz::Color color); + inline void BeginDebugRegion(const char* label, Color color); inline void BeginRenderPass(const VkRenderPassBeginInfo& beginInfo, VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE); inline void BindDescriptorSet(VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, UInt32 firstSet, const VkDescriptorSet& descriptorSets); @@ -79,7 +79,7 @@ namespace Nz inline void ImageBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkImageLayout oldLayout, VkImageLayout newLayout, VkImage image, VkImageAspectFlags aspectFlags); inline void InsertDebugLabel(const char* label); - inline void InsertDebugLabel(const char* label, Nz::Color color); + inline void InsertDebugLabel(const char* label, Color color); inline void MemoryBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask); diff --git a/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl b/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl index edd97068c..f28219799 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl +++ b/include/Nazara/VulkanRenderer/Wrapper/CommandBuffer.inl @@ -120,10 +120,10 @@ namespace Nz inline void CommandBuffer::BeginDebugRegion(const char* label) { - return BeginDebugRegion(label, Nz::Color(0, 0, 0, 0)); + return BeginDebugRegion(label, Color(0, 0, 0, 0)); } - inline void CommandBuffer::BeginDebugRegion(const char* label, Nz::Color color) + inline void CommandBuffer::BeginDebugRegion(const char* label, Color color) { Vk::Device* device = m_pool->GetDevice(); if (device->vkCmdBeginDebugUtilsLabelEXT) @@ -364,10 +364,10 @@ namespace Nz inline void CommandBuffer::InsertDebugLabel(const char* label) { - return InsertDebugLabel(label, Nz::Color(0, 0, 0, 0)); + return InsertDebugLabel(label, Color(0, 0, 0, 0)); } - inline void CommandBuffer::InsertDebugLabel(const char* label, Nz::Color color) + inline void CommandBuffer::InsertDebugLabel(const char* label, Color color) { Vk::Device* device = m_pool->GetDevice(); if (device->vkCmdInsertDebugUtilsLabelEXT) diff --git a/src/Nazara/OpenGLRenderer/OpenGLCommandBuffer.cpp b/src/Nazara/OpenGLRenderer/OpenGLCommandBuffer.cpp index 6ce8a7f63..e90fa80cc 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLCommandBuffer.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLCommandBuffer.cpp @@ -165,7 +165,7 @@ namespace Nz { std::size_t attachmentIndex = colorIndexes[i]; - Nz::Color color = command.clearValues[attachmentIndex].color; + Color color = command.clearValues[attachmentIndex].color; std::array clearColor = { color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f }; const auto& attachmentInfo = command.renderpass->GetAttachment(attachmentIndex); @@ -230,7 +230,7 @@ namespace Nz { context->ResetColorWriteMasks(); - Nz::Color color = command.clearValues[colorAttachmentIndex].color; + Color color = command.clearValues[colorAttachmentIndex].color; context->glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); clearFields |= GL_COLOR_BUFFER_BIT; diff --git a/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp b/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp index ff19cf522..cef0d2ad9 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp @@ -14,7 +14,7 @@ namespace Nz { - void OpenGLCommandBufferBuilder::BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color) + void OpenGLCommandBufferBuilder::BeginDebugRegion(const std::string_view& regionName, const Color& color) { m_commandBuffer.BeginDebugRegion(regionName, color); } diff --git a/src/Nazara/Shader/Ast/SanitizeVisitor.cpp b/src/Nazara/Shader/Ast/SanitizeVisitor.cpp index 4d9894167..68ab48b7c 100644 --- a/src/Nazara/Shader/Ast/SanitizeVisitor.cpp +++ b/src/Nazara/Shader/Ast/SanitizeVisitor.cpp @@ -1468,7 +1468,7 @@ namespace Nz::ShaderAst throw AstError{ "pow only works with primitive and vector types" }; if ((IsPrimitiveType(type) && std::get(type) != PrimitiveType::Float32) || - (IsVectorType(type) && std::get(type).type != PrimitiveType::Float32)) + (IsVectorType(type) && std::get(type).type != PrimitiveType::Float32)) throw AstError{ "pow only works with floating-point primitive or vectors" }; node.cachedExpressionType = type; diff --git a/src/Nazara/Shader/ShaderLangParser.cpp b/src/Nazara/Shader/ShaderLangParser.cpp index d9753cffa..6bc257083 100644 --- a/src/Nazara/Shader/ShaderLangParser.cpp +++ b/src/Nazara/Shader/ShaderLangParser.cpp @@ -740,7 +740,7 @@ namespace Nz::ShaderLang break; default: - break; + throw UnexpectedToken{}; } return statement; diff --git a/src/Nazara/Utility/Formats/OBJLoader.cpp b/src/Nazara/Utility/Formats/OBJLoader.cpp index cd8a51502..76a7e5b81 100644 --- a/src/Nazara/Utility/Formats/OBJLoader.cpp +++ b/src/Nazara/Utility/Formats/OBJLoader.cpp @@ -326,7 +326,7 @@ namespace Nz if (auto colorPtr = vertexMapper.GetComponentPtr(VertexComponent::Color)) { for (unsigned int i = 0; i < vertexCount; ++i) - colorPtr[i] = Nz::Color::White; + colorPtr[i] = Color::White; } vertexMapper.Unmap(); diff --git a/src/Nazara/Utility/SimpleTextDrawer.cpp b/src/Nazara/Utility/SimpleTextDrawer.cpp index c1fbf241d..009f77acd 100644 --- a/src/Nazara/Utility/SimpleTextDrawer.cpp +++ b/src/Nazara/Utility/SimpleTextDrawer.cpp @@ -142,7 +142,7 @@ namespace Nz m_lines.emplace_back(Line{Rectf::Zero(), 0}); } - bool SimpleTextDrawer::GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Nz::Color color, int renderOrder, int* advance) const + bool SimpleTextDrawer::GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Color color, int renderOrder, int* advance) const { const Font::Glyph& fontGlyph = m_font->GetGlyph(m_characterSize, m_style, outlineThickness, character); if (fontGlyph.valid && fontGlyph.fauxOutlineThickness <= 0.f)