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

Fix TextureAtlas issues #1949

Merged
merged 27 commits into from
Jan 14, 2024
Merged

Fix TextureAtlas issues #1949

merged 27 commits into from
Jan 14, 2024

Conversation

einarf
Copy link
Member

@einarf einarf commented Jan 14, 2024

The current TextureAtlas is weakly referecing textures supporting python garbage collection. The plan was to completely remove this due to the complexity it adds. I think we've maanged to figure out the remaining issues.

Fixes:

  • Textures are now stored using the Texture.atlas_name meaning we only store textures with different hash-orientation combo. It doesn't care what hitbox algo the texture has. This mean the number of textures in the atlas are always the same as the uv data simplifying things.
  • Resizing the atlas should no longer clear the image counter
  • Rebuilding the atlas should now clear the image counter
  • The atlas will now smartly rebuild itself if images have been removed before attempting to resize
  • Added an initial ABC class for atlases
  • Added sanity check in image ref counter raising error on underflow
  • Fixed the experimenal atlas load/save code
  • Added various comments to make it easier to inspect the code later

@einarf einarf merged commit 630a4f4 into development Jan 14, 2024
7 of 8 checks passed
@einarf einarf deleted the atlas-rabbit-hole branch January 14, 2024 11:36
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.

1 participant