diff options
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | ttxtsubs.c | 2 | ||||
-rw-r--r-- | ttxtsubsdisplay.c | 59 |
3 files changed, 39 insertions, 25 deletions
@@ -1,6 +1,9 @@ VDR Plugin 'ttxtsubs' Revision History -------------------------------------- +2008-12-18: Version 0.0.7 +-Try to set OSDArea to 8 bpp when AntiAliasing is enabled (Closes #17) + 2008-12-14: Version 0.0.6 - Project moved to http://projects.vdr-developer.org/projects/show/plg-ttxtsubs - Applied patch from Rolf Ahrenberg (vdr-ttxtsubs-0.0.5-raastinrauta-edition.diff.gz) @@ -50,7 +50,7 @@ #error "This version of ttxtsubs only works with vdr version >= 1.6.0!" #endif -static const char *VERSION = "0.0.6"; +static const char *VERSION = "0.0.7"; static const char *DESCRIPTION = trNOOP("Teletext subtitles"); cTtxtsubsConf globals; diff --git a/ttxtsubsdisplay.c b/ttxtsubsdisplay.c index 22d9c43..cbd7e9d 100644 --- a/ttxtsubsdisplay.c +++ b/ttxtsubsdisplay.c @@ -442,6 +442,11 @@ void cTtxtSubsDisplay::ShowOSD(void) if(rowcount > MAXTTXTROWS) rowcount = MAXTTXTROWS; y = bottom - SCREENTOP - ROWH - ((ROWINCR + globals.lineSpacing()) * (rowcount-1)); + + int bpp = 2; + if (Setup.AntiAlias) { + bpp = 8; + } for(i = 0; i < rowcount; i++) { int w = 0; int left = SIDEMARGIN; @@ -456,37 +461,43 @@ void cTtxtSubsDisplay::ShowOSD(void) left = SCREENRIGHT - SIDEMARGIN - w; break; } - tArea area = {left, y, left+w-1, y+ROWH-1, 2}; + tArea area = {left, y, left+w-1, y+ROWH-1, bpp}; areas[numAreas++] = area; y += (ROWINCR + globals.lineSpacing()); } if (mOsd->CanHandleAreas(areas, numAreas) != oeOk) { - dprint("ttxtsubs: OSD Cannot handle areas (error code: %d) - try to enlarge the line spacing!\n", mOsd->CanHandleAreas(areas, numAreas)); - } - else { - mOsd->SetAreas(areas, numAreas); - y = bottom - SCREENTOP - ROWH - ((ROWINCR + globals.lineSpacing()) * (rowcount-1)); - for(i = 0; i < rowcount; i++) { - int w = 0; - int left = SIDEMARGIN; - w = mOsdFont->Width(buf[i]) + 2 * TEXTX; - if(w % 4) - w += 4 - (w % 4); - switch(globals.textPos()) { - case 1: - left = (SCREENRIGHT - w) / 2; - break; - case 2: - left = SCREENRIGHT - SIDEMARGIN - w; - break; + // try lower color depth + if (bpp > 2) { + for(i = 0; i < numAreas; i++) areas[numAreas++].bpp = 2; + if (mOsd->CanHandleAreas(areas, numAreas) != oeOk) { + dprint("ttxtsubs: OSD Cannot handle areas (error code: %d) - try to enlarge the line spacing!\n", mOsd->CanHandleAreas(areas, numAreas)); + return; } - mOsd->DrawRectangle(left, y, left + w, y + ROWH, getcolor(globals.bgColor())); - mOsd->DrawText(left + TEXTX, y + TEXTY, buf[i], getcolor(globals.fgColor()), getcolor(globals.bgColor()), mOsdFont); - //dprint("%d/%d (%d,%d) (%d,%d): %s\n", i, rowcount-1, areas[i].x1, areas[i].y1, left + TEXTX, y + TEXTY, buf[i]); - y += (ROWINCR + globals.lineSpacing()); } - mOsd->Flush(); } + mOsd->SetAreas(areas, numAreas); + + y = bottom - SCREENTOP - ROWH - ((ROWINCR + globals.lineSpacing()) * (rowcount-1)); + for(i = 0; i < rowcount; i++) { + int w = 0; + int left = SIDEMARGIN; + w = mOsdFont->Width(buf[i]) + 2 * TEXTX; + if(w % 4) + w += 4 - (w % 4); + switch(globals.textPos()) { + case 1: + left = (SCREENRIGHT - w) / 2; + break; + case 2: + left = SCREENRIGHT - SIDEMARGIN - w; + break; + } + mOsd->DrawRectangle(left, y, left + w, y + ROWH, getcolor(globals.bgColor())); + mOsd->DrawText(left + TEXTX, y + TEXTY, buf[i], getcolor(globals.fgColor()), getcolor(globals.bgColor()), mOsdFont); + //dprint("%d/%d (%d,%d) (%d,%d): %s\n", i, rowcount-1, areas[i].x1, areas[i].y1, left + TEXTX, y + TEXTY, buf[i]); + y += (ROWINCR + globals.lineSpacing()); + } + mOsd->Flush(); } |