HaxeFlixel / HaxeFlixel/flixel
`sprite.dirty` always true on renderTile
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
The value of sprite.dirty is always initialized as true. This leads to calcFrame() being call in draw(), which redundantly calls checkEmptyFrame() and then does an early return:
The issue is that dirty is never set back to false on targets that use renderTile (so most cases), therefore each draw has redundant useless function calls.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in flixel/FlxSprite.hx at the linked lines around draw(), calcFrame(), and checkEmptyFrame(). Trace how sprite.dirty is initialized and handled for renderTile targets, then verify that repeated draws no longer perform the redundant calls while other rendering paths remain correct.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100