From e64c2b036ee93d8ad607742ce7d2a36d964cae07 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Sat, 10 Feb 2024 22:46:53 +0100 Subject: [PATCH] Remove Utility module and move its content to Core and TextRenderer modules --- CHANGELOG.md | 2 +- examples/DeferredShading/main.cpp | 1 - examples/FirstScene/main.cpp | 2 +- examples/HardwareInfo/build.lua | 3 +- examples/MeshInfos/build.lua | 3 +- examples/MeshInfos/main.cpp | 23 +- examples/Particles/Common.cpp | 2 +- examples/Particles/LogoDemo.cpp | 2 +- examples/Particles/SpacebattleDemo.cpp | 2 +- examples/Particles/main.cpp | 1 - examples/PhysicallyBasedRendering/main.cpp | 1 - examples/Physics2DDemo/main.cpp | 1 - examples/PhysicsDemo/main.cpp | 2 +- examples/PhysicsPlayground/main.cpp | 1 - examples/Showcase/main.cpp | 4 +- examples/Tut00/main.cpp | 5 +- examples/Tut00/xmake.lua | 4 +- examples/Tut01/main.cpp | 2 +- examples/Tut02/main.cpp | 2 +- examples/WidgetDemo/main.cpp | 2 +- include/Nazara/Audio/OpenALDevice.hpp | 2 +- include/Nazara/Audio/OpenALDevice.inl | 1 - include/Nazara/Core.hpp | 32 +- .../{Utility => Core}/AbstractAtlas.hpp | 14 +- .../{Utility => Core}/AbstractImage.hpp | 16 +- .../{Utility => Core}/AbstractImage.inl | 6 +- include/Nazara/Core/Algorithm.hpp | 88 +++- include/Nazara/Core/Algorithm.inl | 194 +++----- .../Nazara/{Utility => Core}/Animation.hpp | 18 +- .../Nazara/{Utility => Core}/Animation.inl | 6 +- include/Nazara/{Utility => Core}/Buffer.hpp | 16 +- include/Nazara/{Utility => Core}/Buffer.inl | 6 +- .../Nazara/{Utility => Core}/BufferMapper.hpp | 12 +- .../Nazara/{Utility => Core}/BufferMapper.inl | 8 +- include/Nazara/Core/ByteStream.hpp | 2 +- include/Nazara/Core/ByteStream.inl | 2 - include/Nazara/Core/Clock.inl | 2 +- include/Nazara/Core/Color.hpp | 1 + include/Nazara/Core/Components.hpp | 5 + .../Core/Components/DisabledComponent.hpp | 2 +- .../Core/Components/LifetimeComponent.hpp | 2 +- .../Components/NodeComponent.hpp | 14 +- .../Components/NodeComponent.inl | 6 +- .../Components/SharedSkeletonComponent.hpp | 16 +- .../Components/SharedSkeletonComponent.inl | 6 +- .../Components/SkeletonComponent.hpp | 16 +- .../Components/SkeletonComponent.inl | 6 +- .../Components/SkeletonComponentBase.hpp | 16 +- .../Components/SkeletonComponentBase.inl | 6 +- .../Components/VelocityComponent.hpp | 14 +- .../Components/VelocityComponent.inl | 6 +- include/Nazara/Core/Config.hpp | 9 +- include/Nazara/Core/ConfigCheck.hpp | 2 +- include/Nazara/Core/Core.hpp | 23 + .../{Utility => Core}/CubemapParams.hpp | 8 +- include/Nazara/Core/Enums.hpp | 409 +++++++++++++++++ .../Formats/MD5AnimParser.hpp | 14 +- .../Formats/MD5MeshParser.hpp | 14 +- .../{Utility => Core}/Formats/MTLParser.hpp | 14 +- .../{Utility => Core}/Formats/MTLParser.inl | 6 +- .../{Utility => Core}/Formats/OBJParser.hpp | 18 +- .../{Utility => Core}/Formats/OBJParser.inl | 12 +- include/Nazara/Core/Functor.hpp | 3 +- .../GuillotineImageAtlas.hpp | 16 +- include/Nazara/Core/HardwareInfo.inl | 1 - include/Nazara/{Utility => Core}/Image.hpp | 18 +- include/Nazara/{Utility => Core}/Image.inl | 6 +- .../Nazara/{Utility => Core}/ImageStream.hpp | 16 +- .../Nazara/{Utility => Core}/ImageStream.inl | 6 +- .../Nazara/{Utility => Core}/IndexBuffer.hpp | 14 +- .../Nazara/{Utility => Core}/IndexBuffer.inl | 6 +- .../{Utility => Core}/IndexIterator.hpp | 10 +- .../{Utility => Core}/IndexIterator.inl | 8 +- .../Nazara/{Utility => Core}/IndexMapper.hpp | 14 +- include/Nazara/{Utility => Core}/Joint.hpp | 14 +- include/Nazara/{Utility => Core}/Joint.inl | 8 +- .../Nazara/{Utility => Core}/MaterialData.hpp | 8 +- include/Nazara/{Utility => Core}/Mesh.hpp | 28 +- include/Nazara/{Utility => Core}/Mesh.inl | 8 +- include/Nazara/{Utility => Core}/MeshData.hpp | 10 +- include/Nazara/{Utility => Core}/Node.hpp | 17 +- include/Nazara/{Utility => Core}/Node.inl | 7 +- include/Nazara/Core/ObjectHandle.hpp | 2 +- include/Nazara/Core/ObjectRef.hpp | 3 +- .../Nazara/{Utility => Core}/PixelFormat.hpp | 18 +- .../Nazara/{Utility => Core}/PixelFormat.inl | 14 +- .../Plugins/AssimpPlugin.hpp | 12 +- .../Plugins/AssimpPlugin.inl | 6 +- .../Plugins/FFmpegPlugin.hpp | 12 +- .../Plugins/FFmpegPlugin.inl | 6 +- include/Nazara/{Utility => Core}/Sequence.hpp | 8 +- include/Nazara/Core/Serialization.hpp | 55 +++ include/Nazara/Core/Serialization.inl | 184 ++++++++ include/Nazara/Core/SerializationContext.hpp | 37 -- include/Nazara/Core/SerializationContext.inl | 31 -- .../Nazara/{Utility => Core}/SkeletalMesh.hpp | 18 +- .../Nazara/{Utility => Core}/SkeletalMesh.inl | 6 +- include/Nazara/{Utility => Core}/Skeleton.hpp | 14 +- include/Nazara/{Utility => Core}/Skeleton.inl | 6 +- .../{Utility => Core}/SoftwareBuffer.hpp | 14 +- .../Nazara/{Utility => Core}/StaticMesh.hpp | 14 +- .../Nazara/{Utility => Core}/StaticMesh.inl | 6 +- include/Nazara/{Utility => Core}/SubMesh.hpp | 16 +- include/Nazara/Core/Systems.hpp | 2 + .../Systems/SkeletonSystem.hpp | 14 +- .../Systems/SkeletonSystem.inl | 6 +- .../Systems/VelocitySystem.hpp | 14 +- .../Systems/VelocitySystem.inl | 6 +- include/Nazara/Core/Time.hpp | 4 +- .../{Utility => Core}/TriangleIterator.hpp | 14 +- .../{Utility => Core}/UniformBuffer.hpp | 14 +- .../{Utility => Core}/UniformBuffer.inl | 6 +- include/Nazara/Core/Uuid.hpp | 2 +- .../Nazara/{Utility => Core}/VertexBuffer.hpp | 16 +- .../Nazara/{Utility => Core}/VertexBuffer.inl | 6 +- .../{Utility => Core}/VertexDeclaration.hpp | 18 +- .../{Utility => Core}/VertexDeclaration.inl | 8 +- .../Nazara/{Utility => Core}/VertexMapper.hpp | 18 +- .../Nazara/{Utility => Core}/VertexMapper.inl | 9 +- .../Nazara/{Utility => Core}/VertexStruct.hpp | 8 +- include/Nazara/Graphics/Billboard.hpp | 4 +- include/Nazara/Graphics/ElementRenderer.hpp | 1 - include/Nazara/Graphics/Enums.hpp | 2 +- include/Nazara/Graphics/FrameGraphStructs.hpp | 2 +- .../Nazara/Graphics/FramePassAttachment.hpp | 2 +- include/Nazara/Graphics/GraphicalMesh.hpp | 4 +- .../Graphics/GuillotineTextureAtlas.hpp | 2 +- include/Nazara/Graphics/Light.hpp | 2 +- .../Nazara/Graphics/LinearSlicedSprite.hpp | 4 +- include/Nazara/Graphics/MaterialPass.hpp | 2 +- include/Nazara/Graphics/Model.hpp | 4 +- include/Nazara/Graphics/RenderElement.inl | 2 +- include/Nazara/Graphics/RenderSubmesh.hpp | 2 +- include/Nazara/Graphics/RenderTextureBlit.hpp | 2 +- include/Nazara/Graphics/SkeletonInstance.hpp | 2 +- include/Nazara/Graphics/SlicedSprite.hpp | 4 +- include/Nazara/Graphics/Sprite.hpp | 4 +- .../Nazara/Graphics/Systems/RenderSystem.hpp | 4 +- include/Nazara/Graphics/TextSprite.hpp | 6 +- include/Nazara/Graphics/Tilemap.hpp | 2 +- include/Nazara/Graphics/UberShader.hpp | 1 - include/Nazara/Math/Angle.inl | 2 + include/Nazara/Math/BoundingVolume.hpp | 3 +- include/Nazara/Math/BoundingVolume.inl | 2 +- include/Nazara/Math/Box.inl | 2 +- include/Nazara/Math/Enums.hpp | 2 +- include/Nazara/Math/EulerAngles.inl | 2 +- include/Nazara/Math/Frustum.inl | 2 +- include/Nazara/Math/Matrix4.inl | 2 +- include/Nazara/Math/OrientedBox.inl | 2 +- include/Nazara/Math/Plane.inl | 2 +- include/Nazara/Math/Quaternion.inl | 2 +- include/Nazara/Math/Ray.inl | 2 +- include/Nazara/Math/Rect.inl | 2 +- include/Nazara/Math/Sphere.inl | 2 +- include/Nazara/Network/NetPacket.inl | 1 + include/Nazara/OpenGLRenderer/Utils.hpp | 2 +- include/Nazara/OpenGLRenderer/Utils.inl | 2 +- .../Nazara/OpenGLRenderer/Wrapper/Context.hpp | 2 +- include/Nazara/Physics2D/RigidBody2D.hpp | 1 + include/Nazara/Platform/Cursor.hpp | 2 +- include/Nazara/Platform/Platform.hpp | 4 +- include/Nazara/Platform/WindowHandle.hpp | 2 +- .../Nazara/Renderer/CommandBufferBuilder.hpp | 2 +- include/Nazara/Renderer/ComputePipeline.hpp | 2 +- include/Nazara/Renderer/DebugDrawer.hpp | 2 +- include/Nazara/Renderer/RenderBuffer.hpp | 2 +- include/Nazara/Renderer/RenderDevice.hpp | 2 +- include/Nazara/Renderer/RenderPass.hpp | 2 +- include/Nazara/Renderer/RenderPipeline.hpp | 2 +- include/Nazara/Renderer/RenderStates.hpp | 4 +- include/Nazara/Renderer/RenderStates.inl | 2 +- include/Nazara/Renderer/RendererImpl.hpp | 2 +- .../Nazara/Renderer/SwapchainParameters.hpp | 2 +- include/Nazara/Renderer/Texture.hpp | 2 +- include/Nazara/Renderer/TextureSampler.hpp | 2 +- include/Nazara/Renderer/WindowSwapchain.hpp | 1 + .../Components.hpp => TextRenderer.hpp} | 22 +- .../AbstractTextDrawer.hpp | 14 +- .../AbstractTextDrawer.inl | 6 +- .../Systems.hpp => TextRenderer/Config.hpp} | 26 +- .../{Utility => TextRenderer}/ConfigCheck.hpp | 10 +- .../{Utility => TextRenderer}/Debug.hpp | 2 +- .../{Utility => TextRenderer}/DebugOff.hpp | 2 +- .../Nazara/{Utility => TextRenderer}/Font.hpp | 21 +- .../Nazara/{Utility => TextRenderer}/Font.inl | 6 +- .../{Utility => TextRenderer}/FontData.hpp | 14 +- .../{Utility => TextRenderer}/FontGlyph.hpp | 10 +- .../RichTextBuilder.hpp | 14 +- .../RichTextBuilder.inl | 6 +- .../RichTextDrawer.hpp | 18 +- .../RichTextDrawer.inl | 6 +- .../SimpleTextDrawer.hpp | 18 +- .../SimpleTextDrawer.inl | 6 +- include/Nazara/TextRenderer/TextRenderer.hpp | 39 ++ include/Nazara/Utility.hpp | 81 ---- include/Nazara/Utility/Algorithm.hpp | 86 ---- include/Nazara/Utility/Algorithm.inl | 90 ---- include/Nazara/Utility/Config.hpp | 62 --- include/Nazara/Utility/Enums.hpp | 433 ------------------ include/Nazara/Utility/Utility.hpp | 66 --- include/Nazara/VulkanRenderer/Utils.hpp | 2 +- include/Nazara/VulkanRenderer/Utils.inl | 2 +- .../VulkanRenderer/VulkanComputePipeline.hpp | 1 - .../VulkanRenderer/VulkanRenderPipeline.hpp | 1 - .../Nazara/VulkanRenderer/Wrapper/Device.hpp | 1 - include/Nazara/Widgets.hpp | 2 + .../Nazara/Widgets/AbstractTextAreaWidget.hpp | 2 +- include/Nazara/Widgets/BaseWidget.hpp | 2 +- include/Nazara/Widgets/RichTextAreaWidget.hpp | 2 +- include/Nazara/Widgets/SimpleLabelWidget.hpp | 2 +- include/Nazara/Widgets/TextAreaWidget.hpp | 2 +- plugins/Assimp/CustomStream.cpp | 2 +- plugins/Assimp/Plugin.cpp | 52 +-- plugins/Assimp/xmake.lua | 2 +- plugins/FFmpeg/Plugin.cpp | 26 +- plugins/FFmpeg/xmake.lua | 2 +- src/Nazara/Audio/DummyAudioBuffer.cpp | 2 +- src/Nazara/Audio/DummyAudioSource.cpp | 1 - src/Nazara/Audio/OpenALBuffer.cpp | 2 +- src/Nazara/Audio/OpenALSource.cpp | 2 +- src/Nazara/Audio/Sound.cpp | 2 +- .../{Utility => Core}/AbstractAtlas.cpp | 6 +- src/Nazara/Core/AbstractHash.cpp | 2 +- .../{Utility => Core}/AbstractImage.cpp | 8 +- src/Nazara/Core/AbstractLogger.cpp | 1 - .../AlgorithmCore.cpp} | 14 +- src/Nazara/{Utility => Core}/Animation.cpp | 36 +- src/Nazara/Core/AntiWindows.hpp | 1 + src/Nazara/{Utility => Core}/Buffer.cpp | 8 +- .../Components/NodeComponent.cpp | 10 +- .../Components/SharedSkeletonComponent.cpp | 8 +- src/Nazara/Core/Core.cpp | 105 +++++ .../Formats/DDSConstants.cpp | 7 +- .../Formats/DDSConstants.hpp | 18 +- .../{Utility => Core}/Formats/DDSLoader.cpp | 12 +- .../{Utility => Core}/Formats/DDSLoader.hpp | 10 +- .../{Utility => Core}/Formats/GIFLoader.cpp | 10 +- .../{Utility => Core}/Formats/GIFLoader.hpp | 12 +- .../Formats/MD2Constants.cpp | 6 +- .../Formats/MD2Constants.hpp | 8 +- .../{Utility => Core}/Formats/MD2Loader.cpp | 16 +- .../{Utility => Core}/Formats/MD2Loader.hpp | 10 +- .../Formats/MD5AnimLoader.cpp | 12 +- .../Formats/MD5AnimLoader.hpp | 10 +- .../Formats/MD5AnimParser.cpp | 37 +- .../Formats/MD5MeshLoader.cpp | 26 +- .../Formats/MD5MeshLoader.hpp | 10 +- .../Formats/MD5MeshParser.cpp | 39 +- .../{Utility => Core}/Formats/MTLParser.cpp | 60 +-- .../{Utility => Core}/Formats/OBJLoader.cpp | 20 +- .../{Utility => Core}/Formats/OBJLoader.hpp | 10 +- .../{Utility => Core}/Formats/OBJParser.cpp | 45 +- .../{Utility => Core}/Formats/OBJSaver.cpp | 20 +- .../{Utility => Core}/Formats/OBJSaver.hpp | 10 +- .../{Utility => Core}/Formats/PCXLoader.cpp | 8 +- .../{Utility => Core}/Formats/PCXLoader.hpp | 10 +- .../{Utility => Core}/Formats/STBLoader.cpp | 8 +- .../{Utility => Core}/Formats/STBLoader.hpp | 10 +- .../{Utility => Core}/Formats/STBSaver.cpp | 12 +- .../{Utility => Core}/Formats/STBSaver.hpp | 10 +- .../GuillotineImageAtlas.cpp | 8 +- src/Nazara/{Utility => Core}/Image.cpp | 96 ++-- src/Nazara/{Utility => Core}/ImageStream.cpp | 26 +- src/Nazara/{Utility => Core}/IndexBuffer.cpp | 14 +- src/Nazara/{Utility => Core}/IndexMapper.cpp | 12 +- src/Nazara/{Utility => Core}/Joint.cpp | 6 +- src/Nazara/{Utility => Core}/Mesh.cpp | 54 +-- src/Nazara/{Utility => Core}/Node.cpp | 13 +- src/Nazara/{Utility => Core}/PixelFormat.cpp | 8 +- src/Nazara/Core/Posix/FileImpl.cpp | 1 - ...alizationContext.cpp => Serialization.cpp} | 3 +- src/Nazara/{Utility => Core}/SkeletalMesh.cpp | 8 +- src/Nazara/{Utility => Core}/Skeleton.cpp | 8 +- .../{Utility => Core}/SoftwareBuffer.cpp | 6 +- src/Nazara/{Utility => Core}/StaticMesh.cpp | 10 +- src/Nazara/Core/StdLogger.cpp | 1 - src/Nazara/Core/StringExt.cpp | 2 +- src/Nazara/{Utility => Core}/SubMesh.cpp | 12 +- .../Systems/SkeletonSystem.cpp | 12 +- .../Systems/VelocitySystem.cpp | 10 +- .../{Utility => Core}/TriangleIterator.cpp | 8 +- .../{Utility => Core}/UniformBuffer.cpp | 8 +- src/Nazara/{Utility => Core}/VertexBuffer.cpp | 6 +- .../{Utility => Core}/VertexDeclaration.cpp | 12 +- src/Nazara/{Utility => Core}/VertexMapper.cpp | 14 +- .../Graphics/Formats/ModelMeshLoader.cpp | 6 +- src/Nazara/Graphics/Formats/TextureLoader.cpp | 6 +- src/Nazara/Graphics/FrameGraph.cpp | 2 +- src/Nazara/Graphics/GraphicalMesh.cpp | 4 +- src/Nazara/Graphics/Graphics.cpp | 2 +- src/Nazara/Graphics/MaterialInstance.cpp | 10 +- src/Nazara/Graphics/SkeletonInstance.cpp | 2 +- src/Nazara/Graphics/Systems/RenderSystem.cpp | 6 +- src/Nazara/Graphics/TextSprite.cpp | 3 +- src/Nazara/Network/AbstractSocket.cpp | 1 - src/Nazara/Network/IpAddress.cpp | 1 - src/Nazara/Network/Posix/IpAddressImpl.cpp | 2 +- src/Nazara/Network/Posix/SocketImpl.cpp | 2 +- src/Nazara/Network/SocketPoller.cpp | 2 +- src/Nazara/Network/Win32/IpAddressImpl.cpp | 2 +- src/Nazara/Network/Win32/SocketImpl.cpp | 6 +- .../OpenGLRenderer/OpenGLShaderBinding.cpp | 4 +- src/Nazara/OpenGLRenderer/OpenGLTexture.cpp | 2 +- .../Systems/ChipmunkPhysics2DSystem.cpp | 2 +- src/Nazara/Physics3D/Collider3D.cpp | 10 +- .../Physics3D/Systems/Physics3DSystem.cpp | 2 +- src/Nazara/Platform/SDL2/CursorImpl.cpp | 2 +- src/Nazara/Platform/SDL2/CursorImpl.hpp | 2 +- src/Nazara/Platform/SDL2/IconImpl.cpp | 4 +- src/Nazara/Platform/SDL2/IconImpl.hpp | 2 +- src/Nazara/Platform/SDL2/WindowImpl.cpp | 2 +- src/Nazara/Renderer/DebugDrawer.cpp | 4 +- src/Nazara/Renderer/Texture.cpp | 2 +- .../AbstractTextDrawer.cpp | 6 +- src/Nazara/{Utility => TextRenderer}/Font.cpp | 48 +- .../{Utility => TextRenderer}/FontData.cpp | 6 +- .../Formats/FreeTypeLoader.cpp | 20 +- .../Formats/FreeTypeLoader.hpp | 10 +- .../Resources/Fonts/OpenSans-Regular.ttf | Bin .../RichTextDrawer.cpp | 6 +- .../SimpleTextDrawer.cpp | 6 +- src/Nazara/TextRenderer/TextRenderer.cpp | 44 ++ src/Nazara/Utility/Utility.cpp | 165 ------- src/Nazara/VulkanRenderer/Vulkan.cpp | 2 +- .../VulkanCommandBufferBuilder.cpp | 2 +- .../VulkanRenderer/VulkanShaderBinding.cpp | 2 +- src/Nazara/VulkanRenderer/VulkanSwapchain.cpp | 2 +- src/Nazara/VulkanRenderer/VulkanTexture.cpp | 2 +- src/Nazara/VulkanRenderer/Wrapper/Loader.cpp | 1 + src/Nazara/Widgets/AbstractLabelWidget.cpp | 2 +- src/Nazara/Widgets/AbstractTextAreaWidget.cpp | 4 +- src/Nazara/Widgets/BaseWidget.cpp | 2 +- src/Nazara/Widgets/ButtonWidget.cpp | 2 +- src/Nazara/Widgets/CheckboxWidget.cpp | 4 +- src/Nazara/Widgets/ImageWidget.cpp | 2 +- src/Nazara/Widgets/LabelWidget.cpp | 2 +- src/Nazara/Widgets/SimpleLabelWidget.cpp | 2 +- src/Nazara/Widgets/SimpleWidgetStyles.cpp | 2 +- src/Nazara/Widgets/TextAreaWidget.cpp | 4 +- src/ShaderNode/DataModels/BufferField.inl | 2 +- .../DataModels/ConditionalExpression.inl | 2 +- src/ShaderNode/DataModels/VecValue.inl | 2 +- src/ShaderNode/ShaderGraph.cpp | 2 +- src/ShaderNode/ShaderGraph.hpp | 2 +- src/ShaderNode/Widgets/StructEditDialog.cpp | 2 +- tests/ComputeParticlesTest/main.cpp | 1 - tests/ComputeTest/main.cpp | 1 - tests/GraphicsTest/main.cpp | 1 - tests/PresentModeTest/main.cpp | 2 +- tests/RenderTest/main.cpp | 1 - tests/SchedulerBenchmark/main.cpp | 5 +- tests/SchedulerBenchmark/xmake.lua | 2 +- .../UnitTests/Engine/Core/ByteStreamTest.cpp | 1 + .../Engine/{Utility => Core}/ImageLoading.cpp | 4 +- .../{Utility => Core}/ImageStreamLoading.cpp | 8 +- .../Engine/{Utility => Core}/MeshLoading.cpp | 4 +- .../Engine/Core/SerializationTest.cpp | 2 +- .../Engine/Core/VirtualDirectoryTest.cpp | 3 +- tests/UnitTests/Engine/Modules.hpp | 1 - .../{Utility => TextRenderer}/FontLoading.cpp | 8 +- tests/UnitTests/main.cpp | 5 +- tests/UnitTests/xmake.lua | 2 +- xmake.lua | 21 +- 364 files changed, 2336 insertions(+), 2516 deletions(-) rename include/Nazara/{Utility => Core}/AbstractAtlas.hpp (81%) rename include/Nazara/{Utility => Core}/AbstractImage.hpp (79%) rename include/Nazara/{Utility => Core}/AbstractImage.inl (82%) rename include/Nazara/{Utility => Core}/Animation.hpp (88%) rename include/Nazara/{Utility => Core}/Animation.inl (55%) rename include/Nazara/{Utility => Core}/Buffer.hpp (79%) rename include/Nazara/{Utility => Core}/Buffer.inl (82%) rename include/Nazara/{Utility => Core}/BufferMapper.hpp (66%) rename include/Nazara/{Utility => Core}/BufferMapper.inl (87%) rename include/Nazara/{Utility => Core}/Components/NodeComponent.hpp (69%) rename include/Nazara/{Utility => Core}/Components/NodeComponent.inl (55%) rename include/Nazara/{Utility => Core}/Components/SharedSkeletonComponent.hpp (70%) rename include/Nazara/{Utility => Core}/Components/SharedSkeletonComponent.inl (67%) rename include/Nazara/{Utility => Core}/Components/SkeletonComponent.hpp (61%) rename include/Nazara/{Utility => Core}/Components/SkeletonComponent.inl (79%) rename include/Nazara/{Utility => Core}/Components/SkeletonComponentBase.hpp (69%) rename include/Nazara/{Utility => Core}/Components/SkeletonComponentBase.inl (84%) rename include/Nazara/{Utility => Core}/Components/VelocityComponent.hpp (68%) rename include/Nazara/{Utility => Core}/Components/VelocityComponent.inl (79%) rename include/Nazara/{Utility => Core}/CubemapParams.hpp (83%) rename include/Nazara/{Utility => Core}/Formats/MD5AnimParser.hpp (84%) rename include/Nazara/{Utility => Core}/Formats/MD5MeshParser.hpp (84%) rename include/Nazara/{Utility => Core}/Formats/MTLParser.hpp (86%) rename include/Nazara/{Utility => Core}/Formats/MTLParser.inl (92%) rename include/Nazara/{Utility => Core}/Formats/OBJParser.hpp (88%) rename include/Nazara/{Utility => Core}/Formats/OBJParser.inl (93%) rename include/Nazara/{Utility => Core}/GuillotineImageAtlas.hpp (84%) rename include/Nazara/{Utility => Core}/Image.hpp (94%) rename include/Nazara/{Utility => Core}/Image.inl (93%) rename include/Nazara/{Utility => Core}/ImageStream.hpp (80%) rename include/Nazara/{Utility => Core}/ImageStream.inl (55%) rename include/Nazara/{Utility => Core}/IndexBuffer.hpp (85%) rename include/Nazara/{Utility => Core}/IndexBuffer.inl (90%) rename include/Nazara/{Utility => Core}/IndexIterator.hpp (89%) rename include/Nazara/{Utility => Core}/IndexIterator.inl (95%) rename include/Nazara/{Utility => Core}/IndexMapper.hpp (76%) rename include/Nazara/{Utility => Core}/Joint.hpp (80%) rename include/Nazara/{Utility => Core}/Joint.inl (92%) rename include/Nazara/{Utility => Core}/MaterialData.hpp (96%) rename include/Nazara/{Utility => Core}/Mesh.hpp (91%) rename include/Nazara/{Utility => Core}/Mesh.inl (85%) rename include/Nazara/{Utility => Core}/MeshData.hpp (62%) rename include/Nazara/{Utility => Core}/Node.hpp (95%) rename include/Nazara/{Utility => Core}/Node.inl (98%) rename include/Nazara/{Utility => Core}/PixelFormat.hpp (91%) rename include/Nazara/{Utility => Core}/PixelFormat.inl (96%) rename include/Nazara/{Utility => Core}/Plugins/AssimpPlugin.hpp (77%) rename include/Nazara/{Utility => Core}/Plugins/AssimpPlugin.inl (55%) rename include/Nazara/{Utility => Core}/Plugins/FFmpegPlugin.hpp (74%) rename include/Nazara/{Utility => Core}/Plugins/FFmpegPlugin.inl (55%) rename include/Nazara/{Utility => Core}/Sequence.hpp (75%) create mode 100644 include/Nazara/Core/Serialization.hpp create mode 100644 include/Nazara/Core/Serialization.inl delete mode 100644 include/Nazara/Core/SerializationContext.hpp delete mode 100644 include/Nazara/Core/SerializationContext.inl rename include/Nazara/{Utility => Core}/SkeletalMesh.hpp (69%) rename include/Nazara/{Utility => Core}/SkeletalMesh.inl (58%) rename include/Nazara/{Utility => Core}/Skeleton.hpp (86%) rename include/Nazara/{Utility => Core}/Skeleton.inl (58%) rename include/Nazara/{Utility => Core}/SoftwareBuffer.hpp (59%) rename include/Nazara/{Utility => Core}/StaticMesh.hpp (75%) rename include/Nazara/{Utility => Core}/StaticMesh.inl (58%) rename include/Nazara/{Utility => Core}/SubMesh.hpp (80%) rename include/Nazara/{Utility => Core}/Systems/SkeletonSystem.hpp (71%) rename include/Nazara/{Utility => Core}/Systems/SkeletonSystem.inl (55%) rename include/Nazara/{Utility => Core}/Systems/VelocitySystem.hpp (69%) rename include/Nazara/{Utility => Core}/Systems/VelocitySystem.inl (66%) rename include/Nazara/{Utility => Core}/TriangleIterator.hpp (67%) rename include/Nazara/{Utility => Core}/UniformBuffer.hpp (79%) rename include/Nazara/{Utility => Core}/UniformBuffer.inl (76%) rename include/Nazara/{Utility => Core}/VertexBuffer.hpp (84%) rename include/Nazara/{Utility => Core}/VertexBuffer.inl (86%) rename include/Nazara/{Utility => Core}/VertexDeclaration.hpp (85%) rename include/Nazara/{Utility => Core}/VertexDeclaration.inl (92%) rename include/Nazara/{Utility => Core}/VertexMapper.hpp (66%) rename include/Nazara/{Utility => Core}/VertexMapper.inl (83%) rename include/Nazara/{Utility => Core}/VertexStruct.hpp (90%) rename include/Nazara/{Utility/Components.hpp => TextRenderer.hpp} (67%) rename include/Nazara/{Utility => TextRenderer}/AbstractTextDrawer.hpp (78%) rename include/Nazara/{Utility => TextRenderer}/AbstractTextDrawer.inl (78%) rename include/Nazara/{Utility/Systems.hpp => TextRenderer/Config.hpp} (67%) rename include/Nazara/{Utility => TextRenderer}/ConfigCheck.hpp (59%) rename include/Nazara/{Utility => TextRenderer}/Debug.hpp (73%) rename include/Nazara/{Utility => TextRenderer}/DebugOff.hpp (73%) rename include/Nazara/{Utility => TextRenderer}/Font.hpp (91%) rename include/Nazara/{Utility => TextRenderer}/Font.inl (56%) rename include/Nazara/{Utility => TextRenderer}/FontData.hpp (78%) rename include/Nazara/{Utility => TextRenderer}/FontGlyph.hpp (53%) rename include/Nazara/{Utility => TextRenderer}/RichTextBuilder.hpp (89%) rename include/Nazara/{Utility => TextRenderer}/RichTextBuilder.inl (96%) rename include/Nazara/{Utility => TextRenderer}/RichTextDrawer.hpp (94%) rename include/Nazara/{Utility => TextRenderer}/RichTextDrawer.inl (99%) rename include/Nazara/{Utility => TextRenderer}/SimpleTextDrawer.hpp (91%) rename include/Nazara/{Utility => TextRenderer}/SimpleTextDrawer.inl (98%) create mode 100644 include/Nazara/TextRenderer/TextRenderer.hpp delete mode 100644 include/Nazara/Utility.hpp delete mode 100644 include/Nazara/Utility/Algorithm.hpp delete mode 100644 include/Nazara/Utility/Algorithm.inl delete mode 100644 include/Nazara/Utility/Config.hpp delete mode 100644 include/Nazara/Utility/Enums.hpp delete mode 100644 include/Nazara/Utility/Utility.hpp rename src/Nazara/{Utility => Core}/AbstractAtlas.cpp (62%) rename src/Nazara/{Utility => Core}/AbstractImage.cpp (73%) rename src/Nazara/{Utility/AlgorithmUtility.cpp => Core/AlgorithmCore.cpp} (99%) rename src/Nazara/{Utility => Core}/Animation.cpp (90%) rename src/Nazara/{Utility => Core}/Buffer.cpp (78%) rename src/Nazara/{Utility => Core}/Components/NodeComponent.cpp (85%) rename src/Nazara/{Utility => Core}/Components/SharedSkeletonComponent.cpp (93%) rename src/Nazara/{Utility => Core}/Formats/DDSConstants.cpp (92%) rename src/Nazara/{Utility => Core}/Formats/DDSConstants.hpp (95%) rename src/Nazara/{Utility => Core}/Formats/DDSLoader.cpp (96%) rename src/Nazara/{Utility => Core}/Formats/DDSLoader.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/GIFLoader.cpp (98%) rename src/Nazara/{Utility => Core}/Formats/GIFLoader.hpp (51%) rename src/Nazara/{Utility => Core}/Formats/MD2Constants.cpp (98%) rename src/Nazara/{Utility => Core}/Formats/MD2Constants.hpp (89%) rename src/Nazara/{Utility => Core}/Formats/MD2Loader.cpp (95%) rename src/Nazara/{Utility => Core}/Formats/MD2Loader.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/MD5AnimLoader.cpp (92%) rename src/Nazara/{Utility => Core}/Formats/MD5AnimLoader.hpp (53%) rename src/Nazara/{Utility => Core}/Formats/MD5AnimParser.cpp (93%) rename src/Nazara/{Utility => Core}/Formats/MD5MeshLoader.cpp (95%) rename src/Nazara/{Utility => Core}/Formats/MD5MeshLoader.hpp (53%) rename src/Nazara/{Utility => Core}/Formats/MD5MeshParser.cpp (91%) rename src/Nazara/{Utility => Core}/Formats/MTLParser.cpp (90%) rename src/Nazara/{Utility => Core}/Formats/OBJLoader.cpp (96%) rename src/Nazara/{Utility => Core}/Formats/OBJLoader.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/OBJParser.cpp (93%) rename src/Nazara/{Utility => Core}/Formats/OBJSaver.cpp (93%) rename src/Nazara/{Utility => Core}/Formats/OBJSaver.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/PCXLoader.cpp (97%) rename src/Nazara/{Utility => Core}/Formats/PCXLoader.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/STBLoader.cpp (94%) rename src/Nazara/{Utility => Core}/Formats/STBLoader.hpp (54%) rename src/Nazara/{Utility => Core}/Formats/STBSaver.cpp (96%) rename src/Nazara/{Utility => Core}/Formats/STBSaver.hpp (54%) rename src/Nazara/{Utility => Core}/GuillotineImageAtlas.cpp (97%) rename src/Nazara/{Utility => Core}/Image.cpp (95%) rename src/Nazara/{Utility => Core}/ImageStream.cpp (66%) rename src/Nazara/{Utility => Core}/IndexBuffer.cpp (90%) rename src/Nazara/{Utility => Core}/IndexMapper.cpp (92%) rename src/Nazara/{Utility => Core}/Joint.cpp (69%) rename src/Nazara/{Utility => Core}/Mesh.cpp (93%) rename src/Nazara/{Utility => Core}/Node.cpp (97%) rename src/Nazara/{Utility => Core}/PixelFormat.cpp (99%) rename src/Nazara/Core/{SerializationContext.cpp => Serialization.cpp} (90%) rename src/Nazara/{Utility => Core}/SkeletalMesh.cpp (87%) rename src/Nazara/{Utility => Core}/Skeleton.cpp (97%) rename src/Nazara/{Utility => Core}/SoftwareBuffer.cpp (91%) rename src/Nazara/{Utility => Core}/StaticMesh.cpp (90%) rename src/Nazara/{Utility => Core}/SubMesh.cpp (95%) rename src/Nazara/{Utility => Core}/Systems/SkeletonSystem.cpp (85%) rename src/Nazara/{Utility => Core}/Systems/VelocitySystem.cpp (69%) rename src/Nazara/{Utility => Core}/TriangleIterator.cpp (91%) rename src/Nazara/{Utility => Core}/UniformBuffer.cpp (91%) rename src/Nazara/{Utility => Core}/VertexBuffer.cpp (96%) rename src/Nazara/{Utility => Core}/VertexDeclaration.cpp (97%) rename src/Nazara/{Utility => Core}/VertexMapper.cpp (79%) rename src/Nazara/{Utility => TextRenderer}/AbstractTextDrawer.cpp (58%) rename src/Nazara/{Utility => TextRenderer}/Font.cpp (91%) rename src/Nazara/{Utility => TextRenderer}/FontData.cpp (58%) rename src/Nazara/{Utility => TextRenderer}/Formats/FreeTypeLoader.cpp (98%) rename src/Nazara/{Utility => TextRenderer}/Formats/FreeTypeLoader.hpp (55%) rename src/Nazara/{Utility => TextRenderer}/Resources/Fonts/OpenSans-Regular.ttf (100%) rename src/Nazara/{Utility => TextRenderer}/RichTextDrawer.cpp (99%) rename src/Nazara/{Utility => TextRenderer}/SimpleTextDrawer.cpp (98%) create mode 100644 src/Nazara/TextRenderer/TextRenderer.cpp delete mode 100644 src/Nazara/Utility/Utility.cpp rename tests/UnitTests/Engine/{Utility => Core}/ImageLoading.cpp (93%) rename tests/UnitTests/Engine/{Utility => Core}/ImageStreamLoading.cpp (96%) rename tests/UnitTests/Engine/{Utility => Core}/MeshLoading.cpp (95%) rename tests/UnitTests/Engine/{Utility => TextRenderer}/FontLoading.cpp (96%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0adf0a036..52b8986a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -370,7 +370,7 @@ Nazara Engine: - Added support for debug draw - Added support for damping - ⚠️ RigidBody2D created without mass are now kinematic by default instead of statics -- https://github.com/NazaraEngine/NazaraEngine/pull/128 ⚠️ **Platform-specific classes were moved to a new module: Platform** (this means Utility module no longer needs to be linked to X11/xcb or gdi32). +- https://github.com/NazaraEngine/NazaraEngine/pull/128 ⚠️ **Platform-specific classes were moved to a new module: Platform** (this means Core module no longer needs to be linked to X11/xcb or gdi32). - https://github.com/NazaraEngine/NazaraEngine/pull/135 ⚠️ Improved vertex declarations (they now checks template type with real type) - Mesh index buffer optimization is now disabled by default in debug mode - It is now possible to set the vertex declaration wanted when building/loading a mesh diff --git a/examples/DeferredShading/main.cpp b/examples/DeferredShading/main.cpp index ca3132d01..2d81ed054 100644 --- a/examples/DeferredShading/main.cpp +++ b/examples/DeferredShading/main.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/FirstScene/main.cpp b/examples/FirstScene/main.cpp index c830638dc..dbfb3de5e 100644 --- a/examples/FirstScene/main.cpp +++ b/examples/FirstScene/main.cpp @@ -16,7 +16,7 @@ #include // Module graphique #include // Module de rendu #include // Module utilitaire -#include // Module utilitaire +#include // Module utilitaire #include #include #include diff --git a/examples/HardwareInfo/build.lua b/examples/HardwareInfo/build.lua index 953cba7d9..2c38d7850 100644 --- a/examples/HardwareInfo/build.lua +++ b/examples/HardwareInfo/build.lua @@ -13,6 +13,5 @@ EXAMPLE.Files = { EXAMPLE.Libraries = { "NazaraCore", "NazaraPlatform", - "NazaraRenderer", - "NazaraUtility" + "NazaraRenderer" } diff --git a/examples/MeshInfos/build.lua b/examples/MeshInfos/build.lua index 462533740..737b37fb8 100644 --- a/examples/MeshInfos/build.lua +++ b/examples/MeshInfos/build.lua @@ -8,8 +8,7 @@ EXAMPLE.Files = { EXAMPLE.Libraries = { "NazaraCore", - "NazaraPlatform", - "NazaraUtility" + "NazaraPlatform" } if Config.PlatformSDL2 then diff --git a/examples/MeshInfos/main.cpp b/examples/MeshInfos/main.cpp index 45cc08225..f4d1fb711 100644 --- a/examples/MeshInfos/main.cpp +++ b/examples/MeshInfos/main.cpp @@ -1,13 +1,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -15,14 +15,7 @@ int main() { // Pour charger des ressources, il est impératif d'initialiser le module utilitaire - Nz::Modules nazara; - /*if (!utility) - { - // Ça n'a pas fonctionné, le pourquoi se trouve dans le fichier NazaraLog.log - std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl; - std::getchar(); // On laise le temps de voir l'erreur - return EXIT_FAILURE; - }*/ + Nz::Modules nazara; for (;;) { diff --git a/examples/Particles/Common.cpp b/examples/Particles/Common.cpp index 690537d0f..f28d0994e 100644 --- a/examples/Particles/Common.cpp +++ b/examples/Particles/Common.cpp @@ -1,6 +1,6 @@ #include "Common.hpp" #include -#include +#include #include #include diff --git a/examples/Particles/LogoDemo.cpp b/examples/Particles/LogoDemo.cpp index 975593a86..d6311274e 100644 --- a/examples/Particles/LogoDemo.cpp +++ b/examples/Particles/LogoDemo.cpp @@ -1,7 +1,7 @@ #include "LogoDemo.hpp" #include #include -#include +#include #include #include #include diff --git a/examples/Particles/SpacebattleDemo.cpp b/examples/Particles/SpacebattleDemo.cpp index 4b8dc12fd..85fe0ab9f 100644 --- a/examples/Particles/SpacebattleDemo.cpp +++ b/examples/Particles/SpacebattleDemo.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include diff --git a/examples/Particles/main.cpp b/examples/Particles/main.cpp index 33cdff82a..ae7e61258 100644 --- a/examples/Particles/main.cpp +++ b/examples/Particles/main.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/PhysicallyBasedRendering/main.cpp b/examples/PhysicallyBasedRendering/main.cpp index 69bc13dc0..5acd7adad 100644 --- a/examples/PhysicallyBasedRendering/main.cpp +++ b/examples/PhysicallyBasedRendering/main.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/Physics2DDemo/main.cpp b/examples/Physics2DDemo/main.cpp index 1c824a5e2..09b21c038 100644 --- a/examples/Physics2DDemo/main.cpp +++ b/examples/Physics2DDemo/main.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/PhysicsDemo/main.cpp b/examples/PhysicsDemo/main.cpp index a319db00a..3dcd3db97 100644 --- a/examples/PhysicsDemo/main.cpp +++ b/examples/PhysicsDemo/main.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/examples/PhysicsPlayground/main.cpp b/examples/PhysicsPlayground/main.cpp index 01af868d4..7860c4792 100644 --- a/examples/PhysicsPlayground/main.cpp +++ b/examples/PhysicsPlayground/main.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include diff --git a/examples/Showcase/main.cpp b/examples/Showcase/main.cpp index aa7745a31..0078021bf 100644 --- a/examples/Showcase/main.cpp +++ b/examples/Showcase/main.cpp @@ -1,11 +1,11 @@ #include +#include #include #include #include #include #include -#include -#include +#include #include #include #include diff --git a/examples/Tut00/main.cpp b/examples/Tut00/main.cpp index d1cf15633..54c66be0f 100644 --- a/examples/Tut00/main.cpp +++ b/examples/Tut00/main.cpp @@ -5,14 +5,15 @@ #include #include #include -#include +#include +#include #include int main(int argc, char* argv[]) { // This "example" has only one purpose: Giving an empty project for you to test whatever you want // If you wish to have multiple test projects, you only have to copy/paste this directory and change the name in the xmake.lua - Nz::Application app(argc, argv); + Nz::Application app(argc, argv); return EXIT_SUCCESS; } diff --git a/examples/Tut00/xmake.lua b/examples/Tut00/xmake.lua index 0a5322b56..29b40240f 100644 --- a/examples/Tut00/xmake.lua +++ b/examples/Tut00/xmake.lua @@ -1,3 +1,5 @@ target("Tut00_EmptyProject") - add_deps("NazaraAudio", "NazaraGraphics", "NazaraNetwork", "NazaraPhysics2D", "NazaraPhysics3D", "NazaraRenderer", "NazaraUtility") + add_packages("entt") + add_defines("NAZARA_ENTT") + add_deps("NazaraAudio", "NazaraGraphics", "NazaraNetwork", "NazaraPhysics2D", "NazaraPhysics3D", "NazaraRenderer", "NazaraTextRenderer", "NazaraWidgets") add_files("main.cpp") diff --git a/examples/Tut01/main.cpp b/examples/Tut01/main.cpp index 9b8266d65..edf67b40d 100644 --- a/examples/Tut01/main.cpp +++ b/examples/Tut01/main.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include int main(int argc, char* argv[]) diff --git a/examples/Tut02/main.cpp b/examples/Tut02/main.cpp index 51d4211f9..973592ecd 100644 --- a/examples/Tut02/main.cpp +++ b/examples/Tut02/main.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include int main(int argc, char* argv[]) diff --git a/examples/WidgetDemo/main.cpp b/examples/WidgetDemo/main.cpp index 3fb15adc4..cb2ecc902 100644 --- a/examples/WidgetDemo/main.cpp +++ b/examples/WidgetDemo/main.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/Nazara/Audio/OpenALDevice.hpp b/include/Nazara/Audio/OpenALDevice.hpp index 08825ed3b..8ecf35405 100644 --- a/include/Nazara/Audio/OpenALDevice.hpp +++ b/include/Nazara/Audio/OpenALDevice.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/Nazara/Audio/OpenALDevice.inl b/include/Nazara/Audio/OpenALDevice.inl index 04e77ff92..4a280ac38 100644 --- a/include/Nazara/Audio/OpenALDevice.inl +++ b/include/Nazara/Audio/OpenALDevice.inl @@ -2,7 +2,6 @@ // This file is part of the "Nazara Engine - Audio module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include namespace Nz diff --git a/include/Nazara/Core.hpp b/include/Nazara/Core.hpp index 943c3c25a..3933c8de0 100644 --- a/include/Nazara/Core.hpp +++ b/include/Nazara/Core.hpp @@ -29,14 +29,19 @@ #ifndef NAZARA_GLOBAL_CORE_HPP #define NAZARA_GLOBAL_CORE_HPP +#include #include +#include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -45,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -59,20 +65,32 @@ #include #include #include +#include #include #include +#include +#include +#include +#include +#include #include +#include #include +#include #include #include +#include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -86,19 +104,31 @@ #include #include #include -#include +#include +#include #include +#include +#include +#include #include #include +#include #include #include #include +#include #include #include #include +#include #include +#include #include #include +#include +#include +#include +#include #include #include diff --git a/include/Nazara/Utility/AbstractAtlas.hpp b/include/Nazara/Core/AbstractAtlas.hpp similarity index 81% rename from include/Nazara/Utility/AbstractAtlas.hpp rename to include/Nazara/Core/AbstractAtlas.hpp index 001bc988e..30b7a0acf 100644 --- a/include/Nazara/Utility/AbstractAtlas.hpp +++ b/include/Nazara/Core/AbstractAtlas.hpp @@ -1,16 +1,16 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_ABSTRACTATLAS_HPP -#define NAZARA_UTILITY_ABSTRACTATLAS_HPP +#ifndef NAZARA_CORE_ABSTRACTATLAS_HPP +#define NAZARA_CORE_ABSTRACTATLAS_HPP #include +#include +#include #include -#include -#include #include #include @@ -19,7 +19,7 @@ namespace Nz class AbstractImage; class Image; - class NAZARA_UTILITY_API AbstractAtlas + class NAZARA_CORE_API AbstractAtlas { public: AbstractAtlas() = default; @@ -44,4 +44,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_ABSTRACTATLAS_HPP +#endif // NAZARA_CORE_ABSTRACTATLAS_HPP diff --git a/include/Nazara/Utility/AbstractImage.hpp b/include/Nazara/Core/AbstractImage.hpp similarity index 79% rename from include/Nazara/Utility/AbstractImage.hpp rename to include/Nazara/Core/AbstractImage.hpp index 5950a9aea..bde0fe801 100644 --- a/include/Nazara/Utility/AbstractImage.hpp +++ b/include/Nazara/Core/AbstractImage.hpp @@ -1,24 +1,24 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_ABSTRACTIMAGE_HPP -#define NAZARA_UTILITY_ABSTRACTIMAGE_HPP +#ifndef NAZARA_CORE_ABSTRACTIMAGE_HPP +#define NAZARA_CORE_ABSTRACTIMAGE_HPP #include +#include +#include #include #include #include -#include -#include namespace Nz { class AbstractImage; - class NAZARA_UTILITY_API AbstractImage + class NAZARA_CORE_API AbstractImage { public: AbstractImage() = default; @@ -44,6 +44,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_ABSTRACTIMAGE_HPP +#endif // NAZARA_CORE_ABSTRACTIMAGE_HPP diff --git a/include/Nazara/Utility/AbstractImage.inl b/include/Nazara/Core/AbstractImage.inl similarity index 82% rename from include/Nazara/Utility/AbstractImage.inl rename to include/Nazara/Core/AbstractImage.inl index 599de385f..6995a3a2b 100644 --- a/include/Nazara/Utility/AbstractImage.inl +++ b/include/Nazara/Core/AbstractImage.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -17,4 +17,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/Algorithm.hpp b/include/Nazara/Core/Algorithm.hpp index f6a1dfc73..b65095e52 100644 --- a/include/Nazara/Core/Algorithm.hpp +++ b/include/Nazara/Core/Algorithm.hpp @@ -9,9 +9,18 @@ #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include @@ -23,28 +32,75 @@ namespace Nz { class ByteArray; + // Hash template ByteArray ComputeHash(HashType hash, T&& v); template ByteArray ComputeHash(AbstractHash& hash, T&& v); inline bool HashAppend(AbstractHash* hash, std::string_view v); - template - bool Serialize(SerializationContext& context, T&& value); - - inline bool Serialize(SerializationContext& context, bool value, TypeTag); - inline bool Serialize(SerializationContext& context, const std::string& value, TypeTag); - - template - std::enable_if_t::value, bool> Serialize(SerializationContext& context, T value, TypeTag); - - template - bool Unserialize(SerializationContext& context, T* value); - - inline bool Unserialize(SerializationContext& context, bool* value, TypeTag); - inline bool Unserialize(SerializationContext& context, std::string* value, TypeTag); - template std::enable_if_t::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag); + + // Vertex processing + class Joint; + struct VertexStruct_XYZ_Normal_UV_Tangent; + struct VertexStruct_XYZ_Normal_UV_Tangent_Skinning; + + using MeshVertex = VertexStruct_XYZ_Normal_UV_Tangent; + using SkeletalMeshVertex = VertexStruct_XYZ_Normal_UV_Tangent_Skinning; + + struct SkinningData + { + const Joint* joints; + SparsePtr inputPositions; + SparsePtr inputNormals; + SparsePtr inputTangents; + SparsePtr inputJointIndices; + SparsePtr inputJointWeights; + SparsePtr inputUv; + SparsePtr outputNormals; + SparsePtr outputPositions; + SparsePtr outputTangents; + SparsePtr outputUv; + }; + + struct VertexPointers + { + SparsePtr normalPtr; + SparsePtr positionPtr; + SparsePtr tangentPtr; + SparsePtr uvPtr; + }; + + NAZARA_CORE_API Boxf ComputeAABB(SparsePtr positionPtr, UInt32 vertexCount); + NAZARA_CORE_API void ComputeBoxIndexVertexCount(const Vector3ui& subdivision, UInt32* indexCount, UInt32* vertexCount); + NAZARA_CORE_API UInt32 ComputeCacheMissCount(IndexIterator indices, UInt32 indexCount); + NAZARA_CORE_API void ComputeConeIndexVertexCount(unsigned int subdivision, UInt32* indexCount, UInt32* vertexCount); + NAZARA_CORE_API void ComputeCubicSphereIndexVertexCount(unsigned int subdivision, UInt32* indexCount, UInt32* vertexCount); + NAZARA_CORE_API void ComputeIcoSphereIndexVertexCount(unsigned int recursionLevel, UInt32* indexCount, UInt32* vertexCount); + NAZARA_CORE_API void ComputePlaneIndexVertexCount(const Vector2ui& subdivision, UInt32* indexCount, UInt32* vertexCount); + NAZARA_CORE_API void ComputeUvSphereIndexVertexCount(unsigned int sliceCount, unsigned int stackCount, UInt32* indexCount, UInt32* vertexCount); + + NAZARA_CORE_API void GenerateBox(const Vector3f& lengths, const Vector3ui& subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + NAZARA_CORE_API void GenerateCone(float length, float radius, unsigned int subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + NAZARA_CORE_API void GenerateCubicSphere(float size, unsigned int subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + NAZARA_CORE_API void GenerateIcoSphere(float size, unsigned int recursionLevel, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + NAZARA_CORE_API void GeneratePlane(const Vector2ui& subdivision, const Vector2f& size, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + NAZARA_CORE_API void GenerateUvSphere(float size, unsigned int sliceCount, unsigned int stackCount, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); + + NAZARA_CORE_API void OptimizeIndices(IndexIterator indices, UInt32 indexCount); + + NAZARA_CORE_API void SkinLinearBlend(const SkinningData& data, UInt32 startVertex, UInt32 vertexCount); + + inline Vector3f TransformPositionTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& position); + inline Vector3f TransformNormalTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& normal); + inline Quaternionf TransformRotationTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Quaternionf& rotation); + inline Vector3f TransformScaleTRS(const Vector3f& transformScale, const Vector3f& scale); + inline void TransformTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, Vector3f& position, Quaternionf& rotation, Vector3f& scale); + inline void TransformVertices(VertexPointers vertexPointers, UInt32 vertexCount, const Matrix4f& matrix); + + template constexpr ComponentType ComponentTypeId(); + template constexpr ComponentType GetComponentTypeOf(); } #include diff --git a/include/Nazara/Core/Algorithm.inl b/include/Nazara/Core/Algorithm.inl index d0bd3f4a8..8e1aa7c59 100644 --- a/include/Nazara/Core/Algorithm.inl +++ b/include/Nazara/Core/Algorithm.inl @@ -63,157 +63,83 @@ namespace Nz return true; } - template - bool Serialize(SerializationContext& context, T&& value) + inline Vector3f TransformPositionTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& position) { - return Serialize(context, std::forward(value), TypeTag>()); + return transformRotation * (transformScale * position) + transformTranslation; } - /*! - * \ingroup core - * \brief Serializes a boolean - * \return true if serialization succeeded - * - * \param context Context for the serialization - * \param value Boolean to serialize - * - * \see Serialize, Unserialize - */ - inline bool Serialize(SerializationContext& context, bool value, TypeTag) + Vector3f TransformNormalTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& normal) { - if (context.writeBitPos == 8) + return Quaternionf::Mirror(transformRotation, transformScale) * normal; + } + + inline Quaternionf TransformRotationTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Quaternionf& rotation) + { + return Quaternionf::Mirror(transformRotation, transformScale) * rotation; + } + + inline Vector3f TransformScaleTRS(const Vector3f& transformScale, const Vector3f& scale) + { + return transformScale * scale; + } + + inline void TransformTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, Vector3f& position, Quaternionf& rotation, Vector3f& scale) + { + position = TransformPositionTRS(transformTranslation, transformRotation, transformScale, position); + rotation = TransformRotationTRS(transformRotation, transformScale, rotation); + scale = TransformScaleTRS(transformScale, scale); + } + + inline void TransformVertices(VertexPointers vertexPointers, UInt32 vertexCount, const Matrix4f& matrix) + { + if (vertexPointers.positionPtr) { - context.writeBitPos = 0; - context.writeByte = 0; + for (UInt32 i = 0; i < vertexCount; ++i) + *vertexPointers.positionPtr++ = matrix.Transform(*vertexPointers.positionPtr); } - if (value) - context.writeByte |= 1 << context.writeBitPos; - - if (++context.writeBitPos >= 8) - return Serialize(context, context.writeByte, TypeTag()); - else - return true; - } - - /*! - * \ingroup core - * \brief Serializes a std::string - * \return true if successful - * - * \param context Context for the serialization - * \param value String to serialize - */ - bool Serialize(SerializationContext& context, const std::string& value, TypeTag) - { - if (!Serialize(context, SafeCast(value.size()), TypeTag())) - return false; - - return context.stream->Write(value.data(), value.size()) == value.size(); - } - - /*! - * \ingroup core - * \brief Serializes an arithmetic type - * \return true if serialization succeeded - * - * \param context Context for the serialization - * \param value Arithmetic type to serialize - * - * \see Serialize, Unserialize - */ - template - std::enable_if_t::value, bool> Serialize(SerializationContext& context, T value, TypeTag) - { - // Flush bits in case a writing is in progress - context.FlushBits(); - - if (context.endianness != Endianness::Unknown && context.endianness != PlatformEndianness) - value = ByteSwap(value); - - return context.stream->Write(&value, sizeof(T)) == sizeof(T); - } - - - template - bool Unserialize(SerializationContext& context, T* value) - { - return Unserialize(context, value, TypeTag()); - } - - /*! - * \ingroup core - * \brief Unserializes a boolean - * \return true if unserialization succedeed - * - * \param context Context for the unserialization - * \param value Pointer to boolean to unserialize - * - * \see Serialize, Unserialize - */ - inline bool Unserialize(SerializationContext& context, bool* value, TypeTag) - { - if (context.readBitPos == 8) + if (vertexPointers.normalPtr || vertexPointers.tangentPtr) { - if (!Unserialize(context, &context.readByte, TypeTag())) - return false; + Vector3f scale = matrix.GetScale(); - context.readBitPos = 0; + if (vertexPointers.normalPtr) + { + for (UInt64 i = 0; i < vertexCount; ++i) + *vertexPointers.normalPtr++ = matrix.Transform(*vertexPointers.normalPtr, 0.f) / scale; + } + + if (vertexPointers.tangentPtr) + { + for (UInt64 i = 0; i < vertexCount; ++i) + *vertexPointers.tangentPtr++ = matrix.Transform(*vertexPointers.tangentPtr, 0.f) / scale; + } } - - if (value) - *value = (context.readByte & (1 << context.readBitPos)) != 0; - - context.readBitPos++; - - return true; } - /*! - * \brief Unserializes a string - * \return true if successful - * - * \param context Context of unserialization - * \param string std::string to unserialize - */ - bool Unserialize(SerializationContext& context, std::string* string, TypeTag) + template constexpr ComponentType ComponentTypeId() { - UInt32 size; - if (!Unserialize(context, &size, TypeTag())) - return false; - - string->resize(size); - return context.stream->Read(&(*string)[0], size) == size; + static_assert(AlwaysFalse::value, "This type cannot be used as a component."); + return ComponentType{}; } - /*! - * \ingroup core - * \brief Unserializes an arithmetic type - * \return true if unserialization succedeed - * - * \param context Context for the unserialization - * \param value Pointer to arithmetic type to serialize - * - * \remark Produce a NazaraAssert if pointer to value is invalid - * - * \see Serialize, Unserialize - */ + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Color; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double1; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double2; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double3; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double4; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float1; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float2; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float3; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float4; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int1; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int2; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int3; } + template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int4; } + template - std::enable_if_t::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag) + constexpr ComponentType GetComponentTypeOf() { - NazaraAssert(value, "Invalid data pointer"); - - context.ResetReadBitPosition(); - - if (context.stream->Read(value, sizeof(T)) == sizeof(T)) - { - if (context.endianness != Endianness::Unknown && context.endianness != PlatformEndianness) - *value = ByteSwap(*value); - - return true; - } - else - return false; + return ComponentTypeId>(); } } diff --git a/include/Nazara/Utility/Animation.hpp b/include/Nazara/Core/Animation.hpp similarity index 88% rename from include/Nazara/Utility/Animation.hpp rename to include/Nazara/Core/Animation.hpp index e633a59ad..e3323da61 100644 --- a/include/Nazara/Utility/Animation.hpp +++ b/include/Nazara/Core/Animation.hpp @@ -1,13 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_ANIMATION_HPP -#define NAZARA_UTILITY_ANIMATION_HPP +#ifndef NAZARA_CORE_ANIMATION_HPP +#define NAZARA_CORE_ANIMATION_HPP #include +#include +#include #include #include #include @@ -15,8 +17,6 @@ #include #include #include -#include -#include #include #include #include @@ -25,7 +25,7 @@ namespace Nz { class Skeleton; - struct NAZARA_UTILITY_API AnimationParams : ResourceParameters + struct NAZARA_CORE_API AnimationParams : ResourceParameters { // La frame de fin à charger std::size_t endFrame = 0xFFFFFFFF; @@ -54,7 +54,7 @@ namespace Nz struct AnimationImpl; - class NAZARA_UTILITY_API Animation : public Resource + class NAZARA_CORE_API Animation : public Resource { public: using Params = AnimationParams; @@ -105,6 +105,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_ANIMATION_HPP +#endif // NAZARA_CORE_ANIMATION_HPP diff --git a/include/Nazara/Utility/Animation.inl b/include/Nazara/Core/Animation.inl similarity index 55% rename from include/Nazara/Utility/Animation.inl rename to include/Nazara/Core/Animation.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/Animation.inl +++ b/include/Nazara/Core/Animation.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Buffer.hpp b/include/Nazara/Core/Buffer.hpp similarity index 79% rename from include/Nazara/Utility/Buffer.hpp rename to include/Nazara/Core/Buffer.hpp index 57df02847..515ef47f4 100644 --- a/include/Nazara/Utility/Buffer.hpp +++ b/include/Nazara/Core/Buffer.hpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_BUFFER_HPP -#define NAZARA_UTILITY_BUFFER_HPP +#ifndef NAZARA_CORE_BUFFER_HPP +#define NAZARA_CORE_BUFFER_HPP #include -#include -#include +#include +#include #include #include @@ -19,7 +19,7 @@ namespace Nz using BufferFactory = std::function(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData)>; - class NAZARA_UTILITY_API Buffer + class NAZARA_CORE_API Buffer { public: inline Buffer(DataStorage storage, BufferType type, UInt64 size, BufferUsageFlags usage); @@ -50,6 +50,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_BUFFER_HPP +#endif // NAZARA_CORE_BUFFER_HPP diff --git a/include/Nazara/Utility/Buffer.inl b/include/Nazara/Core/Buffer.inl similarity index 82% rename from include/Nazara/Utility/Buffer.inl rename to include/Nazara/Core/Buffer.inl index 7c8ee7257..03f98e32d 100644 --- a/include/Nazara/Utility/Buffer.inl +++ b/include/Nazara/Core/Buffer.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -36,4 +36,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/BufferMapper.hpp b/include/Nazara/Core/BufferMapper.hpp similarity index 66% rename from include/Nazara/Utility/BufferMapper.hpp rename to include/Nazara/Core/BufferMapper.hpp index 939cbb40f..344bdc296 100644 --- a/include/Nazara/Utility/BufferMapper.hpp +++ b/include/Nazara/Core/BufferMapper.hpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_BUFFERMAPPER_HPP -#define NAZARA_UTILITY_BUFFERMAPPER_HPP +#ifndef NAZARA_CORE_BUFFERMAPPER_HPP +#define NAZARA_CORE_BUFFERMAPPER_HPP -#include +#include namespace Nz { @@ -32,6 +32,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_BUFFERMAPPER_HPP +#endif // NAZARA_CORE_BUFFERMAPPER_HPP diff --git a/include/Nazara/Utility/BufferMapper.inl b/include/Nazara/Core/BufferMapper.inl similarity index 87% rename from include/Nazara/Utility/BufferMapper.inl rename to include/Nazara/Core/BufferMapper.inl index 86c9ebeee..b11c8cb82 100644 --- a/include/Nazara/Utility/BufferMapper.inl +++ b/include/Nazara/Core/BufferMapper.inl @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp +#include #include -#include -#include +#include namespace Nz { @@ -69,4 +69,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/ByteStream.hpp b/include/Nazara/Core/ByteStream.hpp index dbf7226a3..49fcc528d 100644 --- a/include/Nazara/Core/ByteStream.hpp +++ b/include/Nazara/Core/ByteStream.hpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace Nz diff --git a/include/Nazara/Core/ByteStream.inl b/include/Nazara/Core/ByteStream.inl index 484f9cfa2..a5838d87b 100644 --- a/include/Nazara/Core/ByteStream.inl +++ b/include/Nazara/Core/ByteStream.inl @@ -2,7 +2,6 @@ // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include namespace Nz @@ -163,7 +162,6 @@ namespace Nz * * \remark Produces a NazaraError if unserialization failed */ - template ByteStream& ByteStream::operator>>(T& value) { diff --git a/include/Nazara/Core/Clock.inl b/include/Nazara/Core/Clock.inl index 2e356c2df..d088b8af5 100644 --- a/include/Nazara/Core/Clock.inl +++ b/include/Nazara/Core/Clock.inl @@ -9,7 +9,7 @@ namespace Nz /*! * \ingroup core * \class Nz::Clock - * \brief Utility class that measure the elapsed time + * \brief Core class that measure the elapsed time */ /*! diff --git a/include/Nazara/Core/Color.hpp b/include/Nazara/Core/Color.hpp index 01281ce7b..2d07d1646 100644 --- a/include/Nazara/Core/Color.hpp +++ b/include/Nazara/Core/Color.hpp @@ -8,6 +8,7 @@ #define NAZARA_CORE_COLOR_HPP #include +#include #include #include #include diff --git a/include/Nazara/Core/Components.hpp b/include/Nazara/Core/Components.hpp index 0b72ca1ca..507dcc5d4 100644 --- a/include/Nazara/Core/Components.hpp +++ b/include/Nazara/Core/Components.hpp @@ -31,5 +31,10 @@ #include #include +#include +#include +#include +#include +#include #endif // NAZARA_CORE_COMPONENTS_HPP diff --git a/include/Nazara/Core/Components/DisabledComponent.hpp b/include/Nazara/Core/Components/DisabledComponent.hpp index 1b525130e..06554282b 100644 --- a/include/Nazara/Core/Components/DisabledComponent.hpp +++ b/include/Nazara/Core/Components/DisabledComponent.hpp @@ -8,8 +8,8 @@ #define NAZARA_CORE_COMPONENTS_DISABLEDCOMPONENT_HPP #include +#include #include -#include namespace Nz { diff --git a/include/Nazara/Core/Components/LifetimeComponent.hpp b/include/Nazara/Core/Components/LifetimeComponent.hpp index 193eed1da..7da020323 100644 --- a/include/Nazara/Core/Components/LifetimeComponent.hpp +++ b/include/Nazara/Core/Components/LifetimeComponent.hpp @@ -8,8 +8,8 @@ #define NAZARA_CORE_COMPONENTS_LIFETIMECOMPONENT_HPP #include +#include #include -#include namespace Nz { diff --git a/include/Nazara/Utility/Components/NodeComponent.hpp b/include/Nazara/Core/Components/NodeComponent.hpp similarity index 69% rename from include/Nazara/Utility/Components/NodeComponent.hpp rename to include/Nazara/Core/Components/NodeComponent.hpp index 3f59f98c5..94fac0d27 100644 --- a/include/Nazara/Utility/Components/NodeComponent.hpp +++ b/include/Nazara/Core/Components/NodeComponent.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_NODECOMPONENT_HPP -#define NAZARA_UTILITY_COMPONENTS_NODECOMPONENT_HPP +#ifndef NAZARA_CORE_COMPONENTS_NODECOMPONENT_HPP +#define NAZARA_CORE_COMPONENTS_NODECOMPONENT_HPP #include -#include +#include #include namespace Nz { - class NAZARA_UTILITY_API NodeComponent : public Node + class NAZARA_CORE_API NodeComponent : public Node { public: using Node::Node; @@ -31,6 +31,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_NODECOMPONENT_HPP +#endif // NAZARA_CORE_COMPONENTS_NODECOMPONENT_HPP diff --git a/include/Nazara/Utility/Components/NodeComponent.inl b/include/Nazara/Core/Components/NodeComponent.inl similarity index 55% rename from include/Nazara/Utility/Components/NodeComponent.inl rename to include/Nazara/Core/Components/NodeComponent.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/Components/NodeComponent.inl +++ b/include/Nazara/Core/Components/NodeComponent.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Components/SharedSkeletonComponent.hpp b/include/Nazara/Core/Components/SharedSkeletonComponent.hpp similarity index 70% rename from include/Nazara/Utility/Components/SharedSkeletonComponent.hpp rename to include/Nazara/Core/Components/SharedSkeletonComponent.hpp index 387428015..6e94a7847 100644 --- a/include/Nazara/Utility/Components/SharedSkeletonComponent.hpp +++ b/include/Nazara/Core/Components/SharedSkeletonComponent.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP -#define NAZARA_UTILITY_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP +#ifndef NAZARA_CORE_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP +#define NAZARA_CORE_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP #include -#include -#include +#include +#include namespace Nz { - class NAZARA_UTILITY_API SharedSkeletonComponent final : public SkeletonComponentBase + class NAZARA_CORE_API SharedSkeletonComponent final : public SkeletonComponentBase { friend class SkeletonSystem; @@ -41,6 +41,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP +#endif // NAZARA_CORE_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP diff --git a/include/Nazara/Utility/Components/SharedSkeletonComponent.inl b/include/Nazara/Core/Components/SharedSkeletonComponent.inl similarity index 67% rename from include/Nazara/Utility/Components/SharedSkeletonComponent.inl rename to include/Nazara/Core/Components/SharedSkeletonComponent.inl index 025d13171..4dbdb70f0 100644 --- a/include/Nazara/Utility/Components/SharedSkeletonComponent.inl +++ b/include/Nazara/Core/Components/SharedSkeletonComponent.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -12,4 +12,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Components/SkeletonComponent.hpp b/include/Nazara/Core/Components/SkeletonComponent.hpp similarity index 61% rename from include/Nazara/Utility/Components/SkeletonComponent.hpp rename to include/Nazara/Core/Components/SkeletonComponent.hpp index 04466b1ef..5ee6cbf12 100644 --- a/include/Nazara/Utility/Components/SkeletonComponent.hpp +++ b/include/Nazara/Core/Components/SkeletonComponent.hpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENT_HPP -#define NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENT_HPP +#ifndef NAZARA_CORE_COMPONENTS_SKELETONCOMPONENT_HPP +#define NAZARA_CORE_COMPONENTS_SKELETONCOMPONENT_HPP #include -#include -#include +#include +#include namespace Nz { class Node; - class NAZARA_UTILITY_API SkeletonComponent final : public SkeletonComponentBase + class NAZARA_CORE_API SkeletonComponent final : public SkeletonComponentBase { public: inline SkeletonComponent(std::shared_ptr skeleton); @@ -33,6 +33,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENT_HPP +#endif // NAZARA_CORE_COMPONENTS_SKELETONCOMPONENT_HPP diff --git a/include/Nazara/Utility/Components/SkeletonComponent.inl b/include/Nazara/Core/Components/SkeletonComponent.inl similarity index 79% rename from include/Nazara/Utility/Components/SkeletonComponent.inl rename to include/Nazara/Core/Components/SkeletonComponent.inl index 5888ba7d7..b14be89ef 100644 --- a/include/Nazara/Utility/Components/SkeletonComponent.inl +++ b/include/Nazara/Core/Components/SkeletonComponent.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -22,4 +22,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Components/SkeletonComponentBase.hpp b/include/Nazara/Core/Components/SkeletonComponentBase.hpp similarity index 69% rename from include/Nazara/Utility/Components/SkeletonComponentBase.hpp rename to include/Nazara/Core/Components/SkeletonComponentBase.hpp index 86291a399..fe01a5d54 100644 --- a/include/Nazara/Utility/Components/SkeletonComponentBase.hpp +++ b/include/Nazara/Core/Components/SkeletonComponentBase.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENTBASE_HPP -#define NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENTBASE_HPP +#ifndef NAZARA_CORE_COMPONENTS_SKELETONCOMPONENTBASE_HPP +#define NAZARA_CORE_COMPONENTS_SKELETONCOMPONENTBASE_HPP #include -#include -#include +#include +#include namespace Nz { - class NAZARA_UTILITY_API SkeletonComponentBase + class NAZARA_CORE_API SkeletonComponentBase { public: SkeletonComponentBase(const SkeletonComponentBase&) = default; @@ -37,6 +37,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENTBASE_HPP +#endif // NAZARA_CORE_COMPONENTS_SKELETONCOMPONENTBASE_HPP diff --git a/include/Nazara/Utility/Components/SkeletonComponentBase.inl b/include/Nazara/Core/Components/SkeletonComponentBase.inl similarity index 84% rename from include/Nazara/Utility/Components/SkeletonComponentBase.inl rename to include/Nazara/Core/Components/SkeletonComponentBase.inl index 4e7f4d2e9..9ca14bb9a 100644 --- a/include/Nazara/Utility/Components/SkeletonComponentBase.inl +++ b/include/Nazara/Core/Components/SkeletonComponentBase.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -27,4 +27,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Components/VelocityComponent.hpp b/include/Nazara/Core/Components/VelocityComponent.hpp similarity index 68% rename from include/Nazara/Utility/Components/VelocityComponent.hpp rename to include/Nazara/Core/Components/VelocityComponent.hpp index b0c178d2b..fa0411996 100644 --- a/include/Nazara/Utility/Components/VelocityComponent.hpp +++ b/include/Nazara/Core/Components/VelocityComponent.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_VELOCITYCOMPONENT_HPP -#define NAZARA_UTILITY_COMPONENTS_VELOCITYCOMPONENT_HPP +#ifndef NAZARA_CORE_COMPONENTS_VELOCITYCOMPONENT_HPP +#define NAZARA_CORE_COMPONENTS_VELOCITYCOMPONENT_HPP #include +#include #include -#include namespace Nz { - class NAZARA_UTILITY_API VelocityComponent + class NAZARA_CORE_API VelocityComponent { public: inline VelocityComponent(const Vector3f& linearVelocity = Vector3f::Zero()); @@ -33,6 +33,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_VELOCITYCOMPONENT_HPP +#endif // NAZARA_CORE_COMPONENTS_VELOCITYCOMPONENT_HPP diff --git a/include/Nazara/Utility/Components/VelocityComponent.inl b/include/Nazara/Core/Components/VelocityComponent.inl similarity index 79% rename from include/Nazara/Utility/Components/VelocityComponent.inl rename to include/Nazara/Core/Components/VelocityComponent.inl index edbf5bba5..17ca48ea7 100644 --- a/include/Nazara/Utility/Components/VelocityComponent.inl +++ b/include/Nazara/Core/Components/VelocityComponent.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -22,4 +22,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/Config.hpp b/include/Nazara/Core/Config.hpp index d4f71ef9f..ff68238a5 100644 --- a/include/Nazara/Core/Config.hpp +++ b/include/Nazara/Core/Config.hpp @@ -34,9 +34,6 @@ /// Each modification of a parameter needs a recompilation of the module -// Precision of reals when transformed into string (Max. numbers after the coma) -#define NAZARA_CORE_DECIMAL_DIGITS 6 - // Duplicate the log output on the standard output flux (cout) #define NAZARA_CORE_DUPLICATE_LOG_TO_COUT 0 @@ -55,6 +52,12 @@ // Activate the security tests based on the code (Advised for development) #define NAZARA_CORE_SAFE 1 +// When a resource is being parsed, it triggers a warning if a non-critical error is found in the resource (Slower) +#define NAZARA_CORE_STRICT_RESOURCE_PARSING 1 + +// The maximal number of weights acting on a vertex (In case of overflow, the surnumerous weights would be ignored and the others renormalized) +#define NAZARA_CORE_SKINNING_MAX_WEIGHTS 4 + /// Checking the values and types of certain constants #include diff --git a/include/Nazara/Core/ConfigCheck.hpp b/include/Nazara/Core/ConfigCheck.hpp index 726c33dda..c89aeb6b6 100644 --- a/include/Nazara/Core/ConfigCheck.hpp +++ b/include/Nazara/Core/ConfigCheck.hpp @@ -12,8 +12,8 @@ #include #define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type ::value && name op val, #type err) -NazaraCheckTypeAndVal(NAZARA_CORE_DECIMAL_DIGITS, integral, >, 0, " shall be a strictly positive integer"); NazaraCheckTypeAndVal(NAZARA_CORE_FILE_BUFFERSIZE, integral, >, 0, " shall be a strictly positive integer"); +NazaraCheckTypeAndVal(NAZARA_CORE_SKINNING_MAX_WEIGHTS, integral, >, 0, " shall be a strictly positive integer"); #undef NazaraCheckTypeAndVal diff --git a/include/Nazara/Core/Core.hpp b/include/Nazara/Core/Core.hpp index 3d8df8e74..10cdfd9a3 100644 --- a/include/Nazara/Core/Core.hpp +++ b/include/Nazara/Core/Core.hpp @@ -8,7 +8,12 @@ #define NAZARA_CORE_HPP #include +#include +#include #include +#include +#include +#include #include #include #include @@ -28,10 +33,28 @@ namespace Nz Core(Config /*config*/); ~Core(); + AnimationLoader& GetAnimationLoader(); + const AnimationLoader& GetAnimationLoader() const; inline const HardwareInfo& GetHardwareInfo() const; + ImageLoader& GetImageLoader(); + const ImageLoader& GetImageLoader() const; + ImageSaver& GetImageSaver(); + const ImageSaver& GetImageSaver() const; + ImageStreamLoader& GetImageStreamLoader(); + const ImageStreamLoader& GetImageStreamLoader() const; + MeshLoader& GetMeshLoader(); + const MeshLoader& GetMeshLoader() const; + MeshSaver& GetMeshSaver(); + const MeshSaver& GetMeshSaver() const; private: std::optional m_hardwareInfo; + AnimationLoader m_animationLoader; + ImageLoader m_imageLoader; + ImageSaver m_imageSaver; + ImageStreamLoader m_imageStreamLoader; + MeshLoader m_meshLoader; + MeshSaver m_meshSaver; static Core* s_instance; }; diff --git a/include/Nazara/Utility/CubemapParams.hpp b/include/Nazara/Core/CubemapParams.hpp similarity index 83% rename from include/Nazara/Utility/CubemapParams.hpp rename to include/Nazara/Core/CubemapParams.hpp index f4752a7d4..b52761d11 100644 --- a/include/Nazara/Utility/CubemapParams.hpp +++ b/include/Nazara/Core/CubemapParams.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_CUBEMAPPARAMS_HPP -#define NAZARA_UTILITY_CUBEMAPPARAMS_HPP +#ifndef NAZARA_CORE_CUBEMAPPARAMS_HPP +#define NAZARA_CORE_CUBEMAPPARAMS_HPP #include @@ -35,4 +35,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_CUBEMAPPARAMS_HPP +#endif // NAZARA_CORE_CUBEMAPPARAMS_HPP diff --git a/include/Nazara/Core/Enums.hpp b/include/Nazara/Core/Enums.hpp index 362d47694..e3fa2034f 100644 --- a/include/Nazara/Core/Enums.hpp +++ b/include/Nazara/Core/Enums.hpp @@ -11,6 +11,103 @@ namespace Nz { + enum class AnimationType + { + Skeletal, + Static, + + Max = Static + }; + + enum class BlendEquation + { + Add, + Max, + Min, + ReverseSubtract, + Subtract, + }; + + enum class BlendFunc + { + ConstantColor, + ConstantAlpha, + DstAlpha, + DstColor, + SrcAlpha, + SrcColor, + InvConstantColor, + InvConstantAlpha, + InvDstAlpha, + InvDstColor, + InvSrcAlpha, + InvSrcColor, + One, + Zero + }; + + enum class BufferAccess + { + DiscardAndWrite, + ReadOnly, + ReadWrite, + WriteOnly, + + Max = WriteOnly + }; + + enum class BufferType + { + Index, + Vertex, + Storage, + Uniform, + Upload, + + Max = Upload + }; + + enum class BufferUsage + { + DeviceLocal, + DirectMapping, + Dynamic, + Read, + PersistentMapping, + Write, + + Max = DirectMapping + }; + + template<> + struct EnumAsFlags + { + static constexpr BufferUsage max = BufferUsage::Max; + }; + + using BufferUsageFlags = Flags; + + enum class ComponentType + { + Color, + Double1, + Double2, + Double3, + Double4, + Float1, + Float2, + Float3, + Float4, + Int1, + Int2, + Int3, + Int4, + + Max = Int4 + }; + + constexpr std::size_t ComponentTypeCount = static_cast(ComponentType::Max) + 1; + enum class CoordSys { Global, @@ -28,6 +125,37 @@ namespace Nz Max = AtEnd }; + enum class CubemapFace + { + // This enumeration is intended to replace the "z" argument of Image's methods containing cubemap + // The order is X, -X, Y, -Y, Z, -Z + PositiveX = 0, + PositiveY = 2, + PositiveZ = 4, + NegativeX = 1, + NegativeY = 3, + NegativeZ = 5, + + Max = NegativeZ + }; + + enum class DataStorage + { + Hardware, + Software, + + Max = Software + }; + + template<> + struct EnumAsFlags + { + static constexpr DataStorage max = DataStorage::Max; + }; + + using DataStoreFlags = Flags; + constexpr std::size_t DataStorageCount = static_cast(DataStorage::Max) + 1; + enum class ErrorMode { Silent, @@ -58,6 +186,34 @@ namespace Nz constexpr std::size_t ErrorTypeCount = static_cast(ErrorType::Max) + 1; + enum class FaceFilling + { + Fill, + Line, + Point, + + Max = Point + }; + + enum class FaceCulling + { + None, + + Back, + Front, + FrontAndBack, + + Max = FrontAndBack + }; + + enum class FrontFace + { + Clockwise, + CounterClockwise, + + Max = CounterClockwise + }; + enum class ImageType { E1D, @@ -72,6 +228,15 @@ namespace Nz constexpr std::size_t ImageTypeCount = static_cast(ImageType::Max) + 1; + enum class IndexType + { + U8, + U16, + U32, + + Max = U32 + }; + enum class HashType { CRC32, @@ -131,6 +296,120 @@ namespace Nz Max = Userdata }; + enum class PixelFormatContent + { + Undefined = -1, + + ColorRGBA, + Depth, + DepthStencil, + Stencil, + + Max = Stencil + }; + + enum class PixelFormat + { + Undefined = -1, + + A8, // 1*uint8 + BGR8, // 3*uint8 + BGR8_SRGB, // 3*uint8 + BGRA8, // 4*uint8 + BGRA8_SRGB, // 4*uint8 + DXT1, + DXT3, + DXT5, + L8, // 1*uint8 + LA8, // 2*uint8 + R8, // 1*uint8 + R8I, // 1*int8 + R8UI, // 1*uint8 + R16, // 1*uint16 + R16F, // 1*half + R16I, // 1*int16 + R16UI, // 1*uint16 + R32F, // 1*float + R32I, // 1*uint16 + R32UI, // 1*uint32 + RG8, // 2*int8 + RG8I, // 2*int8 + RG8UI, // 2*uint8 + RG16, // 2*uint16 + RG16F, // 2*half + RG16I, // 2*int16 + RG16UI, // 2*uint16 + RG32F, // 2*float + RG32I, // 2*uint16 + RG32UI, // 2*uint32 + RGB5A1, // 3*uint5 + alpha bit + RGB8, // 3*uint8 + RGB8_SRGB, // 3*uint8 + RGB16F, // 3*half + RGB16I, // 4*int16 + RGB16UI, // 4*uint16 + RGB32F, // 3*float + RGB32I, // 4*int32 + RGB32UI, // 4*uint32 + RGBA4, // 4*uint4 + RGBA8, // 4*uint8 + RGBA8_SRGB, // 4*uint8 + RGBA16F, // 4*half + RGBA16I, // 4*int16 + RGBA16UI, // 4*uint16 + RGBA32F, // 4*float + RGBA32I, // 4*int32 + RGBA32UI, // 4*uint32 + Depth16, + Depth16Stencil8, + Depth24, + Depth24Stencil8, + Depth32F, + Depth32FStencil8, + Stencil1, + Stencil4, + Stencil8, + Stencil16, + + Max = Stencil16 + }; + + constexpr std::size_t PixelFormatCount = static_cast(PixelFormat::Max) + 1; + + enum class PixelFormatSubType + { + Compressed, // Opaque + Double, // F64 + Float, // F32 + Half, // F16 + Int, // Signed integer + Unsigned, // Unsigned integer + + Max = Unsigned + }; + + enum class PixelFlipping + { + Horizontally, + Vertically, + + Max = Vertically + }; + + constexpr std::size_t PixelFlippingCount = static_cast(PixelFlipping::Max) + 1; + + enum class PrimitiveMode + { + LineList, + LineStrip, + PointList, + TriangleList, + TriangleStrip, + TriangleFan, + + Max = TriangleFan + }; + enum class PrimitiveType { Box, @@ -204,6 +483,20 @@ namespace Nz constexpr std::size_t ProcessorVendorCount = static_cast(ProcessorVendor::Max) + 1; + enum class RendererComparison + { + Always, + Equal, + Greater, + GreaterOrEqual, + Less, + LessOrEqual, + Never, + NotEqual, + + Max = NotEqual + }; + enum class ResourceLoadingError { DecodingError, @@ -213,6 +506,31 @@ namespace Nz Unrecognized }; + enum class SamplerFilter + { + Linear, + Nearest, + + Max = Nearest + }; + + enum class SamplerMipmapMode + { + Linear, + Nearest, + + Max = Nearest + }; + + enum class SamplerWrap + { + Clamp, + MirroredRepeat, + Repeat, + + Max = Repeat + }; + enum class SphereType { Cubic, @@ -222,6 +540,20 @@ namespace Nz Max = UV }; + enum class StencilOperation + { + Decrement, + DecrementNoClamp, + Increment, + IncrementNoClamp, + Invert, + Keep, + Replace, + Zero, + + Max = Zero + }; + enum class StreamOption { None, @@ -241,6 +573,83 @@ namespace Nz }; using StreamOptionFlags = Flags; + + enum class TextAlign + { + Left, + Middle, + Right, + + Max = Right + }; + + enum class TextStyle + { + Bold, + Italic, + StrikeThrough, + Underlined, + + Max = Underlined + }; + + template<> + struct EnumAsFlags + { + static constexpr TextStyle max = TextStyle::Max; + }; + + using TextStyleFlags = Flags; + + constexpr TextStyleFlags TextStyle_Regular = TextStyleFlags{}; + + enum class VertexComponent + { + Unused = -1, + + Color, + JointIndices, + JointWeights, + Normal, + Position, + SizeSinCos, + Tangent, + TexCoord, + Userdata, + + Max = Userdata + }; + + enum class VertexInputRate + { + Instance, + Vertex + }; + + enum class VertexLayout + { + // Predefined declarations for rendering + UV_SizeSinCos, + XY, + XY_Color, + XY_UV, + XYZ, + XYZ_Color, + XYZ_Color_UV, + XYZ_Normal, + XYZ_Normal_UV, + XYZ_Normal_UV_Tangent, + XYZ_Normal_UV_Tangent_Skinning, + UV_SizeSinCos_Color, + XYZ_UV, + + // Predefined declarations for instancing + Matrix4, + + Max = Matrix4 + }; + + constexpr std::size_t VertexLayoutCount = static_cast(VertexLayout::Max) + 1; } #endif // NAZARA_CORE_ENUMS_HPP diff --git a/include/Nazara/Utility/Formats/MD5AnimParser.hpp b/include/Nazara/Core/Formats/MD5AnimParser.hpp similarity index 84% rename from include/Nazara/Utility/Formats/MD5AnimParser.hpp rename to include/Nazara/Core/Formats/MD5AnimParser.hpp index b977ba1c3..f92b4552f 100644 --- a/include/Nazara/Utility/Formats/MD5AnimParser.hpp +++ b/include/Nazara/Core/Formats/MD5AnimParser.hpp @@ -1,22 +1,24 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD5ANIMPARSER_HPP -#define NAZARA_UTILITY_FORMATS_MD5ANIMPARSER_HPP +#ifndef NAZARA_CORE_FORMATS_MD5ANIMPARSER_HPP +#define NAZARA_CORE_FORMATS_MD5ANIMPARSER_HPP #include +#include #include #include #include -#include #include namespace Nz { - class NAZARA_UTILITY_API MD5AnimParser + class Stream; + + class NAZARA_CORE_API MD5AnimParser { public: struct FrameJoint @@ -78,4 +80,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_FORMATS_MD5ANIMPARSER_HPP +#endif // NAZARA_CORE_FORMATS_MD5ANIMPARSER_HPP diff --git a/include/Nazara/Utility/Formats/MD5MeshParser.hpp b/include/Nazara/Core/Formats/MD5MeshParser.hpp similarity index 84% rename from include/Nazara/Utility/Formats/MD5MeshParser.hpp rename to include/Nazara/Core/Formats/MD5MeshParser.hpp index c557765db..eac4725a0 100644 --- a/include/Nazara/Utility/Formats/MD5MeshParser.hpp +++ b/include/Nazara/Core/Formats/MD5MeshParser.hpp @@ -1,23 +1,25 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD5MESHPARSER_HPP -#define NAZARA_UTILITY_FORMATS_MD5MESHPARSER_HPP +#ifndef NAZARA_CORE_FORMATS_MD5MESHPARSER_HPP +#define NAZARA_CORE_FORMATS_MD5MESHPARSER_HPP #include +#include #include #include #include -#include #include #include namespace Nz { - class NAZARA_UTILITY_API MD5MeshParser + class Stream; + + class NAZARA_CORE_API MD5MeshParser { public: struct Joint @@ -83,4 +85,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_FORMATS_MD5MESHPARSER_HPP +#endif // NAZARA_CORE_FORMATS_MD5MESHPARSER_HPP diff --git a/include/Nazara/Utility/Formats/MTLParser.hpp b/include/Nazara/Core/Formats/MTLParser.hpp similarity index 86% rename from include/Nazara/Utility/Formats/MTLParser.hpp rename to include/Nazara/Core/Formats/MTLParser.hpp index fdff247b1..12e62b690 100644 --- a/include/Nazara/Utility/Formats/MTLParser.hpp +++ b/include/Nazara/Core/Formats/MTLParser.hpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MTLPARSER_HPP -#define NAZARA_UTILITY_FORMATS_MTLPARSER_HPP +#ifndef NAZARA_CORE_FORMATS_MTLPARSER_HPP +#define NAZARA_CORE_FORMATS_MTLPARSER_HPP #include #include -#include +#include #include #include namespace Nz { - class NAZARA_UTILITY_API MTLParser + class NAZARA_CORE_API MTLParser { public: struct Material; @@ -75,6 +75,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_FORMATS_MTLPARSER_HPP +#endif // NAZARA_CORE_FORMATS_MTLPARSER_HPP diff --git a/include/Nazara/Utility/Formats/MTLParser.inl b/include/Nazara/Core/Formats/MTLParser.inl similarity index 92% rename from include/Nazara/Utility/Formats/MTLParser.inl rename to include/Nazara/Core/Formats/MTLParser.inl index 620b1d0f7..1308b603c 100644 --- a/include/Nazara/Utility/Formats/MTLParser.inl +++ b/include/Nazara/Core/Formats/MTLParser.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -78,4 +78,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Formats/OBJParser.hpp b/include/Nazara/Core/Formats/OBJParser.hpp similarity index 88% rename from include/Nazara/Utility/Formats/OBJParser.hpp rename to include/Nazara/Core/Formats/OBJParser.hpp index e45721506..e1e9f7cb0 100644 --- a/include/Nazara/Utility/Formats/OBJParser.hpp +++ b/include/Nazara/Core/Formats/OBJParser.hpp @@ -1,21 +1,23 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_OBJPARSER_HPP -#define NAZARA_UTILITY_FORMATS_OBJPARSER_HPP +#ifndef NAZARA_CORE_FORMATS_OBJPARSER_HPP +#define NAZARA_CORE_FORMATS_OBJPARSER_HPP #include +#include #include #include -#include #include namespace Nz { - class NAZARA_UTILITY_API OBJParser + class Stream; + + class NAZARA_CORE_API OBJParser { public: struct Mesh; @@ -82,7 +84,7 @@ namespace Nz inline void EmitLine() const; template void EmitLine(const T& line) const; inline void Error(std::string_view message); - inline void Flush() const; + void Flush() const; inline void Warning(std::string_view message); inline bool UnrecognizedLine(bool error = false); @@ -101,6 +103,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_FORMATS_OBJPARSER_HPP +#endif // NAZARA_CORE_FORMATS_OBJPARSER_HPP diff --git a/include/Nazara/Utility/Formats/OBJParser.inl b/include/Nazara/Core/Formats/OBJParser.inl similarity index 93% rename from include/Nazara/Utility/Formats/OBJParser.inl rename to include/Nazara/Core/Formats/OBJParser.inl index f43193214..c88150daa 100644 --- a/include/Nazara/Utility/Formats/OBJParser.inl +++ b/include/Nazara/Core/Formats/OBJParser.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -156,12 +156,6 @@ namespace Nz NazaraErrorFmt("{0} on line #{1}", message, m_lineCount); } - inline void OBJParser::Flush() const - { - m_currentStream->Write(std::move(m_outputStream).str()); - m_outputStream.str({}); - } - inline void OBJParser::Warning(std::string_view message) { NazaraWarningFmt("{0} on line #{1}", message, m_lineCount); @@ -188,4 +182,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/Functor.hpp b/include/Nazara/Core/Functor.hpp index bcbbe13dc..194b5343b 100644 --- a/include/Nazara/Core/Functor.hpp +++ b/include/Nazara/Core/Functor.hpp @@ -7,7 +7,8 @@ #ifndef NAZARA_CORE_FUNCTOR_HPP #define NAZARA_CORE_FUNCTOR_HPP -#include +#include +#include // Inspired from the of code of the SFML by Laurent Gomila diff --git a/include/Nazara/Utility/GuillotineImageAtlas.hpp b/include/Nazara/Core/GuillotineImageAtlas.hpp similarity index 84% rename from include/Nazara/Utility/GuillotineImageAtlas.hpp rename to include/Nazara/Core/GuillotineImageAtlas.hpp index bbfb99efb..c7fe51e85 100644 --- a/include/Nazara/Utility/GuillotineImageAtlas.hpp +++ b/include/Nazara/Core/GuillotineImageAtlas.hpp @@ -1,23 +1,23 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_GUILLOTINEIMAGEATLAS_HPP -#define NAZARA_UTILITY_GUILLOTINEIMAGEATLAS_HPP +#ifndef NAZARA_CORE_GUILLOTINEIMAGEATLAS_HPP +#define NAZARA_CORE_GUILLOTINEIMAGEATLAS_HPP #include +#include +#include #include -#include -#include -#include +#include #include #include namespace Nz { - class NAZARA_UTILITY_API GuillotineImageAtlas : public AbstractAtlas + class NAZARA_CORE_API GuillotineImageAtlas : public AbstractAtlas { public: GuillotineImageAtlas(); @@ -76,4 +76,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_GUILLOTINEIMAGEATLAS_HPP +#endif // NAZARA_CORE_GUILLOTINEIMAGEATLAS_HPP diff --git a/include/Nazara/Core/HardwareInfo.inl b/include/Nazara/Core/HardwareInfo.inl index c87e4683a..20eef3e09 100644 --- a/include/Nazara/Core/HardwareInfo.inl +++ b/include/Nazara/Core/HardwareInfo.inl @@ -2,7 +2,6 @@ // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include namespace Nz diff --git a/include/Nazara/Utility/Image.hpp b/include/Nazara/Core/Image.hpp similarity index 94% rename from include/Nazara/Utility/Image.hpp rename to include/Nazara/Core/Image.hpp index d1588daf3..dc4438763 100644 --- a/include/Nazara/Utility/Image.hpp +++ b/include/Nazara/Core/Image.hpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_IMAGE_HPP -#define NAZARA_UTILITY_IMAGE_HPP +#ifndef NAZARA_CORE_IMAGE_HPP +#define NAZARA_CORE_IMAGE_HPP #include +#include #include +#include #include #include #include #include #include #include -#include -#include #include #include #include @@ -25,7 +25,7 @@ namespace Nz { - struct NAZARA_UTILITY_API ImageParams : ResourceParameters + struct NAZARA_CORE_API ImageParams : ResourceParameters { // Le format dans lequel l'image doit être chargée (Undefined pour le format le plus proche de l'original) PixelFormat loadFormat = PixelFormat::Undefined; @@ -44,7 +44,7 @@ namespace Nz using ImageManager = ResourceManager; using ImageSaver = ResourceSaver; - class NAZARA_UTILITY_API Image : public AbstractImage, public Resource + class NAZARA_CORE_API Image : public AbstractImage, public Resource { public: using Params = ImageParams; @@ -168,6 +168,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_IMAGE_HPP +#endif // NAZARA_CORE_IMAGE_HPP diff --git a/include/Nazara/Utility/Image.inl b/include/Nazara/Core/Image.inl similarity index 93% rename from include/Nazara/Utility/Image.inl rename to include/Nazara/Core/Image.inl index 950da2e6f..06c9ae81f 100644 --- a/include/Nazara/Utility/Image.inl +++ b/include/Nazara/Core/Image.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -86,4 +86,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/ImageStream.hpp b/include/Nazara/Core/ImageStream.hpp similarity index 80% rename from include/Nazara/Utility/ImageStream.hpp rename to include/Nazara/Core/ImageStream.hpp index c9b72ecf2..438224e16 100644 --- a/include/Nazara/Utility/ImageStream.hpp +++ b/include/Nazara/Core/ImageStream.hpp @@ -1,20 +1,20 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_IMAGESTREAM_HPP -#define NAZARA_UTILITY_IMAGESTREAM_HPP +#ifndef NAZARA_CORE_IMAGESTREAM_HPP +#define NAZARA_CORE_IMAGESTREAM_HPP #include +#include +#include #include #include #include #include #include -#include -#include #include namespace Nz @@ -28,7 +28,7 @@ namespace Nz using ImageStreamLoader = ResourceLoader; - class NAZARA_UTILITY_API ImageStream : public Resource + class NAZARA_CORE_API ImageStream : public Resource { public: using Params = ImageStreamParams; @@ -52,6 +52,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_IMAGESTREAM_HPP +#endif // NAZARA_CORE_IMAGESTREAM_HPP diff --git a/include/Nazara/Utility/ImageStream.inl b/include/Nazara/Core/ImageStream.inl similarity index 55% rename from include/Nazara/Utility/ImageStream.inl rename to include/Nazara/Core/ImageStream.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/ImageStream.inl +++ b/include/Nazara/Core/ImageStream.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/IndexBuffer.hpp b/include/Nazara/Core/IndexBuffer.hpp similarity index 85% rename from include/Nazara/Utility/IndexBuffer.hpp rename to include/Nazara/Core/IndexBuffer.hpp index 24dd5c2a1..9553566f5 100644 --- a/include/Nazara/Utility/IndexBuffer.hpp +++ b/include/Nazara/Core/IndexBuffer.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_INDEXBUFFER_HPP -#define NAZARA_UTILITY_INDEXBUFFER_HPP +#ifndef NAZARA_CORE_INDEXBUFFER_HPP +#define NAZARA_CORE_INDEXBUFFER_HPP #include -#include +#include namespace Nz { - class NAZARA_UTILITY_API IndexBuffer + class NAZARA_CORE_API IndexBuffer { public: IndexBuffer() = default; @@ -58,6 +58,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_INDEXBUFFER_HPP +#endif // NAZARA_CORE_INDEXBUFFER_HPP diff --git a/include/Nazara/Utility/IndexBuffer.inl b/include/Nazara/Core/IndexBuffer.inl similarity index 90% rename from include/Nazara/Utility/IndexBuffer.inl rename to include/Nazara/Core/IndexBuffer.inl index 4e58b2d72..8ee068fc7 100644 --- a/include/Nazara/Utility/IndexBuffer.inl +++ b/include/Nazara/Core/IndexBuffer.inl @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include -#include +#include namespace Nz { @@ -69,4 +69,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/IndexIterator.hpp b/include/Nazara/Core/IndexIterator.hpp similarity index 89% rename from include/Nazara/Utility/IndexIterator.hpp rename to include/Nazara/Core/IndexIterator.hpp index 3d9d07032..361d97349 100644 --- a/include/Nazara/Utility/IndexIterator.hpp +++ b/include/Nazara/Core/IndexIterator.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_INDEXITERATOR_HPP -#define NAZARA_UTILITY_INDEXITERATOR_HPP +#ifndef NAZARA_CORE_INDEXITERATOR_HPP +#define NAZARA_CORE_INDEXITERATOR_HPP #include @@ -77,6 +77,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_INDEXITERATOR_HPP +#endif // NAZARA_CORE_INDEXITERATOR_HPP diff --git a/include/Nazara/Utility/IndexIterator.inl b/include/Nazara/Core/IndexIterator.inl similarity index 95% rename from include/Nazara/Utility/IndexIterator.inl rename to include/Nazara/Core/IndexIterator.inl index f2a7c0904..5ab5337c1 100644 --- a/include/Nazara/Utility/IndexIterator.inl +++ b/include/Nazara/Core/IndexIterator.inl @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include +#include namespace Nz { @@ -172,4 +172,4 @@ namespace std }; } -#include +#include diff --git a/include/Nazara/Utility/IndexMapper.hpp b/include/Nazara/Core/IndexMapper.hpp similarity index 76% rename from include/Nazara/Utility/IndexMapper.hpp rename to include/Nazara/Core/IndexMapper.hpp index a24e7953f..1bfde6d54 100644 --- a/include/Nazara/Utility/IndexMapper.hpp +++ b/include/Nazara/Core/IndexMapper.hpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_INDEXMAPPER_HPP -#define NAZARA_UTILITY_INDEXMAPPER_HPP +#ifndef NAZARA_CORE_INDEXMAPPER_HPP +#define NAZARA_CORE_INDEXMAPPER_HPP #include -#include -#include +#include +#include namespace Nz { class IndexIterator; class SubMesh; - class NAZARA_UTILITY_API IndexMapper + class NAZARA_CORE_API IndexMapper { public: IndexMapper(IndexBuffer& indexBuffer, UInt32 indexCount = 0); @@ -49,4 +49,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_INDEXMAPPER_HPP +#endif // NAZARA_CORE_INDEXMAPPER_HPP diff --git a/include/Nazara/Utility/Joint.hpp b/include/Nazara/Core/Joint.hpp similarity index 80% rename from include/Nazara/Utility/Joint.hpp rename to include/Nazara/Core/Joint.hpp index 57a3c854d..d691d5e00 100644 --- a/include/Nazara/Utility/Joint.hpp +++ b/include/Nazara/Core/Joint.hpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_JOINT_HPP -#define NAZARA_UTILITY_JOINT_HPP +#ifndef NAZARA_CORE_JOINT_HPP +#define NAZARA_CORE_JOINT_HPP #include +#include #include -#include #include namespace Nz { class Skeleton; - class NAZARA_UTILITY_API Joint : public Node + class NAZARA_CORE_API Joint : public Node { public: inline Joint(Skeleton* skeleton); @@ -50,6 +50,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_JOINT_HPP +#endif // NAZARA_CORE_JOINT_HPP diff --git a/include/Nazara/Utility/Joint.inl b/include/Nazara/Core/Joint.inl similarity index 92% rename from include/Nazara/Utility/Joint.inl rename to include/Nazara/Core/Joint.inl index c72d2862e..01eb6ada9 100644 --- a/include/Nazara/Utility/Joint.inl +++ b/include/Nazara/Core/Joint.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { @@ -109,4 +109,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/MaterialData.hpp b/include/Nazara/Core/MaterialData.hpp similarity index 96% rename from include/Nazara/Utility/MaterialData.hpp rename to include/Nazara/Core/MaterialData.hpp index e851a4ccf..c1717221b 100644 --- a/include/Nazara/Utility/MaterialData.hpp +++ b/include/Nazara/Core/MaterialData.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_MATERIALDATA_HPP -#define NAZARA_UTILITY_MATERIALDATA_HPP +#ifndef NAZARA_CORE_MATERIALDATA_HPP +#define NAZARA_CORE_MATERIALDATA_HPP namespace Nz { @@ -81,4 +81,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_MATERIALDATA_HPP +#endif // NAZARA_CORE_MATERIALDATA_HPP diff --git a/include/Nazara/Utility/Mesh.hpp b/include/Nazara/Core/Mesh.hpp similarity index 91% rename from include/Nazara/Utility/Mesh.hpp rename to include/Nazara/Core/Mesh.hpp index 0ba045b0c..3f332ab86 100644 --- a/include/Nazara/Utility/Mesh.hpp +++ b/include/Nazara/Core/Mesh.hpp @@ -1,33 +1,33 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_MESH_HPP -#define NAZARA_UTILITY_MESH_HPP +#ifndef NAZARA_CORE_MESH_HPP +#define NAZARA_CORE_MESH_HPP #include +#include +#include #include #include #include #include #include #include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include #include #include namespace Nz { - struct NAZARA_UTILITY_API MeshParams : ResourceParameters + struct NAZARA_CORE_API MeshParams : ResourceParameters { // How buffer will be allocated (by default in RAM) BufferFactory bufferFactory = &SoftwareBufferFactory; @@ -90,7 +90,7 @@ namespace Nz struct MeshImpl; - class NAZARA_UTILITY_API Mesh : public Resource + class NAZARA_CORE_API Mesh : public Resource { public: using Params = MeshParams; @@ -187,6 +187,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_MESH_HPP +#endif // NAZARA_CORE_MESH_HPP diff --git a/include/Nazara/Utility/Mesh.inl b/include/Nazara/Core/Mesh.inl similarity index 85% rename from include/Nazara/Utility/Mesh.inl rename to include/Nazara/Core/Mesh.inl index 5c5d161f1..ca088fb18 100644 --- a/include/Nazara/Utility/Mesh.inl +++ b/include/Nazara/Core/Mesh.inl @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include +#include namespace Nz { @@ -43,4 +43,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/MeshData.hpp b/include/Nazara/Core/MeshData.hpp similarity index 62% rename from include/Nazara/Utility/MeshData.hpp rename to include/Nazara/Core/MeshData.hpp index d99011c88..62578b69a 100644 --- a/include/Nazara/Utility/MeshData.hpp +++ b/include/Nazara/Core/MeshData.hpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_MESHDATA_HPP -#define NAZARA_UTILITY_MESHDATA_HPP +#ifndef NAZARA_CORE_MESHDATA_HPP +#define NAZARA_CORE_MESHDATA_HPP -#include +#include namespace Nz { @@ -22,4 +22,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_MESHDATA_HPP +#endif // NAZARA_CORE_MESHDATA_HPP diff --git a/include/Nazara/Utility/Node.hpp b/include/Nazara/Core/Node.hpp similarity index 95% rename from include/Nazara/Utility/Node.hpp rename to include/Nazara/Core/Node.hpp index b53cc61e1..3c66e1794 100644 --- a/include/Nazara/Utility/Node.hpp +++ b/include/Nazara/Core/Node.hpp @@ -1,25 +1,25 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_NODE_HPP -#define NAZARA_UTILITY_NODE_HPP +#ifndef NAZARA_CORE_NODE_HPP +#define NAZARA_CORE_NODE_HPP #include +#include +#include #include #include #include #include -#include -#include #include #include namespace Nz { - class NAZARA_UTILITY_API Node + class NAZARA_CORE_API Node { public: enum class Invalidation; @@ -43,7 +43,6 @@ namespace Nz inline Quaternionf GetInitialRotation() const; inline Vector3f GetInitialScale() const; inline Vector3f GetLeft() const; - virtual NodeType GetNodeType() const; inline const Node* GetParent() const; inline Vector3f GetPosition(CoordSys coordSys = CoordSys::Local) const; inline Vector3f GetRight() const; @@ -142,6 +141,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_NODE_HPP +#endif // NAZARA_CORE_NODE_HPP diff --git a/include/Nazara/Utility/Node.inl b/include/Nazara/Core/Node.inl similarity index 98% rename from include/Nazara/Utility/Node.inl rename to include/Nazara/Core/Node.inl index 81f4f5bcc..5cf8c546f 100644 --- a/include/Nazara/Utility/Node.inl +++ b/include/Nazara/Core/Node.inl @@ -1,11 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include -#include +#include namespace Nz { @@ -485,4 +484,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/ObjectHandle.hpp b/include/Nazara/Core/ObjectHandle.hpp index 70e8d8f5b..97f5ae17d 100644 --- a/include/Nazara/Core/ObjectHandle.hpp +++ b/include/Nazara/Core/ObjectHandle.hpp @@ -7,8 +7,8 @@ #ifndef NAZARA_CORE_OBJECTHANDLE_HPP #define NAZARA_CORE_OBJECTHANDLE_HPP -#include #include +#include #include #include #include diff --git a/include/Nazara/Core/ObjectRef.hpp b/include/Nazara/Core/ObjectRef.hpp index c68682177..b04b10415 100644 --- a/include/Nazara/Core/ObjectRef.hpp +++ b/include/Nazara/Core/ObjectRef.hpp @@ -8,9 +8,8 @@ #define NAZARA_CORE_OBJECTREF_HPP #include -#include #include -#include +#include namespace Nz { diff --git a/include/Nazara/Utility/PixelFormat.hpp b/include/Nazara/Core/PixelFormat.hpp similarity index 91% rename from include/Nazara/Utility/PixelFormat.hpp rename to include/Nazara/Core/PixelFormat.hpp index 40ec29ede..c9298164d 100644 --- a/include/Nazara/Utility/PixelFormat.hpp +++ b/include/Nazara/Core/PixelFormat.hpp @@ -1,16 +1,16 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_PIXELFORMAT_HPP -#define NAZARA_UTILITY_PIXELFORMAT_HPP +#ifndef NAZARA_CORE_PIXELFORMAT_HPP +#define NAZARA_CORE_PIXELFORMAT_HPP #include +#include +#include #include -#include -#include #include #include #include @@ -53,9 +53,9 @@ namespace Nz UInt8 bitsPerPixel; }; - class NAZARA_UTILITY_API PixelFormatInfo + class NAZARA_CORE_API PixelFormatInfo { - friend class Utility; + friend class Core; public: using ConvertFunction = std::function; @@ -96,6 +96,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_PIXELFORMAT_HPP +#endif // NAZARA_CORE_PIXELFORMAT_HPP diff --git a/include/Nazara/Utility/PixelFormat.inl b/include/Nazara/Core/PixelFormat.inl similarity index 96% rename from include/Nazara/Utility/PixelFormat.inl rename to include/Nazara/Core/PixelFormat.inl index 0b5afb33e..6aa8c781f 100644 --- a/include/Nazara/Utility/PixelFormat.inl +++ b/include/Nazara/Core/PixelFormat.inl @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include -#include +#include namespace Nz { @@ -94,7 +94,7 @@ namespace Nz counter |= blueMask; counter |= alphaMask; - bitsPerPixel = static_cast(counter.Count()); + bitsPerPixel = SafeCast(counter.Count()); } inline bool PixelFormatDescription::Validate() const @@ -110,7 +110,7 @@ namespace Nz for (unsigned int i = 0; i < 4; ++i) { - UInt8 usedBits = static_cast(masks[i]->Count()); + UInt8 usedBits = SafeCast(masks[i]->Count()); if (usedBits == 0) continue; @@ -172,7 +172,7 @@ namespace Nz return true; } - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (IsCompressed(srcFormat)) { NazaraError("cannot convert single pixel from compressed format"); @@ -296,4 +296,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Plugins/AssimpPlugin.hpp b/include/Nazara/Core/Plugins/AssimpPlugin.hpp similarity index 77% rename from include/Nazara/Utility/Plugins/AssimpPlugin.hpp rename to include/Nazara/Core/Plugins/AssimpPlugin.hpp index 14c1dd8f3..9a8bf6185 100644 --- a/include/Nazara/Utility/Plugins/AssimpPlugin.hpp +++ b/include/Nazara/Core/Plugins/AssimpPlugin.hpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_PLUGINS_ASSIMPPLUGIN_HPP -#define NAZARA_UTILITY_PLUGINS_ASSIMPPLUGIN_HPP +#ifndef NAZARA_CORE_PLUGINS_ASSIMPPLUGIN_HPP +#define NAZARA_CORE_PLUGINS_ASSIMPPLUGIN_HPP #include +#include #include -#include namespace Nz { @@ -41,6 +41,6 @@ namespace Nz #endif } -#include +#include -#endif // NAZARA_UTILITY_PLUGINS_ASSIMPPLUGIN_HPP +#endif // NAZARA_CORE_PLUGINS_ASSIMPPLUGIN_HPP diff --git a/include/Nazara/Utility/Plugins/AssimpPlugin.inl b/include/Nazara/Core/Plugins/AssimpPlugin.inl similarity index 55% rename from include/Nazara/Utility/Plugins/AssimpPlugin.inl rename to include/Nazara/Core/Plugins/AssimpPlugin.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/Plugins/AssimpPlugin.inl +++ b/include/Nazara/Core/Plugins/AssimpPlugin.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Plugins/FFmpegPlugin.hpp b/include/Nazara/Core/Plugins/FFmpegPlugin.hpp similarity index 74% rename from include/Nazara/Utility/Plugins/FFmpegPlugin.hpp rename to include/Nazara/Core/Plugins/FFmpegPlugin.hpp index 763e68ed3..7674ae9cb 100644 --- a/include/Nazara/Utility/Plugins/FFmpegPlugin.hpp +++ b/include/Nazara/Core/Plugins/FFmpegPlugin.hpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_PLUGINS_FFMPEGPLUGIN_HPP -#define NAZARA_UTILITY_PLUGINS_FFMPEGPLUGIN_HPP +#ifndef NAZARA_CORE_PLUGINS_FFMPEGPLUGIN_HPP +#define NAZARA_CORE_PLUGINS_FFMPEGPLUGIN_HPP #include +#include #include -#include namespace Nz { @@ -33,6 +33,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_PLUGINS_FFMPEGPLUGIN_HPP +#endif // NAZARA_CORE_PLUGINS_FFMPEGPLUGIN_HPP diff --git a/include/Nazara/Utility/Plugins/FFmpegPlugin.inl b/include/Nazara/Core/Plugins/FFmpegPlugin.inl similarity index 55% rename from include/Nazara/Utility/Plugins/FFmpegPlugin.inl rename to include/Nazara/Core/Plugins/FFmpegPlugin.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/Plugins/FFmpegPlugin.inl +++ b/include/Nazara/Core/Plugins/FFmpegPlugin.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Sequence.hpp b/include/Nazara/Core/Sequence.hpp similarity index 75% rename from include/Nazara/Utility/Sequence.hpp rename to include/Nazara/Core/Sequence.hpp index 8c92b44d7..a505b0b15 100644 --- a/include/Nazara/Utility/Sequence.hpp +++ b/include/Nazara/Core/Sequence.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SEQUENCE_HPP -#define NAZARA_UTILITY_SEQUENCE_HPP +#ifndef NAZARA_CORE_SEQUENCE_HPP +#define NAZARA_CORE_SEQUENCE_HPP #include #include @@ -29,4 +29,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_SEQUENCE_HPP +#endif // NAZARA_CORE_SEQUENCE_HPP diff --git a/include/Nazara/Core/Serialization.hpp b/include/Nazara/Core/Serialization.hpp new file mode 100644 index 000000000..dc053a9b2 --- /dev/null +++ b/include/Nazara/Core/Serialization.hpp @@ -0,0 +1,55 @@ +// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) +// This file is part of the "Nazara Engine - Core module" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#pragma once + +#ifndef NAZARA_CORE_SERIALIZATION_HPP +#define NAZARA_CORE_SERIALIZATION_HPP + +#include +#include +#include +#include +#include +#include +#include + +namespace Nz +{ + struct NAZARA_CORE_API SerializationContext + { + MovablePtr stream; + Endianness endianness = Endianness::BigEndian; //< Default to Big Endian encoding + UInt8 readBitPos = 8; //< 8 means no bit is currently read + UInt8 readByte; //< Undefined value, will be initialized at the first bit read + UInt8 writeBitPos = 8; //< 8 means no bit is currently wrote + UInt8 writeByte; //< Undefined value, will be initialized at the first bit write + + void FlushBits(); + inline void ResetReadBitPosition(); + inline void ResetWriteBitPosition(); + }; + + template + bool Serialize(SerializationContext& context, T&& value); + + inline bool Serialize(SerializationContext& context, bool value, TypeTag); + inline bool Serialize(SerializationContext& context, const std::string& value, TypeTag); + + template + std::enable_if_t::value, bool> Serialize(SerializationContext& context, T value, TypeTag); + + template + bool Unserialize(SerializationContext& context, T* value); + + inline bool Unserialize(SerializationContext& context, bool* value, TypeTag); + inline bool Unserialize(SerializationContext& context, std::string* value, TypeTag); + + template + std::enable_if_t::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag); +} + +#include + +#endif // NAZARA_CORE_SERIALIZATION_HPP diff --git a/include/Nazara/Core/Serialization.inl b/include/Nazara/Core/Serialization.inl new file mode 100644 index 000000000..8df1a2ff5 --- /dev/null +++ b/include/Nazara/Core/Serialization.inl @@ -0,0 +1,184 @@ +// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) +// This file is part of the "Nazara Engine - Core module" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#include + +namespace Nz +{ + /*! + * \brief Reset the current read bit cursor + */ + inline void SerializationContext::ResetReadBitPosition() + { + readBitPos = 8; + } + + /*! + * \brief Reset the current read bit cursor + + * \remark This function only reset the cursor position, it doesn't do any writing + if you wish to write all bits and reset bit position, call FlushBits + + \see FlushBits + */ + inline void SerializationContext::ResetWriteBitPosition() + { + writeBitPos = 8; + } + + template + bool Serialize(SerializationContext& context, T&& value) + { + return Serialize(context, std::forward(value), TypeTag>()); + } + + /*! + * \ingroup core + * \brief Serializes a boolean + * \return true if serialization succeeded + * + * \param context Context for the serialization + * \param value Boolean to serialize + * + * \see Serialize, Unserialize + */ + inline bool Serialize(SerializationContext& context, bool value, TypeTag) + { + if (context.writeBitPos == 8) + { + context.writeBitPos = 0; + context.writeByte = 0; + } + + if (value) + context.writeByte |= 1 << context.writeBitPos; + + if (++context.writeBitPos >= 8) + return Serialize(context, context.writeByte, TypeTag()); + else + return true; + } + + /*! + * \ingroup core + * \brief Serializes a std::string + * \return true if successful + * + * \param context Context for the serialization + * \param value String to serialize + */ + bool Serialize(SerializationContext& context, const std::string& value, TypeTag) + { + if (!Serialize(context, SafeCast(value.size()), TypeTag())) + return false; + + return context.stream->Write(value.data(), value.size()) == value.size(); + } + + /*! + * \ingroup core + * \brief Serializes an arithmetic type + * \return true if serialization succeeded + * + * \param context Context for the serialization + * \param value Arithmetic type to serialize + * + * \see Serialize, Unserialize + */ + template + std::enable_if_t::value, bool> Serialize(SerializationContext& context, T value, TypeTag) + { + // Flush bits in case a writing is in progress + context.FlushBits(); + + if (context.endianness != Endianness::Unknown && context.endianness != PlatformEndianness) + value = ByteSwap(value); + + return context.stream->Write(&value, sizeof(T)) == sizeof(T); + } + + + template + bool Unserialize(SerializationContext& context, T* value) + { + return Unserialize(context, value, TypeTag()); + } + + /*! + * \ingroup core + * \brief Unserializes a boolean + * \return true if unserialization succedeed + * + * \param context Context for the unserialization + * \param value Pointer to boolean to unserialize + * + * \see Serialize, Unserialize + */ + inline bool Unserialize(SerializationContext& context, bool* value, TypeTag) + { + if (context.readBitPos == 8) + { + if (!Unserialize(context, &context.readByte, TypeTag())) + return false; + + context.readBitPos = 0; + } + + if (value) + *value = (context.readByte & (1 << context.readBitPos)) != 0; + + context.readBitPos++; + + return true; + } + + /*! + * \brief Unserializes a string + * \return true if successful + * + * \param context Context of unserialization + * \param string std::string to unserialize + */ + bool Unserialize(SerializationContext& context, std::string* string, TypeTag) + { + UInt32 size; + if (!Unserialize(context, &size, TypeTag())) + return false; + + string->resize(size); + return context.stream->Read(&(*string)[0], size) == size; + } + + /*! + * \ingroup core + * \brief Unserializes an arithmetic type + * \return true if unserialization succedeed + * + * \param context Context for the unserialization + * \param value Pointer to arithmetic type to serialize + * + * \remark Produce a NazaraAssert if pointer to value is invalid + * + * \see Serialize, Unserialize + */ + template + std::enable_if_t::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag) + { + NazaraAssert(value, "Invalid data pointer"); + + context.ResetReadBitPosition(); + + if (context.stream->Read(value, sizeof(T)) == sizeof(T)) + { + if (context.endianness != Endianness::Unknown && context.endianness != PlatformEndianness) + *value = ByteSwap(*value); + + return true; + } + else + return false; + } +} + +#include diff --git a/include/Nazara/Core/SerializationContext.hpp b/include/Nazara/Core/SerializationContext.hpp deleted file mode 100644 index a52f855ba..000000000 --- a/include/Nazara/Core/SerializationContext.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Core module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_CORE_SERIALIZATIONCONTEXT_HPP -#define NAZARA_CORE_SERIALIZATIONCONTEXT_HPP - -#include -#include -#include -#include -#include - -namespace Nz -{ - class Stream; - - struct NAZARA_CORE_API SerializationContext - { - MovablePtr stream; - Endianness endianness = Endianness::BigEndian; //< Default to Big Endian encoding - UInt8 readBitPos = 8; //< 8 means no bit is currently read - UInt8 readByte; //< Undefined value, will be initialized at the first bit read - UInt8 writeBitPos = 8; //< 8 means no bit is currently wrote - UInt8 writeByte; //< Undefined value, will be initialized at the first bit write - - void FlushBits(); - inline void ResetReadBitPosition(); - inline void ResetWriteBitPosition(); - }; -} - -#include - -#endif // NAZARA_CORE_SERIALIZATIONCONTEXT_HPP diff --git a/include/Nazara/Core/SerializationContext.inl b/include/Nazara/Core/SerializationContext.inl deleted file mode 100644 index b07facbdb..000000000 --- a/include/Nazara/Core/SerializationContext.inl +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Core module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include - -namespace Nz -{ - /*! - * \brief Reset the current read bit cursor - */ - inline void SerializationContext::ResetReadBitPosition() - { - readBitPos = 8; - } - - /*! - * \brief Reset the current read bit cursor - - * \remark This function only reset the cursor position, it doesn't do any writing - if you wish to write all bits and reset bit position, call FlushBits - - \see FlushBits - */ - inline void SerializationContext::ResetWriteBitPosition() - { - writeBitPos = 8; - } -} - -#include diff --git a/include/Nazara/Utility/SkeletalMesh.hpp b/include/Nazara/Core/SkeletalMesh.hpp similarity index 69% rename from include/Nazara/Utility/SkeletalMesh.hpp rename to include/Nazara/Core/SkeletalMesh.hpp index 33503c619..fa370b67d 100644 --- a/include/Nazara/Utility/SkeletalMesh.hpp +++ b/include/Nazara/Core/SkeletalMesh.hpp @@ -1,20 +1,20 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SKELETALMESH_HPP -#define NAZARA_UTILITY_SKELETALMESH_HPP +#ifndef NAZARA_CORE_SKELETALMESH_HPP +#define NAZARA_CORE_SKELETALMESH_HPP #include -#include -#include -#include +#include +#include +#include namespace Nz { - class NAZARA_UTILITY_API SkeletalMesh final : public SubMesh + class NAZARA_CORE_API SkeletalMesh final : public SubMesh { public: SkeletalMesh(std::shared_ptr vertexBuffer, std::shared_ptr indexBuffer); @@ -39,6 +39,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_SKELETALMESH_HPP +#endif // NAZARA_CORE_SKELETALMESH_HPP diff --git a/include/Nazara/Utility/SkeletalMesh.inl b/include/Nazara/Core/SkeletalMesh.inl similarity index 58% rename from include/Nazara/Utility/SkeletalMesh.inl rename to include/Nazara/Core/SkeletalMesh.inl index 019424c5c..d8ff1e990 100644 --- a/include/Nazara/Utility/SkeletalMesh.inl +++ b/include/Nazara/Core/SkeletalMesh.inl @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Skeleton.hpp b/include/Nazara/Core/Skeleton.hpp similarity index 86% rename from include/Nazara/Utility/Skeleton.hpp rename to include/Nazara/Core/Skeleton.hpp index cffdbbddd..64ac93e27 100644 --- a/include/Nazara/Utility/Skeleton.hpp +++ b/include/Nazara/Core/Skeleton.hpp @@ -1,16 +1,16 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SKELETON_HPP -#define NAZARA_UTILITY_SKELETON_HPP +#ifndef NAZARA_CORE_SKELETON_HPP +#define NAZARA_CORE_SKELETON_HPP #include +#include #include #include -#include #include #include @@ -23,7 +23,7 @@ namespace Nz struct SkeletonImpl; - class NAZARA_UTILITY_API Skeleton + class NAZARA_CORE_API Skeleton { friend Joint; @@ -70,6 +70,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_SKELETON_HPP +#endif // NAZARA_CORE_SKELETON_HPP diff --git a/include/Nazara/Utility/Skeleton.inl b/include/Nazara/Core/Skeleton.inl similarity index 58% rename from include/Nazara/Utility/Skeleton.inl rename to include/Nazara/Core/Skeleton.inl index 019424c5c..d8ff1e990 100644 --- a/include/Nazara/Utility/Skeleton.inl +++ b/include/Nazara/Core/Skeleton.inl @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/SoftwareBuffer.hpp b/include/Nazara/Core/SoftwareBuffer.hpp similarity index 59% rename from include/Nazara/Utility/SoftwareBuffer.hpp rename to include/Nazara/Core/SoftwareBuffer.hpp index 40f9d2c44..b23f1f8f4 100644 --- a/include/Nazara/Utility/SoftwareBuffer.hpp +++ b/include/Nazara/Core/SoftwareBuffer.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SOFTWAREBUFFER_HPP -#define NAZARA_UTILITY_SOFTWAREBUFFER_HPP +#ifndef NAZARA_CORE_SOFTWAREBUFFER_HPP +#define NAZARA_CORE_SOFTWAREBUFFER_HPP #include -#include +#include #include namespace Nz { - class NAZARA_UTILITY_API SoftwareBuffer : public Buffer + class NAZARA_CORE_API SoftwareBuffer : public Buffer { public: SoftwareBuffer(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData); @@ -31,7 +31,7 @@ namespace Nz bool m_mapped; }; - NAZARA_UTILITY_API std::shared_ptr SoftwareBufferFactory(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData = nullptr); + NAZARA_CORE_API std::shared_ptr SoftwareBufferFactory(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData = nullptr); } -#endif // NAZARA_UTILITY_SOFTWAREBUFFER_HPP +#endif // NAZARA_CORE_SOFTWAREBUFFER_HPP diff --git a/include/Nazara/Utility/StaticMesh.hpp b/include/Nazara/Core/StaticMesh.hpp similarity index 75% rename from include/Nazara/Utility/StaticMesh.hpp rename to include/Nazara/Core/StaticMesh.hpp index ced10a482..ead6ac8f3 100644 --- a/include/Nazara/Utility/StaticMesh.hpp +++ b/include/Nazara/Core/StaticMesh.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_STATICMESH_HPP -#define NAZARA_UTILITY_STATICMESH_HPP +#ifndef NAZARA_CORE_STATICMESH_HPP +#define NAZARA_CORE_STATICMESH_HPP #include -#include +#include namespace Nz { - class NAZARA_UTILITY_API StaticMesh final : public SubMesh + class NAZARA_CORE_API StaticMesh final : public SubMesh { public: StaticMesh(std::shared_ptr vertexBuffer, std::shared_ptr indexBuffer); @@ -41,6 +41,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_STATICMESH_HPP +#endif // NAZARA_CORE_STATICMESH_HPP diff --git a/include/Nazara/Utility/StaticMesh.inl b/include/Nazara/Core/StaticMesh.inl similarity index 58% rename from include/Nazara/Utility/StaticMesh.inl rename to include/Nazara/Core/StaticMesh.inl index 019424c5c..d8ff1e990 100644 --- a/include/Nazara/Utility/StaticMesh.inl +++ b/include/Nazara/Core/StaticMesh.inl @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/SubMesh.hpp b/include/Nazara/Core/SubMesh.hpp similarity index 80% rename from include/Nazara/Utility/SubMesh.hpp rename to include/Nazara/Core/SubMesh.hpp index 977de08c5..5e5105ae9 100644 --- a/include/Nazara/Utility/SubMesh.hpp +++ b/include/Nazara/Core/SubMesh.hpp @@ -1,25 +1,25 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SUBMESH_HPP -#define NAZARA_UTILITY_SUBMESH_HPP +#ifndef NAZARA_CORE_SUBMESH_HPP +#define NAZARA_CORE_SUBMESH_HPP #include +#include #include +#include +#include #include -#include -#include -#include #include namespace Nz { class Mesh; - class NAZARA_UTILITY_API SubMesh + class NAZARA_CORE_API SubMesh { friend Mesh; @@ -58,4 +58,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_SUBMESH_HPP +#endif // NAZARA_CORE_SUBMESH_HPP diff --git a/include/Nazara/Core/Systems.hpp b/include/Nazara/Core/Systems.hpp index f1d4713ea..273fdc528 100644 --- a/include/Nazara/Core/Systems.hpp +++ b/include/Nazara/Core/Systems.hpp @@ -30,5 +30,7 @@ #define NAZARA_CORE_SYSTEMS_HPP #include +#include +#include #endif // NAZARA_CORE_SYSTEMS_HPP diff --git a/include/Nazara/Utility/Systems/SkeletonSystem.hpp b/include/Nazara/Core/Systems/SkeletonSystem.hpp similarity index 71% rename from include/Nazara/Utility/Systems/SkeletonSystem.hpp rename to include/Nazara/Core/Systems/SkeletonSystem.hpp index 3b7b4650d..f4da22f0b 100644 --- a/include/Nazara/Utility/Systems/SkeletonSystem.hpp +++ b/include/Nazara/Core/Systems/SkeletonSystem.hpp @@ -1,20 +1,20 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SYSTEMS_SKELETONSYSTEM_HPP -#define NAZARA_UTILITY_SYSTEMS_SKELETONSYSTEM_HPP +#ifndef NAZARA_CORE_SYSTEMS_SKELETONSYSTEM_HPP +#define NAZARA_CORE_SYSTEMS_SKELETONSYSTEM_HPP #include +#include #include -#include #include namespace Nz { - class NAZARA_UTILITY_API SkeletonSystem + class NAZARA_CORE_API SkeletonSystem { public: static constexpr bool AllowConcurrent = false; @@ -37,6 +37,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_SYSTEMS_SKELETONSYSTEM_HPP +#endif // NAZARA_CORE_SYSTEMS_SKELETONSYSTEM_HPP diff --git a/include/Nazara/Utility/Systems/SkeletonSystem.inl b/include/Nazara/Core/Systems/SkeletonSystem.inl similarity index 55% rename from include/Nazara/Utility/Systems/SkeletonSystem.inl rename to include/Nazara/Core/Systems/SkeletonSystem.inl index 7c1ebadad..a8eacde68 100644 --- a/include/Nazara/Utility/Systems/SkeletonSystem.inl +++ b/include/Nazara/Core/Systems/SkeletonSystem.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/Systems/VelocitySystem.hpp b/include/Nazara/Core/Systems/VelocitySystem.hpp similarity index 69% rename from include/Nazara/Utility/Systems/VelocitySystem.hpp rename to include/Nazara/Core/Systems/VelocitySystem.hpp index 9850aedaa..773f18079 100644 --- a/include/Nazara/Utility/Systems/VelocitySystem.hpp +++ b/include/Nazara/Core/Systems/VelocitySystem.hpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP -#define NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP +#ifndef NAZARA_CORE_SYSTEMS_VELOCITYSYSTEM_HPP +#define NAZARA_CORE_SYSTEMS_VELOCITYSYSTEM_HPP #include +#include #include -#include #include #include namespace Nz { - class NAZARA_UTILITY_API VelocitySystem + class NAZARA_CORE_API VelocitySystem { public: using Components = TypeList; @@ -35,6 +35,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_SYSTEMS_VELOCITYSYSTEM_HPP +#endif // NAZARA_CORE_SYSTEMS_VELOCITYSYSTEM_HPP diff --git a/include/Nazara/Utility/Systems/VelocitySystem.inl b/include/Nazara/Core/Systems/VelocitySystem.inl similarity index 66% rename from include/Nazara/Utility/Systems/VelocitySystem.inl rename to include/Nazara/Core/Systems/VelocitySystem.inl index 08a030439..af6b8a6a9 100644 --- a/include/Nazara/Utility/Systems/VelocitySystem.inl +++ b/include/Nazara/Core/Systems/VelocitySystem.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -12,4 +12,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/Time.hpp b/include/Nazara/Core/Time.hpp index 26138ea1c..f95cfc36c 100644 --- a/include/Nazara/Core/Time.hpp +++ b/include/Nazara/Core/Time.hpp @@ -8,16 +8,14 @@ #define NAZARA_CORE_TIME_HPP #include -#include #include +#include #include #include #include namespace Nz { - struct SerializationContext; - class Time { public: diff --git a/include/Nazara/Utility/TriangleIterator.hpp b/include/Nazara/Core/TriangleIterator.hpp similarity index 67% rename from include/Nazara/Utility/TriangleIterator.hpp rename to include/Nazara/Core/TriangleIterator.hpp index 2cc00177f..8e2bf4a0d 100644 --- a/include/Nazara/Utility/TriangleIterator.hpp +++ b/include/Nazara/Core/TriangleIterator.hpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_TRIANGLEITERATOR_HPP -#define NAZARA_UTILITY_TRIANGLEITERATOR_HPP +#ifndef NAZARA_CORE_TRIANGLEITERATOR_HPP +#define NAZARA_CORE_TRIANGLEITERATOR_HPP #include -#include -#include +#include +#include namespace Nz { class SubMesh; - class NAZARA_UTILITY_API TriangleIterator + class NAZARA_CORE_API TriangleIterator { public: TriangleIterator(PrimitiveMode primitiveMode, IndexBuffer& indexBuffer); @@ -37,4 +37,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_TRIANGLEITERATOR_HPP +#endif // NAZARA_CORE_TRIANGLEITERATOR_HPP diff --git a/include/Nazara/Utility/UniformBuffer.hpp b/include/Nazara/Core/UniformBuffer.hpp similarity index 79% rename from include/Nazara/Utility/UniformBuffer.hpp rename to include/Nazara/Core/UniformBuffer.hpp index b1ab6144f..87a58f4b7 100644 --- a/include/Nazara/Utility/UniformBuffer.hpp +++ b/include/Nazara/Core/UniformBuffer.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_UNIFORMBUFFER_HPP -#define NAZARA_UTILITY_UNIFORMBUFFER_HPP +#ifndef NAZARA_CORE_UNIFORMBUFFER_HPP +#define NAZARA_CORE_UNIFORMBUFFER_HPP #include -#include +#include namespace Nz { - class NAZARA_UTILITY_API UniformBuffer + class NAZARA_CORE_API UniformBuffer { public: UniformBuffer(std::shared_ptr buffer); @@ -43,6 +43,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_UNIFORMBUFFER_HPP +#endif // NAZARA_CORE_UNIFORMBUFFER_HPP diff --git a/include/Nazara/Utility/UniformBuffer.inl b/include/Nazara/Core/UniformBuffer.inl similarity index 76% rename from include/Nazara/Utility/UniformBuffer.inl rename to include/Nazara/Core/UniformBuffer.inl index c4a5a5772..e130fca87 100644 --- a/include/Nazara/Utility/UniformBuffer.inl +++ b/include/Nazara/Core/UniformBuffer.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -23,4 +23,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Core/Uuid.hpp b/include/Nazara/Core/Uuid.hpp index 9e5a872c0..fa55392e6 100644 --- a/include/Nazara/Core/Uuid.hpp +++ b/include/Nazara/Core/Uuid.hpp @@ -8,8 +8,8 @@ #define NAZARA_CORE_UUID_HPP #include -#include #include +#include #include #include #include diff --git a/include/Nazara/Utility/VertexBuffer.hpp b/include/Nazara/Core/VertexBuffer.hpp similarity index 84% rename from include/Nazara/Utility/VertexBuffer.hpp rename to include/Nazara/Core/VertexBuffer.hpp index 7bc5fd462..9e49533bd 100644 --- a/include/Nazara/Utility/VertexBuffer.hpp +++ b/include/Nazara/Core/VertexBuffer.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_VERTEXBUFFER_HPP -#define NAZARA_UTILITY_VERTEXBUFFER_HPP +#ifndef NAZARA_CORE_VERTEXBUFFER_HPP +#define NAZARA_CORE_VERTEXBUFFER_HPP #include -#include -#include +#include +#include namespace Nz { - class NAZARA_UTILITY_API VertexBuffer + class NAZARA_CORE_API VertexBuffer { public: VertexBuffer() = default; @@ -57,6 +57,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_VERTEXBUFFER_HPP +#endif // NAZARA_CORE_VERTEXBUFFER_HPP diff --git a/include/Nazara/Utility/VertexBuffer.inl b/include/Nazara/Core/VertexBuffer.inl similarity index 86% rename from include/Nazara/Utility/VertexBuffer.inl rename to include/Nazara/Core/VertexBuffer.inl index b38b0d4d6..eb4e07ed2 100644 --- a/include/Nazara/Utility/VertexBuffer.inl +++ b/include/Nazara/Core/VertexBuffer.inl @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { @@ -43,4 +43,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/VertexDeclaration.hpp b/include/Nazara/Core/VertexDeclaration.hpp similarity index 85% rename from include/Nazara/Utility/VertexDeclaration.hpp rename to include/Nazara/Core/VertexDeclaration.hpp index e06f35938..2666d886c 100644 --- a/include/Nazara/Utility/VertexDeclaration.hpp +++ b/include/Nazara/Core/VertexDeclaration.hpp @@ -1,16 +1,16 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_VERTEXDECLARATION_HPP -#define NAZARA_UTILITY_VERTEXDECLARATION_HPP +#ifndef NAZARA_CORE_VERTEXDECLARATION_HPP +#define NAZARA_CORE_VERTEXDECLARATION_HPP #include +#include +#include #include -#include -#include #include #include #include @@ -22,10 +22,10 @@ namespace Nz using VertexDeclarationLibrary = ObjectLibrary; - class NAZARA_UTILITY_API VertexDeclaration + class NAZARA_CORE_API VertexDeclaration { friend VertexDeclarationLibrary; - friend class Utility; + friend class Core; public: struct Component; @@ -82,6 +82,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_VERTEXDECLARATION_HPP +#endif // NAZARA_CORE_VERTEXDECLARATION_HPP diff --git a/include/Nazara/Utility/VertexDeclaration.inl b/include/Nazara/Core/VertexDeclaration.inl similarity index 92% rename from include/Nazara/Utility/VertexDeclaration.inl rename to include/Nazara/Core/VertexDeclaration.inl index 50cff0304..9e1044506 100644 --- a/include/Nazara/Utility/VertexDeclaration.inl +++ b/include/Nazara/Core/VertexDeclaration.inl @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include -#include +#include namespace Nz { @@ -78,4 +78,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/VertexMapper.hpp b/include/Nazara/Core/VertexMapper.hpp similarity index 66% rename from include/Nazara/Utility/VertexMapper.hpp rename to include/Nazara/Core/VertexMapper.hpp index 94cf57a11..0b6aef508 100644 --- a/include/Nazara/Utility/VertexMapper.hpp +++ b/include/Nazara/Core/VertexMapper.hpp @@ -1,23 +1,23 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_VERTEXMAPPER_HPP -#define NAZARA_UTILITY_VERTEXMAPPER_HPP +#ifndef NAZARA_CORE_VERTEXMAPPER_HPP +#define NAZARA_CORE_VERTEXMAPPER_HPP #include -#include -#include -#include +#include +#include +#include #include namespace Nz { class SubMesh; - class NAZARA_UTILITY_API VertexMapper + class NAZARA_CORE_API VertexMapper { public: VertexMapper(SubMesh& subMesh); @@ -37,6 +37,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_VERTEXMAPPER_HPP +#endif // NAZARA_CORE_VERTEXMAPPER_HPP diff --git a/include/Nazara/Utility/VertexMapper.inl b/include/Nazara/Core/VertexMapper.inl similarity index 83% rename from include/Nazara/Utility/VertexMapper.inl rename to include/Nazara/Core/VertexMapper.inl index 143b7c5ca..687da0731 100644 --- a/include/Nazara/Utility/VertexMapper.inl +++ b/include/Nazara/Core/VertexMapper.inl @@ -1,10 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include namespace Nz { @@ -37,4 +36,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/VertexStruct.hpp b/include/Nazara/Core/VertexStruct.hpp similarity index 90% rename from include/Nazara/Utility/VertexStruct.hpp rename to include/Nazara/Core/VertexStruct.hpp index 15c458434..dba6dd132 100644 --- a/include/Nazara/Utility/VertexStruct.hpp +++ b/include/Nazara/Core/VertexStruct.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_VERTEXSTRUCT_HPP -#define NAZARA_UTILITY_VERTEXSTRUCT_HPP +#ifndef NAZARA_CORE_VERTEXSTRUCT_HPP +#define NAZARA_CORE_VERTEXSTRUCT_HPP #include #include @@ -93,4 +93,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_VERTEXSTRUCT_HPP +#endif // NAZARA_CORE_VERTEXSTRUCT_HPP diff --git a/include/Nazara/Graphics/Billboard.hpp b/include/Nazara/Graphics/Billboard.hpp index 0d6979093..f9279a9a0 100644 --- a/include/Nazara/Graphics/Billboard.hpp +++ b/include/Nazara/Graphics/Billboard.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_BILLBOARD_HPP #include +#include +#include #include #include #include -#include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/ElementRenderer.hpp b/include/Nazara/Graphics/ElementRenderer.hpp index c8c08bd03..464c17395 100644 --- a/include/Nazara/Graphics/ElementRenderer.hpp +++ b/include/Nazara/Graphics/ElementRenderer.hpp @@ -8,7 +8,6 @@ #define NAZARA_GRAPHICS_ELEMENTRENDERER_HPP #include -#include #include #include #include diff --git a/include/Nazara/Graphics/Enums.hpp b/include/Nazara/Graphics/Enums.hpp index 2e82b39cc..27687d659 100644 --- a/include/Nazara/Graphics/Enums.hpp +++ b/include/Nazara/Graphics/Enums.hpp @@ -7,7 +7,7 @@ #ifndef NAZARA_GRAPHICS_ENUMS_HPP #define NAZARA_GRAPHICS_ENUMS_HPP -#include +#include #include namespace Nz diff --git a/include/Nazara/Graphics/FrameGraphStructs.hpp b/include/Nazara/Graphics/FrameGraphStructs.hpp index f42a941a5..9feb70371 100644 --- a/include/Nazara/Graphics/FrameGraphStructs.hpp +++ b/include/Nazara/Graphics/FrameGraphStructs.hpp @@ -8,9 +8,9 @@ #define NAZARA_GRAPHICS_FRAMEGRAPHSTRUCTS_HPP #include +#include #include #include -#include #include #include diff --git a/include/Nazara/Graphics/FramePassAttachment.hpp b/include/Nazara/Graphics/FramePassAttachment.hpp index dcae93ba6..d038311ac 100644 --- a/include/Nazara/Graphics/FramePassAttachment.hpp +++ b/include/Nazara/Graphics/FramePassAttachment.hpp @@ -8,9 +8,9 @@ #define NAZARA_GRAPHICS_FRAMEPASSATTACHMENT_HPP #include +#include #include #include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/GraphicalMesh.hpp b/include/Nazara/Graphics/GraphicalMesh.hpp index d27a3a8a2..d24e5caec 100644 --- a/include/Nazara/Graphics/GraphicalMesh.hpp +++ b/include/Nazara/Graphics/GraphicalMesh.hpp @@ -8,10 +8,10 @@ #define NAZARA_GRAPHICS_GRAPHICALMESH_HPP #include +#include +#include #include #include -#include -#include #include #include diff --git a/include/Nazara/Graphics/GuillotineTextureAtlas.hpp b/include/Nazara/Graphics/GuillotineTextureAtlas.hpp index 916e5b084..08dc0c7ea 100644 --- a/include/Nazara/Graphics/GuillotineTextureAtlas.hpp +++ b/include/Nazara/Graphics/GuillotineTextureAtlas.hpp @@ -8,8 +8,8 @@ #define NAZARA_GRAPHICS_GUILLOTINETEXTUREATLAS_HPP #include +#include #include -#include namespace Nz { diff --git a/include/Nazara/Graphics/Light.hpp b/include/Nazara/Graphics/Light.hpp index b4df2bac7..1aacee0f1 100644 --- a/include/Nazara/Graphics/Light.hpp +++ b/include/Nazara/Graphics/Light.hpp @@ -8,13 +8,13 @@ #define NAZARA_GRAPHICS_LIGHT_HPP #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/include/Nazara/Graphics/LinearSlicedSprite.hpp b/include/Nazara/Graphics/LinearSlicedSprite.hpp index 2fc91f2b2..3d691d68a 100644 --- a/include/Nazara/Graphics/LinearSlicedSprite.hpp +++ b/include/Nazara/Graphics/LinearSlicedSprite.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_LINEARSLICEDSPRITE_HPP #include +#include +#include #include #include #include -#include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/MaterialPass.hpp b/include/Nazara/Graphics/MaterialPass.hpp index 7d269dbf9..7fbd4e020 100644 --- a/include/Nazara/Graphics/MaterialPass.hpp +++ b/include/Nazara/Graphics/MaterialPass.hpp @@ -10,13 +10,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/include/Nazara/Graphics/Model.hpp b/include/Nazara/Graphics/Model.hpp index 360620410..3fa7fc9c6 100644 --- a/include/Nazara/Graphics/Model.hpp +++ b/include/Nazara/Graphics/Model.hpp @@ -8,18 +8,18 @@ #define NAZARA_GRAPHICS_MODEL_HPP #include +#include #include #include #include #include #include #include +#include #include #include #include #include -#include -#include #include #include #include diff --git a/include/Nazara/Graphics/RenderElement.inl b/include/Nazara/Graphics/RenderElement.inl index 249ae8593..6c04daa4c 100644 --- a/include/Nazara/Graphics/RenderElement.inl +++ b/include/Nazara/Graphics/RenderElement.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include namespace Nz diff --git a/include/Nazara/Graphics/RenderSubmesh.hpp b/include/Nazara/Graphics/RenderSubmesh.hpp index 860111007..80175fceb 100644 --- a/include/Nazara/Graphics/RenderSubmesh.hpp +++ b/include/Nazara/Graphics/RenderSubmesh.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_RENDERSUBMESH_HPP #include +#include #include #include #include #include -#include #include #include diff --git a/include/Nazara/Graphics/RenderTextureBlit.hpp b/include/Nazara/Graphics/RenderTextureBlit.hpp index 930d1728f..e1a33cf85 100644 --- a/include/Nazara/Graphics/RenderTextureBlit.hpp +++ b/include/Nazara/Graphics/RenderTextureBlit.hpp @@ -8,10 +8,10 @@ #define NAZARA_GRAPHICS_RENDERTEXTUREBLIT_HPP #include +#include #include #include #include -#include namespace Nz { diff --git a/include/Nazara/Graphics/SkeletonInstance.hpp b/include/Nazara/Graphics/SkeletonInstance.hpp index fd52ab2ab..0e11d5417 100644 --- a/include/Nazara/Graphics/SkeletonInstance.hpp +++ b/include/Nazara/Graphics/SkeletonInstance.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_SKELETONINSTANCE_HPP #include +#include #include #include #include #include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/SlicedSprite.hpp b/include/Nazara/Graphics/SlicedSprite.hpp index 33e5bb05c..94b185f9f 100644 --- a/include/Nazara/Graphics/SlicedSprite.hpp +++ b/include/Nazara/Graphics/SlicedSprite.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_SLICEDSPRITE_HPP #include +#include +#include #include #include #include -#include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/Sprite.hpp b/include/Nazara/Graphics/Sprite.hpp index dd1ff092f..72cead090 100644 --- a/include/Nazara/Graphics/Sprite.hpp +++ b/include/Nazara/Graphics/Sprite.hpp @@ -8,11 +8,11 @@ #define NAZARA_GRAPHICS_SPRITE_HPP #include +#include +#include #include #include #include -#include -#include #include namespace Nz diff --git a/include/Nazara/Graphics/Systems/RenderSystem.hpp b/include/Nazara/Graphics/Systems/RenderSystem.hpp index a38759c11..e11042d78 100644 --- a/include/Nazara/Graphics/Systems/RenderSystem.hpp +++ b/include/Nazara/Graphics/Systems/RenderSystem.hpp @@ -8,14 +8,14 @@ #define NAZARA_GRAPHICS_SYSTEMS_RENDERSYSTEM_HPP #include +#include +#include #include #include #include #include #include #include -#include -#include #include #include #include diff --git a/include/Nazara/Graphics/TextSprite.hpp b/include/Nazara/Graphics/TextSprite.hpp index 22e722ee2..b84770ffb 100644 --- a/include/Nazara/Graphics/TextSprite.hpp +++ b/include/Nazara/Graphics/TextSprite.hpp @@ -8,12 +8,12 @@ #define NAZARA_GRAPHICS_TEXTSPRITE_HPP #include +#include +#include +#include #include #include #include -#include -#include -#include #include #include diff --git a/include/Nazara/Graphics/Tilemap.hpp b/include/Nazara/Graphics/Tilemap.hpp index d530abf46..6509c5b46 100644 --- a/include/Nazara/Graphics/Tilemap.hpp +++ b/include/Nazara/Graphics/Tilemap.hpp @@ -9,9 +9,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/include/Nazara/Graphics/UberShader.hpp b/include/Nazara/Graphics/UberShader.hpp index 929485ef0..d2fd05e74 100644 --- a/include/Nazara/Graphics/UberShader.hpp +++ b/include/Nazara/Graphics/UberShader.hpp @@ -8,7 +8,6 @@ #define NAZARA_GRAPHICS_UBERSHADER_HPP #include -#include #include #include #include diff --git a/include/Nazara/Math/Angle.inl b/include/Nazara/Math/Angle.inl index 0640b12bc..fd57139f9 100644 --- a/include/Nazara/Math/Angle.inl +++ b/include/Nazara/Math/Angle.inl @@ -3,6 +3,8 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include #include diff --git a/include/Nazara/Math/BoundingVolume.hpp b/include/Nazara/Math/BoundingVolume.hpp index 5a5388679..ca49052d2 100644 --- a/include/Nazara/Math/BoundingVolume.hpp +++ b/include/Nazara/Math/BoundingVolume.hpp @@ -7,6 +7,7 @@ #ifndef NAZARA_MATH_BOUNDINGVOLUME_HPP #define NAZARA_MATH_BOUNDINGVOLUME_HPP +#include #include #include #include @@ -16,8 +17,6 @@ namespace Nz { - struct SerializationContext; - template class BoundingVolume { diff --git a/include/Nazara/Math/BoundingVolume.inl b/include/Nazara/Math/BoundingVolume.inl index 737af733e..6bdda6380 100644 --- a/include/Nazara/Math/BoundingVolume.inl +++ b/include/Nazara/Math/BoundingVolume.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Box.inl b/include/Nazara/Math/Box.inl index 98fa1f0d1..8b10a5804 100644 --- a/include/Nazara/Math/Box.inl +++ b/include/Nazara/Math/Box.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Enums.hpp b/include/Nazara/Math/Enums.hpp index 3e0e4cffc..094800b20 100644 --- a/include/Nazara/Math/Enums.hpp +++ b/include/Nazara/Math/Enums.hpp @@ -7,7 +7,7 @@ #ifndef NAZARA_MATH_ENUMS_HPP #define NAZARA_MATH_ENUMS_HPP -#include +#include namespace Nz { diff --git a/include/Nazara/Math/EulerAngles.inl b/include/Nazara/Math/EulerAngles.inl index c6c67f2cf..6d01d2e01 100644 --- a/include/Nazara/Math/EulerAngles.inl +++ b/include/Nazara/Math/EulerAngles.inl @@ -2,10 +2,10 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include #include #include +#include #include #include #include diff --git a/include/Nazara/Math/Frustum.inl b/include/Nazara/Math/Frustum.inl index 0a145a0a9..e331629f6 100644 --- a/include/Nazara/Math/Frustum.inl +++ b/include/Nazara/Math/Frustum.inl @@ -6,8 +6,8 @@ // http://www.crownandcutlass.com/features/technicaldetails/frustum.html // http://www.lighthouse3d.com/tutorials/view-frustum-culling/ -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Matrix4.inl b/include/Nazara/Math/Matrix4.inl index f5beadcf2..0bb1a6522 100644 --- a/include/Nazara/Math/Matrix4.inl +++ b/include/Nazara/Math/Matrix4.inl @@ -2,7 +2,6 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Nazara/Math/OrientedBox.inl b/include/Nazara/Math/OrientedBox.inl index 1bc496b6b..bf60a219e 100644 --- a/include/Nazara/Math/OrientedBox.inl +++ b/include/Nazara/Math/OrientedBox.inl @@ -2,7 +2,7 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include #include diff --git a/include/Nazara/Math/Plane.inl b/include/Nazara/Math/Plane.inl index f713b6475..003d09bf2 100644 --- a/include/Nazara/Math/Plane.inl +++ b/include/Nazara/Math/Plane.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Quaternion.inl b/include/Nazara/Math/Quaternion.inl index f2b07b4a5..6e4ebd81c 100644 --- a/include/Nazara/Math/Quaternion.inl +++ b/include/Nazara/Math/Quaternion.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Ray.inl b/include/Nazara/Math/Ray.inl index 1147f53b2..bc856db30 100644 --- a/include/Nazara/Math/Ray.inl +++ b/include/Nazara/Math/Ray.inl @@ -2,7 +2,7 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include #include diff --git a/include/Nazara/Math/Rect.inl b/include/Nazara/Math/Rect.inl index 9435284b8..46001f50d 100644 --- a/include/Nazara/Math/Rect.inl +++ b/include/Nazara/Math/Rect.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Math/Sphere.inl b/include/Nazara/Math/Sphere.inl index 129dda1ec..e19c1389b 100644 --- a/include/Nazara/Math/Sphere.inl +++ b/include/Nazara/Math/Sphere.inl @@ -2,8 +2,8 @@ // This file is part of the "Nazara Engine - Math module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include +#include #include #include #include diff --git a/include/Nazara/Network/NetPacket.inl b/include/Nazara/Network/NetPacket.inl index 24e79a19c..ceef10a44 100644 --- a/include/Nazara/Network/NetPacket.inl +++ b/include/Nazara/Network/NetPacket.inl @@ -2,6 +2,7 @@ // This file is part of the "Nazara Engine - Network module" // For conditions of distribution and use, see copyright notice in Config.hpp +#include #include #include #include diff --git a/include/Nazara/OpenGLRenderer/Utils.hpp b/include/Nazara/OpenGLRenderer/Utils.hpp index ec4635b55..026c4c73d 100644 --- a/include/Nazara/OpenGLRenderer/Utils.hpp +++ b/include/Nazara/OpenGLRenderer/Utils.hpp @@ -8,9 +8,9 @@ #define NAZARA_OPENGLRENDERER_UTILS_HPP #include +#include #include #include -#include #include #include #include diff --git a/include/Nazara/OpenGLRenderer/Utils.inl b/include/Nazara/OpenGLRenderer/Utils.inl index e62a278e2..4f9faf3e7 100644 --- a/include/Nazara/OpenGLRenderer/Utils.inl +++ b/include/Nazara/OpenGLRenderer/Utils.inl @@ -2,9 +2,9 @@ // This file is part of the "Nazara Engine - OpenGL renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include #include +#include #include namespace Nz diff --git a/include/Nazara/OpenGLRenderer/Wrapper/Context.hpp b/include/Nazara/OpenGLRenderer/Wrapper/Context.hpp index 7a3182d98..f42300dd4 100644 --- a/include/Nazara/OpenGLRenderer/Wrapper/Context.hpp +++ b/include/Nazara/OpenGLRenderer/Wrapper/Context.hpp @@ -8,7 +8,6 @@ #define NAZARA_OPENGLRENDERER_WRAPPER_CONTEXT_HPP #include -#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Nazara/Physics2D/RigidBody2D.hpp b/include/Nazara/Physics2D/RigidBody2D.hpp index bbf78f136..083d8d038 100644 --- a/include/Nazara/Physics2D/RigidBody2D.hpp +++ b/include/Nazara/Physics2D/RigidBody2D.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Nazara/Platform/Cursor.hpp b/include/Nazara/Platform/Cursor.hpp index 4a5d565d3..65e45b184 100644 --- a/include/Nazara/Platform/Cursor.hpp +++ b/include/Nazara/Platform/Cursor.hpp @@ -8,10 +8,10 @@ #define NAZARA_PLATFORM_CURSOR_HPP #include +#include #include #include #include -#include #include #include diff --git a/include/Nazara/Platform/Platform.hpp b/include/Nazara/Platform/Platform.hpp index 77bb5c05b..8626049f2 100644 --- a/include/Nazara/Platform/Platform.hpp +++ b/include/Nazara/Platform/Platform.hpp @@ -8,8 +8,8 @@ #define NAZARA_PLATFORM_HPP #include +#include #include -#include namespace Nz { @@ -18,7 +18,7 @@ namespace Nz friend ModuleBase; public: - using Dependencies = TypeList; + using Dependencies = TypeList; struct Config {}; diff --git a/include/Nazara/Platform/WindowHandle.hpp b/include/Nazara/Platform/WindowHandle.hpp index aa08dec7a..833817cad 100644 --- a/include/Nazara/Platform/WindowHandle.hpp +++ b/include/Nazara/Platform/WindowHandle.hpp @@ -8,7 +8,7 @@ #define NAZARA_PLATFORM_WINDOWHANDLE_HPP #include -#include +#include namespace Nz { diff --git a/include/Nazara/Renderer/CommandBufferBuilder.hpp b/include/Nazara/Renderer/CommandBufferBuilder.hpp index 1f20a90e6..b7c209184 100644 --- a/include/Nazara/Renderer/CommandBufferBuilder.hpp +++ b/include/Nazara/Renderer/CommandBufferBuilder.hpp @@ -9,13 +9,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include namespace Nz diff --git a/include/Nazara/Renderer/ComputePipeline.hpp b/include/Nazara/Renderer/ComputePipeline.hpp index a041e151d..7adb4e665 100644 --- a/include/Nazara/Renderer/ComputePipeline.hpp +++ b/include/Nazara/Renderer/ComputePipeline.hpp @@ -7,9 +7,9 @@ #ifndef NAZARA_RENDERER_COMPUTEPIPELINE_HPP #define NAZARA_RENDERER_COMPUTEPIPELINE_HPP +#include #include #include -#include namespace Nz { diff --git a/include/Nazara/Renderer/DebugDrawer.hpp b/include/Nazara/Renderer/DebugDrawer.hpp index 9d10f07a8..8d5c569f6 100644 --- a/include/Nazara/Renderer/DebugDrawer.hpp +++ b/include/Nazara/Renderer/DebugDrawer.hpp @@ -9,13 +9,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/include/Nazara/Renderer/RenderBuffer.hpp b/include/Nazara/Renderer/RenderBuffer.hpp index ed663facb..3ed392faa 100644 --- a/include/Nazara/Renderer/RenderBuffer.hpp +++ b/include/Nazara/Renderer/RenderBuffer.hpp @@ -8,8 +8,8 @@ #define NAZARA_RENDERER_RENDERBUFFER_HPP #include +#include #include -#include #include #include diff --git a/include/Nazara/Renderer/RenderDevice.hpp b/include/Nazara/Renderer/RenderDevice.hpp index 18ea93e29..b1ea7c3b2 100644 --- a/include/Nazara/Renderer/RenderDevice.hpp +++ b/include/Nazara/Renderer/RenderDevice.hpp @@ -8,6 +8,7 @@ #define NAZARA_RENDERER_RENDERDEVICE_HPP #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/include/Nazara/Renderer/RenderPass.hpp b/include/Nazara/Renderer/RenderPass.hpp index 72a5f23d7..106448b29 100644 --- a/include/Nazara/Renderer/RenderPass.hpp +++ b/include/Nazara/Renderer/RenderPass.hpp @@ -8,9 +8,9 @@ #define NAZARA_RENDERER_RENDERPASS_HPP #include +#include #include #include -#include #include #include #include diff --git a/include/Nazara/Renderer/RenderPipeline.hpp b/include/Nazara/Renderer/RenderPipeline.hpp index 4249cef99..e949acd59 100644 --- a/include/Nazara/Renderer/RenderPipeline.hpp +++ b/include/Nazara/Renderer/RenderPipeline.hpp @@ -7,9 +7,9 @@ #ifndef NAZARA_RENDERER_RENDERPIPELINE_HPP #define NAZARA_RENDERER_RENDERPIPELINE_HPP +#include #include #include -#include namespace Nz { diff --git a/include/Nazara/Renderer/RenderStates.hpp b/include/Nazara/Renderer/RenderStates.hpp index ef42104cf..a6eb1d39c 100644 --- a/include/Nazara/Renderer/RenderStates.hpp +++ b/include/Nazara/Renderer/RenderStates.hpp @@ -8,9 +8,9 @@ #define NAZARA_RENDERER_RENDERSTATES_HPP #include +#include +#include #include -#include -#include #include #include diff --git a/include/Nazara/Renderer/RenderStates.inl b/include/Nazara/Renderer/RenderStates.inl index 66ffc618a..d0cd7e129 100644 --- a/include/Nazara/Renderer/RenderStates.inl +++ b/include/Nazara/Renderer/RenderStates.inl @@ -2,7 +2,7 @@ // This file is part of the "Nazara Engine - Renderer module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include diff --git a/include/Nazara/Renderer/RendererImpl.hpp b/include/Nazara/Renderer/RendererImpl.hpp index 038fc1057..2dd367a29 100644 --- a/include/Nazara/Renderer/RendererImpl.hpp +++ b/include/Nazara/Renderer/RendererImpl.hpp @@ -8,12 +8,12 @@ #define NAZARA_RENDERER_RENDERERIMPL_HPP #include +#include #include #include #include #include #include -#include #include #include diff --git a/include/Nazara/Renderer/SwapchainParameters.hpp b/include/Nazara/Renderer/SwapchainParameters.hpp index dedb3d87c..c6d0a8995 100644 --- a/include/Nazara/Renderer/SwapchainParameters.hpp +++ b/include/Nazara/Renderer/SwapchainParameters.hpp @@ -8,8 +8,8 @@ #define NAZARA_RENDERER_SWAPCHAINPARAMETERS_HPP #include +#include #include -#include #include namespace Nz diff --git a/include/Nazara/Renderer/Texture.hpp b/include/Nazara/Renderer/Texture.hpp index f58964455..6069012c7 100644 --- a/include/Nazara/Renderer/Texture.hpp +++ b/include/Nazara/Renderer/Texture.hpp @@ -8,6 +8,7 @@ #define NAZARA_RENDERER_TEXTURE_HPP #include +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include namespace Nz { diff --git a/include/Nazara/Renderer/TextureSampler.hpp b/include/Nazara/Renderer/TextureSampler.hpp index d09988853..c8684f8fe 100644 --- a/include/Nazara/Renderer/TextureSampler.hpp +++ b/include/Nazara/Renderer/TextureSampler.hpp @@ -8,8 +8,8 @@ #define NAZARA_RENDERER_TEXTURESAMPLER_HPP #include +#include #include -#include #include #include diff --git a/include/Nazara/Renderer/WindowSwapchain.hpp b/include/Nazara/Renderer/WindowSwapchain.hpp index aad79a703..54746995a 100644 --- a/include/Nazara/Renderer/WindowSwapchain.hpp +++ b/include/Nazara/Renderer/WindowSwapchain.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include namespace Nz diff --git a/include/Nazara/Utility/Components.hpp b/include/Nazara/TextRenderer.hpp similarity index 67% rename from include/Nazara/Utility/Components.hpp rename to include/Nazara/TextRenderer.hpp index 72248e6e6..8332a1f77 100644 --- a/include/Nazara/Utility/Components.hpp +++ b/include/Nazara/TextRenderer.hpp @@ -1,7 +1,7 @@ // this file was automatically generated and should not be edited /* - Nazara Engine - Utility module + Nazara Engine - Platform module Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) @@ -26,13 +26,17 @@ #pragma once -#ifndef NAZARA_UTILITY_COMPONENTS_HPP -#define NAZARA_UTILITY_COMPONENTS_HPP +#ifndef NAZARA_GLOBAL_TEXTRENDERER_HPP +#define NAZARA_GLOBAL_TEXTRENDERER_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#endif // NAZARA_UTILITY_COMPONENTS_HPP +#endif // NAZARA_GLOBAL_TEXTRENDERER_HPP diff --git a/include/Nazara/Utility/AbstractTextDrawer.hpp b/include/Nazara/TextRenderer/AbstractTextDrawer.hpp similarity index 78% rename from include/Nazara/Utility/AbstractTextDrawer.hpp rename to include/Nazara/TextRenderer/AbstractTextDrawer.hpp index 612501c58..a7e541a38 100644 --- a/include/Nazara/Utility/AbstractTextDrawer.hpp +++ b/include/Nazara/TextRenderer/AbstractTextDrawer.hpp @@ -1,17 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_ABSTRACTTEXTDRAWER_HPP -#define NAZARA_UTILITY_ABSTRACTTEXTDRAWER_HPP +#ifndef NAZARA_TEXTRENDERER_ABSTRACTTEXTDRAWER_HPP +#define NAZARA_TEXTRENDERER_ABSTRACTTEXTDRAWER_HPP #include #include #include #include -#include +#include #include namespace Nz @@ -19,7 +19,7 @@ namespace Nz class AbstractImage; class Font; - class NAZARA_UTILITY_API AbstractTextDrawer + class NAZARA_TEXTRENDERER_API AbstractTextDrawer { public: struct Glyph; @@ -61,6 +61,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_ABSTRACTTEXTDRAWER_HPP +#endif // NAZARA_TEXTRENDERER_ABSTRACTTEXTDRAWER_HPP diff --git a/include/Nazara/Utility/AbstractTextDrawer.inl b/include/Nazara/TextRenderer/AbstractTextDrawer.inl similarity index 78% rename from include/Nazara/Utility/AbstractTextDrawer.inl rename to include/Nazara/TextRenderer/AbstractTextDrawer.inl index 39805488d..478e6282b 100644 --- a/include/Nazara/Utility/AbstractTextDrawer.inl +++ b/include/Nazara/TextRenderer/AbstractTextDrawer.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -19,4 +19,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/Systems.hpp b/include/Nazara/TextRenderer/Config.hpp similarity index 67% rename from include/Nazara/Utility/Systems.hpp rename to include/Nazara/TextRenderer/Config.hpp index 7f4dec3a8..8414a98c7 100644 --- a/include/Nazara/Utility/Systems.hpp +++ b/include/Nazara/TextRenderer/Config.hpp @@ -1,7 +1,5 @@ -// this file was automatically generated and should not be edited - /* - Nazara Engine - Utility module + Nazara Engine - Platform module Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) @@ -26,10 +24,22 @@ #pragma once -#ifndef NAZARA_UTILITY_SYSTEMS_HPP -#define NAZARA_UTILITY_SYSTEMS_HPP +#ifndef NAZARA_TEXTRENDERER_CONFIG_HPP +#define NAZARA_TEXTRENDERER_CONFIG_HPP -#include -#include +/// Each modification of a parameter needs a recompilation of the module -#endif // NAZARA_UTILITY_SYSTEMS_HPP +// Activate the security tests based on the code (Advised for development) +#define NAZARA_TEXTRENDERER_SAFE 1 + +#if defined(NAZARA_STATIC) + #define NAZARA_TEXTRENDERER_API +#else + #ifdef NAZARA_TEXTRENDERER_BUILD + #define NAZARA_TEXTRENDERER_API NAZARA_EXPORT + #else + #define NAZARA_TEXTRENDERER_API NAZARA_IMPORT + #endif +#endif + +#endif // NAZARA_TEXTRENDERER_CONFIG_HPP diff --git a/include/Nazara/Utility/ConfigCheck.hpp b/include/Nazara/TextRenderer/ConfigCheck.hpp similarity index 59% rename from include/Nazara/Utility/ConfigCheck.hpp rename to include/Nazara/TextRenderer/ConfigCheck.hpp index 1fcd4a922..9b524a9ba 100644 --- a/include/Nazara/Utility/ConfigCheck.hpp +++ b/include/Nazara/TextRenderer/ConfigCheck.hpp @@ -1,19 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_CONFIGCHECK_HPP -#define NAZARA_UTILITY_CONFIGCHECK_HPP +#ifndef NAZARA_TEXTRENDERER_CONFIGCHECK_HPP +#define NAZARA_TEXTRENDERER_CONFIGCHECK_HPP /// This file is used to check the constant values defined in Config.hpp #include #define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type ::value && name op val, #type err) -NazaraCheckTypeAndVal(NAZARA_UTILITY_SKINNING_MAX_WEIGHTS, integral, >, 0, " shall be a strictly positive integer"); - #undef NazaraCheckTypeAndVal -#endif // NAZARA_UTILITY_CONFIGCHECK_HPP +#endif // NAZARA_TEXTRENDERER_CONFIGCHECK_HPP diff --git a/include/Nazara/Utility/Debug.hpp b/include/Nazara/TextRenderer/Debug.hpp similarity index 73% rename from include/Nazara/Utility/Debug.hpp rename to include/Nazara/TextRenderer/Debug.hpp index 12779eb6e..e144d0071 100644 --- a/include/Nazara/Utility/Debug.hpp +++ b/include/Nazara/TextRenderer/Debug.hpp @@ -1,5 +1,5 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp // no header guards diff --git a/include/Nazara/Utility/DebugOff.hpp b/include/Nazara/TextRenderer/DebugOff.hpp similarity index 73% rename from include/Nazara/Utility/DebugOff.hpp rename to include/Nazara/TextRenderer/DebugOff.hpp index 12779eb6e..e144d0071 100644 --- a/include/Nazara/Utility/DebugOff.hpp +++ b/include/Nazara/TextRenderer/DebugOff.hpp @@ -1,5 +1,5 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp // no header guards diff --git a/include/Nazara/Utility/Font.hpp b/include/Nazara/TextRenderer/Font.hpp similarity index 91% rename from include/Nazara/Utility/Font.hpp rename to include/Nazara/TextRenderer/Font.hpp index 0d7ae54f5..b0515c640 100644 --- a/include/Nazara/Utility/Font.hpp +++ b/include/Nazara/TextRenderer/Font.hpp @@ -1,27 +1,28 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp ///TODO: FontManager ? #pragma once -#ifndef NAZARA_UTILITY_FONT_HPP -#define NAZARA_UTILITY_FONT_HPP +#ifndef NAZARA_TEXTRENDERER_FONT_HPP +#define NAZARA_TEXTRENDERER_FONT_HPP #include +#include +#include #include #include #include #include -#include -#include +#include #include #include namespace Nz { - struct NAZARA_UTILITY_API FontParams : ResourceParameters + struct NAZARA_TEXTRENDERER_API FontParams : ResourceParameters { bool IsValid() const; }; @@ -34,11 +35,11 @@ namespace Nz using FontLibrary = ObjectLibrary; using FontLoader = ResourceLoader; - class NAZARA_UTILITY_API Font : public Resource + class NAZARA_TEXTRENDERER_API Font : public Resource { friend FontLibrary; friend FontLoader; - friend class Utility; + friend class TextRenderer; public: struct Glyph; @@ -154,6 +155,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_FONT_HPP +#endif // NAZARA_TEXTRENDERER_FONT_HPP diff --git a/include/Nazara/Utility/Font.inl b/include/Nazara/TextRenderer/Font.inl similarity index 56% rename from include/Nazara/Utility/Font.inl rename to include/Nazara/TextRenderer/Font.inl index 019424c5c..d63c9a657 100644 --- a/include/Nazara/Utility/Font.inl +++ b/include/Nazara/TextRenderer/Font.inl @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include namespace Nz { } -#include +#include diff --git a/include/Nazara/Utility/FontData.hpp b/include/Nazara/TextRenderer/FontData.hpp similarity index 78% rename from include/Nazara/Utility/FontData.hpp rename to include/Nazara/TextRenderer/FontData.hpp index 3ca3a6f17..0252aa955 100644 --- a/include/Nazara/Utility/FontData.hpp +++ b/include/Nazara/TextRenderer/FontData.hpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FONTDATA_HPP -#define NAZARA_UTILITY_FONTDATA_HPP +#ifndef NAZARA_TEXTRENDERER_FONTDATA_HPP +#define NAZARA_TEXTRENDERER_FONTDATA_HPP #include -#include -#include +#include +#include #include namespace Nz { struct FontGlyph; - class NAZARA_UTILITY_API FontData + class NAZARA_TEXTRENDERER_API FontData { public: FontData() = default; @@ -41,4 +41,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_FONTDATA_HPP +#endif // NAZARA_TEXTRENDERER_FONTDATA_HPP diff --git a/include/Nazara/Utility/FontGlyph.hpp b/include/Nazara/TextRenderer/FontGlyph.hpp similarity index 53% rename from include/Nazara/Utility/FontGlyph.hpp rename to include/Nazara/TextRenderer/FontGlyph.hpp index cc756db51..0a13998dc 100644 --- a/include/Nazara/Utility/FontGlyph.hpp +++ b/include/Nazara/TextRenderer/FontGlyph.hpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FONTGLYPH_HPP -#define NAZARA_UTILITY_FONTGLYPH_HPP +#ifndef NAZARA_TEXTRENDERER_FONTGLYPH_HPP +#define NAZARA_TEXTRENDERER_FONTGLYPH_HPP -#include +#include namespace Nz { @@ -19,4 +19,4 @@ namespace Nz }; } -#endif // NAZARA_UTILITY_FONTGLYPH_HPP +#endif // NAZARA_TEXTRENDERER_FONTGLYPH_HPP diff --git a/include/Nazara/Utility/RichTextBuilder.hpp b/include/Nazara/TextRenderer/RichTextBuilder.hpp similarity index 89% rename from include/Nazara/Utility/RichTextBuilder.hpp rename to include/Nazara/TextRenderer/RichTextBuilder.hpp index b0add1739..919643eb1 100644 --- a/include/Nazara/Utility/RichTextBuilder.hpp +++ b/include/Nazara/TextRenderer/RichTextBuilder.hpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_RICHTEXTBUILDER_HPP -#define NAZARA_UTILITY_RICHTEXTBUILDER_HPP +#ifndef NAZARA_TEXTRENDERER_RICHTEXTBUILDER_HPP +#define NAZARA_TEXTRENDERER_RICHTEXTBUILDER_HPP #include -#include -#include +#include +#include #include #include @@ -75,6 +75,6 @@ namespace Nz } -#include +#include -#endif // NAZARA_UTILITY_RICHTEXTBUILDER_HPP +#endif // NAZARA_TEXTRENDERER_RICHTEXTBUILDER_HPP diff --git a/include/Nazara/Utility/RichTextBuilder.inl b/include/Nazara/TextRenderer/RichTextBuilder.inl similarity index 96% rename from include/Nazara/Utility/RichTextBuilder.inl rename to include/Nazara/TextRenderer/RichTextBuilder.inl index c49501a8d..3d360c4de 100644 --- a/include/Nazara/Utility/RichTextBuilder.inl +++ b/include/Nazara/TextRenderer/RichTextBuilder.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -166,4 +166,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/RichTextDrawer.hpp b/include/Nazara/TextRenderer/RichTextDrawer.hpp similarity index 94% rename from include/Nazara/Utility/RichTextDrawer.hpp rename to include/Nazara/TextRenderer/RichTextDrawer.hpp index 0ed8d2753..61a8c811e 100644 --- a/include/Nazara/Utility/RichTextDrawer.hpp +++ b/include/Nazara/TextRenderer/RichTextDrawer.hpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_RICHTEXTDRAWER_HPP -#define NAZARA_UTILITY_RICHTEXTDRAWER_HPP +#ifndef NAZARA_TEXTRENDERER_RICHTEXTDRAWER_HPP +#define NAZARA_TEXTRENDERER_RICHTEXTDRAWER_HPP #include -#include -#include -#include +#include +#include +#include #include #include namespace Nz { - class NAZARA_UTILITY_API RichTextDrawer : public AbstractTextDrawer + class NAZARA_TEXTRENDERER_API RichTextDrawer : public AbstractTextDrawer { public: class BlockRef; @@ -207,6 +207,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_RICHTEXTDRAWER_HPP +#endif // NAZARA_TEXTRENDERER_RICHTEXTDRAWER_HPP diff --git a/include/Nazara/Utility/RichTextDrawer.inl b/include/Nazara/TextRenderer/RichTextDrawer.inl similarity index 99% rename from include/Nazara/Utility/RichTextDrawer.inl rename to include/Nazara/TextRenderer/RichTextDrawer.inl index 9f1bef4f0..94ee96dfb 100644 --- a/include/Nazara/Utility/RichTextDrawer.inl +++ b/include/Nazara/TextRenderer/RichTextDrawer.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -620,4 +620,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/Utility/SimpleTextDrawer.hpp b/include/Nazara/TextRenderer/SimpleTextDrawer.hpp similarity index 91% rename from include/Nazara/Utility/SimpleTextDrawer.hpp rename to include/Nazara/TextRenderer/SimpleTextDrawer.hpp index 9f98f1dcf..2c96708e0 100644 --- a/include/Nazara/Utility/SimpleTextDrawer.hpp +++ b/include/Nazara/TextRenderer/SimpleTextDrawer.hpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_SIMPLETEXTDRAWER_HPP -#define NAZARA_UTILITY_SIMPLETEXTDRAWER_HPP +#ifndef NAZARA_TEXTRENDERER_SIMPLETEXTDRAWER_HPP +#define NAZARA_TEXTRENDERER_SIMPLETEXTDRAWER_HPP #include -#include -#include -#include +#include +#include +#include #include namespace Nz { - class NAZARA_UTILITY_API SimpleTextDrawer : public AbstractTextDrawer + class NAZARA_TEXTRENDERER_API SimpleTextDrawer : public AbstractTextDrawer { public: inline SimpleTextDrawer(); @@ -121,6 +121,6 @@ namespace Nz }; } -#include +#include -#endif // NAZARA_UTILITY_SIMPLETEXTDRAWER_HPP +#endif // NAZARA_TEXTRENDERER_SIMPLETEXTDRAWER_HPP diff --git a/include/Nazara/Utility/SimpleTextDrawer.inl b/include/Nazara/TextRenderer/SimpleTextDrawer.inl similarity index 98% rename from include/Nazara/Utility/SimpleTextDrawer.inl rename to include/Nazara/TextRenderer/SimpleTextDrawer.inl index 878c7409e..1f4d01f6a 100644 --- a/include/Nazara/Utility/SimpleTextDrawer.inl +++ b/include/Nazara/TextRenderer/SimpleTextDrawer.inl @@ -1,8 +1,8 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include namespace Nz { @@ -381,4 +381,4 @@ namespace Nz } } -#include +#include diff --git a/include/Nazara/TextRenderer/TextRenderer.hpp b/include/Nazara/TextRenderer/TextRenderer.hpp new file mode 100644 index 000000000..b11cfe1eb --- /dev/null +++ b/include/Nazara/TextRenderer/TextRenderer.hpp @@ -0,0 +1,39 @@ +// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) +// This file is part of the "Nazara Engine - Text renderer" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#pragma once + +#ifndef NAZARA_TEXTRENDERER_HPP +#define NAZARA_TEXTRENDERER_HPP + +#include +#include +#include +#include + +namespace Nz +{ + class NAZARA_TEXTRENDERER_API TextRenderer : public ModuleBase + { + friend ModuleBase; + + public: + using Dependencies = TypeList; + + struct Config {}; + + TextRenderer(Config /*config*/); + ~TextRenderer(); + + FontLoader& GetFontLoader(); + const FontLoader& GetFontLoader() const; + + private: + FontLoader m_fontLoader; + + static TextRenderer* s_instance; + }; +} + +#endif // NAZARA_TEXTRENDERER_HPP diff --git a/include/Nazara/Utility.hpp b/include/Nazara/Utility.hpp deleted file mode 100644 index 508f0abfc..000000000 --- a/include/Nazara/Utility.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// this file was automatically generated and should not be edited - -/* - Nazara Engine - Utility module - - Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#pragma once - -#ifndef NAZARA_GLOBAL_UTILITY_HPP -#define NAZARA_GLOBAL_UTILITY_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef NAZARA_ENTT - -#include -#include - -#endif - -#endif // NAZARA_GLOBAL_UTILITY_HPP diff --git a/include/Nazara/Utility/Algorithm.hpp b/include/Nazara/Utility/Algorithm.hpp deleted file mode 100644 index 7e69e96b5..000000000 --- a/include/Nazara/Utility/Algorithm.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_UTILITY_ALGORITHM_HPP -#define NAZARA_UTILITY_ALGORITHM_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Nz -{ - class Joint; - struct VertexStruct_XYZ_Normal_UV_Tangent; - struct VertexStruct_XYZ_Normal_UV_Tangent_Skinning; - - using MeshVertex = VertexStruct_XYZ_Normal_UV_Tangent; - using SkeletalMeshVertex = VertexStruct_XYZ_Normal_UV_Tangent_Skinning; - - struct SkinningData - { - const Joint* joints; - SparsePtr inputPositions; - SparsePtr inputNormals; - SparsePtr inputTangents; - SparsePtr inputJointIndices; - SparsePtr inputJointWeights; - SparsePtr inputUv; - SparsePtr outputNormals; - SparsePtr outputPositions; - SparsePtr outputTangents; - SparsePtr outputUv; - }; - - struct VertexPointers - { - SparsePtr normalPtr; - SparsePtr positionPtr; - SparsePtr tangentPtr; - SparsePtr uvPtr; - }; - - NAZARA_UTILITY_API Boxf ComputeAABB(SparsePtr positionPtr, UInt32 vertexCount); - NAZARA_UTILITY_API void ComputeBoxIndexVertexCount(const Vector3ui& subdivision, UInt32* indexCount, UInt32* vertexCount); - NAZARA_UTILITY_API UInt32 ComputeCacheMissCount(IndexIterator indices, UInt32 indexCount); - NAZARA_UTILITY_API void ComputeConeIndexVertexCount(unsigned int subdivision, UInt32* indexCount, UInt32* vertexCount); - NAZARA_UTILITY_API void ComputeCubicSphereIndexVertexCount(unsigned int subdivision, UInt32* indexCount, UInt32* vertexCount); - NAZARA_UTILITY_API void ComputeIcoSphereIndexVertexCount(unsigned int recursionLevel, UInt32* indexCount, UInt32* vertexCount); - NAZARA_UTILITY_API void ComputePlaneIndexVertexCount(const Vector2ui& subdivision, UInt32* indexCount, UInt32* vertexCount); - NAZARA_UTILITY_API void ComputeUvSphereIndexVertexCount(unsigned int sliceCount, unsigned int stackCount, UInt32* indexCount, UInt32* vertexCount); - - NAZARA_UTILITY_API void GenerateBox(const Vector3f& lengths, const Vector3ui& subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - NAZARA_UTILITY_API void GenerateCone(float length, float radius, unsigned int subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - NAZARA_UTILITY_API void GenerateCubicSphere(float size, unsigned int subdivision, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - NAZARA_UTILITY_API void GenerateIcoSphere(float size, unsigned int recursionLevel, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - NAZARA_UTILITY_API void GeneratePlane(const Vector2ui& subdivision, const Vector2f& size, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - NAZARA_UTILITY_API void GenerateUvSphere(float size, unsigned int sliceCount, unsigned int stackCount, const Matrix4f& matrix, const Rectf& textureCoords, VertexPointers vertexPointers, IndexIterator indices, Boxf* aabb = nullptr, UInt32 indexOffset = 0); - - NAZARA_UTILITY_API void OptimizeIndices(IndexIterator indices, UInt32 indexCount); - - NAZARA_UTILITY_API void SkinLinearBlend(const SkinningData& data, UInt32 startVertex, UInt32 vertexCount); - - inline Vector3f TransformPositionTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& position); - inline Vector3f TransformNormalTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& normal); - inline Quaternionf TransformRotationTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Quaternionf& rotation); - inline Vector3f TransformScaleTRS(const Vector3f& transformScale, const Vector3f& scale); - inline void TransformTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, Vector3f& position, Quaternionf& rotation, Vector3f& scale); - inline void TransformVertices(VertexPointers vertexPointers, UInt32 vertexCount, const Matrix4f& matrix); - - template constexpr ComponentType ComponentTypeId(); - template constexpr ComponentType GetComponentTypeOf(); -} - -#include - -#endif // NAZARA_UTILITY_ALGORITHM_HPP diff --git a/include/Nazara/Utility/Algorithm.inl b/include/Nazara/Utility/Algorithm.inl deleted file mode 100644 index 3da103998..000000000 --- a/include/Nazara/Utility/Algorithm.inl +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#include - -namespace Nz -{ - inline Vector3f TransformPositionTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& position) - { - return transformRotation * (transformScale * position) + transformTranslation; - } - - Vector3f TransformNormalTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Vector3f& normal) - { - return Quaternionf::Mirror(transformRotation, transformScale) * normal; - } - - inline Quaternionf TransformRotationTRS(const Quaternionf& transformRotation, const Vector3f& transformScale, const Quaternionf& rotation) - { - return Quaternionf::Mirror(transformRotation, transformScale) * rotation; - } - - inline Vector3f TransformScaleTRS(const Vector3f& transformScale, const Vector3f& scale) - { - return transformScale * scale; - } - - inline void TransformTRS(const Vector3f& transformTranslation, const Quaternionf& transformRotation, const Vector3f& transformScale, Vector3f& position, Quaternionf& rotation, Vector3f& scale) - { - position = TransformPositionTRS(transformTranslation, transformRotation, transformScale, position); - rotation = TransformRotationTRS(transformRotation, transformScale, rotation); - scale = TransformScaleTRS(transformScale, scale); - } - - inline void TransformVertices(VertexPointers vertexPointers, UInt32 vertexCount, const Matrix4f& matrix) - { - if (vertexPointers.positionPtr) - { - for (UInt32 i = 0; i < vertexCount; ++i) - *vertexPointers.positionPtr++ = matrix.Transform(*vertexPointers.positionPtr); - } - - if (vertexPointers.normalPtr || vertexPointers.tangentPtr) - { - Vector3f scale = matrix.GetScale(); - - if (vertexPointers.normalPtr) - { - for (UInt64 i = 0; i < vertexCount; ++i) - *vertexPointers.normalPtr++ = matrix.Transform(*vertexPointers.normalPtr, 0.f) / scale; - } - - if (vertexPointers.tangentPtr) - { - for (UInt64 i = 0; i < vertexCount; ++i) - *vertexPointers.tangentPtr++ = matrix.Transform(*vertexPointers.tangentPtr, 0.f) / scale; - } - } - } - - template constexpr ComponentType ComponentTypeId() - { - static_assert(AlwaysFalse::value, "This type cannot be used as a component."); - return ComponentType{}; - } - - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Color; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double1; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double2; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double3; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Double4; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float1; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float2; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float3; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Float4; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int1; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int2; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int3; } - template<> constexpr ComponentType ComponentTypeId() { return ComponentType::Int4; } - - template - constexpr ComponentType GetComponentTypeOf() - { - return ComponentTypeId>(); - } -} - -#include diff --git a/include/Nazara/Utility/Config.hpp b/include/Nazara/Utility/Config.hpp deleted file mode 100644 index 62487e451..000000000 --- a/include/Nazara/Utility/Config.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - Nazara Engine - Utility module - - Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#pragma once - -#ifndef NAZARA_UTILITY_CONFIG_HPP -#define NAZARA_UTILITY_CONFIG_HPP - -/// Each modification of a parameter needs a recompilation of the module - -// Activate the security tests based on the code (Advised for development) -#define NAZARA_UTILITY_SAFE 1 - -// When a resource is being parsed, it triggers a warning if a non-critical error is found in the resource (Slower) -#define NAZARA_UTILITY_STRICT_RESOURCE_PARSING 1 - -// Protect the classes against data race -//#define NAZARA_UTILITY_THREADSAFE 1 - -// Force the buffers to have a stride which is a multiple of 32 bytes (Gain of performances on certain cards/more memory consumption) -#define NAZARA_UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 0 ///FIXME: Can not be used for the moment - -/// Each modification of a parameter following implies a modification (often minor) of the code - -// The maximal number of weights acting on a vertex (In case of overflow, the surnumerous weights would be ignored and the others renormalized) -#define NAZARA_UTILITY_SKINNING_MAX_WEIGHTS 4 - -/// Checking the values and types of certain constants -#include - -#if defined(NAZARA_STATIC) - #define NAZARA_UTILITY_API -#else - #ifdef NAZARA_UTILITY_BUILD - #define NAZARA_UTILITY_API NAZARA_EXPORT - #else - #define NAZARA_UTILITY_API NAZARA_IMPORT - #endif -#endif - -#endif // NAZARA_UTILITY_CONFIG_HPP diff --git a/include/Nazara/Utility/Enums.hpp b/include/Nazara/Utility/Enums.hpp deleted file mode 100644 index a1dfc819c..000000000 --- a/include/Nazara/Utility/Enums.hpp +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_UTILITY_ENUMS_HPP -#define NAZARA_UTILITY_ENUMS_HPP - -#include - -namespace Nz -{ - enum class AnimationType - { - Skeletal, - Static, - - Max = Static - }; - - enum class BlendEquation - { - Add, - Max, - Min, - ReverseSubtract, - Subtract, - }; - - enum class BlendFunc - { - ConstantColor, - ConstantAlpha, - DstAlpha, - DstColor, - SrcAlpha, - SrcColor, - InvConstantColor, - InvConstantAlpha, - InvDstAlpha, - InvDstColor, - InvSrcAlpha, - InvSrcColor, - One, - Zero - }; - - enum class BufferAccess - { - DiscardAndWrite, - ReadOnly, - ReadWrite, - WriteOnly, - - Max = WriteOnly - }; - - enum class BufferType - { - Index, - Vertex, - Storage, - Uniform, - Upload, - - Max = Upload - }; - - enum class BufferUsage - { - DeviceLocal, - DirectMapping, - Dynamic, - Read, - PersistentMapping, - Write, - - Max = DirectMapping - }; - - template<> - struct EnumAsFlags - { - static constexpr BufferUsage max = BufferUsage::Max; - }; - - using BufferUsageFlags = Flags; - - enum class ComponentType - { - Color, - Double1, - Double2, - Double3, - Double4, - Float1, - Float2, - Float3, - Float4, - Int1, - Int2, - Int3, - Int4, - - Max = Int4 - }; - - constexpr std::size_t ComponentTypeCount = static_cast(ComponentType::Max) + 1; - - enum class CubemapFace - { - // This enumeration is intended to replace the "z" argument of Image's methods containing cubemap - // The order is X, -X, Y, -Y, Z, -Z - PositiveX = 0, - PositiveY = 2, - PositiveZ = 4, - NegativeX = 1, - NegativeY = 3, - NegativeZ = 5, - - Max = NegativeZ - }; - - enum class DataStorage - { - Hardware, - Software, - - Max = Software - }; - - template<> - struct EnumAsFlags - { - static constexpr DataStorage max = DataStorage::Max; - }; - - using DataStoreFlags = Flags; - constexpr std::size_t DataStorageCount = static_cast(DataStorage::Max) + 1; - - enum class FaceFilling - { - Fill, - Line, - Point, - - Max = Point - }; - - enum class FaceCulling - { - None, - - Back, - Front, - FrontAndBack, - - Max = FrontAndBack - }; - - enum class FrontFace - { - Clockwise, - CounterClockwise, - - Max = CounterClockwise - }; - - enum class IndexType - { - U8, - U16, - U32, - - Max = U32 - }; - - enum class NodeType - { - Default, // Node - Scene, // SceneNode (Graphics) - Skeletal, ///TODO - - Max = Skeletal - }; - - enum class PixelFormatContent - { - Undefined = -1, - - ColorRGBA, - Depth, - DepthStencil, - Stencil, - - Max = Stencil - }; - - enum class PixelFormat - { - Undefined = -1, - - A8, // 1*uint8 - BGR8, // 3*uint8 - BGR8_SRGB, // 3*uint8 - BGRA8, // 4*uint8 - BGRA8_SRGB, // 4*uint8 - DXT1, - DXT3, - DXT5, - L8, // 1*uint8 - LA8, // 2*uint8 - R8, // 1*uint8 - R8I, // 1*int8 - R8UI, // 1*uint8 - R16, // 1*uint16 - R16F, // 1*half - R16I, // 1*int16 - R16UI, // 1*uint16 - R32F, // 1*float - R32I, // 1*uint16 - R32UI, // 1*uint32 - RG8, // 2*int8 - RG8I, // 2*int8 - RG8UI, // 2*uint8 - RG16, // 2*uint16 - RG16F, // 2*half - RG16I, // 2*int16 - RG16UI, // 2*uint16 - RG32F, // 2*float - RG32I, // 2*uint16 - RG32UI, // 2*uint32 - RGB5A1, // 3*uint5 + alpha bit - RGB8, // 3*uint8 - RGB8_SRGB, // 3*uint8 - RGB16F, // 3*half - RGB16I, // 4*int16 - RGB16UI, // 4*uint16 - RGB32F, // 3*float - RGB32I, // 4*int32 - RGB32UI, // 4*uint32 - RGBA4, // 4*uint4 - RGBA8, // 4*uint8 - RGBA8_SRGB, // 4*uint8 - RGBA16F, // 4*half - RGBA16I, // 4*int16 - RGBA16UI, // 4*uint16 - RGBA32F, // 4*float - RGBA32I, // 4*int32 - RGBA32UI, // 4*uint32 - Depth16, - Depth16Stencil8, - Depth24, - Depth24Stencil8, - Depth32F, - Depth32FStencil8, - Stencil1, - Stencil4, - Stencil8, - Stencil16, - - Max = Stencil16 - }; - - constexpr std::size_t PixelFormatCount = static_cast(PixelFormat::Max) + 1; - - enum class PixelFormatSubType - { - Compressed, // Opaque - Double, // F64 - Float, // F32 - Half, // F16 - Int, // Signed integer - Unsigned, // Unsigned integer - - Max = Unsigned - }; - - enum class PixelFlipping - { - Horizontally, - Vertically, - - Max = Vertically - }; - - constexpr std::size_t PixelFlippingCount = static_cast(PixelFlipping::Max) + 1; - - enum class PrimitiveMode - { - LineList, - LineStrip, - PointList, - TriangleList, - TriangleStrip, - TriangleFan, - - Max = TriangleFan - }; - - enum class RendererComparison - { - Always, - Equal, - Greater, - GreaterOrEqual, - Less, - LessOrEqual, - Never, - NotEqual, - - Max = NotEqual - }; - - enum class SamplerFilter - { - Linear, - Nearest, - - Max = Nearest - }; - - enum class SamplerMipmapMode - { - Linear, - Nearest, - - Max = Nearest - }; - - enum class SamplerWrap - { - Clamp, - MirroredRepeat, - Repeat, - - Max = Repeat - }; - - enum class StencilOperation - { - Decrement, - DecrementNoClamp, - Increment, - IncrementNoClamp, - Invert, - Keep, - Replace, - Zero, - - Max = Zero - }; - - enum class TextAlign - { - Left, - Middle, - Right, - - Max = Right - }; - - enum class TextStyle - { - Bold, - Italic, - StrikeThrough, - Underlined, - - Max = Underlined - }; - - template<> - struct EnumAsFlags - { - static constexpr TextStyle max = TextStyle::Max; - }; - - using TextStyleFlags = Flags; - - constexpr TextStyleFlags TextStyle_Regular = TextStyleFlags{}; - - enum class VertexComponent - { - Unused = -1, - - Color, - JointIndices, - JointWeights, - Normal, - Position, - SizeSinCos, - Tangent, - TexCoord, - Userdata, - - Max = Userdata - }; - - enum class VertexInputRate - { - Instance, - Vertex - }; - - enum class VertexLayout - { - // Predefined declarations for rendering - UV_SizeSinCos, - XY, - XY_Color, - XY_UV, - XYZ, - XYZ_Color, - XYZ_Color_UV, - XYZ_Normal, - XYZ_Normal_UV, - XYZ_Normal_UV_Tangent, - XYZ_Normal_UV_Tangent_Skinning, - UV_SizeSinCos_Color, - XYZ_UV, - - // Predefined declarations for instancing - Matrix4, - - Max = Matrix4 - }; - - constexpr std::size_t VertexLayoutCount = static_cast(VertexLayout::Max) + 1; -} - -#endif // NAZARA_UTILITY_ENUMS_HPP diff --git a/include/Nazara/Utility/Utility.hpp b/include/Nazara/Utility/Utility.hpp deleted file mode 100644 index a1546bdd4..000000000 --- a/include/Nazara/Utility/Utility.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_UTILITY_HPP -#define NAZARA_UTILITY_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Nz -{ - class NAZARA_UTILITY_API Utility : public ModuleBase - { - friend ModuleBase; - - public: - using Dependencies = TypeList; - - struct Config {}; - - Utility(Config /*config*/); - Utility(const Utility&) = delete; - Utility(Utility&&) = delete; - ~Utility(); - - AnimationLoader& GetAnimationLoader(); - const AnimationLoader& GetAnimationLoader() const; - FontLoader& GetFontLoader(); - const FontLoader& GetFontLoader() const; - ImageLoader& GetImageLoader(); - const ImageLoader& GetImageLoader() const; - ImageSaver& GetImageSaver(); - const ImageSaver& GetImageSaver() const; - ImageStreamLoader& GetImageStreamLoader(); - const ImageStreamLoader& GetImageStreamLoader() const; - MeshLoader& GetMeshLoader(); - const MeshLoader& GetMeshLoader() const; - MeshSaver& GetMeshSaver(); - const MeshSaver& GetMeshSaver() const; - - Utility& operator=(const Utility&) = delete; - Utility& operator=(Utility&&) = delete; - - private: - AnimationLoader m_animationLoader; - FontLoader m_fontLoader; - ImageLoader m_imageLoader; - ImageSaver m_imageSaver; - ImageStreamLoader m_imageStreamLoader; - MeshLoader m_meshLoader; - MeshSaver m_meshSaver; - - static Utility* s_instance; - }; -} - -#endif // NAZARA_UTILITY_HPP diff --git a/include/Nazara/VulkanRenderer/Utils.hpp b/include/Nazara/VulkanRenderer/Utils.hpp index 29da448fb..c1fd0c4ae 100644 --- a/include/Nazara/VulkanRenderer/Utils.hpp +++ b/include/Nazara/VulkanRenderer/Utils.hpp @@ -8,8 +8,8 @@ #define NAZARA_VULKANRENDERER_UTILS_HPP #include +#include #include -#include #include #include #include diff --git a/include/Nazara/VulkanRenderer/Utils.inl b/include/Nazara/VulkanRenderer/Utils.inl index 83bdead05..24c0b8f61 100644 --- a/include/Nazara/VulkanRenderer/Utils.inl +++ b/include/Nazara/VulkanRenderer/Utils.inl @@ -2,9 +2,9 @@ // This file is part of the "Nazara Engine - Vulkan renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include #include #include +#include #include namespace Nz diff --git a/include/Nazara/VulkanRenderer/VulkanComputePipeline.hpp b/include/Nazara/VulkanRenderer/VulkanComputePipeline.hpp index 00d0c0908..1ebb3b65a 100644 --- a/include/Nazara/VulkanRenderer/VulkanComputePipeline.hpp +++ b/include/Nazara/VulkanRenderer/VulkanComputePipeline.hpp @@ -8,7 +8,6 @@ #define NAZARA_VULKANRENDERER_VULKANCOMPUTEPIPELINE_HPP #include -#include #include #include #include diff --git a/include/Nazara/VulkanRenderer/VulkanRenderPipeline.hpp b/include/Nazara/VulkanRenderer/VulkanRenderPipeline.hpp index 448d0bb37..bc5f07e16 100644 --- a/include/Nazara/VulkanRenderer/VulkanRenderPipeline.hpp +++ b/include/Nazara/VulkanRenderer/VulkanRenderPipeline.hpp @@ -8,7 +8,6 @@ #define NAZARA_VULKANRENDERER_VULKANRENDERPIPELINE_HPP #include -#include #include #include #include diff --git a/include/Nazara/VulkanRenderer/Wrapper/Device.hpp b/include/Nazara/VulkanRenderer/Wrapper/Device.hpp index e7a44e0b1..077d726ea 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/Device.hpp +++ b/include/Nazara/VulkanRenderer/Wrapper/Device.hpp @@ -8,7 +8,6 @@ #define NAZARA_VULKANRENDERER_WRAPPER_DEVICE_HPP #include -#include #include #include #include diff --git a/include/Nazara/Widgets.hpp b/include/Nazara/Widgets.hpp index ca7783802..654a053ce 100644 --- a/include/Nazara/Widgets.hpp +++ b/include/Nazara/Widgets.hpp @@ -29,6 +29,7 @@ #ifndef NAZARA_GLOBAL_WIDGETS_HPP #define NAZARA_GLOBAL_WIDGETS_HPP +#include #include #include #include @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Nazara/Widgets/AbstractTextAreaWidget.hpp b/include/Nazara/Widgets/AbstractTextAreaWidget.hpp index 3dbecfc54..7cc717dbf 100644 --- a/include/Nazara/Widgets/AbstractTextAreaWidget.hpp +++ b/include/Nazara/Widgets/AbstractTextAreaWidget.hpp @@ -8,7 +8,7 @@ #define NAZARA_WIDGETS_ABSTRACTTEXTAREAWIDGET_HPP #include -#include +#include #include #include #include diff --git a/include/Nazara/Widgets/BaseWidget.hpp b/include/Nazara/Widgets/BaseWidget.hpp index f71be56f8..e91bf42a7 100644 --- a/include/Nazara/Widgets/BaseWidget.hpp +++ b/include/Nazara/Widgets/BaseWidget.hpp @@ -7,11 +7,11 @@ #ifndef NAZARA_WIDGETS_BASEWIDGET_HPP #define NAZARA_WIDGETS_BASEWIDGET_HPP +#include #include #include #include #include -#include #include #include #include diff --git a/include/Nazara/Widgets/RichTextAreaWidget.hpp b/include/Nazara/Widgets/RichTextAreaWidget.hpp index 6231d5691..42d336c53 100644 --- a/include/Nazara/Widgets/RichTextAreaWidget.hpp +++ b/include/Nazara/Widgets/RichTextAreaWidget.hpp @@ -7,7 +7,7 @@ #ifndef NAZARA_WIDGETS_RICHTEXTAREAWIDGET_HPP #define NAZARA_WIDGETS_RICHTEXTAREAWIDGET_HPP -#include +#include #include namespace Nz diff --git a/include/Nazara/Widgets/SimpleLabelWidget.hpp b/include/Nazara/Widgets/SimpleLabelWidget.hpp index 016b1f702..d546553e3 100644 --- a/include/Nazara/Widgets/SimpleLabelWidget.hpp +++ b/include/Nazara/Widgets/SimpleLabelWidget.hpp @@ -7,7 +7,7 @@ #ifndef NAZARA_WIDGETS_SIMPLELABELWIDGET_HPP #define NAZARA_WIDGETS_SIMPLELABELWIDGET_HPP -#include +#include #include #include diff --git a/include/Nazara/Widgets/TextAreaWidget.hpp b/include/Nazara/Widgets/TextAreaWidget.hpp index 9b50a2e1b..c5f593868 100644 --- a/include/Nazara/Widgets/TextAreaWidget.hpp +++ b/include/Nazara/Widgets/TextAreaWidget.hpp @@ -7,7 +7,7 @@ #ifndef NAZARA_WIDGETS_TEXTAREAWIDGET_HPP #define NAZARA_WIDGETS_TEXTAREAWIDGET_HPP -#include +#include #include namespace Nz diff --git a/plugins/Assimp/CustomStream.cpp b/plugins/Assimp/CustomStream.cpp index 89dadf6ca..74bf17ccf 100644 --- a/plugins/Assimp/CustomStream.cpp +++ b/plugins/Assimp/CustomStream.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/plugins/Assimp/Plugin.cpp b/plugins/Assimp/Plugin.cpp index b2d705006..a74f7e3b4 100644 --- a/plugins/Assimp/Plugin.cpp +++ b/plugins/Assimp/Plugin.cpp @@ -27,21 +27,21 @@ SOFTWARE. #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -896,8 +896,8 @@ namespace public: bool Activate() override { - Nz::Utility* utility = Nz::Utility::Instance(); - NazaraAssert(utility, "utility module is not instancied"); + Nz::Core* core = Nz::Core::Instance(); + NazaraAssert(core, "core module is not instancied"); Nz::AnimationLoader::Entry animationLoaderEntry; animationLoaderEntry.extensionSupport = IsSupported; @@ -910,7 +910,7 @@ namespace return true; }; - Nz::AnimationLoader& animationLoader = utility->GetAnimationLoader(); + Nz::AnimationLoader& animationLoader = core->GetAnimationLoader(); m_animationLoaderEntry = animationLoader.RegisterLoader(std::move(animationLoaderEntry)); Nz::MeshLoader::Entry meshLoaderEntry; @@ -924,7 +924,7 @@ namespace return true; }; - Nz::MeshLoader& meshLoader = utility->GetMeshLoader(); + Nz::MeshLoader& meshLoader = core->GetMeshLoader(); m_meshLoaderEntry = meshLoader.RegisterLoader(std::move(meshLoaderEntry)); return true; @@ -932,13 +932,13 @@ namespace void Deactivate() override { - Nz::Utility* utility = Nz::Utility::Instance(); - NazaraAssert(utility, "utility module is not instanced"); + Nz::Core* core = Nz::Core::Instance(); + NazaraAssert(core, "core module is not instanced"); - Nz::AnimationLoader& animationLoader = utility->GetAnimationLoader(); + Nz::AnimationLoader& animationLoader = core->GetAnimationLoader(); animationLoader.UnregisterLoader(m_animationLoaderEntry); - Nz::MeshLoader& meshLoader = utility->GetMeshLoader(); + Nz::MeshLoader& meshLoader = core->GetMeshLoader(); meshLoader.UnregisterLoader(m_meshLoaderEntry); } @@ -976,10 +976,10 @@ extern "C" { NAZARA_EXPORT Nz::PluginInterface* PluginLoad() { - Nz::Utility* utility = Nz::Utility::Instance(); - if (!utility) + Nz::Core* core = Nz::Core::Instance(); + if (!core) { - NazaraError("Utility module must be initialized"); + NazaraError("Core module must be initialized"); return nullptr; } diff --git a/plugins/Assimp/xmake.lua b/plugins/Assimp/xmake.lua index f89494d63..12e5d7f0e 100644 --- a/plugins/Assimp/xmake.lua +++ b/plugins/Assimp/xmake.lua @@ -7,7 +7,7 @@ if has_config("assimp") then set_group("Plugins") add_rpathdirs("$ORIGIN") - add_deps("NazaraUtility") + add_deps("NazaraCore") add_packages("assimp") add_headerfiles("**.hpp", "**.inl", { prefixdir = "private", install = false }) diff --git a/plugins/FFmpeg/Plugin.cpp b/plugins/FFmpeg/Plugin.cpp index a7ce40fb3..efe2249c6 100644 --- a/plugins/FFmpeg/Plugin.cpp +++ b/plugins/FFmpeg/Plugin.cpp @@ -10,11 +10,11 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program. If not, see */ -#include +#include #include -#include -#include -#include +#include +#include +#include extern "C" { @@ -434,8 +434,8 @@ namespace public: bool Activate() override { - Nz::Utility* utility = Nz::Utility::Instance(); - NazaraAssert(utility, "utility module is not instancied"); + Nz::Core* core = Nz::Core::Instance(); + NazaraAssert(core, "core module is not instancied"); Nz::ImageStreamLoader::Entry loaderEntry; loaderEntry.extensionSupport = CheckVideoExtension; @@ -450,7 +450,7 @@ namespace return true; }; - Nz::ImageStreamLoader& imageStreamLoader = utility->GetImageStreamLoader(); + Nz::ImageStreamLoader& imageStreamLoader = core->GetImageStreamLoader(); m_ffmpegLoaderEntry = imageStreamLoader.RegisterLoader(loaderEntry); return true; @@ -458,10 +458,10 @@ namespace void Deactivate() override { - Nz::Utility* utility = Nz::Utility::Instance(); - NazaraAssert(utility, "utility module is not instanced"); + Nz::Core* core = Nz::Core::Instance(); + NazaraAssert(core, "core module is not instanced"); - Nz::ImageStreamLoader& imageStreamLoader = utility->GetImageStreamLoader(); + Nz::ImageStreamLoader& imageStreamLoader = core->GetImageStreamLoader(); imageStreamLoader.UnregisterLoader(m_ffmpegLoaderEntry); m_ffmpegLoaderEntry = nullptr; @@ -491,10 +491,10 @@ extern "C" { NAZARA_EXPORT Nz::PluginInterface* PluginLoad() { - Nz::Utility* utility = Nz::Utility::Instance(); - if (!utility) + Nz::Core* core = Nz::Core::Instance(); + if (!core) { - NazaraError("Utility module must be initialized"); + NazaraError("Core module must be initialized"); return nullptr; } diff --git a/plugins/FFmpeg/xmake.lua b/plugins/FFmpeg/xmake.lua index bdda1d4ae..d6741a8d2 100644 --- a/plugins/FFmpeg/xmake.lua +++ b/plugins/FFmpeg/xmake.lua @@ -7,7 +7,7 @@ if has_config("ffmpeg") then set_group("Plugins") add_rpathdirs("$ORIGIN") - add_deps("NazaraUtility") + add_deps("NazaraCore") add_packages("ffmpeg") add_headerfiles("**.hpp", "**.inl", { prefixdir = "private", install = false }) diff --git a/src/Nazara/Audio/DummyAudioBuffer.cpp b/src/Nazara/Audio/DummyAudioBuffer.cpp index 60d8d01d1..d09114d09 100644 --- a/src/Nazara/Audio/DummyAudioBuffer.cpp +++ b/src/Nazara/Audio/DummyAudioBuffer.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Audio/DummyAudioSource.cpp b/src/Nazara/Audio/DummyAudioSource.cpp index da0b4c467..2c4ce62dd 100644 --- a/src/Nazara/Audio/DummyAudioSource.cpp +++ b/src/Nazara/Audio/DummyAudioSource.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/Nazara/Audio/OpenALBuffer.cpp b/src/Nazara/Audio/OpenALBuffer.cpp index d8ad96b8c..560a3cc79 100644 --- a/src/Nazara/Audio/OpenALBuffer.cpp +++ b/src/Nazara/Audio/OpenALBuffer.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Audio/OpenALSource.cpp b/src/Nazara/Audio/OpenALSource.cpp index 9317f149b..0a6a9739f 100644 --- a/src/Nazara/Audio/OpenALSource.cpp +++ b/src/Nazara/Audio/OpenALSource.cpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/Nazara/Audio/Sound.cpp b/src/Nazara/Audio/Sound.cpp index af5e86738..ba4911927 100644 --- a/src/Nazara/Audio/Sound.cpp +++ b/src/Nazara/Audio/Sound.cpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include namespace Nz diff --git a/src/Nazara/Utility/AbstractAtlas.cpp b/src/Nazara/Core/AbstractAtlas.cpp similarity index 62% rename from src/Nazara/Utility/AbstractAtlas.cpp rename to src/Nazara/Core/AbstractAtlas.cpp index 98d11d1ba..715c333da 100644 --- a/src/Nazara/Utility/AbstractAtlas.cpp +++ b/src/Nazara/Core/AbstractAtlas.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Core/AbstractHash.cpp b/src/Nazara/Core/AbstractHash.cpp index 80c0462c2..48721c0c5 100644 --- a/src/Nazara/Core/AbstractHash.cpp +++ b/src/Nazara/Core/AbstractHash.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include @@ -16,6 +15,7 @@ #include #include #include +#include #include namespace Nz diff --git a/src/Nazara/Utility/AbstractImage.cpp b/src/Nazara/Core/AbstractImage.cpp similarity index 73% rename from src/Nazara/Utility/AbstractImage.cpp rename to src/Nazara/Core/AbstractImage.cpp index ebffc3c1b..5e7e03740 100644 --- a/src/Nazara/Utility/AbstractImage.cpp +++ b/src/Nazara/Core/AbstractImage.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Core/AbstractLogger.cpp b/src/Nazara/Core/AbstractLogger.cpp index 63d7125c9..155652977 100644 --- a/src/Nazara/Core/AbstractLogger.cpp +++ b/src/Nazara/Core/AbstractLogger.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include diff --git a/src/Nazara/Utility/AlgorithmUtility.cpp b/src/Nazara/Core/AlgorithmCore.cpp similarity index 99% rename from src/Nazara/Utility/AlgorithmUtility.cpp rename to src/Nazara/Core/AlgorithmCore.cpp index 31b350a3a..d8b2f59ed 100644 --- a/src/Nazara/Utility/AlgorithmUtility.cpp +++ b/src/Nazara/Core/AlgorithmCore.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp /* @@ -25,15 +25,15 @@ * THE SOFTWARE. */ +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Animation.cpp b/src/Nazara/Core/Animation.cpp similarity index 90% rename from src/Nazara/Utility/Animation.cpp rename to src/Nazara/Core/Animation.cpp index f531fe9d8..8fa24d51e 100644 --- a/src/Nazara/Utility/Animation.cpp +++ b/src/Nazara/Core/Animation.cpp @@ -1,17 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include #include #include -#include +#include namespace Nz { @@ -64,7 +64,7 @@ namespace Nz if (!sequence.name.empty()) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE auto it = m_impl->sequenceMap.find(sequence.name); if (it != m_impl->sequenceMap.end()) { @@ -291,25 +291,25 @@ namespace Nz std::shared_ptr Animation::LoadFromFile(const std::filesystem::path& filePath, const AnimationParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetAnimationLoader().LoadFromFile(filePath, params); + return core->GetAnimationLoader().LoadFromFile(filePath, params); } std::shared_ptr Animation::LoadFromMemory(const void* data, std::size_t size, const AnimationParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetAnimationLoader().LoadFromMemory(data, size, params); + return core->GetAnimationLoader().LoadFromMemory(data, size, params); } std::shared_ptr Animation::LoadFromStream(Stream& stream, const AnimationParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetAnimationLoader().LoadFromStream(stream, params); + return core->GetAnimationLoader().LoadFromStream(stream, params); } } diff --git a/src/Nazara/Core/AntiWindows.hpp b/src/Nazara/Core/AntiWindows.hpp index a333ca4a5..b855af7a3 100644 --- a/src/Nazara/Core/AntiWindows.hpp +++ b/src/Nazara/Core/AntiWindows.hpp @@ -9,5 +9,6 @@ #endif #undef CreateWindow +#undef GetEnvironmentVariable #undef MemoryBarrier #undef RemoveDirectory diff --git a/src/Nazara/Utility/Buffer.cpp b/src/Nazara/Core/Buffer.cpp similarity index 78% rename from src/Nazara/Utility/Buffer.cpp rename to src/Nazara/Core/Buffer.cpp index 5abca261f..e6fc25b29 100644 --- a/src/Nazara/Utility/Buffer.cpp +++ b/src/Nazara/Core/Buffer.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Components/NodeComponent.cpp b/src/Nazara/Core/Components/NodeComponent.cpp similarity index 85% rename from src/Nazara/Utility/Components/NodeComponent.cpp rename to src/Nazara/Core/Components/NodeComponent.cpp index b35cce205..e44aa322f 100644 --- a/src/Nazara/Utility/Components/NodeComponent.cpp +++ b/src/Nazara/Core/Components/NodeComponent.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Components/SharedSkeletonComponent.cpp b/src/Nazara/Core/Components/SharedSkeletonComponent.cpp similarity index 93% rename from src/Nazara/Utility/Components/SharedSkeletonComponent.cpp rename to src/Nazara/Core/Components/SharedSkeletonComponent.cpp index 9b68f3b00..444025893 100644 --- a/src/Nazara/Utility/Components/SharedSkeletonComponent.cpp +++ b/src/Nazara/Core/Components/SharedSkeletonComponent.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Core/Core.cpp b/src/Nazara/Core/Core.cpp index 689f1a36b..6e29fd4af 100644 --- a/src/Nazara/Core/Core.cpp +++ b/src/Nazara/Core/Core.cpp @@ -3,12 +3,29 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include #include +#include #include +#include +#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace Nz @@ -27,6 +44,34 @@ namespace Nz LogInit(); m_hardwareInfo.emplace(); + + if (!PixelFormatInfo::Initialize()) + throw std::runtime_error("failed to initialize pixel formats"); + + if (!VertexDeclaration::Initialize()) + throw std::runtime_error("failed to initialize vertex declarations"); + + // Image + m_imageLoader.RegisterLoader(Loaders::GetImageLoader_STB()); // Generic loader (STB) + m_imageSaver.RegisterSaver(Loaders::GetImageSaver_STB()); // Generic saver (STB) + + // ImageStream + m_imageStreamLoader.RegisterLoader(Loaders::GetImageStreamLoader_GIF()); // GIF loader + + /// Specialized loaders + // Animation + m_animationLoader.RegisterLoader(Loaders::GetAnimationLoader_MD5Anim()); // Loader de fichiers .md5anim (v10) + + // Mesh + m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ()); + m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD2()); // .md2 (v8) + m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD5Mesh()); // .md5mesh (v10) + m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ()); // .obj + m_meshSaver.RegisterSaver(Loaders::GetMeshSaver_OBJ()); + + // Image + m_imageLoader.RegisterLoader(Loaders::GetImageLoader_DDS()); // DDS Loader (DirectX format) + m_imageLoader.RegisterLoader(Loaders::GetImageLoader_PCX()); // .pcx loader (1, 4, 8, 24 bits) } Core::~Core() @@ -37,5 +82,65 @@ namespace Nz Log::Uninitialize(); } + AnimationLoader& Core::GetAnimationLoader() + { + return m_animationLoader; + } + + const AnimationLoader& Core::GetAnimationLoader() const + { + return m_animationLoader; + } + + ImageLoader& Core::GetImageLoader() + { + return m_imageLoader; + } + + const ImageLoader& Core::GetImageLoader() const + { + return m_imageLoader; + } + + ImageStreamLoader& Core::GetImageStreamLoader() + { + return m_imageStreamLoader; + } + + const ImageStreamLoader& Core::GetImageStreamLoader() const + { + return m_imageStreamLoader; + } + + ImageSaver& Core::GetImageSaver() + { + return m_imageSaver; + } + + const ImageSaver& Core::GetImageSaver() const + { + return m_imageSaver; + } + + MeshLoader& Core::GetMeshLoader() + { + return m_meshLoader; + } + + const MeshLoader& Core::GetMeshLoader() const + { + return m_meshLoader; + } + + MeshSaver& Core::GetMeshSaver() + { + return m_meshSaver; + } + + const MeshSaver& Core::GetMeshSaver() const + { + return m_meshSaver; + } + Core* Core::s_instance = nullptr; } diff --git a/src/Nazara/Utility/Formats/DDSConstants.cpp b/src/Nazara/Core/Formats/DDSConstants.cpp similarity index 92% rename from src/Nazara/Utility/Formats/DDSConstants.cpp rename to src/Nazara/Core/Formats/DDSConstants.cpp index 9641a1afc..3f8b4d333 100644 --- a/src/Nazara/Utility/Formats/DDSConstants.cpp +++ b/src/Nazara/Core/Formats/DDSConstants.cpp @@ -1,10 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/DDSConstants.hpp b/src/Nazara/Core/Formats/DDSConstants.hpp similarity index 95% rename from src/Nazara/Utility/Formats/DDSConstants.hpp rename to src/Nazara/Core/Formats/DDSConstants.hpp index 38d730cf8..d6395d3d6 100644 --- a/src/Nazara/Utility/Formats/DDSConstants.hpp +++ b/src/Nazara/Core/Formats/DDSConstants.hpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Cruden BV - 2020 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP -#define NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP +#ifndef NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP +#define NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP #include -#include -#include +#include +#include namespace Nz { @@ -369,9 +369,9 @@ namespace Nz UInt32 reserved; }; - NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSHeader* header); - NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSHeaderDX10Ext* header); - NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSPixelFormat* pixelFormat); + NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSHeader* header); + NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSHeaderDX10Ext* header); + NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSPixelFormat* pixelFormat); } -#endif // NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP +#endif // NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP diff --git a/src/Nazara/Utility/Formats/DDSLoader.cpp b/src/Nazara/Core/Formats/DDSLoader.cpp similarity index 96% rename from src/Nazara/Utility/Formats/DDSLoader.cpp rename to src/Nazara/Core/Formats/DDSLoader.cpp index 6589effcc..b4464893e 100644 --- a/src/Nazara/Utility/Formats/DDSLoader.cpp +++ b/src/Nazara/Core/Formats/DDSLoader.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) - 2009 Cruden BV -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/DDSLoader.hpp b/src/Nazara/Core/Formats/DDSLoader.hpp similarity index 54% rename from src/Nazara/Utility/Formats/DDSLoader.hpp rename to src/Nazara/Core/Formats/DDSLoader.hpp index 7fbe37f09..4569858f0 100644 --- a/src/Nazara/Utility/Formats/DDSLoader.hpp +++ b/src/Nazara/Core/Formats/DDSLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_DDSLOADER_HPP -#define NAZARA_UTILITY_FORMATS_DDSLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_DDSLOADER_HPP +#define NAZARA_CORE_FORMATS_DDSLOADER_HPP #include -#include +#include namespace Nz::Loaders { ImageLoader::Entry GetImageLoader_DDS(); } -#endif // NAZARA_UTILITY_FORMATS_DDSLOADER_HPP +#endif // NAZARA_CORE_FORMATS_DDSLOADER_HPP diff --git a/src/Nazara/Utility/Formats/GIFLoader.cpp b/src/Nazara/Core/Formats/GIFLoader.cpp similarity index 98% rename from src/Nazara/Utility/Formats/GIFLoader.cpp rename to src/Nazara/Core/Formats/GIFLoader.cpp index 3b9dd5d03..7761c0876 100644 --- a/src/Nazara/Utility/Formats/GIFLoader.cpp +++ b/src/Nazara/Core/Formats/GIFLoader.cpp @@ -1,17 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include +#include #include -#include -#include +#include #include #include #include -#include +#include // based on https://www.w3.org/Graphics/GIF/spec-gif89a.txt, with help from the following public domain libraries source code: // - https://github.com/lecram/gifdec diff --git a/src/Nazara/Utility/Formats/GIFLoader.hpp b/src/Nazara/Core/Formats/GIFLoader.hpp similarity index 51% rename from src/Nazara/Utility/Formats/GIFLoader.hpp rename to src/Nazara/Core/Formats/GIFLoader.hpp index 2f2115b09..3e20d4fbd 100644 --- a/src/Nazara/Utility/Formats/GIFLoader.hpp +++ b/src/Nazara/Core/Formats/GIFLoader.hpp @@ -1,19 +1,19 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_GIFLOADER_HPP -#define NAZARA_UTILITY_FORMATS_GIFLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_GIFLOADER_HPP +#define NAZARA_CORE_FORMATS_GIFLOADER_HPP #include -#include -#include +#include +#include namespace Nz::Loaders { ImageStreamLoader::Entry GetImageStreamLoader_GIF(); } -#endif // NAZARA_UTILITY_FORMATS_GIFLOADER_HPP +#endif // NAZARA_CORE_FORMATS_GIFLOADER_HPP diff --git a/src/Nazara/Utility/Formats/MD2Constants.cpp b/src/Nazara/Core/Formats/MD2Constants.cpp similarity index 98% rename from src/Nazara/Utility/Formats/MD2Constants.cpp rename to src/Nazara/Core/Formats/MD2Constants.cpp index 0c90bdb46..6d2b2f838 100644 --- a/src/Nazara/Utility/Formats/MD2Constants.cpp +++ b/src/Nazara/Core/Formats/MD2Constants.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/MD2Constants.hpp b/src/Nazara/Core/Formats/MD2Constants.hpp similarity index 89% rename from src/Nazara/Utility/Formats/MD2Constants.hpp rename to src/Nazara/Core/Formats/MD2Constants.hpp index 76d2113fe..76dc5a80d 100644 --- a/src/Nazara/Utility/Formats/MD2Constants.hpp +++ b/src/Nazara/Core/Formats/MD2Constants.hpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD2CONSTANTS_HPP -#define NAZARA_UTILITY_FORMATS_MD2CONSTANTS_HPP +#ifndef NAZARA_CORE_FORMATS_MD2CONSTANTS_HPP +#define NAZARA_CORE_FORMATS_MD2CONSTANTS_HPP #include #include @@ -66,4 +66,4 @@ namespace Nz extern const Vector3f md2Normals[162]; } -#endif // NAZARA_UTILITY_FORMATS_MD2CONSTANTS_HPP +#endif // NAZARA_CORE_FORMATS_MD2CONSTANTS_HPP diff --git a/src/Nazara/Utility/Formats/MD2Loader.cpp b/src/Nazara/Core/Formats/MD2Loader.cpp similarity index 95% rename from src/Nazara/Utility/Formats/MD2Loader.cpp rename to src/Nazara/Core/Formats/MD2Loader.cpp index 585e9f3e4..8f9978ceb 100644 --- a/src/Nazara/Utility/Formats/MD2Loader.cpp +++ b/src/Nazara/Core/Formats/MD2Loader.cpp @@ -1,21 +1,21 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include +#include +#include +#include #include +#include +#include #include -#include -#include -#include -#include -#include #include #include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/MD2Loader.hpp b/src/Nazara/Core/Formats/MD2Loader.hpp similarity index 54% rename from src/Nazara/Utility/Formats/MD2Loader.hpp rename to src/Nazara/Core/Formats/MD2Loader.hpp index 121b5383a..2a15284ca 100644 --- a/src/Nazara/Utility/Formats/MD2Loader.hpp +++ b/src/Nazara/Core/Formats/MD2Loader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD2LOADER_HPP -#define NAZARA_UTILITY_FORMATS_MD2LOADER_HPP +#ifndef NAZARA_CORE_FORMATS_MD2LOADER_HPP +#define NAZARA_CORE_FORMATS_MD2LOADER_HPP #include -#include +#include namespace Nz::Loaders { MeshLoader::Entry GetMeshLoader_MD2(); } -#endif // NAZARA_UTILITY_FORMATS_MD2LOADER_HPP +#endif // NAZARA_CORE_FORMATS_MD2LOADER_HPP diff --git a/src/Nazara/Utility/Formats/MD5AnimLoader.cpp b/src/Nazara/Core/Formats/MD5AnimLoader.cpp similarity index 92% rename from src/Nazara/Utility/Formats/MD5AnimLoader.cpp rename to src/Nazara/Core/Formats/MD5AnimLoader.cpp index 6837e6a05..10befc023 100644 --- a/src/Nazara/Utility/Formats/MD5AnimLoader.cpp +++ b/src/Nazara/Core/Formats/MD5AnimLoader.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/MD5AnimLoader.hpp b/src/Nazara/Core/Formats/MD5AnimLoader.hpp similarity index 53% rename from src/Nazara/Utility/Formats/MD5AnimLoader.hpp rename to src/Nazara/Core/Formats/MD5AnimLoader.hpp index b9abff506..02f43ea15 100644 --- a/src/Nazara/Utility/Formats/MD5AnimLoader.hpp +++ b/src/Nazara/Core/Formats/MD5AnimLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD5ANIMLOADER_HPP -#define NAZARA_UTILITY_FORMATS_MD5ANIMLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP +#define NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP #include -#include +#include namespace Nz::Loaders { AnimationLoader::Entry GetAnimationLoader_MD5Anim(); } -#endif // NAZARA_UTILITY_FORMATS_MD5ANIMLOADER_HPP +#endif // NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP diff --git a/src/Nazara/Utility/Formats/MD5AnimParser.cpp b/src/Nazara/Core/Formats/MD5AnimParser.cpp similarity index 93% rename from src/Nazara/Utility/Formats/MD5AnimParser.cpp rename to src/Nazara/Core/Formats/MD5AnimParser.cpp index bd8bf5ccc..6c81af069 100644 --- a/src/Nazara/Utility/Formats/MD5AnimParser.cpp +++ b/src/Nazara/Core/Formats/MD5AnimParser.cpp @@ -1,13 +1,14 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include +#include #include -#include #include -#include +#include namespace Nz { @@ -80,7 +81,7 @@ namespace Nz { switch (m_currentLine[0]) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING case 'M': // MD5Version if (GetWord(m_currentLine, 0) != "MD5Version") UnrecognizedLine(); @@ -104,13 +105,13 @@ namespace Nz return false; } } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif break; - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING case 'c': // commandline if (GetWord(m_currentLine, 0) != "commandline") UnrecognizedLine(); @@ -138,7 +139,7 @@ namespace Nz } else if (std::sscanf(&m_currentLine[0], "frameRate %u", &m_frameRate) != 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif } @@ -154,7 +155,7 @@ namespace Nz return false; } } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -165,7 +166,7 @@ namespace Nz unsigned int count; if (std::sscanf(&m_currentLine[0], "numAnimatedComponents %u", &count) == 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!m_animatedComponents.empty()) Warning("Animated components count is already defined"); #endif @@ -174,7 +175,7 @@ namespace Nz } else if (std::sscanf(&m_currentLine[0], "numFrames %u", &count) == 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!m_frames.empty()) Warning("Frame count is already defined"); #endif @@ -183,14 +184,14 @@ namespace Nz } else if (std::sscanf(&m_currentLine[0], "numJoints %u", &count) == 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!m_joints.empty()) Warning("Joint count is already defined"); #endif m_joints.resize(count); } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -198,7 +199,7 @@ namespace Nz } default: - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; @@ -295,7 +296,7 @@ namespace Nz if (m_currentLine != "}") { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("Bounds braces closing not found"); #endif @@ -336,7 +337,7 @@ namespace Nz if (m_currentLine != "}") { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("Bounds braces closing not found"); #endif @@ -430,7 +431,7 @@ namespace Nz if (m_currentLine != "}") { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("Hierarchy braces closing not found"); #endif @@ -493,7 +494,7 @@ namespace Nz if (m_currentLine != "}") { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("Hierarchy braces closing not found"); #endif diff --git a/src/Nazara/Utility/Formats/MD5MeshLoader.cpp b/src/Nazara/Core/Formats/MD5MeshLoader.cpp similarity index 95% rename from src/Nazara/Utility/Formats/MD5MeshLoader.cpp rename to src/Nazara/Core/Formats/MD5MeshLoader.cpp index bf972db81..40714e0a0 100644 --- a/src/Nazara/Utility/Formats/MD5MeshLoader.cpp +++ b/src/Nazara/Core/Formats/MD5MeshLoader.cpp @@ -1,20 +1,20 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/MD5MeshLoader.hpp b/src/Nazara/Core/Formats/MD5MeshLoader.hpp similarity index 53% rename from src/Nazara/Utility/Formats/MD5MeshLoader.hpp rename to src/Nazara/Core/Formats/MD5MeshLoader.hpp index 43af0777c..6d68edefb 100644 --- a/src/Nazara/Utility/Formats/MD5MeshLoader.hpp +++ b/src/Nazara/Core/Formats/MD5MeshLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_MD5MESHLOADER_HPP -#define NAZARA_UTILITY_FORMATS_MD5MESHLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP +#define NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP #include -#include +#include namespace Nz::Loaders { MeshLoader::Entry GetMeshLoader_MD5Mesh(); } -#endif // NAZARA_UTILITY_FORMATS_MD5MESHLOADER_HPP +#endif // NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP diff --git a/src/Nazara/Utility/Formats/MD5MeshParser.cpp b/src/Nazara/Core/Formats/MD5MeshParser.cpp similarity index 91% rename from src/Nazara/Utility/Formats/MD5MeshParser.cpp rename to src/Nazara/Core/Formats/MD5MeshParser.cpp index c9819087b..2ea383892 100644 --- a/src/Nazara/Utility/Formats/MD5MeshParser.cpp +++ b/src/Nazara/Core/Formats/MD5MeshParser.cpp @@ -1,14 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include +#include #include -#include #include #include -#include +#include namespace Nz { @@ -70,7 +71,7 @@ namespace Nz { switch (m_currentLine[0]) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING case 'M': // MD5Version if (!StartsWith(m_currentLine, "MD5Version ")) UnrecognizedLine(); @@ -83,7 +84,7 @@ namespace Nz #endif case 'j': // joints - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!StartsWith(m_currentLine, "joints {")) { UnrecognizedLine(); @@ -100,7 +101,7 @@ namespace Nz case 'm': // mesh { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!StartsWith(m_currentLine, "mesh {")) { UnrecognizedLine(); @@ -110,7 +111,7 @@ namespace Nz if (m_meshIndex >= m_meshes.size()) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("More meshes than registred"); #endif @@ -132,7 +133,7 @@ namespace Nz unsigned int count; if (std::sscanf(&m_currentLine[0], "numJoints %u", &count) == 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!m_joints.empty()) Warning("Joint count is already defined"); #endif @@ -141,14 +142,14 @@ namespace Nz } else if (std::sscanf(&m_currentLine[0], "numMeshes %u", &count) == 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!m_meshes.empty()) Warning("Mesh count is already defined"); #endif m_meshes.resize(count); } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -156,7 +157,7 @@ namespace Nz } default: - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; @@ -270,7 +271,7 @@ namespace Nz if (m_currentLine != "}") { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING Warning("Hierarchy braces closing not found"); #endif @@ -294,7 +295,7 @@ namespace Nz case 's': // shader { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!StartsWith(m_currentLine, "shader ")) { UnrecognizedLine(); @@ -306,7 +307,7 @@ namespace Nz shader = shader.substr(7); if (shader.empty()) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; @@ -314,7 +315,7 @@ namespace Nz if (shader.empty()) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; @@ -403,7 +404,7 @@ namespace Nz } } } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -411,7 +412,7 @@ namespace Nz } default: - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; @@ -436,7 +437,7 @@ namespace Nz return false; } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!finished) Warning("Mesh braces closing not found"); #endif diff --git a/src/Nazara/Utility/Formats/MTLParser.cpp b/src/Nazara/Core/Formats/MTLParser.cpp similarity index 90% rename from src/Nazara/Utility/Formats/MTLParser.cpp rename to src/Nazara/Core/Formats/MTLParser.cpp index 91c8332e1..13d8a32a3 100644 --- a/src/Nazara/Utility/Formats/MTLParser.cpp +++ b/src/Nazara/Core/Formats/MTLParser.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include -#include #include #include -#include +#include namespace Nz { @@ -67,7 +67,7 @@ namespace Nz currentMaterial->bumpMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -87,7 +87,7 @@ namespace Nz currentMaterial->alpha = alpha; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -102,7 +102,7 @@ namespace Nz currentMaterial->decalMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -117,7 +117,7 @@ namespace Nz currentMaterial->displacementMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -138,7 +138,7 @@ namespace Nz currentMaterial->emissiveMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -158,7 +158,7 @@ namespace Nz currentMaterial->ambient = Color(r, g, b); } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -173,7 +173,7 @@ namespace Nz currentMaterial->diffuse = Color(r, g, b); } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -188,7 +188,7 @@ namespace Nz currentMaterial->specular = Color(r, g, b); } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -209,7 +209,7 @@ namespace Nz currentMaterial->illumModel = model; } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -229,7 +229,7 @@ namespace Nz currentMaterial->ambientMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -244,7 +244,7 @@ namespace Nz currentMaterial->diffuseMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -259,7 +259,7 @@ namespace Nz currentMaterial->specularMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -274,7 +274,7 @@ namespace Nz currentMaterial->bumpMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -289,7 +289,7 @@ namespace Nz currentMaterial->alphaMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -304,7 +304,7 @@ namespace Nz currentMaterial->decalMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -319,7 +319,7 @@ namespace Nz currentMaterial->displacementMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -334,7 +334,7 @@ namespace Nz currentMaterial->reflectionMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -349,7 +349,7 @@ namespace Nz currentMaterial->normalMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -365,7 +365,7 @@ namespace Nz currentMaterial->emissiveMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -385,7 +385,7 @@ namespace Nz currentMaterial->refractionIndex = density; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -400,7 +400,7 @@ namespace Nz currentMaterial->shininess = coef; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -415,7 +415,7 @@ namespace Nz currentMaterial->normalMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -425,7 +425,7 @@ namespace Nz std::string materialName = m_currentLine.substr(offset); if (!materialName.empty()) currentMaterial = AddMaterial(materialName); -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -445,7 +445,7 @@ namespace Nz currentMaterial->reflectionMap = map; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -465,7 +465,7 @@ namespace Nz currentMaterial->alpha = 1.f - alpha; // tr vaut pour la "valeur de transparence", 0 = opaque } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING else UnrecognizedLine(); #endif @@ -474,7 +474,7 @@ namespace Nz } default: -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING UnrecognizedLine(); #endif break; diff --git a/src/Nazara/Utility/Formats/OBJLoader.cpp b/src/Nazara/Core/Formats/OBJLoader.cpp similarity index 96% rename from src/Nazara/Utility/Formats/OBJLoader.cpp rename to src/Nazara/Core/Formats/OBJLoader.cpp index 8606d0bd4..6778d6238 100644 --- a/src/Nazara/Utility/Formats/OBJLoader.cpp +++ b/src/Nazara/Core/Formats/OBJLoader.cpp @@ -1,20 +1,20 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include // TODO: Use only one index buffer / vertex buffer for all submeshes diff --git a/src/Nazara/Utility/Formats/OBJLoader.hpp b/src/Nazara/Core/Formats/OBJLoader.hpp similarity index 54% rename from src/Nazara/Utility/Formats/OBJLoader.hpp rename to src/Nazara/Core/Formats/OBJLoader.hpp index 5294d2dbd..480e13d5b 100644 --- a/src/Nazara/Utility/Formats/OBJLoader.hpp +++ b/src/Nazara/Core/Formats/OBJLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_OBJLOADER_HPP -#define NAZARA_UTILITY_FORMATS_OBJLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_OBJLOADER_HPP +#define NAZARA_CORE_FORMATS_OBJLOADER_HPP #include -#include +#include namespace Nz::Loaders { MeshLoader::Entry GetMeshLoader_OBJ(); } -#endif // NAZARA_UTILITY_FORMATS_OBJLOADER_HPP +#endif // NAZARA_CORE_FORMATS_OBJLOADER_HPP diff --git a/src/Nazara/Utility/Formats/OBJParser.cpp b/src/Nazara/Core/Formats/OBJParser.cpp similarity index 93% rename from src/Nazara/Utility/Formats/OBJParser.cpp rename to src/Nazara/Core/Formats/OBJParser.cpp index 1bfea7f87..02ff7fd2c 100644 --- a/src/Nazara/Utility/Formats/OBJParser.cpp +++ b/src/Nazara/Core/Formats/OBJParser.cpp @@ -1,17 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include -#include #include #include #include #include #include #include -#include +#include namespace Nz { @@ -169,7 +170,7 @@ namespace Nz { if (m_currentLine.size() < 7) // Since we only treat triangles, this is the minimum length of a face line (f 1 2 3) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -179,7 +180,7 @@ namespace Nz std::size_t vertexCount = std::count(m_currentLine.begin(), m_currentLine.end(), ' '); if (vertexCount < 3) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -212,7 +213,7 @@ namespace Nz { if (std::sscanf(&m_currentLine[pos], "%d%n", &p, &offset) != 1) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -301,7 +302,7 @@ namespace Nz const char prefix[] = "mtllib "; if (!StartsWith(m_currentLine, prefix)) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -318,7 +319,7 @@ namespace Nz { if (m_currentLine.size() <= 2 || m_currentLine[1] != ' ') { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -328,7 +329,7 @@ namespace Nz std::string objectName = m_currentLine.substr(2); if (objectName.empty()) { - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -340,7 +341,7 @@ namespace Nz break; } -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING case 's': //< Smooth if (m_currentLine.size() <= 2 || m_currentLine[1] == ' ') { @@ -361,7 +362,7 @@ namespace Nz const char prefix[] = "usemtl "; if (!StartsWith(m_currentLine, prefix)) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -372,7 +373,7 @@ namespace Nz std::string newMatName = m_currentLine.substr(sizeof(prefix) - 1); if (newMatName.empty()) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -388,7 +389,7 @@ namespace Nz { if (m_currentLine.size() < 7) { -#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING +#if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -401,7 +402,7 @@ namespace Nz unsigned int paramCount = std::sscanf(&m_currentLine[2], " %f %f %f %f", &vertex.x, &vertex.y, &vertex.z, &vertex.w); if (paramCount >= 1) m_positions.push_back(vertex); - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else if (!UnrecognizedLine()) return false; #endif @@ -412,7 +413,7 @@ namespace Nz unsigned int paramCount = std::sscanf(&m_currentLine[3], " %f %f %f", &normal.x, &normal.y, &normal.z); if (paramCount == 3) m_normals.push_back(normal); - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else if (!UnrecognizedLine()) return false; #endif @@ -423,12 +424,12 @@ namespace Nz unsigned int paramCount = std::sscanf(&m_currentLine[3], " %f %f %f", &uvw.x, &uvw.y, &uvw.z); if (paramCount >= 2) m_texCoords.push_back(uvw); - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else if (!UnrecognizedLine()) return false; #endif } - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING else if (!UnrecognizedLine()) return false; #endif @@ -437,7 +438,7 @@ namespace Nz } default: - #if NAZARA_UTILITY_STRICT_RESOURCE_PARSING + #if NAZARA_CORE_STRICT_RESOURCE_PARSING if (!UnrecognizedLine()) return false; #endif @@ -669,4 +670,10 @@ namespace Nz return true; } + + void OBJParser::Flush() const + { + m_currentStream->Write(std::move(m_outputStream).str()); + m_outputStream.str({}); + } } diff --git a/src/Nazara/Utility/Formats/OBJSaver.cpp b/src/Nazara/Core/Formats/OBJSaver.cpp similarity index 93% rename from src/Nazara/Utility/Formats/OBJSaver.cpp rename to src/Nazara/Core/Formats/OBJSaver.cpp index 8494f14fe..1b60b7644 100644 --- a/src/Nazara/Utility/Formats/OBJSaver.cpp +++ b/src/Nazara/Core/Formats/OBJSaver.cpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/OBJSaver.hpp b/src/Nazara/Core/Formats/OBJSaver.hpp similarity index 54% rename from src/Nazara/Utility/Formats/OBJSaver.hpp rename to src/Nazara/Core/Formats/OBJSaver.hpp index be72bac82..85c98272c 100644 --- a/src/Nazara/Utility/Formats/OBJSaver.hpp +++ b/src/Nazara/Core/Formats/OBJSaver.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_OBJSAVER_HPP -#define NAZARA_UTILITY_FORMATS_OBJSAVER_HPP +#ifndef NAZARA_CORE_FORMATS_OBJSAVER_HPP +#define NAZARA_CORE_FORMATS_OBJSAVER_HPP #include -#include +#include namespace Nz::Loaders { MeshSaver::Entry GetMeshSaver_OBJ(); } -#endif // NAZARA_UTILITY_FORMATS_OBJSAVER_HPP +#endif // NAZARA_CORE_FORMATS_OBJSAVER_HPP diff --git a/src/Nazara/Utility/Formats/PCXLoader.cpp b/src/Nazara/Core/Formats/PCXLoader.cpp similarity index 97% rename from src/Nazara/Utility/Formats/PCXLoader.cpp rename to src/Nazara/Core/Formats/PCXLoader.cpp index 183225515..a564da653 100644 --- a/src/Nazara/Utility/Formats/PCXLoader.cpp +++ b/src/Nazara/Core/Formats/PCXLoader.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include +#include #include -#include #include #include -#include +#include // Auteur du loader original : David Henry diff --git a/src/Nazara/Utility/Formats/PCXLoader.hpp b/src/Nazara/Core/Formats/PCXLoader.hpp similarity index 54% rename from src/Nazara/Utility/Formats/PCXLoader.hpp rename to src/Nazara/Core/Formats/PCXLoader.hpp index 5bd9fadf7..23396badf 100644 --- a/src/Nazara/Utility/Formats/PCXLoader.hpp +++ b/src/Nazara/Core/Formats/PCXLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_PCXLOADER_HPP -#define NAZARA_UTILITY_FORMATS_PCXLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_PCXLOADER_HPP +#define NAZARA_CORE_FORMATS_PCXLOADER_HPP #include -#include +#include namespace Nz::Loaders { ImageLoader::Entry GetImageLoader_PCX(); } -#endif // NAZARA_UTILITY_FORMATS_PCXLOADER_HPP +#endif // NAZARA_CORE_FORMATS_PCXLOADER_HPP diff --git a/src/Nazara/Utility/Formats/STBLoader.cpp b/src/Nazara/Core/Formats/STBLoader.cpp similarity index 94% rename from src/Nazara/Utility/Formats/STBLoader.cpp rename to src/Nazara/Core/Formats/STBLoader.cpp index 0c87bbb22..59986a2b5 100644 --- a/src/Nazara/Utility/Formats/STBLoader.cpp +++ b/src/Nazara/Core/Formats/STBLoader.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include +#include #include -#include #include #include #include @@ -15,7 +15,7 @@ #define STB_IMAGE_IMPLEMENTATION #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/STBLoader.hpp b/src/Nazara/Core/Formats/STBLoader.hpp similarity index 54% rename from src/Nazara/Utility/Formats/STBLoader.hpp rename to src/Nazara/Core/Formats/STBLoader.hpp index f175ab407..77c824c03 100644 --- a/src/Nazara/Utility/Formats/STBLoader.hpp +++ b/src/Nazara/Core/Formats/STBLoader.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_STBLOADER_HPP -#define NAZARA_UTILITY_FORMATS_STBLOADER_HPP +#ifndef NAZARA_CORE_FORMATS_STBLOADER_HPP +#define NAZARA_CORE_FORMATS_STBLOADER_HPP #include -#include +#include namespace Nz::Loaders { ImageLoader::Entry GetImageLoader_STB(); } -#endif // NAZARA_UTILITY_FORMATS_STBLOADER_HPP +#endif // NAZARA_CORE_FORMATS_STBLOADER_HPP diff --git a/src/Nazara/Utility/Formats/STBSaver.cpp b/src/Nazara/Core/Formats/STBSaver.cpp similarity index 96% rename from src/Nazara/Utility/Formats/STBSaver.cpp rename to src/Nazara/Core/Formats/STBSaver.cpp index 953a1fd75..bd0f2d854 100644 --- a/src/Nazara/Utility/Formats/STBSaver.cpp +++ b/src/Nazara/Core/Formats/STBSaver.cpp @@ -1,17 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include #define STB_IMAGE_WRITE_IMPLEMENTATION #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/STBSaver.hpp b/src/Nazara/Core/Formats/STBSaver.hpp similarity index 54% rename from src/Nazara/Utility/Formats/STBSaver.hpp rename to src/Nazara/Core/Formats/STBSaver.hpp index 63ae8110a..a359db6f7 100644 --- a/src/Nazara/Utility/Formats/STBSaver.hpp +++ b/src/Nazara/Core/Formats/STBSaver.hpp @@ -1,18 +1,18 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_STBSAVER_HPP -#define NAZARA_UTILITY_FORMATS_STBSAVER_HPP +#ifndef NAZARA_CORE_FORMATS_STBSAVER_HPP +#define NAZARA_CORE_FORMATS_STBSAVER_HPP #include -#include +#include namespace Nz::Loaders { ImageSaver::Entry GetImageSaver_STB(); } -#endif // NAZARA_UTILITY_FORMATS_STBSAVER_HPP +#endif // NAZARA_CORE_FORMATS_STBSAVER_HPP diff --git a/src/Nazara/Utility/GuillotineImageAtlas.cpp b/src/Nazara/Core/GuillotineImageAtlas.cpp similarity index 97% rename from src/Nazara/Utility/GuillotineImageAtlas.cpp rename to src/Nazara/Core/GuillotineImageAtlas.cpp index e67ef6f0d..bd92d8b9a 100644 --- a/src/Nazara/Utility/GuillotineImageAtlas.cpp +++ b/src/Nazara/Core/GuillotineImageAtlas.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Image.cpp b/src/Nazara/Core/Image.cpp similarity index 95% rename from src/Nazara/Utility/Image.cpp rename to src/Nazara/Core/Image.cpp index 9facebc0b..46541aa0a 100644 --- a/src/Nazara/Utility/Image.cpp +++ b/src/Nazara/Core/Image.cpp @@ -1,17 +1,17 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include #include +#include #include -#include -#include -#include #include #include -#include +#include ///TODO: Rajouter des warnings (Formats compressés avec les méthodes Copy/Update, tests taille dans Copy) ///TODO: Rendre les méthodes exception-safe (faire usage du RAII) @@ -80,7 +80,7 @@ namespace Nz bool Image::Convert(PixelFormat newFormat) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -158,7 +158,7 @@ namespace Nz NazaraAssert(source.GetFormat() == m_sharedImage->format, "image formats don't match"); const UInt8* srcPtr = source.GetConstPixels(srcBox.x, srcBox.y, srcBox.z); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!srcPtr) { NazaraError("failed to access pixels"); @@ -176,7 +176,7 @@ namespace Nz { Destroy(); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!PixelFormatInfo::IsValid(format)) { NazaraError("invalid pixel format"); @@ -296,7 +296,7 @@ namespace Nz { ///FIXME: Pourquoi cette méthode alloue une nouvelle image plutôt que de remplir l'existante ? - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -361,7 +361,7 @@ namespace Nz bool Image::Fill(const Color& color, const Boxui& box) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -427,7 +427,7 @@ namespace Nz bool Image::Fill(const Color& color, const Rectui& rect, unsigned int z) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -493,7 +493,7 @@ namespace Nz bool Image::FlipHorizontally() { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -530,7 +530,7 @@ namespace Nz bool Image::FlipVertically() { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -573,7 +573,7 @@ namespace Nz const UInt8* Image::GetConstPixels(unsigned int x, unsigned int y, unsigned int z, UInt8 level) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -588,7 +588,7 @@ namespace Nz #endif unsigned int width = GetImageLevelSize(m_sharedImage->width, level); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (x >= width) { NazaraErrorFmt("x value exceeds width ({0} >= {1})", x, width); @@ -597,7 +597,7 @@ namespace Nz #endif unsigned int height = GetImageLevelSize(m_sharedImage->height, level); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (y >= height) { NazaraErrorFmt("y value exceeds height ({0} >= {1})", y, height); @@ -617,7 +617,7 @@ namespace Nz unsigned int Image::GetDepth(UInt8 level) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (level >= m_sharedImage->levels.size()) { NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size()); @@ -635,7 +635,7 @@ namespace Nz unsigned int Image::GetHeight(UInt8 level) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (level >= m_sharedImage->levels.size()) { NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size()); @@ -690,7 +690,7 @@ namespace Nz Color Image::GetPixelColor(unsigned int x, unsigned int y, unsigned int z) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -734,7 +734,7 @@ namespace Nz UInt8* Image::GetPixels(unsigned int x, unsigned int y, unsigned int z, UInt8 level) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -749,7 +749,7 @@ namespace Nz #endif unsigned int width = GetImageLevelSize(m_sharedImage->width, level); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (x >= width) { NazaraErrorFmt("x value exceeds width ({0} >= {1})", x, width); @@ -758,7 +758,7 @@ namespace Nz #endif unsigned int height = GetImageLevelSize(m_sharedImage->height, level); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (y >= height) { NazaraErrorFmt("y value exceeds height ({0} >= {1})", y, height); @@ -786,7 +786,7 @@ namespace Nz Vector3ui Image::GetSize(UInt8 level) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (level >= m_sharedImage->levels.size()) { NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size()); @@ -804,7 +804,7 @@ namespace Nz unsigned int Image::GetWidth(UInt8 level) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (level >= m_sharedImage->levels.size()) { NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size()); @@ -874,7 +874,7 @@ namespace Nz { NazaraAssert(image.IsValid(), "invalid image"); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (atlasSize.x == 0) { NazaraError("atlas width must be over zero"); @@ -890,7 +890,7 @@ namespace Nz ImageType type = image.GetType(); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (type != ImageType::E1D && type != ImageType::E2D) { NazaraErrorFmt("image type not handled ({0:#x})", UnderlyingCast(type)); @@ -971,7 +971,7 @@ namespace Nz { NazaraAssert(image.IsValid(), "invalid image"); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE ImageType type = image.GetType(); if (type != ImageType::E2D) { @@ -1140,23 +1140,23 @@ namespace Nz bool Image::SaveToFile(const std::filesystem::path& filePath, const ImageParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageSaver().SaveToFile(*this, filePath, params); + return core->GetImageSaver().SaveToFile(*this, filePath, params); } bool Image::SaveToStream(Stream& stream, std::string_view format, const ImageParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageSaver().SaveToStream(*this, stream, format, params); + return core->GetImageSaver().SaveToStream(*this, stream, format, params); } void Image::SetLevelCount(UInt8 levelCount) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("Image must be valid"); @@ -1187,7 +1187,7 @@ namespace Nz bool Image::SetPixelColor(const Color& color, unsigned int x, unsigned int y, unsigned int z) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -1233,7 +1233,7 @@ namespace Nz bool Image::Update(const void* pixels, const Boxui& box, unsigned int srcWidth, unsigned int srcHeight, UInt8 level) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (m_sharedImage == &emptyImage) { NazaraError("image must be valid"); @@ -1256,7 +1256,7 @@ namespace Nz unsigned int width = GetImageLevelSize(m_sharedImage->width, level); unsigned int height = GetImageLevelSize(m_sharedImage->height, level); - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!box.IsValid()) { NazaraError("invalid box"); @@ -1298,7 +1298,7 @@ namespace Nz void Image::Copy(UInt8* destination, const UInt8* source, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth, unsigned int dstWidth, unsigned int dstHeight, unsigned int srcWidth, unsigned int srcHeight) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (width == 0) NazaraError("width must be greater than zero"); if (height == 0) @@ -1378,26 +1378,26 @@ namespace Nz std::shared_ptr Image::LoadFromFile(const std::filesystem::path& filePath, const ImageParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageLoader().LoadFromFile(filePath, params); + return core->GetImageLoader().LoadFromFile(filePath, params); } std::shared_ptr Image::LoadFromMemory(const void* data, std::size_t size, const ImageParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageLoader().LoadFromMemory(data, size, params); + return core->GetImageLoader().LoadFromMemory(data, size, params); } std::shared_ptr Image::LoadFromStream(Stream& stream, const ImageParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageLoader().LoadFromStream(stream, params); + return core->GetImageLoader().LoadFromStream(stream, params); } void Image::EnsureOwnership() diff --git a/src/Nazara/Utility/ImageStream.cpp b/src/Nazara/Core/ImageStream.cpp similarity index 66% rename from src/Nazara/Utility/ImageStream.cpp rename to src/Nazara/Core/ImageStream.cpp index bcf0613c3..44123f57d 100644 --- a/src/Nazara/Utility/ImageStream.cpp +++ b/src/Nazara/Core/ImageStream.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { @@ -26,10 +26,10 @@ namespace Nz */ std::shared_ptr ImageStream::OpenFromFile(const std::filesystem::path& filePath, const ImageStreamParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageStreamLoader().LoadFromFile(filePath, params); + return core->GetImageStreamLoader().LoadFromFile(filePath, params); } /*! @@ -44,10 +44,10 @@ namespace Nz */ std::shared_ptr ImageStream::OpenFromMemory(const void* data, std::size_t size, const ImageStreamParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageStreamLoader().LoadFromMemory(data, size, params); + return core->GetImageStreamLoader().LoadFromMemory(data, size, params); } /*! @@ -61,9 +61,9 @@ namespace Nz */ std::shared_ptr ImageStream::OpenFromStream(Stream& stream, const ImageStreamParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetImageStreamLoader().LoadFromStream(stream, params); + return core->GetImageStreamLoader().LoadFromStream(stream, params); } } diff --git a/src/Nazara/Utility/IndexBuffer.cpp b/src/Nazara/Core/IndexBuffer.cpp similarity index 90% rename from src/Nazara/Utility/IndexBuffer.cpp rename to src/Nazara/Core/IndexBuffer.cpp index 959f18870..563b2519e 100644 --- a/src/Nazara/Utility/IndexBuffer.cpp +++ b/src/Nazara/Core/IndexBuffer.cpp @@ -1,15 +1,15 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/IndexMapper.cpp b/src/Nazara/Core/IndexMapper.cpp similarity index 92% rename from src/Nazara/Utility/IndexMapper.cpp rename to src/Nazara/Core/IndexMapper.cpp index 2d7354679..52b77fee3 100644 --- a/src/Nazara/Utility/IndexMapper.cpp +++ b/src/Nazara/Core/IndexMapper.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Joint.cpp b/src/Nazara/Core/Joint.cpp similarity index 69% rename from src/Nazara/Utility/Joint.cpp rename to src/Nazara/Core/Joint.cpp index 87c3469d8..52f85d069 100644 --- a/src/Nazara/Utility/Joint.cpp +++ b/src/Nazara/Core/Joint.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Mesh.cpp b/src/Nazara/Core/Mesh.cpp similarity index 93% rename from src/Nazara/Utility/Mesh.cpp rename to src/Nazara/Core/Mesh.cpp index e5a1a7b7a..6597a70e4 100644 --- a/src/Nazara/Utility/Mesh.cpp +++ b/src/Nazara/Core/Mesh.cpp @@ -1,25 +1,25 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include +#include +#include #include #include +#include #include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include #include #include -#include +#include namespace Nz { @@ -545,18 +545,18 @@ namespace Nz bool Mesh::SaveToFile(const std::filesystem::path& filePath, const MeshParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetMeshSaver().SaveToFile(*this, filePath, params); + return core->GetMeshSaver().SaveToFile(*this, filePath, params); } bool Mesh::SaveToStream(Stream& stream, std::string_view format, const MeshParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetMeshSaver().SaveToStream(*this, stream, format, params); + return core->GetMeshSaver().SaveToStream(*this, stream, format, params); } void Mesh::SetAnimation(const std::filesystem::path& animationPath) @@ -623,25 +623,25 @@ namespace Nz std::shared_ptr Mesh::LoadFromFile(const std::filesystem::path& filePath, const MeshParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetMeshLoader().LoadFromFile(filePath, params); + return core->GetMeshLoader().LoadFromFile(filePath, params); } std::shared_ptr Mesh::LoadFromMemory(const void* data, std::size_t size, const MeshParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetMeshLoader().LoadFromMemory(data, size, params); + return core->GetMeshLoader().LoadFromMemory(data, size, params); } std::shared_ptr Mesh::LoadFromStream(Stream& stream, const MeshParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + Core* core = Core::Instance(); + NazaraAssert(core, "Core module has not been initialized"); - return utility->GetMeshLoader().LoadFromStream(stream, params); + return core->GetMeshLoader().LoadFromStream(stream, params); } } diff --git a/src/Nazara/Utility/Node.cpp b/src/Nazara/Core/Node.cpp similarity index 97% rename from src/Nazara/Utility/Node.cpp rename to src/Nazara/Core/Node.cpp index e0f683c16..ab93f82a7 100644 --- a/src/Nazara/Utility/Node.cpp +++ b/src/Nazara/Core/Node.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { @@ -22,11 +22,6 @@ namespace Nz SetParent(nullptr); } - NodeType Node::GetNodeType() const - { - return NodeType::Default; - } - Node& Node::Interpolate(const Node& nodeA, const Node& nodeB, float interpolation, CoordSys coordSys, Invalidation invalidation) { switch (coordSys) @@ -106,7 +101,7 @@ namespace Nz void Node::SetParent(const Node* node, bool keepDerived, Invalidation invalidation) { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE // On vérifie que le node n'est pas son propre parent const Node* parentNode = node; while (parentNode) diff --git a/src/Nazara/Utility/PixelFormat.cpp b/src/Nazara/Core/PixelFormat.cpp similarity index 99% rename from src/Nazara/Utility/PixelFormat.cpp rename to src/Nazara/Core/PixelFormat.cpp index ea4d4127d..7a5f51bca 100644 --- a/src/Nazara/Utility/PixelFormat.cpp +++ b/src/Nazara/Core/PixelFormat.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include #include -#include +#include namespace Nz { @@ -1413,7 +1413,7 @@ namespace Nz { // Flipping générique - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (IsCompressed(format)) { NazaraError("no function to flip compressed format"); diff --git a/src/Nazara/Core/Posix/FileImpl.cpp b/src/Nazara/Core/Posix/FileImpl.cpp index 42e0275c6..59fc10794 100644 --- a/src/Nazara/Core/Posix/FileImpl.cpp +++ b/src/Nazara/Core/Posix/FileImpl.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include diff --git a/src/Nazara/Core/SerializationContext.cpp b/src/Nazara/Core/Serialization.cpp similarity index 90% rename from src/Nazara/Core/SerializationContext.cpp rename to src/Nazara/Core/Serialization.cpp index 03ea1abf0..4cf641583 100644 --- a/src/Nazara/Core/SerializationContext.cpp +++ b/src/Nazara/Core/Serialization.cpp @@ -2,8 +2,7 @@ // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include #include #include diff --git a/src/Nazara/Utility/SkeletalMesh.cpp b/src/Nazara/Core/SkeletalMesh.cpp similarity index 87% rename from src/Nazara/Utility/SkeletalMesh.cpp rename to src/Nazara/Core/SkeletalMesh.cpp index d3dc16d25..9137ce427 100644 --- a/src/Nazara/Utility/SkeletalMesh.cpp +++ b/src/Nazara/Core/SkeletalMesh.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Skeleton.cpp b/src/Nazara/Core/Skeleton.cpp similarity index 97% rename from src/Nazara/Utility/Skeleton.cpp rename to src/Nazara/Core/Skeleton.cpp index aa7547915..fe6d1fc52 100644 --- a/src/Nazara/Utility/Skeleton.cpp +++ b/src/Nazara/Core/Skeleton.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/SoftwareBuffer.cpp b/src/Nazara/Core/SoftwareBuffer.cpp similarity index 91% rename from src/Nazara/Utility/SoftwareBuffer.cpp rename to src/Nazara/Core/SoftwareBuffer.cpp index bf544b355..97d5763f3 100644 --- a/src/Nazara/Utility/SoftwareBuffer.cpp +++ b/src/Nazara/Core/SoftwareBuffer.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/StaticMesh.cpp b/src/Nazara/Core/StaticMesh.cpp similarity index 90% rename from src/Nazara/Utility/StaticMesh.cpp rename to src/Nazara/Core/StaticMesh.cpp index afe4c9a41..a0a28b32c 100644 --- a/src/Nazara/Utility/StaticMesh.cpp +++ b/src/Nazara/Core/StaticMesh.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include -#include -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Core/StdLogger.cpp b/src/Nazara/Core/StdLogger.cpp index 73fa6d77e..2412ff520 100644 --- a/src/Nazara/Core/StdLogger.cpp +++ b/src/Nazara/Core/StdLogger.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include diff --git a/src/Nazara/Core/StringExt.cpp b/src/Nazara/Core/StringExt.cpp index 29013b953..bf88ca353 100644 --- a/src/Nazara/Core/StringExt.cpp +++ b/src/Nazara/Core/StringExt.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include +#include #include #include diff --git a/src/Nazara/Utility/SubMesh.cpp b/src/Nazara/Core/SubMesh.cpp similarity index 95% rename from src/Nazara/Utility/SubMesh.cpp rename to src/Nazara/Core/SubMesh.cpp index cad26d194..bc088dd81 100644 --- a/src/Nazara/Utility/SubMesh.cpp +++ b/src/Nazara/Core/SubMesh.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Systems/SkeletonSystem.cpp b/src/Nazara/Core/Systems/SkeletonSystem.cpp similarity index 85% rename from src/Nazara/Utility/Systems/SkeletonSystem.cpp rename to src/Nazara/Core/Systems/SkeletonSystem.cpp index 5be3a3982..4c5250d90 100644 --- a/src/Nazara/Utility/Systems/SkeletonSystem.cpp +++ b/src/Nazara/Core/Systems/SkeletonSystem.cpp @@ -1,13 +1,13 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Systems/VelocitySystem.cpp b/src/Nazara/Core/Systems/VelocitySystem.cpp similarity index 69% rename from src/Nazara/Utility/Systems/VelocitySystem.cpp rename to src/Nazara/Core/Systems/VelocitySystem.cpp index 9773329ad..b7513b05a 100644 --- a/src/Nazara/Utility/Systems/VelocitySystem.cpp +++ b/src/Nazara/Core/Systems/VelocitySystem.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/TriangleIterator.cpp b/src/Nazara/Core/TriangleIterator.cpp similarity index 91% rename from src/Nazara/Utility/TriangleIterator.cpp rename to src/Nazara/Core/TriangleIterator.cpp index 4df23fcf4..ca401c2ff 100644 --- a/src/Nazara/Utility/TriangleIterator.cpp +++ b/src/Nazara/Core/TriangleIterator.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include -#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/UniformBuffer.cpp b/src/Nazara/Core/UniformBuffer.cpp similarity index 91% rename from src/Nazara/Utility/UniformBuffer.cpp rename to src/Nazara/Core/UniformBuffer.cpp index 635c49799..7da2d9a46 100644 --- a/src/Nazara/Utility/UniformBuffer.cpp +++ b/src/Nazara/Core/UniformBuffer.cpp @@ -1,12 +1,12 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include #include -#include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/VertexBuffer.cpp b/src/Nazara/Core/VertexBuffer.cpp similarity index 96% rename from src/Nazara/Utility/VertexBuffer.cpp rename to src/Nazara/Core/VertexBuffer.cpp index 3b29784da..60aca00ea 100644 --- a/src/Nazara/Utility/VertexBuffer.cpp +++ b/src/Nazara/Core/VertexBuffer.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/VertexDeclaration.cpp b/src/Nazara/Core/VertexDeclaration.cpp similarity index 97% rename from src/Nazara/Utility/VertexDeclaration.cpp rename to src/Nazara/Core/VertexDeclaration.cpp index c8cc0c69c..13c6e3276 100644 --- a/src/Nazara/Utility/VertexDeclaration.cpp +++ b/src/Nazara/Core/VertexDeclaration.cpp @@ -1,16 +1,16 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include #include +#include #include -#include -#include -#include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/VertexMapper.cpp b/src/Nazara/Core/VertexMapper.cpp similarity index 79% rename from src/Nazara/Utility/VertexMapper.cpp rename to src/Nazara/Core/VertexMapper.cpp index 8ad03aee9..3f2745e38 100644 --- a/src/Nazara/Utility/VertexMapper.cpp +++ b/src/Nazara/Core/VertexMapper.cpp @@ -1,14 +1,14 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace Nz { diff --git a/src/Nazara/Graphics/Formats/ModelMeshLoader.cpp b/src/Nazara/Graphics/Formats/ModelMeshLoader.cpp index bb7b64aa2..8ac87d6b2 100644 --- a/src/Nazara/Graphics/Formats/ModelMeshLoader.cpp +++ b/src/Nazara/Graphics/Formats/ModelMeshLoader.cpp @@ -3,11 +3,11 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include #include -#include -#include #include namespace Nz::Loaders @@ -17,7 +17,7 @@ namespace Nz::Loaders ModelLoader::Entry loaderEntry; loaderEntry.extensionSupport = [](std::string_view extension) { - return Utility::Instance()->GetMeshLoader().IsExtensionSupported(extension); + return Core::Instance()->GetMeshLoader().IsExtensionSupported(extension); }; loaderEntry.streamLoader = [](Stream& stream, const ModelParams& parameters) -> Result, ResourceLoadingError> diff --git a/src/Nazara/Graphics/Formats/TextureLoader.cpp b/src/Nazara/Graphics/Formats/TextureLoader.cpp index 6da60243f..a53d5b0be 100644 --- a/src/Nazara/Graphics/Formats/TextureLoader.cpp +++ b/src/Nazara/Graphics/Formats/TextureLoader.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include -#include -#include #include namespace Nz @@ -18,7 +18,7 @@ namespace Nz MaterialInstanceLoader::Entry loaderEntry; loaderEntry.extensionSupport = [](std::string_view extension) { - return Utility::Instance()->GetImageLoader().IsExtensionSupported(extension); + return Core::Instance()->GetImageLoader().IsExtensionSupported(extension); }; loaderEntry.streamLoader = [](Stream& stream, const MaterialInstanceParams& parameters) -> Result, ResourceLoadingError> diff --git a/src/Nazara/Graphics/FrameGraph.cpp b/src/Nazara/Graphics/FrameGraph.cpp index ca45d1b54..a58451782 100644 --- a/src/Nazara/Graphics/FrameGraph.cpp +++ b/src/Nazara/Graphics/FrameGraph.cpp @@ -6,8 +6,8 @@ // https://themaister.net/blog/2017/08/15/render-graphs-and-vulkan-a-deep-dive/ #include -#include #include +#include #include #include #include diff --git a/src/Nazara/Graphics/GraphicalMesh.cpp b/src/Nazara/Graphics/GraphicalMesh.cpp index 6a435024c..84efe4cf0 100644 --- a/src/Nazara/Graphics/GraphicalMesh.cpp +++ b/src/Nazara/Graphics/GraphicalMesh.cpp @@ -3,9 +3,9 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include -#include -#include #include #include diff --git a/src/Nazara/Graphics/Graphics.cpp b/src/Nazara/Graphics/Graphics.cpp index 232ed620c..48ca14ba3 100644 --- a/src/Nazara/Graphics/Graphics.cpp +++ b/src/Nazara/Graphics/Graphics.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Nazara/Graphics/MaterialInstance.cpp b/src/Nazara/Graphics/MaterialInstance.cpp index 83b7bc994..73eb1ca1a 100644 --- a/src/Nazara/Graphics/MaterialInstance.cpp +++ b/src/Nazara/Graphics/MaterialInstance.cpp @@ -3,6 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include namespace Nz @@ -451,7 +451,7 @@ namespace Nz std::shared_ptr MaterialInstance::GetDefault(MaterialType materialType, MaterialInstancePreset preset) { Graphics* graphics = Graphics::Instance(); - NazaraAssert(graphics, "Utility module has not been initialized"); + NazaraAssert(graphics, "Core module has not been initialized"); return graphics->GetDefaultMaterials().materials[materialType].presets[preset]; } @@ -459,7 +459,7 @@ namespace Nz std::shared_ptr MaterialInstance::LoadFromFile(const std::filesystem::path& filePath, const MaterialInstanceParams& params) { Graphics* graphics = Graphics::Instance(); - NazaraAssert(graphics, "Utility module has not been initialized"); + NazaraAssert(graphics, "Core module has not been initialized"); return graphics->GetMaterialInstanceLoader().LoadFromFile(filePath, params); } @@ -467,7 +467,7 @@ namespace Nz std::shared_ptr MaterialInstance::LoadFromMemory(const void* data, std::size_t size, const MaterialInstanceParams& params) { Graphics* graphics = Graphics::Instance(); - NazaraAssert(graphics, "Utility module has not been initialized"); + NazaraAssert(graphics, "Core module has not been initialized"); return graphics->GetMaterialInstanceLoader().LoadFromMemory(data, size, params); } @@ -475,7 +475,7 @@ namespace Nz std::shared_ptr MaterialInstance::LoadFromStream(Stream& stream, const MaterialInstanceParams& params) { Graphics* graphics = Graphics::Instance(); - NazaraAssert(graphics, "Utility module has not been initialized"); + NazaraAssert(graphics, "Core module has not been initialized"); return graphics->GetMaterialInstanceLoader().LoadFromStream(stream, params); } diff --git a/src/Nazara/Graphics/SkeletonInstance.cpp b/src/Nazara/Graphics/SkeletonInstance.cpp index 608069ba1..b2e10c4c1 100644 --- a/src/Nazara/Graphics/SkeletonInstance.cpp +++ b/src/Nazara/Graphics/SkeletonInstance.cpp @@ -4,12 +4,12 @@ #include #include +#include #include #include #include #include #include -#include #include namespace Nz diff --git a/src/Nazara/Graphics/Systems/RenderSystem.cpp b/src/Nazara/Graphics/Systems/RenderSystem.cpp index 5c16b2ccd..576d95e02 100644 --- a/src/Nazara/Graphics/Systems/RenderSystem.cpp +++ b/src/Nazara/Graphics/Systems/RenderSystem.cpp @@ -4,6 +4,9 @@ #include #include +#include +#include +#include #include #include #include @@ -13,9 +16,6 @@ #include #include #include -#include -#include -#include #include namespace Nz diff --git a/src/Nazara/Graphics/TextSprite.cpp b/src/Nazara/Graphics/TextSprite.cpp index a82491808..3c4dc83f3 100644 --- a/src/Nazara/Graphics/TextSprite.cpp +++ b/src/Nazara/Graphics/TextSprite.cpp @@ -7,7 +7,8 @@ #include #include #include -#include +#include +#include #include #include diff --git a/src/Nazara/Network/AbstractSocket.cpp b/src/Nazara/Network/AbstractSocket.cpp index 3ce39643c..1c25ad41e 100644 --- a/src/Nazara/Network/AbstractSocket.cpp +++ b/src/Nazara/Network/AbstractSocket.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include diff --git a/src/Nazara/Network/IpAddress.cpp b/src/Nazara/Network/IpAddress.cpp index 94dd7756d..59ddd5443 100644 --- a/src/Nazara/Network/IpAddress.cpp +++ b/src/Nazara/Network/IpAddress.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include diff --git a/src/Nazara/Network/Posix/IpAddressImpl.cpp b/src/Nazara/Network/Posix/IpAddressImpl.cpp index 23e013819..bd577767b 100644 --- a/src/Nazara/Network/Posix/IpAddressImpl.cpp +++ b/src/Nazara/Network/Posix/IpAddressImpl.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include +#include #include #include #include diff --git a/src/Nazara/Network/Posix/SocketImpl.cpp b/src/Nazara/Network/Posix/SocketImpl.cpp index 4501d7b83..14ee65684 100644 --- a/src/Nazara/Network/Posix/SocketImpl.cpp +++ b/src/Nazara/Network/Posix/SocketImpl.cpp @@ -3,12 +3,12 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/src/Nazara/Network/SocketPoller.cpp b/src/Nazara/Network/SocketPoller.cpp index 6ac5e00c2..997dae9c9 100644 --- a/src/Nazara/Network/SocketPoller.cpp +++ b/src/Nazara/Network/SocketPoller.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include +#include #if defined(NAZARA_PLATFORM_WINDOWS) #include diff --git a/src/Nazara/Network/Win32/IpAddressImpl.cpp b/src/Nazara/Network/Win32/IpAddressImpl.cpp index 1090a3cac..b851935ad 100644 --- a/src/Nazara/Network/Win32/IpAddressImpl.cpp +++ b/src/Nazara/Network/Win32/IpAddressImpl.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include +#include #include #include #include diff --git a/src/Nazara/Network/Win32/SocketImpl.cpp b/src/Nazara/Network/Win32/SocketImpl.cpp index d9709a42f..cc76c2474 100644 --- a/src/Nazara/Network/Win32/SocketImpl.cpp +++ b/src/Nazara/Network/Win32/SocketImpl.cpp @@ -3,11 +3,11 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include #include +#include #include #include @@ -975,7 +975,7 @@ namespace Nz case WSAEALREADY: case WSAEISCONN: case WSAEWOULDBLOCK: - NazaraWarning("Internal error occurred: " + Error::GetLastSystemError(error) + " (" + NumberToString(error) + ')'); + NazaraWarningFmt("Internal error occurred: {0} ({1:#x})", Error::GetLastSystemError(error), error); return SocketError::Internal; case WSAEADDRNOTAVAIL: @@ -1020,7 +1020,7 @@ namespace Nz return SocketError::TimedOut; } - NazaraWarning("Unhandled WinSock error: " + Error::GetLastSystemError(error) + " (" + NumberToString(error) + ')'); + NazaraWarningFmt("Unhandled WinSock error: {0} ({1:#x})", Error::GetLastSystemError(error), error); return SocketError::Unknown; } diff --git a/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp b/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp index c51654551..33737fe57 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLShaderBinding.cpp @@ -3,11 +3,11 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include #include +#include #include #include @@ -15,7 +15,7 @@ namespace Nz { void OpenGLShaderBinding::Apply(const OpenGLRenderPipelineLayout& pipelineLayout, UInt32 setIndex, const GL::Context& context) const { - //TODO: Check layout compaitiblity + //TODO: Check layout compatibility const auto& bindingMapping = pipelineLayout.GetBindingMapping(); const auto& layoutInfo = pipelineLayout.GetLayoutInfo(); diff --git a/src/Nazara/OpenGLRenderer/OpenGLTexture.cpp b/src/Nazara/OpenGLRenderer/OpenGLTexture.cpp index bc4bb8e23..1e82616eb 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLTexture.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLTexture.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include #include #include diff --git a/src/Nazara/Physics2D/Systems/ChipmunkPhysics2DSystem.cpp b/src/Nazara/Physics2D/Systems/ChipmunkPhysics2DSystem.cpp index ca00291b8..07d214ee6 100644 --- a/src/Nazara/Physics2D/Systems/ChipmunkPhysics2DSystem.cpp +++ b/src/Nazara/Physics2D/Systems/ChipmunkPhysics2DSystem.cpp @@ -3,8 +3,8 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include -#include #include namespace Nz diff --git a/src/Nazara/Physics3D/Collider3D.cpp b/src/Nazara/Physics3D/Collider3D.cpp index 4c4d060f0..9e84e055a 100644 --- a/src/Nazara/Physics3D/Collider3D.cpp +++ b/src/Nazara/Physics3D/Collider3D.cpp @@ -3,13 +3,13 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include +#include +#include +#include #include -#include -#include -#include -#include -#include #include #include #include diff --git a/src/Nazara/Physics3D/Systems/Physics3DSystem.cpp b/src/Nazara/Physics3D/Systems/Physics3DSystem.cpp index fc4077561..736d436a7 100644 --- a/src/Nazara/Physics3D/Systems/Physics3DSystem.cpp +++ b/src/Nazara/Physics3D/Systems/Physics3DSystem.cpp @@ -4,8 +4,8 @@ #include #include +#include #include -#include #include namespace Nz diff --git a/src/Nazara/Platform/SDL2/CursorImpl.cpp b/src/Nazara/Platform/SDL2/CursorImpl.cpp index b7ae91a77..99b79c71a 100644 --- a/src/Nazara/Platform/SDL2/CursorImpl.cpp +++ b/src/Nazara/Platform/SDL2/CursorImpl.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include diff --git a/src/Nazara/Platform/SDL2/CursorImpl.hpp b/src/Nazara/Platform/SDL2/CursorImpl.hpp index 4081c162c..d82c84d50 100644 --- a/src/Nazara/Platform/SDL2/CursorImpl.hpp +++ b/src/Nazara/Platform/SDL2/CursorImpl.hpp @@ -8,9 +8,9 @@ #define NAZARA_PLATFORM_SDL2_CURSORIMPL_HPP #include +#include #include #include -#include #include #include diff --git a/src/Nazara/Platform/SDL2/IconImpl.cpp b/src/Nazara/Platform/SDL2/IconImpl.cpp index 1ce37c374..30ca36a2e 100644 --- a/src/Nazara/Platform/SDL2/IconImpl.cpp +++ b/src/Nazara/Platform/SDL2/IconImpl.cpp @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include namespace Nz diff --git a/src/Nazara/Platform/SDL2/IconImpl.hpp b/src/Nazara/Platform/SDL2/IconImpl.hpp index dc33b043f..aa00b5635 100644 --- a/src/Nazara/Platform/SDL2/IconImpl.hpp +++ b/src/Nazara/Platform/SDL2/IconImpl.hpp @@ -8,7 +8,7 @@ #define NAZARA_PLATFORM_SDL2_ICONIMPL_HPP #include -#include +#include #include #include diff --git a/src/Nazara/Platform/SDL2/WindowImpl.cpp b/src/Nazara/Platform/SDL2/WindowImpl.cpp index 4fdc695fa..56c2d87a6 100644 --- a/src/Nazara/Platform/SDL2/WindowImpl.cpp +++ b/src/Nazara/Platform/SDL2/WindowImpl.cpp @@ -5,13 +5,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #ifdef NAZARA_PLATFORM_MACOS diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index 5c51a6876..61ed4e964 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -3,13 +3,13 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include #include #include #include -#include -#include #include #include #include diff --git a/src/Nazara/Renderer/Texture.cpp b/src/Nazara/Renderer/Texture.cpp index f5dfe2314..2165821fb 100644 --- a/src/Nazara/Renderer/Texture.cpp +++ b/src/Nazara/Renderer/Texture.cpp @@ -4,8 +4,8 @@ #include #include +#include #include -#include #include namespace Nz diff --git a/src/Nazara/Utility/AbstractTextDrawer.cpp b/src/Nazara/TextRenderer/AbstractTextDrawer.cpp similarity index 58% rename from src/Nazara/Utility/AbstractTextDrawer.cpp rename to src/Nazara/TextRenderer/AbstractTextDrawer.cpp index a40e3d631..b59b12f97 100644 --- a/src/Nazara/Utility/AbstractTextDrawer.cpp +++ b/src/Nazara/TextRenderer/AbstractTextDrawer.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Font.cpp b/src/Nazara/TextRenderer/Font.cpp similarity index 91% rename from src/Nazara/Utility/Font.cpp rename to src/Nazara/TextRenderer/Font.cpp index 91f285592..7b7ef3f83 100644 --- a/src/Nazara/Utility/Font.cpp +++ b/src/Nazara/TextRenderer/Font.cpp @@ -1,22 +1,22 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace Nz { namespace { const UInt8 r_sansationRegular[] = { - #include + #include }; } @@ -106,7 +106,7 @@ namespace Nz bool Font::ExtractGlyph(unsigned int characterSize, char32_t character, TextStyleFlags style, float outlineThickness, FontGlyph* glyph) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!IsValid()) { NazaraError("invalid font"); @@ -143,7 +143,7 @@ namespace Nz std::string Font::GetFamilyName() const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!IsValid()) { NazaraError("invalid font"); @@ -156,7 +156,7 @@ namespace Nz int Font::GetKerning(unsigned int characterSize, char32_t first, char32_t second) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!IsValid()) { NazaraError("invalid font"); @@ -199,7 +199,7 @@ namespace Nz const Font::SizeInfo& Font::GetSizeInfo(unsigned int characterSize) const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!IsValid()) { NazaraError("invalid font"); @@ -234,7 +234,7 @@ namespace Nz std::string Font::GetStyleName() const { - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!IsValid()) { NazaraError("invalid font"); @@ -349,26 +349,26 @@ namespace Nz std::shared_ptr Font::OpenFromFile(const std::filesystem::path& filePath, const FontParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + TextRenderer* textRenderer = TextRenderer::Instance(); + NazaraAssert(textRenderer, "TextRenderer module has not been initialized"); - return utility->GetFontLoader().LoadFromFile(filePath, params); + return textRenderer->GetFontLoader().LoadFromFile(filePath, params); } std::shared_ptr Font::OpenFromMemory(const void* data, std::size_t size, const FontParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + TextRenderer* textRenderer = TextRenderer::Instance(); + NazaraAssert(textRenderer, "TextRenderer module has not been initialized"); - return utility->GetFontLoader().LoadFromMemory(data, size, params); + return textRenderer->GetFontLoader().LoadFromMemory(data, size, params); } std::shared_ptr Font::OpenFromStream(Stream& stream, const FontParams& params) { - Utility* utility = Utility::Instance(); - NazaraAssert(utility, "Utility module has not been initialized"); + TextRenderer* textRenderer = TextRenderer::Instance(); + NazaraAssert(textRenderer, "TextRenderer module has not been initialized"); - return utility->GetFontLoader().LoadFromStream(stream, params); + return textRenderer->GetFontLoader().LoadFromStream(stream, params); } void Font::SetDefaultAtlas(std::shared_ptr atlas) @@ -452,7 +452,7 @@ namespace Nz Glyph& glyph = glyphMap[character]; //< Insert a new glyph glyph.valid = false; - #if NAZARA_UTILITY_SAFE + #if NAZARA_CORE_SAFE if (!m_atlas) { NazaraError("font has no atlas"); diff --git a/src/Nazara/Utility/FontData.cpp b/src/Nazara/TextRenderer/FontData.cpp similarity index 58% rename from src/Nazara/Utility/FontData.cpp rename to src/Nazara/TextRenderer/FontData.cpp index 66a132612..266a4978b 100644 --- a/src/Nazara/Utility/FontData.cpp +++ b/src/Nazara/TextRenderer/FontData.cpp @@ -1,9 +1,9 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include -#include +#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/FreeTypeLoader.cpp b/src/Nazara/TextRenderer/Formats/FreeTypeLoader.cpp similarity index 98% rename from src/Nazara/Utility/Formats/FreeTypeLoader.cpp rename to src/Nazara/TextRenderer/Formats/FreeTypeLoader.cpp index c2181f581..4acce879c 100644 --- a/src/Nazara/Utility/Formats/FreeTypeLoader.cpp +++ b/src/Nazara/TextRenderer/Formats/FreeTypeLoader.cpp @@ -1,25 +1,25 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) - 2009 Cruden BV -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include FT_FREETYPE_H #include FT_BITMAP_H #include FT_STROKER_H #include FT_OUTLINE_H -#include -#include -#include -#include -#include -#include -#include #include #include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/Formats/FreeTypeLoader.hpp b/src/Nazara/TextRenderer/Formats/FreeTypeLoader.hpp similarity index 55% rename from src/Nazara/Utility/Formats/FreeTypeLoader.hpp rename to src/Nazara/TextRenderer/Formats/FreeTypeLoader.hpp index fd3ab59f7..8de799912 100644 --- a/src/Nazara/Utility/Formats/FreeTypeLoader.hpp +++ b/src/Nazara/TextRenderer/Formats/FreeTypeLoader.hpp @@ -1,14 +1,14 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once -#ifndef NAZARA_UTILITY_FORMATS_FREETYPELOADER_HPP -#define NAZARA_UTILITY_FORMATS_FREETYPELOADER_HPP +#ifndef NAZARA_TEXTRENDERER_FORMATS_FREETYPELOADER_HPP +#define NAZARA_TEXTRENDERER_FORMATS_FREETYPELOADER_HPP #include -#include +#include namespace Nz::Loaders { @@ -17,4 +17,4 @@ namespace Nz::Loaders void UninitializeFreeType(); } -#endif // NAZARA_UTILITY_FORMATS_FREETYPELOADER_HPP +#endif // NAZARA_TEXTRENDERER_FORMATS_FREETYPELOADER_HPP diff --git a/src/Nazara/Utility/Resources/Fonts/OpenSans-Regular.ttf b/src/Nazara/TextRenderer/Resources/Fonts/OpenSans-Regular.ttf similarity index 100% rename from src/Nazara/Utility/Resources/Fonts/OpenSans-Regular.ttf rename to src/Nazara/TextRenderer/Resources/Fonts/OpenSans-Regular.ttf diff --git a/src/Nazara/Utility/RichTextDrawer.cpp b/src/Nazara/TextRenderer/RichTextDrawer.cpp similarity index 99% rename from src/Nazara/Utility/RichTextDrawer.cpp rename to src/Nazara/TextRenderer/RichTextDrawer.cpp index 78ee08417..1c5cea80b 100644 --- a/src/Nazara/Utility/RichTextDrawer.cpp +++ b/src/Nazara/TextRenderer/RichTextDrawer.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/Utility/SimpleTextDrawer.cpp b/src/Nazara/TextRenderer/SimpleTextDrawer.cpp similarity index 98% rename from src/Nazara/Utility/SimpleTextDrawer.cpp rename to src/Nazara/TextRenderer/SimpleTextDrawer.cpp index 9a53f7e7a..4769a5fd3 100644 --- a/src/Nazara/Utility/SimpleTextDrawer.cpp +++ b/src/Nazara/TextRenderer/SimpleTextDrawer.cpp @@ -1,11 +1,11 @@ // Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" +// This file is part of the "Nazara Engine - Text renderer" // For conditions of distribution and use, see copyright notice in Config.hpp -#include +#include #include #include -#include +#include namespace Nz { diff --git a/src/Nazara/TextRenderer/TextRenderer.cpp b/src/Nazara/TextRenderer/TextRenderer.cpp new file mode 100644 index 000000000..8cb8a392e --- /dev/null +++ b/src/Nazara/TextRenderer/TextRenderer.cpp @@ -0,0 +1,44 @@ +// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) +// This file is part of the "Nazara Engine - Text renderer" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#include +#include +#include +#include +#include +#include + +namespace Nz +{ + TextRenderer::TextRenderer(Config /*config*/) : + ModuleBase("TextRenderer", this) + { + if (!Font::Initialize()) + throw std::runtime_error("failed to initialize fonts"); + + if (!Loaders::InitializeFreeType()) + throw std::runtime_error("failed to initialize freetype"); + + m_fontLoader.RegisterLoader(Loaders::GetFontLoader_FreeType()); + } + + TextRenderer::~TextRenderer() + { + Loaders::UninitializeFreeType(); + + Font::Uninitialize(); + } + + FontLoader& TextRenderer::GetFontLoader() + { + return m_fontLoader; + } + + const FontLoader& TextRenderer::GetFontLoader() const + { + return m_fontLoader; + } + + TextRenderer* TextRenderer::s_instance = nullptr; +} diff --git a/src/Nazara/Utility/Utility.cpp b/src/Nazara/Utility/Utility.cpp deleted file mode 100644 index 220fe1be7..000000000 --- a/src/Nazara/Utility/Utility.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) -// This file is part of the "Nazara Engine - Utility module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Nz -{ - /*! - * \ingroup utility - * \class Nz::Utility - * \brief Utility class that represents the module initializer of Utility - */ - - Utility::Utility(Config /*config*/) : - ModuleBase("Utility", this) - { - if (!Font::Initialize()) - throw std::runtime_error("failed to initialize fonts"); - - if (!PixelFormatInfo::Initialize()) - throw std::runtime_error("failed to initialize pixel formats"); - - if (!VertexDeclaration::Initialize()) - throw std::runtime_error("failed to initialize vertex declarations"); - - // On enregistre les loaders pour les extensions - // Il s'agit ici d'une liste LIFO, le dernier loader enregistré possède la priorité - - /// Loaders génériques - // Font - if (Loaders::InitializeFreeType()) - m_fontLoader.RegisterLoader(Loaders::GetFontLoader_FreeType()); - - // Image - m_imageLoader.RegisterLoader(Loaders::GetImageLoader_STB()); // Generic loader (STB) - m_imageSaver.RegisterSaver(Loaders::GetImageSaver_STB()); // Generic saver (STB) - - // ImageStream - m_imageStreamLoader.RegisterLoader(Loaders::GetImageStreamLoader_GIF()); // GIF loader - - /// Loaders spécialisés - // Animation - m_animationLoader.RegisterLoader(Loaders::GetAnimationLoader_MD5Anim()); // Loader de fichiers .md5anim (v10) - - // Mesh (text) - m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ()); - m_meshSaver.RegisterSaver(Loaders::GetMeshSaver_OBJ()); - - // Mesh - m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD2()); // .md2 (v8) - m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD5Mesh()); // .md5mesh (v10) - m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ()); // .obj - - // Image - m_imageLoader.RegisterLoader(Loaders::GetImageLoader_DDS()); // DDS Loader (DirectX format) - m_imageLoader.RegisterLoader(Loaders::GetImageLoader_PCX()); // .pcx loader (1, 4, 8, 24 bits) - } - - Utility::~Utility() - { - Loaders::UninitializeFreeType(); - - VertexDeclaration::Uninitialize(); - PixelFormatInfo::Uninitialize(); - Font::Uninitialize(); - } - - AnimationLoader& Utility::GetAnimationLoader() - { - return m_animationLoader; - } - - const AnimationLoader& Utility::GetAnimationLoader() const - { - return m_animationLoader; - } - - FontLoader& Utility::GetFontLoader() - { - return m_fontLoader; - } - - const FontLoader& Utility::GetFontLoader() const - { - return m_fontLoader; - } - - ImageLoader& Utility::GetImageLoader() - { - return m_imageLoader; - } - - const ImageLoader& Utility::GetImageLoader() const - { - return m_imageLoader; - } - - ImageStreamLoader& Utility::GetImageStreamLoader() - { - return m_imageStreamLoader; - } - - const ImageStreamLoader& Utility::GetImageStreamLoader() const - { - return m_imageStreamLoader; - } - - ImageSaver& Utility::GetImageSaver() - { - return m_imageSaver; - } - - const ImageSaver& Utility::GetImageSaver() const - { - return m_imageSaver; - } - - MeshLoader& Utility::GetMeshLoader() - { - return m_meshLoader; - } - - const MeshLoader& Utility::GetMeshLoader() const - { - return m_meshLoader; - } - - MeshSaver& Utility::GetMeshSaver() - { - return m_meshSaver; - } - - const MeshSaver& Utility::GetMeshSaver() const - { - return m_meshSaver; - } - - Utility* Utility::s_instance = nullptr; -} diff --git a/src/Nazara/VulkanRenderer/Vulkan.cpp b/src/Nazara/VulkanRenderer/Vulkan.cpp index 5737466af..1e755bb09 100644 --- a/src/Nazara/VulkanRenderer/Vulkan.cpp +++ b/src/Nazara/VulkanRenderer/Vulkan.cpp @@ -3,10 +3,10 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include #include #include -#include #include #include #include diff --git a/src/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.cpp b/src/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.cpp index a98ff13a8..aaae04976 100644 --- a/src/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.cpp +++ b/src/Nazara/VulkanRenderer/VulkanCommandBufferBuilder.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include #include #include diff --git a/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp b/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp index 87354b637..7a3e9efd1 100644 --- a/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp +++ b/src/Nazara/VulkanRenderer/VulkanShaderBinding.cpp @@ -3,11 +3,11 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include #include #include #include #include +#include #include #include diff --git a/src/Nazara/VulkanRenderer/VulkanSwapchain.cpp b/src/Nazara/VulkanRenderer/VulkanSwapchain.cpp index 08e91471c..5d5c5e3f2 100644 --- a/src/Nazara/VulkanRenderer/VulkanSwapchain.cpp +++ b/src/Nazara/VulkanRenderer/VulkanSwapchain.cpp @@ -5,10 +5,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/src/Nazara/VulkanRenderer/VulkanTexture.cpp b/src/Nazara/VulkanRenderer/VulkanTexture.cpp index a33e78d1b..28d49da44 100644 --- a/src/Nazara/VulkanRenderer/VulkanTexture.cpp +++ b/src/Nazara/VulkanRenderer/VulkanTexture.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include #include #include diff --git a/src/Nazara/VulkanRenderer/Wrapper/Loader.cpp b/src/Nazara/VulkanRenderer/Wrapper/Loader.cpp index 26bb94fc6..da3107c08 100644 --- a/src/Nazara/VulkanRenderer/Wrapper/Loader.cpp +++ b/src/Nazara/VulkanRenderer/Wrapper/Loader.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include namespace Nz diff --git a/src/Nazara/Widgets/AbstractLabelWidget.cpp b/src/Nazara/Widgets/AbstractLabelWidget.cpp index fd6119ca3..b79adbe60 100644 --- a/src/Nazara/Widgets/AbstractLabelWidget.cpp +++ b/src/Nazara/Widgets/AbstractLabelWidget.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Widgets/AbstractTextAreaWidget.cpp b/src/Nazara/Widgets/AbstractTextAreaWidget.cpp index e6438968a..85af1a115 100644 --- a/src/Nazara/Widgets/AbstractTextAreaWidget.cpp +++ b/src/Nazara/Widgets/AbstractTextAreaWidget.cpp @@ -5,9 +5,9 @@ #include #include #include +#include #include -#include -#include +#include #include #include #include diff --git a/src/Nazara/Widgets/BaseWidget.cpp b/src/Nazara/Widgets/BaseWidget.cpp index 34f30bf99..843859315 100644 --- a/src/Nazara/Widgets/BaseWidget.cpp +++ b/src/Nazara/Widgets/BaseWidget.cpp @@ -3,9 +3,9 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include #include -#include #include #include #include diff --git a/src/Nazara/Widgets/ButtonWidget.cpp b/src/Nazara/Widgets/ButtonWidget.cpp index c67bfb2df..7337bd84e 100644 --- a/src/Nazara/Widgets/ButtonWidget.cpp +++ b/src/Nazara/Widgets/ButtonWidget.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Widgets/CheckboxWidget.cpp b/src/Nazara/Widgets/CheckboxWidget.cpp index 3678fc6cd..338a439c5 100644 --- a/src/Nazara/Widgets/CheckboxWidget.cpp +++ b/src/Nazara/Widgets/CheckboxWidget.cpp @@ -3,12 +3,12 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include #include #include #include -#include -#include +#include #include #include #include diff --git a/src/Nazara/Widgets/ImageWidget.cpp b/src/Nazara/Widgets/ImageWidget.cpp index 645cdf334..fa518621a 100644 --- a/src/Nazara/Widgets/ImageWidget.cpp +++ b/src/Nazara/Widgets/ImageWidget.cpp @@ -3,8 +3,8 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include -#include #include #include #include diff --git a/src/Nazara/Widgets/LabelWidget.cpp b/src/Nazara/Widgets/LabelWidget.cpp index ec8c0a268..80b0be060 100644 --- a/src/Nazara/Widgets/LabelWidget.cpp +++ b/src/Nazara/Widgets/LabelWidget.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Widgets/SimpleLabelWidget.cpp b/src/Nazara/Widgets/SimpleLabelWidget.cpp index 71204b8ca..dd599020f 100644 --- a/src/Nazara/Widgets/SimpleLabelWidget.cpp +++ b/src/Nazara/Widgets/SimpleLabelWidget.cpp @@ -3,7 +3,7 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include -#include +#include #include namespace Nz diff --git a/src/Nazara/Widgets/SimpleWidgetStyles.cpp b/src/Nazara/Widgets/SimpleWidgetStyles.cpp index b335d5728..4b205a5f1 100644 --- a/src/Nazara/Widgets/SimpleWidgetStyles.cpp +++ b/src/Nazara/Widgets/SimpleWidgetStyles.cpp @@ -3,8 +3,8 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include #include -#include #include #include #include diff --git a/src/Nazara/Widgets/TextAreaWidget.cpp b/src/Nazara/Widgets/TextAreaWidget.cpp index 564f42ee0..b7563d310 100644 --- a/src/Nazara/Widgets/TextAreaWidget.cpp +++ b/src/Nazara/Widgets/TextAreaWidget.cpp @@ -4,10 +4,10 @@ #include #include +#include #include #include -#include -#include +#include #include namespace Nz diff --git a/src/ShaderNode/DataModels/BufferField.inl b/src/ShaderNode/DataModels/BufferField.inl index 67cd1a5e7..d54fc8a14 100644 --- a/src/ShaderNode/DataModels/BufferField.inl +++ b/src/ShaderNode/DataModels/BufferField.inl @@ -1,2 +1,2 @@ #include -#include +#include diff --git a/src/ShaderNode/DataModels/ConditionalExpression.inl b/src/ShaderNode/DataModels/ConditionalExpression.inl index 67cd1a5e7..d54fc8a14 100644 --- a/src/ShaderNode/DataModels/ConditionalExpression.inl +++ b/src/ShaderNode/DataModels/ConditionalExpression.inl @@ -1,2 +1,2 @@ #include -#include +#include diff --git a/src/ShaderNode/DataModels/VecValue.inl b/src/ShaderNode/DataModels/VecValue.inl index d90f5538a..2c64b3032 100644 --- a/src/ShaderNode/DataModels/VecValue.inl +++ b/src/ShaderNode/DataModels/VecValue.inl @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/ShaderNode/ShaderGraph.cpp b/src/ShaderNode/ShaderGraph.cpp index 2aa9da3e4..8272f2624 100644 --- a/src/ShaderNode/ShaderGraph.cpp +++ b/src/ShaderNode/ShaderGraph.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/src/ShaderNode/ShaderGraph.hpp b/src/ShaderNode/ShaderGraph.hpp index ccc6a023d..1d78c2e31 100644 --- a/src/ShaderNode/ShaderGraph.hpp +++ b/src/ShaderNode/ShaderGraph.hpp @@ -4,7 +4,7 @@ #define NAZARA_SHADERNODES_SHADERGRAPH_HPP #include -#include +#include #include #include #include diff --git a/src/ShaderNode/Widgets/StructEditDialog.cpp b/src/ShaderNode/Widgets/StructEditDialog.cpp index 6c10fa0d9..7166f77e5 100644 --- a/src/ShaderNode/Widgets/StructEditDialog.cpp +++ b/src/ShaderNode/Widgets/StructEditDialog.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/tests/ComputeParticlesTest/main.cpp b/tests/ComputeParticlesTest/main.cpp index 8085577b4..e26eecf6c 100644 --- a/tests/ComputeParticlesTest/main.cpp +++ b/tests/ComputeParticlesTest/main.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/ComputeTest/main.cpp b/tests/ComputeTest/main.cpp index a8d3a9e8c..e8624a074 100644 --- a/tests/ComputeTest/main.cpp +++ b/tests/ComputeTest/main.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include diff --git a/tests/GraphicsTest/main.cpp b/tests/GraphicsTest/main.cpp index 2cd64c1b8..583484fea 100644 --- a/tests/GraphicsTest/main.cpp +++ b/tests/GraphicsTest/main.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/PresentModeTest/main.cpp b/tests/PresentModeTest/main.cpp index c2e51eeb7..f826cc82e 100644 --- a/tests/PresentModeTest/main.cpp +++ b/tests/PresentModeTest/main.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/RenderTest/main.cpp b/tests/RenderTest/main.cpp index 5125d8f47..5a2400200 100644 --- a/tests/RenderTest/main.cpp +++ b/tests/RenderTest/main.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include #include diff --git a/tests/SchedulerBenchmark/main.cpp b/tests/SchedulerBenchmark/main.cpp index f9bd5b6fa..722f7d30d 100644 --- a/tests/SchedulerBenchmark/main.cpp +++ b/tests/SchedulerBenchmark/main.cpp @@ -1,8 +1,7 @@ #include #include #include -#include -#include +#include #include "task.hpp" #include #include @@ -10,7 +9,7 @@ int main() { - Nz::Modules core; + Nz::Modules core; constexpr unsigned int imageDimensions = 4096; // Will produce imageDimensions² rays constexpr unsigned int tileSize = 128; diff --git a/tests/SchedulerBenchmark/xmake.lua b/tests/SchedulerBenchmark/xmake.lua index dc228314d..029477f29 100644 --- a/tests/SchedulerBenchmark/xmake.lua +++ b/tests/SchedulerBenchmark/xmake.lua @@ -1,5 +1,5 @@ target("SchedulerBenchmark") - add_deps("NazaraCore", "NazaraUtility") + add_deps("NazaraCore") add_files("main.cpp") add_headerfiles("task.hpp") add_files("task.cpp") diff --git a/tests/UnitTests/Engine/Core/ByteStreamTest.cpp b/tests/UnitTests/Engine/Core/ByteStreamTest.cpp index 164f7dbec..dc045e33f 100644 --- a/tests/UnitTests/Engine/Core/ByteStreamTest.cpp +++ b/tests/UnitTests/Engine/Core/ByteStreamTest.cpp @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/tests/UnitTests/Engine/Utility/ImageLoading.cpp b/tests/UnitTests/Engine/Core/ImageLoading.cpp similarity index 93% rename from tests/UnitTests/Engine/Utility/ImageLoading.cpp rename to tests/UnitTests/Engine/Core/ImageLoading.cpp index f33919d43..21e25fc2e 100644 --- a/tests/UnitTests/Engine/Utility/ImageLoading.cpp +++ b/tests/UnitTests/Engine/Core/ImageLoading.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include #include std::filesystem::path GetAssetDir(); -SCENARIO("Images", "[Utility][Image]") +SCENARIO("Images", "[Core][Image]") { WHEN("Loading PNG files") { diff --git a/tests/UnitTests/Engine/Utility/ImageStreamLoading.cpp b/tests/UnitTests/Engine/Core/ImageStreamLoading.cpp similarity index 96% rename from tests/UnitTests/Engine/Utility/ImageStreamLoading.cpp rename to tests/UnitTests/Engine/Core/ImageStreamLoading.cpp index 75acbc7e4..76b9eb77e 100644 --- a/tests/UnitTests/Engine/Utility/ImageStreamLoading.cpp +++ b/tests/UnitTests/Engine/Core/ImageStreamLoading.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include #include @@ -17,7 +17,7 @@ void CompareFrames(const Nz::ImageStream& gif, std::vector& frameData REQUIRE(std::memcmp(frameData.data(), referenceImage.GetConstPixels(), frameData.size()) == 0); } -SCENARIO("Streamed images", "[Utility][ImageStream]") +SCENARIO("Streamed images", "[Core][ImageStream]") { using namespace Nz::Literals; diff --git a/tests/UnitTests/Engine/Utility/MeshLoading.cpp b/tests/UnitTests/Engine/Core/MeshLoading.cpp similarity index 95% rename from tests/UnitTests/Engine/Utility/MeshLoading.cpp rename to tests/UnitTests/Engine/Core/MeshLoading.cpp index 14822719f..549591850 100644 --- a/tests/UnitTests/Engine/Utility/MeshLoading.cpp +++ b/tests/UnitTests/Engine/Core/MeshLoading.cpp @@ -1,11 +1,11 @@ -#include +#include #include #include #include std::filesystem::path GetAssetDir(); -SCENARIO("Meshes", "[Utility][Mesh]") +SCENARIO("Meshes", "[Core][Mesh]") { WHEN("Loading OJB files") { diff --git a/tests/UnitTests/Engine/Core/SerializationTest.cpp b/tests/UnitTests/Engine/Core/SerializationTest.cpp index 3d05db793..0f32ffced 100644 --- a/tests/UnitTests/Engine/Core/SerializationTest.cpp +++ b/tests/UnitTests/Engine/Core/SerializationTest.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/tests/UnitTests/Engine/Core/VirtualDirectoryTest.cpp b/tests/UnitTests/Engine/Core/VirtualDirectoryTest.cpp index a2f06ca86..c02d0c592 100644 --- a/tests/UnitTests/Engine/Core/VirtualDirectoryTest.cpp +++ b/tests/UnitTests/Engine/Core/VirtualDirectoryTest.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -260,7 +259,7 @@ TEST_CASE("VirtualDirectory", "[Core][VirtualDirectory]") CHECK(resourceDir->GetEntry("./..", CheckOurselves)); CHECK(resourceDir->GetEntry("./..", CheckOurselves)); CHECK(resourceDir->GetEntry("Audio/../..", CheckOurselves)); - CHECK(resourceDir->GetEntry("Core/../Audio/../../..", CheckOurselves)); + CHECK(resourceDir->GetEntry("Utility/../Audio/../../..", CheckOurselves)); } AND_THEN("Overriding the physical file with another one") { diff --git a/tests/UnitTests/Engine/Modules.hpp b/tests/UnitTests/Engine/Modules.hpp index 7fce6d5db..45b5e2470 100644 --- a/tests/UnitTests/Engine/Modules.hpp +++ b/tests/UnitTests/Engine/Modules.hpp @@ -4,4 +4,3 @@ #include #include #include -#include diff --git a/tests/UnitTests/Engine/Utility/FontLoading.cpp b/tests/UnitTests/Engine/TextRenderer/FontLoading.cpp similarity index 96% rename from tests/UnitTests/Engine/Utility/FontLoading.cpp rename to tests/UnitTests/Engine/TextRenderer/FontLoading.cpp index f5aeb1cbc..0e9f266c2 100644 --- a/tests/UnitTests/Engine/Utility/FontLoading.cpp +++ b/tests/UnitTests/Engine/TextRenderer/FontLoading.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include #include @@ -8,7 +8,7 @@ std::filesystem::path GetAssetDir(); -SCENARIO("Fonts", "[Utility][Font]") +SCENARIO("Fonts", "[TextRenderer][Font]") { WHEN("Loading default font") { diff --git a/tests/UnitTests/main.cpp b/tests/UnitTests/main.cpp index b58fab67f..a1ed303c7 100644 --- a/tests/UnitTests/main.cpp +++ b/tests/UnitTests/main.cpp @@ -2,14 +2,15 @@ #include #include +#include #include #include #include -#include +#include int main(int argc, char* argv[]) { - Nz::Modules nazaza; + Nz::Modules nazaza; return Catch::Session().run(argc, argv); } diff --git a/tests/UnitTests/xmake.lua b/tests/UnitTests/xmake.lua index 9fcc668a8..f9bc69363 100644 --- a/tests/UnitTests/xmake.lua +++ b/tests/UnitTests/xmake.lua @@ -18,7 +18,7 @@ target("UnitTests", function () add_defines("CATCH_CONFIG_NO_POSIX_SIGNALS") end - add_deps("NazaraAudio", "NazaraCore", "NazaraNetwork", "NazaraPhysics2D") + add_deps("NazaraAudio", "NazaraCore", "NazaraNetwork", "NazaraPhysics2D", "NazaraTextRenderer") add_deps("UnitTests_sub1", "UnitTests_sub2", { links = {} }) add_packages("catch2", "entt", "frozen") add_headerfiles("Engine/**.hpp", { prefixdir = "private", install = false }) diff --git a/xmake.lua b/xmake.lua index 1b623b024..bd02a53d7 100644 --- a/xmake.lua +++ b/xmake.lua @@ -103,22 +103,22 @@ local modules = { remove_files("src/Nazara/Core/Posix/TimeImpl.cpp") end end, - Packages = { "concurrentqueue", "entt", "frozen", "utfcpp" }, + Packages = { "concurrentqueue", "entt", "frozen", "ordered_map", "stb", "utfcpp" }, PublicPackages = { "nazarautils" } }, Graphics = { Option = "graphics", - Deps = {"NazaraRenderer"}, + Deps = {"NazaraRenderer", "NazaraTextRenderer"}, Packages = {"entt"} }, Physics2D = { Option = "physics2d", - Deps = {"NazaraUtility"}, + Deps = {"NazaraCore"}, Packages = { "chipmunk2d", "entt" } }, Physics3D = { Option = "physics3d", - Deps = {"NazaraUtility"}, + Deps = {"NazaraCore"}, Packages = { "joltphysics", "entt", "ordered_map" } }, Network = { @@ -150,7 +150,7 @@ local modules = { }, Platform = { Option = "platform", - Deps = {"NazaraUtility"}, + Deps = {"NazaraCore"}, Packages = {"utfcpp"}, Custom = function() add_packages("libsdl", { components = {"lib"} }) @@ -195,10 +195,10 @@ local modules = { end end }, - Utility = { - Option = "utility", + TextRenderer = { + Option = "textrenderer", Deps = {"NazaraCore"}, - Packages = {"entt", "freetype", "frozen", "ordered_map", "stb"} + Packages = {"freetype", "frozen"} }, Widgets = { Option = "widgets", @@ -275,7 +275,9 @@ add_requires( "entt 3.13.1", "fmt", "frozen", + "ordered_map", "nazarautils >=2024.01.25", + "stb", "utfcpp" ) @@ -358,9 +360,8 @@ if has_config("renderer") then end end -if has_config("utility") then +if has_config("textrenderer") then add_requires("freetype", { configs = { bzip2 = true, png = true, woff2 = true, zlib = true, debug = is_mode("debug") } }) - add_requires("ordered_map", "stb") end if has_config("vulkan") and not is_plat("wasm") then