Speed up asteroid generation a bunch (#2872)

Shaves 10-20 seconds off of asteroid generation time, bringing it down to 20 seconds, as well as renames some macros so their function is more clear.
This commit is contained in:
Lohikar
2017-06-30 05:11:11 -05:00
committed by skull132
parent 27251ee9ee
commit c486724efa
5 changed files with 119 additions and 158 deletions
+6 -4
View File
@@ -21,9 +21,11 @@
#define ARTIFACT_TURF_CHAR 6
#define ARTIFACT_CHAR 7
#define GET_MAP_CELL(X,Y) ((((Y) - 1) * limit_x) + (X))
#define PREPARE_CELL(X,Y) \
tmp_cell = GET_MAP_CELL(X,Y);\
if (tmp_cell < 1 || tmp_cell > map.len) {\
#define TRANSLATE_COORD(X,Y) ((((Y) - 1) * limit_x) + (X))
#define TRANSLATE_AND_VERIFY_COORD(X,Y) TRANSLATE_AND_VERIFY_COORD_MLEN(X,Y,map.len)
#define TRANSLATE_AND_VERIFY_COORD_MLEN(X,Y,LEN) \
tmp_cell = TRANSLATE_COORD(X,Y);\
if (tmp_cell < 1 || tmp_cell > LEN) {\
tmp_cell = null;\
}