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
|
||||
|
||||
Reference in New Issue
Block a user