analogclock: Save background for using transparent clock images

Origin commit data
------------------
Branch: ni/coolstream
Commit: 5d04ea65f4
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-08-22 (Mon, 22 Aug 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2016-08-22 16:13:46 +02:00
committed by vanhofen
parent e203488ad9
commit dd5f370fcc
2 changed files with 24 additions and 4 deletions

View File

@@ -130,6 +130,7 @@ CInfoViewer::CInfoViewer ()
lasttime = 0;
aspectRatio = 0;
ChanInfoX = 0;
analogclock_buf = NULL; //NI
Init();
infoViewerBB->Init();
oldinfo.current_uniqueKey = 0;
@@ -177,6 +178,12 @@ void CInfoViewer::Init()
_livestreamInfo1.clear();
_livestreamInfo2.clear();
//NI
if (analogclock_buf) {
delete analogclock_buf;
analogclock_buf = NULL;
}
}
/*
@@ -2461,11 +2468,17 @@ void CInfoViewer::showAnalogClock(int posx,int posy,int dia)
hx = int((dia * 0.6 * cos(hAngleInRad)));
hy = int((dia * 0.6 * sin(hAngleInRad)));
std::string clock_face = ICONSDIR_VAR "/clock_face.png";
if (access(clock_face.c_str(), F_OK) != 0)
clock_face = ICONSDIR "/clock_face.png";
if (analogclock_buf == NULL) {
std::string clock_face = ICONSDIR_VAR "/clock_face.png";
if (access(clock_face.c_str(), F_OK) != 0)
clock_face = ICONSDIR "/clock_face.png";
g_PicViewer->DisplayImage(clock_face, posx-dia, posy-dia, 2*dia, 2*dia);
g_PicViewer->DisplayImage(clock_face, posx-dia, posy-dia, 2*dia, 2*dia);
analogclock_buf = new fb_pixel_t[2*dia * 2*dia];
frameBuffer->SaveScreen(posx-dia, posy-dia, 2*dia, 2*dia, analogclock_buf);
}
else
frameBuffer->RestoreScreen(posx-dia, posy-dia, 2*dia, 2*dia, analogclock_buf);
frameBuffer->paintLine(posx,posy,posx+hx,posy+hy,COL_MENUHEAD_TEXT);
frameBuffer->paintLine(posx,posy,posx+mx,posy+my,COL_MENUHEAD_TEXT);
@@ -2510,6 +2523,12 @@ void CInfoViewer::ResetModules()
ResetPB();
delete rec; rec = NULL;
infoViewerBB->ResetModules();
//NI
if (analogclock_buf) {
delete analogclock_buf;
analogclock_buf = NULL;
}
}
//NI