Update for latest nazarautils update
This commit is contained in:
@@ -13,14 +13,14 @@
|
||||
#include <string>
|
||||
|
||||
#if NAZARA_CORE_ENABLE_ASSERTS || defined(NAZARA_DEBUG)
|
||||
#define NazaraAssert(a, err) if (!(a)) Nz::Error::Trigger(Nz::ErrorType::AssertFailed, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||
#define NazaraAssert(a, err) if (!(a)) Nz::Error::Trigger(Nz::ErrorType::AssertFailed, err, __LINE__, __FILE__, NAZARA_PRETTY_FUNCTION)
|
||||
#else
|
||||
#define NazaraAssert(a, err) for (;;) break
|
||||
#endif
|
||||
|
||||
#define NazaraError(err) Nz::Error::Trigger(Nz::ErrorType::Normal, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||
#define NazaraInternalError(err) Nz::Error::Trigger(Nz::ErrorType::Internal, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||
#define NazaraWarning(err) Nz::Error::Trigger(Nz::ErrorType::Warning, err, __LINE__, __FILE__, NAZARA_FUNCTION)
|
||||
#define NazaraError(err) Nz::Error::Trigger(Nz::ErrorType::Normal, err, __LINE__, __FILE__, NAZARA_PRETTY_FUNCTION)
|
||||
#define NazaraInternalError(err) Nz::Error::Trigger(Nz::ErrorType::Internal, err, __LINE__, __FILE__, NAZARA_PRETTY_FUNCTION)
|
||||
#define NazaraWarning(err) Nz::Error::Trigger(Nz::ErrorType::Warning, err, __LINE__, __FILE__, NAZARA_PRETTY_FUNCTION)
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_CORE_API CRC32Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API CRC32Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
CRC32Hash(UInt32 polynomial = DefaultPolynomial);
|
||||
~CRC32Hash();
|
||||
CRC32Hasher(UInt32 polynomial = DefaultPolynomial);
|
||||
~CRC32Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_CORE_API CRC64Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API CRC64Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
CRC64Hash() = default;
|
||||
~CRC64Hash() = default;
|
||||
CRC64Hasher() = default;
|
||||
~CRC64Hasher() = default;
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_CORE_API Fletcher16Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API Fletcher16Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
Fletcher16Hash() = default;
|
||||
~Fletcher16Hash() = default;
|
||||
Fletcher16Hasher() = default;
|
||||
~Fletcher16Hasher() = default;
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_CORE_API MD5Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API MD5Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
MD5Hash() = default;
|
||||
~MD5Hash() = default;
|
||||
MD5Hasher() = default;
|
||||
~MD5Hasher() = default;
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Nz
|
||||
{
|
||||
union SHA_CTX;
|
||||
|
||||
class NAZARA_CORE_API SHA1Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API SHA1Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
SHA1Hash();
|
||||
~SHA1Hash();
|
||||
SHA1Hasher();
|
||||
~SHA1Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Nz
|
||||
{
|
||||
union SHA_CTX;
|
||||
|
||||
class NAZARA_CORE_API SHA224Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API SHA224Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
SHA224Hash();
|
||||
~SHA224Hash();
|
||||
SHA224Hasher();
|
||||
~SHA224Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Nz
|
||||
{
|
||||
union SHA_CTX;
|
||||
|
||||
class NAZARA_CORE_API SHA256Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API SHA256Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
SHA256Hash();
|
||||
~SHA256Hash();
|
||||
SHA256Hasher();
|
||||
~SHA256Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Nz
|
||||
{
|
||||
union SHA_CTX;
|
||||
|
||||
class NAZARA_CORE_API SHA384Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API SHA384Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
SHA384Hash();
|
||||
~SHA384Hash();
|
||||
SHA384Hasher();
|
||||
~SHA384Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Nz
|
||||
{
|
||||
union SHA_CTX;
|
||||
|
||||
class NAZARA_CORE_API SHA512Hash final : public AbstractHash
|
||||
class NAZARA_CORE_API SHA512Hasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
SHA512Hash();
|
||||
~SHA512Hash();
|
||||
SHA512Hasher();
|
||||
~SHA512Hasher();
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_CORE_API WhirlpoolHash final : public AbstractHash
|
||||
class NAZARA_CORE_API WhirlpoolHasher final : public AbstractHash
|
||||
{
|
||||
public:
|
||||
WhirlpoolHash() = default;
|
||||
~WhirlpoolHash() = default;
|
||||
WhirlpoolHasher() = default;
|
||||
~WhirlpoolHasher() = default;
|
||||
|
||||
void Append(const UInt8* data, std::size_t len) override;
|
||||
void Begin() override;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Renderer/Renderer.hpp>
|
||||
#include <NazaraUtils/Hash.hpp>
|
||||
#include <functional>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Math module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <NazaraUtils/Hash.hpp>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
@@ -774,15 +774,9 @@ namespace std
|
||||
*/
|
||||
std::size_t operator()(const Nz::Vector2<T>& v) const
|
||||
{
|
||||
std::size_t seed {};
|
||||
|
||||
Nz::HashCombine(seed, v.x);
|
||||
Nz::HashCombine(seed, v.y);
|
||||
|
||||
return seed;
|
||||
return Nz::HashCombine(v.x, v.y);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Core/DebugOff.hpp>
|
||||
#include "Vector2.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Math module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <NazaraUtils/Hash.hpp>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
@@ -990,13 +990,7 @@ namespace std
|
||||
|
||||
std::size_t operator()(const Nz::Vector3<T>& v) const
|
||||
{
|
||||
std::size_t seed {};
|
||||
|
||||
Nz::HashCombine(seed, v.x);
|
||||
Nz::HashCombine(seed, v.y);
|
||||
Nz::HashCombine(seed, v.z);
|
||||
|
||||
return seed;
|
||||
return Nz::HashCombine(v.x, v.y, v.z);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Math module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <NazaraUtils/Algorithm.hpp>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
@@ -808,17 +808,9 @@ namespace std
|
||||
*/
|
||||
std::size_t operator()(const Nz::Vector4<T>& v) const
|
||||
{
|
||||
std::size_t seed {};
|
||||
|
||||
Nz::HashCombine(seed, v.x);
|
||||
Nz::HashCombine(seed, v.y);
|
||||
Nz::HashCombine(seed, v.z);
|
||||
Nz::HashCombine(seed, v.w);
|
||||
|
||||
return seed;
|
||||
return Nz::HashCombine(v.x, v.y, v.z, v.w);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Core/DebugOff.hpp>
|
||||
#include "Vector4.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - OpenGL renderer"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <NazaraUtils/Hash.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz::GL
|
||||
@@ -50,9 +50,7 @@ namespace Nz::GL
|
||||
|
||||
inline std::size_t OpenGLVaoSetupHasher::operator()(const OpenGLVaoSetup& setup) const
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
|
||||
HashCombine(seed, setup.indexBuffer);
|
||||
std::size_t seed = std::hash<GLuint>{}(setup.indexBuffer);
|
||||
|
||||
std::size_t bindingIndex = 0;
|
||||
for (const auto& attribOpt : setup.vertexAttribs)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Algorithm.hpp>
|
||||
#include <NazaraUtils/Hash.hpp>
|
||||
#include <Nazara/Renderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
@@ -50,18 +50,15 @@ struct std::hash<Nz::TextureSamplerInfo>
|
||||
{
|
||||
std::size_t operator()(const Nz::TextureSamplerInfo& sampler) const
|
||||
{
|
||||
std::size_t seed = 0;
|
||||
Nz::HashCombine(seed, sampler.anisotropyLevel);
|
||||
Nz::HashCombine(seed, sampler.magFilter);
|
||||
Nz::HashCombine(seed, sampler.minFilter);
|
||||
Nz::HashCombine(seed, sampler.mipmapMode);
|
||||
Nz::HashCombine(seed, sampler.wrapModeU);
|
||||
Nz::HashCombine(seed, sampler.wrapModeV);
|
||||
Nz::HashCombine(seed, sampler.wrapModeW);
|
||||
Nz::HashCombine(seed, sampler.depthCompare);
|
||||
Nz::HashCombine(seed, sampler.depthComparison);
|
||||
|
||||
return seed;
|
||||
return Nz::HashCombine(sampler.anisotropyLevel,
|
||||
sampler.magFilter,
|
||||
sampler.minFilter,
|
||||
sampler.mipmapMode,
|
||||
sampler.wrapModeU,
|
||||
sampler.wrapModeV,
|
||||
sampler.wrapModeW,
|
||||
sampler.depthCompare,
|
||||
sampler.depthComparison);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user