summaryrefslogtreecommitdiffhomepage
path: root/src/textures.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-03-17 13:40:07 +0100
committerraysan5 <[email protected]>2020-03-17 13:40:07 +0100
commit23449419744e463fea32c597ac967f064b14422c (patch)
tree4c0061802983768ba11e818daa217c18c1cad5a3 /src/textures.c
parent6f41b9594a3f107ad7332af197cdd3565b7d33fe (diff)
downloadraylib-23449419744e463fea32c597ac967f064b14422c.tar.gz
raylib-23449419744e463fea32c597ac967f064b14422c.zip
Replace external libraries custom allocators by raylib ones #1074
NOTE: Two libraries still use custom allocators: glfw and stb_vorbis
Diffstat (limited to 'src/textures.c')
-rw-r--r--src/textures.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/textures.c b/src/textures.c
index 9122e3b0..9e229b8c 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -124,14 +124,20 @@
#endif
#if defined(SUPPORT_IMAGE_EXPORT)
+ #define STBIW_MALLOC RL_MALLOC
+ #define STBIW_FREE RL_FREE
+ #define STBIW_REALLOC RL_REALLOC
+
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "external/stb_image_write.h" // Required for: stbi_write_*()
#endif
#if defined(SUPPORT_IMAGE_MANIPULATION)
+ #define STBIR_MALLOC(size,c) ((void)(c), RL_MALLOC(size))
+ #define STBIR_FREE(ptr,c) ((void)(c), RL_FREE(ptr))
+
#define STB_IMAGE_RESIZE_IMPLEMENTATION
- #include "external/stb_image_resize.h" // Required for: stbir_resize_uint8()
- // NOTE: Used for image scaling on ImageResize()
+ #include "external/stb_image_resize.h" // Required for: stbir_resize_uint8() [ImageResize()]
#endif
#if defined(SUPPORT_IMAGE_GENERATION)