mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Fix numeric conversion warnings in example
(cherry picked from commit df15a33e10
)
This commit is contained in:
parent
163fa83fac
commit
45336c1104
@ -292,12 +292,12 @@ static void generate_heightmap__circle(float* center_x, float* center_y,
|
|||||||
{
|
{
|
||||||
float sign;
|
float sign;
|
||||||
/* random value for element in between [0-1.0] */
|
/* random value for element in between [0-1.0] */
|
||||||
*center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
*center_x = (MAP_SIZE * rand()) / (float) RAND_MAX;
|
||||||
*center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
*center_y = (MAP_SIZE * rand()) / (float) RAND_MAX;
|
||||||
*size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX);
|
*size = (MAX_CIRCLE_SIZE * rand()) / (float) RAND_MAX;
|
||||||
sign = (1.0f * rand()) / (1.0f * RAND_MAX);
|
sign = (1.0f * rand()) / (float) RAND_MAX;
|
||||||
sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f;
|
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
|
/* Run the specified number of iterations of the generation process for the
|
||||||
|
Loading…
Reference in New Issue
Block a user