Skip to content

Commit 0f4ac45

Browse files
JeffM2501psxdev
authored andcommitted
fix float casting warnings (raysan5#4471)
1 parent ed80d2f commit 0f4ac45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rtextures.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,15 +828,15 @@ Image GenImageGradientLinear(int width, int height, int direction, Color start,
828828
float sinDir = sinf(radianDirection);
829829

830830
// Calculate how far the top-left pixel is along the gradient direction from the center of said gradient
831-
float startingPos = 0.5 - (cosDir*width/2) - (sinDir*height/2);
831+
float startingPos = 0.5f - (cosDir*width/2) - (sinDir*height/2);
832832
// With directions that lie in the first or third quadrant (i.e. from top-left to
833833
// bottom-right or vice-versa), pixel (0, 0) is the farthest point on the gradient
834834
// (i.e. the pixel which should become one of the gradient's ends color); while for
835835
// directions that lie in the second or fourth quadrant, that point is pixel (width, 0).
836836
float maxPosValue =
837837
((signbit(sinDir) != 0) == (signbit(cosDir) != 0))
838-
? fabs(startingPos)
839-
: fabs(startingPos+width*cosDir);
838+
? fabsf(startingPos)
839+
: fabsf(startingPos+width*cosDir);
840840
for (int i = 0; i < width; i++)
841841
{
842842
for (int j = 0; j < height; j++)

0 commit comments

Comments
 (0)