NzNoise added
This commit is contained in:
29
src/Nazara/Noise/Debug/Leaks.cpp
Normal file
29
src/Nazara/Noise/Debug/Leaks.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2012 AUTHORS
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Noise/Config.hpp>
|
||||
#if NAZARA_MODULENAME_MEMORYLEAKTRACKER || defined(NAZARA_DEBUG)
|
||||
#include <Nazara/Core/Debug/MemoryLeakTracker.hpp>
|
||||
#include <new>
|
||||
|
||||
void* operator new(std::size_t size) throw(std::bad_alloc)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, false);
|
||||
}
|
||||
|
||||
void* operator new[](std::size_t size) throw(std::bad_alloc)
|
||||
{
|
||||
return NzMemoryManager::Allocate(size, true);
|
||||
}
|
||||
|
||||
void operator delete(void* pointer) throw()
|
||||
{
|
||||
NzMemoryManager::Free(pointer, false);
|
||||
}
|
||||
|
||||
void operator delete[](void* pointer) throw()
|
||||
{
|
||||
NzMemoryManager::Free(pointer, true);
|
||||
}
|
||||
#endif
|
||||
57
src/Nazara/Noise/Noise.cpp
Normal file
57
src/Nazara/Noise/Noise.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright (C) 2012 AUTHORS
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Noise/Noise.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Noise/Config.hpp>
|
||||
#include <Nazara/Noise/Debug.hpp>
|
||||
|
||||
NzNoise::NzNoise()
|
||||
{
|
||||
}
|
||||
|
||||
NzNoise::~NzNoise()
|
||||
{
|
||||
if (s_initialized)
|
||||
Uninitialize();
|
||||
}
|
||||
|
||||
bool NzNoise::Initialize()
|
||||
{
|
||||
#if NAZARA_NOISE_SAFE
|
||||
if (s_initialized)
|
||||
{
|
||||
NazaraError("NzNoise already initialized");
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialisation du module
|
||||
|
||||
s_initialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void NzNoise::Uninitialize()
|
||||
{
|
||||
#if NAZARA_NOISE_SAFE
|
||||
if (!s_initialized)
|
||||
{
|
||||
NazaraError("NzNoise not initialized");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Libération du module
|
||||
|
||||
s_initialized = false;
|
||||
}
|
||||
|
||||
bool NzNoise::IsInitialized()
|
||||
{
|
||||
return s_initialized;
|
||||
}
|
||||
|
||||
bool NzNoise::s_initialized = false;
|
||||
1054
src/Nazara/Noise/NoiseMachine.cpp
Normal file
1054
src/Nazara/Noise/NoiseMachine.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user