Fixed some warnings on Windows

This commit is contained in:
Vesper 2024-05-01 16:04:49 +01:00
parent 27a015d022
commit 8d743b61aa
6 changed files with 19 additions and 19 deletions

View File

@ -852,7 +852,7 @@ void EndDrawing(void)
#ifndef GIF_RECORD_FRAMERATE #ifndef GIF_RECORD_FRAMERATE
#define GIF_RECORD_FRAMERATE 10 #define GIF_RECORD_FRAMERATE 10
#endif #endif
gifFrameCounter += GetFrameTime()*1000; gifFrameCounter += (unsigned int)(GetFrameTime()*1000);
// NOTE: We record one gif frame depending on the desired gif framerate // NOTE: We record one gif frame depending on the desired gif framerate
if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE) if (gifFrameCounter > 1000/GIF_RECORD_FRAMERATE)

View File

@ -3945,7 +3945,7 @@ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool norma
// Additional types (depends on OpenGL version or extensions): // Additional types (depends on OpenGL version or extensions):
// - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED, // - GL_HALF_FLOAT, GL_FLOAT, GL_DOUBLE, GL_FIXED,
// - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV // - GL_INT_2_10_10_10_REV, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_10F_11F_11F_REV
glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset); glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)((size_t)offset));
#endif #endif
} }

View File

@ -5549,7 +5549,7 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
} }
} }
float duration = fmax((tend - tstart), EPSILON); float duration = fmaxf((tend - tstart), EPSILON);
float t = (time - tstart)/duration; float t = (time - tstart)/duration;
t = (t < 0.0f)? 0.0f : t; t = (t < 0.0f)? 0.0f : t;
t = (t > 1.0f)? 1.0f : t; t = (t > 1.0f)? 1.0f : t;

View File

@ -815,17 +815,17 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
{ {
rlBegin(RL_LINES); rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a); rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2f(posX, posY); rlVertex2f((float)posX, (float)posY);
rlVertex2f(posX + width, posY + 1); rlVertex2f((float)(posX + width), (float)(posY + 1));
rlVertex2f(posX + width, posY + 1); rlVertex2f((float)(posX + width), (float)(posY + 1));
rlVertex2f(posX + width, posY + height); rlVertex2f((float)(posX + width), (float)(posY + height));
rlVertex2f(posX + width, posY + height); rlVertex2f((float)(posX + width), (float)(posY + height));
rlVertex2f(posX + 1, posY + height); rlVertex2f((float)(posX + 1), (float)(posY + height));
rlVertex2f(posX + 1, posY + height); rlVertex2f((float)(posX + 1), (float)(posY + height));
rlVertex2f(posX + 1, posY + 1); rlVertex2f((float)(posX + 1), (float)(posY + 1));
rlEnd(); rlEnd();
} }

View File

@ -1166,7 +1166,7 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f
if (codepoint == '\n') if (codepoint == '\n')
{ {
// NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup // NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup
textOffsetY += (fontSize + textLineSpacing); textOffsetY += (int)(fontSize + textLineSpacing);
textOffsetX = 0.0f; textOffsetX = 0.0f;
} }
else else
@ -1237,7 +1237,7 @@ void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Ve
if (codepoints[i] == '\n') if (codepoints[i] == '\n')
{ {
// NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup // NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup
textOffsetY += (fontSize + textLineSpacing); textOffsetY += (int)(fontSize + textLineSpacing);
textOffsetX = 0.0f; textOffsetX = 0.0f;
} }
else else

View File

@ -311,15 +311,15 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
int dataSize = 0; int dataSize = 0;
unsigned char *fileData = LoadFileData(fileName, &dataSize); unsigned char *fileData = LoadFileData(fileName, &dataSize);
if (fileData != NULL) if (fileData != NULL && dataSize > 0)
{ {
unsigned char *dataPtr = fileData; unsigned char *dataPtr = fileData;
unsigned int size = GetPixelDataSize(width, height, format); unsigned int size = GetPixelDataSize(width, height, format);
if (size <= dataSize) // Security check if (size <= (unsigned int)dataSize) // Security check
{ {
// Offset file data to expected raw image by header size // Offset file data to expected raw image by header size
if ((headerSize > 0) && ((headerSize + size) <= dataSize)) dataPtr += headerSize; if ((headerSize > 0) && ((headerSize + size) <= (unsigned int)dataSize)) dataPtr += headerSize;
image.data = RL_MALLOC(size); // Allocate required memory in bytes image.data = RL_MALLOC(size); // Allocate required memory in bytes
memcpy(image.data, dataPtr, size); // Copy required data to image memcpy(image.data, dataPtr, size); // Copy required data to image
@ -697,8 +697,8 @@ Image LoadImageFromScreen(void)
Vector2 scale = GetWindowScaleDPI(); Vector2 scale = GetWindowScaleDPI();
Image image = { 0 }; Image image = { 0 };
image.width = GetScreenWidth()*scale.x; image.width = (int)(GetScreenWidth()*scale.x);
image.height = GetScreenHeight()*scale.y; image.height = (int)(GetScreenHeight()*scale.y);
image.mipmaps = 1; image.mipmaps = 1;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8; image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
image.data = rlReadScreenPixels(image.width, image.height); image.data = rlReadScreenPixels(image.width, image.height);