summaryrefslogtreecommitdiff
path: root/osd.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-06-19 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-06-19 18:00:00 +0200
commitfef3aa3a7fff0e3b4745532a6b1a157b45cb9643 (patch)
tree7d97c031765c5fe7ae7ebd9420809b663c45a172 /osd.c
parenta616d4b8597cfb69af7a8f0e0a96da2143970ffe (diff)
downloadvdr-patch-lnbsharing-fef3aa3a7fff0e3b4745532a6b1a157b45cb9643.tar.gz
vdr-patch-lnbsharing-fef3aa3a7fff0e3b4745532a6b1a157b45cb9643.tar.bz2
Version 1.3.27vdr-1.3.27
- Fixed handling 'page down', which was broken in version 1.3.26 (thanks to Udo Richter). - Modified page scrolling behaviour (based on a suggestion by Patrick Gleichmann). - The new setup option "OSD/Scroll wraps" can be used to activate wrapping around in menu lists (based on a suggestion by Patrick Gleichmann). - Removed the NPTL check at startup, since several users have reported that VDR now runs fine with NPTL. - Fixed handling VPS timers, so that they only record if the event they are assigned to actually has the given VPS time. - Disabled cVideoRepacker in remux.c, because it has caused several problems during recording. If you want to test (and maybe debug) it, activate the line //#define TEST_cVideoRepacker in remux.c. - When drawing a bitmap to the OSD, the existing palette of the target can now be replaced with the new one instead of adding the new entries (thanks to Andreas Regel).
Diffstat (limited to 'osd.c')
-rw-r--r--osd.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/osd.c b/osd.c
index 2e74a11..104393d 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 1.61 2005/06/11 14:31:36 kls Exp $
+ * $Id: osd.c 1.62 2005/06/19 10:43:04 kls Exp $
*/
#include "osd.h"
@@ -86,6 +86,13 @@ void cPalette::Take(const cPalette &Palette, tIndexes *Indexes, tColor ColorFg,
}
}
+void cPalette::Replace(const cPalette &Palette)
+{
+ for (int i = 0; i < Palette.numColors; i++)
+ SetColor(i, Palette.color[i]);
+ numColors = Palette.numColors;
+}
+
// --- cBitmap ---------------------------------------------------------------
cBitmap::cBitmap(int Width, int Height, int Bpp, int X0, int Y0)
@@ -337,19 +344,28 @@ void cBitmap::DrawPixel(int x, int y, tColor Color)
SetIndex(x, y, Index(Color));
}
-void cBitmap::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg)
+void cBitmap::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg, bool ReplacePalette)
{
if (bitmap && Bitmap.bitmap && Intersects(x, y, x + Bitmap.Width() - 1, y + Bitmap.Height() - 1)) {
if (Covers(x, y, x + Bitmap.Width() - 1, y + Bitmap.Height() - 1))
Reset();
x -= x0;
y -= y0;
- tIndexes Indexes;
- Take(Bitmap, &Indexes, ColorFg, ColorBg);
- for (int ix = 0; ix < Bitmap.width; ix++) {
- for (int iy = 0; iy < Bitmap.height; iy++)
- SetIndex(x + ix, y + iy, Indexes[int(Bitmap.bitmap[Bitmap.width * iy + ix])]);
- }
+ if (ReplacePalette && Covers(x + x0, y + y0, x + x0 + Bitmap.Width() - 1, y + y0 + Bitmap.Height() - 1)) {
+ Replace(Bitmap);
+ for (int ix = 0; ix < Bitmap.width; ix++) {
+ for (int iy = 0; iy < Bitmap.height; iy++)
+ SetIndex(x + ix, y + iy, Bitmap.bitmap[Bitmap.width * iy + ix]);
+ }
+ }
+ else {
+ tIndexes Indexes;
+ Take(Bitmap, &Indexes, ColorFg, ColorBg);
+ for (int ix = 0; ix < Bitmap.width; ix++) {
+ for (int iy = 0; iy < Bitmap.height; iy++)
+ SetIndex(x + ix, y + iy, Indexes[int(Bitmap.bitmap[Bitmap.width * iy + ix])]);
+ }
+ }
}
}
@@ -665,10 +681,10 @@ void cOsd::DrawPixel(int x, int y, tColor Color)
bitmaps[i]->DrawPixel(x, y, Color);
}
-void cOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg)
+void cOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg, bool ReplacePalette)
{
for (int i = 0; i < numBitmaps; i++)
- bitmaps[i]->DrawBitmap(x, y, Bitmap, ColorFg, ColorBg);
+ bitmaps[i]->DrawBitmap(x, y, Bitmap, ColorFg, ColorBg, ReplacePalette);
}
void cOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment)