Fix automatic sprite rotation for non-linear overmap tiles #1762
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
SUMMARY: Bugfixes "Fixed automatic sprite rotation for non-linear overmap tiles"
Purpose of change
If overmap terrain is rotatable, and the tileset has no explicitly defined rotations for the corresponding tile which is also marked as rotatable, then the game would try to automatically rotate that single tile to match rotation of the omt. Except the rotation direction is wrong (screenshot of

ws_regional_dump
found in latest unpacked UDP version):This PR fixes this bug.
Describe the solution
Turns out
rotations
for omts are clockwise rotations, androtations
for tileset sprites are counterclockwise rotations. This PR adds proper conversion from omt rotation to sprite rotation.Describe alternatives you've considered
Rewriting the renderer.
Testing
Additional context
Re-packed UDP with the aforementioned
ws_regional_dump
for testing:UDP_REPACK.zip