diff --git a/examples/heightmap.c b/examples/heightmap.c index 13a3c1e1..988dd0b8 100644 --- a/examples/heightmap.c +++ b/examples/heightmap.c @@ -292,12 +292,12 @@ static void generate_heightmap__circle(float* center_x, float* center_y, { float sign; /* random value for element in between [0-1.0] */ - *center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX); - sign = (1.0f * rand()) / (1.0f * RAND_MAX); + *center_x = (MAP_SIZE * rand()) / (float) RAND_MAX; + *center_y = (MAP_SIZE * rand()) / (float) RAND_MAX; + *size = (MAX_CIRCLE_SIZE * rand()) / (float) RAND_MAX; + sign = (1.0f * rand()) / (float) RAND_MAX; sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f; - *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX); + *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (float) RAND_MAX; } /* Run the specified number of iterations of the generation process for the