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

Fix flickering shadows #320

Conversation

perkinslr
Copy link
Contributor

Changes

For ProjectileCEs which use Graphic_Collection, cache the shadow data and then pick one at random each time the shadow is requested

References

Fixes CombatExtendedRWMod/#1075

Reasoning

This gets simple use cases of Graphic_Flicker or other collections functioning enough (no errors, not obviously wrong).

Alternatives

The shadows are not synchronized with the projectiles. The correct solution would be to add state tracking so the shadow will be synchronized. This could probably be done with a custom random number generator that always gives the same number twice before choosing another randomly. Since the projectile should get drawn, followed by the shadow, this would synchronize them. But it might break other things that use Graphic_Flicker.

We could also subclass Graphic_Flicker, or suggest other mods use a graphic class which doesn't flicker for things which spin.

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • (For compatibility patches) ...with and without patched mod loaded
  • Playtested a colony (minutes)

@perkinslr perkinslr requested review from a team as code owners October 12, 2020 23:51
Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works.

@N7Huntsman N7Huntsman merged commit 822a8af into CombatExtended-Continued:Development Oct 13, 2020
@perkinslr perkinslr deleted the fix-flickering-shadows branch December 4, 2020 19:44
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.

2 participants