From 6757de1be8072c9786aa850532367fa1f9e44c21 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Fri, 26 Jan 2024 10:43:00 +0100 Subject: [PATCH] Add end-of-line spaces checker --- .../ChipmunkConstraint2D.hpp | 6 +-- include/Nazara/Core/ApplicationBase.inl | 2 +- include/Nazara/Core/ApplicationUpdater.hpp | 2 +- include/Nazara/Core/Color.inl | 2 +- include/Nazara/Core/File.inl | 2 +- include/Nazara/Core/Modules.inl | 4 +- include/Nazara/Core/ParameterFile.inl | 4 +- include/Nazara/Core/StringExt.inl | 2 +- include/Nazara/Core/VirtualDirectory.inl | 6 +-- .../Graphics/Components/GraphicsComponent.inl | 2 +- .../Nazara/Graphics/ForwardPipelinePass.hpp | 2 +- include/Nazara/Graphics/FramePass.inl | 2 +- include/Nazara/Graphics/MaterialSettings.inl | 2 +- include/Nazara/Graphics/Model.inl | 2 +- .../PredefinedShaderStructBuilder.inl | 2 +- .../OptionValuePropertyHandler.hpp | 2 +- .../UniformValuePropertyHandler.hpp | 2 +- include/Nazara/Graphics/RenderTextureBlit.inl | 2 +- .../Nazara/Graphics/SpriteChainRenderer.hpp | 2 +- .../Nazara/JoltPhysics3D/JoltCollider3D.hpp | 8 ++-- include/Nazara/Math/Angle.inl | 2 +- include/Nazara/Math/Box.inl | 2 +- include/Nazara/Math/Matrix4.inl | 8 ++-- include/Nazara/Math/Quaternion.inl | 4 +- include/Nazara/Math/Vector4.inl | 2 +- include/Nazara/Network/NetPacket.inl | 2 +- include/Nazara/Network/WebRequest.inl | 2 +- include/Nazara/OpenGLRenderer/Utils.inl | 2 +- include/Nazara/Utility/Image.inl | 2 +- include/Nazara/Utility/Joint.inl | 2 +- include/Nazara/Utility/Node.inl | 2 +- include/Nazara/Utility/RichTextDrawer.hpp | 2 +- include/Nazara/Utility/VertexMapper.hpp | 2 +- include/Nazara/VulkanRenderer/Vulkan.hpp | 2 +- .../VulkanCommandBufferBuilder.hpp | 2 +- .../Nazara/VulkanRenderer/Wrapper/Loader.hpp | 2 +- .../Nazara/VulkanRenderer/Wrapper/Surface.inl | 2 +- .../VulkanRenderer/Wrapper/Swapchain.hpp | 2 +- include/Nazara/Widgets/Canvas.hpp | 2 +- include/Nazara/Widgets/SimpleWidgetStyles.hpp | 8 ++-- include/Nazara/Widgets/WidgetTheme.hpp | 8 ++-- src/Nazara/Audio/Formats/drwavLoader.cpp | 2 +- src/Nazara/Audio/Formats/libflacLoader.cpp | 2 +- src/Nazara/Audio/Formats/libvorbisLoader.cpp | 2 +- src/Nazara/Audio/Formats/minimp3Loader.cpp | 2 +- src/Nazara/Audio/Music.cpp | 2 +- .../BulletPhysics3D/BulletCollider3D.cpp | 2 +- .../ChipmunkConstraint2D.cpp | 2 +- .../ChipmunkPhysics2D/ChipmunkRigidBody2D.cpp | 2 +- src/Nazara/Core/Hash/Whirlpool.cpp | 2 +- src/Nazara/Core/Posix/TaskSchedulerImpl.cpp | 2 +- src/Nazara/Core/SerializationContext.cpp | 2 +- src/Nazara/Core/StringExt.cpp | 2 +- src/Nazara/Core/Win32/ProcessImpl.cpp | 2 +- src/Nazara/Graphics/DebugDrawPipelinePass.cpp | 2 +- .../Formats/PipelinePassListLoader.cpp | 2 +- src/Nazara/Graphics/ForwardFramePipeline.cpp | 2 +- .../Graphics/GuillotineTextureAtlas.cpp | 2 +- src/Nazara/Graphics/LinearSlicedSprite.cpp | 2 +- src/Nazara/Graphics/PointLightShadowData.cpp | 2 +- src/Nazara/Graphics/RenderWindow.cpp | 2 +- src/Nazara/Graphics/ShaderReflection.cpp | 2 +- src/Nazara/Graphics/SubmeshRenderer.cpp | 4 +- src/Nazara/Graphics/Systems/RenderSystem.cpp | 4 +- src/Nazara/Graphics/Tilemap.cpp | 2 +- src/Nazara/Graphics/UberShader.cpp | 2 +- src/Nazara/JoltPhysics3D/JoltCharacter.cpp | 2 +- src/Nazara/JoltPhysics3D/JoltCollider3D.cpp | 4 +- src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp | 2 +- src/Nazara/Network/AbstractSocket.cpp | 6 +-- src/Nazara/Network/Posix/SocketImpl.cpp | 8 ++-- src/Nazara/Network/Win32/SocketImpl.cpp | 4 +- .../OpenGLRenderer/OpenGLShaderBinding.cpp | 4 +- .../OpenGLRenderer/Wrapper/WGL/WGLContext.cpp | 2 +- src/Nazara/Platform/VideoMode.cpp | 2 +- src/Nazara/Renderer/DebugDrawer.cpp | 2 +- src/Nazara/Utility/Formats/STBSaver.cpp | 4 +- src/Nazara/Utility/Systems/SkeletonSystem.cpp | 2 +- src/Nazara/Utility/VertexDeclaration.cpp | 4 +- src/Nazara/Utility/VertexMapper.cpp | 2 +- .../VulkanRenderer/VulkanRenderPass.cpp | 2 +- .../VulkanRenderer/VulkanShaderBinding.cpp | 2 +- src/Nazara/VulkanRenderer/VulkanTexture.cpp | 4 +- src/Nazara/Widgets/AbstractTextAreaWidget.cpp | 2 +- src/Nazara/Widgets/DefaultWidgetTheme.cpp | 2 +- src/Nazara/Widgets/RichTextAreaWidget.cpp | 2 +- src/Nazara/Widgets/ScrollbarWidget.cpp | 10 ++--- src/Nazara/Widgets/SimpleWidgetStyles.cpp | 2 +- src/Nazara/Widgets/TextAreaWidget.cpp | 4 +- xmake/actions/checkfiles.lua | 44 +++++++++++++++++++ 90 files changed, 170 insertions(+), 126 deletions(-) diff --git a/include/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.hpp b/include/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.hpp index a6c4d4e35..12573407c 100644 --- a/include/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.hpp +++ b/include/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.hpp @@ -125,7 +125,7 @@ namespace Nz class ChipmunkMotorConstraint2D; using ChipmunkMotorConstraint2DHandle = ObjectHandle; - + class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkMotorConstraint2D : public ChipmunkConstraint2D { public: @@ -159,7 +159,7 @@ namespace Nz class ChipmunkPivotConstraint2D; using ChipmunkPivotConstraint2DHandle = ObjectHandle; - + class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPivotConstraint2D : public ChipmunkConstraint2D { public: @@ -178,7 +178,7 @@ namespace Nz class ChipmunkRatchetConstraint2D; using ChipmunkRatchetConstraint2DHandle = ObjectHandle; - + class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRatchetConstraint2D : public ChipmunkConstraint2D { public: diff --git a/include/Nazara/Core/ApplicationBase.inl b/include/Nazara/Core/ApplicationBase.inl index 0cdf9ca7b..98de4c57d 100644 --- a/include/Nazara/Core/ApplicationBase.inl +++ b/include/Nazara/Core/ApplicationBase.inl @@ -64,7 +64,7 @@ namespace Nz return static_cast(*m_components[componentIndex]); } - + template const T& ApplicationBase::GetComponent() const { diff --git a/include/Nazara/Core/ApplicationUpdater.hpp b/include/Nazara/Core/ApplicationUpdater.hpp index f51a5e071..75fe42ee8 100644 --- a/include/Nazara/Core/ApplicationUpdater.hpp +++ b/include/Nazara/Core/ApplicationUpdater.hpp @@ -26,7 +26,7 @@ namespace Nz ApplicationUpdater& operator=(const ApplicationUpdater&) = delete; ApplicationUpdater& operator=(ApplicationUpdater&&) = delete; }; - + template class ApplicationUpdaterFunctor : public ApplicationUpdater { diff --git a/include/Nazara/Core/Color.inl b/include/Nazara/Core/Color.inl index b77cafcb4..0a69f5efe 100644 --- a/include/Nazara/Core/Color.inl +++ b/include/Nazara/Core/Color.inl @@ -312,7 +312,7 @@ namespace Nz { return Color(r / 255.f, g / 255.f, b / 255.f); } - + /*! * \brief Converts RGBA8 representation to Color (RGBA32F) * \return Color resulting diff --git a/include/Nazara/Core/File.inl b/include/Nazara/Core/File.inl index b1d95072b..8f2625c3d 100644 --- a/include/Nazara/Core/File.inl +++ b/include/Nazara/Core/File.inl @@ -37,7 +37,7 @@ namespace Nz inline /*constexpr*/ Result File::DecodeOpenMode(std::string_view openModeStr) { OpenModeFlags openModes = 0; - + if (openModeStr.find('r') != std::string_view::npos) { openModes |= OpenMode::Read; diff --git a/include/Nazara/Core/Modules.inl b/include/Nazara/Core/Modules.inl index dbab46352..7f7174d4f 100644 --- a/include/Nazara/Core/Modules.inl +++ b/include/Nazara/Core/Modules.inl @@ -56,7 +56,7 @@ namespace Nz return OverrideModuleConfig(T{}, parameters); } }; - + template template ModuleTuple::ModuleTuple(const CommandLineParameters& parameters, ModuleConfig&&... configs) : @@ -97,7 +97,7 @@ namespace Nz m_modules(CommandLineParameters{}, std::forward(configs)...) { } - + template template Modules::Modules(const CommandLineParameters& parameters, ModuleConfig&&... configs) : diff --git a/include/Nazara/Core/ParameterFile.inl b/include/Nazara/Core/ParameterFile.inl index 8b36bcf57..1ff0a6ca7 100644 --- a/include/Nazara/Core/ParameterFile.inl +++ b/include/Nazara/Core/ParameterFile.inl @@ -25,7 +25,7 @@ namespace Nz { HandleInner(std::forward(args)...); } - + template void ParameterFile::HandleInner(Args&&... args) { @@ -113,7 +113,7 @@ namespace Nz keyValue.handler = BuildBlockHandler(keyValues, std::forward(rest)...); } } - + template auto ParameterFile::GetSingleHandler(V&& value, Rest&&... rest) -> ValueHandler { diff --git a/include/Nazara/Core/StringExt.inl b/include/Nazara/Core/StringExt.inl index 4ef040b95..f989411d7 100644 --- a/include/Nazara/Core/StringExt.inl +++ b/include/Nazara/Core/StringExt.inl @@ -180,7 +180,7 @@ namespace Nz return true; } - + /*! * \ingroup math * \brief Converts the string to number diff --git a/include/Nazara/Core/VirtualDirectory.inl b/include/Nazara/Core/VirtualDirectory.inl index f9f29731f..e3c4f8a3e 100644 --- a/include/Nazara/Core/VirtualDirectory.inl +++ b/include/Nazara/Core/VirtualDirectory.inl @@ -75,7 +75,7 @@ namespace Nz }); } } - + template bool VirtualDirectory::GetDirectoryEntry(std::string_view path, F&& callback) { @@ -260,7 +260,7 @@ namespace Nz { return m_isUprootAllowed; } - + inline auto VirtualDirectory::StoreDirectory(std::string_view path, std::shared_ptr resolver) -> DirectoryEntry& { assert(!path.empty()); @@ -318,7 +318,7 @@ namespace Nz { return StoreFile(path, std::make_shared(data, size)); } - + template bool VirtualDirectory::GetEntryInternal(std::string_view name, bool allowResolve, F&& callback) { if (name == ".") diff --git a/include/Nazara/Graphics/Components/GraphicsComponent.inl b/include/Nazara/Graphics/Components/GraphicsComponent.inl index 265651415..0b713b76e 100644 --- a/include/Nazara/Graphics/Components/GraphicsComponent.inl +++ b/include/Nazara/Graphics/Components/GraphicsComponent.inl @@ -12,7 +12,7 @@ namespace Nz { m_worldInstance = std::make_shared(); //< FIXME: Use pools } - + inline GraphicsComponent::GraphicsComponent(std::shared_ptr renderable, UInt32 renderMask, bool initiallyVisible) : GraphicsComponent(initiallyVisible) { diff --git a/include/Nazara/Graphics/ForwardPipelinePass.hpp b/include/Nazara/Graphics/ForwardPipelinePass.hpp index fd1f0dd71..ccb587dae 100644 --- a/include/Nazara/Graphics/ForwardPipelinePass.hpp +++ b/include/Nazara/Graphics/ForwardPipelinePass.hpp @@ -31,7 +31,7 @@ namespace Nz class Light; class PointLight; class SpotLight; - + class NAZARA_GRAPHICS_API ForwardPipelinePass : public FramePipelinePass, TransferInterface { public: diff --git a/include/Nazara/Graphics/FramePass.inl b/include/Nazara/Graphics/FramePass.inl index 50a7a80d2..9caaa319c 100644 --- a/include/Nazara/Graphics/FramePass.inl +++ b/include/Nazara/Graphics/FramePass.inl @@ -25,7 +25,7 @@ namespace Nz return inputIndex; } - + inline std::size_t FramePass::AddOutput(std::size_t attachmentId) { assert(attachmentId != InvalidAttachmentId); diff --git a/include/Nazara/Graphics/MaterialSettings.inl b/include/Nazara/Graphics/MaterialSettings.inl index 7244d19ca..c0a95d40d 100644 --- a/include/Nazara/Graphics/MaterialSettings.inl +++ b/include/Nazara/Graphics/MaterialSettings.inl @@ -34,7 +34,7 @@ namespace Nz template<> struct TypeToMaterialPropertyType> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int2; }; template<> struct TypeToMaterialPropertyType> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int3; }; template<> struct TypeToMaterialPropertyType> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int4; }; - + template<> struct TypeToMaterialPropertyType { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt; }; template<> struct TypeToMaterialPropertyType> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt2; }; template<> struct TypeToMaterialPropertyType> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt3; }; diff --git a/include/Nazara/Graphics/Model.inl b/include/Nazara/Graphics/Model.inl index d9116eeaa..f0864b1d9 100644 --- a/include/Nazara/Graphics/Model.inl +++ b/include/Nazara/Graphics/Model.inl @@ -11,7 +11,7 @@ namespace Nz { return m_submeshes.size(); } - + inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr material) { assert(subMeshIndex < m_submeshes.size()); diff --git a/include/Nazara/Graphics/PredefinedShaderStructBuilder.inl b/include/Nazara/Graphics/PredefinedShaderStructBuilder.inl index ea5dd1c07..01b5879f9 100644 --- a/include/Nazara/Graphics/PredefinedShaderStructBuilder.inl +++ b/include/Nazara/Graphics/PredefinedShaderStructBuilder.inl @@ -23,7 +23,7 @@ namespace Nz return lightData; } - + // PredefinedPointLightData constexpr PredefinedPointLightData PredefinedPointLightData::Build() { diff --git a/include/Nazara/Graphics/PropertyHandler/OptionValuePropertyHandler.hpp b/include/Nazara/Graphics/PropertyHandler/OptionValuePropertyHandler.hpp index 55f684986..ff5e968f8 100644 --- a/include/Nazara/Graphics/PropertyHandler/OptionValuePropertyHandler.hpp +++ b/include/Nazara/Graphics/PropertyHandler/OptionValuePropertyHandler.hpp @@ -29,7 +29,7 @@ namespace Nz OptionValuePropertyHandler& operator=(const OptionValuePropertyHandler&) = delete; OptionValuePropertyHandler& operator=(OptionValuePropertyHandler&&) = delete; - + private: std::size_t m_propertyIndex; std::string m_propertyName; diff --git a/include/Nazara/Graphics/PropertyHandler/UniformValuePropertyHandler.hpp b/include/Nazara/Graphics/PropertyHandler/UniformValuePropertyHandler.hpp index 1c50afbcd..fd62c8a56 100644 --- a/include/Nazara/Graphics/PropertyHandler/UniformValuePropertyHandler.hpp +++ b/include/Nazara/Graphics/PropertyHandler/UniformValuePropertyHandler.hpp @@ -30,7 +30,7 @@ namespace Nz UniformValuePropertyHandler& operator=(const UniformValuePropertyHandler&) = delete; UniformValuePropertyHandler& operator=(UniformValuePropertyHandler&&) = delete; - + private: std::size_t m_propertyIndex; std::size_t m_offset; diff --git a/include/Nazara/Graphics/RenderTextureBlit.inl b/include/Nazara/Graphics/RenderTextureBlit.inl index 613c3f533..468452bfc 100644 --- a/include/Nazara/Graphics/RenderTextureBlit.inl +++ b/include/Nazara/Graphics/RenderTextureBlit.inl @@ -10,7 +10,7 @@ namespace Nz RenderTextureBlit(textureSize, std::move(targetTexture), filter, PipelineStage::FragmentShader, MemoryAccess::ShaderRead, TextureLayout::ColorInput) { } - + RenderTextureBlit::RenderTextureBlit(const Vector2ui& textureSize, std::shared_ptr texture, SamplerFilter filter, PipelineStage targetPipelineStage, MemoryAccessFlags targetMemoryFlags, TextureLayout targetLayout) : m_targetTexture(std::move(texture)), m_targetMemoryFlags(targetMemoryFlags), diff --git a/include/Nazara/Graphics/SpriteChainRenderer.hpp b/include/Nazara/Graphics/SpriteChainRenderer.hpp index 1d3200664..2bf8dda2d 100644 --- a/include/Nazara/Graphics/SpriteChainRenderer.hpp +++ b/include/Nazara/Graphics/SpriteChainRenderer.hpp @@ -25,7 +25,7 @@ namespace Nz class Texture; class VertexDeclaration; class WorldInstance; - + struct SpriteChainRendererData : public ElementRendererData { struct DrawCall diff --git a/include/Nazara/JoltPhysics3D/JoltCollider3D.hpp b/include/Nazara/JoltPhysics3D/JoltCollider3D.hpp index d3761eb64..d35b1d086 100644 --- a/include/Nazara/JoltPhysics3D/JoltCollider3D.hpp +++ b/include/Nazara/JoltPhysics3D/JoltCollider3D.hpp @@ -111,7 +111,7 @@ namespace Nz private: std::vector m_childs; }; - + class NAZARA_JOLTPHYSICS3D_API JoltConvexHullCollider3D final : public JoltCollider3D { public: @@ -122,7 +122,7 @@ namespace Nz JoltColliderType3D GetType() const override; }; - + class NAZARA_JOLTPHYSICS3D_API JoltMeshCollider3D final : public JoltCollider3D { public: @@ -148,7 +148,7 @@ namespace Nz }; /*********************************** Decorated ******************************************/ - + class NAZARA_JOLTPHYSICS3D_API JoltTranslatedRotatedCollider3D final : public JoltCollider3D { public: @@ -164,7 +164,7 @@ namespace Nz private: std::shared_ptr m_collider; }; - + } #include diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index a060e18ae..0640b12bc 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -612,7 +612,7 @@ namespace Nz { return value <= other.value; } - + template constexpr bool Angle::operator>(Angle other) const { diff --git a/include/Nazara/Math/Box.inl b/include/Nazara/Math/Box.inl index 60b112285..e3cb63baf 100644 --- a/include/Nazara/Math/Box.inl +++ b/include/Nazara/Math/Box.inl @@ -539,7 +539,7 @@ namespace Nz return *this; } - + /*! * \brief Multiplies the lengths of this box with the scalar (the box center doesn't move) * \return A reference to this box where lengths are the product of these lengths and the scalar diff --git a/include/Nazara/Math/Matrix4.inl b/include/Nazara/Math/Matrix4.inl index 24415c9d6..f5beadcf2 100644 --- a/include/Nazara/Math/Matrix4.inl +++ b/include/Nazara/Math/Matrix4.inl @@ -237,17 +237,17 @@ namespace Nz m11*matrix.m12 + m12*matrix.m22 + m13*matrix.m32, m11*matrix.m13 + m12*matrix.m23 + m13*matrix.m33, T(0.0), - + m21*matrix.m11 + m22*matrix.m21 + m23*matrix.m31, m21*matrix.m12 + m22*matrix.m22 + m23*matrix.m32, m21*matrix.m13 + m22*matrix.m23 + m23*matrix.m33, T(0.0), - + m31*matrix.m11 + m32*matrix.m21 + m33*matrix.m31, m31*matrix.m12 + m32*matrix.m22 + m33*matrix.m32, m31*matrix.m13 + m32*matrix.m23 + m33*matrix.m33, T(0.0), - + m41*matrix.m11 + m42*matrix.m21 + m43*matrix.m31 + matrix.m41, m41*matrix.m12 + m42*matrix.m22 + m43*matrix.m32 + matrix.m42, m41*matrix.m13 + m42*matrix.m23 + m43*matrix.m33 + matrix.m43, @@ -502,7 +502,7 @@ namespace Nz if (det == T(0.0)) return false; - + // http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix T inv[16]; inv[0] = m22 * m33 - diff --git a/include/Nazara/Math/Quaternion.inl b/include/Nazara/Math/Quaternion.inl index 3841d5ac6..f2b07b4a5 100644 --- a/include/Nazara/Math/Quaternion.inl +++ b/include/Nazara/Math/Quaternion.inl @@ -527,7 +527,7 @@ namespace Nz if (z != quat.z) return z < quat.z; } - + template constexpr bool Quaternion::operator<=(const Quaternion& quat) const { @@ -543,7 +543,7 @@ namespace Nz if (z != quat.z) return z <= quat.z; } - + template constexpr bool Quaternion::operator>(const Quaternion& quat) const { diff --git a/include/Nazara/Math/Vector4.inl b/include/Nazara/Math/Vector4.inl index c6b6ff545..61274207a 100644 --- a/include/Nazara/Math/Vector4.inl +++ b/include/Nazara/Math/Vector4.inl @@ -513,7 +513,7 @@ namespace Nz return *this; } - + template constexpr Vector4& Vector4::operator%=(const Vector4& vec) { diff --git a/include/Nazara/Network/NetPacket.inl b/include/Nazara/Network/NetPacket.inl index 171a257d3..24e79a19c 100644 --- a/include/Nazara/Network/NetPacket.inl +++ b/include/Nazara/Network/NetPacket.inl @@ -206,7 +206,7 @@ namespace Nz m_buffer = std::move(packet.m_buffer); m_memoryStream = std::move(packet.m_memoryStream); m_netCode = packet.m_netCode; - + ///< Redirect memory stream to the moved buffer if (m_buffer) { diff --git a/include/Nazara/Network/WebRequest.inl b/include/Nazara/Network/WebRequest.inl index 9e9da9c75..224abede5 100644 --- a/include/Nazara/Network/WebRequest.inl +++ b/include/Nazara/Network/WebRequest.inl @@ -30,7 +30,7 @@ namespace Nz { m_headers.insert_or_assign(std::move(header), std::move(value)); } - + inline bool WebRequest::OnBodyResponse(const char* data, std::size_t length) { if (!m_dataCallback) diff --git a/include/Nazara/OpenGLRenderer/Utils.inl b/include/Nazara/OpenGLRenderer/Utils.inl index 04ecb6ab7..e62a278e2 100644 --- a/include/Nazara/OpenGLRenderer/Utils.inl +++ b/include/Nazara/OpenGLRenderer/Utils.inl @@ -84,7 +84,7 @@ namespace Nz NazaraErrorFmt("unhandled BlendFunc {0:#x})", UnderlyingCast(blendFunc)); return {}; } - + inline GLenum ToOpenGL(FaceFilling side) { switch (side) diff --git a/include/Nazara/Utility/Image.inl b/include/Nazara/Utility/Image.inl index fa9ba8fc9..950da2e6f 100644 --- a/include/Nazara/Utility/Image.inl +++ b/include/Nazara/Utility/Image.inl @@ -18,7 +18,7 @@ namespace Nz return *this; } - + inline void Image::ArrayToRegion(ImageType type, unsigned int baseLayer, unsigned int layerCount, Boxui& region) { switch (type) diff --git a/include/Nazara/Utility/Joint.inl b/include/Nazara/Utility/Joint.inl index b6dc18e03..c72d2862e 100644 --- a/include/Nazara/Utility/Joint.inl +++ b/include/Nazara/Utility/Joint.inl @@ -21,7 +21,7 @@ namespace Nz m_skinningMatrixUpdated(false) { } - + inline Joint::Joint(Joint&& joint) noexcept : Node(std::move(joint)), m_inverseBindMatrix(joint.m_inverseBindMatrix), diff --git a/include/Nazara/Utility/Node.inl b/include/Nazara/Utility/Node.inl index b0bec6d2f..81f4f5bcc 100644 --- a/include/Nazara/Utility/Node.inl +++ b/include/Nazara/Utility/Node.inl @@ -406,7 +406,7 @@ namespace Nz EnsureDerivedUpdate(); return globalScale / m_derivedScale; } - + inline Node& Node::operator=(const Node& node) { SetParent(node.m_parent, false, Invalidation::DontInvalidate); diff --git a/include/Nazara/Utility/RichTextDrawer.hpp b/include/Nazara/Utility/RichTextDrawer.hpp index e450a2702..0ed8d2753 100644 --- a/include/Nazara/Utility/RichTextDrawer.hpp +++ b/include/Nazara/Utility/RichTextDrawer.hpp @@ -94,7 +94,7 @@ namespace Nz RichTextDrawer& operator=(RichTextDrawer&& drawer) noexcept; static constexpr std::size_t InvalidBlockIndex = std::numeric_limits::max(); - + private: struct Block; diff --git a/include/Nazara/Utility/VertexMapper.hpp b/include/Nazara/Utility/VertexMapper.hpp index 2b23db65d..94cf57a11 100644 --- a/include/Nazara/Utility/VertexMapper.hpp +++ b/include/Nazara/Utility/VertexMapper.hpp @@ -27,7 +27,7 @@ namespace Nz template SparsePtr GetComponentPtr(VertexComponent component, std::size_t componentIndex = 0); inline const VertexBuffer* GetVertexBuffer() const; inline UInt32 GetVertexCount() const; - + template bool HasComponentOfType(VertexComponent component) const; void Unmap(); diff --git a/include/Nazara/VulkanRenderer/Vulkan.hpp b/include/Nazara/VulkanRenderer/Vulkan.hpp index ae51d573e..37dfb4b32 100644 --- a/include/Nazara/VulkanRenderer/Vulkan.hpp +++ b/include/Nazara/VulkanRenderer/Vulkan.hpp @@ -57,7 +57,7 @@ namespace Nz static std::vector s_physDevices; static Vk::Instance s_instance; static ParameterList s_initializationParameters; - }; + }; } #endif // NAZARA_VULKANRENDERER_VULKAN_HPP diff --git a/include/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.hpp b/include/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.hpp index 63d65fa5a..cdc1f5d91 100644 --- a/include/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.hpp +++ b/include/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.hpp @@ -56,7 +56,7 @@ namespace Nz void InsertDebugLabel(std::string_view label, const Color& color) override; inline Vk::CommandBuffer& GetCommandBuffer(); - + void NextSubpass() override; void PreTransferBarrier() override; diff --git a/include/Nazara/VulkanRenderer/Wrapper/Loader.hpp b/include/Nazara/VulkanRenderer/Wrapper/Loader.hpp index f7e049647..8d13df1ef 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/Loader.hpp +++ b/include/Nazara/VulkanRenderer/Wrapper/Loader.hpp @@ -22,7 +22,7 @@ namespace Nz public: Loader() = delete; ~Loader() = delete; - + static bool EnumerateInstanceExtensionProperties(std::vector* properties, const char* layerName = nullptr); static bool EnumerateInstanceLayerProperties(std::vector* properties); diff --git a/include/Nazara/VulkanRenderer/Wrapper/Surface.inl b/include/Nazara/VulkanRenderer/Wrapper/Surface.inl index 6768d0e2e..3908e2406 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/Surface.inl +++ b/include/Nazara/VulkanRenderer/Wrapper/Surface.inl @@ -166,7 +166,7 @@ namespace Nz::Vk m_surface = VK_NULL_HANDLE; } } - + inline VkResult Surface::GetLastErrorCode() const { return m_lastErrorCode; diff --git a/include/Nazara/VulkanRenderer/Wrapper/Swapchain.hpp b/include/Nazara/VulkanRenderer/Wrapper/Swapchain.hpp index a9a35ad39..5aaa282a8 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/Swapchain.hpp +++ b/include/Nazara/VulkanRenderer/Wrapper/Swapchain.hpp @@ -19,7 +19,7 @@ namespace Nz::Vk public: struct Image; - + Swapchain() = default; Swapchain(const Swapchain&) = delete; Swapchain(Swapchain&&) = default; diff --git a/include/Nazara/Widgets/Canvas.hpp b/include/Nazara/Widgets/Canvas.hpp index dfa596a53..cd4a3e299 100644 --- a/include/Nazara/Widgets/Canvas.hpp +++ b/include/Nazara/Widgets/Canvas.hpp @@ -60,7 +60,7 @@ namespace Nz private: template bool DispatchEvent(std::size_t widgetIndex, F&& functor); - + void OnEventMouseButtonPressed(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event); void OnEventMouseButtonRelease(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event); void OnEventMouseEntered(const WindowEventHandler* eventHandler); diff --git a/include/Nazara/Widgets/SimpleWidgetStyles.hpp b/include/Nazara/Widgets/SimpleWidgetStyles.hpp index f5e383ee3..626399b4b 100644 --- a/include/Nazara/Widgets/SimpleWidgetStyles.hpp +++ b/include/Nazara/Widgets/SimpleWidgetStyles.hpp @@ -63,7 +63,7 @@ namespace Nz bool m_isHovered; bool m_isPressed; }; - + class NAZARA_WIDGETS_API SimpleCheckboxWidgetStyle : public CheckboxWidgetStyle { public: @@ -109,7 +109,7 @@ namespace Nz entt::entity m_checkEntity; bool m_isHovered; }; - + class NAZARA_WIDGETS_API SimpleImageButtonWidgetStyle : public ImageButtonWidgetStyle { public: @@ -150,7 +150,7 @@ namespace Nz bool m_isHovered; bool m_isPressed; }; - + class NAZARA_WIDGETS_API SimpleLabelWidgetStyle : public LabelWidgetStyle { public: @@ -179,7 +179,7 @@ namespace Nz std::shared_ptr m_textSprite; entt::entity m_entity; }; - + class NAZARA_WIDGETS_API SimpleProgressBarWidgetStyle : public ProgressBarWidgetStyle { public: diff --git a/include/Nazara/Widgets/WidgetTheme.hpp b/include/Nazara/Widgets/WidgetTheme.hpp index f30e1bfb3..05b3440f0 100644 --- a/include/Nazara/Widgets/WidgetTheme.hpp +++ b/include/Nazara/Widgets/WidgetTheme.hpp @@ -127,7 +127,7 @@ namespace Nz ButtonWidgetStyle& operator=(const ButtonWidgetStyle&) = delete; ButtonWidgetStyle& operator=(ButtonWidgetStyle&&) = default; }; - + class NAZARA_WIDGETS_API CheckboxWidgetStyle : public BaseWidgetStyle { public: @@ -147,7 +147,7 @@ namespace Nz CheckboxWidgetStyle& operator=(const CheckboxWidgetStyle&) = delete; CheckboxWidgetStyle& operator=(CheckboxWidgetStyle&&) = default; }; - + class NAZARA_WIDGETS_API ImageButtonWidgetStyle : public BaseWidgetStyle { public: @@ -186,7 +186,7 @@ namespace Nz LabelWidgetStyle& operator=(const LabelWidgetStyle&) = delete; LabelWidgetStyle& operator=(LabelWidgetStyle&&) = default; }; - + class NAZARA_WIDGETS_API ProgressBarWidgetStyle : public BaseWidgetStyle { public: @@ -233,7 +233,7 @@ namespace Nz ScrollbarWidgetStyle& operator=(const ScrollbarWidgetStyle&) = delete; ScrollbarWidgetStyle& operator=(ScrollbarWidgetStyle&&) = default; }; - + class NAZARA_WIDGETS_API ScrollbarButtonWidgetStyle : public BaseWidgetStyle { public: diff --git a/src/Nazara/Audio/Formats/drwavLoader.cpp b/src/Nazara/Audio/Formats/drwavLoader.cpp index d307bbc9a..8f882b976 100644 --- a/src/Nazara/Audio/Formats/drwavLoader.cpp +++ b/src/Nazara/Audio/Formats/drwavLoader.cpp @@ -87,7 +87,7 @@ namespace Nz format = AudioFormat::I16_Mono; sampleCount = wav.totalPCMFrameCount; } - + return std::make_shared(format, sampleCount, wav.sampleRate, samples.get()); } diff --git a/src/Nazara/Audio/Formats/libflacLoader.cpp b/src/Nazara/Audio/Formats/libflacLoader.cpp index 1b0b4863d..46f0ae613 100644 --- a/src/Nazara/Audio/Formats/libflacLoader.cpp +++ b/src/Nazara/Audio/Formats/libflacLoader.cpp @@ -242,7 +242,7 @@ namespace Nz format = AudioFormat::I16_Mono; sampleCount = frameCount; } - + return std::make_shared(format, sampleCount, sampleRate, samples.get()); } diff --git a/src/Nazara/Audio/Formats/libvorbisLoader.cpp b/src/Nazara/Audio/Formats/libvorbisLoader.cpp index bdde7213e..c51e947fd 100644 --- a/src/Nazara/Audio/Formats/libvorbisLoader.cpp +++ b/src/Nazara/Audio/Formats/libvorbisLoader.cpp @@ -166,7 +166,7 @@ namespace Nz format = AudioFormat::I16_Mono; sampleCount = frameCount; } - + return std::make_shared(format, sampleCount, info->rate, samples.get()); } diff --git a/src/Nazara/Audio/Formats/minimp3Loader.cpp b/src/Nazara/Audio/Formats/minimp3Loader.cpp index e4e23551e..dd62a2737 100644 --- a/src/Nazara/Audio/Formats/minimp3Loader.cpp +++ b/src/Nazara/Audio/Formats/minimp3Loader.cpp @@ -112,7 +112,7 @@ namespace Nz format = AudioFormat::I16_Mono; sampleCount = frameCount; } - + return std::make_shared(format, sampleCount, info.hz, info.buffer); } diff --git a/src/Nazara/Audio/Music.cpp b/src/Nazara/Audio/Music.cpp index 352d1585e..afba8ba4e 100644 --- a/src/Nazara/Audio/Music.cpp +++ b/src/Nazara/Audio/Music.cpp @@ -30,7 +30,7 @@ namespace Nz Music(*Audio::Instance()->GetDefaultDevice()) { } - + Music::Music(AudioDevice& device) : SoundEmitter(device), m_streaming(false), diff --git a/src/Nazara/BulletPhysics3D/BulletCollider3D.cpp b/src/Nazara/BulletPhysics3D/BulletCollider3D.cpp index b2c84b7e9..294a4485a 100644 --- a/src/Nazara/BulletPhysics3D/BulletCollider3D.cpp +++ b/src/Nazara/BulletPhysics3D/BulletCollider3D.cpp @@ -89,7 +89,7 @@ namespace Nz else return std::make_shared(); } - + std::shared_ptr BulletCollider3D::CreateGeomFromPrimitive(const Primitive& primitive) { switch (primitive.type) diff --git a/src/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.cpp b/src/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.cpp index 9598f8a5c..73fda43de 100644 --- a/src/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.cpp +++ b/src/Nazara/ChipmunkPhysics2D/ChipmunkConstraint2D.cpp @@ -190,7 +190,7 @@ namespace Nz cpDampedSpringSetStiffness(m_constraint, newStiffness); } - + ChipmunkDampedRotarySpringConstraint2D::ChipmunkDampedRotarySpringConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const RadianAnglef& restAngle, float stiffness, float damping) : ChipmunkConstraint2D(first.GetWorld(), cpDampedRotarySpringNew(first.GetHandle(), second.GetHandle(), restAngle.value, stiffness, damping)) { diff --git a/src/Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.cpp b/src/Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.cpp index 01e16ca77..072dab41b 100644 --- a/src/Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.cpp +++ b/src/Nazara/ChipmunkPhysics2D/ChipmunkRigidBody2D.cpp @@ -621,7 +621,7 @@ namespace Nz DestroyBody(); } - + void ChipmunkRigidBody2D::DestroyBody() { UnregisterFromSpace(); diff --git a/src/Nazara/Core/Hash/Whirlpool.cpp b/src/Nazara/Core/Hash/Whirlpool.cpp index e216d883b..7345e69a4 100644 --- a/src/Nazara/Core/Hash/Whirlpool.cpp +++ b/src/Nazara/Core/Hash/Whirlpool.cpp @@ -785,7 +785,7 @@ namespace Nz return "Whirlpool"; } - + void WhirlpoolHasher::ProcessBuffer() { NAZARA_USE_ANONYMOUS_NAMESPACE diff --git a/src/Nazara/Core/Posix/TaskSchedulerImpl.cpp b/src/Nazara/Core/Posix/TaskSchedulerImpl.cpp index a94480dec..779104519 100644 --- a/src/Nazara/Core/Posix/TaskSchedulerImpl.cpp +++ b/src/Nazara/Core/Posix/TaskSchedulerImpl.cpp @@ -195,7 +195,7 @@ namespace Nz pthread_cond_t TaskSchedulerImpl::s_cvEmpty; pthread_cond_t TaskSchedulerImpl::s_cvNotEmpty; pthread_barrier_t TaskSchedulerImpl::s_barrier; - + #if defined(NAZARA_PLATFORM_MACOS) //Code from https://blog.albertarmea.com/post/47089939939/using-pthreadbarrier-on-mac-os-x int TaskSchedulerImpl::pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count) diff --git a/src/Nazara/Core/SerializationContext.cpp b/src/Nazara/Core/SerializationContext.cpp index 1a0499158..03ea1abf0 100644 --- a/src/Nazara/Core/SerializationContext.cpp +++ b/src/Nazara/Core/SerializationContext.cpp @@ -18,7 +18,7 @@ namespace Nz /*! * Write bits to the stream (if any) and reset the current bit cursor - + * \see ResetWriteBitPosition */ void SerializationContext::FlushBits() diff --git a/src/Nazara/Core/StringExt.cpp b/src/Nazara/Core/StringExt.cpp index fa85423c1..768a75efa 100644 --- a/src/Nazara/Core/StringExt.cpp +++ b/src/Nazara/Core/StringExt.cpp @@ -114,7 +114,7 @@ namespace Nz { return utf8::distance(str.data(), str.data() + str.size()); } - + bool EndsWith(std::string_view lhs, std::string_view rhs, CaseIndependent) { NAZARA_USE_ANONYMOUS_NAMESPACE diff --git a/src/Nazara/Core/Win32/ProcessImpl.cpp b/src/Nazara/Core/Win32/ProcessImpl.cpp index 89554b300..4bb23cc01 100644 --- a/src/Nazara/Core/Win32/ProcessImpl.cpp +++ b/src/Nazara/Core/Win32/ProcessImpl.cpp @@ -26,7 +26,7 @@ namespace Nz::PlatformImpl } else commandLine += program; - + ReplaceStr(commandLine, L'/', L'\\'); commandLine += L' '; }; diff --git a/src/Nazara/Graphics/DebugDrawPipelinePass.cpp b/src/Nazara/Graphics/DebugDrawPipelinePass.cpp index 629ba543f..693c7d808 100644 --- a/src/Nazara/Graphics/DebugDrawPipelinePass.cpp +++ b/src/Nazara/Graphics/DebugDrawPipelinePass.cpp @@ -30,7 +30,7 @@ namespace Nz FramePass& debugDrawPass = frameGraph.AddPass("Debug draw pass"); debugDrawPass.AddInput(inputOuputs.inputAttachments[0]); debugDrawPass.AddOutput(inputOuputs.outputAttachments[0]); - + if (inputOuputs.depthStencilInput != InvalidAttachmentIndex) debugDrawPass.SetDepthStencilInput(inputOuputs.depthStencilInput); diff --git a/src/Nazara/Graphics/Formats/PipelinePassListLoader.cpp b/src/Nazara/Graphics/Formats/PipelinePassListLoader.cpp index 349b50549..7205ec753 100644 --- a/src/Nazara/Graphics/Formats/PipelinePassListLoader.cpp +++ b/src/Nazara/Graphics/Formats/PipelinePassListLoader.cpp @@ -125,7 +125,7 @@ namespace Nz::Loaders std::size_t proxyId = m_current->passList->AddAttachmentProxy(proxyName, it->second); m_current->attachmentsByName.emplace(std::move(proxyName), proxyId); } - + void HandlePass(ParameterFileSection section, std::string passName) { struct InputOutput diff --git a/src/Nazara/Graphics/ForwardFramePipeline.cpp b/src/Nazara/Graphics/ForwardFramePipeline.cpp index d28920edb..2c263f034 100644 --- a/src/Nazara/Graphics/ForwardFramePipeline.cpp +++ b/src/Nazara/Graphics/ForwardFramePipeline.cpp @@ -150,7 +150,7 @@ namespace Nz return lightIndex; } - + std::size_t ForwardFramePipeline::RegisterRenderable(std::size_t worldInstanceIndex, std::size_t skeletonInstanceIndex, const InstancedRenderable* instancedRenderable, UInt32 renderMask, const Recti& scissorBox) { std::size_t renderableIndex; diff --git a/src/Nazara/Graphics/GuillotineTextureAtlas.cpp b/src/Nazara/Graphics/GuillotineTextureAtlas.cpp index fb8facd6c..2a729329f 100644 --- a/src/Nazara/Graphics/GuillotineTextureAtlas.cpp +++ b/src/Nazara/Graphics/GuillotineTextureAtlas.cpp @@ -43,7 +43,7 @@ namespace Nz textureInfo.type = ImageType::E2D; textureInfo.usageFlags = TextureUsage::ShaderSampling | TextureUsage::TransferSource | TextureUsage::TransferDestination; textureInfo.levelCount = 1; //< FIXME: Disable mipmaps for now - + std::shared_ptr newTexture; try { diff --git a/src/Nazara/Graphics/LinearSlicedSprite.cpp b/src/Nazara/Graphics/LinearSlicedSprite.cpp index 0e7dd69e7..b330ee724 100644 --- a/src/Nazara/Graphics/LinearSlicedSprite.cpp +++ b/src/Nazara/Graphics/LinearSlicedSprite.cpp @@ -109,7 +109,7 @@ namespace Nz size = Vector2f(m_size, section.size); texCoords = Vector2f(m_textureCoords.width, section.textureCoord); } - + vertices->color = m_color; vertices->position = topLeftCorner; vertices->uv = topLeftUV; diff --git a/src/Nazara/Graphics/PointLightShadowData.cpp b/src/Nazara/Graphics/PointLightShadowData.cpp index c0d4475fa..b66077410 100644 --- a/src/Nazara/Graphics/PointLightShadowData.cpp +++ b/src/Nazara/Graphics/PointLightShadowData.cpp @@ -52,7 +52,7 @@ namespace Nz for (std::size_t i = 0; i < m_directions.size(); ++i) { DirectionData& direction = m_directions[i]; - + ViewerInstance& viewerInstance = direction.viewer.GetViewerInstance(); viewerInstance.UpdateEyePosition(m_light.GetPosition()); viewerInstance.UpdateViewMatrix(Matrix4f::TransformInverse(m_light.GetPosition(), s_dirRotations[i])); diff --git a/src/Nazara/Graphics/RenderWindow.cpp b/src/Nazara/Graphics/RenderWindow.cpp index a9d95cd02..14bdb79e8 100644 --- a/src/Nazara/Graphics/RenderWindow.cpp +++ b/src/Nazara/Graphics/RenderWindow.cpp @@ -36,7 +36,7 @@ namespace Nz { // TODO: Replace the blit to swapchain by a graph.BindExternalSwapchain? std::size_t linkAttachment = graph.AddDummyAttachment(); - + FramePass& blitPass = graph.AddPass("Blit to swapchain"); blitPass.AddInput(attachmentIndex); blitPass.SetInputAccess(0, TextureLayout::TransferSource, PipelineStage::Transfer, MemoryAccess::MemoryRead); diff --git a/src/Nazara/Graphics/ShaderReflection.cpp b/src/Nazara/Graphics/ShaderReflection.cpp index c4345aa1e..b562b70c6 100644 --- a/src/Nazara/Graphics/ShaderReflection.cpp +++ b/src/Nazara/Graphics/ShaderReflection.cpp @@ -192,7 +192,7 @@ namespace Nz }); std::size_t size = structData.fieldOffsets.GetSize() - offset; - + if (member.tag.empty()) continue; diff --git a/src/Nazara/Graphics/SubmeshRenderer.cpp b/src/Nazara/Graphics/SubmeshRenderer.cpp index a7d338494..e8400b8ee 100644 --- a/src/Nazara/Graphics/SubmeshRenderer.cpp +++ b/src/Nazara/Graphics/SubmeshRenderer.cpp @@ -184,7 +184,7 @@ namespace Nz if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapPoint); bindingIndex != Material::InvalidBindingIndex) { std::size_t textureBindingBaseIndex = m_textureBindingCache.size(); - + for (std::size_t j = 0; j < renderState.shadowMapsPoint.size(); ++j) { const Texture* texture = renderState.shadowMapsPoint[j]; @@ -202,7 +202,7 @@ namespace Nz SafeCast(renderState.shadowMapsPoint.size()), &m_textureBindingCache[textureBindingBaseIndex] }; } - + if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapSpot); bindingIndex != Material::InvalidBindingIndex) { std::size_t textureBindingBaseIndex = m_textureBindingCache.size(); diff --git a/src/Nazara/Graphics/Systems/RenderSystem.cpp b/src/Nazara/Graphics/Systems/RenderSystem.cpp index 96adbcc2d..5605319fd 100644 --- a/src/Nazara/Graphics/Systems/RenderSystem.cpp +++ b/src/Nazara/Graphics/Systems/RenderSystem.cpp @@ -292,7 +292,7 @@ namespace Nz CameraComponent& entityCamera = m_registry.get(entity); Vector3f cameraPosition = entityNode.GetPosition(CoordSys::Global); - + ViewerInstance& viewerInstance = entityCamera.GetViewerInstance(); viewerInstance.UpdateEyePosition(cameraPosition); viewerInstance.UpdateViewMatrix(Nz::Matrix4f::TransformInverse(cameraPosition, entityNode.GetRotation(CoordSys::Global))); @@ -355,7 +355,7 @@ namespace Nz assert(m_cameraEntities.find(entity) == m_cameraEntities.end()); m_cameraEntities.emplace(entity, cameraEntity); }); - + m_graphicsConstructObserver.each([&](entt::entity entity) { GraphicsComponent& entityGfx = m_registry.get(entity); diff --git a/src/Nazara/Graphics/Tilemap.cpp b/src/Nazara/Graphics/Tilemap.cpp index d207212c3..1d99e908e 100644 --- a/src/Nazara/Graphics/Tilemap.cpp +++ b/src/Nazara/Graphics/Tilemap.cpp @@ -78,7 +78,7 @@ namespace Nz vertices += 4 * spriteCount; } } - + const std::shared_ptr& Tilemap::GetMaterial(std::size_t i) const { assert(i < m_layers.size()); diff --git a/src/Nazara/Graphics/UberShader.cpp b/src/Nazara/Graphics/UberShader.cpp index 4c472c771..7e52602de 100644 --- a/src/Nazara/Graphics/UberShader.cpp +++ b/src/Nazara/Graphics/UberShader.cpp @@ -92,7 +92,7 @@ namespace Nz for (const auto& [optionHash, optionValue] : config.optionValues) { std::uint32_t hash = optionHash; - + std::visit([&](auto&& arg) { states.optionValues[hash] = arg; diff --git a/src/Nazara/JoltPhysics3D/JoltCharacter.cpp b/src/Nazara/JoltPhysics3D/JoltCharacter.cpp index 1af3a6173..5f7568adf 100644 --- a/src/Nazara/JoltPhysics3D/JoltCharacter.cpp +++ b/src/Nazara/JoltPhysics3D/JoltCharacter.cpp @@ -127,7 +127,7 @@ namespace Nz { m_character->Activate(false); } - + JoltCharacter& JoltCharacter::operator=(JoltCharacter&& character) noexcept { Destroy(); diff --git a/src/Nazara/JoltPhysics3D/JoltCollider3D.cpp b/src/Nazara/JoltPhysics3D/JoltCollider3D.cpp index ce00dbe79..3fb2853c1 100644 --- a/src/Nazara/JoltPhysics3D/JoltCollider3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltCollider3D.cpp @@ -186,7 +186,7 @@ namespace Nz for (unsigned int slice = 0; slice < sliceCount; ++slice) { Quaternionf rot(RadianAnglef(2.f * Pi * slice / sliceCount), Nz::Vector3f::Down()); - + Vector3f top(0.f, halfHeight, 0.f); for (unsigned int i = 0; i < cornerStepCount; ++i) { @@ -354,7 +354,7 @@ namespace Nz } /******************************** JoltMeshCollider3D *********************************/ - + JoltMeshCollider3D::JoltMeshCollider3D(SparsePtr vertices, std::size_t vertexCount, SparsePtr indices, std::size_t indexCount) { std::unique_ptr settings = std::make_unique(); diff --git a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp index 3537d966b..953ae88d8 100644 --- a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp @@ -210,7 +210,7 @@ namespace Nz const FunctionRef(const JoltPhysWorld3D::PointCollisionInfo& hitInfo)>& m_callback; bool m_didHit; }; - + class ShapeCallbackHitResult : public JPH::CollideShapeCollector { public: diff --git a/src/Nazara/Network/AbstractSocket.cpp b/src/Nazara/Network/AbstractSocket.cpp index 276f7457d..3ce39643c 100644 --- a/src/Nazara/Network/AbstractSocket.cpp +++ b/src/Nazara/Network/AbstractSocket.cpp @@ -144,7 +144,7 @@ namespace Nz void AbstractSocket::SetReceiveBufferSize(std::size_t size) { NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first"); - + SocketImpl::SetReceiveBufferSize(m_handle, size); } @@ -156,7 +156,7 @@ namespace Nz void AbstractSocket::SetSendBufferSize(std::size_t size) { NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first"); - + SocketImpl::SetSendBufferSize(m_handle, size); } @@ -249,7 +249,7 @@ namespace Nz m_lastError = abstractSocket.m_lastError; m_state = abstractSocket.m_state; m_type = abstractSocket.m_type; - + abstractSocket.m_handle = SocketImpl::InvalidHandle; return *this; diff --git a/src/Nazara/Network/Posix/SocketImpl.cpp b/src/Nazara/Network/Posix/SocketImpl.cpp index be9dfaced..4501d7b83 100644 --- a/src/Nazara/Network/Posix/SocketImpl.cpp +++ b/src/Nazara/Network/Posix/SocketImpl.cpp @@ -710,7 +710,7 @@ namespace Nz #else int byteSent = sendmsg(handle, &msgHdr, 0); #endif - + if (byteSent == -1) { int errorCode = errno; @@ -892,7 +892,7 @@ namespace Nz if (error) *error = SocketError::NoError; - + #if not defined(MSG_NOSIGNAL) // -> https://github.com/intel/parameter-framework/pull/133/files //There is no MSG_NOSIGNAL on macos const int set = 1; @@ -1017,7 +1017,7 @@ namespace Nz int SocketImpl::TranslateNetProtocolToAF(NetProtocol protocol) { NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum"); - + constexpr EnumArray addressFamily { AF_UNSPEC, //< NetProtocol::Any AF_INET, //< NetProtocol::IPv4 @@ -1031,7 +1031,7 @@ namespace Nz int SocketImpl::TranslateSocketTypeToSock(SocketType type) { NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum"); - + constexpr EnumArray socketType { SOCK_RAW, //< SocketType::Raw SOCK_STREAM, //< SocketType::TCP diff --git a/src/Nazara/Network/Win32/SocketImpl.cpp b/src/Nazara/Network/Win32/SocketImpl.cpp index d78e891ed..d9709a42f 100644 --- a/src/Nazara/Network/Win32/SocketImpl.cpp +++ b/src/Nazara/Network/Win32/SocketImpl.cpp @@ -445,7 +445,7 @@ namespace Nz return 0; #endif } - + SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error) { // Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails) @@ -1041,7 +1041,7 @@ namespace Nz int SocketImpl::TranslateSocketTypeToSock(SocketType type) { NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum"); - + constexpr EnumArray socketType { SOCK_RAW, //< SocketType::Raw SOCK_STREAM, //< SocketType::TCP diff --git a/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp b/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp index a546bc91d..c51654551 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp @@ -84,11 +84,11 @@ namespace Nz for (std::size_t i = 0; i < bindingCount; ++i) { const Binding& binding = bindings[i]; - + std::visit([&](auto&& arg) { using T = std::decay_t; - + if constexpr (std::is_same_v) HandleTextureBinding(binding.bindingIndex, arg); else if constexpr (std::is_same_v) diff --git a/src/Nazara/OpenGLRenderer/Wrapper/WGL/WGLContext.cpp b/src/Nazara/OpenGLRenderer/Wrapper/WGL/WGLContext.cpp index f35e94a37..ea39c1edd 100644 --- a/src/Nazara/OpenGLRenderer/Wrapper/WGL/WGLContext.cpp +++ b/src/Nazara/OpenGLRenderer/Wrapper/WGL/WGLContext.cpp @@ -333,7 +333,7 @@ namespace Nz::GL { // WGL_ARB_pixel_format and WGL_EXT_pixel_format are the same, except for the symbol auto wglChoosePixelFormat = (currentContext->wglChoosePixelFormatARB) ? currentContext->wglChoosePixelFormatARB : currentContext->wglChoosePixelFormatEXT; - + if (wglChoosePixelFormat) { std::array attributes = { diff --git a/src/Nazara/Platform/VideoMode.cpp b/src/Nazara/Platform/VideoMode.cpp index 90a942c22..e0af1b466 100644 --- a/src/Nazara/Platform/VideoMode.cpp +++ b/src/Nazara/Platform/VideoMode.cpp @@ -16,7 +16,7 @@ namespace Nz width(0) { } - + VideoMode::VideoMode(unsigned int w, unsigned int h) : VideoMode(w, h, GetDesktopMode().bitsPerPixel) { diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index eda56a43e..5c51a6876 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -35,7 +35,7 @@ namespace Nz auto debugDrawShader = m_renderDevice.InstantiateShaderModule(nzsl::ShaderStageType::Fragment | nzsl::ShaderStageType::Vertex, *shaderModule, {}); if (!debugDrawShader) throw std::runtime_error("failed to instantiate debug draw shader"); - + RenderPipelineLayoutInfo layoutInfo; layoutInfo.bindings.assign({ { diff --git a/src/Nazara/Utility/Formats/STBSaver.cpp b/src/Nazara/Utility/Formats/STBSaver.cpp index 40b4e18d1..953a1fd75 100644 --- a/src/Nazara/Utility/Formats/STBSaver.cpp +++ b/src/Nazara/Utility/Formats/STBSaver.cpp @@ -109,7 +109,7 @@ namespace Nz NazaraUnused(parameters); Image tempImage(image); //< We're using COW here to prevent Image copy unless required - + int componentCount = ConvertToIntegerFormat(tempImage); if (componentCount == 0) { @@ -229,7 +229,7 @@ namespace Nz { ".png", &SavePNG }, { ".tga", &SaveTGA } }); - + bool FormatQuerier(std::string_view extension) { return s_formatHandlers.find(extension) != s_formatHandlers.end(); diff --git a/src/Nazara/Utility/Systems/SkeletonSystem.cpp b/src/Nazara/Utility/Systems/SkeletonSystem.cpp index 5c60e56f6..5be3a3982 100644 --- a/src/Nazara/Utility/Systems/SkeletonSystem.cpp +++ b/src/Nazara/Utility/Systems/SkeletonSystem.cpp @@ -33,7 +33,7 @@ namespace Nz entitySkeleton.SetSkeletonParent(&entityNode); }); - + m_skeletonConstructObserver.each([&](entt::entity entity) { NodeComponent& entityNode = m_registry.get(entity); diff --git a/src/Nazara/Utility/VertexDeclaration.cpp b/src/Nazara/Utility/VertexDeclaration.cpp index 874eb4f96..c8cc0c69c 100644 --- a/src/Nazara/Utility/VertexDeclaration.cpp +++ b/src/Nazara/Utility/VertexDeclaration.cpp @@ -129,7 +129,7 @@ namespace Nz }); NazaraAssert(s_declarations[VertexLayout::XY_Color]->GetStride() == sizeof(VertexStruct_XY_Color), "Invalid stride for declaration VertexLayout::XY_Color"); - + // VertexLayout::XY_UV : VertexStruct_XY_UV s_declarations[VertexLayout::XY_UV] = NewDeclaration(VertexInputRate::Vertex, { { @@ -292,7 +292,7 @@ namespace Nz }); NazaraAssert(s_declarations[VertexLayout::XYZ_Normal_UV_Tangent_Skinning]->GetStride() == sizeof(VertexStruct_XYZ_Normal_UV_Tangent_Skinning), "Invalid stride for declaration VertexLayout::XYZ_Normal_UV_Tangent_Skinning"); - + // VertexLayout::XYZ_SizeRot : VertexStruct_XYZ_SizeRot s_declarations[VertexLayout::UV_SizeSinCos] = NewDeclaration(VertexInputRate::Vertex, { { diff --git a/src/Nazara/Utility/VertexMapper.cpp b/src/Nazara/Utility/VertexMapper.cpp index a253105b1..8ad03aee9 100644 --- a/src/Nazara/Utility/VertexMapper.cpp +++ b/src/Nazara/Utility/VertexMapper.cpp @@ -47,7 +47,7 @@ namespace Nz ErrorFlags flags(ErrorMode::ThrowException); m_mapper.Map(vertexBuffer, 0, vertexBuffer.GetVertexCount()); } - + VertexMapper::~VertexMapper() = default; void VertexMapper::Unmap() diff --git a/src/Nazara/VulkanRenderer/VulkanRenderPass.cpp b/src/Nazara/VulkanRenderer/VulkanRenderPass.cpp index 7538d9edc..70094e20d 100644 --- a/src/Nazara/VulkanRenderer/VulkanRenderPass.cpp +++ b/src/Nazara/VulkanRenderer/VulkanRenderPass.cpp @@ -53,7 +53,7 @@ namespace Nz ToVulkan(attachmentRef.attachmentLayout) }); } - + std::size_t inputAttachmentIndex = vkAttachmentReferences.size(); for (const AttachmentReference& attachmentRef : subpassInfo.inputAttachments) { diff --git a/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp b/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp index 239edfd8a..87354b637 100644 --- a/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp +++ b/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp @@ -48,7 +48,7 @@ namespace Nz for (std::size_t i = 0; i < bindingCount; ++i) { const Binding& binding = bindings[i]; - + VkWriteDescriptorSet& writeOp = writeOps.emplace_back(); writeOp.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; writeOp.dstSet = m_descriptorSet; diff --git a/src/Nazara/VulkanRenderer/VulkanTexture.cpp b/src/Nazara/VulkanRenderer/VulkanTexture.cpp index c64c82d0e..a33e78d1b 100644 --- a/src/Nazara/VulkanRenderer/VulkanTexture.cpp +++ b/src/Nazara/VulkanRenderer/VulkanTexture.cpp @@ -27,7 +27,7 @@ namespace Nz VkImageViewCreateInfo createInfoView = {}; createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; InitViewForFormat(m_textureInfo.pixelFormat, createInfoView); - + VkImageCreateInfo createInfo = {}; createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; createInfo.format = createInfoView.format; @@ -229,7 +229,7 @@ namespace Nz createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; createInfoView.image = m_image; createInfoView.subresourceRange = m_subresourceRange; - + switch (m_textureViewInfo.type) { case ImageType::E1D: diff --git a/src/Nazara/Widgets/AbstractTextAreaWidget.cpp b/src/Nazara/Widgets/AbstractTextAreaWidget.cpp index 7f4835859..797ee744b 100644 --- a/src/Nazara/Widgets/AbstractTextAreaWidget.cpp +++ b/src/Nazara/Widgets/AbstractTextAreaWidget.cpp @@ -48,7 +48,7 @@ namespace Nz EnableBackground(true); } - + void AbstractTextAreaWidget::Clear() { AbstractTextDrawer& textDrawer = GetTextDrawer(); diff --git a/src/Nazara/Widgets/DefaultWidgetTheme.cpp b/src/Nazara/Widgets/DefaultWidgetTheme.cpp index 6f0652f6d..1ec7f5cf6 100644 --- a/src/Nazara/Widgets/DefaultWidgetTheme.cpp +++ b/src/Nazara/Widgets/DefaultWidgetTheme.cpp @@ -112,7 +112,7 @@ namespace Nz const UInt8 s_defaultThemeScrollbarCenterImage[] = { #include }; - + const UInt8 s_defaultThemeScrollbarGrabbedImage[] = { #include }; diff --git a/src/Nazara/Widgets/RichTextAreaWidget.cpp b/src/Nazara/Widgets/RichTextAreaWidget.cpp index 28d160be4..085c5bfab 100644 --- a/src/Nazara/Widgets/RichTextAreaWidget.cpp +++ b/src/Nazara/Widgets/RichTextAreaWidget.cpp @@ -12,7 +12,7 @@ namespace Nz { Layout(); } - + void RichTextAreaWidget::AppendText(std::string_view text) { //m_text += text; diff --git a/src/Nazara/Widgets/ScrollbarWidget.cpp b/src/Nazara/Widgets/ScrollbarWidget.cpp index a888ef6c5..a272c0f58 100644 --- a/src/Nazara/Widgets/ScrollbarWidget.cpp +++ b/src/Nazara/Widgets/ScrollbarWidget.cpp @@ -26,7 +26,7 @@ namespace Nz const WidgetTheme::Config& themeConfig = GetTheme()->GetConfig(); m_scrollCenterButton = Add(); - + m_scrollCenterButton->OnButtonReleased.Connect([this](const ScrollbarButtonWidget*) { m_style->OnButtonRelease(); @@ -40,7 +40,7 @@ namespace Nz m_grabbedValue = GetValue(); m_style->OnButtonGrab(); }); - + m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget*, int x, int /*y*/) { int deltaX = x - m_grabbedPosition; @@ -65,7 +65,7 @@ namespace Nz m_grabbedValue = GetValue(); m_style->OnButtonGrab(); }); - + m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget* button, int /*x*/, int y) { int deltaY = SafeCast(m_grabbedPosition - (button->GetPosition().y + y)); @@ -87,7 +87,7 @@ namespace Nz { SetValue(GetValue() - 0.1f * (GetMaximumValue() - GetMinimumValue())); }); - + m_scrollNextButton->OnButtonTrigger.Connect([this](const ImageButtonWidget*) { SetValue(GetValue() + 0.1f * (GetMaximumValue() - GetMinimumValue())); @@ -139,7 +139,7 @@ namespace Nz { m_style->OnHoverBegin(); } - + void ScrollbarWidget::OnMouseExit() { m_style->OnHoverEnd(); diff --git a/src/Nazara/Widgets/SimpleWidgetStyles.cpp b/src/Nazara/Widgets/SimpleWidgetStyles.cpp index 760506047..91015ae3a 100644 --- a/src/Nazara/Widgets/SimpleWidgetStyles.cpp +++ b/src/Nazara/Widgets/SimpleWidgetStyles.cpp @@ -393,7 +393,7 @@ namespace Nz { m_textSprite->Update(drawer); } - + /************************************************************************/ SimpleProgressBarWidgetStyle::SimpleProgressBarWidgetStyle(ProgressBarWidget* progressBarWidget, StyleConfig config) : diff --git a/src/Nazara/Widgets/TextAreaWidget.cpp b/src/Nazara/Widgets/TextAreaWidget.cpp index 559ffd1a8..624389716 100644 --- a/src/Nazara/Widgets/TextAreaWidget.cpp +++ b/src/Nazara/Widgets/TextAreaWidget.cpp @@ -38,7 +38,7 @@ namespace Nz Layout(); } - + void TextAreaWidget::AppendText(std::string_view text) { m_text += text; @@ -83,7 +83,7 @@ namespace Nz m_text.clear(); OnTextChanged(this, m_text); } - + void TextAreaWidget::Erase(std::size_t firstGlyph, std::size_t lastGlyph) { if (firstGlyph > lastGlyph) diff --git a/xmake/actions/checkfiles.lua b/xmake/actions/checkfiles.lua index f2a371657..6c5e2d007 100644 --- a/xmake/actions/checkfiles.lua +++ b/xmake/actions/checkfiles.lua @@ -845,6 +845,50 @@ on_run(function () end }) + -- No space should lies before a linefeed + table.insert(checks, { + Name = "end of line spaces", + Check = function (moduleName) + local files = table.join( + os.files("include/Nazara/" .. moduleName .. "/**.hpp"), + os.files("include/Nazara/" .. moduleName .. "/**.inl"), + os.files("src/Nazara/" .. moduleName .. "/**.hpp"), + os.files("src/Nazara/" .. moduleName .. "/**.inl"), + os.files("src/Nazara/" .. moduleName .. "/**.cpp") + ) + + local fixes = {} + + for _, filePath in pairs(files) do + local lines = GetFile(filePath) + + local fileFixes = {} + for i = 1, #lines do + local content = lines[i]:match("^(%s*[^%s]*)%s+$") + if content then + table.insert(fileFixes, { line = i, newContent = content }) + end + end + + if #fileFixes > 0 then + print(filePath .. " has line ending with spaces") + table.insert(fixes, { + File = filePath, + Func = function (lines) + for _, fix in ipairs(fileFixes) do + lines[fix.line] = fix.newContent + end + + UpdateFile(filePath, lines) + end + }) + end + end + + return fixes + end + }) + local shouldFix = option.get("fix") or false for _, check in pairs(checks) do