-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Reload backgrounds and not just images #583
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
also clang-format
robin-carlier
force-pushed
the
reload_bg
branch
from
December 16, 2024 10:39
683a13c
to
b06a48d
Compare
vaxerski
reviewed
Dec 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would've been definitely simpler once @PaideiaDilemma makes the anim manager generic lole
vaxerski
approved these changes
Dec 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! Wiki mr needed
vaxerski
approved these changes
Dec 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the ability to reload backgrounds (and not just images). This was asked for in #290.
The code is mostly copypasta of the code for the image widget, with suitable modifications.
Since backgrounds are usually big, I also added an option to cross-fade between the old and the new background to avoid abrupt changes. The cross-fade can be customized with a float option
crossfade_time
for the widget. A negative value means no cross-fade.The "mixing texture" shader I had to add for this can probably be used to implement similar cross-fades for image widgets, but I didn’t do it.
All timers/reloading options are ignored for screenshot-type backgrounds (perhaps that can be improved, but I’m not sure on how to handle reloading if
reload_cmd
is not supplied and the background is a screenshot).I’m not a C++ dev nor a graphics programmer so pardon me if I did things the wrong way.