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
#define GIF_RECORD_FRAMERATE 10
#endif
gifFrameCounter += GetFrameTime()*1000;
gifFrameCounter += (unsigned int)(GetFrameTime()*1000);
// NOTE: We record one gif frame depending on the desired gif 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):
// - 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
glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)offset);
glVertexAttribPointer(index, compSize, type, normalized, stride, (void *)((size_t)offset));
#endif
}

View File

@ -5165,7 +5165,7 @@ static Model LoadGLTF(const char *fileName)
else TRACELOG(LOG_WARNING, "MODEL: [%s] Texcoords attribute data format not supported", fileName);
}
else TRACELOG(LOG_WARNING, "MODEL: [%s] Texcoords attribute data format not supported, use vec2 float", fileName);
int index = data->meshes[i].primitives[p].attributes[j].index;
if (index == 0) model.meshes[meshIndex].texcoords = texcoordPtr;
else if (index == 1) model.meshes[meshIndex].texcoords2 = texcoordPtr;
@ -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;
t = (t < 0.0f)? 0.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);
rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2f(posX, posY);
rlVertex2f(posX + width, posY + 1);
rlVertex2f((float)posX, (float)posY);
rlVertex2f((float)(posX + width), (float)(posY + 1));
rlVertex2f(posX + width, posY + 1);
rlVertex2f(posX + width, posY + height);
rlVertex2f((float)(posX + width), (float)(posY + 1));
rlVertex2f((float)(posX + width), (float)(posY + height));
rlVertex2f(posX + width, posY + height);
rlVertex2f(posX + 1, posY + height);
rlVertex2f((float)(posX + width), (float)(posY + height));
rlVertex2f((float)(posX + 1), (float)(posY + height));
rlVertex2f(posX + 1, posY + height);
rlVertex2f(posX + 1, posY + 1);
rlVertex2f((float)(posX + 1), (float)(posY + height));
rlVertex2f((float)(posX + 1), (float)(posY + 1));
rlEnd();
}

View File

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

View File

@ -311,15 +311,15 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
int dataSize = 0;
unsigned char *fileData = LoadFileData(fileName, &dataSize);
if (fileData != NULL)
if (fileData != NULL && dataSize > 0)
{
unsigned char *dataPtr = fileData;
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
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
memcpy(image.data, dataPtr, size); // Copy required data to image
@ -697,8 +697,8 @@ Image LoadImageFromScreen(void)
Vector2 scale = GetWindowScaleDPI();
Image image = { 0 };
image.width = GetScreenWidth()*scale.x;
image.height = GetScreenHeight()*scale.y;
image.width = (int)(GetScreenWidth()*scale.x);
image.height = (int)(GetScreenHeight()*scale.y);
image.mipmaps = 1;
image.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
image.data = rlReadScreenPixels(image.width, image.height);