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

Add support for tile flip flags #788

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Conversation

InnocentusLime
Copy link
Contributor

Synposis

Current macroquad_tiled implementation lookups the tileset for a tile by searching via this predicate

tile >= tileset.firstgid && tile < tileset.firstgid + tileset.tilecount

before then converting from GID to a tileset-local ID. This is not entirely correct, because the GID is also used to store tile flip flags (https://doc.mapeditor.org/en/stable/reference/global-tile-ids/#tile-flipping).

This causes the above check to fail and all flipped tiles get filtered off.

What has been done

  • When looking up the tileset the tile flip flags are masked off
  • Since exposing the raw tile id will be backwards-incompatible they are masked off when constructing the Tile struct
  • 3 new fields have been added to Tile

Notes

  • I HAVE NOT updated the rendering code, but can if requested
  • I have done small local testing and the fix seems to work for me

@not-fl3
Copy link
Owner

not-fl3 commented Sep 4, 2024

Thanks for PR!

@not-fl3 not-fl3 merged commit e21e5e7 into not-fl3:master Sep 4, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants