mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
Clang: fix -Wimplicit-const-int-float-conversion
Some of these integers exceed the precision of float. In that case the number is rounded. The rounding shouldn't matter too much anyway, so just shut the compiler up.
This commit is contained in:
parent
210c9419e4
commit
35244fa736
2 changed files with 3 additions and 3 deletions
|
@ -5715,7 +5715,7 @@ static void HWR_DrawSkyBackground(player_t *player)
|
|||
|
||||
dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f);
|
||||
|
||||
v[0].s = v[3].s = (-1.0f * angle) / ((ANGLE_90-1)*dimensionmultiply); // left
|
||||
v[0].s = v[3].s = (-1.0f * angle) / (((float)ANGLE_90-1.0f)*dimensionmultiply); // left
|
||||
v[2].s = v[1].s = v[0].s + (1.0f/dimensionmultiply); // right (or left + 1.0f)
|
||||
// use +angle and -1.0f above instead if you wanted old backwards behavior
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ UINT8 M_RandomByte(void)
|
|||
*/
|
||||
INT32 M_RandomKey(INT32 a)
|
||||
{
|
||||
return (INT32)((rand()/((unsigned)RAND_MAX+1.0f))*a);
|
||||
return (INT32)((rand()/((float)RAND_MAX+1.0f))*a);
|
||||
}
|
||||
|
||||
/** Provides a random integer in a given range.
|
||||
|
@ -73,7 +73,7 @@ INT32 M_RandomKey(INT32 a)
|
|||
*/
|
||||
INT32 M_RandomRange(INT32 a, INT32 b)
|
||||
{
|
||||
return (INT32)((rand()/((unsigned)RAND_MAX+1.0f))*(b-a+1))+a;
|
||||
return (INT32)((rand()/((float)RAND_MAX+1.0f))*(b-a+1))+a;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue