diff options
| author | Ray San <[email protected]> | 2017-12-20 12:36:47 +0100 |
|---|---|---|
| committer | Ray San <[email protected]> | 2017-12-20 12:36:47 +0100 |
| commit | 27c274bc3c5ca343de66a9f76e55c79696aed833 (patch) | |
| tree | 3ee65cc65c7bd0352b2e539750a29a16d23d1dd8 | |
| parent | e8bb53ed3520d2219cd7513b9c1fc20908dbf6f6 (diff) | |
| download | raylib-27c274bc3c5ca343de66a9f76e55c79696aed833.tar.gz raylib-27c274bc3c5ca343de66a9f76e55c79696aed833.zip | |
Corrected issue with SaveImageAs()
That function depends on SavePNG() and forces platform check on textures
module, that behaviour should be changed, platform definition should be
only required on core module...
| -rw-r--r-- | src/textures.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/textures.c b/src/textures.c index 01b8e4fc..9c41ae7d 100644 --- a/src/textures.c +++ b/src/textures.c @@ -34,7 +34,7 @@ * * LICENSE: zlib/libpng * -* Copyright (c) 2014-2017 Ramon Santamaria (@raysan5) +* Copyright (c) 2014-2018 Ramon Santamaria (@raysan5) * * This software is provided "as-is", without any express or implied warranty. In no event * will the authors be held liable for any damages arising from the use of this software. @@ -552,14 +552,16 @@ void UpdateTexture(Texture2D texture, const void *pixels) } // Save image to a PNG file -void SaveImageAs(const char* fileName, Image image) +void SaveImageAs(const char *fileName, Image image) { +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) // NOTE: Getting Color array as RGBA unsigned char values - unsigned char* imgData = (unsigned char*)GetImageData(image); + unsigned char *imgData = (unsigned char *)GetImageData(image); SavePNG(fileName, imgData, image.width, image.height, 4); free(imgData); TraceLog(LOG_INFO, "Image saved: %s", fileName); +#endif } // Convert image data to desired format |
