else if (surface) {
SurfaceVector * surfacevector=dynamic_cast<SurfaceVector*>(surface);
if (surfacevector) surfacevector->drawTVMedia(tvmedia,x, y,width, height, corner);
- else surface->fillblt(x, y, width, height, DrawStyle::RED); // Signal that something went wrong
+ else surface->fillblt((int)x, (int)y, (int)width, (int)height, DrawStyle::RED); // Signal that something went wrong
}
}
{
}
-int RemoteMVP::init(char* devName)
+int RemoteMVP::init(const char* devName)
{
if (initted) return 0;
initted = 1;
RemoteMVP();
~RemoteMVP();
- int init(char *devName);
+ int init(const char *devName);
int shutdown();
int getDevice();
UCHAR getButtonPress(int how);
interpol_upbit[px]= (min((int)ceil(fposx),11));
interpol_lowbit[px]= (max((int)floor(fposx),0));
- 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.;
+ interpol_table_fac1[px][py]=(unsigned int)(xweight*yweight*256.);
+ interpol_table_fac2[px][py]=(unsigned int)(xinvweight*yweight*256.);
+ interpol_table_fac3[px][py]=(unsigned int)(xweight*yinvweight*256.);
+ interpol_table_fac4[px][py]=(unsigned int)(xinvweight*yinvweight*256.);
}
}
startFastDraw();
for (i=0; i<n; i++)
{
- unsigned char c = text[i];
- unsigned long *character = &font->content[font->offset[c]];
- int w = font->width[c];
+ unsigned char ch = text[i];
+ unsigned long *character = &font->content[font->offset[ch]];
+ int w = font->width[ch];
int pixels = 0;
for (X=0; (X<w) && (X + cx < width); X++)
int SurfaceVector::getFontHeight()
{
- return osd->getFontHeight();
+ return (int)osd->getFontHeight();
}
float SurfaceVector::getCharWidth(wchar_t c)
}
delete[] temptext;
#endif
- return drawText(text, x-shift, y, c);
+ return drawText(text, (int)(x-shift), y, c);
}
int SurfaceVector::drawTextCentre(const char* text, int x, int y, const DrawStyle& c)
delete[] temptext;
#endif
- return drawText(text, x-shift/2., y, c);
+ return drawText(text, (int)(x-shift/2.), y, c);
}
void SurfaceVector::drawJpeg(const char *fileName,int x, int y,int *width, int *height)
if (strcmp(fileName,"/vdr.jpg")==0) {
index=sa_vdrlogo;
*height=100; // this is faked so that the system does use the old coordinate system
- *width=ceil(190.f*osd->getPixelAspect());
+ *width=(int)ceil(190.f*osd->getPixelAspect());
} else if (strcmp(fileName,"/wallpaperPAL.jpg")==0) {
index=sa_wallpaper;
*width=720; // this is faked so that the system does use the old coordinate system
ULONG VDR::loadTVMedia(TVMediaInfo& tvmedia)
{
-
+#warning VDR::loadTVMedia returns unsigned long but error return tries to return -1
VDR_RequestPacket vrp;
if (!vrp.init(VDR_LOADTVMEDIA, false, 0)) return -1;
epg.setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
- epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect());
+ epgTVmedia.setSize(100,(UINT)(150/Osd::getInstance()->getPixelAspect()));
epg.add(&epgTVmedia);
boxRed.setBackgroundColour(DrawStyle::RED);
}
epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
- epgTVmedia.setSize(130,195/Osd::getInstance()->getPixelAspect());
+ epgTVmedia.setSize(130,(UINT)(195/Osd::getInstance()->getPixelAspect()));
summary->add(&epgTVmedia);
if (movieview) movieview->add(&epgTVmedia);
if (seriesview) seriesview->add(&epgTVmedia);
epg.setBackgroundColour(DrawStyle::VIEWBACKGROUND);
epgTVmedia.setPosition(epg.getRegionR().w-100-10,10);
- epgTVmedia.setSize(100,150/Osd::getInstance()->getPixelAspect());
+ epgTVmedia.setSize(100,(UINT)(150/Osd::getInstance()->getPixelAspect()));
epg.add(&epgTVmedia);
}
//now convert to our display
float scalex=720.f/((float) (region.framewidth+1));
float scaley=576.f/((float) (region.frameheight+1));
- r.x=floor(scalex*((float)r.x));
- r.y=floor(scaley*((float)r.y));
- r.w=ceil(scalex*((float)r.w))+1.f;
- r.h=ceil(scaley*((float)r.h))+1.f;
+ r.x = (UINT)floor(scalex*((float)r.x));
+ r.y = (UINT)floor(scaley*((float)r.y));
+ r.w = (UINT)(ceil(scalex*((float)r.w))+1.f);
+ r.h = (UINT)(ceil(scaley*((float)r.h))+1.f);
rectangle(r, DrawStyle(0,0,0,0));
boxstack->update(this, &r);
}
intext="";
}
UINT twidth=0;
- for (const char *p=title;*p!=0;p++) twidth+=charWidth(*p);
- for (const char *p=title2;*p!=0;p++) twidth+=charWidth(*p);
+ for (const char *p=title;*p!=0;p++) twidth+=(UINT)charWidth(*p);
+ for (const char *p=title2;*p!=0;p++) twidth+=(UINT)charWidth(*p);
const char *prfx="...";
- UINT prfwidth=3*charWidth('.');
+ UINT prfwidth=(UINT)(3*charWidth('.'));
const char *istart=intext+strlen(intext);
UINT iwidth=0;
while (twidth+iwidth+prfwidth < width-2*paraMargin && istart> intext) {
istart--;
- iwidth+=charWidth(*istart);
+ iwidth+=(UINT)charWidth(*istart);
}
if (twidth+iwidth+prfwidth >= width-2*paraMargin && istart < intext+strlen(intext)) istart++;
if (istart == intext) prfx="";
// skip to previous mark
Log* logger = Log::getInstance();
int currentFrame = (player->getCurrentFrameNum()); // get current Frame
- currentFrame -= 5. * myRec->recInfo->fps; // subtrack 5 seconds, else you cannot skip more than once back ..
+ currentFrame -= (int)(5. * myRec->recInfo->fps); // subtrack 5 seconds, else you cannot skip more than once back ..
int prevMark = myRec->getPrevMark(currentFrame); // find previous Frame
if (prevMark)
//now convert to our display
float scalex=720.f/((float) (region.framewidth+1));
float scaley=576.f/((float) (region.frameheight+1));
- r.x=floor(scalex*((float)r.x));
- r.y=floor(scaley*((float)r.y));
- r.w=ceil(scalex*((float)r.w))+1.f;
- r.h=ceil(scaley*((float)r.h))+1.f;
+ r.x=(UINT)floor(scalex*((float)r.x));
+ r.y=(UINT)floor(scaley*((float)r.y));
+ r.w=(UINT)(ceil(scalex*((float)r.w))+1.f);
+ r.h=(UINT)(ceil(scaley*((float)r.h))+1.f);
rectangle(r, transparent);
boxstack->update(this, &r);
{
if (!(*citty)->caption.empty())
{
- drawTextCentre((*citty)->caption.c_str(), xpos + (*citty)->w*0.5f, ypos, foreColour);
+ drawTextCentre((*citty)->caption.c_str(), (int)(xpos + (*citty)->w*0.5f), (int)ypos, foreColour);
caption1 = true;
}
if (!(*citty)->caption2.empty())
{
- drawTextCentre((*citty)->caption2.c_str(), xpos + (*citty)->w*0.5f, ypos + fontHeight*1.f, foreColour);
+ drawTextCentre((*citty)->caption2.c_str(), (int)(xpos + (*citty)->w*0.5f), (int)(ypos + fontHeight*1.f), foreColour);
caption2 = true;
}
xpos += (*citty)->w + 10.f;
height += fontHeight*1.f;
}
- rem_scroll_line = ceil((height - area.h -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
+ rem_scroll_line = (UINT)ceil((height - area.h -cur_scroll_line * fontHeight*8.f)/fontHeight/8.f);
// Log::getInstance()->log("WActorGallery", Log::DEBUG, "TVMedia rml %d",rem_scroll_line);
drawClippingRectangle(0,0,0,0);
void WSelectList::draw()
{
int fontHeight = getFontHeight();
- int ySeperation = fontHeight * linesPerOption + gap;
+ int ySeperation = (int) (fontHeight * linesPerOption + gap);
numOptionsDisplayable = (area.h - 5) / ySeperation;
if (i == selectedOption && showseloption)
{
- rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
+ rectangle(0, ypos, area.w, (UINT)(fontHeight * linesPerOption-1), darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT, options[i].pict);
}
else
{
- rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, DrawStyle::SELECTBACKGROUND);
+ rectangle(0, ypos, area.w, (UINT)(fontHeight * linesPerOption-1), DrawStyle::SELECTBACKGROUND);
drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].pict);
}
pointer = STRTOKR(buffer, "\t\n", &savepointer);
while(pointer)
{
- drawText(pointer, xposmod + columns[currentColumn], ypos_mod + curline * fontHeight, width - columns[currentColumn], colour);
+ drawText(pointer, xposmod + columns[currentColumn], (int)(ypos_mod + curline * fontHeight), width - columns[currentColumn], colour);
pointer = STRTOKR(NULL, "\t\n", &savepointer);
if (pointer) {
int WSelectList::getMouseLine(int x,int y)
{
int fontHeight = getFontHeight();
- int ySeperation = fontHeight * linesPerOption + gap;
+ int ySeperation = (int)(fontHeight * linesPerOption + gap);
if (y<0) return -1;
if (x<0 || x>(int)area.w) return -1;
for(UINT i = 0; i < strlen(name); i++)
{
- td.nameWidth += charWidth(name[i]);
+ td.nameWidth += (UINT)charWidth(name[i]);
}
UINT newButtonX = 22;