1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-03 11:17:56 +00:00

location.cpp now defines constants global_distance_limit and iteration_limit

This commit is contained in:
Zeno Rogue
2020-03-01 14:36:35 +01:00
parent c1c4cea31f
commit b0eb4e816b
5 changed files with 48 additions and 36 deletions

View File

@@ -288,6 +288,18 @@ struct cdata {
int bits;
};
/** Limit on the 'distance' value in heptagon. This value is signed (negative distances are used
in horocycle implementation. Distance is currently a short, and we need a bit of breathing room.
It would not be a technical problem to use a larger type, but 32000 is close to what fits in
the memory of a normal computer. Farlands appear close to this limit.
*/
constexpr int global_distance_limit = 32000;
/** This value is used in iterative algorithms to prevent infinite loops created by incorrect
data (e.g., circular dragon). It should be larger than global_distance_limit */
constexpr int iteration_limit = 10000000;
/** in bitruncated/irregular/Goldberg geometries, heptagons form the
* underlying regular tiling (not necessarily heptagonal); in pure
* geometries, they correspond 1-1 to tiles; in 'masterless' geometries