diff --git a/assets.d b/assets.d index ab88585..c772bdb 100644 --- a/assets.d +++ b/assets.d @@ -194,7 +194,14 @@ LoadImage(void* data, i32 size) ImageData image; i32 w, h, has_ch; - u8* image_bytes = stbi_load_from_memory(cast(const(u8)*)data, size, &w, &h, &has_ch, 4); + version(NO_STBI) + { + u8* image_bytes; + } + else + { + u8* image_bytes = stbi_load_from_memory(cast(const(u8)*)data, size, &w, &h, &has_ch, 4); + } if(w <= 0 || h <= 0 || has_ch <= 0) { Logf("Failed to load image data"); @@ -213,7 +220,11 @@ LoadImage(void* data, i32 size) void UnloadImage(ImageData* image) { - stbi_image_free(image.data.ptr); + version(NO_STBI) {} + else + { + stbi_image_free(image.data.ptr); + } } ImageData diff --git a/dlibincludes.c b/dlibincludes.c index 76e64d1..4903881 100644 --- a/dlibincludes.c +++ b/dlibincludes.c @@ -17,9 +17,10 @@ # include FT_GLYPH_H #endif -#include "external/stb/stb_image.h" - -#include "external/stb/stb_image_write.h" +#ifdef NO_STBI +# include "external/stb/stb_image.h" +# include "external/stb/stb_image_write.h" +#endif #define CGLM_FORCE_DEPTH_ZERO_TO_ONE #include "external/cglm/cglm.h"