Remove Utility module and move its content to Core and TextRenderer modules

This commit is contained in:
SirLynix 2024-02-10 22:46:53 +01:00 committed by Jérôme Leclercq
parent 965a00182c
commit e64c2b036e
364 changed files with 2336 additions and 2516 deletions

View File

@ -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

View File

@ -3,7 +3,6 @@
#include <Nazara/Math/Angle.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <NZSL/Math/FieldOffsets.hpp>
#include <NZSL/Parser.hpp>
#include <array>

View File

@ -16,7 +16,7 @@
#include <Nazara/Graphics.hpp> // Module graphique
#include <Nazara/Renderer.hpp> // Module de rendu
#include <Nazara/Network.hpp> // Module utilitaire
#include <Nazara/Utility.hpp> // Module utilitaire
#include <Nazara/Core.hpp> // Module utilitaire
#include <NazaraSDK/Application.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Console.hpp>

View File

@ -13,6 +13,5 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraRenderer",
"NazaraUtility"
"NazaraRenderer"
}

View File

@ -8,8 +8,7 @@ EXAMPLE.Files = {
EXAMPLE.Libraries = {
"NazaraCore",
"NazaraPlatform",
"NazaraUtility"
"NazaraPlatform"
}
if Config.PlatformSDL2 then

View File

@ -1,13 +1,13 @@
#include <Nazara/Core/File.hpp>
#include <Nazara/Core/Modules.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/Sequence.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/Sequence.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Core.hpp>
#include <cctype>
#include <iostream>
#include <limits>
@ -15,14 +15,7 @@
int main()
{
// Pour charger des ressources, il est impératif d'initialiser le module utilitaire
Nz::Modules<Nz::Utility> 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<Nz::Core> nazara;
for (;;)
{

View File

@ -1,6 +1,6 @@
#include "Common.hpp"
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/SimpleTextDrawer.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <NazaraSDK/Components/ParticleGroupComponent.hpp>
#include <NazaraSDK/Systems/RenderSystem.hpp>

View File

@ -1,7 +1,7 @@
#include "LogoDemo.hpp"
#include <Nazara/Core/OffsetOf.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Core.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>
#include <iostream>

View File

@ -3,7 +3,7 @@
#include <Nazara/Core/OffsetOf.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Core.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>

View File

@ -3,7 +3,6 @@
#include <Nazara/Graphics.hpp>
#include <Nazara/Network.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <NazaraSDK/Application.hpp>
#include <NazaraSDK/Components.hpp>
#include <NazaraSDK/Systems.hpp>

View File

@ -2,7 +2,6 @@
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <chrono>
#include <iostream>
#include <thread>

View File

@ -4,7 +4,6 @@
#include <Nazara/Math/PidController.hpp>
#include <Nazara/Physics2D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Widgets.hpp>
#include <entt/entt.hpp>
#include <array>

View File

@ -4,7 +4,7 @@
#include <Nazara/Math/PidController.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <entt/entt.hpp>
#include <array>
#include <chrono>

View File

@ -3,7 +3,6 @@
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <iostream>
#include <random>

View File

@ -1,11 +1,11 @@
#include <Nazara/Core.hpp>
#include <Nazara/Core/Plugins/AssimpPlugin.hpp>
#include <Nazara/Platform.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/Physics3D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/Utility/Plugins/AssimpPlugin.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <NZSL/Math/FieldOffsets.hpp>
#include <entt/entt.hpp>

View File

@ -5,14 +5,15 @@
#include <Nazara/Physics3D.hpp>
#include <Nazara/Physics2D.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer.hpp>
#include <Nazara/Widgets.hpp>
#include <iostream>
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<Nz::Audio, Nz::Core, Nz::Graphics, Nz::Network, Nz::Physics2D, Nz::Physics3D, Nz::Renderer, Nz::Utility> app(argc, argv);
Nz::Application<Nz::Audio, Nz::Core, Nz::Graphics, Nz::Network, Nz::Physics2D, Nz::Physics3D, Nz::Renderer, Nz::TextRenderer, Nz::Widgets> app(argc, argv);
return EXIT_SUCCESS;
}

View File

@ -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")

View File

@ -4,7 +4,7 @@
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <iostream>
int main(int argc, char* argv[])

View File

@ -4,7 +4,7 @@
#include <Nazara/Graphics.hpp>
#include <Nazara/Platform/WindowingAppComponent.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer/SimpleTextDrawer.hpp>
#include <iostream>
int main(int argc, char* argv[])

View File

@ -3,7 +3,7 @@
#include <Nazara/Graphics.hpp>
#include <Nazara/Math/PidController.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <Nazara/TextRenderer.hpp>
#include <Nazara/Widgets.hpp>
#include <entt/entt.hpp>
#include <array>

View File

@ -14,7 +14,7 @@
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/OpenAL.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <array>

View File

@ -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 <Nazara/Core/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz

View File

@ -29,14 +29,19 @@
#ifndef NAZARA_GLOBAL_CORE_HPP
#define NAZARA_GLOBAL_CORE_HPP
#include <Nazara/Core/AbstractAtlas.hpp>
#include <Nazara/Core/AbstractHash.hpp>
#include <Nazara/Core/AbstractImage.hpp>
#include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Application.hpp>
#include <Nazara/Core/ApplicationBase.hpp>
#include <Nazara/Core/ApplicationComponent.hpp>
#include <Nazara/Core/ApplicationComponentRegistry.hpp>
#include <Nazara/Core/ApplicationUpdater.hpp>
#include <Nazara/Core/Buffer.hpp>
#include <Nazara/Core/BufferMapper.hpp>
#include <Nazara/Core/ByteArray.hpp>
#include <Nazara/Core/ByteArrayPool.hpp>
#include <Nazara/Core/ByteStream.hpp>
@ -45,6 +50,7 @@
#include <Nazara/Core/CommandLineParameters.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/CubemapParams.hpp>
#include <Nazara/Core/DynLib.hpp>
#include <Nazara/Core/EmptyStream.hpp>
#include <Nazara/Core/EntitySystemAppComponent.hpp>
@ -59,20 +65,32 @@
#include <Nazara/Core/Format.hpp>
#include <Nazara/Core/Functor.hpp>
#include <Nazara/Core/GuillotineBinPack.hpp>
#include <Nazara/Core/GuillotineImageAtlas.hpp>
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Core/HardwareInfo.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/ImageStream.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/Initializer.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/MemoryStream.hpp>
#include <Nazara/Core/MemoryView.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/MeshData.hpp>
#include <Nazara/Core/ModuleBase.hpp>
#include <Nazara/Core/Modules.hpp>
#include <Nazara/Core/Node.hpp>
#include <Nazara/Core/ObjectHandle.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Core/OwnedMemoryStream.hpp>
#include <Nazara/Core/ParameterFile.hpp>
#include <Nazara/Core/ParameterList.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/Plugin.hpp>
#include <Nazara/Core/PluginInterface.hpp>
#include <Nazara/Core/PluginLoader.hpp>
@ -86,19 +104,31 @@
#include <Nazara/Core/ResourceManager.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Core/ResourceSaver.hpp>
#include <Nazara/Core/SerializationContext.hpp>
#include <Nazara/Core/Sequence.hpp>
#include <Nazara/Core/Serialization.hpp>
#include <Nazara/Core/SignalHandlerAppComponent.hpp>
#include <Nazara/Core/SkeletalMesh.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/SoftwareBuffer.hpp>
#include <Nazara/Core/State.hpp>
#include <Nazara/Core/StateMachine.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/StdLogger.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/TaskScheduler.hpp>
#include <Nazara/Core/ThreadExt.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Core/TriangleIterator.hpp>
#include <Nazara/Core/Unicode.hpp>
#include <Nazara/Core/UniformBuffer.hpp>
#include <Nazara/Core/Updatable.hpp>
#include <Nazara/Core/Uuid.hpp>
#include <Nazara/Core/VertexBuffer.hpp>
#include <Nazara/Core/VertexDeclaration.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/VertexStruct.hpp>
#include <Nazara/Core/VirtualDirectory.hpp>
#include <Nazara/Core/VirtualDirectoryFilesystemResolver.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Math/Rect.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/Signal.hpp>
#include <NazaraUtils/SparsePtr.hpp>
@ -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

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Math/Rect.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
namespace Nz
{
class AbstractImage;
class NAZARA_UTILITY_API AbstractImage
class NAZARA_CORE_API AbstractImage
{
public:
AbstractImage() = default;
@ -44,6 +44,6 @@ namespace Nz
};
}
#include <Nazara/Utility/AbstractImage.inl>
#include <Nazara/Core/AbstractImage.inl>
#endif // NAZARA_UTILITY_ABSTRACTIMAGE_HPP
#endif // NAZARA_CORE_ABSTRACTIMAGE_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -17,4 +17,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -9,9 +9,18 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/AbstractHash.hpp>
#include <Nazara/Core/Color.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/SerializationContext.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/Serialization.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Math/Vector4.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/SparsePtr.hpp>
#include <NazaraUtils/TypeTag.hpp>
#include <functional>
#include <string>
@ -23,28 +32,75 @@ namespace Nz
{
class ByteArray;
// Hash
template<typename T> ByteArray ComputeHash(HashType hash, T&& v);
template<typename T> ByteArray ComputeHash(AbstractHash& hash, T&& v);
inline bool HashAppend(AbstractHash* hash, std::string_view v);
template<typename T>
bool Serialize(SerializationContext& context, T&& value);
inline bool Serialize(SerializationContext& context, bool value, TypeTag<bool>);
inline bool Serialize(SerializationContext& context, const std::string& value, TypeTag<std::string>);
template<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>);
template<typename T>
bool Unserialize(SerializationContext& context, T* value);
inline bool Unserialize(SerializationContext& context, bool* value, TypeTag<bool>);
inline bool Unserialize(SerializationContext& context, std::string* value, TypeTag<std::string>);
template<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>);
// 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<const Vector3f> inputPositions;
SparsePtr<const Vector3f> inputNormals;
SparsePtr<const Vector3f> inputTangents;
SparsePtr<const Vector4i32> inputJointIndices;
SparsePtr<const Vector4f> inputJointWeights;
SparsePtr<const Vector2f> inputUv;
SparsePtr<Vector3f> outputNormals;
SparsePtr<Vector3f> outputPositions;
SparsePtr<Vector3f> outputTangents;
SparsePtr<Vector2f> outputUv;
};
struct VertexPointers
{
SparsePtr<Vector3f> normalPtr;
SparsePtr<Vector3f> positionPtr;
SparsePtr<Vector3f> tangentPtr;
SparsePtr<Vector2f> uvPtr;
};
NAZARA_CORE_API Boxf ComputeAABB(SparsePtr<const Vector3f> 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<typename T> constexpr ComponentType ComponentTypeId();
template<typename T> constexpr ComponentType GetComponentTypeOf();
}
#include <Nazara/Core/Algorithm.inl>

