From 5b040b1d92cdf8ae36ad319a5f5805e8d83b5411 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 13 Jul 2002 14:45:55 +0200 Subject: [PATCH] Added direct access to the index data of cPalette (needed for displaying SPUs) (cont'd) --- osdbase.c | 13 ++++++++++++- osdbase.h | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/osdbase.c b/osdbase.c index e7486a74..0d6e2a3a 100644 --- a/osdbase.c +++ b/osdbase.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.c 1.4 2002/05/18 12:39:16 kls Exp $ + * $Id: osdbase.c 1.5 2002/07/13 14:42:47 kls Exp $ */ #include "osdbase.h" @@ -23,6 +23,17 @@ cPalette::cPalette(int Bpp) full = false; } +void cPalette::SetColor(int Index, eDvbColor Color) +{ + if (Index < maxColors) { + if (numColors < Index) + numColors = Index + 1; + used[Index] = true; + color[Index] = Color; + fetched[Index] = false; + } +} + int cPalette::Index(eDvbColor Color) { #if __BYTE_ORDER == __BIG_ENDIAN diff --git a/osdbase.h b/osdbase.h index a73b1c47..1800482f 100644 --- a/osdbase.h +++ b/osdbase.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osdbase.h 1.3 2002/07/13 10:16:18 kls Exp $ + * $Id: osdbase.h 1.4 2002/07/13 14:45:55 kls Exp $ */ #ifndef __OSDBASE_H @@ -50,9 +50,10 @@ private: bool full; protected: typedef unsigned char tIndexes[MAXNUMCOLORS]; + void SetColor(int Index, eDvbColor Color); + eDvbColor GetColor(int Index) { return color[Index]; } public: cPalette(int Bpp); - void SetColor(int Index, eDvbColor Color); int Index(eDvbColor Color); void Reset(void); const eDvbColor *Colors(int &FirstColor, int &LastColor);