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

@@ -5,7 +5,7 @@
#include <Nazara/Audio/DummyAudioBuffer.hpp>
#include <Nazara/Audio/Algorithm.hpp>
#include <Nazara/Audio/AudioDevice.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz

View File

@@ -5,7 +5,6 @@
#include <Nazara/Audio/DummyAudioSource.hpp>
#include <Nazara/Audio/Algorithm.hpp>
#include <Nazara/Audio/DummyAudioBuffer.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <NazaraUtils/StackArray.hpp>

View File

@@ -5,7 +5,7 @@
#include <Nazara/Audio/OpenALBuffer.hpp>
#include <Nazara/Audio/OpenALDevice.hpp>
#include <Nazara/Audio/OpenALLibrary.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz

View File

@@ -6,8 +6,8 @@
#include <Nazara/Audio/OpenALBuffer.hpp>
#include <Nazara/Audio/OpenALDevice.hpp>
#include <Nazara/Audio/OpenALLibrary.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <Nazara/Audio/Debug.hpp>

View File

@@ -6,8 +6,8 @@
#include <Nazara/Audio/Audio.hpp>
#include <Nazara/Audio/AudioSource.hpp>
#include <Nazara/Audio/Config.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <Nazara/Audio/Debug.hpp>
namespace Nz

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

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/AbstractHash.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Core/Hash/CRC32.hpp>
@@ -16,6 +15,7 @@
#include <Nazara/Core/Hash/SHA384.hpp>
#include <Nazara/Core/Hash/SHA512.hpp>
#include <Nazara/Core/Hash/Whirlpool.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz

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

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <sstream>
#include <Nazara/Core/Debug.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
/*
@@ -25,15 +25,15 @@
* THE SOFTWARE.
*/
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/SkeletalMesh.hpp>
#include <Nazara/Math/Angle.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/IndexIterator.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/SkeletalMesh.hpp>
#include <algorithm>
#include <unordered_map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -1,17 +1,17 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Sequence.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Sequence.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <unordered_map>
#include <vector>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -64,7 +64,7 @@ namespace Nz
if (!sequence.name.empty())
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
auto it = m_impl->sequenceMap.find(sequence.name);
if (it != m_impl->sequenceMap.end())
{
@@ -291,25 +291,25 @@ namespace Nz
std::shared_ptr<Animation> Animation::LoadFromFile(const std::filesystem::path& filePath, const AnimationParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetAnimationLoader().LoadFromFile(filePath, params);
return core->GetAnimationLoader().LoadFromFile(filePath, params);
}
std::shared_ptr<Animation> Animation::LoadFromMemory(const void* data, std::size_t size, const AnimationParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetAnimationLoader().LoadFromMemory(data, size, params);
return core->GetAnimationLoader().LoadFromMemory(data, size, params);
}
std::shared_ptr<Animation> Animation::LoadFromStream(Stream& stream, const AnimationParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetAnimationLoader().LoadFromStream(stream, params);
return core->GetAnimationLoader().LoadFromStream(stream, params);
}
}

View File

@@ -9,5 +9,6 @@
#endif
#undef CreateWindow
#undef GetEnvironmentVariable
#undef MemoryBarrier
#undef RemoveDirectory

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/Utility/Buffer.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Core/Buffer.hpp>
#include <Nazara/Core/BufferMapper.hpp>
#include <stdexcept>
#include <vector>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/Components/NodeComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Utility/Components/SkeletonComponent.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Core/Components/SkeletonComponent.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -3,12 +3,29 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Buffer.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/HardwareInfo.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/PluginLoader.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/TaskScheduler.hpp>
#include <Nazara/Core/VertexDeclaration.hpp>
#include <Nazara/Core/Formats/DDSLoader.hpp>
#include <Nazara/Core/Formats/GIFLoader.hpp>
#include <Nazara/Core/Formats/MD2Loader.hpp>
#include <Nazara/Core/Formats/MD5AnimLoader.hpp>
#include <Nazara/Core/Formats/MD5MeshLoader.hpp>
#include <Nazara/Core/Formats/OBJLoader.hpp>
#include <Nazara/Core/Formats/OBJSaver.hpp>
#include <Nazara/Core/Formats/PCXLoader.hpp>
#include <Nazara/Core/Formats/STBLoader.hpp>
#include <Nazara/Core/Formats/STBSaver.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
@@ -27,6 +44,34 @@ namespace Nz
LogInit();
m_hardwareInfo.emplace();
if (!PixelFormatInfo::Initialize())
throw std::runtime_error("failed to initialize pixel formats");
if (!VertexDeclaration::Initialize())
throw std::runtime_error("failed to initialize vertex declarations");
// Image
m_imageLoader.RegisterLoader(Loaders::GetImageLoader_STB()); // Generic loader (STB)
m_imageSaver.RegisterSaver(Loaders::GetImageSaver_STB()); // Generic saver (STB)
// ImageStream
m_imageStreamLoader.RegisterLoader(Loaders::GetImageStreamLoader_GIF()); // GIF loader
/// Specialized loaders
// Animation
m_animationLoader.RegisterLoader(Loaders::GetAnimationLoader_MD5Anim()); // Loader de fichiers .md5anim (v10)
// Mesh
m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ());
m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD2()); // .md2 (v8)
m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_MD5Mesh()); // .md5mesh (v10)
m_meshLoader.RegisterLoader(Loaders::GetMeshLoader_OBJ()); // .obj
m_meshSaver.RegisterSaver(Loaders::GetMeshSaver_OBJ());
// Image
m_imageLoader.RegisterLoader(Loaders::GetImageLoader_DDS()); // DDS Loader (DirectX format)
m_imageLoader.RegisterLoader(Loaders::GetImageLoader_PCX()); // .pcx loader (1, 4, 8, 24 bits)
}
Core::~Core()
@@ -37,5 +82,65 @@ namespace Nz
Log::Uninitialize();
}
AnimationLoader& Core::GetAnimationLoader()
{
return m_animationLoader;
}
const AnimationLoader& Core::GetAnimationLoader() const
{
return m_animationLoader;
}
ImageLoader& Core::GetImageLoader()
{
return m_imageLoader;
}
const ImageLoader& Core::GetImageLoader() const
{
return m_imageLoader;
}
ImageStreamLoader& Core::GetImageStreamLoader()
{
return m_imageStreamLoader;
}
const ImageStreamLoader& Core::GetImageStreamLoader() const
{
return m_imageStreamLoader;
}
ImageSaver& Core::GetImageSaver()
{
return m_imageSaver;
}
const ImageSaver& Core::GetImageSaver() const
{
return m_imageSaver;
}
MeshLoader& Core::GetMeshLoader()
{
return m_meshLoader;
}
const MeshLoader& Core::GetMeshLoader() const
{
return m_meshLoader;
}
MeshSaver& Core::GetMeshSaver()
{
return m_meshSaver;
}
const MeshSaver& Core::GetMeshSaver() const
{
return m_meshSaver;
}
Core* Core::s_instance = nullptr;
}

View File

