Skip to content

Commit 28e40d5

Browse files
#if reduced as possible (#5600)
1 parent 178aca0 commit 28e40d5

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

src/platforms/rcore_desktop_glfw.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,11 +1048,8 @@ Image GetClipboardImage(void)
10481048
{
10491049
Image image = { 0 };
10501050

1051-
#if SUPPORT_CLIPBOARD_IMAGE
1052-
#if SUPPORT_MODULE_RTEXTURES
1051+
#if SUPPORT_CLIPBOARD_IMAGE && SUPPORT_MODULE_RTEXTURES
10531052
#if defined(_WIN32)
1054-
1055-
#if SUPPORT_FILEFORMAT_BMP
10561053
unsigned long long int dataSize = 0;
10571054
void *bmpData = NULL;
10581055
int width = 0;
@@ -1062,15 +1059,11 @@ Image GetClipboardImage(void)
10621059

10631060
if (bmpData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data.");
10641061
else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize);
1065-
#else
1066-
TRACELOG(LOG_WARNING, "WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows");
1067-
#endif // SUPPORT_FILEFORMAT_BMP
10681062
#else
10691063
TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform");
10701064
#endif // defined(_WIN32)
1071-
#else // !SUPPORT_MODULE_RTEXTURES
1072-
TRACELOG(LOG_WARNING, "Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
1073-
#endif // SUPPORT_MODULE_RTEXTURES
1065+
#else
1066+
TRACELOG(LOG_WARNING, "Clipboard image: SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
10741067
#endif // SUPPORT_CLIPBOARD_IMAGE
10751068

10761069
return image;

src/platforms/rcore_desktop_rgfw.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,9 @@ const char *GetClipboardText(void)
10061006
Image GetClipboardImage(void)
10071007
{
10081008
Image image = { 0 };
1009-
#if SUPPORT_CLIPBOARD_IMAGE
1010-
#if SUPPORT_MODULE_RTEXTURES
1009+
#if SUPPORT_CLIPBOARD_IMAGE && SUPPORT_MODULE_RTEXTURES
10111010
#if defined(_WIN32)
10121011

1013-
#if SUPPORT_FILEFORMAT_BMP
10141012
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
10151013
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
10161014

@@ -1020,15 +1018,11 @@ Image GetClipboardImage(void)
10201018

10211019
if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data");
10221020
else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, dataSize);
1023-
#else
1024-
TRACELOG(LOG_WARNING, "WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows");
1025-
#endif // SUPPORT_FILEFORMAT_BMP
10261021
#else
10271022
TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement GetClipboardImage() for this OS");
10281023
#endif // defined(_WIN32)
1029-
#else // !SUPPORT_MODULE_RTEXTURES
1030-
TRACELOG(LOG_WARNING, "Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
1031-
#endif // SUPPORT_MODULE_RTEXTURES
1024+
#else
1025+
TRACELOG(LOG_WARNING, "Clipboard image: SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
10321026
#endif // SUPPORT_CLIPBOARD_IMAGE
10331027

10341028
return image;

src/platforms/rcore_desktop_sdl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,6 @@ Image GetClipboardImage(void)
11771177
// From what I've tested applications on Wayland saves images on clipboard as PNG
11781178
#if (!SUPPORT_FILEFORMAT_PNG || !SUPPORT_FILEFORMAT_JPG) && !defined(_WIN32)
11791179
TRACELOG(LOG_WARNING, "WARNING: Getting image from the clipboard might not work without SUPPORT_FILEFORMAT_PNG or SUPPORT_FILEFORMAT_JPG");
1180-
return image;
11811180
#endif
11821181
// Let's hope compiler put these arrays in static memory
11831182
const char *imageFormats[] = {

0 commit comments

Comments
 (0)