mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Makes math helpers defines for performance
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user