-
Notifications
You must be signed in to change notification settings - Fork 116
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
Feature: Thread sf::Image loading #179
Comments
My thought is that if we stuck with stb_image, Attract-Mode could do the image loading step itself, but at first just load the image dimensions (using stbi_info()) and otherwise set the image to blank. The image data could be loaded by a background thread.... it seems to me this sort of approach might reduce the noticable slowdown when loading images... I think getting the image dimensions is necessary at this point, attract-mode assumes it has them on after calling to load the image. |
Why does AM care about the size when loading a piece of media? I thought that the layout determined the displayed size, which is usually different than the actual media dimensions. |
Two reasons:
|
Related to Issue #96 |
See also #342 |
- Noticably reduces animation stutter when navigating games in the 'Attrac-Man' layout and others - Image decoding now occurs on a background thread - The deletion of videos has also been reworked and involves the background thread to minimize the main thread waiting for audio and video decode threads to shut down - Added LRU cache for uncompressed images. Size of cache can be configured by user Config->General->Image Cache Size. - Added fe.image_cache object for scripts to get info about the image cache and to add images to the cache (i.e. to allow preloading) - Attract-Mode now uses its own instance of stb_image.h. There has been a slight modification to it from the stock stb_image.h to avoid a linking clash with SFML's version when building a static build on window
There's really no way to speed it up (storage is only so fast), and on lower end machines it's probably the most noticeable slowdown in the program.
Thoughts?
head of gprof barf:
The text was updated successfully, but these errors were encountered: