@@ -5041,7 +5041,11 @@ uint16_t mode_2Dfirenoise(void) { // firenoise2d. By Andrew Tuline
50415041 unsigned yscale = SEGMENT.speed *8 ;
50425042 unsigned indexx = 0 ;
50435043
5044- CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : SEGMENT.loadPalette (pal, 35 );
5044+ // CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : SEGMENT.loadPalette(pal, 35);
5045+ CRGBPalette16 pal = SEGMENT.check1 ? SEGPALETTE : CRGBPalette16 (CRGB::Black, CRGB::Black, CRGB::Black, CRGB::Black,
5046+ CRGB::Red, CRGB::Red, CRGB::Red, CRGB::DarkOrange,
5047+ CRGB::DarkOrange,CRGB::DarkOrange, CRGB::Orange, CRGB::Orange,
5048+ CRGB::Yellow, CRGB::Orange, CRGB::Yellow, CRGB::Yellow);
50455049 for (int j=0 ; j < cols; j++) {
50465050 for (int i=0 ; i < rows; i++) {
50475051 indexx = perlin8 (j*yscale*rows/255 , i*xscale+strip.now /4 ); // We're moving along our Perlin map.
@@ -6076,7 +6080,8 @@ uint16_t mode_2Dscrollingtext(void) {
60766080 case 5 : letterWidth = 5 ; letterHeight = 12 ; break ;
60776081 }
60786082 // letters are rotated
6079- if (((SEGMENT.custom3 +1 )>>3 ) % 2 ) {
6083+ const int8_t rotate = map (SEGMENT.custom3 , 0 , 31 , -2 , 2 );
6084+ if (rotate == 1 || rotate == -1 ) {
60806085 rotLH = letterWidth;
60816086 rotLW = letterHeight;
60826087 } else {
@@ -6114,6 +6119,7 @@ uint16_t mode_2Dscrollingtext(void) {
61146119 else if (!strncmp_P (text,PSTR (" #DD" ),3 )) sprintf (text, zero? (" %02d" ) : (" %d" ), day (localTime));
61156120 else if (!strncmp_P (text,PSTR (" #DAY" ),4 )) sprintf (text, (" %s" ) , dayShortStr (day (localTime)));
61166121 else if (!strncmp_P (text,PSTR (" #DDDD" ),5 )) sprintf (text, (" %s" ) , dayStr (day (localTime)));
6122+ else if (!strncmp_P (text,PSTR (" #DAYL" ),5 )) sprintf (text, (" %s" ) , dayStr (day (localTime)));
61176123 else if (!strncmp_P (text,PSTR (" #MO" ),3 )) sprintf (text, zero? (" %02d" ) : (" %d" ), month (localTime));
61186124 else if (!strncmp_P (text,PSTR (" #MON" ),4 )) sprintf (text, (" %s" ) , monthShortStr (month (localTime)));
61196125 else if (!strncmp_P (text,PSTR (" #MMMM" ),5 )) sprintf (text, (" %s" ) , monthStr (month (localTime)));
@@ -6147,27 +6153,28 @@ uint16_t mode_2Dscrollingtext(void) {
61476153 SEGENV.step = strip.now + map (SEGMENT.speed , 0 , 255 , 250 , 50 ); // shift letters every ~250ms to ~50ms
61486154 }
61496155
6150- if (!SEGMENT.check2 ) SEGMENT.fade_out (255 - (SEGMENT.custom1 >>4 )); // trail
6151- bool usePaletteGradient = false ;
6156+ SEGMENT.fade_out (255 - (SEGMENT.custom1 >>4 )); // trail
61526157 uint32_t col1 = SEGMENT.color_from_palette (SEGENV.aux1 , false , PALETTE_SOLID_WRAP, 0 );
61536158 uint32_t col2 = BLACK;
6159+ // if gradient is selected and palette is default (0) drawCharacter() uses gradient from SEGCOLOR(0) to SEGCOLOR(2)
6160+ // otherwise col2 == BLACK means use currently selected palette for gradient
6161+ // if gradient is not selected set both colors the same
61546162 if (SEGMENT.check1 ) { // use gradient
6155- if (SEGMENT.palette == 0 ) { // use colors for gradient
6156- col1 = SEGCOLOR (0 );
6157- col2 = SEGCOLOR (2 );
6163+ if (SEGMENT.palette == 0 ) { // use colors for gradient
6164+ col1 = SEGCOLOR (0 );
6165+ col2 = SEGCOLOR (2 );
61586166 }
6159- else usePaletteGradient = true ;
6160- }
6167+ } else col2 = col1; // force characters to use single color (from palette)
61616168
61626169 for (int i = 0 ; i < numberOfLetters; i++) {
61636170 int xoffset = int (cols) - int (SEGENV.aux0 ) + rotLW*i;
61646171 if (xoffset + rotLW < 0 ) continue ; // don't draw characters off-screen
6165- SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, map (SEGMENT. custom3 , 0 , 31 , - 2 , 2 ), usePaletteGradient );
6172+ SEGMENT.drawCharacter (text[i], xoffset, yoffset, letterWidth, letterHeight, col1, col2, rotate );
61666173 }
61676174
61686175 return FRAMETIME;
61696176}
6170- 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" ;
6177+ 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" ;
61716178
61726179
61736180// //////////////////////////
0 commit comments