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

CPU stuck in Entities and enums with big picture preview. #1007

Closed
hnhhzy opened this issue Nov 30, 2023 · 5 comments
Closed

CPU stuck in Entities and enums with big picture preview. #1007

hnhhzy opened this issue Nov 30, 2023 · 5 comments
Assignees
Milestone

Comments

@hnhhzy
Copy link
Contributor

hnhhzy commented Nov 30, 2023

If I use a single larger image, either as Entities or using the large cut Enums preview image, it causes cpu lag, causing editing Entities or dragging with Enums to become unusually stuck. Here's one of my failing projects
level1.zip

@hnhhzy
Copy link
Contributor Author

hnhhzy commented Nov 30, 2023

wrong in

JsTools.createEntityPreview
td.createTileHtmlImageFromRect(ed.tileRect);
var b64 = haxe.crypto.Base64.encode( subPixels.toPNG() ); //this line is very slow

i fix it
#1008

@hnhhzy
Copy link
Contributor Author

hnhhzy commented Nov 30, 2023

befor

befor.mp4

after

after.mp4

@deepnight
Copy link
Owner

deepnight commented Jan 15, 2024

I merged the PR, but please note that your demo project is using 1100x1100 images as UI icons in the Entity list, which is quite too much for an icon. To get much better perfs, you should probably use smaller icons in your UI lists.

@deepnight deepnight self-assigned this Jan 15, 2024
@deepnight deepnight added this to the 1.5.3 milestone Jan 15, 2024
@hnhhzy
Copy link
Contributor Author

hnhhzy commented Jan 15, 2024

After all, he's an entity, and I'm afraid he won't be able to maintain consistency with the final rendering of the map if other thumbnails are used

@deepnight
Copy link
Owner

I understand 🤔
Maybe there's a way for LDtk to cache smaller size versions of the images when used in UI context, to avoid allocating huge images for very small screen space.

I'll create an issue for a later update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants