@@ -1722,7 +1722,7 @@ uint16_t mode_multi_comet(void) {
17221722 }
17231723 comets[i]++;
17241724 } else {
1725- if (!random (SEGLEN)) {
1725+ if (!random16 (SEGLEN)) {
17261726 comets[i] = 0 ;
17271727 }
17281728 }
@@ -2074,7 +2074,7 @@ uint16_t mode_fire_2012() {
20742074
20752075 // Step 1. Cool down every cell a little
20762076 for (int i = 0 ; i < SEGLEN; i++) {
2077- uint8_t cool = (it != SEGENV.step ) ? random8 ((((20 + SEGMENT.speed /3 ) * 16 ) / SEGLEN)+2 ) : random (4 );
2077+ uint8_t cool = (it != SEGENV.step ) ? random8 ((((20 + SEGMENT.speed /3 ) * 16 ) / SEGLEN)+2 ) : random8 (4 );
20782078 uint8_t minTemp = (i<ignition) ? (ignition-i)/4 + 16 : 0 ; // should not become black in ignition area
20792079 uint8_t temp = qsub8 (heat[i], cool);
20802080 heat[i] = temp<minTemp ? minTemp : temp;
@@ -4580,15 +4580,15 @@ class AuroraWave {
45804580
45814581 public:
45824582 void init (uint32_t segment_length, CRGB color) {
4583- ttl = random (500 , 1501 );
4583+ ttl = random16 (500 , 1501 );
45844584 basecolor = color;
4585- basealpha = random (60 , 101 ) / (float )100 ;
4585+ basealpha = random8 (60 , 101 ) / (float )100 ;
45864586 age = 0 ;
4587- width = random (segment_length / 20 , segment_length / W_WIDTH_FACTOR); // half of width to make math easier
4587+ width = random16 (segment_length / 20 , segment_length / W_WIDTH_FACTOR); // half of width to make math easier
45884588 if (!width) width = 1 ;
4589- center = random (101 ) / (float )100 * segment_length;
4590- goingleft = random (0 , 2 ) == 0 ;
4591- speed_factor = (random (10 , 31 ) / (float )100 * W_MAX_SPEED / 255 );
4589+ center = random8 (101 ) / (float )100 * segment_length;
4590+ goingleft = random8 (0 , 2 ) == 0 ;
4591+ speed_factor = (random8 (10 , 31 ) / (float )100 * W_MAX_SPEED / 255 );
45924592 alive = true ;
45934593 }
45944594
@@ -4673,7 +4673,7 @@ uint16_t mode_aurora(void) {
46734673 waves = reinterpret_cast <AuroraWave*>(SEGENV.data );
46744674
46754675 for (int i = 0 ; i < SEGENV.aux1 ; i++) {
4676- waves[i].init (SEGLEN, CRGB (SEGMENT.color_from_palette (random8 (), false , false , random (0 , 3 ))));
4676+ waves[i].init (SEGLEN, CRGB (SEGMENT.color_from_palette (random8 (), false , false , random8 (0 , 3 ))));
46774677 }
46784678 } else {
46794679 waves = reinterpret_cast <AuroraWave*>(SEGENV.data );
@@ -4685,7 +4685,7 @@ uint16_t mode_aurora(void) {
46854685
46864686 if (!(waves[i].stillAlive ())) {
46874687 // If a wave dies, reinitialize it starts over.
4688- waves[i].init (SEGLEN, CRGB (SEGMENT.color_from_palette (random8 (), false , false , random (0 , 3 ))));
4688+ waves[i].init (SEGLEN, CRGB (SEGMENT.color_from_palette (random8 (), false , false , random8 (0 , 3 ))));
46894689 }
46904690 }
46914691
@@ -5993,7 +5993,7 @@ uint16_t mode_2Dghostrider(void) {
59935993 if (lighter->reg [i]) {
59945994 lighter->lightersPosY [i] = lighter->gPosY ;
59955995 lighter->lightersPosX [i] = lighter->gPosX ;
5996- lighter->Angle [i] = lighter->gAngle + random (- 10 , 10 );
5996+ lighter->Angle [i] = lighter->gAngle + (( int ) random8 ( 20 ) - 10 );
59975997 lighter->time [i] = 0 ;
59985998 lighter->reg [i] = false ;
59995999 } else {
@@ -6928,7 +6928,7 @@ uint16_t mode_puddlepeak(void) { // Puddlepeak. By Andrew Tuline.
69286928
69296929 uint16_t size = 0 ;
69306930 uint8_t fadeVal = map (SEGMENT.speed ,0 ,255 , 224 , 254 );
6931- uint16_t pos = random (SEGLEN); // Set a random starting position.
6931+ uint16_t pos = random16 (SEGLEN); // Set a random starting position.
69326932
69336933 um_data_t *um_data;
69346934 if (!usermods.getUMData (&um_data, USERMOD_ID_AUDIOREACTIVE)) {
0 commit comments