Big config/debug update
Added config checkers Macro no longer use suffixes Moved MemoryManager to upper directory Renamed *_MEMORYMANAGER to *_MANAGE_MEMORY Renamed AUDIO_STREAMEDBUFFERCOUNT to AUDIO_STREAMED_BUFFER_COUNT Renamed CORE_REAL_PRECISION to CORE_DECIMAL_DIGITS Renamed DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION to DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION Renamed GRAPHICS_MAX_LIGHTPERPASS to GRAPHICS_MAX_LIGHT_PER_PASS Renamed UTILITY_FORCE_DECLARATION_STRIDE_MULTIPLE_OF_32 to UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 Former-commit-id: 81ef836ac9f092ac471f60e544bb7c7c6370593c
This commit is contained in:
@@ -27,15 +27,18 @@
|
||||
#ifndef NAZARA_CONFIG_AUDIO_HPP
|
||||
#define NAZARA_CONFIG_AUDIO_HPP
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
/// Modifier la configuration d'un module nécessite une recompilation quasi-intégrale de celui-ci et de ceux en héritant
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_AUDIO_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_AUDIO_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
// Active les tests de sécurité supplémentaires (Teste notamment les arguments des fonctions, conseillé pour le développement)
|
||||
#define NAZARA_AUDIO_SAFE 1
|
||||
|
||||
// Le nombre de buffers utilisés lors du streaming d'objets audio (Au moins deux)
|
||||
#define NAZARA_AUDIO_STREAMEDBUFFERCOUNT 2
|
||||
#define NAZARA_AUDIO_STREAMED_BUFFER_COUNT 2
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Audio/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_AUDIO_HPP
|
||||
|
||||
23
include/Nazara/Audio/ConfigCheck.hpp
Normal file
23
include/Nazara/Audio/ConfigCheck.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Audio module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_AUDIO_HPP
|
||||
#define NAZARA_CONFIG_CHECK_AUDIO_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_AUDIO_MANAGE_MEMORY
|
||||
#undef NAZARA_AUDIO_MANAGE_MEMORY
|
||||
#define NAZARA_AUDIO_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_AUDIO_STREAMED_BUFFER_COUNT, integral, >, 0, " shall be a strictly positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_AUDIO_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Audio/Config.hpp>
|
||||
#if NAZARA_AUDIO_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_AUDIO_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Audio module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_AUDIO_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_AUDIO_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Précision des réels lors de la transformation en chaîne de caractère (Max. chiffres après la virgule)
|
||||
#define NAZARA_CORE_DECIMAL_DIGITS 6
|
||||
|
||||
// Duplique la sortie du log sur le flux de sortie standard (cout)
|
||||
#define NAZARA_CORE_DUPLICATE_LOG_TO_COUT 0
|
||||
|
||||
@@ -44,11 +47,8 @@
|
||||
// Incorpore la table Unicode Character Data (Nécessaires pour faire fonctionner le flag NzString::HandleUTF8)
|
||||
#define NAZARA_CORE_INCLUDE_UNICODEDATA 0
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_CORE_MEMORYMANAGER 0
|
||||
|
||||
// Précision des réels lors de la transformation en texte (Max. chiffres après la virgule)
|
||||
#define NAZARA_CORE_REAL_PRECISION 6
|
||||
// Utilise le MemoryManager pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_CORE_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_CORE_SAFE 1
|
||||
@@ -64,7 +64,7 @@
|
||||
#define NAZARA_THREADSAFETY_LOG 1 // NzLog
|
||||
#define NAZARA_THREADSAFETY_RESOURCE 1 // NzResource
|
||||
|
||||
// Le nombre de spinlocks à utiliser avec les critical sections de Windows (0 pour désactiver)
|
||||
// Le nombre de spinlocks à utiliser avec les sections critiques de Windows (0 pour désactiver)
|
||||
#define NAZARA_CORE_WINDOWS_CS_SPINLOCKS 4096
|
||||
|
||||
// Optimise l'implémentation Windows avec certaines avancées de Windows vista (Casse la compatibilité XP)
|
||||
@@ -75,4 +75,7 @@
|
||||
#define NAZARA_CORE_TIMER_WAKEUPTIME 10
|
||||
*/
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Core/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_CORE_HPP
|
||||
|
||||
25
include/Nazara/Core/ConfigCheck.hpp
Normal file
25
include/Nazara/Core/ConfigCheck.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// 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_CONFIG_CHECK_CORE_HPP
|
||||
#define NAZARA_CONFIG_CHECK_CORE_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_CORE_MANAGE_MEMORY
|
||||
#undef NAZARA_CORE_MANAGE_MEMORY
|
||||
#define NAZARA_CORE_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_CORE_DECIMAL_DIGITS, integral, >, 0, " shall be a strictly positive integer");
|
||||
CheckTypeAndVal(NAZARA_CORE_FILE_BUFFERSIZE, integral, >, 0, " shall be a strictly positive integer");
|
||||
CheckTypeAndVal(NAZARA_CORE_WINDOWS_CS_SPINLOCKS, integral, >=, 0, " shall be a positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_CORE_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#if NAZARA_CORE_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_CORE_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#ifndef NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
#define NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
class NAZARA_API NzMemoryManager
|
||||
{
|
||||
public:
|
||||
static void* Allocate(std::size_t size, bool multi, const char* file = nullptr, unsigned int line = 0);
|
||||
|
||||
static void Free(void* pointer, bool multi);
|
||||
|
||||
static unsigned int GetAllocatedBlockCount();
|
||||
static std::size_t GetAllocatedSize();
|
||||
static unsigned int GetAllocationCount();
|
||||
|
||||
static void NextFree(const char* file, unsigned int line);
|
||||
|
||||
private:
|
||||
NzMemoryManager();
|
||||
~NzMemoryManager();
|
||||
|
||||
static void Initialize();
|
||||
static void TimeInfo(char buffer[23]);
|
||||
static void Uninitialize();
|
||||
};
|
||||
|
||||
NAZARA_API void* operator new(std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) noexcept;
|
||||
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) noexcept;
|
||||
|
||||
#endif // NAZARA_DEBUG_MEMORYMANAGER_HPP
|
||||
|
||||
#ifndef NAZARA_DEBUG_MEMORYMANAGER_DISABLE_REDEFINITION
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#endif
|
||||
28
include/Nazara/Core/Debug/NewRedefinition.hpp
Normal file
28
include/Nazara/Core/Debug/NewRedefinition.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
// Pas de #pragma once car ce fichier est prévu pour être inclus plusieurs fois
|
||||
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#if NAZARA_CORE_MANAGE_MEMORY
|
||||
|
||||
#ifndef NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
#define NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
|
||||
NAZARA_API void* operator new(std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void* operator new[](std::size_t size, const char* file, unsigned int line);
|
||||
NAZARA_API void operator delete(void* ptr, const char* file, unsigned int line) noexcept;
|
||||
NAZARA_API void operator delete[](void* ptr, const char* file, unsigned int line) noexcept;
|
||||
|
||||
#endif // NAZARA_DEBUG_NEWREDEFINITION_HPP
|
||||
|
||||
#ifndef NAZARA_DEBUG_NEWREDEFINITION_DISABLE_REDEFINITION
|
||||
#define delete NzMemoryManager::NextFree(__FILE__, __LINE__), delete
|
||||
#define new new(__FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CORE_MANAGE_MEMORY
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_CORE_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_CORE_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
36
include/Nazara/Core/MemoryManager.hpp
Normal file
36
include/Nazara/Core/MemoryManager.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// 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_MEMORYMANAGER_HPP
|
||||
#define NAZARA_MEMORYMANAGER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
class NAZARA_API NzMemoryManager
|
||||
{
|
||||
public:
|
||||
static void* Allocate(std::size_t size, bool multi = false, const char* file = nullptr, unsigned int line = 0);
|
||||
|
||||
static void Free(void* pointer, bool multi = false);
|
||||
|
||||
static unsigned int GetAllocatedBlockCount();
|
||||
static std::size_t GetAllocatedSize();
|
||||
static unsigned int GetAllocationCount();
|
||||
|
||||
static void NextFree(const char* file, unsigned int line);
|
||||
|
||||
private:
|
||||
NzMemoryManager();
|
||||
~NzMemoryManager();
|
||||
|
||||
static void Initialize();
|
||||
static void TimeInfo(char buffer[23]);
|
||||
static void Uninitialize();
|
||||
};
|
||||
|
||||
#endif // NAZARA_MEMORYMANAGER_HPP
|
||||
@@ -32,13 +32,18 @@
|
||||
// À partir de combien d'instances d'un même mesh/matériau l'instancing doit-il être utilisé ?
|
||||
#define NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT 10
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_GRAPHICS_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_GRAPHICS_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_GRAPHICS_SAFE 1
|
||||
|
||||
/// Chaque modification d'un paramètre ci-dessous implique une modification (souvent mineure) du code
|
||||
|
||||
// Le nombre maximum de lumières qu'un shader standard supportera
|
||||
#define NAZARA_GRAPHICS_MAX_LIGHTPERPASS 3U // Unsigned
|
||||
#define NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS 3
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Graphics/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_GRAPHICS_HPP
|
||||
|
||||
24
include/Nazara/Graphics/ConfigCheck.hpp
Normal file
24
include/Nazara/Graphics/ConfigCheck.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
#define NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#undef NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#define NAZARA_GRAPHICS_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT, integral, >, 0, " shall be a strictly positive integer");
|
||||
CheckTypeAndVal(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, integral, >, 0, " shall be a strictly positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_GRAPHICS_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#if NAZARA_GRAPHICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_GRAPHICS_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_GRAPHICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_GRAPHICS_HPP
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -29,10 +29,13 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_LUA_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_LUA_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_LUA_SAFE 1
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Lua/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_LUA_HPP
|
||||
|
||||
18
include/Nazara/Lua/ConfigCheck.hpp
Normal file
18
include/Nazara/Lua/ConfigCheck.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Lua module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_LUA_HPP
|
||||
#define NAZARA_CONFIG_CHECK_LUA_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_LUA_MANAGE_MEMORY
|
||||
#undef NAZARA_LUA_MANAGE_MEMORY
|
||||
#define NAZARA_LUA_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_LUA_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Lua/Config.hpp>
|
||||
#if NAZARA_LUA_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_LUA_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Lua scripting module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_LUA_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_LUA_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -33,9 +33,9 @@ unsigned int NzGetNumberLength(int number);
|
||||
unsigned int NzGetNumberLength(unsigned int number);
|
||||
unsigned int NzGetNumberLength(long long number);
|
||||
unsigned int NzGetNumberLength(unsigned long long number);
|
||||
unsigned int NzGetNumberLength(float number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||
unsigned int NzGetNumberLength(double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||
unsigned int NzGetNumberLength(long double number, nzUInt8 precision = NAZARA_CORE_REAL_PRECISION);
|
||||
unsigned int NzGetNumberLength(float number, nzUInt8 precision = NAZARA_CORE_DECIMAL_DIGITS);
|
||||
unsigned int NzGetNumberLength(double number, nzUInt8 precision = NAZARA_CORE_DECIMAL_DIGITS);
|
||||
unsigned int NzGetNumberLength(long double number, nzUInt8 precision = NAZARA_CORE_DECIMAL_DIGITS);
|
||||
template<typename T, typename T2> T NzLerp(T from, T to, T2 interpolation);
|
||||
template<typename T> T NzNormalizeAngle(T angle);
|
||||
template<typename T> bool NzNumberEquals(T a, T b, T maxDifference = std::numeric_limits<T>::epsilon());
|
||||
|
||||
@@ -29,10 +29,13 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_NOISE_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_NOISE_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_NOISE_SAFE 1
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Noise/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_MODULENAME_HPP
|
||||
|
||||
18
include/Nazara/Noise/ConfigCheck.hpp
Normal file
18
include/Nazara/Noise/ConfigCheck.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Noise module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_NOISE_HPP
|
||||
#define NAZARA_CONFIG_CHECK_NOISE_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_NOISE_MANAGE_MEMORY
|
||||
#undef NAZARA_NOISE_MANAGE_MEMORY
|
||||
#define NAZARA_NOISE_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_NOISE_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Noise/Config.hpp>
|
||||
#if NAZARA_NOISE_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_NOISE_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Noise module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_NOISE_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_NOISE_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -29,10 +29,13 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_PHYSICS_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_PHYSICS_MANAGE_MEMORY 0
|
||||
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_PHYSICS_SAFE 1
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Physics/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_PHYSICS_HPP
|
||||
|
||||
18
include/Nazara/Physics/ConfigCheck.hpp
Normal file
18
include/Nazara/Physics/ConfigCheck.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Physics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_PHYSICS_HPP
|
||||
#define NAZARA_CONFIG_CHECK_PHYSICS_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_PHYSICS_MANAGE_MEMORY
|
||||
#undef NAZARA_PHYSICS_MANAGE_MEMORY
|
||||
#define NAZARA_PHYSICS_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_PHYSICS_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Physics/Config.hpp>
|
||||
#if NAZARA_PHYSICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_PHYSICS_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Physics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_PHYSICS_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_PHYSICS_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// La taille du buffer d'Instancing (définit le nombre maximum d'instances en un rendu)
|
||||
#define NAZARA_RENDERER_INSTANCE_BUFFER_SIZE 8192*64 // 8192 matrices 4x4 flottantes
|
||||
#define NAZARA_RENDERER_INSTANCE_BUFFER_SIZE 524288 // 8192 matrices 4x4 flottantes
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_RENDERER_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_RENDERER_MANAGE_MEMORY 0
|
||||
|
||||
// Active le paramère debug des paramètres des contextes par défaut (Perte de performances mais capable de recevoir des messages d'OpenGL)
|
||||
#define NAZARA_RENDERER_OPENGL_DEBUG 0
|
||||
@@ -41,4 +41,7 @@
|
||||
// Active les tests de sécurité basés sur le code (Conseillé pour le développement)
|
||||
#define NAZARA_RENDERER_SAFE 1
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Renderer/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_MODULENAME_HPP
|
||||
|
||||
23
include/Nazara/Renderer/ConfigCheck.hpp
Normal file
23
include/Nazara/Renderer/ConfigCheck.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_RENDERER_HPP
|
||||
#define NAZARA_CONFIG_CHECK_RENDERER_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_RENDERER_MANAGE_MEMORY
|
||||
#undef NAZARA_RENDERER_MANAGE_MEMORY
|
||||
#define NAZARA_RENDERER_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_RENDERER_INSTANCE_BUFFER_SIZE, integral, >, 0, " shall be a strictly positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_RENDERER_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#if NAZARA_RENDERER_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_RENDERER_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Renderer module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_RENDERER_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_RENDERER_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Nazara Engine - Window module
|
||||
Nazara Engine - Utility module
|
||||
|
||||
Copyright (C) 2014 Jérôme "Lynix" Leclercq (Lynix680@gmail.com)
|
||||
|
||||
@@ -29,11 +29,8 @@
|
||||
|
||||
/// Chaque modification d'un paramètre du module nécessite une recompilation de celui-ci
|
||||
|
||||
// Force les buffers à posséder un stride multiple de 32 bytes (Gain de performances sur certaines cartes/plus de consommation mémoire)
|
||||
#define NAZARA_UTILITY_FORCE_DECLARATION_STRIDE_MULTIPLE_OF_32 0 ///FIXME: Ne peut pas être utilisé pour l'instant
|
||||
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks, ralenti l'exécution)
|
||||
#define NAZARA_UTILITY_MEMORYMANAGER 0
|
||||
// Utilise un manager de mémoire pour gérer les allocations dynamiques (détecte les leaks au prix d'allocations/libérations dynamiques plus lentes)
|
||||
#define NAZARA_UTILITY_MANAGE_MEMORY 0
|
||||
|
||||
// Le skinning doit-il prendre avantage du multi-threading ? (Boost de performances sur les processeurs multi-coeurs)
|
||||
#define NAZARA_UTILITY_MULTITHREADED_SKINNING 0
|
||||
@@ -50,7 +47,13 @@
|
||||
// Protège les classes des accès concurrentiels
|
||||
//#define NAZARA_UTILITY_THREADSAFE 1
|
||||
|
||||
// Force les buffers à posséder un stride multiple de 32 bytes (Gain de performances sur certaines cartes/plus de consommation mémoire)
|
||||
#define NAZARA_UTILITY_VERTEX_DECLARATION_FORCE_STRIDE_MULTIPLE_OF_32 0 ///FIXME: Ne peut pas être utilisé pour l'instant
|
||||
|
||||
// Sous Windows, fait en sorte que les touches ALT et F10 n'activent pas le menu de la fenêtre
|
||||
#define NAZARA_UTILITY_WINDOWS_DISABLE_MENU_KEYS 1
|
||||
|
||||
/// Vérification des valeurs et types de certaines constantes
|
||||
#include <Nazara/Utility/ConfigCheck.hpp>
|
||||
|
||||
#endif // NAZARA_CONFIG_UTILITY_HPP
|
||||
|
||||
23
include/Nazara/Utility/ConfigCheck.hpp
Normal file
23
include/Nazara/Utility/ConfigCheck.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2014 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CONFIG_CHECK_UTILITY_HPP
|
||||
#define NAZARA_CONFIG_CHECK_UTILITY_HPP
|
||||
|
||||
/// Ce fichier sert à vérifier la valeur des constantes du fichier Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type <decltype(name)>::value && name op val, #type err)
|
||||
|
||||
// On force la valeur de MANAGE_MEMORY en mode debug
|
||||
#if defined(NAZARA_DEBUG) && !NAZARA_UTILITY_MANAGE_MEMORY
|
||||
#undef NAZARA_UTILITY_MANAGE_MEMORY
|
||||
#define NAZARA_UTILITY_MANAGE_MEMORY 1
|
||||
#endif
|
||||
|
||||
CheckTypeAndVal(NAZARA_UTILITY_SKINNING_MAX_WEIGHTS, integral, >, 0, " shall be a strictly positive integer");
|
||||
|
||||
#endif // NAZARA_CONFIG_CHECK_UTILITY_HPP
|
||||
@@ -3,6 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#if NAZARA_UTILITY_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryManager.hpp>
|
||||
#if NAZARA_UTILITY_MANAGE_MEMORY
|
||||
#include <Nazara/Core/Debug/NewRedefinition.hpp>
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// This file is part of the "Nazara Engine - Utility module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#if NAZARA_UTILITY_MEMORYMANAGER || defined(NAZARA_DEBUG)
|
||||
// On suppose que Debug.hpp a déjà été inclus, tout comme Config.hpp
|
||||
#if NAZARA_UTILITY_MANAGE_MEMORY
|
||||
#undef delete
|
||||
#undef new
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user