NzNoise added

This commit is contained in:
Overdrivr
2012-05-24 20:41:08 +02:00
parent 570e0a8070
commit 341eda975c
9 changed files with 1376 additions and 0 deletions

View 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

View 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;

File diff suppressed because it is too large Load Diff