aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruser <email>2017-12-14 11:40:08 +0100
committeruser <email>2017-12-14 11:40:08 +0100
commit08fc886afd88907516dc7519ac7542fa30e5f369 (patch)
treee1ed8a717291e2c19b3d1e4379eab47e8824c61e /src
parent2388cbc3cd73ab228a4d60f05becd51035c703ea (diff)
downloadraylib-08fc886afd88907516dc7519ac7542fa30e5f369.tar.gz
raylib-08fc886afd88907516dc7519ac7542fa30e5f369.zip
added proper define checks for png-save if it's disabled
Diffstat (limited to 'src')
-rw-r--r--src/core.c2
-rw-r--r--src/textures.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index ec7db978..d4646268 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1134,7 +1134,7 @@ void SetConfigFlags(char flags)
// Takes a screenshot of current screen (saved a .png)
void TakeScreenshot(const char *fileName)
{
-#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
+#if (defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)) && defined(SUPPORT_SAVE_PNG)
unsigned char *imgData = rlReadScreenPixels(renderWidth, renderHeight);
SavePNG(fileName, imgData, renderWidth, renderHeight, 4); // Save image as PNG
free(imgData);
diff --git a/src/textures.c b/src/textures.c
index 6bd306f4..55749118 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -554,7 +554,7 @@ void UpdateTexture(Texture2D texture, const void *pixels)
// Save image to a PNG file
void SaveImageAs(const char* fileName, Image image)
{
-#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
+#if (defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)) && defined(SUPPORT_SAVE_PNG)
unsigned char* imgData = (unsigned char*)GetImageData(image); // this works since Color is just a container for the RGBA values
SavePNG(fileName, imgData, image.width, image.height, 4);
free(imgData);