add safeties for enum math across define boundaries

This commit is contained in:
AzaezelX 2023-04-26 22:27:35 -05:00
parent 1230d0d280
commit aa02e48c8d
20 changed files with 71 additions and 71 deletions

View file

@ -442,7 +442,7 @@ void GroundPlane::createGeometry( const Frustum& frustum )
U32 width = mCeil( ( max.x - min.x ) / mSquareSize );
if( width > MAX_WIDTH )
{
mSquareSize = mCeil( ( max.x - min.x ) / MAX_WIDTH );
mSquareSize = mCeil( ( max.x - min.x ) / (F32)MAX_WIDTH );
width = MAX_WIDTH;
}
else if( !width )
@ -451,7 +451,7 @@ void GroundPlane::createGeometry( const Frustum& frustum )
U32 height = mCeil( ( max.y - min.y ) / mSquareSize );
if( height > MAX_HEIGHT )
{
mSquareSize = mCeil( ( max.y - min.y ) / MAX_HEIGHT );
mSquareSize = mCeil( ( max.y - min.y ) / (F32)MAX_HEIGHT );
height = MAX_HEIGHT;
}
else if( !height )