summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2024-05-01 18:12:57 +0200
committerRay <[email protected]>2024-05-01 18:12:57 +0200
commit763129e96b0ae8a795f62d40d1b75736e4e6ae46 (patch)
treecdc837d00c8f660b720b1bf64a49f6c4e4f363c1
parent27a015d022ecdf771ea64b23f495a3b66101e170 (diff)
downloadraylib-763129e96b0ae8a795f62d40d1b75736e4e6ae46.tar.gz
raylib-763129e96b0ae8a795f62d40d1b75736e4e6ae46.zip
Reviewed some warnings
-rw-r--r--src/rmodels.c2
-rw-r--r--src/rshapes.c16
-rw-r--r--src/rtext.c4
-rw-r--r--src/rtextures.c6
4 files changed, 14 insertions, 14 deletions
diff --git a/src/rmodels.c b/src/rmodels.c
index 5efc3228..27c19a3c 100644
--- a/src/rmodels.c
+++ b/src/rmodels.c
@@ -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;
diff --git a/src/rshapes.c b/src/rshapes.c
index f13f4b01..80df64e2 100644
--- a/src/rshapes.c
+++ b/src/rshapes.c
@@ -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 + (float)width, (float)posY + 1);
- rlVertex2f(posX + width, posY + 1);
- rlVertex2f(posX + width, posY + height);
+ rlVertex2f((float)posX + (float)width, (float)posY + 1);
+ rlVertex2f((float)posX + (float)width, (float)posY + (float)height);
- rlVertex2f(posX + width, posY + height);
- rlVertex2f(posX + 1, posY + height);
+ rlVertex2f((float)posX + (float)width, (float)posY + (float)height);
+ rlVertex2f((float)posX + 1, (float)posY + (float)height);
- rlVertex2f(posX + 1, posY + height);
- rlVertex2f(posX + 1, posY + 1);
+ rlVertex2f((float)posX + 1, (float)posY + (float)height);
+ rlVertex2f((float)posX + 1, (float)posY + 1);
rlEnd();
}
diff --git a/src/rtext.c b/src/rtext.c
index 3544ff8d..b5ba17e3 100644
--- a/src/rtext.c
+++ b/src/rtext.c
@@ -1151,7 +1151,7 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f
int size = TextLength(text); // Total size in bytes of the text, scanned by codepoints in loop
- int textOffsetY = 0; // Offset between lines (on linebreak '\n')
+ float textOffsetY = 0; // Offset between lines (on linebreak '\n')
float textOffsetX = 0.0f; // Offset X to next character to draw
float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor
@@ -1225,7 +1225,7 @@ void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSiz
// Draw multiple character (codepoints)
void DrawTextCodepoints(Font font, const int *codepoints, int codepointCount, Vector2 position, float fontSize, float spacing, Color tint)
{
- int textOffsetY = 0; // Offset between lines (on linebreak '\n')
+ float textOffsetY = 0; // Offset between lines (on linebreak '\n')
float textOffsetX = 0.0f; // Offset X to next character to draw
float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor
diff --git a/src/rtextures.c b/src/rtextures.c
index 0658a680..47ff83f5 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -314,7 +314,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
if (fileData != NULL)
{
unsigned char *dataPtr = fileData;
- unsigned int size = GetPixelDataSize(width, height, format);
+ int size = GetPixelDataSize(width, height, format);
if (size <= dataSize) // Security check
{
@@ -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);