summaryrefslogtreecommitdiffhomepage
path: root/src/utils.c
diff options
context:
space:
mode:
authorDavid Reid <[email protected]>2018-05-21 20:26:28 +1000
committerDavid Reid <[email protected]>2018-05-21 20:26:28 +1000
commit6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7 (patch)
tree95d9092e666ef409dd4cb75a5f836e37acabfdf9 /src/utils.c
parent3ca5047c8285318c2385c6b52b2e2b5f12905f0d (diff)
parente025e62445913bf1ec9cf075eaaf1dc7374da83c (diff)
downloadraylib-6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7.tar.gz
raylib-6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7.zip
Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/utils.c b/src/utils.c
index 9d9d8b55..74780680 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -57,6 +57,12 @@
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end()
#include <string.h> // Required for: strlen(), strrchr(), strcmp()
+/* This should be in <stdio.h>, but Travis doesn't find it... */
+FILE *funopen(const void *cookie, int (*readfn)(void *, char *, int),
+ int (*writefn)(void *, const char *, int),
+ fpos_t (*seekfn)(void *, fpos_t, int), int (*closefn)(void *));
+
+
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "external/stb_image_write.h" // Required for: stbi_write_bmp(), stbi_write_png()
@@ -137,31 +143,27 @@ void TraceLog(int msgType, const char *text, ...)
va_end(args);
if (msgType == LOG_ERROR) exit(1); // If LOG_ERROR message, exit program
-
+
#endif // SUPPORT_TRACELOG
}
-#if defined(SUPPORT_SAVE_BMP)
// Creates a BMP image file from an array of pixel data
void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize)
{
-#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
+#if defined(SUPPORT_SAVE_BMP) && (defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI))
stbi_write_bmp(fileName, width, height, compSize, imgData);
TraceLog(LOG_INFO, "BMP Image saved: %s", fileName);
#endif
}
-#endif
-#if defined(SUPPORT_SAVE_PNG)
// Creates a PNG image file from an array of pixel data
void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize)
{
-#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
+#if defined(SUPPORT_SAVE_PNG) && (defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI))
stbi_write_png(fileName, width, height, compSize, imgData, width*compSize);
TraceLog(LOG_INFO, "PNG Image saved: %s", fileName);
#endif
}
-#endif
// Keep track of memory allocated
// NOTE: mallocType defines the type of data allocated