summaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix_animations/digital_rain_anim.h
diff options
context:
space:
mode:
authorJames Young <18669334+noroadsleft@users.noreply.github.com>2020-05-30 13:14:59 -0700
committerGitHub <noreply@github.com>2020-05-30 13:14:59 -0700
commitfced377ac007d27f2650ccffbe0b18abcdcfe23d (patch)
treebd5b141987394a5a16cfc416bfe2b9efdb14d067 /quantum/rgb_matrix_animations/digital_rain_anim.h
parent7b8a013826ad90714a05ea522de53adf964ab3b9 (diff)
2020 May 30 Breaking Changes Update (#9215)
* Branch point for 2020 May 30 Breaking Change * Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954) * Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957) * Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958) * Migrate `ACTION_LAYER_MODS` to `LM()` (#8959) * Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968) * Convert V-USB usbdrv to a submodule (#8321) * Unify Tap Hold functions and documentation (#8348) * Changing board names to prevent confusion (#8412) * Move the Keyboardio Model01 to a keyboardio/ subdir (#8499) * Move spaceman keyboards (#8830) * Migrate miscellaneous `fn_actions` entries (#8977) * Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979) * Organizing my keyboards (plaid, tartan, ergoinu) (#8537) * Refactor Lily58 to use split_common (#6260) * Refactor zinc to use split_common (#7114) * Add a message if bin/qmk doesn't work (#9000) * Fix conflicting types for 'tfp_printf' (#8269) * Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480) * Refactor and updates to TKC1800 code (#8472) * Switch to qmk forks for everything (#9019) * audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484) * Audio enable corrections (2/3) (#8903) * Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582) * Audio enable corrections (Part 4) (#8974) * Fix typo from PR7114 (#9171) * Augment future branch Changelogs (#8978) * Revert "Branch point for 2020 May 30 Breaking Change"
Diffstat (limited to 'quantum/rgb_matrix_animations/digital_rain_anim.h')
-rw-r--r--quantum/rgb_matrix_animations/digital_rain_anim.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h
index 7a4a52db1b..1de45f8e8d 100644
--- a/quantum/rgb_matrix_animations/digital_rain_anim.h
+++ b/quantum/rgb_matrix_animations/digital_rain_anim.h
@@ -18,7 +18,7 @@ bool DIGITAL_RAIN(effect_params_t* params) {
if (params->init) {
rgb_matrix_set_color_all(0, 0, 0);
- memset(rgb_frame_buffer, 0, sizeof(rgb_frame_buffer));
+ memset(g_rgb_frame_buffer, 0, sizeof(g_rgb_frame_buffer));
drop = 0;
}
@@ -27,10 +27,10 @@ bool DIGITAL_RAIN(effect_params_t* params) {
if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) {
// top row, pixels have just fallen and we're
// making a new rain drop in this column
- rgb_frame_buffer[row][col] = max_intensity;
- } else if (rgb_frame_buffer[row][col] > 0 && rgb_frame_buffer[row][col] < max_intensity) {
+ g_rgb_frame_buffer[row][col] = max_intensity;
+ } else if (g_rgb_frame_buffer[row][col] > 0 && g_rgb_frame_buffer[row][col] < max_intensity) {
// neither fully bright nor dark, decay it
- rgb_frame_buffer[row][col]--;
+ g_rgb_frame_buffer[row][col]--;
}
// set the pixel colour
uint8_t led[LED_HITS_TO_REMEMBER];
@@ -38,11 +38,11 @@ bool DIGITAL_RAIN(effect_params_t* params) {
// TODO: multiple leds are supported mapped to the same row/column
if (led_count > 0) {
- if (rgb_frame_buffer[row][col] > pure_green_intensity) {
- const uint8_t boost = (uint8_t)((uint16_t)max_brightness_boost * (rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity));
+ if (g_rgb_frame_buffer[row][col] > pure_green_intensity) {
+ const uint8_t boost = (uint8_t)((uint16_t)max_brightness_boost * (g_rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity));
rgb_matrix_set_color(led[0], boost, max_intensity, boost);
} else {
- const uint8_t green = (uint8_t)((uint16_t)max_intensity * rgb_frame_buffer[row][col] / pure_green_intensity);
+ const uint8_t green = (uint8_t)((uint16_t)max_intensity * g_rgb_frame_buffer[row][col] / pure_green_intensity);
rgb_matrix_set_color(led[0], 0, green, 0);
}
}
@@ -55,15 +55,15 @@ bool DIGITAL_RAIN(effect_params_t* params) {
for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) {
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
// if ths is on the bottom row and bright allow decay
- if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[row][col] == max_intensity) {
- rgb_frame_buffer[row][col]--;
+ if (row == MATRIX_ROWS - 1 && g_rgb_frame_buffer[row][col] == max_intensity) {
+ g_rgb_frame_buffer[row][col]--;
}
// check if the pixel above is bright
- if (rgb_frame_buffer[row - 1][col] == max_intensity) {
+ if (g_rgb_frame_buffer[row - 1][col] == max_intensity) {
// allow old bright pixel to decay
- rgb_frame_buffer[row - 1][col]--;
+ g_rgb_frame_buffer[row - 1][col]--;
// make this pixel bright
- rgb_frame_buffer[row][col] = max_intensity;
+ g_rgb_frame_buffer[row][col] = max_intensity;
}
}
}