diff --git a/ChangeLog.md b/ChangeLog.md index a1f22e9e8..f5a1edf45 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -192,6 +192,7 @@ Nazara Engine: - Added x and y mouse position to MouseWheelEvent - Added SimpleTextDrawer::[Get|Set]MaxLineWidth (which does line wrap) - TypeTag helper struct now includes a Type using +- GuillotineBinPack::Insert overload taking multiple rectangles no longer does a heap allocation Nazara Development Kit: - Added ImageWidget (#139) diff --git a/src/Nazara/Core/GuillotineBinPack.cpp b/src/Nazara/Core/GuillotineBinPack.cpp index 9ebae4bbb..ef8e2f953 100644 --- a/src/Nazara/Core/GuillotineBinPack.cpp +++ b/src/Nazara/Core/GuillotineBinPack.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -302,7 +303,8 @@ namespace Nz bool GuillotineBinPack::Insert(Rectui* rects, bool* flipped, bool* inserted, unsigned int count, bool merge, FreeRectChoiceHeuristic rectChoice, GuillotineSplitHeuristic splitMethod) { - std::vector remainingRects(count); // Position of the rectangle + Nz::StackVector remainingRects = NazaraStackVector(Rectui*, count); // Position of the rectangle + remainingRects.resize(count); for (unsigned int i = 0; i < count; ++i) remainingRects[i] = &rects[i];