Makes math helpers defines for performance

This commit is contained in:
kevinz000
2018-12-06 13:13:59 -08:00
committed by VirgoBot
parent 4a27ffb35a
commit fc178c1e04
48 changed files with 1000 additions and 228 deletions

View File

@@ -19,10 +19,10 @@
/datum/random_map/noise/set_map_size()
// Make sure the grid is a square with limits that are
// (n^2)+1, otherwise diamond-square won't work.
if(!IsPowerOfTwo((limit_x-1)))
limit_x = RoundUpToPowerOfTwo(limit_x) + 1
if(!IsPowerOfTwo((limit_y-1)))
limit_y = RoundUpToPowerOfTwo(limit_y) + 1
if(!ISPOWEROFTWO((limit_x-1)))
limit_x = ROUNDUPTOPOWEROFTWO(limit_x) + 1
if(!ISPOWEROFTWO((limit_y-1)))
limit_y = ROUNDUPTOPOWEROFTWO(limit_y) + 1
// Sides must be identical lengths.
if(limit_x > limit_y)
limit_y = limit_x