Phase out direct references to alltemperate and single_pole outside mapgen
Note: The MAP_MAX_ABS_LATITUDE and MAP_MIN_ABS_LATITUDE macros introduced in this patch aren't used yet, but will be in #44167.
This is not an opinion to either direction, but something that you may want to consider: Should the macros support maps other than main wld.map, i.e., to take the map as parameter? Though for the map properties these macros are interested about are very unlikely to ever differ between active maps (-> values from wld.map are fine for any other map as well)
Reply To cazfi
Should the macros support maps other than main wld.map, i.e., to take the map as parameter?
I thought about that too, and I'm a bit torn – on the one hand, it likely won't be necessary for a long time (maybe ever) and might make relevant code less readable with additional (wld.map)s left and right; on the other hand, it would be more versatile and future-proof, and it might help clearly separate global constants from things depending on an individual map. I think I'll check how it affects code readability, and if that's fine, I'll do it. After all, explicit is better than implicit.
Reply To alienvalkyrie
Reply To cazfi
Should the macros support maps other than main wld.map, i.e., to take the map as parameter?
I think I'll check how it affects code readability, and if that's fine, I'll do it.
While it doesn't make the ever-constant struggle with line lengths and code layout easier (particularly in some parts of the stuff for #44167), it's not too bad, so there's really no reason not to do it.
Also, this new patch adds one more macro that'll be useful for #44167, so that all changes for that ticket will be contained to mapgen.
Reply To alienvalkyrie
While it doesn't make the ever-constant struggle with line lengths and code layout easier (particularly in some parts of the stuff for #44167), it's not too bad, so there's really no reason not to do it.
We'll see how long it takes until another round of refactoring introduces this:
#define WLD_NORTH_LATITUDE MAP_NORTH_LATITUDE(wld.map)
Reply To cazfi
We'll see how long it takes until another round of refactoring introduces this:
#define WLD_NORTH_LATITUDE MAP_NORTH_LATITUDE(wld.map)
I mean, yeah, might be sensible to do that in general – make all the stuff in map.[ch] take a map parameter, and declare WLD_ versions for all of it; it'd certainly be clearer than the current mish-mash situation. But that'd be a large undertaking best left for when we have more use for it, or have a couple days with nothing else to do (or switch to a programming language that makes it easier... fat chance).
Required for #44038. Introduce macros for northern- and southernmost latitude in map.h, as well as potentially other helper macros, and use those where applicable.
This ticket is only for common code; since making those changes in mapgen is more involved, that will happen separately in #44167