@@ -1139,20 +1139,50 @@ int parse_LF(const char *input, int *L, int *F, int max_lines) {
11391139 char * l_ptr = strstr (line , "&L" );
11401140 char * f_ptr = strstr (line , "&F" );
11411141
1142- if (l_ptr && f_ptr ) {
1143- L [line_count ] = atoi (l_ptr + 2 );
1144- F [line_count ] = atoi (f_ptr + 2 );
1142+ if (l_ptr ) {
1143+ L [line_count ] = atoi (l_ptr + 2 );
11451144 } else {
1146- L [line_count ] = -1 ;
1145+ L [line_count ] = -1 ;
1146+ }
1147+ if (f_ptr ) {
1148+ F [line_count ] = atoi (f_ptr + 2 );
1149+ } else {
11471150 F [line_count ] = -1 ;
11481151 }
11491152
1153+
11501154 line_count ++ ;
11511155 }
11521156
11531157 return line_count ;
11541158}
11551159
1160+ /* We use some predefined color indexes and need to keep them for compatibility
1161+ 0- white, 1 - black, 2- blue, 3 - green, 4 - red, 5 - yellow, 6 - magenta, 7 - cyan, 8 - semi-transparent, 9 - transparent
1162+ */
1163+ int I4ColorIndex (int msg_colour ) {
1164+
1165+ // if (msg_colour == 8)//9
1166+ // return COLOR_SEMI_TRANSPARENT;
1167+ // if (msg_colour == 9)//
1168+ // return COLOR_TRANSPARENT;
1169+
1170+ if (msg_colour == 8 )//9
1171+ return 12 ; //Orchid
1172+ if (msg_colour == 9 )//
1173+ return 10 ;
1174+
1175+ if (msg_colour == 0 )
1176+ msg_colour = COLOR_WHITE ;
1177+ else if (msg_colour == 1 )
1178+ msg_colour = COLOR_BLACK ;
1179+ else
1180+ //index in palette 1=Red, Green, Blue, Yellow ,Magenta, 6=Cyan,
1181+ msg_colour -- ;
1182+
1183+ return msg_colour ;
1184+ }
1185+
11561186static int droppedTTL = 0 ;
11571187static int droppedTTL_start = 0 ;
11581188static bool first_wfb_read = true;
@@ -1366,14 +1396,7 @@ void fill(char *str) {
13661396 int value = atoi (numStr );
13671397 // Ugly
13681398 msg_layout = value % 10 ;
1369- msg_colour = value / 10 ;
1370- if (msg_colour == 0 )
1371- msg_colour = COLOR_WHITE ;
1372- else if (msg_colour == 1 )
1373- msg_colour = COLOR_BLACK ;
1374- else
1375- // 1=Red, Green, Blue, Yellow ,Magenta, 6=Cyan
1376- msg_colour -- ;
1399+ msg_colour = I4ColorIndex (value / 10 );
13771400
13781401 ipos += 3 ;
13791402 }
@@ -1585,8 +1608,9 @@ bool DrawTextOnOSDBitmap(char *msg) {
15851608 osds [FULL_OVERLAY_ID ].size = F [i ];
15861609 rect = measure_text (font , osds [FULL_OVERLAY_ID ].size , lines [i ]);
15871610 maxwidth = (rect .width > maxwidth ) ? rect .width : maxwidth ;
1588- heighttl += rect .height - 2 - (( i > 0 )?1 :0 );
1611+ heighttl += ( int )( rect .height * 0.9 ) /*- ((rect.height>40 )?1:0)*/ ;
15891612 }
1613+ heighttl += 2 ;
15901614
15911615 bitmapText .u32Height = heighttl ; // line_count * rect.height;
15921616 bitmapText .u32Width = MIN ((maxwidth + 15 ) & ~15 ,
@@ -1603,7 +1627,7 @@ bool DrawTextOnOSDBitmap(char *msg) {
16031627
16041628 uint16_t color = 0xFFFF ;
16051629 if (L [i ] > 0 ) {
1606- msg_colour = L [i ] / 10 ;
1630+ msg_colour = I4ColorIndex ( L [i ] / 10 ) ;
16071631 color = GetARGB1555From_RGN_Palette (msg_colour );
16081632 }
16091633
@@ -1616,7 +1640,7 @@ bool DrawTextOnOSDBitmap(char *msg) {
16161640 bitmapText .u32Height , 0 , 0 , MIN (bitmapTextLine .u32Width , bitmapText .u32Width ),
16171641 MIN (bitmapTextLine .u32Height , bitmapText .u32Height ), 0 , heighttl );
16181642
1619- heighttl += bitmapTextLine .u32Height - 2 ;
1643+ heighttl += ( int )( bitmapTextLine .u32Height * 0.9 ) ;
16201644 free (bitmapTextLine .pData ); // Free the memory allocated by raster_text !!!
16211645 }
16221646
@@ -1628,7 +1652,7 @@ bool DrawTextOnOSDBitmap(char *msg) {
16281652 getRowStride (bitmapText .u32Width , PIXEL_FORMAT_BitsPerPixel ));
16291653
16301654 convertBitmap1555ToI4 (bitmapText .pData , bitmapText .u32Width , bitmapText .u32Height ,
1631- destBitmap , (L [1 ] > 0 ) ? -1 : msg_colour ,
1655+ destBitmap , (L [0 ] > 0 ) ? -1 : msg_colour ,
16321656 msg_colour_background ); // If different color per line is used
16331657
16341658 free (bitmapText .pData ); // free ARGB1555 bitmap
@@ -2378,8 +2402,8 @@ static void InitMSPHook() {
23782402 OVERLAY_WIDTH = current_display_info .font_width *
23792403 (current_display_info .char_width ); // must be multiple of 8 !!!
23802404 OVERLAY_WIDTH = (OVERLAY_WIDTH + 7 ) & ~7 ;
2381- if (matrix_size > 10 && OVERLAY_WIDTH < (1920 - (53 * 2 ))) {
2382- printf ("Matrix size not supported on resolutions smaller than 1920x1080p!\n" );
2405+ if (matrix_size == 11 && OVERLAY_WIDTH < (1920 - (53 * 2 ))) {
2406+ printf ("Matrix size 11 not supported on resolutions smaller than 1920x1080p!\n" );
23832407 matrix_size = 0 ;
23842408 }
23852409 /*
0 commit comments