Skip to content

Conversation

@einarf
Copy link
Member

@einarf einarf commented Jan 23, 2024

Fixed various issues related to texture tracking in atlases.

@einarf
Copy link
Member Author

einarf commented Jan 23, 2024

Remaining:

  • Don't raise exception when removing a texture that is no longer in the atlas. This is too error prone.
  • Ensure atlas ref is injected into the texture when added every time

@einarf
Copy link
Member Author

einarf commented Jan 23, 2024

  • Might need an internal unique_texture counter as well so we don't remove one that has a duplicate
  • In addition we need to wrap the add() method so we don't increment the ref coutner multiple times when add() causes a resize or rebuild
  • The above point can also be solved by simplifying the clear() method. Splitting it into smaller private methods might be a good idea. The problem is that resize() calls clear with all param flags as false and it's unclear what that even do. We end up wiping texture list, but keep the image ref count.

einarf added 11 commits January 25, 2024 23:35
* Refactor texture coordinate handling into a new UVtexture class
* get_texture_id() now takes a Texture for simplicity
* Removed unnecessary methods and members
* Raise Exception instead of ValueError
* Update test
This fixes issues related to resizing and rebuilding
@einarf einarf merged commit 4d55462 into development Feb 10, 2024
@einarf einarf deleted the atlas-track-all-textures branch February 10, 2024 07:38
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