aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix_animations/solid_reactive_nexus.h
diff options
context:
space:
mode:
authorskullY <skullydazed@gmail.com>2019-08-30 11:19:03 -0700
committerskullydazed <skullydazed@users.noreply.github.com>2019-08-30 15:01:52 -0700
commitb624f32f944acdc59dcb130674c09090c5c404cb (patch)
treebc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /quantum/rgb_matrix_animations/solid_reactive_nexus.h
parent61af76a10d00aba185b8338604171de490a13e3b (diff)
downloadqmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz
qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.zip
clang-format changes
Diffstat (limited to 'quantum/rgb_matrix_animations/solid_reactive_nexus.h')
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_nexus.h45
1 files changed, 19 insertions, 26 deletions
diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h
index e90eaf4b2..17f94e3c1 100644
--- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h
+++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h
@@ -1,41 +1,34 @@
1#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED 1#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
2#if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) 2# if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS)
3 3
4#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS 4# ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
5RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) 5RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS)
6#endif 6# endif
7 7
8#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS 8# ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
9RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) 9RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS)
10#endif 10# endif
11 11
12#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS 12# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
13 13
14static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { 14static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
15 uint16_t effect = tick - dist; 15 uint16_t effect = tick - dist;
16 if (effect > 255) 16 if (effect > 255) effect = 255;
17 effect = 255; 17 if (dist > 72) effect = 255;
18 if (dist > 72) 18 if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255;
19 effect = 255;
20 if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8))
21 effect = 255;
22 hsv.v = qadd8(hsv.v, 255 - effect); 19 hsv.v = qadd8(hsv.v, 255 - effect);
23 hsv.h = rgb_matrix_config.hsv.h + dy / 4; 20 hsv.h = rgb_matrix_config.hsv.h + dy / 4;
24 return hsv; 21 return hsv;
25} 22}
26 23
27#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS 24# ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
28bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { 25bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); }
29 return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); 26# endif
30}
31#endif
32 27
33#ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS 28# ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
34bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { 29bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); }
35 return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); 30# endif
36}
37#endif
38 31
39#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS 32# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
40#endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) 33# endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS)
41#endif // RGB_MATRIX_KEYREACTIVE_ENABLED 34#endif // RGB_MATRIX_KEYREACTIVE_ENABLED