Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typified cata_tiles and sdl_tiles #78815

Merged
merged 2 commits into from
Jan 5, 2025
Merged

Conversation

PatrikLundell
Copy link
Contributor

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.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Dec 28, 2024
@mqrause
Copy link
Contributor

mqrause commented Dec 28, 2024

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).

Unfortunately we still don't have android CI, so the earliest we'd notice something went wrong is when the release build fails.

@PatrikLundell
Copy link
Contributor Author

I was afraid that might be the case, which is one reason I made sure to indicate it. Is there someone who's capable of building android executables and who's willing to test this?

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 28, 2024
@Maleclypse Maleclypse merged commit 9ece845 into CleverRaven:master Jan 5, 2025
26 checks passed
@PatrikLundell PatrikLundell deleted the typify branch January 5, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants