mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Updated the Advance Flash Animation macro to be further simplified.
This commit is contained in:
parent
35b5e6a7ea
commit
6c51dff28b
1 changed files with 6 additions and 10 deletions
|
@ -10,17 +10,13 @@
|
|||
|
||||
#include <colors/colorPaths.h>
|
||||
|
||||
// Appears frequently in z_message flashing animations.
|
||||
// "temp" variable is included because it is generally reused between instances of this block.
|
||||
// This is mathematically equivalent but does not match.Macro was introduced because it
|
||||
// originally represented a 20 line block and was going to be used an additional 3 times.
|
||||
// Appears frequently in z_message flashing animations
|
||||
// This is mathematically equivalent but does not match
|
||||
#define advanceFlashAnimation(currentColor, targetColor, flashIndex, flashTimer) \
|
||||
currentColor.r += (currentColor.r >= targetColor[flashIndex].r ? -1 : 1) * \
|
||||
ABS(currentColor.r - targetColor[flashIndex].r) / flashTimer; \
|
||||
currentColor.g += (currentColor.g >= targetColor[flashIndex].g ? -1 : 1) * \
|
||||
ABS(currentColor.g - targetColor[flashIndex].g) / flashTimer; \
|
||||
currentColor.b += (currentColor.b >= targetColor[flashIndex].b ? -1 : 1) * \
|
||||
ABS(currentColor.b - targetColor[flashIndex].b) / flashTimer;
|
||||
currentColor.r += (targetColor[flashIndex].r - currentColor.r) / flashTimer; \
|
||||
currentColor.g += (targetColor[flashIndex].g - currentColor.g) / flashTimer; \
|
||||
currentColor.b += (targetColor[flashIndex].b - currentColor.b) / flashTimer;
|
||||
|
||||
|
||||
s16 sTextFade = false; // original name: key_off_flag ?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue