vdr/vdr/debian/patches opt-22_8bitcolor.dpatch opt-23_osdpip-0.0.3.dpatch 00list

Tobias Grimm pkg-vdr-dvb-changes@lists.alioth.debian.org
Sat, 07 Aug 2004 23:12:12 +0000


Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/patches
In directory haydn:/tmp/cvs-serv21632/debian/patches

Modified Files:
	00list 
Added Files:
	opt-22_8bitcolor.dpatch opt-23_osdpip-0.0.3.dpatch 
Log Message:
added optional osdpip and 8-bit-color patch

Index: 00list
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/patches/00list,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- 00list	7 Aug 2004 22:50:09 -0000	1.7
+++ 00list	7 Aug 2004 23:12:10 -0000	1.8
@@ -5,7 +5,14 @@
 
 # The Elchi AIO 4d patch for a nicer OSD, inlcuding the frames and black
 # square fix.
-opt-20_elchiaio4d+1
+# opt-20_elchiaio4d+1
 
 # Patch needed for ttxtsubs (does not work with AC3-patch)
-opt-21_ttxtsubs
+# opt-21_ttxtsubs
+
+# This patch fixes a problem with 256 color, by changing char to unsigned
+# char.
+# opt-22_8bitcolor
+
+# Patch to support variable color for osdpip plugin
+# opt-23_osdpip-0.0.3

--- NEW FILE: opt-23_osdpip-0.0.3.dpatch ---
#!/bin/sh debian/patches/dpatch.sh

## osdpip-patch by Sascha Volkenandt <sascha@akv-soft.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch supports the OSDPIP-PlugIn
## DP: (can not be used with autopid)

@DPATCH@
diff -Nur vdr.orig/osdbase.c vdr/osdbase.c
--- vdr.orig/osdbase.c	2004-03-15 22:56:29.000000000 +0100
+++ vdr/osdbase.c	2004-03-15 22:56:29.000000000 +0100
@@ -173,6 +173,12 @@
       }
 }
 
+void cPalette::Replace(const cPalette &Palette)
+{
+  for (int i = 0; i < Palette.numColors; i++)
+      SetColor(i, Palette.color[i]);
+}
+
 // --- cBitmap ---------------------------------------------------------------
 
 cBitmap::cBitmap(int Width, int Height, int Bpp, bool ClearWithBackground)
@@ -289,6 +295,17 @@
      }
 }
 
+void cBitmap::SetBitmap256(int x, int y, const cBitmap &Bitmap)
+{
+  if (bitmap && Bitmap.bitmap) {
+     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]);
+         }
+     }
+}
+
 int cBitmap::Width(unsigned char c)
 {
   return font ? font->Width(c) : -1;
@@ -550,7 +567,10 @@
      x -= x0;
      y -= y0;
      }
-  cBitmap::SetBitmap(x, y, Bitmap);
+  if (bpp == 8)
+     cBitmap::SetBitmap256(x, y, Bitmap);
+  else
+     cBitmap::SetBitmap(x, y, Bitmap);
 }
 
 void cWindow::Text(int x, int y, const char *s, eDvbColor ColorFg, eDvbColor ColorBg)
diff -Nur vdr.orig/osdbase.h vdr/osdbase.h
--- vdr.orig/osdbase.h	2004-03-15 22:56:29.000000000 +0100
+++ vdr/osdbase.h	2004-03-15 22:56:53.000000000 +0100
@@ -14,6 +14,7 @@
 #include "font.h"
 
 #define MAXNUMCOLORS 256
+#define VDR_OSDPIP_PATCHED
 
 enum eDvbColor {
 #ifdef DEBUG_OSD
@@ -95,6 +96,7 @@
         // stored yet, NumColors will be set to 0 and the function will
         // return NULL.
   void Take(const cPalette &Palette, tIndexes *Indexes = NULL);
+  void Replace(const cPalette &Palette);
   };
 
 class cBitmap : public cPalette {
@@ -115,6 +117,7 @@
   void SetIndex(int x, int y, unsigned char Index);
   void SetPixel(int x, int y, eDvbColor Color);
   void SetBitmap(int x, int y, const cBitmap &Bitmap);
+  void SetBitmap256(int x, int y, const cBitmap &Bitmap);
   int Width(void) { return width; }
   int Width(unsigned char c);
   int Width(const char *s);

--- NEW FILE: opt-22_8bitcolor.dpatch ---
#!/bin/sh debian/patches/dpatch.sh

## 8bitcolor by Andreas Regel <andreas.regel@gmx.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fixes problems with 8 bit colors by using unsigned char instead of char.
## DP: For 256 color support, you will also need ElchiAIO4d.

@DPATCH@
diff -Nur vdr.orig/osdbase.c vdr/osdbase.c
--- vdr.orig/osdbase.c	2004-03-15 22:48:57.000000000 +0100
+++ vdr/osdbase.c	2004-03-15 22:48:57.000000000 +0100
@@ -185,7 +185,7 @@
   fontType = fontOsd;
   font = NULL;
   if (width > 0 && height > 0) {
-     bitmap = MALLOC(char, width * height);
+     bitmap = MALLOC(unsigned char, width * height);
      if (bitmap) {
         Clean();
         memset(bitmap, 0x00, width * height);
@@ -257,7 +257,7 @@
   dirtyY2 = -1;
 }
 
-void cBitmap::SetIndex(int x, int y, char Index)
+void cBitmap::SetIndex(int x, int y, unsigned char Index)
 {
   if (bitmap) {
      if (0 <= x && x < width && 0 <= y && y < height) {
@@ -338,7 +338,7 @@
      Fill(0, 0, width - 1, height - 1, clrBackground);
 }
 
-const char *cBitmap::Data(int x, int y)
+const unsigned char *cBitmap::Data(int x, int y)
 {
   return &bitmap[y * width + x];
 }
@@ -476,7 +476,7 @@
            ABORT;
            }
         free(bitmap);
-        bitmap = MALLOC(char, height * width);
+        bitmap = MALLOC(unsigned char, height * width);
         for (int y = 0; y < height; ++y)
             for (int x = 0; x < width; ++x) {
                 eDvbColor col;
@@ -562,7 +562,7 @@
   cBitmap::Text(x, y, s, ColorFg, ColorBg);
 }
 
-const char *cWindow::Data(int x, int y)
+const unsigned char *cWindow::Data(int x, int y)
 {
   return cBitmap::Data(x, y);
 }
diff -Nur vdr.orig/osdbase.h vdr/osdbase.h
--- vdr.orig/osdbase.h	2004-03-15 22:48:57.000000000 +0100
+++ vdr/osdbase.h	2004-03-15 22:49:54.000000000 +0100
@@ -101,7 +101,7 @@
 private:
   cFont *font;
   eDvbFont fontType;
-  char *bitmap;
+  unsigned char *bitmap;
   bool clearWithBackground;
 protected:
   int width, height;
@@ -112,7 +112,7 @@
   bool ClearWithBackground(void) { return clearWithBackground; }
   eDvbFont SetFont(eDvbFont Font);
   bool Dirty(int &x1, int &y1, int &x2, int &y2);
-  void SetIndex(int x, int y, char Index);
+  void SetIndex(int x, int y, unsigned char Index);
   void SetPixel(int x, int y, eDvbColor Color);
   void SetBitmap(int x, int y, const cBitmap &Bitmap);
   int Width(void) { return width; }
@@ -123,7 +123,7 @@
   void Fill(int x1, int y1, int x2, int y2, eDvbColor Color);
   void Clean(void);
   void Clear(void);
-  const char *Data(int x, int y);
+  const unsigned char *Data(int x, int y);
   bool LoadXpm(const char *FileName, eDvbColor NoneColor = clrTransparent);
   bool LoadLogo(const char *FileName);
   };
@@ -150,7 +150,7 @@
   void Fill(int x1, int y1, int x2, int y2, eDvbColor Color);
   void SetBitmap(int x, int y, const cBitmap &Bitmap);
   void Text(int x, int y, const char *s, eDvbColor ColorFg = clrWhite, eDvbColor ColorBg = clrBackground);
-  const char *Data(int x, int y);
+  const unsigned char *Data(int x, int y);
   };
 
 typedef int tWindowHandle;