add no stbi build version
This commit is contained in:
parent
617e03f917
commit
7f4c109106
15
assets.d
15
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
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user