Fixed last commit

Yep, forgot to test it :D

It should be okay now


Former-commit-id: 3392523240affb4151f5121decb0e458500878a3
This commit is contained in:
Lynix
2013-04-03 01:25:57 +02:00
parent 34dbd19385
commit 2c7744af41
11 changed files with 33 additions and 76 deletions

View File

@@ -25,7 +25,7 @@ NzCamera::~NzCamera() = default;
void NzCamera::Activate() const
{
#ifdef NAZARA_3D_SAFE
#ifdef NAZARA_GRAPHICS_SAFE
if (!m_target)
{
NazaraError("No render target !");

View File

@@ -3,15 +3,15 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/Graphics.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Graphics/Loaders/Mesh.hpp>
#include <Nazara/Graphics/Loaders/OBJ.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Graphics/Debug.hpp>
bool Nz3D::Initialize()
bool NzGraphics::Initialize()
{
if (s_moduleReferenceCounter++ != 0)
return true; // Déjà initialisé
@@ -38,12 +38,12 @@ bool Nz3D::Initialize()
return true;
}
bool Nz3D::IsInitialized()
bool NzGraphics::IsInitialized()
{
return s_moduleReferenceCounter != 0;
}
void Nz3D::Uninitialize()
void NzGraphics::Uninitialize()
{
if (s_moduleReferenceCounter != 1)
{
@@ -64,7 +64,7 @@ void Nz3D::Uninitialize()
NazaraNotice("Uninitialized: Graphics module");
// Libération des dépendances
Nz2D::Uninitialize();
NzRenderer::Uninitialize();
}
unsigned int Nz3D::s_moduleReferenceCounter = 0;
unsigned int NzGraphics::s_moduleReferenceCounter = 0;

View File

@@ -107,7 +107,7 @@ void NzModel::AddToRenderQueue(NzRenderQueue& renderQueue) const
void NzModel::AdvanceAnimation(float elapsedTime)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_animation)
{
NazaraError("Model has no animation");
@@ -163,7 +163,7 @@ NzAnimation* NzModel::GetAnimation() const
const NzBoundingBoxf& NzModel::GetBoundingBox() const
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_mesh)
{
NazaraError("Model has no mesh");
@@ -181,7 +181,7 @@ const NzBoundingBoxf& NzModel::GetBoundingBox() const
NzMaterial* NzModel::GetMaterial(unsigned int matIndex) const
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (matIndex >= m_matCount)
{
NazaraError("Material index out of range (" + NzString::Number(matIndex) + " >= " + NzString::Number(m_matCount));
@@ -194,7 +194,7 @@ NzMaterial* NzModel::GetMaterial(unsigned int matIndex) const
NzMaterial* NzModel::GetMaterial(unsigned int skinIndex, unsigned int matIndex) const
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (skinIndex >= m_skinCount)
{
NazaraError("Skin index out of range (" + NzString::Number(skinIndex) + " >= " + NzString::Number(m_skinCount));
@@ -296,7 +296,7 @@ void NzModel::Reset()
bool NzModel::SetAnimation(NzAnimation* animation)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_mesh)
{
NazaraError("Model has no animation");
@@ -344,7 +344,7 @@ bool NzModel::SetAnimation(NzAnimation* animation)
void NzModel::SetMaterial(unsigned int matIndex, NzMaterial* material)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (matIndex >= m_matCount)
{
NazaraError("Material index out of range (" + NzString::Number(matIndex) + " >= " + NzString::Number(m_matCount));
@@ -362,7 +362,7 @@ void NzModel::SetMaterial(unsigned int matIndex, NzMaterial* material)
void NzModel::SetMaterial(unsigned int skinIndex, unsigned int matIndex, NzMaterial* material)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (skinIndex >= m_skinCount)
{
NazaraError("Skin index out of range (" + NzString::Number(skinIndex) + " >= " + NzString::Number(m_skinCount));
@@ -423,7 +423,7 @@ void NzModel::SetMesh(NzMesh* mesh)
bool NzModel::SetSequence(const NzString& sequenceName)
{
///TODO: Rendre cette erreur "safe" avec le nouveau système de gestions d'erreur (No-log)
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_animation)
{
NazaraError("Model has no animation");
@@ -446,7 +446,7 @@ bool NzModel::SetSequence(const NzString& sequenceName)
void NzModel::SetSequence(unsigned int sequenceIndex)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_animation)
{
NazaraError("Model has no animation");
@@ -455,7 +455,7 @@ void NzModel::SetSequence(unsigned int sequenceIndex)
#endif
const NzSequence* currentSequence = m_animation->GetSequence(sequenceIndex);
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!currentSequence)
{
NazaraError("Sequence not found");
@@ -469,7 +469,7 @@ void NzModel::SetSequence(unsigned int sequenceIndex)
void NzModel::SetSkin(unsigned int skin)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (skin >= m_skinCount)
{
NazaraError("Skin index out of range (" + NzString::Number(skin) + " >= " + NzString::Number(m_skinCount));
@@ -482,7 +482,7 @@ void NzModel::SetSkin(unsigned int skin)
void NzModel::SetSkinCount(unsigned int skinCount)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (skinCount == 0)
{
NazaraError("Skin count must be over 0");
@@ -587,7 +587,7 @@ void NzModel::UpdateBoundingBox() const
bool NzModel::VisibilityTest(const NzFrustumf& frustum)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!m_mesh)
{
NazaraError("Model has no mesh");

View File

@@ -23,7 +23,7 @@
#include <memory>
#include <set>
#include <vector>
#include <Nazara/3D/Debug.hpp>
#include <Nazara/Graphics/Debug.hpp>
namespace
{
@@ -350,7 +350,7 @@ unsigned int NzScene::GetUpdatePerSecond() const
void NzScene::RegisterForUpdate(NzUpdatable* object)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!object)
{
NazaraError("Invalid object");
@@ -378,7 +378,7 @@ void NzScene::SetUpdatePerSecond(unsigned int updatePerSecond)
void NzScene::UnregisterForUpdate(NzUpdatable* object)
{
#if NAZARA_3D_SAFE
#if NAZARA_GRAPHICS_SAFE
if (!object)
{
NazaraError("Invalid object");