Skip to content

Commit

Permalink
2DPlasmaball - optimize out float
Browse files Browse the repository at this point in the history
  • Loading branch information
softhack007 committed Jul 8, 2023
1 parent 2562f30 commit 72b7960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5285,7 +5285,7 @@ uint16_t mode_2DPlasmaball(void) { // By: Stepko https://edito

SEGMENT.fadeToBlackBy(SEGMENT.custom1>>2);

float t = millis() / (33 - SEGMENT.speed/8);
uint_fast32_t t = (millis() * 8) / (256 - SEGMENT.speed); // optimized to avoid float
for (int i = 0; i < cols; i++) {
uint16_t thisVal = inoise8(i * 30, t, t);
uint16_t thisMax = map(thisVal, 0, 255, 0, cols-1);
Expand Down

0 comments on commit 72b7960

Please sign in to comment.