diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-10-08 11:28:40 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-10-08 11:28:40 +0200 |
commit | a8240bb6b214fc844acaec5c0955255f2a5048a0 (patch) | |
tree | 438469a2a870eadb9bd1652f3f080ee4375a5a2a | |
parent | 34dffe437703ebf2d194a3221bb45cc18760627f (diff) | |
download | vdr-plugin-dxr3-a8240bb6b214fc844acaec5c0955255f2a5048a0.tar.gz vdr-plugin-dxr3-a8240bb6b214fc844acaec5c0955255f2a5048a0.tar.bz2 |
change the way we use to encode the osd in cDxr3Osd::Flush
-rw-r--r-- | dxr3osd.c | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -151,20 +151,32 @@ void cDxr3Osd::Flush() if (!Active()) return; - int i = 0; - while (GetBitmap(i) != NULL) { + cBitmap *bmap = NULL; + int x1 = 0, y1 = 0, x2 = 0, y2 = 0; - int x1 = 0, y1 = 0, x2 = 0, y2 = 0; + // check if we need to encode an OSD, which is build by only + // one area, or if we need to create a big bitmap containing + // all areas + if (numAreas == 1) { - if (GetBitmap(0)->Dirty(x1, y1, x2, y2)) { + // we only need to set bmap pointer to a valid bitmap + bmap = GetBitmap(0); - cSpuEncoder::instance()->encode(GetBitmap(i), Top(), Left()); - shown = true; - GetBitmap(i)->Clean(); - } - i++; + } else { + + /* TODO */ } + if (!bmap) + return; + + // encode bitmap + if (bmap->Dirty(x1, y1, x2, y2)) { + cSpuEncoder::instance()->encode(bmap, Top(), Left()); + shown = true; + bmap->Clean(); + } + #if 0 if (last->Elapsed() < cDxr3ConfigData::instance()->GetOsdFlushRate()) return; |