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

Better bitmap keying for FlxText #3081

Open
Geokureli opened this issue Mar 13, 2024 · 6 comments
Open

Better bitmap keying for FlxText #3081

Geokureli opened this issue Mar 13, 2024 · 6 comments

Comments

@Geokureli
Copy link
Member

source: https://github.com/HaxeFlixel/flixel/blob/dev/flixel/text/FlxText.hx#L893
FlxText bitmaps are keyed by their text, this seems like it would generate a lot of bitmaps unnecessarily. ideally we would generate a new bitmap if the dimensions of a textfield change, without having different fields of the same size use the same bitmap. maybe we can use ID, or get some kinda mem address?

@moxie-coder
Copy link
Contributor

is this to address this old issue? HaxeFlixel/flixel-addons#393

@Geokureli
Copy link
Member Author

HaxeFlixel/flixel-addons#393

no that seems unrelated

@superpowers04
Copy link

superpowers04 commented Mar 17, 2024

On an semi-related note, the current method also causes a memory leak whenever you try to edit a FlxText. I believe it's somehow not disposing of graphics or something. I tried just using the existing key and the memory leak went away however all of the FlxText's broke for obvious reasons

@Geokureli
Copy link
Member Author

On an semi-related note, the current method also causes a memory leak whenever you try to edit a FlxText. I believe it's somehow not disposing of graphics or something. I tried just using the existing key and the memory leak went away however all of the FlxText's broke for obvious reasons

Do you have a decent way to reproduce this memory leak?

@superpowers04
Copy link

On an semi-related note, the current method also causes a memory leak whenever you try to edit a FlxText. I believe it's somehow not disposing of graphics or something. I tried just using the existing key and the memory leak went away however all of the FlxText's broke for obvious reasons

Do you have a decent way to reproduce this memory leak?

In my experience, it happens whenever I change the text field of an FlxText. I don't really have the time to make a reproducible test because it takes an absurd amount of time for a new Flixel project to compile

@Geokureli
Copy link
Member Author

In my experience, it happens whenever I change the text field of an FlxText.

how are you measuring memory?

I don't really have the time to make a reproducible test because it takes an absurd amount of time for a new Flixel project to compile

it compiles immensely faster if you target something other than native desktop, I typically use HTML5 for testing, many use HL which is lightning fast

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

No branches or pull requests

3 participants