Fix billboard atlas animation playing order and frame count #5997
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.
Fixes #5881
It looks like we had the texture atlas selection inverted so it was playing from the "end" of the atlases animation.
I say "inverted" and "end" but these are slightly arbitrary because we define what they should be. However starting at the top-left is a reasonable convention and not an arbitrary point within the texture atlas, progressing to the top-left which is how it was behaving.
This is a handy test atlas with numbers in each slot so you can change
Sfx.ini
to point to it, and then instead of the explosion you can see the numbers counting up.test_atlas.zip
Taking the above test-atlas you could see it counting down from 30 to 0, which I think most people would find odd.
There was also an issue with it playing only 31 out of 32 frames of animation from the animation.
Finally I added the ability to press Ctrl+F8 if you're running a dev build with devkeys enables and it will spawn an explosion billboard right atop your ship. It's purely visual but very useful for testing, for example if someone wanted to replace the existing explosion etc, and could be extended to show other effects easily.
I've tested all of this quite a bit, sadly the texture supplied in the original bug by @Miner34dev isn't suitable for use as is because it fades to the black instead of alpha, and then terminates suddenly.