typified cata_tiles and sdl_tiles #78815
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
None
Purpose of change
Convert usage of untyped coordinates into typed ones. This time focusing on cata_tiles.h.
Describe the solution
Convert untyped operations into typed ones (typically tripoint_bub_ms) and create overloads with tripoint_abs_omt when needed. The abs_omt operations then call the bub_ms one after an unsavory type conversion, hoping people won't see how the sausage is made.
Describe alternatives you've considered
I initially considered retaining the untyped operations internally and have both the bub_ms and abs_omt operations call that one, but changed my mind and went for having the bub_ms ones as the canonical version.
Testing
Since the changed code affects presentation but shouldn't have any functional effect, the tests were limited to zooming the map and overmap, moving to another overmap tile and repeat the process. Nothing odd was noticed.
Additional context
sdl_tiles.cpp contains a lot of android specific code, which is "text" to my compiler environment, so I hope the automatic tests will catch any potential errors (I've tried to search for changed operations, but that doesn't catch things internal to the sdl_tiles file itself).
There are a lot of untyped points in the code. As far as I can tell those are in screen and pixel coordinate systems which don't have their own representation. I'm fairly sure some of the untyped points are actually in bub_ms (or abs_omt, in some cases) coordinates, but I've left anything uncertain untouched.