From a1b6f51398208ec30bbf3ab80f21b6e4586f3ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Mon, 21 Feb 2022 20:46:37 +0100 Subject: [PATCH] Minor fixes --- .github/workflows/coverage.yml | 9 ++------- Doxyfile | 2 +- examples/PhysicsDemo/main.cpp | 2 +- include/Nazara/Core/Bitset.inl | 2 +- include/Nazara/Utility/SimpleTextDrawer.hpp | 4 ++-- include/Nazara/Utility/SimpleTextDrawer.inl | 4 ++-- .../Graphics/Resources/Shaders/depth_material.nzsl | 4 +++- src/Nazara/Shader/GlslWriter.cpp | 4 ++++ 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3592a8d12..6171af54f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -36,13 +36,8 @@ jobs: # Install Nazara dependencies - name: Install system dependencies run: | - sudo apt-get install libsndfile1-dev libfreetype6-dev libsdl2-dev mesa-common-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libglx-mesa0 mesa-vulkan-drivers alsa-base alsa-oss alsa-utils pulseaudio git gcovr -y - sudo apt-get -y install linux-modules-extra-$(uname -r) + sudo apt-get -y install libsndfile1-dev libfreetype6-dev libsdl2-dev mesa-common-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev git gcovr - # Setup dummy audio device - - name: Enable snd-dummy - run: sudo modprobe snd-dummy - # Force xmake to a specific folder (for cache) - name: Set xmake env run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV @@ -79,7 +74,7 @@ jobs: # Run unit tests - name: Run unit tests - run: xmake run NazaraClientUnitTests + run: xmake run NazaraUnitTests # Build coverage file - name: Build coverage output diff --git a/Doxyfile b/Doxyfile index bb73485f3..47af03df4 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "Nazara Engine" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.4 +PROJECT_NUMBER = 0.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/examples/PhysicsDemo/main.cpp b/examples/PhysicsDemo/main.cpp index c39a2da5c..e939ecbc3 100644 --- a/examples/PhysicsDemo/main.cpp +++ b/examples/PhysicsDemo/main.cpp @@ -147,7 +147,7 @@ int main() registry.emplace(viewer); auto& cameraComponent = registry.emplace(viewer, window.GetRenderTarget()); cameraComponent.UpdateRenderMask(1); - //cameraComponent.UpdateClearColor(Nz::Color(127, 127, 127)); + cameraComponent.UpdateClearColor(Nz::Color(127, 127, 127)); } auto shipCollider = std::make_shared(vertices, vertexMapper.GetVertexCount(), 0.01f); diff --git a/include/Nazara/Core/Bitset.inl b/include/Nazara/Core/Bitset.inl index 6cb02d72a..be96020ab 100644 --- a/include/Nazara/Core/Bitset.inl +++ b/include/Nazara/Core/Bitset.inl @@ -654,7 +654,7 @@ namespace Nz // Activation of the bit without branching // https://graphics.stanford.edu/~seander/bithacks.html#ConditionalSetOrClearBitsWithoutBranching - block = (block & ~mask) | (-val & mask); + block = (block & ~mask) | (-static_cast(val) & mask); } /*! diff --git a/include/Nazara/Utility/SimpleTextDrawer.hpp b/include/Nazara/Utility/SimpleTextDrawer.hpp index f6f7f7b9a..3f9da9cb2 100644 --- a/include/Nazara/Utility/SimpleTextDrawer.hpp +++ b/include/Nazara/Utility/SimpleTextDrawer.hpp @@ -20,7 +20,7 @@ namespace Nz public: inline SimpleTextDrawer(); inline SimpleTextDrawer(const SimpleTextDrawer& drawer); - inline SimpleTextDrawer(SimpleTextDrawer&& drawer); + inline SimpleTextDrawer(SimpleTextDrawer&& drawer) noexcept; ~SimpleTextDrawer() = default; inline void AppendText(const std::string_view& str); @@ -58,7 +58,7 @@ namespace Nz inline void SetText(std::string str); inline SimpleTextDrawer& operator=(const SimpleTextDrawer& drawer); - inline SimpleTextDrawer& operator=(SimpleTextDrawer&& drawer); + inline SimpleTextDrawer& operator=(SimpleTextDrawer&& drawer) noexcept; static inline SimpleTextDrawer Draw(const std::string& str, unsigned int characterSize, TextStyleFlags style = TextStyle_Regular, const Color& color = Color::White); static inline SimpleTextDrawer Draw(const std::string& str, unsigned int characterSize, TextStyleFlags style, const Color& color, float outlineThickness, const Color& outlineColor); diff --git a/include/Nazara/Utility/SimpleTextDrawer.inl b/include/Nazara/Utility/SimpleTextDrawer.inl index fa77013a4..9da30299c 100644 --- a/include/Nazara/Utility/SimpleTextDrawer.inl +++ b/include/Nazara/Utility/SimpleTextDrawer.inl @@ -38,7 +38,7 @@ namespace Nz SetFont(drawer.m_font); } - inline SimpleTextDrawer::SimpleTextDrawer(SimpleTextDrawer&& drawer) + inline SimpleTextDrawer::SimpleTextDrawer(SimpleTextDrawer&& drawer) noexcept { operator=(std::move(drawer)); } @@ -228,7 +228,7 @@ namespace Nz return *this; } - inline SimpleTextDrawer& SimpleTextDrawer::operator=(SimpleTextDrawer&& drawer) + inline SimpleTextDrawer& SimpleTextDrawer::operator=(SimpleTextDrawer&& drawer) noexcept { DisconnectFontSlots(); diff --git a/src/Nazara/Graphics/Resources/Shaders/depth_material.nzsl b/src/Nazara/Graphics/Resources/Shaders/depth_material.nzsl index 7cbb80bef..8a14d22b2 100644 --- a/src/Nazara/Graphics/Resources/Shaders/depth_material.nzsl +++ b/src/Nazara/Graphics/Resources/Shaders/depth_material.nzsl @@ -86,8 +86,10 @@ struct VertOut [entry(vert)] fn main(input: VertIn) -> VertOut { + let worldPosition = instanceData.worldMatrix * vec4[f32](input.pos, 1.0); + let output: VertOut; - output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4[f32](input.pos, 1.0); + output.position = viewerData.viewProjMatrix * worldPosition; const if (HasUV) output.uv = input.uv; diff --git a/src/Nazara/Shader/GlslWriter.cpp b/src/Nazara/Shader/GlslWriter.cpp index 34935cf45..4cd4c969a 100644 --- a/src/Nazara/Shader/GlslWriter.cpp +++ b/src/Nazara/Shader/GlslWriter.cpp @@ -1160,6 +1160,10 @@ namespace Nz AppendVariableDeclaration(member.type.GetResultingValue(), member.name); Append(";"); } + + // Empty structs are not allowed in GLSL + if (first) + AppendLine("int dummy;"); } LeaveScope(false); AppendLine(";");