From 5d3e4d7aeb6ca119b3faaa325d7d62423f785283 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 26 Nov 2015 23:57:48 +0100 Subject: [PATCH] Core/GuillotineBinPack: Fix search error Former-commit-id: 8b7428f59b0a1258c8096df2f784910523dee79d --- src/Nazara/Core/GuillotineBinPack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Nazara/Core/GuillotineBinPack.cpp b/src/Nazara/Core/GuillotineBinPack.cpp index b3aedccc0..05f8736b5 100644 --- a/src/Nazara/Core/GuillotineBinPack.cpp +++ b/src/Nazara/Core/GuillotineBinPack.cpp @@ -154,7 +154,7 @@ namespace Nz bool bestFlipped; std::size_t bestFreeRect; std::size_t bestRect; - std::size_t bestScore = std::numeric_limits::max(); + int bestScore = std::numeric_limits::max(); for (std::size_t i = 0; i < m_freeRectangles.size(); ++i) { @@ -170,7 +170,7 @@ namespace Nz bestFreeRect = i; bestRect = j; bestFlipped = false; - bestScore = std::numeric_limits::min(); + bestScore = std::numeric_limits::min(); i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit. break; } @@ -180,7 +180,7 @@ namespace Nz bestFreeRect = i; bestRect = j; bestFlipped = true; - bestScore = std::numeric_limits::min(); + bestScore = std::numeric_limits::min(); i = m_freeRectangles.size(); // Force a jump out of the outer loop as well - we got an instant fit. break; } @@ -212,7 +212,7 @@ namespace Nz } // If we didn't manage to find any rectangle to pack, abort. - if (bestScore == std::numeric_limits::max()) + if (bestScore == std::numeric_limits::max()) { // Si nous le pouvons, on marque les rectangles n'ayant pas pu être insérés if (inserted)