mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-23 15:23:57 -04:00
Swaping #pragma message with TRACELOG inside the clipboard_image function (#5596)
Co-authored-by: Ray <raysan5@gmail.com>
This commit is contained in:
@ -1049,7 +1049,10 @@ Image GetClipboardImage(void)
|
|||||||
Image image = { 0 };
|
Image image = { 0 };
|
||||||
|
|
||||||
#if SUPPORT_CLIPBOARD_IMAGE
|
#if SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
#if SUPPORT_MODULE_RTEXTURES
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
|
#if SUPPORT_FILEFORMAT_BMP
|
||||||
unsigned long long int dataSize = 0;
|
unsigned long long int dataSize = 0;
|
||||||
void *bmpData = NULL;
|
void *bmpData = NULL;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
@ -1059,10 +1062,16 @@ Image GetClipboardImage(void)
|
|||||||
|
|
||||||
if (bmpData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data.");
|
if (bmpData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data.");
|
||||||
else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize);
|
else image = LoadImageFromMemory(".bmp", (const unsigned char *)bmpData, (int)dataSize);
|
||||||
|
#else
|
||||||
|
TRACELOG(LOG_WARNING, "WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows");
|
||||||
|
#endif // SUPPORT_FILEFORMAT_BMP
|
||||||
#else
|
#else
|
||||||
TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform");
|
TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform");
|
||||||
#endif
|
#endif // defined(_WIN32)
|
||||||
#endif
|
#else // !SUPPORT_MODULE_RTEXTURES
|
||||||
|
TRACELOG(LOG_WARNING, "Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
|
||||||
|
#endif // SUPPORT_MODULE_RTEXTURES
|
||||||
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1007,7 +1007,10 @@ Image GetClipboardImage(void)
|
|||||||
{
|
{
|
||||||
Image image = { 0 };
|
Image image = { 0 };
|
||||||
#if SUPPORT_CLIPBOARD_IMAGE
|
#if SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
#if SUPPORT_MODULE_RTEXTURES
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
||||||
|
#if SUPPORT_FILEFORMAT_BMP
|
||||||
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
|
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
|
||||||
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
|
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
|
||||||
|
|
||||||
@ -1017,9 +1020,15 @@ Image GetClipboardImage(void)
|
|||||||
|
|
||||||
if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data");
|
if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data");
|
||||||
else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, dataSize);
|
else image = LoadImageFromMemory(".bmp", (const unsigned char *)fileData, dataSize);
|
||||||
|
#else
|
||||||
|
TRACELOG(LOG_WARNING, "WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows");
|
||||||
|
#endif // SUPPORT_FILEFORMAT_BMP
|
||||||
#else
|
#else
|
||||||
TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement GetClipboardImage() for this OS");
|
TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement GetClipboardImage() for this OS");
|
||||||
#endif
|
#endif // defined(_WIN32)
|
||||||
|
#else // !SUPPORT_MODULE_RTEXTURES
|
||||||
|
TRACELOG(LOG_WARNING, "Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
|
||||||
|
#endif // SUPPORT_MODULE_RTEXTURES
|
||||||
#endif // SUPPORT_CLIPBOARD_IMAGE
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
|
|||||||
@ -1163,6 +1163,22 @@ Image GetClipboardImage(void)
|
|||||||
Image image = { 0 };
|
Image image = { 0 };
|
||||||
|
|
||||||
#if SUPPORT_CLIPBOARD_IMAGE
|
#if SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
#if !SUPPORT_MODULE_RTEXTURES
|
||||||
|
TRACELOG(LOG_WARNING, "Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly");
|
||||||
|
return image;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// It's nice to have support Bitmap on Linux as well, but not as necessary as Windows
|
||||||
|
#if !SUPPORT_FILEFORMAT_BMP && defined(_WIN32)
|
||||||
|
TRACELOG(LOG_WARNING, "WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows");
|
||||||
|
return image;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// From what I've tested applications on Wayland saves images on clipboard as PNG
|
||||||
|
#if (!SUPPORT_FILEFORMAT_PNG || !SUPPORT_FILEFORMAT_JPG) && !defined(_WIN32)
|
||||||
|
TRACELOG(LOG_WARNING, "WARNING: Getting image from the clipboard might not work without SUPPORT_FILEFORMAT_PNG or SUPPORT_FILEFORMAT_JPG");
|
||||||
|
return image;
|
||||||
|
#endif
|
||||||
// Let's hope compiler put these arrays in static memory
|
// Let's hope compiler put these arrays in static memory
|
||||||
const char *imageFormats[] = {
|
const char *imageFormats[] = {
|
||||||
"image/bmp",
|
"image/bmp",
|
||||||
@ -1197,7 +1213,7 @@ Image GetClipboardImage(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!IsImageValid(image)) TRACELOG(LOG_WARNING, "Clipboard: Couldn't get clipboard data. ERROR: %s", SDL_GetError());
|
if (!IsImageValid(image)) TRACELOG(LOG_WARNING, "Clipboard: Couldn't get clipboard data. ERROR: %s", SDL_GetError());
|
||||||
#endif
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2708,7 +2708,7 @@ RMAPI void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotatio
|
|||||||
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].x));
|
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].x));
|
||||||
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].y));
|
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].y));
|
||||||
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].z));
|
stabilizer = fmaxf(stabilizer, fabsf(matColumns[i].z));
|
||||||
};
|
}
|
||||||
matColumns[0] = Vector3Scale(matColumns[0], 1.0f / stabilizer);
|
matColumns[0] = Vector3Scale(matColumns[0], 1.0f / stabilizer);
|
||||||
matColumns[1] = Vector3Scale(matColumns[1], 1.0f / stabilizer);
|
matColumns[1] = Vector3Scale(matColumns[1], 1.0f / stabilizer);
|
||||||
matColumns[2] = Vector3Scale(matColumns[2], 1.0f / stabilizer);
|
matColumns[2] = Vector3Scale(matColumns[2], 1.0f / stabilizer);
|
||||||
|
|||||||
16
src/rcore.c
16
src/rcore.c
@ -529,22 +529,6 @@ const char *TextFormat(const char *text, ...); // Formatting of text with variab
|
|||||||
#define PLATFORM_DESKTOP_GLFW
|
#define PLATFORM_DESKTOP_GLFW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Using '#pragma message' because '#warning' is not adopted by MSVC
|
|
||||||
#if SUPPORT_CLIPBOARD_IMAGE
|
|
||||||
#if !SUPPORT_MODULE_RTEXTURES
|
|
||||||
#pragma message ("WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_MODULE_RTEXTURES to work properly")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// It's nice to have support Bitmap on Linux as well, but not as necessary as Windows
|
|
||||||
#if !SUPPORT_FILEFORMAT_BMP && defined(_WIN32)
|
|
||||||
#pragma message ("WARNING: Enabling SUPPORT_CLIPBOARD_IMAGE requires SUPPORT_FILEFORMAT_BMP, specially on Windows")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// From what I've tested applications on Wayland saves images on clipboard as PNG
|
|
||||||
#if (!SUPPORT_FILEFORMAT_PNG || !SUPPORT_FILEFORMAT_JPG) && !defined(_WIN32)
|
|
||||||
#pragma message ("WARNING: Getting image from the clipboard might not work without SUPPORT_FILEFORMAT_PNG or SUPPORT_FILEFORMAT_JPG")
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Include platform-specific submodules
|
// Include platform-specific submodules
|
||||||
#if defined(PLATFORM_DESKTOP_GLFW)
|
#if defined(PLATFORM_DESKTOP_GLFW)
|
||||||
|
|||||||
Reference in New Issue
Block a user