@@ -5053,7 +5053,11 @@ uint16_t mode_2Dfirenoise(void) { // firenoise2d. By Andrew Tuline
50535053 unsigned yscale = SEGMENT.speed *8 ;
50545054 unsigned indexx = 0 ;
50555055
5056- CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : SEGMENT.loadPalette (pal, 35 );
5056+ // CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : SEGMENT.loadPalette(pal, 35);
5057+ CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : CRGBPalette16 (CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black,
5058+ CRGB::Red, CRGB::Red, CRGB::Red, CRGB::DarkOrange,
5059+ CRGB::DarkOrange,CRGB::DarkOrange, CRGB::Orange, CRGB::Orange,
5060+ CRGB::Yellow, CRGB::Orange, CRGB::Yellow, CRGB::Yellow);
50575061 for (int j=0 ; j < cols; j++) {
50585062 for (int i=0 ; i < rows; i++) {
50595063 indexx = perlin8 (j*yscale*rows/255 , i*xscale+strip.now /4 ); // We're moving along our Perlin map.
@@ -6088,7 +6092,8 @@ uint16_t mode_2Dscrollingtext(void) {
60886092 case 5 : letterWidth = 5 ; letterHeight = 12 ; break ;
60896093 }
60906094 // letters are rotated
6091- if (((SEGMENT.custom3 +1 )>>3 ) % 2 ) {
6095+ const int8_t rotate = map (SEGMENT.custom3 , 0 , 31 , -2 , 2 );
6096+ if (rotate == 1 || rotate == -1 ) {
60926097 rotLH = letterWidth;
60936098 rotLW = letterHeight;
60946099 } else {
@@ -6126,6 +6131,7 @@ uint16_t mode_2Dscrollingtext(void) {
61266131 else if (!strncmp_P (text,PSTR (" #DD" ),3 )) sprintf (text, zero? (" %02d" ) : (" %d" ), day (localTime));
61276132 else if (!strncmp_P (text,PSTR (" #DAY" ),4 )) sprintf (text, (" %s" ) , dayShortStr (day (localTime)));
61286133 else if (!strncmp_P (text,PSTR (" #DDDD" ),5 )) sprintf (text, (" %s" ) , dayStr (day (localTime)));
6134+ else if (!strncmp_P (text,PSTR (" #DAYL" ),5 )) sprintf (text, (" %s" ) , dayStr (day (localTime)));
61296135 else if (!strncmp_P (text,PSTR (" #MO" ),3 )) sprintf (text, zero? (" %02d" ) : (" %d" ), month (localTime));
61306136 else if (!strncmp_P (text,PSTR (" #MON" ),4 )) sprintf (text, (" %s" ) , monthShortStr (month (localTime)));
61316137 else if (!strncmp_P (text,PSTR (" #MMMM" ),5 )) sprintf (text, (" %s" ) , monthStr (month (localTime)));
@@ -6159,27 +6165,28 @@ uint16_t mode_2Dscrollingtext(void) {
61596165 SEGENV.step = strip.now + map (SEGMENT.speed , 0 , 255 , 250 , 50 ); // shift letters every ~250ms to ~50ms
61606166 }
61616167
6162- if (!SEGMENT.check2 ) SEGMENT.fade_out (255 - (SEGMENT.custom1 >>4 )); // trail
6163- bool usePaletteGradient = false ;
6168+ SEGMENT.fade_out (255 - (SEGMENT.custom1 >>4 )); // trail
61646169 uint32_t col1 = SEGMENT.color_from_palette (SEGENV.aux1 , false , PALETTE_SOLID_WRAP, 0 );
61656170 uint32_t col2 = BLACK;
6171+ // if gradient is selected and palette is default (0) drawCharacter() uses gradient from SEGCOLOR(0) to SEGCOLOR(2)
6172+ // otherwise col2 == BLACK means use currently selected palette for gradient
6173+ // if gradient is not selected set both colors the same
61666174 if (SEGMENT.check1 ) { // use gradient
6167- if (SEGMENT.palette == 0 ) { // use colors for gradient
6168- col1 = SEGCOLOR (0 );
6169- col2 = SEGCOLOR (2 );
6175+ if (SEGMENT.palette == 0 ) { // use colors for gradient
6176+ col1 = SEGCOLOR (0 );
6177+ col2 = SEGCOLOR (2 );
61706178 }
6171- else usePaletteGradient = true ;
6172- }
6179+ } else col2 = col1; // force characters to use single color (from palette)
61736180
61746181 for (int i = 0 ; i < numberOfLetters; i++) {
61756182 int xoffset = int (cols) - int (SEGENV.aux0 ) + rotLW*i;
61766183 if (xoffset + rotLW < 0 ) continue ; // don't draw characters off-screen
6177- SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, map (SEGMENT. custom3 , 0 , 31 , - 2 , 2 ), usePaletteGradient );
6184+ SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, rotate );
61786185 }
61796186
61806187 return FRAMETIME;
61816188}
6182- static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = " Scrolling Text@!,Y Offset,Trail,Font size,Rotate,Gradient,Overlay ,Reverse;!,!,Gradient;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0" ;
6189+ static const char _data_FX_MODE_2DSCROLLTEXT[] PROGMEM = " Scrolling Text@!,Y Offset,Trail,Font size,Rotate,Gradient,,Reverse;!,!,Gradient;!;2;ix=128,c1=0,rev=0,mi=0,rY=0,mY=0" ;
61836190
61846191
61856192// //////////////////////////
0 commit comments