@@ -1,10 +1,9 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/DDSConstants.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Formats/DDSConstants.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -1,15 +1,15 @@
// Copyright (C) 2024 Cruden BV - 2020 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP
#define NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP
#ifndef NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP
#define NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/SerializationContext.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Serialization.hpp>
namespace Nz
{
@@ -369,9 +369,9 @@ namespace Nz
UInt32 reserved;
};
NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSHeader* header);
NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSHeaderDX10Ext* header);
NAZARA_UTILITY_API bool Unserialize(SerializationContext& context, DDSPixelFormat* pixelFormat);
NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSHeader* header);
NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSHeaderDX10Ext* header);
NAZARA_CORE_API bool Unserialize(SerializationContext& context, DDSPixelFormat* pixelFormat);
}
#endif // NAZARA_UTILITY_FORMATS_DDSCONSTANTS_HPP
#endif // NAZARA_CORE_FORMATS_DDSCONSTANTS_HPP

View File

@@ -1,14 +1,14 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) - 2009 Cruden BV
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/DDSLoader.hpp>
#include <Nazara/Core/Formats/DDSLoader.hpp>
#include <Nazara/Core/ByteStream.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Formats/DDSConstants.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/Formats/DDSConstants.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_DDSLOADER_HPP
#define NAZARA_UTILITY_FORMATS_DDSLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_DDSLOADER_HPP
#define NAZARA_CORE_FORMATS_DDSLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
namespace Nz::Loaders
{
ImageLoader::Entry GetImageLoader_DDS();
}
#endif // NAZARA_UTILITY_FORMATS_DDSLOADER_HPP
#endif // NAZARA_CORE_FORMATS_DDSLOADER_HPP

View File

@@ -1,17 +1,17 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/GIFLoader.hpp>
#include <Nazara/Core/Formats/GIFLoader.hpp>
#include <Nazara/Core/ByteStream.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Formats/STBLoader.hpp>
#include <Nazara/Core/Formats/STBLoader.hpp>
#include <NazaraUtils/Bitset.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
// based on https://www.w3.org/Graphics/GIF/spec-gif89a.txt, with help from the following public domain libraries source code:
// - https://github.com/lecram/gifdec

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_FORMATS_GIFLOADER_HPP
#define NAZARA_UTILITY_FORMATS_GIFLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_GIFLOADER_HPP
#define NAZARA_CORE_FORMATS_GIFLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/ImageStream.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/ImageStream.hpp>
namespace Nz::Loaders
{
ImageStreamLoader::Entry GetImageStreamLoader_GIF();
}
#endif // NAZARA_UTILITY_FORMATS_GIFLOADER_HPP
#endif // NAZARA_CORE_FORMATS_GIFLOADER_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/Formats/MD2Constants.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Formats/MD2Constants.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_MD2CONSTANTS_HPP
#define NAZARA_UTILITY_FORMATS_MD2CONSTANTS_HPP
#ifndef NAZARA_CORE_FORMATS_MD2CONSTANTS_HPP
#define NAZARA_CORE_FORMATS_MD2CONSTANTS_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Math/Vector3.hpp>
@@ -66,4 +66,4 @@ namespace Nz
extern const Vector3f md2Normals[162];
}
#endif // NAZARA_UTILITY_FORMATS_MD2CONSTANTS_HPP
#endif // NAZARA_CORE_FORMATS_MD2CONSTANTS_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
#include <Nazara/Utility/Formats/MD2Loader.hpp>
#include <Nazara/Core/Formats/MD2Loader.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Formats/MD2Constants.hpp>
#include <Nazara/Math/Quaternion.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Formats/MD2Constants.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <array>
#include <cassert>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_MD2LOADER_HPP
#define NAZARA_UTILITY_FORMATS_MD2LOADER_HPP
#ifndef NAZARA_CORE_FORMATS_MD2LOADER_HPP
#define NAZARA_CORE_FORMATS_MD2LOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Core/Mesh.hpp>
namespace Nz::Loaders
{
MeshLoader::Entry GetMeshLoader_MD2();
}
#endif // NAZARA_UTILITY_FORMATS_MD2LOADER_HPP
#endif // NAZARA_CORE_FORMATS_MD2LOADER_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/Utility/Formats/MD5AnimLoader.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Utility/Sequence.hpp>
#include <Nazara/Utility/Formats/MD5AnimParser.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Formats/MD5AnimLoader.hpp>
#include <Nazara/Core/Animation.hpp>
#include <Nazara/Core/Sequence.hpp>
#include <Nazara/Core/Formats/MD5AnimParser.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_MD5ANIMLOADER_HPP
#define NAZARA_UTILITY_FORMATS_MD5ANIMLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP
#define NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Animation.hpp>
#include <Nazara/Core/Animation.hpp>
namespace Nz::Loaders
{
AnimationLoader::Entry GetAnimationLoader_MD5Anim();
}
#endif // NAZARA_UTILITY_FORMATS_MD5ANIMLOADER_HPP
#endif // NAZARA_CORE_FORMATS_MD5ANIMLOADER_HPP

View File

@@ -1,13 +1,14 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/MD5AnimParser.hpp>
#include <Nazara/Core/Formats/MD5AnimParser.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <cstdio>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -80,7 +81,7 @@ namespace Nz
{
switch (m_currentLine[0])
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
case 'M': // MD5Version
if (GetWord(m_currentLine, 0) != "MD5Version")
UnrecognizedLine();
@@ -104,13 +105,13 @@ namespace Nz
return false;
}
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
break;
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
case 'c': // commandline
if (GetWord(m_currentLine, 0) != "commandline")
UnrecognizedLine();
@@ -138,7 +139,7 @@ namespace Nz
}
else if (std::sscanf(&m_currentLine[0], "frameRate %u", &m_frameRate) != 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
}
@@ -154,7 +155,7 @@ namespace Nz
return false;
}
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -165,7 +166,7 @@ namespace Nz
unsigned int count;
if (std::sscanf(&m_currentLine[0], "numAnimatedComponents %u", &count) == 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!m_animatedComponents.empty())
Warning("Animated components count is already defined");
#endif
@@ -174,7 +175,7 @@ namespace Nz
}
else if (std::sscanf(&m_currentLine[0], "numFrames %u", &count) == 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!m_frames.empty())
Warning("Frame count is already defined");
#endif
@@ -183,14 +184,14 @@ namespace Nz
}
else if (std::sscanf(&m_currentLine[0], "numJoints %u", &count) == 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!m_joints.empty())
Warning("Joint count is already defined");
#endif
m_joints.resize(count);
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -198,7 +199,7 @@ namespace Nz
}
default:
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;
@@ -295,7 +296,7 @@ namespace Nz
if (m_currentLine != "}")
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("Bounds braces closing not found");
#endif
@@ -336,7 +337,7 @@ namespace Nz
if (m_currentLine != "}")
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("Bounds braces closing not found");
#endif
@@ -430,7 +431,7 @@ namespace Nz
if (m_currentLine != "}")
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("Hierarchy braces closing not found");
#endif
@@ -493,7 +494,7 @@ namespace Nz
if (m_currentLine != "}")
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("Hierarchy braces closing not found");
#endif

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
#include <Nazara/Utility/Formats/MD5MeshLoader.hpp>
#include <Nazara/Utility/IndexIterator.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/SkeletalMesh.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Formats/MD5MeshParser.hpp>
#include <Nazara/Core/Formats/MD5MeshLoader.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/SkeletalMesh.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Formats/MD5MeshParser.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_MD5MESHLOADER_HPP
#define NAZARA_UTILITY_FORMATS_MD5MESHLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP
#define NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Core/Mesh.hpp>
namespace Nz::Loaders
{
MeshLoader::Entry GetMeshLoader_MD5Mesh();
}
#endif // NAZARA_UTILITY_FORMATS_MD5MESHLOADER_HPP
#endif // NAZARA_CORE_FORMATS_MD5MESHLOADER_HPP

