summaryrefslogtreecommitdiffhomepage
path: root/src/textures.c
diff options
context:
space:
mode:
authorRay <[email protected]>2021-05-30 22:31:14 +0200
committerRay <[email protected]>2021-05-30 22:31:14 +0200
commit89e734de6b720b54669464361e0c0ca1ef0f7369 (patch)
tree85111a64930012dc5860843346b0c6eafe20f883 /src/textures.c
parentcc4de1d1f9073dc75a4d79cdc2551b5e2e1b5215 (diff)
downloadraylib-89e734de6b720b54669464361e0c0ca1ef0f7369.tar.gz
raylib-89e734de6b720b54669464361e0c0ca1ef0f7369.zip
Review config flags #1784
Diffstat (limited to 'src/textures.c')
-rw-r--r--src/textures.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/textures.c b/src/textures.c
index f46b0c9a..dbad6220 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -67,6 +67,7 @@
#include <stdlib.h> // Required for: malloc(), free()
#include <string.h> // Required for: strlen() [Used in ImageTextEx()]
#include <math.h> // Required for: fabsf()
+#include <stdio.h> // Required for: sprintf() [Used in ExportImageAsCode()]
#include "utils.h" // Required for: fopen() Android mapping
@@ -122,7 +123,7 @@
// NOTE: Used to read image data (multiple formats support)
#endif
-#if (defined(SUPPORT_IMAGE_EXPORT) || defined(SUPPORT_COMPRESSION_API))
+#if defined(SUPPORT_IMAGE_EXPORT)
#define STBIW_MALLOC RL_MALLOC
#define STBIW_FREE RL_FREE
#define STBIW_REALLOC RL_REALLOC
@@ -459,6 +460,8 @@ bool ExportImageAsCode(Image image, const char *fileName)
{
bool success = false;
+#if defined(SUPPORT_IMAGE_EXPORT)
+
#ifndef TEXT_BYTES_PER_LINE
#define TEXT_BYTES_PER_LINE 20
#endif
@@ -500,6 +503,11 @@ bool ExportImageAsCode(Image image, const char *fileName)
success = SaveFileText(fileName, txtData);
RL_FREE(txtData);
+
+#endif // SUPPORT_IMAGE_EXPORT
+
+ if (success != 0) TRACELOG(LOG_INFO, "FILEIO: [%s] Image exported successfully", fileName);
+ else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to export image", fileName);
return success;
}