LGatodu47 / ScreenshotViewer

Mod which adds a GUI to see your screenshots in game!
MIT License
12 stars 12 forks source link

[1.19.x] Fixed lag when opening screen and memory leak #1

Closed Ocelot5836 closed 2 years ago

Ocelot5836 commented 2 years ago

I found this mod on curse and thought it was really cool, so I decided to fix a couple issues I saw with it.

I changed the image loading to use a CompletableFuture on the background executor so the screen stops lagging. I also made the texture lazy so it only gets created when the image is rendered.

This makes it work much better with larger screenshot libraries. I like to take massive screenshots with Fabrishot, which meant the screenshots screen was painfully slow to load. Lmk if you have any issues with the changes I made.

LGatodu47 commented 2 years ago

Thanks for submitting your pull request! I was thinking about fixing the lag when opening the screen at one point but it looks like you did it pretty well! I'm not pretty good when dealing with concurrency so I'm merging your pull request into the main branch.