From ade2192bbb1c5071de87a82c3e7f10f18752d17b Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 18 Jul 2009 19:48:09 +0000 Subject: [PATCH] Fix for teletext on MVP --- vteletextview.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/vteletextview.cc b/vteletextview.cc index 08274ee..168f65d 100644 --- a/vteletextview.cc +++ b/vteletextview.cc @@ -25,10 +25,10 @@ #include "remote.h" #include "teletxt/txtfont.h" -float interpol_table_fac1[16][22]; -float interpol_table_fac2[16][22]; -float interpol_table_fac3[16][22]; -float interpol_table_fac4[16][22]; +unsigned int interpol_table_fac1[16][22]; +unsigned int interpol_table_fac2[16][22]; +unsigned int interpol_table_fac3[16][22]; +unsigned int interpol_table_fac4[16][22]; int interpol_lowbit[16]; int interpol_upbit[16]; int interpol_lowline[22]; @@ -59,10 +59,10 @@ void initpol_tables(){ interpol_upbit[px]= (min((unsigned int)ceil(fposx),11)); interpol_lowbit[px]= (max((unsigned int)floor(fposx),0)); - interpol_table_fac1[px][py]=xweight*yweight; - interpol_table_fac2[px][py]=xinvweight*yweight; - interpol_table_fac3[px][py]=xweight*yinvweight; - interpol_table_fac4[px][py]=xinvweight*yinvweight; + interpol_table_fac1[px][py]=xweight*yweight*256.; + interpol_table_fac2[px][py]=xinvweight*yweight*256.; + interpol_table_fac3[px][py]=xweight*yinvweight*256.; + interpol_table_fac4[px][py]=xinvweight*yinvweight*256.; } } @@ -80,11 +80,11 @@ VTeletextView::VTeletextView(TeletextDecoderVBIEBU* TTdecoder,Boxx* playerview) { //setSize(680, 550); setSize(680,22); //Only first line - setPosition(40, 13); + setPosition(40, 26); } else { - setPosition(40, 15); + setPosition(40, 30); //setSize(680, 450); setSize(680,18);//only first line } @@ -218,16 +218,16 @@ void VTeletextView::drawChar(int x, int y, cTeletextChar c) Colour ulc=( upperbitline &(0x8000>>lowerbit)) ? fgcharcl: bgcharcl; Colour luc=( lowerbitline &(0x8000>>upperbit)) ? fgcharcl: bgcharcl; Colour llc=( lowerbitline &(0x8000>>lowerbit)) ? fgcharcl: bgcharcl; - float fac1,fac2,fac3,fac4; + unsigned int fac1,fac2,fac3,fac4; fac1=interpol_table_fac1[px][py]; fac2=interpol_table_fac2[px][py]; fac3=interpol_table_fac3[px][py]; fac4=interpol_table_fac4[px][py]; - Colour res(uuc.red*fac1+ulc.red*fac2+luc.red*fac3+llc.red*fac4, - uuc.green*fac1+ulc.green*fac2+luc.green*fac3+llc.green*fac4, - uuc.blue*fac1+ulc.blue*fac2+luc.blue*fac3+llc.blue*fac4, - uuc.alpha*fac1+ulc.alpha*fac2+luc.alpha*fac3+llc.alpha*fac4); //if this is too slow make a table + Colour res((uuc.red*fac1+ulc.red*fac2+luc.red*fac3+llc.red*fac4)/256, + (uuc.green*fac1+ulc.green*fac2+luc.green*fac3+llc.green*fac4)/256, + (uuc.blue*fac1+ulc.blue*fac2+luc.blue*fac3+llc.blue*fac4)/256, + (uuc.alpha*fac1+ulc.alpha*fac2+luc.alpha*fac3+llc.alpha*fac4)/256); //if this is too slow make a table drawtarget->drawPixelAlpha(screenposx+px,screenposy+py,res, true); } } -- 2.39.5