diff --git a/SDK/include/NDK/Components/CameraComponent.hpp b/SDK/include/NDK/Components/CameraComponent.hpp index cd575b40d..4b610d5a0 100644 --- a/SDK/include/NDK/Components/CameraComponent.hpp +++ b/SDK/include/NDK/Components/CameraComponent.hpp @@ -40,6 +40,7 @@ namespace Ndk inline const NzFrustumf& GetFrustum() const; inline unsigned int GetLayer() const; inline const NzMatrix4f& GetProjectionMatrix() const; + inline nzProjectionType GetProjectionType() const; inline const NzRenderTarget* GetTarget() const; inline const NzRectf& GetTargetRegion() const; inline const NzMatrix4f& GetViewMatrix() const; @@ -49,6 +50,7 @@ namespace Ndk inline void SetFOV(float fov); inline void SetLayer(unsigned int layer); + inline void SetProjectionType(nzProjectionType projection); inline void SetTarget(const NzRenderTarget* renderTarget); inline void SetTargetRegion(const NzRectf& region); inline void SetViewport(const NzRecti& viewport); @@ -80,6 +82,7 @@ namespace Ndk NazaraSlot(NzRenderTarget, OnRenderTargetRelease, m_targetReleaseSlot); NazaraSlot(NzRenderTarget, OnRenderTargetSizeChange, m_targetResizeSlot); + nzProjectionType m_projectionType; mutable NzFrustumf m_frustum; mutable NzMatrix4f m_projectionMatrix; mutable NzMatrix4f m_viewMatrix; diff --git a/SDK/include/NDK/Components/CameraComponent.inl b/SDK/include/NDK/Components/CameraComponent.inl index 6a6eb3084..083ef4219 100644 --- a/SDK/include/NDK/Components/CameraComponent.inl +++ b/SDK/include/NDK/Components/CameraComponent.inl @@ -8,6 +8,7 @@ namespace Ndk { inline CameraComponent::CameraComponent() : + m_projectionType(nzProjectionType_Perspective), m_targetRegion(0.f, 0.f, 1.f, 1.f), m_target(nullptr), m_frustumUpdated(false), @@ -25,8 +26,9 @@ namespace Ndk inline CameraComponent::CameraComponent(const CameraComponent& camera) : Component(camera), NzAbstractViewer(camera), + m_projectionType(camera.m_projectionType), m_targetRegion(camera.m_targetRegion), - m_target(camera.m_target), + m_target(nullptr), m_frustumUpdated(false), m_projectionMatrixUpdated(false), m_viewMatrixUpdated(false), @@ -37,7 +39,7 @@ namespace Ndk m_zNear(camera.m_zNear), m_layer(camera.m_layer) { - + SetTarget(camera.m_target); } inline void CameraComponent::EnsureFrustumUpdate() const @@ -95,6 +97,11 @@ namespace Ndk return m_projectionMatrix; } + inline nzProjectionType CameraComponent::GetProjectionType() const + { + return m_projectionType; + } + inline const NzRenderTarget* CameraComponent::GetTarget() const { return m_target; @@ -132,8 +139,15 @@ namespace Ndk inline void CameraComponent::SetFOV(float fov) { NazaraAssert(!NzNumberEquals(fov, 0.f), "FOV must be different from zero"); - m_fov = fov; + + InvalidateProjectionMatrix(); + } + + inline void CameraComponent::SetProjectionType(nzProjectionType projectionType) + { + m_projectionType = projectionType; + InvalidateProjectionMatrix(); } @@ -149,6 +163,7 @@ namespace Ndk inline void CameraComponent::SetTargetRegion(const NzRectf& region) { m_targetRegion = region; + InvalidateViewport(); } @@ -166,14 +181,15 @@ namespace Ndk inline void CameraComponent::SetZFar(float zFar) { m_zFar = zFar; + InvalidateProjectionMatrix(); } inline void CameraComponent::SetZNear(float zNear) { NazaraAssert(!NzNumberEquals(zNear, 0.f), "zNear cannot be zero"); - m_zNear = zNear; + InvalidateProjectionMatrix(); } diff --git a/SDK/include/NDK/Components/GraphicsComponent.hpp b/SDK/include/NDK/Components/GraphicsComponent.hpp index 41f03ca3c..70223bbab 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.hpp +++ b/SDK/include/NDK/Components/GraphicsComponent.hpp @@ -15,6 +15,8 @@ namespace Ndk { class NDK_API GraphicsComponent : public Component { + friend class RenderSystem; + public: GraphicsComponent() = default; inline GraphicsComponent(const GraphicsComponent& graphicsComponent); @@ -30,6 +32,7 @@ namespace Ndk private: void InvalidateRenderableData(const NzInstancedRenderable* renderable, nzUInt32 flags, unsigned int index); + inline void InvalidateRenderables(); inline void InvalidateTransformMatrix(); void OnAttached() override; diff --git a/SDK/include/NDK/Components/GraphicsComponent.inl b/SDK/include/NDK/Components/GraphicsComponent.inl index af435aa2b..0691414d1 100644 --- a/SDK/include/NDK/Components/GraphicsComponent.inl +++ b/SDK/include/NDK/Components/GraphicsComponent.inl @@ -46,11 +46,16 @@ namespace Ndk UpdateTransformMatrix(); } - inline void GraphicsComponent::InvalidateTransformMatrix() + inline void GraphicsComponent::InvalidateRenderables() { for (Renderable& r : m_renderables) r.dataUpdated = false; + } + inline void GraphicsComponent::InvalidateTransformMatrix() + { m_transformMatrixUpdated = false; + + InvalidateRenderables(); } } diff --git a/SDK/include/NDK/EntityHandle.hpp b/SDK/include/NDK/EntityHandle.hpp index 21d3f3820..554bd4a35 100644 --- a/SDK/include/NDK/EntityHandle.hpp +++ b/SDK/include/NDK/EntityHandle.hpp @@ -33,6 +33,8 @@ namespace Ndk EntityHandle& Swap(EntityHandle& handle); + NzString ToString() const; + operator bool() const; operator Entity*() const; Entity* operator->() const; diff --git a/SDK/include/NDK/EntityHandle.inl b/SDK/include/NDK/EntityHandle.inl index fa2a55469..e34bc8492 100644 --- a/SDK/include/NDK/EntityHandle.inl +++ b/SDK/include/NDK/EntityHandle.inl @@ -2,6 +2,7 @@ // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp +#include #include #include @@ -89,6 +90,20 @@ namespace Ndk return *this; } + inline NzString EntityHandle::ToString() const + { + NzStringStream ss; + ss << "EntityHandle("; + if (IsValid()) + ss << "Entity(" << m_entity->GetId() << ')'; + else + ss << "Null entity"; + + ss << ')'; + + return ss; + } + inline EntityHandle::operator bool() const { return IsValid(); @@ -143,7 +158,7 @@ namespace Ndk { out << "EntityHandle("; if (handle.IsValid()) - out << "Entity(" << handle->GetId() << ")"; + out << "Entity(" << handle->GetId() << ')'; else out << "Null entity"; diff --git a/SDK/include/NDK/Systems/RenderSystem.hpp b/SDK/include/NDK/Systems/RenderSystem.hpp index 9df56bc49..4934ffd78 100644 --- a/SDK/include/NDK/Systems/RenderSystem.hpp +++ b/SDK/include/NDK/Systems/RenderSystem.hpp @@ -28,12 +28,21 @@ namespace Ndk ~RenderSystem() = default; inline const NzBackgroundRef& GetDefaultBackground() const; + inline const NzMatrix4f& GetCoordinateSystemMatrix() const; + inline NzVector3f GetGlobalForward() const; + inline NzVector3f GetGlobalRight() const; + inline NzVector3f GetGlobalUp() const; inline void SetDefaultBackground(NzBackgroundRef background); + inline void SetGlobalForward(const NzVector3f& direction); + inline void SetGlobalRight(const NzVector3f& direction); + inline void SetGlobalUp(const NzVector3f& direction); static SystemIndex systemIndex; private: + inline void InvalidateCoordinateSystem(); + void OnEntityRemoved(Entity* entity) override; void OnEntityValidation(Entity* entity, bool justAdded) override; void OnUpdate(float elapsedTime) override; @@ -48,7 +57,9 @@ namespace Ndk NzBackgroundRef m_background; NzDepthRenderTechnique m_shadowTechnique; NzForwardRenderTechnique m_renderTechnique; + NzMatrix4f m_coordinateSystemMatrix; NzRenderTexture m_shadowRT; + bool m_coordinateSystemInvalidated; }; } diff --git a/SDK/include/NDK/Systems/RenderSystem.inl b/SDK/include/NDK/Systems/RenderSystem.inl index ac4db251f..a2eed384e 100644 --- a/SDK/include/NDK/Systems/RenderSystem.inl +++ b/SDK/include/NDK/Systems/RenderSystem.inl @@ -14,8 +14,60 @@ namespace Ndk return m_background; } + inline const NzMatrix4f& RenderSystem::GetCoordinateSystemMatrix() const + { + return m_coordinateSystemMatrix; + } + + inline NzVector3f RenderSystem::GetGlobalForward() const + { + return NzVector3f(-m_coordinateSystemMatrix.m13, -m_coordinateSystemMatrix.m23, -m_coordinateSystemMatrix.m33); + } + + inline NzVector3f RenderSystem::GetGlobalRight() const + { + return NzVector3f(m_coordinateSystemMatrix.m11, m_coordinateSystemMatrix.m21, m_coordinateSystemMatrix.m31); + } + + inline NzVector3f RenderSystem::GetGlobalUp() const + { + return NzVector3f(m_coordinateSystemMatrix.m12, m_coordinateSystemMatrix.m22, m_coordinateSystemMatrix.m32); + } + inline void RenderSystem::SetDefaultBackground(NzBackgroundRef background) { m_background = std::move(background); } + + inline void RenderSystem::SetGlobalForward(const NzVector3f& direction) + { + m_coordinateSystemMatrix.m13 = -direction.x; + m_coordinateSystemMatrix.m23 = -direction.y; + m_coordinateSystemMatrix.m33 = -direction.z; + + InvalidateCoordinateSystem(); + } + + inline void RenderSystem::SetGlobalRight(const NzVector3f& direction) + { + m_coordinateSystemMatrix.m11 = direction.x; + m_coordinateSystemMatrix.m21 = direction.y; + m_coordinateSystemMatrix.m31 = direction.z; + + InvalidateCoordinateSystem(); + } + + inline void RenderSystem::SetGlobalUp(const NzVector3f& direction) + { + m_coordinateSystemMatrix.m12 = direction.x; + m_coordinateSystemMatrix.m22 = direction.y; + m_coordinateSystemMatrix.m32 = direction.z; + + InvalidateCoordinateSystem(); + } + + inline void RenderSystem::InvalidateCoordinateSystem() + { + m_coordinateSystemInvalidated = true; + } } diff --git a/SDK/src/NDK/Components/CameraComponent.cpp b/SDK/src/NDK/Components/CameraComponent.cpp index a976262c4..d408552c5 100644 --- a/SDK/src/NDK/Components/CameraComponent.cpp +++ b/SDK/src/NDK/Components/CameraComponent.cpp @@ -116,9 +116,21 @@ namespace Ndk void CameraComponent::UpdateProjectionMatrix() const { - EnsureViewportUpdate(); // Can affect aspect ratio + switch (m_projectionType) + { + case nzProjectionType_Orthogonal: + EnsureViewportUpdate(); + + m_projectionMatrix.MakeOrtho(0.f, static_cast(m_viewport.width), 0.f, static_cast(m_viewport.height), m_zNear, m_zFar); + break; + + case nzProjectionType_Perspective: + EnsureViewportUpdate(); // Can affect aspect ratio + + m_projectionMatrix.MakePerspective(m_fov, m_aspectRatio, m_zNear, m_zFar); + break; + } - m_projectionMatrix.MakePerspective(m_fov, m_aspectRatio, m_zNear, m_zFar); m_projectionMatrixUpdated = true; } @@ -153,7 +165,8 @@ namespace Ndk { m_aspectRatio = aspectRatio; - InvalidateProjectionMatrix(); + if (m_projectionType == nzProjectionType_Perspective) + InvalidateProjectionMatrix(); } // Convert it back to int diff --git a/SDK/src/NDK/Components/GraphicsComponent.cpp b/SDK/src/NDK/Components/GraphicsComponent.cpp index 13d44577b..ee5658e18 100644 --- a/SDK/src/NDK/Components/GraphicsComponent.cpp +++ b/SDK/src/NDK/Components/GraphicsComponent.cpp @@ -3,15 +3,16 @@ // For conditions of distribution and use, see copyright notice in Prerequesites.hpp #include +#include +#include #include namespace Ndk { void GraphicsComponent::InvalidateRenderableData(const NzInstancedRenderable* renderable, nzUInt32 flags, unsigned int index) { - NazaraUnused(renderable); - NazaraAssert(index < m_renderables.size(), "Invalid renderable index"); + NazaraUnused(renderable); Renderable& r = m_renderables[index]; r.dataUpdated = false; @@ -66,7 +67,9 @@ namespace Ndk { NazaraAssert(m_entity && m_entity->HasComponent(), "GraphicsComponent requires NodeComponent"); - m_transformMatrix = m_entity->GetComponent().GetTransformMatrix(); + Ndk::RenderSystem& renderSystem = m_entity->GetWorld()->GetSystem(); + + m_transformMatrix = renderSystem.GetCoordinateSystemMatrix() * m_entity->GetComponent().GetTransformMatrix(); m_transformMatrixUpdated = true; } diff --git a/SDK/src/NDK/Systems/RenderSystem.cpp b/SDK/src/NDK/Systems/RenderSystem.cpp index 742dcd363..3daa9cf5a 100644 --- a/SDK/src/NDK/Systems/RenderSystem.cpp +++ b/SDK/src/NDK/Systems/RenderSystem.cpp @@ -12,7 +12,9 @@ namespace Ndk { - RenderSystem::RenderSystem() + RenderSystem::RenderSystem() : + m_coordinateSystemMatrix(NzMatrix4f::Identity()), + m_coordinateSystemInvalidated(true) { SetDefaultBackground(NzColorBackground::New()); SetUpdateRate(0.f); @@ -73,6 +75,18 @@ namespace Ndk { NazaraUnused(elapsedTime); + // Invalidate every renderable if the coordinate system changed + if (m_coordinateSystemInvalidated) + { + for (const Ndk::EntityHandle& drawable : m_drawables) + { + GraphicsComponent& graphicsComponent = drawable->GetComponent(); + graphicsComponent.InvalidateTransformMatrix(); + } + + m_coordinateSystemInvalidated = false; + } + UpdatePointSpotShadowMaps(); for (const Ndk::EntityHandle& camera : m_cameras) @@ -84,6 +98,7 @@ namespace Ndk NzAbstractRenderQueue* renderQueue = m_renderTechnique.GetRenderQueue(); renderQueue->Clear(); + //TODO: Culling for (const Ndk::EntityHandle& drawable : m_drawables) { GraphicsComponent& graphicsComponent = drawable->GetComponent(); @@ -97,7 +112,8 @@ namespace Ndk LightComponent& lightComponent = light->GetComponent(); NodeComponent& lightNode = light->GetComponent(); - lightComponent.AddToRenderQueue(renderQueue, lightNode.GetTransformMatrix()); + ///TODO: Cache somehow? + lightComponent.AddToRenderQueue(renderQueue, m_coordinateSystemMatrix * drawableNode.GetTransformMatrix()); } camComponent.ApplyView(); diff --git a/build/scripts/common.lua b/build/scripts/common.lua index e8bcfb6d9..b1da33015 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -134,7 +134,8 @@ function NazaraBuild:Execute() buildoptions("-fvisibility=hidden") configuration("vs*") - buildoptions("/MP") + buildoptions("/MP") -- Multiprocessus build + flags("NoMinimalRebuild") defines("_CRT_SECURE_NO_WARNINGS") defines("_SCL_SECURE_NO_WARNINGS") @@ -246,7 +247,7 @@ function NazaraBuild:Execute() kind("ConsoleApp") elseif (toolTable.Kind == "windowapp") then debugdir(toolTable.Directory) - kind("Window") + kind("WindowedApp") else assert(false, "wut") end @@ -269,47 +270,61 @@ function NazaraBuild:Execute() configuration({"codeblocks or codelite or gmake", "x32"}) libdirs("../extlibs/lib/mingw/x86") libdirs("../lib/mingw/x86") - targetdir("../lib/mingw/x86") + if (toolTable.Kind == "library") then + targetdir("../lib/mingw/x86") + end configuration({"codeblocks or codelite or gmake", "x64"}) libdirs("../extlibs/lib/mingw/x64") libdirs("../lib/mingw/x64") - targetdir("../lib/mingw/x64") + if (toolTable.Kind == "library") then + targetdir("../lib/mingw/x64") + end configuration({"vs*", "x32"}) libdirs("../extlibs/lib/msvc/x86") libdirs("../lib/msvc/x86") - targetdir("../lib/msvc/x86") + if (toolTable.Kind == "library") then + targetdir("../lib/msvc/x86") + end configuration({"vs*", "x64"}) libdirs("../extlibs/lib/msvc/x64") libdirs("../lib/msvc/x64") - targetdir("../lib/msvc/x64") + if (toolTable.Kind == "library") then + targetdir("../lib/msvc/x64") + end configuration({"xcode3 or xcode4", "x32"}) libdirs("../extlibs/lib/xcode/x86") libdirs("../lib/xcode/x86") - targetdir("../lib/xcode/x86") + if (toolTable.Kind == "library") then + targetdir("../lib/xcode/x86") + end configuration({"xcode3 or xcode4", "x64"}) libdirs("../extlibs/lib/xcode/x64") libdirs("../lib/xcode/x64") - targetdir("../lib/xcode/x64") + if (toolTable.Kind == "library") then + targetdir("../lib/xcode/x64") + end - configuration("*Static") - kind("StaticLib") + if (toolTable.Kind == "library") then + configuration("*Static") + kind("StaticLib") - configuration("*Dynamic") - kind("SharedLib") + configuration("*Dynamic") + kind("SharedLib") + + configuration("DebugStatic") + targetsuffix("-s-d") - configuration("DebugStatic") - targetsuffix("-s-d") + configuration("ReleaseStatic") + targetsuffix("-s") - configuration("ReleaseStatic") - targetsuffix("-s") - - configuration("DebugDynamic") - targetsuffix("-d") + configuration("DebugDynamic") + targetsuffix("-d") + end configuration({}) diff --git a/build/scripts/tools/unittests.lua b/build/scripts/tools/unittests.lua new file mode 100644 index 000000000..cc6051297 --- /dev/null +++ b/build/scripts/tools/unittests.lua @@ -0,0 +1,27 @@ +TOOL.Name = "UnitTests" + +TOOL.Directory = "../tests" +TOOL.Kind = "ConsoleApp" + +TOOL.Defines = { +} + +TOOL.Includes = { + "../include" +} + +TOOL.Files = { + "../tests/main.cpp", + "../tests/Engine/**.cpp" +} + +TOOL.Libraries = { + "NazaraCore", + "NazaraAudio", + "NazaraLua", + "NazaraNoise", + "NazaraPhysics", + "NazaraUtility", + "NazaraRenderer", + "NazaraGraphics" +} diff --git a/include/Nazara/Audio/SoundBuffer.hpp b/include/Nazara/Audio/SoundBuffer.hpp index 9fda02538..4016cf60d 100644 --- a/include/Nazara/Audio/SoundBuffer.hpp +++ b/include/Nazara/Audio/SoundBuffer.hpp @@ -70,8 +70,8 @@ class NAZARA_AUDIO_API NzSoundBuffer : public NzRefCounted, public NzResource, N template static NzSoundBufferRef New(Args&&... args); // Signals: - NazaraSignal(OnSoundBufferDestroy, const NzSoundBuffer*); //< Args: me - NazaraSignal(OnSoundBufferRelease, const NzSoundBuffer*); //< Args: me + NazaraSignal(OnSoundBufferDestroy, const NzSoundBuffer* /*soundBuffer*/); + NazaraSignal(OnSoundBufferRelease, const NzSoundBuffer* /*soundBuffer*/); private: unsigned int GetOpenALBuffer() const; diff --git a/include/Nazara/Core/Bitset.inl b/include/Nazara/Core/Bitset.inl index e439dfc80..eb7720015 100644 --- a/include/Nazara/Core/Bitset.inl +++ b/include/Nazara/Core/Bitset.inl @@ -245,7 +245,7 @@ template void NzBitset::Resize(unsigned int bitCount, bool defaultVal) { // On commence par changer la taille du conteneur, avec la valeur correcte d'initialisation - unsigned int lastBlockIndex = m_blocks.size()-1; + unsigned int lastBlockIndex = m_blocks.size() - 1; m_blocks.resize(ComputeBlockCount(bitCount), (defaultVal) ? fullBitMask : 0U); unsigned int remainingBits = GetBitIndex(m_bitCount); @@ -304,7 +304,7 @@ template void NzBitset::Swap(NzBitset& bitset) { std::swap(m_bitCount, bitset.m_bitCount); - std::swap(m_blocks, bitset.m_blocks); + std::swap(m_blocks, bitset.m_blocks); } template @@ -358,7 +358,7 @@ T NzBitset::To() const { static_assert(std::is_integral() && std::is_unsigned(), "T must be a unsigned integral type"); - NazaraAssert(m_bitCount <= std::numeric_limits::digits, "Bit count cannot be greater than UInt32 bit count"); + NazaraAssert(m_bitCount <= std::numeric_limits::digits, "Bit count cannot be greater than T bit count"); T value = 0; for (unsigned int i = 0; i < m_blocks.size(); ++i) diff --git a/include/Nazara/Core/ByteArray.inl b/include/Nazara/Core/ByteArray.inl index 122f8af9e..6c8d97f35 100644 --- a/include/Nazara/Core/ByteArray.inl +++ b/include/Nazara/Core/ByteArray.inl @@ -65,6 +65,16 @@ inline NzByteArray::iterator NzByteArray::Erase(const_iterator first, const_iter return m_array.erase(first, last); } +inline NzByteArray::reference NzByteArray::Front() +{ + return m_array.front(); +} + +inline NzByteArray::const_reference NzByteArray::Front() const +{ + return m_array.front(); +} + inline NzByteArray::allocator_type NzByteArray::GetAllocator() const { return m_array.get_allocator(); diff --git a/include/Nazara/Core/String.hpp b/include/Nazara/Core/String.hpp index 1efdb396b..f6e209c3f 100644 --- a/include/Nazara/Core/String.hpp +++ b/include/Nazara/Core/String.hpp @@ -307,7 +307,7 @@ class NAZARA_CORE_API NzString : public NzHashable bool FillHash(NzAbstractHash* hash) const; inline void ReleaseString(); - static std::shared_ptr GetEmptyString(); + static const std::shared_ptr& GetEmptyString(); std::shared_ptr m_sharedString; diff --git a/include/Nazara/Graphics/Enums.hpp b/include/Nazara/Graphics/Enums.hpp index 70002d7cf..aa1d62254 100644 --- a/include/Nazara/Graphics/Enums.hpp +++ b/include/Nazara/Graphics/Enums.hpp @@ -17,6 +17,14 @@ enum nzBackgroundType nzBackgroundType_Max = nzBackgroundType_User }; +enum nzProjectionType +{ + nzProjectionType_Orthogonal, + nzProjectionType_Perspective, + + nzProjectionType_Max = nzProjectionType_Perspective +}; + enum nzLightType { nzLightType_Directional, diff --git a/include/Nazara/Graphics/InstancedRenderable.hpp b/include/Nazara/Graphics/InstancedRenderable.hpp index 2851fd3bb..79dd50a5c 100644 --- a/include/Nazara/Graphics/InstancedRenderable.hpp +++ b/include/Nazara/Graphics/InstancedRenderable.hpp @@ -46,8 +46,8 @@ class NAZARA_GRAPHICS_API NzInstancedRenderable : public NzRefCounted inline NzInstancedRenderable& operator=(const NzInstancedRenderable& renderable); // Signals: - NazaraSignal(OnInstancedRenderableInvalidateData, const NzInstancedRenderable*, nzUInt32); //< Args: me, flags - NazaraSignal(OnInstancedRenderableRelease, const NzInstancedRenderable*); //< Args: me + NazaraSignal(OnInstancedRenderableInvalidateData, const NzInstancedRenderable* /*instancedRenderable*/, nzUInt32 /*flags*/); + NazaraSignal(OnInstancedRenderableRelease, const NzInstancedRenderable* /*instancedRenderable*/); struct InstanceData { diff --git a/include/Nazara/Graphics/Material.hpp b/include/Nazara/Graphics/Material.hpp index bdd6e8fcc..ec0460e88 100644 --- a/include/Nazara/Graphics/Material.hpp +++ b/include/Nazara/Graphics/Material.hpp @@ -148,9 +148,9 @@ class NAZARA_GRAPHICS_API NzMaterial : public NzRefCounted, public NzResource static NzMaterialRef GetDefault(); template static NzMaterialRef New(Args&&... args); - // Signals - NazaraSignal(OnMaterialRelease, const NzMaterial*); //< Args: me - NazaraSignal(OnMaterialReset, const NzMaterial*); //< Args: me + // Signals: + NazaraSignal(OnMaterialRelease, const NzMaterial* /*material*/); + NazaraSignal(OnMaterialReset, const NzMaterial* /*material*/); private: struct ShaderInstance diff --git a/include/Nazara/Graphics/ParticleController.hpp b/include/Nazara/Graphics/ParticleController.hpp index 2481f759d..eb35416fa 100644 --- a/include/Nazara/Graphics/ParticleController.hpp +++ b/include/Nazara/Graphics/ParticleController.hpp @@ -35,7 +35,7 @@ class NAZARA_GRAPHICS_API NzParticleController : public NzRefCounted virtual void Apply(NzParticleSystem& system, NzParticleMapper& mapper, unsigned int startId, unsigned int endId, float elapsedTime) = 0; // Signals: - NazaraSignal(OnParticleControllerRelease, const NzParticleController*); //< Args: me + NazaraSignal(OnParticleControllerRelease, const NzParticleController* /*particleController*/); private: static bool Initialize(); diff --git a/include/Nazara/Graphics/ParticleDeclaration.hpp b/include/Nazara/Graphics/ParticleDeclaration.hpp index b45e82526..4b63dc568 100644 --- a/include/Nazara/Graphics/ParticleDeclaration.hpp +++ b/include/Nazara/Graphics/ParticleDeclaration.hpp @@ -45,8 +45,8 @@ class NAZARA_GRAPHICS_API NzParticleDeclaration : public NzRefCounted static NzParticleDeclaration* Get(nzParticleLayout layout); static bool IsTypeSupported(nzComponentType type); - // Signals - NazaraSignal(OnParticleDeclarationRelease, const NzParticleDeclaration*); //< Args: me + // Signals: + NazaraSignal(OnParticleDeclarationRelease, const NzParticleDeclaration* /*particleDeclaration*/); private: static bool Initialize(); diff --git a/include/Nazara/Graphics/ParticleGenerator.hpp b/include/Nazara/Graphics/ParticleGenerator.hpp index f4a3c22d6..30f379a66 100644 --- a/include/Nazara/Graphics/ParticleGenerator.hpp +++ b/include/Nazara/Graphics/ParticleGenerator.hpp @@ -35,7 +35,7 @@ class NAZARA_GRAPHICS_API NzParticleGenerator : public NzRefCounted virtual void Generate(NzParticleSystem& system, NzParticleMapper& mapper, unsigned int startId, unsigned int endId) = 0; // Signals: - NazaraSignal(OnParticleGeneratorRelease, const NzParticleGenerator*); //< Args: me + NazaraSignal(OnParticleGeneratorRelease, const NzParticleGenerator* /*particleGenerator*/); private: static bool Initialize(); diff --git a/include/Nazara/Graphics/ParticleRenderer.hpp b/include/Nazara/Graphics/ParticleRenderer.hpp index fc5d52c51..e3e2082e7 100644 --- a/include/Nazara/Graphics/ParticleRenderer.hpp +++ b/include/Nazara/Graphics/ParticleRenderer.hpp @@ -36,7 +36,7 @@ class NAZARA_GRAPHICS_API NzParticleRenderer : public NzRefCounted virtual void Render(const NzParticleSystem& system, const NzParticleMapper& mapper, unsigned int startId, unsigned int endId, NzAbstractRenderQueue* renderQueue) = 0; // Signals: - NazaraSignal(OnParticleRendererRelease, const NzParticleRenderer*); //< Args: me + NazaraSignal(OnParticleRendererRelease, const NzParticleRenderer* /*particleRenderer*/); private: static bool Initialize(); diff --git a/include/Nazara/Physics/Geom.hpp b/include/Nazara/Physics/Geom.hpp index 67c849798..511b7019d 100644 --- a/include/Nazara/Physics/Geom.hpp +++ b/include/Nazara/Physics/Geom.hpp @@ -51,7 +51,8 @@ class NAZARA_PHYSICS_API NzPhysGeom : public NzRefCounted, NzNonCopyable static NzPhysGeomRef Build(const NzPrimitiveList& list); - NazaraSignal(OnPhysGeomRelease, const NzPhysGeom*); //< Args: me + // Signals: + NazaraSignal(OnPhysGeomRelease, const NzPhysGeom* /*physGeom*/); protected: virtual NewtonCollision* CreateHandle(NzPhysWorld* world) const = 0; @@ -217,6 +218,8 @@ class NAZARA_PHYSICS_API NzNullGeom : public NzPhysGeom public: NzNullGeom(); + void ComputeInertialMatrix(NzVector3f* inertia, NzVector3f* center) const; + nzGeomType GetType() const override; template static NzNullGeomRef New(Args&&... args); diff --git a/include/Nazara/Renderer/Context.hpp b/include/Nazara/Renderer/Context.hpp index 2e59ba110..4abf66c42 100644 --- a/include/Nazara/Renderer/Context.hpp +++ b/include/Nazara/Renderer/Context.hpp @@ -47,9 +47,9 @@ class NAZARA_RENDERER_API NzContext : public NzRefCounted static const NzContext* GetReference(); static const NzContext* GetThreadContext(); - // Signals - NazaraSignal(OnContextDestroy, const NzContext*); //< Args: me - NazaraSignal(OnContextRelease, const NzContext*); //< Args: me + // Signals: + NazaraSignal(OnContextDestroy, const NzContext* /*context*/); + NazaraSignal(OnContextRelease, const NzContext* /*context*/); private: static bool Initialize(); diff --git a/include/Nazara/Renderer/RenderBuffer.hpp b/include/Nazara/Renderer/RenderBuffer.hpp index d02458d7e..ea99c74c1 100644 --- a/include/Nazara/Renderer/RenderBuffer.hpp +++ b/include/Nazara/Renderer/RenderBuffer.hpp @@ -46,9 +46,9 @@ class NAZARA_RENDERER_API NzRenderBuffer : public NzRefCounted, NzNonCopyable static bool IsSupported(); template static NzRenderBufferRef New(Args&&... args); - // Signals - NazaraSignal(OnRenderBufferDestroy, const NzRenderBuffer*); //< Args: me - NazaraSignal(OnRenderBufferRelease, const NzRenderBuffer*); //< Args: me + // Signals: + NazaraSignal(OnRenderBufferDestroy, const NzRenderBuffer* /*renderBuffer*/); + NazaraSignal(OnRenderBufferRelease, const NzRenderBuffer* /*renderBuffer*/); private: static bool Initialize(); diff --git a/include/Nazara/Renderer/RenderTarget.hpp b/include/Nazara/Renderer/RenderTarget.hpp index 52806b2aa..2e9be52a7 100644 --- a/include/Nazara/Renderer/RenderTarget.hpp +++ b/include/Nazara/Renderer/RenderTarget.hpp @@ -35,10 +35,10 @@ class NAZARA_RENDERER_API NzRenderTarget // Fonctions OpenGL virtual bool HasContext() const = 0; - // Signals - NazaraSignal(OnRenderTargetParametersChange, const NzRenderTarget*); //< Args: me - NazaraSignal(OnRenderTargetRelease, const NzRenderTarget*); //< Args: me - NazaraSignal(OnRenderTargetSizeChange, const NzRenderTarget*); //< Args: me + // Signals: + NazaraSignal(OnRenderTargetParametersChange, const NzRenderTarget* /*renderTarget*/); + NazaraSignal(OnRenderTargetRelease, const NzRenderTarget* /*renderTarget*/); + NazaraSignal(OnRenderTargetSizeChange, const NzRenderTarget* /*renderTarget*/); protected: virtual bool Activate() const = 0; diff --git a/include/Nazara/Renderer/Shader.hpp b/include/Nazara/Renderer/Shader.hpp index 3057943ac..56c3c9545 100644 --- a/include/Nazara/Renderer/Shader.hpp +++ b/include/Nazara/Renderer/Shader.hpp @@ -103,10 +103,10 @@ class NAZARA_RENDERER_API NzShader : public NzRefCounted, NzNonCopyable static bool IsStageSupported(nzShaderStage stage); template static NzShaderRef New(Args&&... args); - // Signals - NazaraSignal(OnShaderDestroy, const NzShader*); //< Args: me - NazaraSignal(OnShaderRelease, const NzShader*); //< Args: me - NazaraSignal(OnShaderUniformInvalidated, const NzShader*); //< Args: me + // Signals: + NazaraSignal(OnShaderDestroy, const NzShader* /*shader*/); + NazaraSignal(OnShaderRelease, const NzShader* /*shader*/); + NazaraSignal(OnShaderUniformInvalidated, const NzShader* /*shader*/); private: bool PostLinkage(); diff --git a/include/Nazara/Renderer/Texture.hpp b/include/Nazara/Renderer/Texture.hpp index f12cb74c6..8ff2205c0 100644 --- a/include/Nazara/Renderer/Texture.hpp +++ b/include/Nazara/Renderer/Texture.hpp @@ -108,9 +108,9 @@ class NAZARA_RENDERER_API NzTexture : public NzAbstractImage, public NzRefCounte static bool IsTypeSupported(nzImageType type); template static NzTextureRef New(Args&&... args); - // Signals - NazaraSignal(OnTextureDestroy, const NzTexture*); //< Args: me - NazaraSignal(OnTextureRelease, const NzTexture*); //< Args: me + // Signals: + NazaraSignal(OnTextureDestroy, const NzTexture* /*texture*/); + NazaraSignal(OnTextureRelease, const NzTexture* /*texture*/); private: bool CreateTexture(bool proxy); diff --git a/include/Nazara/Renderer/UberShader.hpp b/include/Nazara/Renderer/UberShader.hpp index 7663e0e17..99258223e 100644 --- a/include/Nazara/Renderer/UberShader.hpp +++ b/include/Nazara/Renderer/UberShader.hpp @@ -32,7 +32,8 @@ class NAZARA_RENDERER_API NzUberShader : public NzRefCounted virtual NzUberShaderInstance* Get(const NzParameterList& parameters) const = 0; - NazaraSignal(OnUberShaderRelease, const NzUberShader*); //< Args: me + // Signals: + NazaraSignal(OnUberShaderRelease, const NzUberShader* /*uberShader*/); private: static bool Initialize(); diff --git a/include/Nazara/Renderer/UberShaderPreprocessor.hpp b/include/Nazara/Renderer/UberShaderPreprocessor.hpp index eeae1ffdc..7e2042887 100644 --- a/include/Nazara/Renderer/UberShaderPreprocessor.hpp +++ b/include/Nazara/Renderer/UberShaderPreprocessor.hpp @@ -36,7 +36,7 @@ class NAZARA_RENDERER_API NzUberShaderPreprocessor : public NzUberShader template static NzUberShaderPreprocessorRef New(Args&&... args); // Signals: - NazaraSignal(OnUberShaderPreprocessorRelease, const NzUberShaderPreprocessor*); //< Args: me + NazaraSignal(OnUberShaderPreprocessorRelease, const NzUberShaderPreprocessor* /*uberShaderPreprocessor*/); private: struct Shader diff --git a/include/Nazara/Utility/AbstractAtlas.hpp b/include/Nazara/Utility/AbstractAtlas.hpp index 4c73a916e..1b1b28a36 100644 --- a/include/Nazara/Utility/AbstractAtlas.hpp +++ b/include/Nazara/Utility/AbstractAtlas.hpp @@ -31,9 +31,10 @@ class NAZARA_UTILITY_API NzAbstractAtlas virtual nzUInt32 GetStorage() const = 0; virtual bool Insert(const NzImage& image, NzRectui* rect, bool* flipped, unsigned int* layerIndex) = 0; - NazaraSignal(OnAtlasCleared, const NzAbstractAtlas*); //< Args: me - NazaraSignal(OnAtlasLayerChange, const NzAbstractAtlas*, NzAbstractImage*, NzAbstractImage*); //< Args: me, oldLayer, newLayer - NazaraSignal(OnAtlasRelease, const NzAbstractAtlas*); //< Args: me + // Signals: + NazaraSignal(OnAtlasCleared, const NzAbstractAtlas* /*atlas*/); + NazaraSignal(OnAtlasLayerChange, const NzAbstractAtlas* /*atlas*/, NzAbstractImage* /*oldLayer*/, NzAbstractImage* /*newLayer*/); + NazaraSignal(OnAtlasRelease, const NzAbstractAtlas* /*atlas*/); }; #endif // NAZARA_ABSTRACTATLAS_HPP diff --git a/include/Nazara/Utility/Animation.hpp b/include/Nazara/Utility/Animation.hpp index 1a74bf407..6e6bd9c84 100644 --- a/include/Nazara/Utility/Animation.hpp +++ b/include/Nazara/Utility/Animation.hpp @@ -88,9 +88,9 @@ class NAZARA_UTILITY_API NzAnimation : public NzRefCounted, public NzResource template static NzAnimationRef New(Args&&... args); - // Signals - NazaraSignal(OnAnimationDestroy, const NzAnimation*); //< Args: me - NazaraSignal(OnAnimationRelease, const NzAnimation*); //< Args: me + // Signals: + NazaraSignal(OnAnimationDestroy, const NzAnimation* /*animation*/); + NazaraSignal(OnAnimationRelease, const NzAnimation* /*animation*/); private: static bool Initialize(); diff --git a/include/Nazara/Utility/Buffer.hpp b/include/Nazara/Utility/Buffer.hpp index 16f8a014b..3dd352307 100644 --- a/include/Nazara/Utility/Buffer.hpp +++ b/include/Nazara/Utility/Buffer.hpp @@ -61,8 +61,8 @@ class NAZARA_UTILITY_API NzBuffer : public NzRefCounted, NzNonCopyable static void SetBufferFactory(nzUInt32 storage, BufferFactory func); // Signals: - NazaraSignal(OnBufferDestroy, const NzBuffer*); //< Args: me - NazaraSignal(OnBufferRelease, const NzBuffer*); //< Args: me + NazaraSignal(OnBufferDestroy, const NzBuffer* /*buffer*/); + NazaraSignal(OnBufferRelease, const NzBuffer* /*buffer*/); private: static bool Initialize(); diff --git a/include/Nazara/Utility/Font.hpp b/include/Nazara/Utility/Font.hpp index bf904347b..dc5544dff 100644 --- a/include/Nazara/Utility/Font.hpp +++ b/include/Nazara/Utility/Font.hpp @@ -112,13 +112,14 @@ class NAZARA_UTILITY_API NzFont : public NzRefCounted, public NzResource, NzNonC float underlineThickness; }; - NazaraSignal(OnFontAtlasChanged, const NzFont*); //< Args: me - NazaraSignal(OnFontAtlasLayerChanged, const NzFont*, NzAbstractImage*, NzAbstractImage*); //< Args: me, old layer, new layer - NazaraSignal(OnFontDestroy, const NzFont*); //< Args: me - NazaraSignal(OnFontGlyphCacheCleared, const NzFont*); //< Args: me - NazaraSignal(OnFontKerningCacheCleared, const NzFont*); //< Args: me - NazaraSignal(OnFontRelease, const NzFont*); //< Args: me - NazaraSignal(OnFontSizeInfoCacheCleared, const NzFont*); //< Args: me + // Signals: + NazaraSignal(OnFontAtlasChanged, const NzFont* /*font*/); + NazaraSignal(OnFontAtlasLayerChanged, const NzFont* /*font*/, NzAbstractImage* /*oldLayer*/, NzAbstractImage* /*newLayer*/); + NazaraSignal(OnFontDestroy, const NzFont* /*font*/); + NazaraSignal(OnFontGlyphCacheCleared, const NzFont* /*font*/); + NazaraSignal(OnFontKerningCacheCleared, const NzFont* /*font*/); + NazaraSignal(OnFontRelease, const NzFont* /*font*/); + NazaraSignal(OnFontSizeInfoCacheCleared, const NzFont* /*font*/); private: using GlyphMap = std::unordered_map; diff --git a/include/Nazara/Utility/Image.hpp b/include/Nazara/Utility/Image.hpp index c4b63d1b8..67efac84e 100644 --- a/include/Nazara/Utility/Image.hpp +++ b/include/Nazara/Utility/Image.hpp @@ -147,8 +147,8 @@ class NAZARA_UTILITY_API NzImage : public NzAbstractImage, public NzRefCounted, static SharedImage emptyImage; // Signals: - NazaraSignal(OnImageDestroy, const NzImage*); //< Args: me - NazaraSignal(OnImageRelease, const NzImage*); //< Args: me + NazaraSignal(OnImageDestroy, const NzImage* /*image*/); + NazaraSignal(OnImageRelease, const NzImage* /*image*/); private: void EnsureOwnership(); diff --git a/include/Nazara/Utility/IndexBuffer.hpp b/include/Nazara/Utility/IndexBuffer.hpp index 9edc78131..2e92ef49b 100644 --- a/include/Nazara/Utility/IndexBuffer.hpp +++ b/include/Nazara/Utility/IndexBuffer.hpp @@ -64,8 +64,8 @@ class NAZARA_UTILITY_API NzIndexBuffer : public NzRefCounted template static NzIndexBufferRef New(Args&&... args); - // Signals - NazaraSignal(OnIndexBufferRelease, const NzIndexBuffer*); //< Args: me + // Signals: + NazaraSignal(OnIndexBufferRelease, const NzIndexBuffer* /*indexBuffer*/); private: NzBufferRef m_buffer; diff --git a/include/Nazara/Utility/Mesh.hpp b/include/Nazara/Utility/Mesh.hpp index ccb1d67e8..0bb29401d 100644 --- a/include/Nazara/Utility/Mesh.hpp +++ b/include/Nazara/Utility/Mesh.hpp @@ -129,8 +129,8 @@ class NAZARA_UTILITY_API NzMesh : public NzRefCounted, public NzResource template static NzMeshRef New(Args&&... args); // Signals: - NazaraSignal(OnMeshDestroy, const NzMesh*); //< Args: me - NazaraSignal(OnMeshRelease, const NzMesh*); //< Args: me + NazaraSignal(OnMeshDestroy, const NzMesh* /*mesh*/); + NazaraSignal(OnMeshRelease, const NzMesh* /*mesh*/); private: NzMeshImpl* m_impl = nullptr; diff --git a/include/Nazara/Utility/Node.hpp b/include/Nazara/Utility/Node.hpp index 4a13fd918..016eb0047 100644 --- a/include/Nazara/Utility/Node.hpp +++ b/include/Nazara/Utility/Node.hpp @@ -92,9 +92,9 @@ class NAZARA_UTILITY_API NzNode NzNode& operator=(const NzNode& node); // Signals: - NazaraSignal(OnNodeInvalidation, const NzNode*); //< Args: me - NazaraSignal(OnNodeNewParent, const NzNode*, const NzNode*); //< Args: me, new parent - NazaraSignal(OnNodeRelease, const NzNode*); //< Args: me + NazaraSignal(OnNodeInvalidation, const NzNode* /*node*/); + NazaraSignal(OnNodeNewParent, const NzNode* /*node*/, const NzNode* /*parent*/); + NazaraSignal(OnNodeRelease, const NzNode* /*node*/); protected: void AddChild(NzNode* node) const; diff --git a/include/Nazara/Utility/SkeletalMesh.hpp b/include/Nazara/Utility/SkeletalMesh.hpp index ba7a617a9..187fb9411 100644 --- a/include/Nazara/Utility/SkeletalMesh.hpp +++ b/include/Nazara/Utility/SkeletalMesh.hpp @@ -42,8 +42,8 @@ class NAZARA_UTILITY_API NzSkeletalMesh final : public NzSubMesh template static NzSkeletalMeshRef New(Args&&... args); // Signals: - NazaraSignal(OnSkeletalMeshDestroy, const NzSkeletalMesh*); //< Args: me - NazaraSignal(OnSkeletalMeshRelease, const NzSkeletalMesh*); //< Args: me + NazaraSignal(OnSkeletalMeshDestroy, const NzSkeletalMesh* /*skeletalMesh*/); + NazaraSignal(OnSkeletalMeshRelease, const NzSkeletalMesh* /*skeletalMesh*/); private: NzBoxf m_aabb; diff --git a/include/Nazara/Utility/Skeleton.hpp b/include/Nazara/Utility/Skeleton.hpp index fc386eb76..2a88d5feb 100644 --- a/include/Nazara/Utility/Skeleton.hpp +++ b/include/Nazara/Utility/Skeleton.hpp @@ -58,9 +58,9 @@ class NAZARA_UTILITY_API NzSkeleton : public NzRefCounted template static NzSkeletonRef New(Args&&... args); // Signals: - NazaraSignal(OnSkeletonDestroy, const NzSkeleton*); //< Args: me - NazaraSignal(OnSkeletonJointsInvalidated, const NzSkeleton*); //< Args: me - NazaraSignal(OnSkeletonRelease, const NzSkeleton*); //< Args: me + NazaraSignal(OnSkeletonDestroy, const NzSkeleton* /*skeleton*/); + NazaraSignal(OnSkeletonJointsInvalidated, const NzSkeleton* /*skeleton*/); + NazaraSignal(OnSkeletonRelease, const NzSkeleton* /*skeleton*/); private: void InvalidateJoints(); diff --git a/include/Nazara/Utility/StaticMesh.hpp b/include/Nazara/Utility/StaticMesh.hpp index 9d4f8d548..dfc92b8b4 100644 --- a/include/Nazara/Utility/StaticMesh.hpp +++ b/include/Nazara/Utility/StaticMesh.hpp @@ -45,8 +45,8 @@ class NAZARA_UTILITY_API NzStaticMesh final : public NzSubMesh template static NzStaticMeshRef New(Args&&... args); // Signals: - NazaraSignal(OnStaticMeshDestroy, const NzStaticMesh*); //< Args: me - NazaraSignal(OnStaticMeshRelease, const NzStaticMesh*); //< Args: me + NazaraSignal(OnStaticMeshDestroy, const NzStaticMesh* /*staticMesh*/); + NazaraSignal(OnStaticMeshRelease, const NzStaticMesh* /*staticMesh*/); private: NzBoxf m_aabb; diff --git a/include/Nazara/Utility/SubMesh.hpp b/include/Nazara/Utility/SubMesh.hpp index f46727d5f..c039dec0c 100644 --- a/include/Nazara/Utility/SubMesh.hpp +++ b/include/Nazara/Utility/SubMesh.hpp @@ -49,7 +49,7 @@ class NAZARA_UTILITY_API NzSubMesh : public NzRefCounted void SetPrimitiveMode(nzPrimitiveMode mode); // Signals: - NazaraSignal(OnSubMeshRelease, const NzSubMesh*); //< Args: me + NazaraSignal(OnSubMeshRelease, const NzSubMesh* /*subMesh*/); protected: nzPrimitiveMode m_primitiveMode; diff --git a/include/Nazara/Utility/VertexBuffer.hpp b/include/Nazara/Utility/VertexBuffer.hpp index 8bc4b4ad0..ee7de3dc0 100644 --- a/include/Nazara/Utility/VertexBuffer.hpp +++ b/include/Nazara/Utility/VertexBuffer.hpp @@ -62,8 +62,8 @@ class NAZARA_UTILITY_API NzVertexBuffer : public NzRefCounted template static NzVertexBufferRef New(Args&&... args); - // Signals - NazaraSignal(OnVertexBufferRelease, const NzVertexBuffer*); //< Args: me + // Signals: + NazaraSignal(OnVertexBufferRelease, const NzVertexBuffer* /*vertexBuffer*/); private: NzBufferRef m_buffer; diff --git a/include/Nazara/Utility/VertexDeclaration.hpp b/include/Nazara/Utility/VertexDeclaration.hpp index e58da9947..9ba9edda9 100644 --- a/include/Nazara/Utility/VertexDeclaration.hpp +++ b/include/Nazara/Utility/VertexDeclaration.hpp @@ -45,8 +45,8 @@ class NAZARA_UTILITY_API NzVertexDeclaration : public NzRefCounted static bool IsTypeSupported(nzComponentType type); template static NzVertexDeclarationRef New(Args&&... args); - // Signals - NazaraSignal(OnVertexDeclarationRelease, const NzVertexDeclaration*); //< Args: me + // Signals: + NazaraSignal(OnVertexDeclarationRelease, const NzVertexDeclaration* /*vertexDeclaration*/); private: static bool Initialize(); diff --git a/src/Nazara/Core/String.cpp b/src/Nazara/Core/String.cpp index a1ba87b84..1566b32a5 100644 --- a/src/Nazara/Core/String.cpp +++ b/src/Nazara/Core/String.cpp @@ -1934,7 +1934,7 @@ bool NzString::IsEmpty() const bool NzString::IsNull() const { - return !m_sharedString.get(); + return m_sharedString.get() == GetEmptyString().get(); } bool NzString::IsNumber(nzUInt8 base, nzUInt32 flags) const @@ -2609,7 +2609,7 @@ NzString& NzString::Set(unsigned int rep, const char* string, unsigned int lengt if (totalSize > 0) { if (m_sharedString->capacity >= totalSize) - { + { EnsureOwnership(true); m_sharedString->size = totalSize; @@ -2642,7 +2642,7 @@ NzString& NzString::Set(const char* string, unsigned int length) if (length > 0) { if (m_sharedString->capacity >= length) - { + { EnsureOwnership(true); m_sharedString->size = length; @@ -4198,7 +4198,7 @@ bool NzString::FillHash(NzAbstractHash* hash) const return true; } -std::shared_ptr NzString::GetEmptyString() +const std::shared_ptr& NzString::GetEmptyString() { static auto emptyString = std::make_shared(); diff --git a/src/Nazara/Physics/Geom.cpp b/src/Nazara/Physics/Geom.cpp index 5fcf4e8bf..e2676a0df 100644 --- a/src/Nazara/Physics/Geom.cpp +++ b/src/Nazara/Physics/Geom.cpp @@ -379,6 +379,15 @@ nzGeomType NzNullGeom::GetType() const return nzGeomType_Null; } +void NzNullGeom::ComputeInertialMatrix(NzVector3f* inertia, NzVector3f* center) const +{ + if (inertia) + inertia->MakeUnit(); + + if (center) + center->MakeZero(); +} + NewtonCollision* NzNullGeom::CreateHandle(NzPhysWorld* world) const { return NewtonCreateNull(world->GetHandle()); diff --git a/tests/Nazara/Core/ByteArray.cpp b/tests/Engine/Core/ByteArray.cpp similarity index 99% rename from tests/Nazara/Core/ByteArray.cpp rename to tests/Engine/Core/ByteArray.cpp index b2b97fe08..54c8754f5 100644 --- a/tests/Nazara/Core/ByteArray.cpp +++ b/tests/Engine/Core/ByteArray.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/tests/Nazara/Core/Clock.cpp b/tests/Engine/Core/Clock.cpp similarity index 81% rename from tests/Nazara/Core/Clock.cpp rename to tests/Engine/Core/Clock.cpp index 9f33a002d..140b2cf57 100644 --- a/tests/Nazara/Core/Clock.cpp +++ b/tests/Engine/Core/Clock.cpp @@ -1,7 +1,6 @@ #include -#include - -#include +#include +#include SCENARIO("Clock", "[CORE][CLOCK]") { @@ -22,7 +21,7 @@ SCENARIO("Clock", "[CORE][CLOCK]") clock.Unpause(); THEN("Time must not be the initialTime") { - std::this_thread::sleep_for(std::chrono::microseconds(10)); + NzThread::Sleep(1); REQUIRE(clock.GetMicroseconds() != initialTime); } } diff --git a/tests/Nazara/Core/Color.cpp b/tests/Engine/Core/Color.cpp similarity index 93% rename from tests/Nazara/Core/Color.cpp rename to tests/Engine/Core/Color.cpp index a07610839..36e988613 100644 --- a/tests/Nazara/Core/Color.cpp +++ b/tests/Engine/Core/Color.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Color", "[CORE][COLOR]") { diff --git a/tests/Nazara/Core/Directory.cpp b/tests/Engine/Core/Directory.cpp similarity index 96% rename from tests/Nazara/Core/Directory.cpp rename to tests/Engine/Core/Directory.cpp index 203529bb1..4b152776d 100644 --- a/tests/Nazara/Core/Directory.cpp +++ b/tests/Engine/Core/Directory.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Directory", "[CORE][DIRECTORY]") { diff --git a/tests/Nazara/Core/Error.cpp b/tests/Engine/Core/Error.cpp similarity index 97% rename from tests/Nazara/Core/Error.cpp rename to tests/Engine/Core/Error.cpp index c05e695be..fd1a8fa91 100644 --- a/tests/Nazara/Core/Error.cpp +++ b/tests/Engine/Core/Error.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Error", "[CORE][ERROR]") { diff --git a/tests/Nazara/Core/File.cpp b/tests/Engine/Core/File.cpp similarity index 97% rename from tests/Nazara/Core/File.cpp rename to tests/Engine/Core/File.cpp index 1527632f8..7da5ad689 100644 --- a/tests/Nazara/Core/File.cpp +++ b/tests/Engine/Core/File.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("File", "[CORE][FILE]") { diff --git a/tests/Nazara/Core/String.cpp b/tests/Engine/Core/String.cpp similarity index 99% rename from tests/Nazara/Core/String.cpp rename to tests/Engine/Core/String.cpp index 88daf56da..80e227ef1 100644 --- a/tests/Nazara/Core/String.cpp +++ b/tests/Engine/Core/String.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("String", "[CORE][STRING]") { diff --git a/tests/Nazara/Core/StringStream.cpp b/tests/Engine/Core/StringStream.cpp similarity index 98% rename from tests/Nazara/Core/StringStream.cpp rename to tests/Engine/Core/StringStream.cpp index 62f0b794e..b5d1f56dc 100644 --- a/tests/Nazara/Core/StringStream.cpp +++ b/tests/Engine/Core/StringStream.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("StringStream", "[CORE][STRINGSTREAM]") { diff --git a/tests/Nazara/Math/Algorithm.cpp b/tests/Engine/Math/Algorithm.cpp similarity index 99% rename from tests/Nazara/Math/Algorithm.cpp rename to tests/Engine/Math/Algorithm.cpp index 8683a3058..f0bcbc0f1 100644 --- a/tests/Nazara/Math/Algorithm.cpp +++ b/tests/Engine/Math/Algorithm.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST_CASE("Approach", "[MATH][ALGORITHM]" ) { diff --git a/tests/Nazara/Math/BoundingVolume.cpp b/tests/Engine/Math/BoundingVolume.cpp similarity index 98% rename from tests/Nazara/Math/BoundingVolume.cpp rename to tests/Engine/Math/BoundingVolume.cpp index 57c82cfeb..895999536 100644 --- a/tests/Nazara/Math/BoundingVolume.cpp +++ b/tests/Engine/Math/BoundingVolume.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("BoundingVolume", "[MATH][BOUNDINGVOLUME]") { diff --git a/tests/Nazara/Math/Box.cpp b/tests/Engine/Math/Box.cpp similarity index 99% rename from tests/Nazara/Math/Box.cpp rename to tests/Engine/Math/Box.cpp index 724fe1ec5..89e65e0c0 100644 --- a/tests/Nazara/Math/Box.cpp +++ b/tests/Engine/Math/Box.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Box", "[MATH][BOX]") { diff --git a/tests/Nazara/Math/EulerAngles.cpp b/tests/Engine/Math/EulerAngles.cpp similarity index 98% rename from tests/Nazara/Math/EulerAngles.cpp rename to tests/Engine/Math/EulerAngles.cpp index 6a4508179..62ee61340 100644 --- a/tests/Nazara/Math/EulerAngles.cpp +++ b/tests/Engine/Math/EulerAngles.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("EulerAngles", "[MATH][EULERANGLES]") { diff --git a/tests/Nazara/Math/Frustum.cpp b/tests/Engine/Math/Frustum.cpp similarity index 99% rename from tests/Nazara/Math/Frustum.cpp rename to tests/Engine/Math/Frustum.cpp index ae13afe7b..3b4494fb3 100644 --- a/tests/Nazara/Math/Frustum.cpp +++ b/tests/Engine/Math/Frustum.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Frustum", "[MATH][FRUSTUM]") { diff --git a/tests/Nazara/Math/Matrix4.cpp b/tests/Engine/Math/Matrix4.cpp similarity index 99% rename from tests/Nazara/Math/Matrix4.cpp rename to tests/Engine/Math/Matrix4.cpp index ea61e4541..9e31ff4e5 100644 --- a/tests/Nazara/Math/Matrix4.cpp +++ b/tests/Engine/Math/Matrix4.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Matrix4", "[MATH][MATRIX4]") { diff --git a/tests/Nazara/Math/OrientedBox.cpp b/tests/Engine/Math/OrientedBox.cpp similarity index 97% rename from tests/Nazara/Math/OrientedBox.cpp rename to tests/Engine/Math/OrientedBox.cpp index c5b650c7d..b465f06ca 100644 --- a/tests/Nazara/Math/OrientedBox.cpp +++ b/tests/Engine/Math/OrientedBox.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("OrientedBox", "[MATH][ORIENTEDBOX]") { diff --git a/tests/Nazara/Math/Plane.cpp b/tests/Engine/Math/Plane.cpp similarity index 98% rename from tests/Nazara/Math/Plane.cpp rename to tests/Engine/Math/Plane.cpp index 59db2ef29..59c6a0ac3 100644 --- a/tests/Nazara/Math/Plane.cpp +++ b/tests/Engine/Math/Plane.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Plane", "[MATH][PLANE]") { diff --git a/tests/Nazara/Math/Quaternion.cpp b/tests/Engine/Math/Quaternion.cpp similarity index 99% rename from tests/Nazara/Math/Quaternion.cpp rename to tests/Engine/Math/Quaternion.cpp index 7ce748cbf..905d17f6c 100644 --- a/tests/Nazara/Math/Quaternion.cpp +++ b/tests/Engine/Math/Quaternion.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Quaternion", "[MATH][QUATERNION]") { diff --git a/tests/Nazara/Math/Ray.cpp b/tests/Engine/Math/Ray.cpp similarity index 99% rename from tests/Nazara/Math/Ray.cpp rename to tests/Engine/Math/Ray.cpp index 3b7c4648c..0f2ba34df 100644 --- a/tests/Nazara/Math/Ray.cpp +++ b/tests/Engine/Math/Ray.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Ray", "[RAY]") { diff --git a/tests/Nazara/Math/Rect.cpp b/tests/Engine/Math/Rect.cpp similarity index 98% rename from tests/Nazara/Math/Rect.cpp rename to tests/Engine/Math/Rect.cpp index a09eb747c..60f302206 100644 --- a/tests/Nazara/Math/Rect.cpp +++ b/tests/Engine/Math/Rect.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Rect", "[MATH][RECT]") { diff --git a/tests/Nazara/Math/Sphere.cpp b/tests/Engine/Math/Sphere.cpp similarity index 98% rename from tests/Nazara/Math/Sphere.cpp rename to tests/Engine/Math/Sphere.cpp index cb668999a..ee902eb6a 100644 --- a/tests/Nazara/Math/Sphere.cpp +++ b/tests/Engine/Math/Sphere.cpp @@ -1,5 +1,5 @@ #include -#include +#include SCENARIO("Sphere", "[MATH][SPHERE]") { diff --git a/tests/Nazara/Math/Vector2.cpp b/tests/Engine/Math/Vector2.cpp similarity index 97% rename from tests/Nazara/Math/Vector2.cpp rename to tests/Engine/Math/Vector2.cpp index 533a6bf35..07f7dd5c3 100644 --- a/tests/Nazara/Math/Vector2.cpp +++ b/tests/Engine/Math/Vector2.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/tests/Nazara/Math/Vector3.cpp b/tests/Engine/Math/Vector3.cpp similarity index 98% rename from tests/Nazara/Math/Vector3.cpp rename to tests/Engine/Math/Vector3.cpp index de8290a64..49239a9d0 100644 --- a/tests/Nazara/Math/Vector3.cpp +++ b/tests/Engine/Math/Vector3.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/tests/Nazara/Math/Vector4.cpp b/tests/Engine/Math/Vector4.cpp similarity index 97% rename from tests/Nazara/Math/Vector4.cpp rename to tests/Engine/Math/Vector4.cpp index ba60c2232..f2f14daad 100644 --- a/tests/Nazara/Math/Vector4.cpp +++ b/tests/Engine/Math/Vector4.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/tests/main.cpp b/tests/main.cpp index b3143fbb1..7be81a57e 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,2 +1,2 @@ #define CATCH_CONFIG_MAIN -#include +#include