From 2c13513a956dd8e22f2c775100276777a5a6c5ce Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 21 Jan 2015 23:21:19 +0100 Subject: [PATCH] stb_truetype: fix for if stb_rect_pack .h wasn't included. --- stb_truetype.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stb_truetype.h b/stb_truetype.h index 60e9547..570b4b6 100644 --- a/stb_truetype.h +++ b/stb_truetype.h @@ -494,6 +494,9 @@ typedef struct typedef struct stbtt_pack_context stbtt_pack_context; typedef struct stbtt_fontinfo stbtt_fontinfo; +#ifndef STB_RECT_PACK_VERSION +typedef struct stbrp_rect stbrp_rect; +#endif extern int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); // Initializes a packing context stored in the passed-in stbtt_pack_context. @@ -2094,11 +2097,11 @@ typedef struct unsigned char x; } stbrp_node; -typedef struct +struct stbrp_rect { stbrp_coord x,y; int id,w,h,was_packed; -} stbrp_rect; +}; static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) {