Changed all the files encoding to UTF-8

Named modules in licence informations
This commit is contained in:
Lynix
2012-08-10 03:21:37 +02:00
parent f8a0cdad39
commit 5619ddb0b1
269 changed files with 888 additions and 890 deletions

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Animation.hpp>

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/AxisAlignedBox.hpp>
#include <Nazara/Core/Error.hpp>
@@ -55,7 +55,7 @@ void NzAxisAlignedBox::ExtendTo(const NzAxisAlignedBox& box)
}
case nzExtend_Infinite:
// Rien à faire
// Rien à faire
break;
case nzExtend_Null:
@@ -74,11 +74,11 @@ void NzAxisAlignedBox::ExtendTo(const NzVector3f& vector)
break;
case nzExtend_Infinite:
// Rien à faire
// Rien à faire
break;
case nzExtend_Null:
// Nous étendons l'AABB en la construisant de l'origine jusqu'au vecteur
// Nous étendons l'AABB en la construisant de l'origine jusqu'au vecteur
m_cube.x = 0.f;
m_cube.y = 0.f;
m_cube.z = 0.f;

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Buffer.hpp>
@@ -88,7 +88,7 @@ bool NzBuffer::Create(unsigned int length, nzUInt8 typeSize, nzBufferStorage sto
{
Destroy();
// On tente d'abord de faire un buffer hardware, si supporté
// On tente d'abord de faire un buffer hardware, si supporté
if (s_bufferFunctions[storage])
{
NzBufferImpl* impl = s_bufferFunctions[storage](this, m_type);
@@ -113,7 +113,7 @@ bool NzBuffer::Create(unsigned int length, nzUInt8 typeSize, nzBufferStorage sto
m_storage = storage;
m_usage = usage;
// Si on arrive ici c'est que tout s'est bien passé.
// Si on arrive ici c'est que tout s'est bien passé.
return true;
}

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/BufferImpl.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Cursor.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Config.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Icon.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Image.hpp>
@@ -84,7 +84,7 @@ bool NzImage::Convert(nzPixelFormat format)
unsigned int width = m_sharedImage->width;
unsigned int height = m_sharedImage->height;
// Les images 3D et cubemaps sont stockés de la même façon
// Les images 3D et cubemaps sont stockés de la même façon
unsigned int depth = (m_sharedImage->type == nzImageType_Cubemap) ? 6 : m_sharedImage->depth;
for (unsigned int i = 0; i < m_sharedImage->levelCount; ++i)
@@ -101,7 +101,7 @@ bool NzImage::Convert(nzPixelFormat format)
{
NazaraError("Failed to convert image");
// Nettoyage de la mémoire
// Nettoyage de la mémoire
delete[] ptr; // Permet une optimisation de boucle (GCC)
for (unsigned int j = 0; j < i; ++j)
delete[] levels[j];
@@ -159,11 +159,11 @@ bool NzImage::Copy(const NzImage& source, const NzCubeui& srcCube, const NzVecto
}
/*
Correctif temporaire : Update veut de la mémoire contigüe
Il est donc nécessaire de prendre la partie de la texture que nous voulons mettre à jour
Correctif temporaire : Update veut de la mémoire contigüe
Il est donc nécessaire de prendre la partie de la texture que nous voulons mettre à jour
FIXME: Trouver une interface pour gérer ce genre de problème (Façon OpenGL?)
(Appliquer l'interface à NzTexture également)
FIXME: Trouver une interface pour gérer ce genre de problème (Façon OpenGL?)
(Appliquer l'interface à NzTexture également)
*/
nzUInt8 bpp = NzPixelFormat::GetBPP(m_sharedImage->format);
unsigned int dstLineStride = srcCube.width*bpp;
@@ -269,7 +269,7 @@ bool NzImage::Create(nzImageType type, nzPixelFormat format, unsigned int width,
for (unsigned int i = 0; i < levelCount; ++i)
{
// Cette allocation est protégée car sa taille dépend directement de paramètres utilisateurs
// Cette allocation est protégée car sa taille dépend directement de paramètres utilisateurs
try
{
levels[i] = new nzUInt8[w * h * d * NzPixelFormat::GetBPP(format)];
@@ -1013,7 +1013,7 @@ bool NzImage::Update(const nzUInt8* pixels, const NzRectui& rect, unsigned int z
bool NzImage::Update(const nzUInt8* pixels, const NzCubeui& cube, nzUInt8 level)
{
///FIXME: Vérifier que ça fonctionne correctement
///FIXME: Vérifier que ça fonctionne correctement
#if NAZARA_UTILITY_SAFE
if (!IsValid())
{

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/IndexBuffer.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Keyboard.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/KeyframeMesh.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Loaders/MD2/Constants.hpp>

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#ifndef NAZARA_LOADERS_MD2_CONSTANTS_HPP
#define NAZARA_LOADERS_MD2_CONSTANTS_HPP
@@ -21,16 +21,16 @@ struct md2_header
nzUInt32 num_skins; // nombre de skins
nzUInt32 num_vertices; // nombre de vertices par frame
nzUInt32 num_st; // nombre de coordonnées de texture
nzUInt32 num_st; // nombre de coordonnées de texture
nzUInt32 num_tris; // nombre de triangles
nzUInt32 num_glcmds; // nombre de commandes opengl
nzUInt32 num_frames; // nombre de frames
nzUInt32 offset_skins; // offset données skins
nzUInt32 offset_st; // offset données coordonnées de texture
nzUInt32 offset_tris; // offset données triangles
nzUInt32 offset_frames; // offset données frames
nzUInt32 offset_glcmds; // offset données commandes OpenGL
nzUInt32 offset_skins; // offset données skins
nzUInt32 offset_st; // offset données coordonnées de texture
nzUInt32 offset_tris; // offset données triangles
nzUInt32 offset_frames; // offset données frames
nzUInt32 offset_glcmds; // offset données commandes OpenGL
nzUInt32 offset_end; // offset fin de fichier
};

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Loaders/MD2.hpp>
#include <Nazara/Core/Endianness.hpp>
@@ -92,8 +92,8 @@ namespace
return false;
}
/// Création du mesh
// Animé ou statique, c'est la question
/// Création du mesh
// Animé ou statique, c'est la question
bool animated;
unsigned int startFrame = NzClamp(parameters.animation.startFrame, 0U, static_cast<unsigned int>(header.num_frames-1));
unsigned int endFrame = NzClamp(parameters.animation.endFrame, 0U, static_cast<unsigned int>(header.num_frames-1));
@@ -103,7 +103,7 @@ namespace
else
animated = false;
if (!mesh->Create((animated) ? nzAnimationType_Keyframe : nzAnimationType_Static)) // Ne devrait pas échouer
if (!mesh->Create((animated) ? nzAnimationType_Keyframe : nzAnimationType_Static)) // Ne devrait pas échouer
{
NazaraInternalError("Failed to create mesh");
return false;
@@ -129,11 +129,11 @@ namespace
NzAnimation* animation = new NzAnimation;
if (animation->Create(nzAnimationType_Keyframe, endFrame-startFrame+1))
{
// Décodage des séquences
// Décodage des séquences
NzString frameName;
NzSequence sequence;
sequence.framePerSecond = 10; // Par défaut pour les animations MD2
sequence.framePerSecond = 10; // Par défaut pour les animations MD2
char name[16], last[16];
stream.SetCursorPos(header.offset_frames + startFrame*header.framesize + offsetof(md2_frame, name));
@@ -165,9 +165,9 @@ namespace
}
name[pos+1] = '\0';
if (std::strcmp(name, last) != 0) // Si les deux frames n'ont pas le même nom
if (std::strcmp(name, last) != 0) // Si les deux frames n'ont pas le même nom
{
// Alors on enregistre la séquence
// Alors on enregistre la séquence
sequence.firstFrame = i-numFrames;
sequence.lastFrame = i-1;
sequence.name = last;
@@ -181,7 +181,7 @@ namespace
numFrames++;
}
// On ajoute la dernière frame (Qui n'a pas été traitée par la boucle)
// On ajoute la dernière frame (Qui n'a pas été traitée par la boucle)
sequence.firstFrame = endFrame-numFrames;
sequence.lastFrame = endFrame;
sequence.name = last;
@@ -196,7 +196,7 @@ namespace
/// Chargement des submesh
// Actuellement le loader ne charge qu'un submesh
// TODO: Utiliser les commandes OpenGL pour accélérer le rendu
// TODO: Utiliser les commandes OpenGL pour accélérer le rendu
NzMD2Mesh* subMesh = new NzMD2Mesh(mesh);
if (!subMesh->Create(header, stream, parameters))
{

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Loaders/MD2/Mesh.hpp>
#include <Nazara/Core/InputStream.hpp>
@@ -37,7 +37,7 @@ bool NzMD2Mesh::Create(const md2_header& header, NzInputStream& stream, const Nz
std::vector<md2_texCoord> texCoords(header.num_st);
std::vector<md2_triangle> triangles(header.num_tris);
// Lecture des coordonnées de texture
// Lecture des coordonnées de texture
stream.SetCursorPos(header.offset_st);
stream.Read(&texCoords[0], header.num_st*sizeof(md2_texCoord));
@@ -71,7 +71,7 @@ bool NzMD2Mesh::Create(const md2_header& header, NzInputStream& stream, const Nz
md2_frame frame;
frame.vertices.resize(header.num_vertices);
// Pour que le modèle soit correctement aligné, on génère une matrice de rotation que nous appliquerons à chacune des vertices
// Pour que le modèle soit correctement aligné, on génère une matrice de rotation que nous appliquerons à chacune des vertices
NzMatrix4f rotationMatrix = NzMatrix4f::Rotate(NzEulerAnglesf(90.f, -90.f, 0.f));
unsigned int stride = s_declaration.GetStride(nzElementStream_VertexData);
@@ -94,7 +94,7 @@ bool NzMD2Mesh::Create(const md2_header& header, NzInputStream& stream, const Nz
NzByteSwap(&frame.translate.z, sizeof(float));
#endif
m_frames[i].normal = new nzUInt8[m_vertexCount]; // Nous stockons l'indice de la normale plutôt que la normale (gain d'espace)
m_frames[i].normal = new nzUInt8[m_vertexCount]; // Nous stockons l'indice de la normale plutôt que la normale (gain d'espace)
m_frames[i].vertices = new NzVector3f[m_vertexCount];
NzVector3f max, min;
@@ -128,7 +128,7 @@ bool NzMD2Mesh::Create(const md2_header& header, NzInputStream& stream, const Nz
return false;
}
// On avance jusqu'aux premières coordonnées de texture
// On avance jusqu'aux premières coordonnées de texture
ptr += s_declaration.GetElement(nzElementStream_VertexData, nzElementUsage_TexCoord)->offset;
for (unsigned int t = 0; t < header.num_tris; ++t)
{

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Loaders/PCX.hpp>
#include <Nazara/Core/Endianness.hpp>
@@ -339,7 +339,7 @@ namespace
}
default:
NazaraError("Unable to load " + NzString::Number(bitCount) + " bitcount pcx files");
NazaraError("Failed to load " + NzString::Number(bitCount) + " bitcount pcx files");
return false;
}

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,6 +1,6 @@
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Ungine".
// For conditions of distribution and use, see copyright notice in Core.h
// Copyright (C) 2011 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Loaders/STB.hpp>
#include <Nazara/Core/Endianness.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Mesh.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Mouse.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/PixelFormat.hpp>
@@ -1139,7 +1139,7 @@ bool NzPixelFormat::Initialize()
RegisterConverter<nzPixelFormat_BGRA8, nzPixelFormat_RGBA8>();
/**********************************DXT1***********************************/
///TODO: Décompresseur DXT1
///TODO: Décompresseur DXT1
/*
RegisterConverter<nzPixelFormat_DXT1, nzPixelFormat_BGR8>();
RegisterConverter<nzPixelFormat_DXT1, nzPixelFormat_BGRA8>();
@@ -1162,7 +1162,7 @@ bool NzPixelFormat::Initialize()
*/
/**********************************DXT3***********************************/
///TODO: Décompresseur DXT3
///TODO: Décompresseur DXT3
/*
RegisterConverter<nzPixelFormat_DXT3, nzPixelFormat_BGR8>();
RegisterConverter<nzPixelFormat_DXT3, nzPixelFormat_BGRA8>();
@@ -1185,7 +1185,7 @@ bool NzPixelFormat::Initialize()
*/
/**********************************DXT5***********************************/
///TODO: Décompresseur DXT5
///TODO: Décompresseur DXT5
/*
RegisterConverter<nzPixelFormat_DXT5, nzPixelFormat_BGR8>();
RegisterConverter<nzPixelFormat_DXT5, nzPixelFormat_BGRA8>();

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/SoftwareBuffer.hpp>
@@ -23,7 +23,7 @@ bool NzSoftwareBuffer::Create(unsigned int size, nzBufferUsage usage)
{
NazaraUnused(usage);
// Cette allocation est protégée car sa taille dépend directement de paramètres utilisateurs
// Cette allocation est protégée car sa taille dépend directement de paramètres utilisateurs
try
{
m_buffer = new nzUInt8[size];

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/StaticMesh.hpp>
@@ -95,7 +95,7 @@ bool NzStaticMesh::GenerateAABB()
const NzVertexElement* position = m_vertexDeclaration->GetElement(nzElementStream_VertexData, nzElementUsage_Position);
if (position && position->type == nzElementType_Float3) // Si nous avons des positions du type Vec3
{
// On lock le buffer pour itérer sur toutes les positions et composer notre AABB
// On lock le buffer pour itérer sur toutes les positions et composer notre AABB
nzUInt8* buffer = reinterpret_cast<nzUInt8*>(m_vertexBuffer->Map(nzBufferAccess_ReadOnly));
if (!buffer)
{
@@ -181,6 +181,6 @@ void NzStaticMesh::AnimateImpl(unsigned int frameA, unsigned int frameB, float i
NazaraUnused(frameB);
NazaraUnused(interpolation);
// Le safe mode est censé nous protéger de cet appel
// Le safe mode est censé nous protéger de cet appel
NazaraError("Static mesh have no animation, please enable safe mode");
}

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/SubMesh.hpp>
@@ -11,7 +11,7 @@
#include <Nazara/Utility/Debug.hpp>
NzSubMesh::NzSubMesh(const NzMesh* parent) :
NzResource(false), // Un SubMesh n'est pas persistant par défaut
NzResource(false), // Un SubMesh n'est pas persistant par défaut
m_parent(parent)
{
#ifdef NAZARA_DEBUG

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Utility.hpp>
@@ -18,9 +18,9 @@
bool NzUtility::Initialize()
{
if (s_moduleReferenceCouter++ != 0)
return true; // Déjà initialisé
return true; // Déjà initialisé
// Initialisation des dépendances
// Initialisation des dépendances
if (!NzCore::Initialize())
{
NazaraError("Failed to initialize core module");
@@ -48,16 +48,16 @@ bool NzUtility::Initialize()
return false;
}
/// Loaders spécialisés
/// Loaders spécialisés
// Mesh
NzLoaders_MD2_Register(); // Loader de fichiers .MD2 (v8)
// Image
NzLoaders_PCX_Register(); // Loader de fichiers .PCX (1, 4, 8, 24)
/// Loaders génériques (En dernier pour donner la priorité aux loaders spécialisés)
/// Loaders génériques (En dernier pour donner la priorité aux loaders spécialisés)
// Image
NzLoaders_STB_Register(); // Loader générique (STB)
NzLoaders_STB_Register(); // Loader générique (STB)
NazaraNotice("Initialized: Utility module");
@@ -72,9 +72,9 @@ bool NzUtility::IsInitialized()
void NzUtility::Uninitialize()
{
if (--s_moduleReferenceCouter != 0)
return; // Encore utilisé
return; // Encore utilisé
// Libération du module
// Libération du module
NzLoaders_MD2_Unregister();
NzLoaders_PCX_Unregister();
NzLoaders_STB_Unregister();
@@ -85,7 +85,7 @@ void NzUtility::Uninitialize()
NazaraNotice("Uninitialized: Utility module");
// Libération des dépendances
// Libération des dépendances
NzCore::Uninitialize();
}

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VertexBuffer.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VertexDeclaration.hpp>
@@ -113,7 +113,7 @@ bool NzVertexDeclaration::Create(const NzVertexElement* elements, unsigned int e
std::memset(&impl->elementPos, -1, (nzElementStream_Max+1)*(nzElementUsage_Max+1)*sizeof(int));
std::memset(&impl->streamPos, -1, (nzElementStream_Max+1)*sizeof(int));
// On copie et trie les éléments
// On copie et trie les éléments
impl->elements.resize(elementCount);
std::memcpy(&impl->elements[0], elements, elementCount*sizeof(NzVertexElement));
std::sort(impl->elements.begin(), impl->elements.end(), VertexElementCompare);
@@ -122,13 +122,13 @@ bool NzVertexDeclaration::Create(const NzVertexElement* elements, unsigned int e
{
NzVertexElement& current = impl->elements[i];
#if NAZARA_UTILITY_SAFE
// Notre tableau étant trié, s'il y a collision, les deux éléments identiques se suivent...
// Notre tableau étant trié, s'il y a collision, les deux éléments identiques se suivent...
if (i > 0)
{
NzVertexElement& previous = impl->elements[i-1]; // On accède à l'élément précédent
NzVertexElement& previous = impl->elements[i-1]; // On accède à l'élément précédent
if (previous.usage == current.usage && previous.usageIndex == current.usageIndex && previous.stream == current.stream)
{
// Les deux éléments sont identiques là où ils ne devraient pas, nous avons une collision...
// Les deux éléments sont identiques là où ils ne devraient pas, nous avons une collision...
NazaraError("Element usage 0x" + NzString::Number(current.usage, 16) + " collision with usage index " + NzString::Number(current.usageIndex) + " on stream 0x" + NzString::Number(current.stream, 16));
delete impl;
@@ -141,7 +141,7 @@ bool NzVertexDeclaration::Create(const NzVertexElement* elements, unsigned int e
impl->elementPos[current.stream][current.usage] = i;
if (impl->streamPos[current.stream] == -1)
impl->streamPos[current.stream] = i; // Premier élément du stream (via le triage)
impl->streamPos[current.stream] = i; // Premier élément du stream (via le triage)
impl->stride[current.stream] += size[current.type];
}

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VideoMode.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/CursorImpl.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/IconImpl.hpp>

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Win32/InputImpl.hpp>
@@ -31,7 +31,7 @@ NzVector2i NzEventImpl::GetMousePosition(const NzWindow& relativeTo)
{
NazaraError("Window's handle is invalid");
// Attention que (-1, -1) est une position tout à fait valide et ne doit pas être utilisée pour tester l'erreur
// Attention que (-1, -1) est une position tout à fait valide et ne doit pas être utilisée pour tester l'erreur
return NzVector2i(-1, -1);
}
}
@@ -84,13 +84,13 @@ bool NzEventImpl::IsKeyPressed(NzKeyboard::Key key)
VK_F14, // Key::F14
VK_F15, // Key::F15
// Flèches directionnelles
// Flèches directionnelles
VK_DOWN, // Key::Down
VK_LEFT, // Key::Left
VK_RIGHT, // Key::Right
VK_UP, // Key::Up
// Pavé numérique
// Pavé numérique
VK_ADD, // Key::Add
VK_DIVIDE, // Key::Divide
VK_MULTIPLY, // Key::Multiply
@@ -167,12 +167,12 @@ bool NzEventImpl::IsKeyPressed(NzKeyboard::Key key)
VK_MEDIA_PREV_TRACK, // Key::Media_Previous,
VK_MEDIA_STOP, // Key::Media_Stop,
// Touches de contrôle du volume
// Touches de contrôle du volume
VK_VOLUME_DOWN, // Key::Volume_Down
VK_VOLUME_MUTE, // Key::Volume_Mute
VK_VOLUME_UP, // Key::Volume_Up
// Touches à verrouillage
// Touches à verrouillage
VK_CAPITAL, // Key::CapsLock
VK_NUMLOCK, // Key::NumLock
VK_SCROLL // Key::ScrollLock

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/VideoModeImpl.hpp>
@@ -25,7 +25,7 @@ void NzVideoModeImpl::GetFullscreenModes(std::vector<NzVideoMode>& modes)
{
NzVideoMode mode(win32Mode.dmPelsWidth, win32Mode.dmPelsHeight, win32Mode.dmBitsPerPel);
// Il existe plusieurs modes avec ces trois caractéristques identiques
// Il existe plusieurs modes avec ces trois caractéristques identiques
if (std::find(modes.begin(), modes.end(), mode) == modes.end())
modes.push_back(mode);
}

View File

@@ -1,8 +1,8 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Un grand merci à Laurent Gomila pour la SFML qui m'aura bien aidé à réaliser cette implémentation
// Un grand merci à Laurent Gomila pour la SFML qui m'aura bien aidé à réaliser cette implémentation
#define OEMRESOURCE
@@ -26,12 +26,12 @@
#define GWL_USERDATA GWLP_USERDATA
#endif
// N'est pas définit avec MinGW apparemment
// N'est pas définit avec MinGW apparemment
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
#endif
#undef IsMinimized // Conflit avec la méthode du même nom
#undef IsMinimized // Conflit avec la méthode du même nom
namespace
{
@@ -71,20 +71,20 @@ bool NzWindowImpl::Create(NzVideoMode mode, const NzString& title, nzUInt32 styl
if (ChangeDisplaySettings(&win32Mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
{
// Situation extrêmement rare grâce à NzVideoMode::IsValid appelé par NzWindow
// Situation extrêmement rare grâce à NzVideoMode::IsValid appelé par NzWindow
NazaraError("Failed to change display settings for fullscreen, this video mode is not supported by your computer");
fullscreen = false;
}
}
// Testé une seconde fois car sa valeur peut changer
// Testé une seconde fois car sa valeur peut changer
if (fullscreen)
{
x = 0;
y = 0;
win32Style = WS_CLIPCHILDREN | WS_POPUP;
// Pour cacher la barre des tâches
// Pour cacher la barre des tâches
// http://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx
win32StyleEx = WS_EX_APPWINDOW;
@@ -126,7 +126,7 @@ bool NzWindowImpl::Create(NzVideoMode mode, const NzString& title, nzUInt32 styl
m_thread = new NzThread(WindowThread, &m_handle, win32StyleEx, wtitle, win32Style, x, y, width, height, this, &mutex, &condition);
m_threadActive = true;
// On attend que la fenêtre soit créée
// On attend que la fenêtre soit créée
mutex.Lock();
m_thread->Launch();
condition.Wait(&mutex);
@@ -178,7 +178,7 @@ void NzWindowImpl::Destroy()
if (m_thread)
{
m_threadActive = false;
PostMessageW(m_handle, WM_NULL, 0, 0); // Pour réveiller le thread
PostMessageW(m_handle, WM_NULL, 0, 0); // Pour réveiller le thread
m_thread->Join();
delete m_thread;
@@ -234,7 +234,7 @@ NzString NzWindowImpl::GetTitle() const
if (titleSize == 0)
return NzString();
titleSize++; // Caractère nul
titleSize++; // Caractère nul
wchar_t* wTitle = new wchar_t[titleSize];
GetWindowTextW(m_handle, wTitle, titleSize);
@@ -353,7 +353,7 @@ void NzWindowImpl::SetCursor(nzWindowCursor cursor)
break;
}
// Pas besoin de libérer le curseur par la suite s'il est partagé
// Pas besoin de libérer le curseur par la suite s'il est partagé
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms648045(v=vs.85).aspx
::SetCursor(m_cursor);
}
@@ -437,7 +437,7 @@ void NzWindowImpl::SetPosition(int x, int y)
void NzWindowImpl::SetSize(unsigned int width, unsigned int height)
{
// SetWindowPos demande la taille totale de la fenêtre
// SetWindowPos demande la taille totale de la fenêtre
RECT rect = {0, 0, static_cast<LONG>(width), static_cast<LONG>(height)};
AdjustWindowRect(&rect, GetWindowLongPtr(m_handle, GWL_STYLE), false);
@@ -466,7 +466,7 @@ void NzWindowImpl::SetVisible(bool visible)
bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
{
// Inutile de récupérer des évènements ne venant pas de notre fenêtre
// Inutile de récupérer des évènements ne venant pas de notre fenêtre
if (m_handle != window)
return false;
@@ -531,7 +531,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
event.type = nzEventType_Quit;
m_parent->PushEvent(event);
return true; // Afin que Windows ne ferme pas la fenêtre automatiquement
return true; // Afin que Windows ne ferme pas la fenêtre automatiquement
}
#if !NAZARA_UTILITY_THREADED_WINDOW
@@ -545,7 +545,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
{
m_sizemove = false;
// On vérifie ce qui a changé
// On vérifie ce qui a changé
NzVector2i position = GetPosition();
if (m_position != position)
{
@@ -621,8 +621,8 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
case WM_LBUTTONDBLCLK:
{
// Cet évènement est généré à la place d'un WM_LBUTTONDOWN lors d'un double-clic.
// Comme nous désirons quand même notifier chaque clic, nous envoyons les deux évènements.
// Cet évènement est généré à la place d'un WM_LBUTTONDOWN lors d'un double-clic.
// Comme nous désirons quand même notifier chaque clic, nous envoyons les deux évènements.
NzEvent event;
event.mouseButton.button = NzMouse::Left;
event.mouseButton.x = GET_X_LPARAM(lParam);
@@ -701,7 +701,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
break;
}
// Nécessite un appel précédent à TrackMouseEvent (Fait dans WM_MOUSEMOVE)
// Nécessite un appel précédent à TrackMouseEvent (Fait dans WM_MOUSEMOVE)
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms645615(v=vs.85).aspx
case WM_MOUSELEAVE:
{
@@ -860,7 +860,7 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
if (!m_sizemove && wParam != SIZE_MINIMIZED)
#endif
{
NzVector2ui size = GetSize(); // On récupère uniquement la taille de la zone client
NzVector2ui size = GetSize(); // On récupère uniquement la taille de la zone client
#if !NAZARA_UTILITY_THREADED_WINDOW
if (m_size == size)
break;
@@ -941,14 +941,14 @@ bool NzWindowImpl::HandleMessage(HWND window, UINT message, WPARAM wParam, LPARA
bool NzWindowImpl::Initialize()
{
// Nous devons faire un type Unicode pour que la fenêtre le soit également
// Nous devons faire un type Unicode pour que la fenêtre le soit également
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms633574(v=vs.85).aspx
WNDCLASSW windowClass;
windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0;
windowClass.hbrBackground = nullptr;
windowClass.hCursor = nullptr; // Le curseur est définit dynamiquement
windowClass.hIcon = nullptr; // L'icône est définie dynamiquement
windowClass.hCursor = nullptr; // Le curseur est définit dynamiquement
windowClass.hIcon = nullptr; // L'icône est définie dynamiquement
windowClass.hInstance = GetModuleHandle(nullptr);
windowClass.lpfnWndProc = MessageHandler;
windowClass.lpszClassName = className;
@@ -1125,7 +1125,7 @@ void NzWindowImpl::WindowThread(HWND* handle, DWORD styleEx, const wchar_t* titl
mutex->Lock();
condition->Signal();
mutex->Unlock();
// mutex et condition sont considérés invalides à partir d'ici
// mutex et condition sont considérés invalides à partir d'ici
while (window->m_threadActive)
window->ProcessEvents(true);

View File

@@ -1,8 +1,8 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
// Interface inspirée de la SFML par Laurent Gomila
// Interface inspirée de la SFML par Laurent Gomila
#pragma once
@@ -26,7 +26,7 @@ class NzThread;
#endif
class NzWindow;
#undef IsMinimized // Conflit avec la méthode du même nom
#undef IsMinimized // Conflit avec la méthode du même nom
class NzWindowImpl : NzNonCopyable
{

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine".
// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Utility/Window.hpp>
@@ -87,7 +87,7 @@ NzWindow::~NzWindow()
bool NzWindow::Create(NzVideoMode mode, const NzString& title, nzUInt32 style)
{
// Si la fenêtre est déjà ouverte, nous conservons sa position
// Si la fenêtre est déjà ouverte, nous conservons sa position
bool opened = IsOpen();
NzVector2i position;
if (opened)
@@ -95,7 +95,7 @@ bool NzWindow::Create(NzVideoMode mode, const NzString& title, nzUInt32 style)
Destroy();
// Inspiré du code de la SFML par Laurent Gomila
// Inspiré du code de la SFML par Laurent Gomila
if (style & nzWindowStyle_Fullscreen)
{
if (fullscreenWindow)
@@ -138,7 +138,7 @@ bool NzWindow::Create(NzVideoMode mode, const NzString& title, nzUInt32 style)
return false;
}
// Paramètres par défaut
// Paramètres par défaut
m_impl->EnableKeyRepeat(true);
m_impl->EnableSmoothScrolling(false);
m_impl->SetCursor(nzWindowCursor_Default);
@@ -337,7 +337,7 @@ void NzWindow::SetEventListener(bool listener)
m_impl->SetEventListener(listener);
if (!listener)
{
// On vide la pile des évènements
// On vide la pile des évènements
NzLockGuard lock(m_eventMutex);
while (!m_events.empty())
m_events.pop();
@@ -345,7 +345,7 @@ void NzWindow::SetEventListener(bool listener)
#else
if (m_ownsWindow)
{
// Inutile de transmettre l'ordre dans ce cas-là
// Inutile de transmettre l'ordre dans ce cas-là
if (!listener)
NazaraError("A non-threaded window needs to listen to events");
}