From 2c7744af41585e46a41e1d6c52481e2d9f9cef94 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 3 Apr 2013 01:25:57 +0200 Subject: [PATCH] Fixed last commit Yep, forgot to test it :D It should be okay now Former-commit-id: 3392523240affb4151f5121decb0e458500878a3 --- examples/16bitsRendering/main.cpp | 4 +- examples/FirstScene/main.cpp | 8 ++-- include/Nazara/3D.hpp | 43 ------------------- include/Nazara/Graphics.hpp | 2 +- include/Nazara/Graphics/Camera.hpp | 2 +- .../Nazara/Graphics/{3D.hpp => Graphics.hpp} | 0 include/Nazara/Utility/Enums.hpp | 2 +- src/Nazara/Graphics/Camera.cpp | 2 +- src/Nazara/Graphics/Graphics.cpp | 14 +++--- src/Nazara/Graphics/Model.cpp | 26 +++++------ src/Nazara/Graphics/Scene.cpp | 6 +-- 11 files changed, 33 insertions(+), 76 deletions(-) delete mode 100644 include/Nazara/3D.hpp rename include/Nazara/Graphics/{3D.hpp => Graphics.hpp} (100%) diff --git a/examples/16bitsRendering/main.cpp b/examples/16bitsRendering/main.cpp index 3f3f9bb4a..9a21cba4e 100644 --- a/examples/16bitsRendering/main.cpp +++ b/examples/16bitsRendering/main.cpp @@ -1,14 +1,14 @@ // Cette démo suppose que vous avez déjà lu les commentaires de "FirstScene" -#include #include +#include #include #include #include int main() { - NzInitializer nazara; + NzInitializer nazara; if (!nazara) { std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl; diff --git a/examples/FirstScene/main.cpp b/examples/FirstScene/main.cpp index 1dc335ea8..734e20240 100644 --- a/examples/FirstScene/main.cpp +++ b/examples/FirstScene/main.cpp @@ -1,16 +1,16 @@ -#include // Module 3D #include // Horloges +#include // Module Graphique #include // Module de rendu #include // Module utilitaire #include int main() { - // Pour commencer, nous initialisons le module 3D, celui-ci va provoquer l'initialisation (dans l'ordre), - // du noyau (Core), Utility, Renderer, 2D. + // Pour commencer, nous initialisons le module Graphique, celui-ci va provoquer l'initialisation (dans l'ordre), + // du noyau (Core), Utility, Renderer. // NzInitializer est une classe RAII appelant Initialize dans son constructeur et Uninitialize dans son destructeur. // Autrement dit, une fois ceci fait nous n'avons plus à nous soucier de la libération du moteur. - NzInitializer nazara; + NzInitializer nazara; if (!nazara) { // Une erreur s'est produite dans l'initialisation d'un des modules diff --git a/include/Nazara/3D.hpp b/include/Nazara/3D.hpp deleted file mode 100644 index a80c6c45b..000000000 --- a/include/Nazara/3D.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// This file was automatically generated on 13 Mar 2013 at 23:20:31 - -/* - Nazara Engine - 3D module - - Copyright (C) 2013 Jérôme "Lynix" Leclercq (Lynix680@gmail.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#pragma once - -#ifndef NAZARA_GLOBAL_3D_HPP -#define NAZARA_GLOBAL_3D_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif // NAZARA_GLOBAL_3D_HPP diff --git a/include/Nazara/Graphics.hpp b/include/Nazara/Graphics.hpp index 767019033..adf36e6ca 100644 --- a/include/Nazara/Graphics.hpp +++ b/include/Nazara/Graphics.hpp @@ -29,13 +29,13 @@ #ifndef NAZARA_GLOBAL_GRAPHICS_HPP #define NAZARA_GLOBAL_GRAPHICS_HPP -#include #include #include #include #include #include #include +#include #include #include #include diff --git a/include/Nazara/Graphics/Camera.hpp b/include/Nazara/Graphics/Camera.hpp index 038b12e33..2e536ef3f 100644 --- a/include/Nazara/Graphics/Camera.hpp +++ b/include/Nazara/Graphics/Camera.hpp @@ -8,7 +8,7 @@ #define NAZARA_CAMERA_HPP #include -#include +#include #include #include #include diff --git a/include/Nazara/Graphics/3D.hpp b/include/Nazara/Graphics/Graphics.hpp similarity index 100% rename from include/Nazara/Graphics/3D.hpp rename to include/Nazara/Graphics/Graphics.hpp diff --git a/include/Nazara/Utility/Enums.hpp b/include/Nazara/Utility/Enums.hpp index c2e9a3098..2933407cc 100644 --- a/include/Nazara/Utility/Enums.hpp +++ b/include/Nazara/Utility/Enums.hpp @@ -142,7 +142,7 @@ enum nzImageType enum nzNodeType { nzNodeType_Default, // NzNode - nzNodeType_Scene, // NzSceneNode (3D) + nzNodeType_Scene, // NzSceneNode (Graphics) nzNodeType_Skeletal, ///TODO nzNodeType_Max = nzNodeType_Skeletal diff --git a/src/Nazara/Graphics/Camera.cpp b/src/Nazara/Graphics/Camera.cpp index a03a94a6c..96234b7f6 100644 --- a/src/Nazara/Graphics/Camera.cpp +++ b/src/Nazara/Graphics/Camera.cpp @@ -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 !"); diff --git a/src/Nazara/Graphics/Graphics.cpp b/src/Nazara/Graphics/Graphics.cpp index d0ebe7967..712d03a18 100644 --- a/src/Nazara/Graphics/Graphics.cpp +++ b/src/Nazara/Graphics/Graphics.cpp @@ -3,15 +3,15 @@ // For conditions of distribution and use, see copyright notice in Config.hpp #include +#include +#include #include #include #include -#include -#include #include #include -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; diff --git a/src/Nazara/Graphics/Model.cpp b/src/Nazara/Graphics/Model.cpp index 8226bfad5..a069530a1 100644 --- a/src/Nazara/Graphics/Model.cpp +++ b/src/Nazara/Graphics/Model.cpp @@ -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"); diff --git a/src/Nazara/Graphics/Scene.cpp b/src/Nazara/Graphics/Scene.cpp index 98ae7905e..9a0948e5e 100644 --- a/src/Nazara/Graphics/Scene.cpp +++ b/src/Nazara/Graphics/Scene.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include 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");