mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 21:33:40 -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>
|
#include <colors/colorPaths.h>
|
||||||
|
|
||||||
// Appears frequently in z_message flashing animations.
|
// 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
|
||||||
// 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.
|
|
||||||
#define advanceFlashAnimation(currentColor, targetColor, flashIndex, flashTimer) \
|
#define advanceFlashAnimation(currentColor, targetColor, flashIndex, flashTimer) \
|
||||||
currentColor.r += (currentColor.r >= targetColor[flashIndex].r ? -1 : 1) * \
|
currentColor.r += (targetColor[flashIndex].r - currentColor.r) / flashTimer; \
|
||||||
ABS(currentColor.r - targetColor[flashIndex].r) / flashTimer; \
|
currentColor.g += (targetColor[flashIndex].g - currentColor.g) / flashTimer; \
|
||||||
currentColor.g += (currentColor.g >= targetColor[flashIndex].g ? -1 : 1) * \
|
currentColor.b += (targetColor[flashIndex].b - currentColor.b) / flashTimer;
|
||||||
ABS(currentColor.g - targetColor[flashIndex].g) / flashTimer; \
|
|
||||||
currentColor.b += (currentColor.b >= targetColor[flashIndex].b ? -1 : 1) * \
|
|
||||||
ABS(currentColor.b - targetColor[flashIndex].b) / flashTimer;
|
|
||||||
|
|
||||||
s16 sTextFade = false; // original name: key_off_flag ?
|
s16 sTextFade = false; // original name: key_off_flag ?
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue