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

Asynchronous loading of map previews in the map chooser dialog #2581

Closed
wants to merge 2 commits into from

Conversation

Carko
Copy link
Contributor

@Carko Carko commented Jan 13, 2013

Added async loading of map previews in the map chooses dialog based on the idea from Pull request 5.

The problem with it was that while the items were added asynchronously to the list, the actual map loading was done in the GUI thread since the map was first loaded and added to the cache in the Draw() override of the MapPreviewWidget.

I have added a method that forces loading the map preview into the cache and that can be called from another thread.

@chrisforbes
Copy link
Member

What happens if the filter is changed while the list is still populating?

@chrisforbes
Copy link
Member

(Otherwise looks good, just concerned about races.)

@Mailaender
Copy link
Member

Tested, works for all mods. Supersedes pull request #5.

@Carko
Copy link
Contributor Author

Carko commented Jan 13, 2013

Fixed the filter. (It didn't crash, however if you changed it, it loaded the maps the "old" way while the async one was still loading the maps in the other thread.)

@chrisforbes
Copy link
Member

Looks good to me.

@chrisforbes
Copy link
Member

Merged, thanks @Carko.

@ScottNZ
Copy link
Contributor

ScottNZ commented Jan 22, 2013

It seems to make the order of the maps all weird on subsequent openings of the map chooser.

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.

None yet

4 participants