diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index d5d093a6a..102efd4c1 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -47,6 +47,9 @@ static int cfg_national_subset; static int screen_x, screen_y, screen_w, screen_h; +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor=false); +void FillBorder(fb_pixel_t color, bool modeFullColor=false); + fb_pixel_t *getFBp(int *y) { if (*y < (int)var_screeninfo.yres) @@ -56,34 +59,31 @@ fb_pixel_t *getFBp(int *y) return lbb; } -void FillRect(int x, int y, int w, int h, int color) +void FillRect(int x, int y, int w, int h, fb_pixel_t color, bool modeFullColor/*=false*/) { - if(color < 0 || SIZECOLTABLE < color){ - printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); - return; - } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; - if (w > 0) + if (w > 0) { + fb_pixel_t col = (modeFullColor) ? color : bgra[color]; for (int count = 0; count < h; count++) { fb_pixel_t *dest0 = p; for (int i = 0; i < w; i++) - *(dest0++) = bgra[color]; + *(dest0++) = col; p += stride; } + } } - -void FillBorder(int color) +void FillBorder(fb_pixel_t color, bool modeFullColor/*=false*/) { int ys = (var_screeninfo.yres-var_screeninfo.yoffset); - FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color); - FillRect(StartX, ys ,displaywidth,StartY ,color); - FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color); + FillRect(0 , ys ,StartX ,var_screeninfo.yres ,color, modeFullColor); + FillRect(StartX, ys ,displaywidth,StartY ,color, modeFullColor); + FillRect(StartX, ys+StartY+25*fontheight,displaywidth,var_screeninfo.yres-(StartY+25*fontheight),color, modeFullColor); if (screenmode == 0 ) - FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color); + FillRect(StartX+displaywidth, ys,var_screeninfo.xres-(StartX+displaywidth),var_screeninfo.yres ,color, modeFullColor); } int getIndexOfPageInHotlist() @@ -258,7 +258,7 @@ void RenderClearMenuLineBB(char *p, tstPageAttr *attrcol, tstPageAttr *attr) memset(p-TOPMENUCHARS, ' ', TOPMENUCHARS); /* init with spaces */ } -void ClearBB(int color) +void ClearBB(fb_pixel_t color) { FillRect(0, (var_screeninfo.yres - var_screeninfo.yoffset), var_screeninfo.xres, var_screeninfo.yres, color); } @@ -270,7 +270,7 @@ void ClearFB(int /*color*/) } #if 0 //never used -void ClearB(int color) +void ClearB(fb_pixel_t color) { FillRect(0, 0, var_screeninfo.xres, var_screeninfo.yres, color); /* framebuffer */ FillRect(0, var_screeninfo.yres, var_screeninfo.xres, var_screeninfo.yres, color); /* backbuffer */ @@ -841,7 +841,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, { *pAPy = RowAddress2Row(iAddress); /* new Active Row */ - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0 + *pAPy; int maxrow; #if TUXTXT_DEBUG @@ -892,7 +892,7 @@ int eval_triplet(int iOData, tstCachedPage *pstCachedPage, *pAPx = *pAPy = 0; /* new Active Position 0,0 */ if (*endcol == 40) /* active object */ { - int color = iData & 0x1f; + fb_pixel_t color = iData & 0x1f; int row = *pAPy0; // + *pAPy; int maxrow; @@ -4096,7 +4096,7 @@ void RenderDRCS( //FIX ME } -void DrawVLine(int x, int y, int l, int color) +void DrawVLine(int x, int y, int l, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, 0, l); @@ -4109,7 +4109,7 @@ void DrawVLine(int x, int y, int l, int color) } } -void DrawHLine(int x, int y, int l, int color) +void DrawHLine(int x, int y, int l, fb_pixel_t color) { int ltmp; fb_pixel_t *p = getFBp(&y); @@ -4130,7 +4130,7 @@ void FillRectMosaicSeparated(int x, int y, int w, int h, int fgcolor, int bgcolo } } -void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, int color) +void FillTrapez(int x0, int y0, int l0, int xoffset1, int h, int l1, fb_pixel_t color) { fb_pixel_t *p = getFBp(&y0); MARK_FB(x0, y0, l0, h); @@ -4789,7 +4789,7 @@ void RenderChar(int Char, tstPageAttr *Attribute, int zoom, int yoffset) { for (Bit = 0x80; Bit; Bit >>= 1) { - int color; + fb_pixel_t color; if (--pixtodo < 0) break; @@ -5559,7 +5559,7 @@ void CopyBB2FB() /* adapt background of backbuffer if changed */ if (StartX > 0 && *lfb != *lbb) { - FillBorder(*lbb); + FillBorder(*lbb, true); // ClearBB(*(lfb + var_screeninfo.xres * var_screeninfo.yoffset)); } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 88226cbd5..f4fb03b52 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3557,7 +3557,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + if (m_movieSelectionHandler){ + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + } mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green));