diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-02-20 15:12:56 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-02-20 15:12:56 +0100 |
commit | 6c7089afd257df3a9033a5bd2f205b8f03eccfaf (patch) | |
tree | d146c9d9c4b37d52b966607d7c1ef9e3b85dcf0f /skinsttng.c | |
parent | 343071cc6ab69169312ae04a7888cd55a79395d0 (diff) | |
download | vdr-6c7089afd257df3a9033a5bd2f205b8f03eccfaf.tar.gz vdr-6c7089afd257df3a9033a5bd2f205b8f03eccfaf.tar.bz2 |
Implemented support for TrueColor OSD
Diffstat (limited to 'skinsttng.c')
-rw-r--r-- | skinsttng.c | 121 |
1 files changed, 78 insertions, 43 deletions
diff --git a/skinsttng.c b/skinsttng.c index c39ecce0..9bd1b15c 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 2.6 2010/11/07 15:10:08 kls Exp $ + * $Id: skinsttng.c 2.7 2011/02/20 13:02:49 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -182,12 +182,17 @@ cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(bool WithInfo) int yt = (y0 + y1) / 2; int yb = (y6 + y7) / 2; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + (Setup.ChannelInfoPos ? 0 : cOsd::OsdHeight() - y7)); - tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground)); osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent); @@ -220,12 +225,17 @@ cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(bool WithInfo) y0 = 0; y1 = lineHeight; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + (Setup.ChannelInfoPos ? 0 : cOsd::OsdHeight() - y1)); - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent); osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7); @@ -397,21 +407,26 @@ cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(void) int yt = (y0 + y1) / 2; int yb = (y6 + y7) / 2; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); - tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; - if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, - { x0, y3, x3 - 1, y4 - 1, 1 }, - { x3, y3, x4 - 1, y4 - 1, 2 }, - { x4, y3, x7 - 1, y4 - 1, 2 }, - { x0, y4, x7 - 1, y7 - 1, 4 } - }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors + { x0, y3, x3 - 1, y4 - 1, 1 }, + { x3, y3, x4 - 1, y4 - 1, 2 }, + { x4, y3, x7 - 1, y4 - 1, 2 }, + { x0, y4, x7 - 1, y7 - 1, 4 } + }; + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } } osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground)); @@ -754,12 +769,17 @@ cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(bool ModeOnly) int yt = (y0 + y1) / 2; int yb = (y6 + y7) / 2; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - y7); - tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } }; // 16 colors + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground)); if (!ModeOnly) { @@ -888,12 +908,17 @@ cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(void) y0 = 0; y1 = lineHeight; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - y1); - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } }; // 16 colors + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent); osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7); @@ -1003,21 +1028,26 @@ cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(const char *Title, int NumTrack int yt = (y0 + y1) / 2; int yb = (y6 + y7) / 2; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - y7); - tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; - if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, - { x0, y3, x3 - 1, y4 - 1, 1 }, - { x3, y3, x4 - 1, y4 - 1, 2 }, - { x4, y3, x7 - 1, y4 - 1, 2 }, - { x0, y4, x7 - 1, y7 - 1, 4 } - }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } }; // 16 colors + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 }, // 2..16 colors + { x0, y3, x3 - 1, y4 - 1, 1 }, + { x3, y3, x4 - 1, y4 - 1, 2 }, + { x4, y3, x7 - 1, y4 - 1, 2 }, + { x0, y4, x7 - 1, y7 - 1, 4 } + }; + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } } osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground)); @@ -1131,12 +1161,17 @@ cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(void) y0 = 0; y1 = lineHeight; osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - y1); - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; - if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 32 } }; // TrueColor + if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; - osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 8 } }; // 256 colors + if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + else { + tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 2 } }; // 4 colors + osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); + } } osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent); osd->DrawEllipse (x0, y0, x1 - 1, y1 - 1, frameColor, 7); |