aboutsummaryrefslogtreecommitdiff
path: root/quantum/led_matrix/animations/solid_splash_anim.h
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/led_matrix/animations/solid_splash_anim.h')
-rw-r--r--quantum/led_matrix/animations/solid_splash_anim.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/quantum/led_matrix/animations/solid_splash_anim.h b/quantum/led_matrix/animations/solid_splash_anim.h
new file mode 100644
index 000000000..d95889b81
--- /dev/null
+++ b/quantum/led_matrix/animations/solid_splash_anim.h
@@ -0,0 +1,30 @@
1#ifdef LED_MATRIX_KEYREACTIVE_ENABLED
2# if !defined(DISABLE_LED_MATRIX_SOLID_SPLASH) || !defined(DISABLE_LED_MATRIX_SOLID_MULTISPLASH)
3
4# ifndef DISABLE_LED_MATRIX_SOLID_SPLASH
5LED_MATRIX_EFFECT(SOLID_SPLASH)
6# endif
7
8# ifndef DISABLE_LED_MATRIX_SOLID_MULTISPLASH
9LED_MATRIX_EFFECT(SOLID_MULTISPLASH)
10# endif
11
12# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
13
14uint8_t SOLID_SPLASH_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 return qadd8(val, 255 - effect);
18}
19
20# ifndef DISABLE_LED_MATRIX_SOLID_SPLASH
21bool SOLID_SPLASH(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); }
22# endif
23
24# ifndef DISABLE_LED_MATRIX_SOLID_MULTISPLASH
25bool SOLID_MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); }
26# endif
27
28# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
29# endif // !defined(DISABLE_LED_MATRIX_SPLASH) && !defined(DISABLE_LED_MATRIX_MULTISPLASH)
30#endif // LED_MATRIX_KEYREACTIVE_ENABLED