-
-
Notifications
You must be signed in to change notification settings - Fork 989
feat: Use a Free List Strategy on BatchItem indexes within SpriteBatch and return index from .add() #3650
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
Open
gnarhard
wants to merge
27
commits into
flame-engine:main
Choose a base branch
from
gnarhard:feat/manage_sprite_batch_items_by_id
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Use a Free List Strategy on BatchItem indexes within SpriteBatch and return index from .add() #3650
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3babca9
feat: Add optional id to BatchItem and methods for managing items by …
gnarhard c474ad1
refactor: Simplify logic for adding and replacing BatchItems
gnarhard 15942a5
feat: Add tests for new BatchItem ID management functionality
gnarhard ff42f75
docs: Add documentation about ID management in SpriteBatch section of…
gnarhard f7e5329
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard a1afe6d
perf: Remove redundant lookup
gnarhard b843c45
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard 1804a88
fix: Add suggested code change to get keys from _idToIndex map keys
gnarhard 5c2752c
fix: Add Free List Strategy for managing indices to prevent race cond…
gnarhard 0c4f4ff
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard 8996ede
perf: optimize getting transforms, sources, and colors list while avo…
gnarhard e964abc
refactor: Rip out id functionality and transform, source, and color l…
gnarhard 05d792b
feat: Add method to retrieve a BatchItem at a given index
gnarhard 33a09db
fix: Update SpriteBatch tests
gnarhard a06a16b
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard 025cd11
docs: Remove ID reference in docs
gnarhard 0b51063
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
spydon 312dda2
Fix formatting
spydon 0c7aace
perf: Move list creation inside if statement that uses those objects
gnarhard a577478
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
spydon 071e7b2
Merge branch 'feat/manage_sprite_batch_items_by_id' of https://github…
gnarhard a81322d
refactor: Don't create a new paint reference each render cycle, organ…
gnarhard 39ebfd4
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard 69ae8a4
feat: Use a Free List Strategy on BatchItem indexes within SpriteBatc…
gnarhard 0e0479d
Merge branch 'feat/manage_sprite_batch_items_by_id' of https://github…
gnarhard a9df9e3
perf: add color property to BatchItem to optimize color getting so we…
gnarhard e29e8b4
Merge branch 'main' into feat/manage_sprite_batch_items_by_id
gnarhard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @gnarhard, I took a quick look at the failing tests and I suspect it has something to do with the
flip
andsource
rects. Before your change,addTransform
was always creatingBatchItem
with the originalsource
.flip
was considered only while adding to_sources
list.I modified the
addTransform
method to createBatchItem
with defaultsource
and some of the tests started passing.I didn't get enough time to look further into this, but I hope this helps you to narrow down the root cause 🙂