add no stbi build version
This commit is contained in:
parent
617e03f917
commit
7f4c109106
11
assets.d
11
assets.d
@ -194,7 +194,14 @@ LoadImage(void* data, i32 size)
|
|||||||
ImageData image;
|
ImageData image;
|
||||||
|
|
||||||
i32 w, h, has_ch;
|
i32 w, h, has_ch;
|
||||||
|
version(NO_STBI)
|
||||||
|
{
|
||||||
|
u8* image_bytes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
u8* image_bytes = stbi_load_from_memory(cast(const(u8)*)data, size, &w, &h, &has_ch, 4);
|
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)
|
if(w <= 0 || h <= 0 || has_ch <= 0)
|
||||||
{
|
{
|
||||||
Logf("Failed to load image data");
|
Logf("Failed to load image data");
|
||||||
@ -213,7 +220,11 @@ LoadImage(void* data, i32 size)
|
|||||||
void
|
void
|
||||||
UnloadImage(ImageData* image)
|
UnloadImage(ImageData* image)
|
||||||
{
|
{
|
||||||
|
version(NO_STBI) {}
|
||||||
|
else
|
||||||
|
{
|
||||||
stbi_image_free(image.data.ptr);
|
stbi_image_free(image.data.ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageData
|
ImageData
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
# include FT_GLYPH_H
|
# include FT_GLYPH_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "external/stb/stb_image.h"
|
#ifdef NO_STBI
|
||||||
|
# include "external/stb/stb_image.h"
|
||||||
#include "external/stb/stb_image_write.h"
|
# include "external/stb/stb_image_write.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CGLM_FORCE_DEPTH_ZERO_TO_ONE
|
#define CGLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||||
#include "external/cglm/cglm.h"
|
#include "external/cglm/cglm.h"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user