diff options
| author | XScorpion2 <rcalt2vt@gmail.com> | 2019-05-07 18:22:46 -0500 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-05-07 16:22:46 -0700 |
| commit | af89752bffbaf5dcea30ea16be66b4d682701bc4 (patch) | |
| tree | c82f2bc25409159a44778379db8b3a35afc47b8a /quantum/rgb_matrix_animations/solid_reactive_nexus.h | |
| parent | c7f8548d9af2045996294602d2a4bd9a214ae23c (diff) | |
| download | qmk_firmware-af89752bffbaf5dcea30ea16be66b4d682701bc4.tar.gz qmk_firmware-af89752bffbaf5dcea30ea16be66b4d682701bc4.zip | |
rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783)
* Initial conversion of the rgb_led struct
* Converting last keyboard & updating effects to take advantage of the new structure
* New struct should not be const
* Updated docs
* Changing define ___ for no led to NO_LED
* Missed converting some keymap usages of the old struct layout
Diffstat (limited to 'quantum/rgb_matrix_animations/solid_reactive_nexus.h')
| -rw-r--r-- | quantum/rgb_matrix_animations/solid_reactive_nexus.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8952a1e2b..c0e3c2450 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
| 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) |
| 4 | 4 | ||
| 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern led_config_t g_led_config; |
| 6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
| 7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
| 8 | 8 | ||
| @@ -13,11 +13,10 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par | |||
| 13 | uint8_t count = g_last_hit_tracker.count; | 13 | uint8_t count = g_last_hit_tracker.count; |
| 14 | for (uint8_t i = led_min; i < led_max; i++) { | 14 | for (uint8_t i = led_min; i < led_max; i++) { |
| 15 | hsv.v = 0; | 15 | hsv.v = 0; |
| 16 | point_t point = g_rgb_leds[i].point; | ||
| 17 | for (uint8_t j = start; j < count; j++) { | 16 | for (uint8_t j = start; j < count; j++) { |
| 18 | RGB_MATRIX_TEST_LED_FLAGS(); | 17 | RGB_MATRIX_TEST_LED_FLAGS(); |
| 19 | int16_t dx = point.x - g_last_hit_tracker.x[j]; | 18 | int16_t dx = g_led_config.point[i].x - g_last_hit_tracker.x[j]; |
| 20 | int16_t dy = point.y - g_last_hit_tracker.y[j]; | 19 | int16_t dy = g_led_config.point[i].y - g_last_hit_tracker.y[j]; |
| 21 | uint8_t dist = sqrt16(dx * dx + dy * dy); | 20 | uint8_t dist = sqrt16(dx * dx + dy * dy); |
| 22 | int16_t dist2 = 8; | 21 | int16_t dist2 = 8; |
| 23 | uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; | 22 | uint16_t effect = scale16by8(g_last_hit_tracker.tick[j], rgb_matrix_config.speed) - dist; |
