diff options
Diffstat (limited to 'dvbspu.c')
-rw-r--r-- | dvbspu.c | 35 |
1 files changed, 6 insertions, 29 deletions
@@ -8,7 +8,7 @@ * * parts of this file are derived from the OMS program. * - * $Id: dvbspu.c 1.12 2005/02/06 09:54:51 kls Exp $ + * $Id: dvbspu.c 1.14 2005/05/07 11:13:48 kls Exp $ */ #include <assert.h> @@ -143,6 +143,8 @@ bool cDvbSpuBitmap::getMinSize(const aDvbSpuPalDescr paldescr, if (ret) DEBUG("MinSize: (%d, %d) x (%d, %d)\n", size.x1, size.y1, size.x2, size.y2); + if (size.x1 > size.x2 || size.y1 > size.y2) + return false; return ret; } @@ -304,24 +306,6 @@ void cDvbSpuDecoder::clearHighlight(void) hlpsize.y2 = -1; } -int cDvbSpuDecoder::ScaleYcoord(int value) -{ - if (scaleMode == eSpuLetterBox) { - int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60; - return lround((value * 3.0) / 4.0) + offset; - } - else - return value; -} - -int cDvbSpuDecoder::ScaleYres(int value) -{ - if (scaleMode == eSpuLetterBox) - return lround((value * 3.0) / 4.0); - else - return value; -} - sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp) { sDvbSpuRect size; @@ -365,22 +349,15 @@ void cDvbSpuDecoder::Draw(void) sDvbSpuRect hlsize; hlsize.x1 = hlpsize.x1; - hlsize.y1 = ScaleYcoord(hlpsize.y1); + hlsize.y1 = hlpsize.y1; hlsize.x2 = hlpsize.x2; - hlsize.y2 = ScaleYcoord(hlpsize.y2); + hlsize.y2 = hlpsize.y2; if (highlight) fg = spubmp->getBitmap(hlpDescr, palette, hlsize); - if (spubmp->getMinSize(palDescr, bgsize)) { + if (spubmp->getMinSize(palDescr, bgsize)) bg = spubmp->getBitmap(palDescr, palette, bgsize); - if (scaleMode == eSpuLetterBox) { - // the coordinates have to be modified for letterbox - int y1 = ScaleYres(bgsize.y1) + bgsize.height(); - bgsize.y2 = y1 + bgsize.height(); - bgsize.y1 = y1; - } - } sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg); |