View File

@@ -1,14 +1,15 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/MD5MeshParser.hpp>
#include <Nazara/Core/Formats/MD5MeshParser.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <cstdio>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -70,7 +71,7 @@ namespace Nz
{
switch (m_currentLine[0])
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
case 'M': // MD5Version
if (!StartsWith(m_currentLine, "MD5Version "))
UnrecognizedLine();
@@ -83,7 +84,7 @@ namespace Nz
#endif
case 'j': // joints
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!StartsWith(m_currentLine, "joints {"))
{
UnrecognizedLine();
@@ -100,7 +101,7 @@ namespace Nz
case 'm': // mesh
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!StartsWith(m_currentLine, "mesh {"))
{
UnrecognizedLine();
@@ -110,7 +111,7 @@ namespace Nz
if (m_meshIndex >= m_meshes.size())
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("More meshes than registred");
#endif
@@ -132,7 +133,7 @@ namespace Nz
unsigned int count;
if (std::sscanf(&m_currentLine[0], "numJoints %u", &count) == 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!m_joints.empty())
Warning("Joint count is already defined");
#endif
@@ -141,14 +142,14 @@ namespace Nz
}
else if (std::sscanf(&m_currentLine[0], "numMeshes %u", &count) == 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!m_meshes.empty())
Warning("Mesh count is already defined");
#endif
m_meshes.resize(count);
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -156,7 +157,7 @@ namespace Nz
}
default:
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;
@@ -270,7 +271,7 @@ namespace Nz
if (m_currentLine != "}")
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
Warning("Hierarchy braces closing not found");
#endif
@@ -294,7 +295,7 @@ namespace Nz
case 's': // shader
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!StartsWith(m_currentLine, "shader "))
{
UnrecognizedLine();
@@ -306,7 +307,7 @@ namespace Nz
shader = shader.substr(7);
if (shader.empty())
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;
@@ -314,7 +315,7 @@ namespace Nz
if (shader.empty())
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;
@@ -403,7 +404,7 @@ namespace Nz
}
}
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -411,7 +412,7 @@ namespace Nz
}
default:
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;
@@ -436,7 +437,7 @@ namespace Nz
return false;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!finished)
Warning("Mesh braces closing not found");
#endif

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
#include <Nazara/Utility/Formats/MTLParser.hpp>
#include <Nazara/Core/Formats/MTLParser.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <cstdio>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -67,7 +67,7 @@ namespace Nz
currentMaterial->bumpMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -87,7 +87,7 @@ namespace Nz
currentMaterial->alpha = alpha;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -102,7 +102,7 @@ namespace Nz
currentMaterial->decalMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -117,7 +117,7 @@ namespace Nz
currentMaterial->displacementMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -138,7 +138,7 @@ namespace Nz
currentMaterial->emissiveMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -158,7 +158,7 @@ namespace Nz
currentMaterial->ambient = Color(r, g, b);
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -173,7 +173,7 @@ namespace Nz
currentMaterial->diffuse = Color(r, g, b);
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -188,7 +188,7 @@ namespace Nz
currentMaterial->specular = Color(r, g, b);
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -209,7 +209,7 @@ namespace Nz
currentMaterial->illumModel = model;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -229,7 +229,7 @@ namespace Nz
currentMaterial->ambientMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -244,7 +244,7 @@ namespace Nz
currentMaterial->diffuseMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -259,7 +259,7 @@ namespace Nz
currentMaterial->specularMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -274,7 +274,7 @@ namespace Nz
currentMaterial->bumpMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -289,7 +289,7 @@ namespace Nz
currentMaterial->alphaMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -304,7 +304,7 @@ namespace Nz
currentMaterial->decalMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -319,7 +319,7 @@ namespace Nz
currentMaterial->displacementMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -334,7 +334,7 @@ namespace Nz
currentMaterial->reflectionMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -349,7 +349,7 @@ namespace Nz
currentMaterial->normalMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -365,7 +365,7 @@ namespace Nz
currentMaterial->emissiveMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -385,7 +385,7 @@ namespace Nz
currentMaterial->refractionIndex = density;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -400,7 +400,7 @@ namespace Nz
currentMaterial->shininess = coef;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -415,7 +415,7 @@ namespace Nz
currentMaterial->normalMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -425,7 +425,7 @@ namespace Nz
std::string materialName = m_currentLine.substr(offset);
if (!materialName.empty())
currentMaterial = AddMaterial(materialName);
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -445,7 +445,7 @@ namespace Nz
currentMaterial->reflectionMap = map;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -465,7 +465,7 @@ namespace Nz
currentMaterial->alpha = 1.f - alpha; // tr vaut pour la "valeur de transparence", 0 = opaque
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else
UnrecognizedLine();
#endif
@@ -474,7 +474,7 @@ namespace Nz
}
default:
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
UnrecognizedLine();
#endif
break;

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
#include <Nazara/Utility/Formats/OBJLoader.hpp>
#include <Nazara/Core/Formats/OBJLoader.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Formats/MTLParser.hpp>
#include <Nazara/Utility/Formats/OBJParser.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Formats/MTLParser.hpp>
#include <Nazara/Core/Formats/OBJParser.hpp>
#include <limits>
#include <memory>
#include <unordered_map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
// TODO: Use only one index buffer / vertex buffer for all submeshes

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_FORMATS_OBJLOADER_HPP
#define NAZARA_UTILITY_FORMATS_OBJLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_OBJLOADER_HPP
#define NAZARA_CORE_FORMATS_OBJLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Core/Mesh.hpp>
namespace Nz::Loaders
{
MeshLoader::Entry GetMeshLoader_OBJ();
}
#endif // NAZARA_UTILITY_FORMATS_OBJLOADER_HPP
#endif // NAZARA_CORE_FORMATS_OBJLOADER_HPP

View File

