You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.4 KiB

  1. #ifdef LED_MATRIX_KEYREACTIVE_ENABLED
  2. # if defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS)
  3. # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS
  4. LED_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS)
  5. # endif
  6. # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS
  7. LED_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS)
  8. # endif
  9. # ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
  10. static uint8_t SOLID_REACTIVE_NEXUS_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
  11. uint16_t effect = tick - dist;
  12. if (effect > 255) effect = 255;
  13. if (dist > 72) effect = 255;
  14. if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255;
  15. return qadd8(val, 255 - effect);
  16. }
  17. # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS
  18. bool SOLID_REACTIVE_NEXUS(effect_params_t* params) {
  19. return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math);
  20. }
  21. # endif
  22. # ifdef ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS
  23. bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) {
  24. return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math);
  25. }
  26. # endif
  27. # endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
  28. # endif // defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || defined(ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS)
  29. #endif // LED_MATRIX_KEYREACTIVE_ENABLED