diff --git a/SDK/src/NDK/Entity.cpp b/SDK/src/NDK/Entity.cpp index a49a8f6aa..4f60bb427 100644 --- a/SDK/src/NDK/Entity.cpp +++ b/SDK/src/NDK/Entity.cpp @@ -148,9 +148,11 @@ namespace Ndk // We alert each system for (std::size_t index = m_systemBits.FindFirst(); index != m_systemBits.npos; index = m_systemBits.FindNext(index)) { - if (m_world->HasSystem(index)) + auto sysIndex = static_cast(index); + + if (m_world->HasSystem(sysIndex)) { - BaseSystem& system = m_world->GetSystem(index); + BaseSystem& system = m_world->GetSystem(sysIndex); system.RemoveEntity(this); } } diff --git a/SDK/src/NDK/LuaBinding_Math.cpp b/SDK/src/NDK/LuaBinding_Math.cpp index 35ad13a2e..4b7816aac 100644 --- a/SDK/src/NDK/LuaBinding_Math.cpp +++ b/SDK/src/NDK/LuaBinding_Math.cpp @@ -174,7 +174,7 @@ namespace Ndk case 16: { double values[16]; - for (std::size_t i = 0; i < 16; ++i) + for (int i = 0; i < 16; ++i) values[i] = lua.CheckNumber(i); Nz::PlacementNew(matrix, values); diff --git a/SDK/src/NDK/World.cpp b/SDK/src/NDK/World.cpp index 8b041aa5c..f0cfbb44b 100644 --- a/SDK/src/NDK/World.cpp +++ b/SDK/src/NDK/World.cpp @@ -67,7 +67,7 @@ namespace Ndk else { // We allocate a new entity - id = m_entities.size(); + id = static_cast(m_entities.size()); // We can't use emplace_back due to the scope m_entities.push_back(Entity(this, id)); @@ -221,7 +221,7 @@ namespace Ndk Nz::Bitset<>& removedComponents = entity->GetRemovedComponentBits(); for (std::size_t j = removedComponents.FindFirst(); j != m_dirtyEntities.npos; j = removedComponents.FindNext(j)) - entity->DestroyComponent(j); + entity->DestroyComponent(static_cast(j)); removedComponents.Reset(); for (auto& system : m_orderedSystems) diff --git a/include/Nazara/Graphics/ForwardRenderQueue.hpp b/include/Nazara/Graphics/ForwardRenderQueue.hpp index 99be2743e..56474a642 100644 --- a/include/Nazara/Graphics/ForwardRenderQueue.hpp +++ b/include/Nazara/Graphics/ForwardRenderQueue.hpp @@ -87,7 +87,7 @@ namespace Nz struct SpriteChain_XYZ_Color_UV { const VertexStruct_XYZ_Color_UV* vertices; - unsigned int spriteCount; + std::size_t spriteCount; }; struct BatchedSpriteEntry @@ -160,7 +160,7 @@ namespace Nz const Material* material; }; - typedef std::vector TransparentModelContainer; + typedef std::vector TransparentModelContainer; struct Layer { diff --git a/include/Nazara/Graphics/ParticleDeclaration.hpp b/include/Nazara/Graphics/ParticleDeclaration.hpp index 278d25961..770cbe31d 100644 --- a/include/Nazara/Graphics/ParticleDeclaration.hpp +++ b/include/Nazara/Graphics/ParticleDeclaration.hpp @@ -36,10 +36,10 @@ namespace Nz ~ParticleDeclaration(); void DisableComponent(ParticleComponent component); - void EnableComponent(ParticleComponent component, ComponentType type, unsigned int offset); + void EnableComponent(ParticleComponent component, ComponentType type, std::size_t offset); - void GetComponent(ParticleComponent component, bool* enabled, ComponentType* type, unsigned int* offset) const; - unsigned int GetStride() const; + void GetComponent(ParticleComponent component, bool* enabled, ComponentType* type, std::size_t* offset) const; + std::size_t GetStride() const; void SetStride(unsigned int stride); @@ -60,7 +60,7 @@ namespace Nz { ComponentType type; bool enabled = false; - unsigned int offset; + std::size_t offset; /* ** -Lynix: @@ -71,7 +71,7 @@ namespace Nz }; std::array m_components; - unsigned int m_stride; + std::size_t m_stride; static std::array s_declarations; static ParticleDeclarationLibrary::LibraryMap s_library; diff --git a/include/Nazara/Graphics/ParticleEmitter.hpp b/include/Nazara/Graphics/ParticleEmitter.hpp index 8bd26a4bd..cfbb9e98a 100644 --- a/include/Nazara/Graphics/ParticleEmitter.hpp +++ b/include/Nazara/Graphics/ParticleEmitter.hpp @@ -28,12 +28,12 @@ namespace Nz void EnableLagCompensation(bool enable); - unsigned int GetEmissionCount() const; + std::size_t GetEmissionCount() const; float GetEmissionRate() const; bool IsLagCompensationEnabled() const; - void SetEmissionCount(unsigned int count); + void SetEmissionCount(std::size_t count); void SetEmissionRate(float rate); ParticleEmitter& operator=(const ParticleEmitter& emitter) = default; @@ -49,7 +49,7 @@ namespace Nz bool m_lagCompensationEnabled; mutable float m_emissionAccumulator; float m_emissionRate; - unsigned int m_emissionCount; + std::size_t m_emissionCount; }; } diff --git a/include/Nazara/Graphics/ParticleGroup.hpp b/include/Nazara/Graphics/ParticleGroup.hpp index 409090284..35feaa674 100644 --- a/include/Nazara/Graphics/ParticleGroup.hpp +++ b/include/Nazara/Graphics/ParticleGroup.hpp @@ -45,11 +45,11 @@ namespace Nz void* GenerateParticles(unsigned int count); const ParticleDeclarationConstRef& GetDeclaration() const; - unsigned int GetMaxParticleCount() const; - unsigned int GetParticleCount() const; - unsigned int GetParticleSize() const; + std::size_t GetMaxParticleCount() const; + std::size_t GetParticleCount() const; + std::size_t GetParticleSize() const; - void KillParticle(unsigned int index); + void KillParticle(std::size_t index); void KillParticles(); void RemoveController(ParticleController* controller); @@ -81,6 +81,9 @@ namespace Nz }; std::set> m_dyingParticles; + std::size_t m_maxParticleCount; + std::size_t m_particleCount; + std::size_t m_particleSize; mutable std::vector m_buffer; std::vector m_controllers; std::vector m_emitters; @@ -88,9 +91,6 @@ namespace Nz ParticleDeclarationConstRef m_declaration; ParticleRendererRef m_renderer; bool m_processing; - unsigned int m_maxParticleCount; - unsigned int m_particleCount; - unsigned int m_particleSize; }; } diff --git a/include/Nazara/Graphics/RenderTechniques.hpp b/include/Nazara/Graphics/RenderTechniques.hpp index 1e006858a..a4642ffc8 100644 --- a/include/Nazara/Graphics/RenderTechniques.hpp +++ b/include/Nazara/Graphics/RenderTechniques.hpp @@ -29,7 +29,7 @@ namespace Nz static AbstractRenderTechnique* GetByName(const String& name, int* techniqueRanking = nullptr); static AbstractRenderTechnique* GetByRanking(int maxRanking, int* techniqueRanking = nullptr); - static unsigned int GetCount(); + static std::size_t GetCount(); static void Register(const String& name, int ranking, RenderTechniqueFactory factory); diff --git a/src/Nazara/Graphics/DeferredGeometryPass.cpp b/src/Nazara/Graphics/DeferredGeometryPass.cpp index 79e651926..e95bf250b 100644 --- a/src/Nazara/Graphics/DeferredGeometryPass.cpp +++ b/src/Nazara/Graphics/DeferredGeometryPass.cpp @@ -159,13 +159,13 @@ namespace Nz instanceBuffer->SetVertexDeclaration(VertexDeclaration::Get(VertexLayout_Matrix4)); const Matrix4f* instanceMatrices = &instances[0]; - unsigned int instanceCount = instances.size(); - unsigned int maxInstanceCount = instanceBuffer->GetVertexCount(); // The number of matrices that can be hold in the buffer + std::size_t instanceCount = instances.size(); + std::size_t maxInstanceCount = instanceBuffer->GetVertexCount(); // The number of matrices that can be hold in the buffer while (instanceCount > 0) { // We compute the number of instances that we will be able to show this time (Depending on the instance buffer size) - unsigned int renderedInstanceCount = std::min(instanceCount, maxInstanceCount); + std::size_t renderedInstanceCount = std::min(instanceCount, maxInstanceCount); instanceCount -= renderedInstanceCount; // We fill the instancing buffer with our world matrices diff --git a/src/Nazara/Graphics/DepthRenderTechnique.cpp b/src/Nazara/Graphics/DepthRenderTechnique.cpp index bcae2eb57..60d344fb7 100644 --- a/src/Nazara/Graphics/DepthRenderTechnique.cpp +++ b/src/Nazara/Graphics/DepthRenderTechnique.cpp @@ -267,13 +267,13 @@ namespace Nz const Texture* overlay = overlayIt.first; auto& spriteChainVector = overlayIt.second.spriteChains; - unsigned int spriteChainCount = spriteChainVector.size(); + std::size_t spriteChainCount = spriteChainVector.size(); if (spriteChainCount > 0) { Renderer::SetTexture(overlayUnit, (overlay) ? overlay : &m_whiteTexture); - unsigned int spriteChain = 0; // Which chain of sprites are we treating - unsigned int spriteChainOffset = 0; // Where was the last offset where we stopped in the last chain + std::size_t spriteChain = 0; // Which chain of sprites are we treating + std::size_t spriteChainOffset = 0; // Where was the last offset where we stopped in the last chain do { @@ -281,13 +281,13 @@ namespace Nz BufferMapper vertexMapper(m_spriteBuffer, BufferAccess_DiscardAndWrite); VertexStruct_XYZ_Color_UV* vertices = static_cast(vertexMapper.GetPointer()); - unsigned int spriteCount = 0; - unsigned int maxSpriteCount = std::min(s_maxQuads, m_spriteBuffer.GetVertexCount() / 4); + std::size_t spriteCount = 0; + std::size_t maxSpriteCount = std::min(s_maxQuads, m_spriteBuffer.GetVertexCount() / 4); do { ForwardRenderQueue::SpriteChain_XYZ_Color_UV& currentChain = spriteChainVector[spriteChain]; - unsigned int count = std::min(maxSpriteCount - spriteCount, currentChain.spriteCount - spriteChainOffset); + std::size_t count = std::min(maxSpriteCount - spriteCount, currentChain.spriteCount - spriteChainOffset); std::memcpy(vertices, currentChain.vertices + spriteChainOffset * 4, 4 * count * sizeof(VertexStruct_XYZ_Color_UV)); vertices += count * 4; @@ -373,17 +373,17 @@ namespace Nz auto& entry = matIt.second; auto& billboardVector = entry.billboards; - unsigned int billboardCount = billboardVector.size(); + std::size_t billboardCount = billboardVector.size(); if (billboardCount > 0) { // We begin to apply the material (and get the shader activated doing so) material->Apply(pipelineInstance); const ForwardRenderQueue::BillboardData* data = &billboardVector[0]; - unsigned int maxBillboardPerDraw = instanceBuffer->GetVertexCount(); + std::size_t maxBillboardPerDraw = instanceBuffer->GetVertexCount(); do { - unsigned int renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); + std::size_t renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); billboardCount -= renderedBillboardCount; instanceBuffer->Fill(data, 0, renderedBillboardCount, true); @@ -435,12 +435,12 @@ namespace Nz auto& billboardVector = entry.billboards; const ForwardRenderQueue::BillboardData* data = &billboardVector[0]; - unsigned int maxBillboardPerDraw = std::min(s_maxQuads, m_billboardPointBuffer.GetVertexCount() / 4); + std::size_t maxBillboardPerDraw = std::min(s_maxQuads, m_billboardPointBuffer.GetVertexCount() / 4); - unsigned int billboardCount = billboardVector.size(); + std::size_t billboardCount = billboardVector.size(); do { - unsigned int renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); + std::size_t renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); billboardCount -= renderedBillboardCount; BufferMapper vertexMapper(m_billboardPointBuffer, BufferAccess_DiscardAndWrite, 0, renderedBillboardCount * 4); @@ -584,13 +584,13 @@ namespace Nz instanceBuffer->SetVertexDeclaration(VertexDeclaration::Get(VertexLayout_Matrix4)); const Matrix4f* instanceMatrices = &instances[0]; - unsigned int instanceCount = instances.size(); - unsigned int maxInstanceCount = instanceBuffer->GetVertexCount(); // Maximum number of instance in one batch + std::size_t instanceCount = instances.size(); + std::size_t maxInstanceCount = instanceBuffer->GetVertexCount(); // Maximum number of instance in one batch while (instanceCount > 0) { // We compute the number of instances that we will be able to draw this time (depending on the instancing buffer size) - unsigned int renderedInstanceCount = std::min(instanceCount, maxInstanceCount); + std::size_t renderedInstanceCount = std::min(instanceCount, maxInstanceCount); instanceCount -= renderedInstanceCount; // We fill the instancing buffer with our world matrices diff --git a/src/Nazara/Graphics/ForwardRenderQueue.cpp b/src/Nazara/Graphics/ForwardRenderQueue.cpp index b74ffa732..97c3a53d5 100644 --- a/src/Nazara/Graphics/ForwardRenderQueue.cpp +++ b/src/Nazara/Graphics/ForwardRenderQueue.cpp @@ -383,7 +383,7 @@ namespace Nz auto& transparentModelData = currentLayer.transparentModelData; // The material is transparent, we must draw this mesh using another way (after the rendering of opages objects while sorting them) - unsigned int index = transparentModelData.size(); + std::size_t index = transparentModelData.size(); transparentModelData.resize(index+1); TransparentModelData& data = transparentModelData.back(); @@ -603,7 +603,7 @@ namespace Nz { Layer& layer = pair.second; - std::sort(layer.transparentModels.begin(), layer.transparentModels.end(), [&layer, &nearPlane, &viewerNormal] (unsigned int index1, unsigned int index2) + std::sort(layer.transparentModels.begin(), layer.transparentModels.end(), [&layer, &nearPlane, &viewerNormal] (std::size_t index1, std::size_t index2) { const Spheref& sphere1 = layer.transparentModelData[index1].squaredBoundingSphere; const Spheref& sphere2 = layer.transparentModelData[index2].squaredBoundingSphere; @@ -672,7 +672,7 @@ namespace Nz BatchedBillboardEntry& entry = it->second; auto& billboardVector = entry.billboards; - unsigned int prevSize = billboardVector.size(); + std::size_t prevSize = billboardVector.size(); billboardVector.resize(prevSize + count); return &billboardVector[prevSize]; diff --git a/src/Nazara/Graphics/ForwardRenderTechnique.cpp b/src/Nazara/Graphics/ForwardRenderTechnique.cpp index 699ae416a..7792a93b2 100644 --- a/src/Nazara/Graphics/ForwardRenderTechnique.cpp +++ b/src/Nazara/Graphics/ForwardRenderTechnique.cpp @@ -33,8 +33,8 @@ namespace Nz Vector2f uv; }; - unsigned int s_maxQuads = std::numeric_limits::max() / 6; - unsigned int s_vertexBufferSize = 4 * 1024 * 1024; // 4 MiB + std::size_t s_maxQuads = std::numeric_limits::max() / 6; + std::size_t s_vertexBufferSize = 4 * 1024 * 1024; // 4 MiB } /*! @@ -347,13 +347,13 @@ namespace Nz const Texture* overlay = overlayIt.first; auto& spriteChainVector = overlayIt.second.spriteChains; - unsigned int spriteChainCount = spriteChainVector.size(); + std::size_t spriteChainCount = spriteChainVector.size(); if (spriteChainCount > 0) { Renderer::SetTexture(overlayUnit, (overlay) ? overlay : &m_whiteTexture); - unsigned int spriteChain = 0; // Which chain of sprites are we treating - unsigned int spriteChainOffset = 0; // Where was the last offset where we stopped in the last chain + std::size_t spriteChain = 0; // Which chain of sprites are we treating + std::size_t spriteChainOffset = 0; // Where was the last offset where we stopped in the last chain do { @@ -361,13 +361,13 @@ namespace Nz BufferMapper vertexMapper(m_spriteBuffer, BufferAccess_DiscardAndWrite); VertexStruct_XYZ_Color_UV* vertices = static_cast(vertexMapper.GetPointer()); - unsigned int spriteCount = 0; - unsigned int maxSpriteCount = std::min(s_maxQuads, m_spriteBuffer.GetVertexCount() / 4); + std::size_t spriteCount = 0; + std::size_t maxSpriteCount = std::min(s_maxQuads, m_spriteBuffer.GetVertexCount() / 4); do { ForwardRenderQueue::SpriteChain_XYZ_Color_UV& currentChain = spriteChainVector[spriteChain]; - unsigned int count = std::min(maxSpriteCount - spriteCount, currentChain.spriteCount - spriteChainOffset); + std::size_t count = std::min(maxSpriteCount - spriteCount, currentChain.spriteCount - spriteChainOffset); std::memcpy(vertices, currentChain.vertices + spriteChainOffset * 4, 4 * count * sizeof(VertexStruct_XYZ_Color_UV)); vertices += count * 4; @@ -450,17 +450,17 @@ namespace Nz auto& entry = matIt.second; auto& billboardVector = entry.billboards; - unsigned int billboardCount = billboardVector.size(); + std::size_t billboardCount = billboardVector.size(); if (billboardCount > 0) { // We begin to apply the material (and get the shader activated doing so) material->Apply(pipelineInstance); const ForwardRenderQueue::BillboardData* data = &billboardVector[0]; - unsigned int maxBillboardPerDraw = instanceBuffer->GetVertexCount(); + std::size_t maxBillboardPerDraw = instanceBuffer->GetVertexCount(); do { - unsigned int renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); + std::size_t renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); billboardCount -= renderedBillboardCount; instanceBuffer->Fill(data, 0, renderedBillboardCount, true); @@ -512,12 +512,12 @@ namespace Nz auto& billboardVector = entry.billboards; const ForwardRenderQueue::BillboardData* data = &billboardVector[0]; - unsigned int maxBillboardPerDraw = std::min(s_maxQuads, m_billboardPointBuffer.GetVertexCount() / 4); + std::size_t maxBillboardPerDraw = std::min(s_maxQuads, m_billboardPointBuffer.GetVertexCount() / 4); - unsigned int billboardCount = billboardVector.size(); + std::size_t billboardCount = billboardVector.size(); do { - unsigned int renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); + std::size_t renderedBillboardCount = std::min(billboardCount, maxBillboardPerDraw); billboardCount -= renderedBillboardCount; BufferMapper vertexMapper(m_billboardPointBuffer, BufferAccess_DiscardAndWrite, 0, renderedBillboardCount * 4); @@ -666,16 +666,16 @@ namespace Nz // With instancing, impossible to select the lights for each object // So, it's only activated for directional lights - unsigned int lightCount = m_renderQueue.directionalLights.size(); - unsigned int lightIndex = 0; + std::size_t lightCount = m_renderQueue.directionalLights.size(); + std::size_t lightIndex = 0; RendererComparison oldDepthFunc = Renderer::GetDepthFunc(); - unsigned int passCount = (lightCount == 0) ? 1 : (lightCount - 1) / NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS + 1; - for (unsigned int pass = 0; pass < passCount; ++pass) + std::size_t passCount = (lightCount == 0) ? 1 : (lightCount - 1) / NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS + 1; + for (std::size_t pass = 0; pass < passCount; ++pass) { if (shaderUniforms->hasLightUniforms) { - unsigned int renderedLightCount = std::min(lightCount, NazaraSuffixMacro(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, U)); + std::size_t renderedLightCount = std::min(lightCount, NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS); lightCount -= renderedLightCount; if (pass == 1) @@ -690,18 +690,18 @@ namespace Nz } // Sends the uniforms - for (unsigned int i = 0; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) + for (std::size_t i = 0; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) SendLightUniforms(shader, shaderUniforms->lightUniforms, lightIndex++, shaderUniforms->lightOffset * i, freeTextureUnit + i); } const Matrix4f* instanceMatrices = &instances[0]; - unsigned int instanceCount = instances.size(); - unsigned int maxInstanceCount = instanceBuffer->GetVertexCount(); // Maximum number of instance in one batch + std::size_t instanceCount = instances.size(); + std::size_t maxInstanceCount = instanceBuffer->GetVertexCount(); // Maximum number of instance in one batch while (instanceCount > 0) { // We compute the number of instances that we will be able to draw this time (depending on the instancing buffer size) - unsigned int renderedInstanceCount = std::min(instanceCount, maxInstanceCount); + std::size_t renderedInstanceCount = std::min(instanceCount, maxInstanceCount); instanceCount -= renderedInstanceCount; // We fill the instancing buffer with our world matrices @@ -726,16 +726,16 @@ namespace Nz // Choose the lights depending on an object position and apparent radius ChooseLights(Spheref(matrix.GetTranslation() + squaredBoundingSphere.GetPosition(), squaredBoundingSphere.radius)); - unsigned int lightCount = m_lights.size(); + std::size_t lightCount = m_lights.size(); Renderer::SetMatrix(MatrixType_World, matrix); - unsigned int lightIndex = 0; + std::size_t lightIndex = 0; RendererComparison oldDepthFunc = Renderer::GetDepthFunc(); // In the case where we have to change it - unsigned int passCount = (lightCount == 0) ? 1 : (lightCount - 1) / NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS + 1; - for (unsigned int pass = 0; pass < passCount; ++pass) + std::size_t passCount = (lightCount == 0) ? 1 : (lightCount - 1) / NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS + 1; + for (std::size_t pass = 0; pass < passCount; ++pass) { - lightCount -= std::min(lightCount, NazaraSuffixMacro(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, U)); + lightCount -= std::min(lightCount, NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS); if (pass == 1) { @@ -749,7 +749,7 @@ namespace Nz } // Sends the light uniforms to the shader - for (unsigned int i = 0; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) + for (std::size_t i = 0; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) SendLightUniforms(shader, shaderUniforms->lightUniforms, lightIndex++, shaderUniforms->lightOffset*i, freeTextureUnit + i); // And we draw @@ -835,7 +835,7 @@ namespace Nz { lightCount = std::min(m_renderQueue.directionalLights.size(), static_cast(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS)); - for (unsigned int i = 0; i < lightCount; ++i) + for (std::size_t i = 0; i < lightCount; ++i) SendLightUniforms(shader, shaderUniforms->lightUniforms, i, shaderUniforms->lightOffset * i, freeTextureUnit++); } @@ -874,7 +874,7 @@ namespace Nz float radius = modelData.squaredBoundingSphere.radius; ChooseLights(Spheref(position, radius), false); - for (unsigned int i = lightCount; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) + for (std::size_t i = lightCount; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i) SendLightUniforms(shader, shaderUniforms->lightUniforms, i, shaderUniforms->lightOffset*i, freeTextureUnit++); } diff --git a/src/Nazara/Graphics/ParticleDeclaration.cpp b/src/Nazara/Graphics/ParticleDeclaration.cpp index ebd84e95d..60786c1f1 100644 --- a/src/Nazara/Graphics/ParticleDeclaration.cpp +++ b/src/Nazara/Graphics/ParticleDeclaration.cpp @@ -100,7 +100,7 @@ namespace Nz * \remark Produces a NazaraError with NAZARA_GRAPHICS_SAFE defined if type is not supported */ - void ParticleDeclaration::EnableComponent(ParticleComponent component, ComponentType type, unsigned int offset) + void ParticleDeclaration::EnableComponent(ParticleComponent component, ComponentType type, std::size_t offset) { #ifdef NAZARA_DEBUG if (component > ParticleComponent_Max) @@ -145,7 +145,7 @@ namespace Nz * \remark Produces a NazaraError with NAZARA_GRAPHICS_SAFE defined if enumeration is equal to ParticleComponent_Unused */ - void ParticleDeclaration::GetComponent(ParticleComponent component, bool* enabled, ComponentType* type, unsigned int* offset) const + void ParticleDeclaration::GetComponent(ParticleComponent component, bool* enabled, ComponentType* type, std::size_t* offset) const { #ifdef NAZARA_DEBUG if (component > ParticleComponent_Max) @@ -180,7 +180,7 @@ namespace Nz * \return Stride of the declaration */ - unsigned int ParticleDeclaration::GetStride() const + std::size_t ParticleDeclaration::GetStride() const { return m_stride; } diff --git a/src/Nazara/Graphics/ParticleEmitter.cpp b/src/Nazara/Graphics/ParticleEmitter.cpp index fe27575e7..038e69ce9 100644 --- a/src/Nazara/Graphics/ParticleEmitter.cpp +++ b/src/Nazara/Graphics/ParticleEmitter.cpp @@ -74,11 +74,11 @@ namespace Nz if (emissionCount >= 1.f) { // We compute the maximum number of particles which can be emitted - unsigned int emissionCountInt = static_cast(emissionCount); - unsigned int maxParticleCount = emissionCountInt * m_emissionCount; + std::size_t emissionCountInt = static_cast(emissionCount); + std::size_t maxParticleCount = emissionCountInt * m_emissionCount; // We get the number of particles that we are able to create (depending on the free space) - unsigned int particleCount = std::min(maxParticleCount, system.GetMaxParticleCount() - system.GetParticleCount()); + std::size_t particleCount = std::min(maxParticleCount, system.GetMaxParticleCount() - system.GetParticleCount()); if (particleCount == 0) return; @@ -115,7 +115,7 @@ namespace Nz * \return Current emission count */ - unsigned int ParticleEmitter::GetEmissionCount() const + std::size_t ParticleEmitter::GetEmissionCount() const { return m_emissionCount; } @@ -146,7 +146,7 @@ namespace Nz * \param count Emission count */ - void ParticleEmitter::SetEmissionCount(unsigned int count) + void ParticleEmitter::SetEmissionCount(std::size_t count) { m_emissionCount = count; } diff --git a/src/Nazara/Graphics/ParticleGroup.cpp b/src/Nazara/Graphics/ParticleGroup.cpp index 5aca6c2b4..f2c46d91c 100644 --- a/src/Nazara/Graphics/ParticleGroup.cpp +++ b/src/Nazara/Graphics/ParticleGroup.cpp @@ -142,11 +142,10 @@ namespace Nz * \remark Produces a NazaraAssert if renderQueue is invalid */ - void ParticleGroup::AddToRenderQueue(AbstractRenderQueue* renderQueue, const Matrix4f& transformMatrix) const + void ParticleGroup::AddToRenderQueue(AbstractRenderQueue* renderQueue, const Matrix4f& /*transformMatrix*/) const { NazaraAssert(m_renderer, "Invalid particle renderer"); NazaraAssert(renderQueue, "Invalid renderqueue"); - NazaraUnused(transformMatrix); if (m_particleCount > 0) { @@ -215,7 +214,7 @@ namespace Nz if (m_particleCount + count > m_maxParticleCount) return nullptr; - unsigned int particlesIndex = m_particleCount; + std::size_t particlesIndex = m_particleCount; m_particleCount += count; return &m_buffer[particlesIndex * m_particleSize]; @@ -264,7 +263,7 @@ namespace Nz * \return Current maximum number */ - unsigned int ParticleGroup::GetMaxParticleCount() const + std::size_t ParticleGroup::GetMaxParticleCount() const { return m_maxParticleCount; } @@ -274,7 +273,7 @@ namespace Nz * \return Current number */ - unsigned int ParticleGroup::GetParticleCount() const + std::size_t ParticleGroup::GetParticleCount() const { return m_particleCount; } @@ -284,7 +283,7 @@ namespace Nz * \return Current size */ - unsigned int ParticleGroup::GetParticleSize() const + std::size_t ParticleGroup::GetParticleSize() const { return m_particleSize; } @@ -295,7 +294,7 @@ namespace Nz * \param index Index of the particle */ - void ParticleGroup::KillParticle(unsigned int index) + void ParticleGroup::KillParticle(std::size_t index) { ///FIXME: Verify the index @@ -402,10 +401,8 @@ namespace Nz * \param transformMatrix Matrix transformation for our bounding volume */ - void ParticleGroup::UpdateBoundingVolume(const Matrix4f& transformMatrix) + void ParticleGroup::UpdateBoundingVolume(const Matrix4f& /*transformMatrix*/) { - NazaraUnused(transformMatrix); - // Nothing to do here (our bounding volume is global) } diff --git a/src/Nazara/Graphics/RenderTechniques.cpp b/src/Nazara/Graphics/RenderTechniques.cpp index 46d84d9c4..8298245b7 100644 --- a/src/Nazara/Graphics/RenderTechniques.cpp +++ b/src/Nazara/Graphics/RenderTechniques.cpp @@ -170,7 +170,7 @@ namespace Nz * \return Number of techniques */ - unsigned int RenderTechniques::GetCount() + std::size_t RenderTechniques::GetCount() { return s_renderTechniques.size(); } diff --git a/src/Nazara/Physics2D/PhysWorld2D.cpp b/src/Nazara/Physics2D/PhysWorld2D.cpp index 5290abfcd..878a84400 100644 --- a/src/Nazara/Physics2D/PhysWorld2D.cpp +++ b/src/Nazara/Physics2D/PhysWorld2D.cpp @@ -24,7 +24,7 @@ namespace Nz Vector2f PhysWorld2D::GetGravity() const { cpVect gravity = cpSpaceGetGravity(m_handle); - return Vector2f(gravity.x, gravity.y); + return Vector2f(Vector2(gravity.x, gravity.y)); } cpSpace* PhysWorld2D::GetHandle() const diff --git a/src/Nazara/Utility/Image.cpp b/src/Nazara/Utility/Image.cpp index 160c2ac90..b4be2c7c5 100644 --- a/src/Nazara/Utility/Image.cpp +++ b/src/Nazara/Utility/Image.cpp @@ -1441,7 +1441,7 @@ namespace Nz SharedImage::PixelContainer levels(m_sharedImage->levels.size()); for (unsigned int i = 0; i < levels.size(); ++i) { - unsigned int size = GetMemoryUsage(i); + std::size_t size = GetMemoryUsage(i); levels[i].reset(new UInt8[size]); std::memcpy(levels[i].get(), m_sharedImage->levels[i].get(), size); } diff --git a/src/Nazara/Utility/VertexBuffer.cpp b/src/Nazara/Utility/VertexBuffer.cpp index 0bc890340..b196d723a 100644 --- a/src/Nazara/Utility/VertexBuffer.cpp +++ b/src/Nazara/Utility/VertexBuffer.cpp @@ -45,7 +45,7 @@ namespace Nz bool VertexBuffer::Fill(const void* data, unsigned int startVertex, unsigned int length, bool forceDiscard) { - unsigned int stride = m_vertexDeclaration->GetStride(); + std::size_t stride = m_vertexDeclaration->GetStride(); return FillRaw(data, startVertex*stride, length*stride, forceDiscard); }