@@ -1,17 +1,18 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/OBJParser.hpp>
#include <Nazara/Core/Formats/OBJParser.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <NazaraUtils/PathUtils.hpp>
#include <tsl/ordered_map.h>
#include <cctype>
#include <memory>
#include <unordered_map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -169,7 +170,7 @@ namespace Nz
{
if (m_currentLine.size() < 7) // Since we only treat triangles, this is the minimum length of a face line (f 1 2 3)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -179,7 +180,7 @@ namespace Nz
std::size_t vertexCount = std::count(m_currentLine.begin(), m_currentLine.end(), ' ');
if (vertexCount < 3)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -212,7 +213,7 @@ namespace Nz
{
if (std::sscanf(&m_currentLine[pos], "%d%n", &p, &offset) != 1)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -301,7 +302,7 @@ namespace Nz
const char prefix[] = "mtllib ";
if (!StartsWith(m_currentLine, prefix))
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -318,7 +319,7 @@ namespace Nz
{
if (m_currentLine.size() <= 2 || m_currentLine[1] != ' ')
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -328,7 +329,7 @@ namespace Nz
std::string objectName = m_currentLine.substr(2);
if (objectName.empty())
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -340,7 +341,7 @@ namespace Nz
break;
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
case 's': //< Smooth
if (m_currentLine.size() <= 2 || m_currentLine[1] == ' ')
{
@@ -361,7 +362,7 @@ namespace Nz
const char prefix[] = "usemtl ";
if (!StartsWith(m_currentLine, prefix))
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -372,7 +373,7 @@ namespace Nz
std::string newMatName = m_currentLine.substr(sizeof(prefix) - 1);
if (newMatName.empty())
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -388,7 +389,7 @@ namespace Nz
{
if (m_currentLine.size() < 7)
{
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -401,7 +402,7 @@ namespace Nz
unsigned int paramCount = std::sscanf(&m_currentLine[2], " %f %f %f %f", &vertex.x, &vertex.y, &vertex.z, &vertex.w);
if (paramCount >= 1)
m_positions.push_back(vertex);
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else if (!UnrecognizedLine())
return false;
#endif
@@ -412,7 +413,7 @@ namespace Nz
unsigned int paramCount = std::sscanf(&m_currentLine[3], " %f %f %f", &normal.x, &normal.y, &normal.z);
if (paramCount == 3)
m_normals.push_back(normal);
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else if (!UnrecognizedLine())
return false;
#endif
@@ -423,12 +424,12 @@ namespace Nz
unsigned int paramCount = std::sscanf(&m_currentLine[3], " %f %f %f", &uvw.x, &uvw.y, &uvw.z);
if (paramCount >= 2)
m_texCoords.push_back(uvw);
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else if (!UnrecognizedLine())
return false;
#endif
}
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
else if (!UnrecognizedLine())
return false;
#endif
@@ -437,7 +438,7 @@ namespace Nz
}
default:
#if NAZARA_UTILITY_STRICT_RESOURCE_PARSING
#if NAZARA_CORE_STRICT_RESOURCE_PARSING
if (!UnrecognizedLine())
return false;
#endif
@@ -669,4 +670,10 @@ namespace Nz
return true;
}
void OBJParser::Flush() const
{
m_currentStream->Write(std::move(m_outputStream).str());
m_outputStream.str({});
}
}

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
#include <Nazara/Utility/Formats/OBJSaver.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/TriangleIterator.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Formats/MTLParser.hpp>
#include <Nazara/Utility/Formats/OBJParser.hpp>
#include <Nazara/Core/Formats/OBJSaver.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/TriangleIterator.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Formats/MTLParser.hpp>
#include <Nazara/Core/Formats/OBJParser.hpp>
#include <map>
#include <unordered_set>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_OBJSAVER_HPP
#define NAZARA_UTILITY_FORMATS_OBJSAVER_HPP
#ifndef NAZARA_CORE_FORMATS_OBJSAVER_HPP
#define NAZARA_CORE_FORMATS_OBJSAVER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Core/Mesh.hpp>
namespace Nz::Loaders
{
MeshSaver::Entry GetMeshSaver_OBJ();
}
#endif // NAZARA_UTILITY_FORMATS_OBJSAVER_HPP
#endif // NAZARA_CORE_FORMATS_OBJSAVER_HPP

View File

@@ -1,14 +1,14 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/PCXLoader.hpp>
#include <Nazara/Core/Formats/PCXLoader.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Utility/Image.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
// Auteur du loader original : David Henry

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_FORMATS_PCXLOADER_HPP
#define NAZARA_UTILITY_FORMATS_PCXLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_PCXLOADER_HPP
#define NAZARA_CORE_FORMATS_PCXLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
namespace Nz::Loaders
{
ImageLoader::Entry GetImageLoader_PCX();
}
#endif // NAZARA_UTILITY_FORMATS_PCXLOADER_HPP
#endif // NAZARA_CORE_FORMATS_PCXLOADER_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/Formats/STBLoader.hpp>
#include <Nazara/Core/Formats/STBLoader.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/Stream.hpp>
#include <Nazara/Utility/Image.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <frozen/string.h>
@@ -15,7 +15,7 @@
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_STBLOADER_HPP
#define NAZARA_UTILITY_FORMATS_STBLOADER_HPP
#ifndef NAZARA_CORE_FORMATS_STBLOADER_HPP
#define NAZARA_CORE_FORMATS_STBLOADER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
namespace Nz::Loaders
{
ImageLoader::Entry GetImageLoader_STB();
}
#endif // NAZARA_UTILITY_FORMATS_STBLOADER_HPP
#endif // NAZARA_CORE_FORMATS_STBLOADER_HPP

View File

@@ -1,17 +1,17 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Formats/STBSaver.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Formats/STBLoader.hpp>
#include <Nazara/Core/Formats/STBSaver.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/Formats/STBLoader.hpp>
#include <frozen/string.h>
#include <frozen/unordered_map.h>
#include <stdexcept>
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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_FORMATS_STBSAVER_HPP
#define NAZARA_UTILITY_FORMATS_STBSAVER_HPP
#ifndef NAZARA_CORE_FORMATS_STBSAVER_HPP
#define NAZARA_CORE_FORMATS_STBSAVER_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
namespace Nz::Loaders
{
ImageSaver::Entry GetImageSaver_STB();
}
#endif // NAZARA_UTILITY_FORMATS_STBSAVER_HPP
#endif // NAZARA_CORE_FORMATS_STBSAVER_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/GuillotineImageAtlas.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/GuillotineImageAtlas.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -1,17 +1,17 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <memory>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
///TODO: Rajouter des warnings (Formats compressés avec les méthodes Copy/Update, tests taille dans Copy)
///TODO: Rendre les méthodes exception-safe (faire usage du RAII)
@@ -80,7 +80,7 @@ namespace Nz
bool Image::Convert(PixelFormat newFormat)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -158,7 +158,7 @@ namespace Nz
NazaraAssert(source.GetFormat() == m_sharedImage->format, "image formats don't match");
const UInt8* srcPtr = source.GetConstPixels(srcBox.x, srcBox.y, srcBox.z);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!srcPtr)
{
NazaraError("failed to access pixels");
@@ -176,7 +176,7 @@ namespace Nz
{
Destroy();
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!PixelFormatInfo::IsValid(format))
{
NazaraError("invalid pixel format");
@@ -296,7 +296,7 @@ namespace Nz
{
///FIXME: Pourquoi cette méthode alloue une nouvelle image plutôt que de remplir l'existante ?
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -361,7 +361,7 @@ namespace Nz
bool Image::Fill(const Color& color, const Boxui& box)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -427,7 +427,7 @@ namespace Nz
bool Image::Fill(const Color& color, const Rectui& rect, unsigned int z)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -493,7 +493,7 @@ namespace Nz
bool Image::FlipHorizontally()
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -530,7 +530,7 @@ namespace Nz
bool Image::FlipVertically()
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -573,7 +573,7 @@ namespace Nz
const UInt8* Image::GetConstPixels(unsigned int x, unsigned int y, unsigned int z, UInt8 level) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -588,7 +588,7 @@ namespace Nz
#endif
unsigned int width = GetImageLevelSize(m_sharedImage->width, level);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (x >= width)
{
NazaraErrorFmt("x value exceeds width ({0} >= {1})", x, width);
@@ -597,7 +597,7 @@ namespace Nz
#endif
unsigned int height = GetImageLevelSize(m_sharedImage->height, level);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (y >= height)
{
NazaraErrorFmt("y value exceeds height ({0} >= {1})", y, height);
@@ -617,7 +617,7 @@ namespace Nz
unsigned int Image::GetDepth(UInt8 level) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (level >= m_sharedImage->levels.size())
{
NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size());
@@ -635,7 +635,7 @@ namespace Nz
unsigned int Image::GetHeight(UInt8 level) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (level >= m_sharedImage->levels.size())
{
NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size());
@@ -690,7 +690,7 @@ namespace Nz
Color Image::GetPixelColor(unsigned int x, unsigned int y, unsigned int z) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -734,7 +734,7 @@ namespace Nz
UInt8* Image::GetPixels(unsigned int x, unsigned int y, unsigned int z, UInt8 level)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -749,7 +749,7 @@ namespace Nz
#endif
unsigned int width = GetImageLevelSize(m_sharedImage->width, level);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (x >= width)
{
NazaraErrorFmt("x value exceeds width ({0} >= {1})", x, width);
@@ -758,7 +758,7 @@ namespace Nz
#endif
unsigned int height = GetImageLevelSize(m_sharedImage->height, level);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (y >= height)
{
NazaraErrorFmt("y value exceeds height ({0} >= {1})", y, height);
@@ -786,7 +786,7 @@ namespace Nz
Vector3ui Image::GetSize(UInt8 level) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (level >= m_sharedImage->levels.size())
{
NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size());
@@ -804,7 +804,7 @@ namespace Nz
unsigned int Image::GetWidth(UInt8 level) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (level >= m_sharedImage->levels.size())
{
NazaraErrorFmt("level out of bounds ({0} >= {1})", level, m_sharedImage->levels.size());
@@ -874,7 +874,7 @@ namespace Nz
{
NazaraAssert(image.IsValid(), "invalid image");
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (atlasSize.x == 0)
{
NazaraError("atlas width must be over zero");
@@ -890,7 +890,7 @@ namespace Nz
ImageType type = image.GetType();
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (type != ImageType::E1D && type != ImageType::E2D)
{
NazaraErrorFmt("image type not handled ({0:#x})", UnderlyingCast(type));
@@ -971,7 +971,7 @@ namespace Nz
{
NazaraAssert(image.IsValid(), "invalid image");
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
ImageType type = image.GetType();
if (type != ImageType::E2D)
{
@@ -1140,23 +1140,23 @@ namespace Nz
bool Image::SaveToFile(const std::filesystem::path& filePath, const ImageParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageSaver().SaveToFile(*this, filePath, params);
return core->GetImageSaver().SaveToFile(*this, filePath, params);
}
bool Image::SaveToStream(Stream& stream, std::string_view format, const ImageParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageSaver().SaveToStream(*this, stream, format, params);
return core->GetImageSaver().SaveToStream(*this, stream, format, params);
}
void Image::SetLevelCount(UInt8 levelCount)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("Image must be valid");
@@ -1187,7 +1187,7 @@ namespace Nz
bool Image::SetPixelColor(const Color& color, unsigned int x, unsigned int y, unsigned int z)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -1233,7 +1233,7 @@ namespace Nz
bool Image::Update(const void* pixels, const Boxui& box, unsigned int srcWidth, unsigned int srcHeight, UInt8 level)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (m_sharedImage == &emptyImage)
{
NazaraError("image must be valid");
@@ -1256,7 +1256,7 @@ namespace Nz
unsigned int width = GetImageLevelSize(m_sharedImage->width, level);
unsigned int height = GetImageLevelSize(m_sharedImage->height, level);
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!box.IsValid())
{
NazaraError("invalid box");
@@ -1298,7 +1298,7 @@ namespace Nz
void Image::Copy(UInt8* destination, const UInt8* source, PixelFormat format, unsigned int width, unsigned int height, unsigned int depth, unsigned int dstWidth, unsigned int dstHeight, unsigned int srcWidth, unsigned int srcHeight)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (width == 0)
NazaraError("width must be greater than zero");
if (height == 0)
@@ -1378,26 +1378,26 @@ namespace Nz
std::shared_ptr<Image> Image::LoadFromFile(const std::filesystem::path& filePath, const ImageParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageLoader().LoadFromFile(filePath, params);
return core->GetImageLoader().LoadFromFile(filePath, params);
}
std::shared_ptr<Image> Image::LoadFromMemory(const void* data, std::size_t size, const ImageParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageLoader().LoadFromMemory(data, size, params);
return core->GetImageLoader().LoadFromMemory(data, size, params);
}
std::shared_ptr<Image> Image::LoadFromStream(Stream& stream, const ImageParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageLoader().LoadFromStream(stream, params);
return core->GetImageLoader().LoadFromStream(stream, params);
}
void Image::EnsureOwnership()

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/ImageStream.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/ImageStream.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -26,10 +26,10 @@ namespace Nz
*/
std::shared_ptr<ImageStream> ImageStream::OpenFromFile(const std::filesystem::path& filePath, const ImageStreamParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageStreamLoader().LoadFromFile(filePath, params);
return core->GetImageStreamLoader().LoadFromFile(filePath, params);
}
/*!
@@ -44,10 +44,10 @@ namespace Nz
*/
std::shared_ptr<ImageStream> ImageStream::OpenFromMemory(const void* data, std::size_t size, const ImageStreamParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageStreamLoader().LoadFromMemory(data, size, params);
return core->GetImageStreamLoader().LoadFromMemory(data, size, params);
}
/*!
@@ -61,9 +61,9 @@ namespace Nz
*/
std::shared_ptr<ImageStream> ImageStream::OpenFromStream(Stream& stream, const ImageStreamParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetImageStreamLoader().LoadFromStream(stream, params);
return core->GetImageStreamLoader().LoadFromStream(stream, params);
}
}

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
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/IndexIterator.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/IndexMapper.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Utility/IndexIterator.hpp>
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
#include <Nazara/Core/IndexIterator.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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

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
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Buffer.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Enums.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/IndexMapper.hpp>
#include <Nazara/Core/PrimitiveList.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/IndexMapper.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <limits>
#include <memory>
#include <unordered_map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -545,18 +545,18 @@ namespace Nz
bool Mesh::SaveToFile(const std::filesystem::path& filePath, const MeshParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetMeshSaver().SaveToFile(*this, filePath, params);
return core->GetMeshSaver().SaveToFile(*this, filePath, params);
}
bool Mesh::SaveToStream(Stream& stream, std::string_view format, const MeshParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetMeshSaver().SaveToStream(*this, stream, format, params);
return core->GetMeshSaver().SaveToStream(*this, stream, format, params);
}
void Mesh::SetAnimation(const std::filesystem::path& animationPath)
@@ -623,25 +623,25 @@ namespace Nz
std::shared_ptr<Mesh> Mesh::LoadFromFile(const std::filesystem::path& filePath, const MeshParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetMeshLoader().LoadFromFile(filePath, params);
return core->GetMeshLoader().LoadFromFile(filePath, params);
}
std::shared_ptr<Mesh> Mesh::LoadFromMemory(const void* data, std::size_t size, const MeshParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetMeshLoader().LoadFromMemory(data, size, params);
return core->GetMeshLoader().LoadFromMemory(data, size, params);
}
std::shared_ptr<Mesh> Mesh::LoadFromStream(Stream& stream, const MeshParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
Core* core = Core::Instance();
NazaraAssert(core, "Core module has not been initialized");
return utility->GetMeshLoader().LoadFromStream(stream, params);
return core->GetMeshLoader().LoadFromStream(stream, params);
}
}

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/Node.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Node.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -22,11 +22,6 @@ namespace Nz
SetParent(nullptr);
}
NodeType Node::GetNodeType() const
{
return NodeType::Default;
}
Node& Node::Interpolate(const Node& nodeA, const Node& nodeB, float interpolation, CoordSys coordSys, Invalidation invalidation)
{
switch (coordSys)
@@ -106,7 +101,7 @@ namespace Nz
void Node::SetParent(const Node* node, bool keepDerived, Invalidation invalidation)
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
// On vérifie que le node n'est pas son propre parent
const Node* parentNode = node;
while (parentNode)

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/Utility/PixelFormat.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <NazaraUtils/Endianness.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
@@ -1413,7 +1413,7 @@ namespace Nz
{
// Flipping générique
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (IsCompressed(format))
{
NazaraError("no function to flip compressed format");

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Posix/FileImpl.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <NazaraUtils/Algorithm.hpp>

View File

@@ -2,8 +2,7 @@
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/SerializationContext.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Serialization.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Debug.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/SkeletalMesh.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/SkeletalMesh.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/Skeleton.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Core/Joint.hpp>
#include <NazaraUtils/StringHash.hpp>
#include <unordered_map>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/SoftwareBuffer.hpp>
#include <Nazara/Core/SoftwareBuffer.hpp>
#include <Nazara/Core/Error.hpp>
#include <cstring>
#include <exception>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/StaticMesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/StdLogger.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <cstdio>
#include <Nazara/Core/Debug.hpp>

View File

@@ -3,10 +3,10 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <NazaraUtils/FunctionTraits.hpp>
#include <utf8cpp/utf8.h>
#include <array>
#include <cinttypes>
#include <Nazara/Core/Debug.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
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/TriangleIterator.hpp>
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/TriangleIterator.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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
#include <Nazara/Utility/Systems/SkeletonSystem.hpp>
#include <Nazara/Core/Systems/SkeletonSystem.hpp>
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Utility/Components/NodeComponent.hpp>
#include <Nazara/Utility/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Utility/Components/SkeletonComponent.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Core/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Core/Components/SkeletonComponent.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/Utility/Systems/VelocitySystem.hpp>
#include <Nazara/Core/Systems/VelocitySystem.hpp>
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Utility/Components/NodeComponent.hpp>
#include <Nazara/Utility/Components/VelocityComponent.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Core/Components/VelocityComponent.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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

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/Utility/UniformBuffer.hpp>
#include <Nazara/Core/UniformBuffer.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

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/VertexBuffer.hpp>
#include <Nazara/Core/VertexBuffer.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.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
#include <Nazara/Utility/VertexDeclaration.hpp>
#include <Nazara/Core/VertexDeclaration.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/VertexStruct.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Utility/VertexStruct.hpp>
#include <NazaraUtils/OffsetOf.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -1,14 +1,14 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Utility module"
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VertexMapper.hpp>
#include <Nazara/Core/VertexMapper.hpp>
#include <Nazara/Core/BufferMapper.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/SkeletalMesh.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/SubMesh.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/Core/SkeletalMesh.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/SubMesh.hpp>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{

View File

@@ -3,11 +3,11 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Formats/ModelMeshLoader.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Mesh.hpp>
#include <Nazara/Graphics/GraphicalMesh.hpp>
#include <Nazara/Graphics/MaterialInstance.hpp>
#include <Nazara/Graphics/Model.hpp>
#include <Nazara/Utility/Mesh.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz::Loaders
@@ -17,7 +17,7 @@ namespace Nz::Loaders
ModelLoader::Entry loaderEntry;
loaderEntry.extensionSupport = [](std::string_view extension)
{
return Utility::Instance()->GetMeshLoader().IsExtensionSupported(extension);
return Core::Instance()->GetMeshLoader().IsExtensionSupported(extension);
};
loaderEntry.streamLoader = [](Stream& stream, const ModelParams& parameters) -> Result<std::shared_ptr<Model>, ResourceLoadingError>

View File

@@ -3,10 +3,10 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Formats/TextureLoader.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Renderer/Texture.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz
@@ -18,7 +18,7 @@ namespace Nz
MaterialInstanceLoader::Entry loaderEntry;
loaderEntry.extensionSupport = [](std::string_view extension)
{
return Utility::Instance()->GetImageLoader().IsExtensionSupported(extension);
return Core::Instance()->GetImageLoader().IsExtensionSupported(extension);
};
loaderEntry.streamLoader = [](Stream& stream, const MaterialInstanceParams& parameters) -> Result<std::shared_ptr<MaterialInstance>, ResourceLoadingError>

View File

@@ -6,8 +6,8 @@
// https://themaister.net/blog/2017/08/15/render-graphs-and-vulkan-a-deep-dive/
#include <Nazara/Graphics/FrameGraph.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/Bitset.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <stdexcept>

View File

@@ -3,9 +3,9 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/GraphicalMesh.hpp>
#include <Nazara/Core/SoftwareBuffer.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Utility/SoftwareBuffer.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <cassert>
#include <Nazara/Graphics/Debug.hpp>

View File

@@ -18,7 +18,7 @@
#include <Nazara/Graphics/Formats/ModelMeshLoader.hpp>
#include <Nazara/Graphics/Formats/PipelinePassListLoader.hpp>
#include <Nazara/Graphics/Formats/TextureLoader.hpp>
#include <Nazara/Utility/Font.hpp>
#include <Nazara/TextRenderer/Font.hpp>
#include <NZSL/Ast/AstSerializer.hpp>
#include <NZSL/Ast/Module.hpp>
#include <array>

View File

@@ -3,6 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/MaterialInstance.hpp>
#include <Nazara/Core/MaterialData.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/Material.hpp>
#include <Nazara/Graphics/MaterialPass.hpp>
@@ -10,7 +11,6 @@
#include <Nazara/Renderer/CommandBufferBuilder.hpp>
#include <Nazara/Renderer/RenderResources.hpp>
#include <Nazara/Renderer/UploadPool.hpp>
#include <Nazara/Utility/MaterialData.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz
@@ -451,7 +451,7 @@ namespace Nz
std::shared_ptr<MaterialInstance> MaterialInstance::GetDefault(MaterialType materialType, MaterialInstancePreset preset)
{
Graphics* graphics = Graphics::Instance();
NazaraAssert(graphics, "Utility module has not been initialized");
NazaraAssert(graphics, "Core module has not been initialized");
return graphics->GetDefaultMaterials().materials[materialType].presets[preset];
}
@@ -459,7 +459,7 @@ namespace Nz
std::shared_ptr<MaterialInstance> MaterialInstance::LoadFromFile(const std::filesystem::path& filePath, const MaterialInstanceParams& params)
{
Graphics* graphics = Graphics::Instance();
NazaraAssert(graphics, "Utility module has not been initialized");
NazaraAssert(graphics, "Core module has not been initialized");
return graphics->GetMaterialInstanceLoader().LoadFromFile(filePath, params);
}
@@ -467,7 +467,7 @@ namespace Nz
std::shared_ptr<MaterialInstance> MaterialInstance::LoadFromMemory(const void* data, std::size_t size, const MaterialInstanceParams& params)
{
Graphics* graphics = Graphics::Instance();
NazaraAssert(graphics, "Utility module has not been initialized");
NazaraAssert(graphics, "Core module has not been initialized");
return graphics->GetMaterialInstanceLoader().LoadFromMemory(data, size, params);
}
@@ -475,7 +475,7 @@ namespace Nz
std::shared_ptr<MaterialInstance> MaterialInstance::LoadFromStream(Stream& stream, const MaterialInstanceParams& params)
{
Graphics* graphics = Graphics::Instance();
NazaraAssert(graphics, "Utility module has not been initialized");
NazaraAssert(graphics, "Core module has not been initialized");
return graphics->GetMaterialInstanceLoader().LoadFromStream(stream, params);
}

View File

@@ -4,12 +4,12 @@
#include <Nazara/Graphics/SkeletonInstance.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Graphics/PredefinedShaderStructs.hpp>
#include <Nazara/Renderer/CommandBufferBuilder.hpp>
#include <Nazara/Renderer/RenderResources.hpp>
#include <Nazara/Renderer/UploadPool.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz

View File

@@ -4,6 +4,9 @@
#include <Nazara/Graphics/Systems/RenderSystem.hpp>
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Core/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Core/Components/SkeletonComponent.hpp>
#include <Nazara/Graphics/ForwardFramePipeline.hpp>
#include <Nazara/Graphics/ViewerInstance.hpp>
#include <Nazara/Graphics/WorldInstance.hpp>
@@ -13,9 +16,6 @@
#include <Nazara/Renderer/RenderResources.hpp>
#include <Nazara/Renderer/UploadPool.hpp>
#include <Nazara/Renderer/WindowSwapchain.hpp>
#include <Nazara/Utility/Components/NodeComponent.hpp>
#include <Nazara/Utility/Components/SharedSkeletonComponent.hpp>
#include <Nazara/Utility/Components/SkeletonComponent.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz

View File

@@ -7,7 +7,8 @@
#include <Nazara/Graphics/MaterialInstance.hpp>
#include <Nazara/Graphics/RenderSpriteChain.hpp>
#include <Nazara/Graphics/WorldInstance.hpp>
#include <Nazara/Utility/AbstractTextDrawer.hpp>
#include <Nazara/TextRenderer/AbstractTextDrawer.hpp>
#include <Nazara/TextRenderer/Font.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <Nazara/Graphics/Debug.hpp>

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/AbstractSocket.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Algorithm.hpp>

View File

@@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/IpAddress.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Algorithm.hpp>

View File

@@ -3,10 +3,10 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/Posix/IpAddressImpl.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Posix/SocketImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <cstring>
#include <Nazara/Network/Debug.hpp>

View File

@@ -3,12 +3,12 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/Posix/SocketImpl.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Algorithm.hpp>
#include <Nazara/Network/NetBuffer.hpp>
#include <Nazara/Network/Posix/IpAddressImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <cstring>

View File

@@ -3,10 +3,10 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/SocketPoller.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Algorithm.hpp>
#include <NazaraUtils/Algorithm.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Network/Win32/SocketPollerImpl.hpp>

View File

@@ -3,10 +3,10 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/Win32/IpAddressImpl.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Win32/SocketImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <cstring>
#include <Nazara/Network/Debug.hpp>

View File

@@ -3,11 +3,11 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/Win32/SocketImpl.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Win32/IpAddressImpl.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp>
@@ -975,7 +975,7 @@ namespace Nz
case WSAEALREADY:
case WSAEISCONN:
case WSAEWOULDBLOCK:
NazaraWarning("Internal error occurred: " + Error::GetLastSystemError(error) + " (" + NumberToString(error) + ')');
NazaraWarningFmt("Internal error occurred: {0} ({1:#x})", Error::GetLastSystemError(error), error);
return SocketError::Internal;
case WSAEADDRNOTAVAIL:
@@ -1020,7 +1020,7 @@ namespace Nz
return SocketError::TimedOut;
}
NazaraWarning("Unhandled WinSock error: " + Error::GetLastSystemError(error) + " (" + NumberToString(error) + ')');
NazaraWarningFmt("Unhandled WinSock error: {0} ({1:#x})", Error::GetLastSystemError(error), error);
return SocketError::Unknown;
}

View File

@@ -3,11 +3,11 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/OpenGLRenderer/OpenGLShaderBinding.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/OpenGLRenderer/OpenGLBuffer.hpp>
#include <Nazara/OpenGLRenderer/OpenGLRenderPipelineLayout.hpp>
#include <Nazara/OpenGLRenderer/OpenGLTexture.hpp>
#include <Nazara/OpenGLRenderer/OpenGLTextureSampler.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/StackVector.hpp>
#include <Nazara/OpenGLRenderer/Debug.hpp>
@@ -15,7 +15,7 @@ namespace Nz
{
void OpenGLShaderBinding::Apply(const OpenGLRenderPipelineLayout& pipelineLayout, UInt32 setIndex, const GL::Context& context) const
{
//TODO: Check layout compaitiblity
//TODO: Check layout compatibility
const auto& bindingMapping = pipelineLayout.GetBindingMapping();
const auto& layoutInfo = pipelineLayout.GetLayoutInfo();

View File

@@ -3,7 +3,7 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/OpenGLRenderer/OpenGLTexture.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <NazaraUtils/CallOnExit.hpp>
#include <stdexcept>
#include <Nazara/OpenGLRenderer/Debug.hpp>

View File

@@ -3,8 +3,8 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Physics2D/Systems/Physics2DSystem.hpp>
#include <Nazara/Utility/Components/NodeComponent.hpp>
#include <Nazara/Physics2D/Debug.hpp>
namespace Nz

View File

@@ -3,13 +3,13 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Physics3D/Collider3D.hpp>
#include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/IndexBuffer.hpp>
#include <Nazara/Core/PrimitiveList.hpp>
#include <Nazara/Core/SoftwareBuffer.hpp>
#include <Nazara/Core/StaticMesh.hpp>
#include <Nazara/Core/VertexBuffer.hpp>
#include <Nazara/Physics3D/JoltHelper.hpp>
#include <Nazara/Utility/Algorithm.hpp>
#include <Nazara/Utility/IndexBuffer.hpp>
#include <Nazara/Utility/SoftwareBuffer.hpp>
#include <Nazara/Utility/StaticMesh.hpp>
#include <Nazara/Utility/VertexBuffer.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <Jolt/Core/Core.h>
#include <Jolt/Physics/Collision/Shape/BoxShape.h>

View File

@@ -4,8 +4,8 @@
#include <Nazara/Physics3D/Systems/Physics3DSystem.hpp>
#include <Nazara/Core/Components/DisabledComponent.hpp>
#include <Nazara/Core/Components/NodeComponent.hpp>
#include <Nazara/Physics3D/PhysBody3D.hpp>
#include <Nazara/Utility/Components/NodeComponent.hpp>
#include <Nazara/Physics3D/Debug.hpp>
namespace Nz

View File

@@ -4,7 +4,7 @@
#include <Nazara/Platform/SDL2/CursorImpl.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <array>
#include <Nazara/Platform/Debug.hpp>

View File

@@ -8,9 +8,9 @@
#define NAZARA_PLATFORM_SDL2_CURSORIMPL_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Utility/Image.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <SDL_mouse.h>

View File

@@ -4,8 +4,8 @@
#include <Nazara/Platform/SDL2/IconImpl.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/PixelFormat.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Core/PixelFormat.hpp>
#include <Nazara/Platform/Debug.hpp>
namespace Nz

View File

@@ -8,7 +8,7 @@
#define NAZARA_PLATFORM_SDL2_ICONIMPL_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Core/Image.hpp>
#include <NazaraUtils/MovablePtr.hpp>
#include <SDL_surface.h>

View File

@@ -5,13 +5,13 @@
#include <Nazara/Platform/SDL2/WindowImpl.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ErrorFlags.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Cursor.hpp>
#include <Nazara/Platform/Icon.hpp>
#include <Nazara/Platform/SDL2/CursorImpl.hpp>
#include <Nazara/Platform/SDL2/IconImpl.hpp>
#include <Nazara/Platform/SDL2/SDLHelper.hpp>
#include <Nazara/Utility/Image.hpp>
#include <SDL.h>
#ifdef NAZARA_PLATFORM_MACOS

View File

@@ -3,13 +3,13 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Renderer/DebugDrawer.hpp>
#include <Nazara/Core/Joint.hpp>
#include <Nazara/Core/Skeleton.hpp>
#include <Nazara/Renderer/CommandBufferBuilder.hpp>
#include <Nazara/Renderer/RenderDevice.hpp>
#include <Nazara/Renderer/RenderPipeline.hpp>
#include <Nazara/Renderer/RenderPipelineLayout.hpp>
#include <Nazara/Renderer/RenderResources.hpp>
#include <Nazara/Utility/Joint.hpp>
#include <Nazara/Utility/Skeleton.hpp>
#include <NZSL/Serializer.hpp>
#include <NZSL/Ast/AstSerializer.hpp>
#include <NZSL/Math/FieldOffsets.hpp>

View File

@@ -4,8 +4,8 @@
#include <Nazara/Renderer/Texture.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Image.hpp>
#include <Nazara/Renderer/RenderDevice.hpp>
#include <Nazara/Utility/Image.hpp>
#include <Nazara/Renderer/Debug.hpp>
namespace Nz

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 - Text renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/AbstractTextDrawer.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/TextRenderer/AbstractTextDrawer.hpp>
#include <Nazara/TextRenderer/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 - Text renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Font.hpp>
#include <Nazara/TextRenderer/Font.hpp>
#include <Nazara/Core/Config.hpp>
#include <Nazara/Core/GuillotineImageAtlas.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/FontData.hpp>
#include <Nazara/Utility/FontGlyph.hpp>
#include <Nazara/Utility/GuillotineImageAtlas.hpp>
#include <Nazara/Utility/Utility.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/TextRenderer/FontData.hpp>
#include <Nazara/TextRenderer/FontGlyph.hpp>
#include <Nazara/TextRenderer/TextRenderer.hpp>
#include <Nazara/TextRenderer/Debug.hpp>
namespace Nz
{
namespace
{
const UInt8 r_sansationRegular[] = {
#include <Nazara/Utility/Resources/Fonts/OpenSans-Regular.ttf.h>
#include <Nazara/TextRenderer/Resources/Fonts/OpenSans-Regular.ttf.h>
};
}
@@ -106,7 +106,7 @@ namespace Nz
bool Font::ExtractGlyph(unsigned int characterSize, char32_t character, TextStyleFlags style, float outlineThickness, FontGlyph* glyph) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!IsValid())
{
NazaraError("invalid font");
@@ -143,7 +143,7 @@ namespace Nz
std::string Font::GetFamilyName() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!IsValid())
{
NazaraError("invalid font");
@@ -156,7 +156,7 @@ namespace Nz
int Font::GetKerning(unsigned int characterSize, char32_t first, char32_t second) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!IsValid())
{
NazaraError("invalid font");
@@ -199,7 +199,7 @@ namespace Nz
const Font::SizeInfo& Font::GetSizeInfo(unsigned int characterSize) const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!IsValid())
{
NazaraError("invalid font");
@@ -234,7 +234,7 @@ namespace Nz
std::string Font::GetStyleName() const
{
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!IsValid())
{
NazaraError("invalid font");
@@ -349,26 +349,26 @@ namespace Nz
std::shared_ptr<Font> Font::OpenFromFile(const std::filesystem::path& filePath, const FontParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
TextRenderer* textRenderer = TextRenderer::Instance();
NazaraAssert(textRenderer, "TextRenderer module has not been initialized");
return utility->GetFontLoader().LoadFromFile(filePath, params);
return textRenderer->GetFontLoader().LoadFromFile(filePath, params);
}
std::shared_ptr<Font> Font::OpenFromMemory(const void* data, std::size_t size, const FontParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
TextRenderer* textRenderer = TextRenderer::Instance();
NazaraAssert(textRenderer, "TextRenderer module has not been initialized");
return utility->GetFontLoader().LoadFromMemory(data, size, params);
return textRenderer->GetFontLoader().LoadFromMemory(data, size, params);
}
std::shared_ptr<Font> Font::OpenFromStream(Stream& stream, const FontParams& params)
{
Utility* utility = Utility::Instance();
NazaraAssert(utility, "Utility module has not been initialized");
TextRenderer* textRenderer = TextRenderer::Instance();
NazaraAssert(textRenderer, "TextRenderer module has not been initialized");
return utility->GetFontLoader().LoadFromStream(stream, params);
return textRenderer->GetFontLoader().LoadFromStream(stream, params);
}
void Font::SetDefaultAtlas(std::shared_ptr<AbstractAtlas> atlas)
@@ -452,7 +452,7 @@ namespace Nz
Glyph& glyph = glyphMap[character]; //< Insert a new glyph
glyph.valid = false;
#if NAZARA_UTILITY_SAFE
#if NAZARA_CORE_SAFE
if (!m_atlas)
{
NazaraError("font has no atlas");

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 - Text renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/FontData.hpp>
#include <Nazara/Utility/Debug.hpp>
#include <Nazara/TextRenderer/FontData.hpp>
#include <Nazara/TextRenderer/Debug.hpp>
namespace Nz
{

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