Android fixes

This commit is contained in:
luboslenco
2025-08-20 17:30:32 +02:00
parent cd219186e7
commit 9c87ab842c
+2 -2
View File
@@ -1656,7 +1656,7 @@ void _write_image(char *path, buffer_t *bytes, i32 w, i32 h, i32 format, int ima
comp = 3;
pixels = (unsigned char *)malloc(w * h * comp);
for (int i = 0; i < w * h; ++i) {
#if defined(IRON_METAL) || defined(IRON_VULKAN)
#ifdef IRON_BGRA
pixels[i * 3 ] = rgba[i * 4 + 2];
pixels[i * 3 + 1] = rgba[i * 4 + 1];
pixels[i * 3 + 2] = rgba[i * 4 ];
@@ -1671,7 +1671,7 @@ void _write_image(char *path, buffer_t *bytes, i32 w, i32 h, i32 format, int ima
comp = 1;
pixels = (unsigned char *)malloc(w * h * comp);
int off = format - 3;
#if defined(IRON_METAL) || defined(IRON_VULKAN)
#ifdef IRON_BGRA
off = 2 - off;
#endif
for (int i = 0; i < w * h; ++i) {