View File

@ -63,157 +63,83 @@ namespace Nz
return true;
}
template<typename T>
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<T>(value), TypeTag<std::decay_t<T>>());
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<bool>)
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<UInt8>());
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<std::string>)
{
if (!Serialize(context, SafeCast<UInt32>(value.size()), TypeTag<UInt32>()))
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<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>)
{
// 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<typename T>
bool Unserialize(SerializationContext& context, T* value)
{
return Unserialize(context, value, TypeTag<T>());
}
/*!
* \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<bool>)
{
if (context.readBitPos == 8)
if (vertexPointers.normalPtr || vertexPointers.tangentPtr)
{
if (!Unserialize(context, &context.readByte, TypeTag<UInt8>()))
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<std::string>)
template<typename T> constexpr ComponentType ComponentTypeId()
{
UInt32 size;
if (!Unserialize(context, &size, TypeTag<UInt32>()))
return false;
string->resize(size);
return context.stream->Read(&(*string)[0], size) == size;
static_assert(AlwaysFalse<T>::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<Color>() { return ComponentType::Color; }
template<> constexpr ComponentType ComponentTypeId<double>() { return ComponentType::Double1; }
template<> constexpr ComponentType ComponentTypeId<Vector2d>() { return ComponentType::Double2; }
template<> constexpr ComponentType ComponentTypeId<Vector3d>() { return ComponentType::Double3; }
template<> constexpr ComponentType ComponentTypeId<Vector4d>() { return ComponentType::Double4; }
template<> constexpr ComponentType ComponentTypeId<float>() { return ComponentType::Float1; }
template<> constexpr ComponentType ComponentTypeId<Vector2f>() { return ComponentType::Float2; }
template<> constexpr ComponentType ComponentTypeId<Vector3f>() { return ComponentType::Float3; }
template<> constexpr ComponentType ComponentTypeId<Vector4f>() { return ComponentType::Float4; }
template<> constexpr ComponentType ComponentTypeId<int>() { return ComponentType::Int1; }
template<> constexpr ComponentType ComponentTypeId<Vector2i>() { return ComponentType::Int2; }
template<> constexpr ComponentType ComponentTypeId<Vector3i>() { return ComponentType::Int3; }
template<> constexpr ComponentType ComponentTypeId<Vector4i>() { return ComponentType::Int4; }
template<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>)
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<std::decay_t<T>>();
}
}

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
@ -15,8 +17,6 @@
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <NazaraUtils/Signal.hpp>
#include <string>
@ -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 <Nazara/Utility/Animation.inl>
#include <Nazara/Core/Animation.inl>
#endif // NAZARA_UTILITY_ANIMATION_HPP
#endif // NAZARA_CORE_ANIMATION_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <functional>
#include <memory>
@ -19,7 +19,7 @@ namespace Nz
using BufferFactory = std::function<std::shared_ptr<Buffer>(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 <Nazara/Utility/Buffer.inl>
#include <Nazara/Core/Buffer.inl>
#endif // NAZARA_UTILITY_BUFFER_HPP
#endif // NAZARA_CORE_BUFFER_HPP

View File

@ -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 <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -36,4 +36,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <Nazara/Utility/Enums.hpp>
#include <Nazara/Core/Enums.hpp>
namespace Nz
{
@ -32,6 +32,6 @@ namespace Nz
};
}
#include <Nazara/Utility/BufferMapper.inl>
#include <Nazara/Core/BufferMapper.inl>
#endif // NAZARA_UTILITY_BUFFERMAPPER_HPP
#endif // NAZARA_CORE_BUFFERMAPPER_HPP

View File

@ -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 <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -69,4 +69,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -10,7 +10,7 @@
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/SerializationContext.hpp>
#include <Nazara/Core/Serialization.hpp>
#include <memory>
namespace Nz

View File

@ -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 <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
@ -163,7 +162,6 @@ namespace Nz
*
* \remark Produces a NazaraError if unserialization failed
*/
template<typename T>
ByteStream& ByteStream::operator>>(T& value)
{

View File

@ -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
*/
/*!

View File

@ -8,6 +8,7 @@
#define NAZARA_CORE_COLOR_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Serialization.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <limits>
#include <string>

View File

@ -31,5 +31,10 @@
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Core/Components/LifetimeComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Core/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Core/Components/SkeletonComponent.hpp>
#include <Nazara/Core/Components/SkeletonComponentBase.hpp>
#include <Nazara/Core/Components/VelocityComponent.hpp>
#endif // NAZARA_CORE_COMPONENTS_HPP

View File

@ -8,8 +8,8 @@
#define NAZARA_CORE_COMPONENTS_DISABLEDCOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Utility/Config.hpp>
namespace Nz
{

View File

@ -8,8 +8,8 @@
#define NAZARA_CORE_COMPONENTS_LIFETIMECOMPONENT_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Utility/Config.hpp>
namespace Nz
{

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Node.hpp>
#include <Nazara/Core/Node.hpp>
#include <entt/entt.hpp>
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 <Nazara/Utility/Components/NodeComponent.inl>
#include <Nazara/Core/Components/NodeComponent.inl>
#endif // NAZARA_UTILITY_COMPONENTS_NODECOMPONENT_HPP
#endif // NAZARA_CORE_COMPONENTS_NODECOMPONENT_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Components/SkeletonComponentBase.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Components/SkeletonComponentBase.hpp>
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 <Nazara/Utility/Components/SharedSkeletonComponent.inl>
#include <Nazara/Core/Components/SharedSkeletonComponent.inl>
#endif // NAZARA_UTILITY_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP
#endif // NAZARA_CORE_COMPONENTS_SHAREDSKELETONCOMPONENT_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -12,4 +12,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Components/SkeletonComponentBase.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Components/SkeletonComponentBase.hpp>
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> skeleton);
@ -33,6 +33,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Components/SkeletonComponent.inl>
#include <Nazara/Core/Components/SkeletonComponent.inl>
#endif // NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENT_HPP
#endif // NAZARA_CORE_COMPONENTS_SKELETONCOMPONENT_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -22,4 +22,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Skeleton.hpp>
namespace Nz
{
class NAZARA_UTILITY_API SkeletonComponentBase
class NAZARA_CORE_API SkeletonComponentBase
{
public:
SkeletonComponentBase(const SkeletonComponentBase&) = default;
@ -37,6 +37,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Components/SkeletonComponentBase.inl>
#include <Nazara/Core/Components/SkeletonComponentBase.inl>
#endif // NAZARA_UTILITY_COMPONENTS_SKELETONCOMPONENTBASE_HPP
#endif // NAZARA_CORE_COMPONENTS_SKELETONCOMPONENTBASE_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -27,4 +27,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
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 <Nazara/Utility/Components/VelocityComponent.inl>
#include <Nazara/Core/Components/VelocityComponent.inl>
#endif // NAZARA_UTILITY_COMPONENTS_VELOCITYCOMPONENT_HPP
#endif // NAZARA_CORE_COMPONENTS_VELOCITYCOMPONENT_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -22,4 +22,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <Nazara/Core/ConfigCheck.hpp>

View File

@ -12,8 +12,8 @@
#include <type_traits>
#define NazaraCheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::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

View File

@ -8,7 +8,12 @@
#define NAZARA_CORE_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/HardwareInfo.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/ImageStream.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/ModuleBase.hpp>
#include <Nazara/Core/Modules.hpp>
#include <NazaraUtils/TypeList.hpp>
@ -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<HardwareInfo> m_hardwareInfo;
AnimationLoader m_animationLoader;
ImageLoader m_imageLoader;
ImageSaver m_imageSaver;
ImageStreamLoader m_imageStreamLoader;
MeshLoader m_meshLoader;
MeshSaver m_meshSaver;
static Core* s_instance;
};

View File

@ -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 <Nazara/Math/Vector2.hpp>
@ -35,4 +35,4 @@ namespace Nz
};
}
#endif // NAZARA_UTILITY_CUBEMAPPARAMS_HPP
#endif // NAZARA_CORE_CUBEMAPPARAMS_HPP

View File

@ -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<BufferUsage>
{
static constexpr BufferUsage max = BufferUsage::Max;
};
using BufferUsageFlags = Flags<BufferUsage>;
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<std::size_t>(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<DataStorage>
{
static constexpr DataStorage max = DataStorage::Max;
};
using DataStoreFlags = Flags<DataStorage>;
constexpr std::size_t DataStorageCount = static_cast<std::size_t>(DataStorage::Max) + 1;
enum class ErrorMode
{
Silent,
@ -58,6 +186,34 @@ namespace Nz
constexpr std::size_t ErrorTypeCount = static_cast<std::size_t>(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<std::size_t>(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<std::size_t>(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<std::size_t>(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<std::size_t>(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<StreamOption>;
enum class TextAlign
{
Left,
Middle,
Right,
Max = Right
};
enum class TextStyle
{
Bold,
Italic,
StrikeThrough,
Underlined,
Max = Underlined
};
template<>
struct EnumAsFlags<TextStyle>
{
static constexpr TextStyle max = TextStyle::Max;
};
using TextStyleFlags = Flags<TextStyle>;
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<std::size_t>(VertexLayout::Max) + 1;
}
#endif // NAZARA_CORE_ENUMS_HPP

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
#include <vector>
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

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
#include <string>
#include <vector>
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

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Color.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Core/Config.hpp>
#include <NazaraUtils/StringHash.hpp>
#include <unordered_map>
namespace Nz
{
class NAZARA_UTILITY_API MTLParser
class NAZARA_CORE_API MTLParser
{
public:
struct Material;
@ -75,6 +75,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Formats/MTLParser.inl>
#include <Nazara/Core/Formats/MTLParser.inl>
#endif // NAZARA_UTILITY_FORMATS_MTLPARSER_HPP
#endif // NAZARA_CORE_FORMATS_MTLPARSER_HPP

View File

@ -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 <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -78,4 +78,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Math/Vector4.hpp>
#include <Nazara/Utility/Config.hpp>
#include <vector>
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<typename T> 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 <Nazara/Utility/Formats/OBJParser.inl>
#include <Nazara/Core/Formats/OBJParser.inl>
#endif // NAZARA_UTILITY_FORMATS_OBJPARSER_HPP
#endif // NAZARA_CORE_FORMATS_OBJPARSER_HPP

View File

@ -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 <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
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 <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -7,7 +7,8 @@
#ifndef NAZARA_CORE_FUNCTOR_HPP
#define NAZARA_CORE_FUNCTOR_HPP
#include <Nazara/Core/Algorithm.hpp>
#include <tuple>
#include <utility>
// Inspired from the of code of the SFML by Laurent Gomila

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/AbstractAtlas.hpp>
#include <Nazara/Core/AbstractImage.hpp>
#include <Nazara/Core/GuillotineBinPack.hpp>
#include <Nazara/Utility/AbstractAtlas.hpp>
#include <Nazara/Utility/AbstractImage.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
#include <memory>
#include <vector>
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

View File

@ -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 <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/AbstractImage.hpp>
#include <Nazara/Core/Color.hpp>
#include <Nazara/Core/CubemapParams.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceManager.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Core/ResourceSaver.hpp>
#include <Nazara/Utility/AbstractImage.hpp>
#include <Nazara/Utility/CubemapParams.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <NazaraUtils/Signal.hpp>
#include <atomic>
@ -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<Image, ImageParams>;
using ImageSaver = ResourceSaver<Image, ImageParams>;
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 <Nazara/Utility/Image.inl>
#include <Nazara/Core/Image.inl>
#endif // NAZARA_UTILITY_IMAGE_HPP
#endif // NAZARA_CORE_IMAGE_HPP

View File

@ -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 <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -86,4 +86,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Core/Time.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <mutex>
namespace Nz
@ -28,7 +28,7 @@ namespace Nz
using ImageStreamLoader = ResourceLoader<ImageStream, ImageStreamParams>;
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 <Nazara/Utility/ImageStream.inl>
#include <Nazara/Core/ImageStream.inl>
#endif // NAZARA_UTILITY_IMAGESTREAM_HPP
#endif // NAZARA_CORE_IMAGESTREAM_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Core/Buffer.hpp>
namespace Nz
{
class NAZARA_UTILITY_API IndexBuffer
class NAZARA_CORE_API IndexBuffer
{
public:
IndexBuffer() = default;
@ -58,6 +58,6 @@ namespace Nz
};
}
#include <Nazara/Utility/IndexBuffer.inl>
#include <Nazara/Core/IndexBuffer.inl>
#endif // NAZARA_UTILITY_INDEXBUFFER_HPP
#endif // NAZARA_CORE_INDEXBUFFER_HPP

View File

@ -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 <Nazara/Core/Error.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -69,4 +69,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
@ -77,6 +77,6 @@ namespace Nz
};
}
#include <Nazara/Utility/IndexIterator.inl>
#include <Nazara/Core/IndexIterator.inl>
#endif // NAZARA_UTILITY_INDEXITERATOR_HPP
#endif // NAZARA_CORE_INDEXITERATOR_HPP

View File

@ -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 <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <iterator>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -172,4 +172,4 @@ namespace std
};
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Core/BufferMapper.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
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

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Node.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Utility/Node.hpp>
#include <string>
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 <Nazara/Utility/Joint.inl>
#include <Nazara/Core/Joint.inl>
#endif // NAZARA_UTILITY_JOINT_HPP
#endif // NAZARA_CORE_JOINT_HPP

View File

@ -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 <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -109,4 +109,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Core/Resource.hpp>
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceManager.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Core/ResourceSaver.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/SoftwareBuffer.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/VertexDeclaration.hpp>
#include <Nazara/Core/VertexStruct.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/SoftwareBuffer.hpp>
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/VertexDeclaration.hpp>
#include <Nazara/Utility/VertexStruct.hpp>
#include <unordered_map>
#include <vector>
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 <Nazara/Utility/Mesh.inl>
#include <Nazara/Core/Mesh.inl>
#endif // NAZARA_UTILITY_MESH_HPP
#endif // NAZARA_CORE_MESH_HPP

View File

@ -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 <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -43,4 +43,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <Nazara/Utility/Enums.hpp>
#include <Nazara/Core/Enums.hpp>
namespace Nz
{
@ -22,4 +22,4 @@ namespace Nz
};
}
#endif // NAZARA_UTILITY_MESHDATA_HPP
#endif // NAZARA_CORE_MESHDATA_HPP

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/Signal.hpp>
#include <vector>
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 <Nazara/Utility/Node.inl>
#include <Nazara/Core/Node.inl>
#endif // NAZARA_UTILITY_NODE_HPP
#endif // NAZARA_CORE_NODE_HPP

View File

@ -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 <Nazara/Core/Algorithm.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -485,4 +484,4 @@ namespace Nz
}
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -7,8 +7,8 @@
#ifndef NAZARA_CORE_OBJECTHANDLE_HPP
#define NAZARA_CORE_OBJECTHANDLE_HPP
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/HandledObject.hpp>
#include <NazaraUtils/TypeTraits.hpp>
#include <memory>
#include <ostream>
#include <string>

View File

@ -8,9 +8,8 @@
#define NAZARA_CORE_OBJECTREF_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/RefCounted.hpp>
#include <type_traits>
#include <NazaraUtils/TypeTraits.hpp>
namespace Nz
{

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/Bitset.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <array>
@ -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<UInt8*(const UInt8* start, const UInt8* end, UInt8* dst)>;
@ -96,6 +96,6 @@ namespace Nz
};
}
#include <Nazara/Utility/PixelFormat.inl>
#include <Nazara/Core/PixelFormat.inl>
#endif // NAZARA_UTILITY_PIXELFORMAT_HPP
#endif // NAZARA_CORE_PIXELFORMAT_HPP

View File

@ -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 <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <array>
#include <cstring>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@ -94,7 +94,7 @@ namespace Nz
counter |= blueMask;
counter |= alphaMask;
bitsPerPixel = static_cast<UInt8>(counter.Count());
bitsPerPixel = SafeCast<UInt8>(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<UInt8>(masks[i]->Count());
UInt8 usedBits = SafeCast<UInt8>(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 <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/PluginInterface.hpp>
#include <Nazara/Utility/Config.hpp>
namespace Nz
{
@ -41,6 +41,6 @@ namespace Nz
#endif
}
#include <Nazara/Utility/Plugins/AssimpPlugin.inl>
#include <Nazara/Core/Plugins/AssimpPlugin.inl>
#endif // NAZARA_UTILITY_PLUGINS_ASSIMPPLUGIN_HPP
#endif // NAZARA_CORE_PLUGINS_ASSIMPPLUGIN_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/PluginInterface.hpp>
#include <Nazara/Utility/Config.hpp>
namespace Nz
{
@ -33,6 +33,6 @@ namespace Nz
};
}
#include <Nazara/Utility/Plugins/FFmpegPlugin.inl>
#include <Nazara/Core/Plugins/FFmpegPlugin.inl>
#endif // NAZARA_UTILITY_PLUGINS_FFMPEGPLUGIN_HPP
#endif // NAZARA_CORE_PLUGINS_FFMPEGPLUGIN_HPP

View File

@ -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 <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <Nazara/Math/Quaternion.hpp>
#include <Nazara/Math/Vector3.hpp>
@ -29,4 +29,4 @@ namespace Nz
};
}
#endif // NAZARA_UTILITY_SEQUENCE_HPP
#endif // NAZARA_CORE_SEQUENCE_HPP

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Stream.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <NazaraUtils/TypeTag.hpp>
#include <string>
namespace Nz
{
struct NAZARA_CORE_API SerializationContext
{
MovablePtr<Stream> 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<typename T>
bool Serialize(SerializationContext& context, T&& value);
inline bool Serialize(SerializationContext& context, bool value, TypeTag<bool>);
inline bool Serialize(SerializationContext& context, const std::string& value, TypeTag<std::string>);
template<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>);
template<typename T>
bool Unserialize(SerializationContext& context, T* value);
inline bool Unserialize(SerializationContext& context, bool* value, TypeTag<bool>);
inline bool Unserialize(SerializationContext& context, std::string* value, TypeTag<std::string>);
template<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>);
}
#include <Nazara/Core/Serialization.inl>
#endif // NAZARA_CORE_SERIALIZATION_HPP

View File

@ -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 <Nazara/Core/Debug.hpp>
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<typename T>
bool Serialize(SerializationContext& context, T&& value)
{
return Serialize(context, std::forward<T>(value), TypeTag<std::decay_t<T>>());
}
/*!
* \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<bool>)
{
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<UInt8>());
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<std::string>)
{
if (!Serialize(context, SafeCast<UInt32>(value.size()), TypeTag<UInt32>()))
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<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Serialize(SerializationContext& context, T value, TypeTag<T>)
{
// 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<typename T>
bool Unserialize(SerializationContext& context, T* value)
{
return Unserialize(context, value, TypeTag<T>());
}
/*!
* \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<bool>)
{
if (context.readBitPos == 8)
{
if (!Unserialize(context, &context.readByte, TypeTag<UInt8>()))
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<std::string>)
{
UInt32 size;
if (!Unserialize(context, &size, TypeTag<UInt32>()))
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<typename T>
std::enable_if_t<std::is_arithmetic<T>::value, bool> Unserialize(SerializationContext& context, T* value, TypeTag<T>)
{
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 <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <NazaraUtils/TypeTag.hpp>
namespace Nz
{
class Stream;
struct NAZARA_CORE_API SerializationContext
{
MovablePtr<Stream> 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 <Nazara/Core/SerializationContext.inl>
#endif // NAZARA_CORE_SERIALIZATIONCONTEXT_HPP

View File

@ -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 <Nazara/Core/Debug.hpp>
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 <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/VertexBuffer.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/VertexBuffer.hpp>
namespace Nz
{
class NAZARA_UTILITY_API SkeletalMesh final : public SubMesh
class NAZARA_CORE_API SkeletalMesh final : public SubMesh
{
public:
SkeletalMesh(std::shared_ptr<VertexBuffer> vertexBuffer, std::shared_ptr<IndexBuffer> indexBuffer);
@ -39,6 +39,6 @@ namespace Nz
};
}
#include <Nazara/Utility/SkeletalMesh.inl>
#include <Nazara/Core/SkeletalMesh.inl>
#endif // NAZARA_UTILITY_SKELETALMESH_HPP
#endif // NAZARA_CORE_SKELETALMESH_HPP

View File

@ -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 <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Math/Box.hpp>
#include <Nazara/Utility/Config.hpp>
#include <NazaraUtils/Signal.hpp>
#include <string>
@ -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 <Nazara/Utility/Skeleton.inl>
#include <Nazara/Core/Skeleton.inl>
#endif // NAZARA_UTILITY_SKELETON_HPP
#endif // NAZARA_CORE_SKELETON_HPP

View File

@ -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 <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Utility/DebugOff.hpp>
#include <Nazara/Core/DebugOff.hpp>

View File

@ -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 <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Core/Buffer.hpp>
#include <vector>
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<Buffer> SoftwareBufferFactory(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData = nullptr);
NAZARA_CORE_API std::shared_ptr<Buffer> SoftwareBufferFactory(BufferType type, UInt64 size, BufferUsageFlags usage, const void* initialData = nullptr);
}
#endif // NAZARA_UTILITY_SOFTWAREBUFFER_HPP
#endif // NAZARA_CORE_SOFTWAREBUFFER_HPP

Some files were not shown because too many files have changed in this diff Show More