summaryrefslogtreecommitdiffhomepage
path: root/src/external/stb_rect_pack.h
diff options
context:
space:
mode:
authorRay <[email protected]>2017-01-18 23:27:41 +0100
committerRay <[email protected]>2017-01-18 23:27:41 +0100
commit7cd24d27061cb08f818692961beb1ecb4a74445e (patch)
tree6b79154628edb1ac05969767c08612c1e61240db /src/external/stb_rect_pack.h
parent3b120bd7d936b5e6b730caa60709c6d73865d146 (diff)
downloadraylib-7cd24d27061cb08f818692961beb1ecb4a74445e.tar.gz
raylib-7cd24d27061cb08f818692961beb1ecb4a74445e.zip
Updated stb external libraries
Diffstat (limited to 'src/external/stb_rect_pack.h')
-rw-r--r--src/external/stb_rect_pack.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/external/stb_rect_pack.h b/src/external/stb_rect_pack.h
index bd1cfc60..c75527da 100644
--- a/src/external/stb_rect_pack.h
+++ b/src/external/stb_rect_pack.h
@@ -1,4 +1,4 @@
-// stb_rect_pack.h - v0.08 - public domain - rectangle packing
+// stb_rect_pack.h - v0.10 - public domain - rectangle packing
// Sean Barrett 2014
//
// Useful for e.g. packing rectangular textures into an atlas.
@@ -32,6 +32,8 @@
//
// Version history:
//
+// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
+// 0.09 (2016-08-27) fix compiler warnings
// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
@@ -148,7 +150,7 @@ enum
{
STBRP_HEURISTIC_Skyline_default=0,
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
- STBRP_HEURISTIC_Skyline_BF_sortHeight,
+ STBRP_HEURISTIC_Skyline_BF_sortHeight
};
@@ -198,9 +200,15 @@ struct stbrp_context
#define STBRP_ASSERT assert
#endif
+#ifdef _MSC_VER
+#define STBRP__NOTUSED(v) (void)(v)
+#else
+#define STBRP__NOTUSED(v) (void)sizeof(v)
+#endif
+
enum
{
- STBRP__INIT_skyline = 1,
+ STBRP__INIT_skyline = 1
};
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
@@ -273,6 +281,9 @@ static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0
stbrp_node *node = first;
int x1 = x0 + width;
int min_y, visited_width, waste_area;
+
+ STBRP__NOTUSED(c);
+
STBRP_ASSERT(first->x <= x0);
#if 0
@@ -500,8 +511,8 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
static int rect_height_compare(const void *a, const void *b)
{
- stbrp_rect *p = (stbrp_rect *) a;
- stbrp_rect *q = (stbrp_rect *) b;
+ const stbrp_rect *p = (const stbrp_rect *) a;
+ const stbrp_rect *q = (const stbrp_rect *) b;
if (p->h > q->h)
return -1;
if (p->h < q->h)
@@ -511,8 +522,8 @@ static int rect_height_compare(const void *a, const void *b)
static int rect_width_compare(const void *a, const void *b)
{
- stbrp_rect *p = (stbrp_rect *) a;
- stbrp_rect *q = (stbrp_rect *) b;
+ const stbrp_rect *p = (const stbrp_rect *) a;
+ const stbrp_rect *q = (const stbrp_rect *) b;
if (p->w > q->w)
return -1;
if (p->w < q->w)
@@ -522,8 +533,8 @@ static int rect_width_compare(const void *a, const void *b)
static int rect_original_order(const void *a, const void *b)
{
- stbrp_rect *p = (stbrp_rect *) a;
- stbrp_rect *q = (stbrp_rect *) b;
+ const stbrp_rect *p = (const stbrp_rect *) a;
+ const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}