diff options
Diffstat (limited to 'quantum/led_matrix/animations/solid_reactive_nexus.h')
-rw-r--r-- | quantum/led_matrix/animations/solid_reactive_nexus.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/quantum/led_matrix/animations/solid_reactive_nexus.h b/quantum/led_matrix/animations/solid_reactive_nexus.h new file mode 100644 index 000000000..504b1104f --- /dev/null +++ b/quantum/led_matrix/animations/solid_reactive_nexus.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifdef LED_MATRIX_KEYREACTIVE_ENABLED | ||
2 | # if !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
3 | |||
4 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS | ||
5 | LED_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) | ||
6 | # endif | ||
7 | |||
8 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
9 | LED_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) | ||
10 | # endif | ||
11 | |||
12 | # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
13 | |||
14 | static uint8_t SOLID_REACTIVE_NEXUS_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { | ||
15 | uint16_t effect = tick - dist; | ||
16 | if (effect > 255) effect = 255; | ||
17 | if (dist > 72) effect = 255; | ||
18 | if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255; | ||
19 | return qadd8(val, 255 - effect); | ||
20 | } | ||
21 | |||
22 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS | ||
23 | bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); } | ||
24 | # endif | ||
25 | |||
26 | # ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
27 | bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); } | ||
28 | # endif | ||
29 | |||
30 | # endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS | ||
31 | # endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
32 | #endif // LED_MATRIX_KEYREACTIVE_ENABLED | ||