From 6b2af70f1d6a3d087be54dd63216686b0e7d2f12 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 9 Jun 2013 22:05:05 +0200 Subject: [PATCH] Cleaned interface Former-commit-id: cdd284de8396d5988853c84d5db17bfa6fa0ba51 --- include/Nazara/Core/Enums.hpp | 8 ++++++++ include/Nazara/Math/Box.hpp | 4 ++-- include/Nazara/Math/Box.inl | 8 ++++---- include/Nazara/Math/Rect.hpp | 4 ++-- include/Nazara/Math/Rect.inl | 8 ++++---- include/Nazara/Utility/Enums.hpp | 8 -------- include/Nazara/Utility/SkeletalMesh.hpp | 4 ++-- src/Nazara/Utility/SkeletalMesh.cpp | 12 ++++++------ 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/Nazara/Core/Enums.hpp b/include/Nazara/Core/Enums.hpp index 734632009..6a4190503 100644 --- a/include/Nazara/Core/Enums.hpp +++ b/include/Nazara/Core/Enums.hpp @@ -7,6 +7,14 @@ #ifndef NAZARA_ENUMS_CORE_HPP #define NAZARA_ENUMS_CORE_HPP +enum nzCoordSys +{ + nzCoordSys_Global, + nzCoordSys_Local, + + nzCoordSys_Max = nzCoordSys_Local +}; + enum nzEndianness { nzEndianness_Unknown = -1, diff --git a/include/Nazara/Math/Box.hpp b/include/Nazara/Math/Box.hpp index d301d5cec..4c13744e4 100644 --- a/include/Nazara/Math/Box.hpp +++ b/include/Nazara/Math/Box.hpp @@ -23,7 +23,7 @@ class NzBox NzBox(T X, T Y, T Z, T Width, T Height, T Depth); NzBox(const T box[6]); NzBox(const NzRect& rect); - NzBox(const NzVector3& size); + NzBox(const NzVector3& lengths); NzBox(const NzVector3& vec1, const NzVector3& vec2); template explicit NzBox(const NzBox& box); NzBox(const NzBox& box) = default; @@ -60,7 +60,7 @@ class NzBox NzBox& Set(const T box[6]); NzBox& Set(const NzBox& box); NzBox& Set(const NzRect& rect); - NzBox& Set(const NzVector3& size); + NzBox& Set(const NzVector3& lengths); NzBox& Set(const NzVector3& vec1, const NzVector3& vec2); template NzBox& Set(const NzBox& box); diff --git a/include/Nazara/Math/Box.inl b/include/Nazara/Math/Box.inl index b9387a262..b324304e2 100644 --- a/include/Nazara/Math/Box.inl +++ b/include/Nazara/Math/Box.inl @@ -29,9 +29,9 @@ NzBox::NzBox(const NzRect& rect) } template -NzBox::NzBox(const NzVector3& size) +NzBox::NzBox(const NzVector3& lengths) { - Set(size); + Set(lengths); } template @@ -344,9 +344,9 @@ NzBox& NzBox::Set(const NzRect& rect) } template -NzBox& NzBox::Set(const NzVector3& size) +NzBox& NzBox::Set(const NzVector3& lengths) { - return Set(size.x, size.y, size.z); + return Set(lengths.x, lengths.y, lengths.z); } template diff --git a/include/Nazara/Math/Rect.hpp b/include/Nazara/Math/Rect.hpp index 17a60778b..b8f34fd92 100644 --- a/include/Nazara/Math/Rect.hpp +++ b/include/Nazara/Math/Rect.hpp @@ -18,7 +18,7 @@ class NzRect NzRect(T Width, T Height); NzRect(T X, T Y, T Width, T Height); NzRect(const T rect[4]); - NzRect(const NzVector2& size); + NzRect(const NzVector2& lengths); NzRect(const NzVector2& vec1, const NzVector2& vec2); template explicit NzRect(const NzRect& rect); NzRect(const NzRect& rect) = default; @@ -50,7 +50,7 @@ class NzRect NzRect& Set(T X, T Y, T Width, T Height); NzRect& Set(const T rect[4]); NzRect& Set(const NzRect& rect); - NzRect& Set(const NzVector2& size); + NzRect& Set(const NzVector2& lengths); NzRect& Set(const NzVector2& vec1, const NzVector2& vec2); template NzRect& Set(const NzRect& rect); diff --git a/include/Nazara/Math/Rect.inl b/include/Nazara/Math/Rect.inl index 5973df9ef..4a68c5a2f 100644 --- a/include/Nazara/Math/Rect.inl +++ b/include/Nazara/Math/Rect.inl @@ -29,9 +29,9 @@ NzRect::NzRect(const T vec[4]) } template -NzRect::NzRect(const NzVector2& size) +NzRect::NzRect(const NzVector2& lengths) { - Set(size); + Set(lengths); } template @@ -245,9 +245,9 @@ NzRect& NzRect::Set(const NzRect& rect) } template -NzRect& NzRect::Set(const NzVector2& size) +NzRect& NzRect::Set(const NzVector2& lengths) { - return Set(size.x, size.y); + return Set(lengths.x, lengths.y); } template diff --git a/include/Nazara/Utility/Enums.hpp b/include/Nazara/Utility/Enums.hpp index 1fb7a8ba9..388c09d93 100644 --- a/include/Nazara/Utility/Enums.hpp +++ b/include/Nazara/Utility/Enums.hpp @@ -50,14 +50,6 @@ enum nzBufferUsage nzBufferUsage_Max = nzBufferUsage_Static }; -enum nzCoordSys -{ - nzCoordSys_Global, - nzCoordSys_Local, - - nzCoordSys_Max = nzCoordSys_Local -}; - enum nzCubemapFace { // Cette énumération est prévue pour remplacer l'argument "z" des méthodes de NzImage contenant un cubemap diff --git a/include/Nazara/Utility/SkeletalMesh.hpp b/include/Nazara/Utility/SkeletalMesh.hpp index 75e1a319b..e2b94478b 100644 --- a/include/Nazara/Utility/SkeletalMesh.hpp +++ b/include/Nazara/Utility/SkeletalMesh.hpp @@ -42,8 +42,8 @@ class NAZARA_API NzSkeletalMesh final : public NzSubMesh const NzBoxf& GetAABB() const; nzAnimationType GetAnimationType() const final; - void* GetBindPoseBuffer(); - const void* GetBindPoseBuffer() const; + NzMeshVertex* GetBindPoseBuffer(); + const NzMeshVertex* GetBindPoseBuffer() const; const NzIndexBuffer* GetIndexBuffer() const override; unsigned int GetVertexCount() const override; NzVertexWeight* GetVertexWeight(unsigned int vertexIndex = 0); diff --git a/src/Nazara/Utility/SkeletalMesh.cpp b/src/Nazara/Utility/SkeletalMesh.cpp index 370bb0da7..b4d14e782 100644 --- a/src/Nazara/Utility/SkeletalMesh.cpp +++ b/src/Nazara/Utility/SkeletalMesh.cpp @@ -133,7 +133,7 @@ namespace struct NzSkeletalMeshImpl { - std::unique_ptr bindPoseBuffer; + std::unique_ptr bindPoseBuffer; std::vector vertexWeights; std::vector weights; NzBoxf aabb; @@ -170,7 +170,7 @@ bool NzSkeletalMesh::Create(unsigned int vertexCount, unsigned int weightCount) #endif m_impl = new NzSkeletalMeshImpl; - m_impl->bindPoseBuffer.reset(new nzUInt8[vertexCount*sizeof(NzMeshVertex)]); + m_impl->bindPoseBuffer.reset(new NzMeshVertex[vertexCount]); m_impl->vertexCount = vertexCount; m_impl->vertexWeights.resize(vertexCount); m_impl->weights.resize(weightCount); @@ -207,7 +207,7 @@ nzAnimationType NzSkeletalMesh::GetAnimationType() const return nzAnimationType_Skeletal; } -void* NzSkeletalMesh::GetBindPoseBuffer() +NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer() { #if NAZARA_UTILITY_SAFE if (!m_impl) @@ -220,7 +220,7 @@ void* NzSkeletalMesh::GetBindPoseBuffer() return m_impl->bindPoseBuffer.get(); } -const void* NzSkeletalMesh::GetBindPoseBuffer() const +const NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer() const { #if NAZARA_UTILITY_SAFE if (!m_impl) @@ -358,7 +358,7 @@ void NzSkeletalMesh::Skin(NzMeshVertex* outputBuffer, const NzSkeleton* skeleton #endif SkinningInfos skinningInfos; - skinningInfos.inputVertex = reinterpret_cast(m_impl->bindPoseBuffer.get()); + skinningInfos.inputVertex = m_impl->bindPoseBuffer.get(); skinningInfos.outputVertex = outputBuffer; skinningInfos.joints = skeleton->GetJoints(); skinningInfos.vertexWeights = &m_impl->vertexWeights[0]; @@ -380,7 +380,7 @@ void NzSkeletalMesh::Skin(NzMeshVertex* outputBuffer, const NzSkeleton* skeleton Skin_PositionNormalTangent(skinningInfos, 0, m_impl->vertexCount); #endif - m_impl->aabb = skeleton->GetAABB(); + m_impl->aabb = skeleton->GetAABB(); ///FIXME: Qu'est-ce que ça fait encore là ça ? } void NzSkeletalMesh::SetIndexBuffer(const NzIndexBuffer* indexBuffer)