diff options
| author | Ray <[email protected]> | 2022-11-29 10:58:27 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-11-29 10:58:27 +0100 |
| commit | d241ee85166e720cc0d3bc777ea940e25e1f1d3c (patch) | |
| tree | 366a33580c014c3448d023a8bb16b1d21f2104f2 /src | |
| parent | 2edf5a958484f8dc8fb6d3be14606852b696e379 (diff) | |
| download | raylib-d241ee85166e720cc0d3bc777ea940e25e1f1d3c.tar.gz raylib-d241ee85166e720cc0d3bc777ea940e25e1f1d3c.zip | |
ADDED: Optional support for PNM images (.ppm, .pgm)
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.h | 1 | ||||
| -rw-r--r-- | src/rtextures.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/config.h b/src/config.h index a7ec2523..82224e3a 100644 --- a/src/config.h +++ b/src/config.h @@ -148,6 +148,7 @@ //#define SUPPORT_FILEFORMAT_PSD 1 #define SUPPORT_FILEFORMAT_DDS 1 #define SUPPORT_FILEFORMAT_HDR 1 +//#define SUPPORT_FILEFORMAT_PNM 1 //#define SUPPORT_FILEFORMAT_KTX 1 //#define SUPPORT_FILEFORMAT_ASTC 1 //#define SUPPORT_FILEFORMAT_PKM 1 diff --git a/src/rtextures.c b/src/rtextures.c index 6b8af71d..19dd5f62 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -16,6 +16,7 @@ * #define SUPPORT_FILEFORMAT_PSD * #define SUPPORT_FILEFORMAT_PIC * #define SUPPORT_FILEFORMAT_HDR +* #define SUPPORT_FILEFORMAT_PNM * #define SUPPORT_FILEFORMAT_DDS * #define SUPPORT_FILEFORMAT_PKM * #define SUPPORT_FILEFORMAT_KTX @@ -103,6 +104,9 @@ #if !defined(SUPPORT_FILEFORMAT_HDR) #define STBI_NO_HDR #endif +#if !defined(SUPPORT_FILEFORMAT_PNM) + #define STBI_NO_PNM +#endif #if defined(SUPPORT_FILEFORMAT_DDS) #define RL_GPUTEX_SUPPORT_DDS @@ -135,7 +139,8 @@ defined(SUPPORT_FILEFORMAT_PSD) || \ defined(SUPPORT_FILEFORMAT_GIF) || \ defined(SUPPORT_FILEFORMAT_PIC) || \ - defined(SUPPORT_FILEFORMAT_HDR)) + defined(SUPPORT_FILEFORMAT_HDR) || \ + defined(SUPPORT_FILEFORMAT_PNM)) #define STBI_MALLOC RL_MALLOC #define STBI_FREE RL_FREE @@ -234,6 +239,7 @@ Image LoadImage(const char *fileName) defined(SUPPORT_FILEFORMAT_GIF) || \ defined(SUPPORT_FILEFORMAT_PIC) || \ defined(SUPPORT_FILEFORMAT_HDR) || \ + defined(SUPPORT_FILEFORMAT_PNM) || \ defined(SUPPORT_FILEFORMAT_PSD) #define STBI_REQUIRED @@ -344,6 +350,9 @@ Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, i #if defined(SUPPORT_FILEFORMAT_PIC) || (strcmp(fileType, ".pic") == 0) #endif +#if defined(SUPPORT_FILEFORMAT_PNM) + || ((strcmp(fileType, ".ppm") == 0) || (strcmp(fileType, ".pgm") == 0)) +#endif #if defined(SUPPORT_FILEFORMAT_PSD) || (strcmp(fileType, ".psd") == 0) #endif |
