solid_splash_anim.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
  2. # if defined(ENABLE_RGB_MATRIX_SOLID_SPLASH) || defined(ENABLE_RGB_MATRIX_SOLID_MULTISPLASH)
  3. # ifdef ENABLE_RGB_MATRIX_SOLID_SPLASH
  4. RGB_MATRIX_EFFECT(SOLID_SPLASH)
  5. # endif
  6. # ifdef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
  7. RGB_MATRIX_EFFECT(SOLID_MULTISPLASH)
  8. # endif
  9. # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  10. HSV SOLID_SPLASH_math(HSV hsv, 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. hsv.v = qadd8(hsv.v, 255 - effect);
  14. return hsv;
  15. }
  16. # ifdef ENABLE_RGB_MATRIX_SOLID_SPLASH
  17. bool SOLID_SPLASH(effect_params_t* params) {
  18. return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math);
  19. }
  20. # endif
  21. # ifdef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
  22. bool SOLID_MULTISPLASH(effect_params_t* params) {
  23. return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math);
  24. }
  25. # endif
  26. # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  27. # endif // !defined(ENABLE_RGB_MATRIX_SPLASH) && !defined(ENABLE_RGB_MATRIX_MULTISPLASH)
  28. #endif // RGB_MATRIX_KEYREACTIVE_ENABLED