Skip to content
Myr

tweak previous PR merge

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent 9009ae0 · Browse files · 1 file+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−4 removed

  • other:+7 added−4 removed

1 file+7 added−4 removed

modified:stb_rect_pack.h+7 added-4 removed
1// stb_rect_pack.h - v0.10 - public domain - rectangle packing1// stb_rect_pack.h - v0.11 - public domain - rectangle packing2// Sean Barrett 20143//4// Useful for e.g. packing rectangular textures into an atlas.5// Does not do rotation.
20 unmodified lines
26// Library27// Sean Barrett28// Minor features29// Martins Mozeiko30// github:IntellectualKitty31// 32// Bugfixes / warning fixes33// Jeremy Jaussaud34//35// Version history:36//37// 0.11 (2017-03-03) return packing success/fail result38// 0.10 (2016-10-25) remove cast-away-const to avoid warnings39// 0.09 (2016-08-27) fix compiler warnings40// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)41// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
538 unmodified lines
580 // unsort581 STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);582583 // set was_packed flags and all_rects_packed status581 for (i=0; i < num_rects; ++i)582 {583 if (!(rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL)))584 for (i=0; i < num_rects; ++i) {585 rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);586 if (!rects[i].was_packed)587 all_rects_packed = 0;588 }589590 // return the all_rects_packed status
45 unmodified lines