adapt Pig() to blitter-based OSD border

This commit is contained in:
martii
2013-03-22 21:54:55 +01:00
parent 5548017dc7
commit 46754e01b1
2 changed files with 21 additions and 1 deletions

View File

@@ -541,7 +541,11 @@ void cVideo::VideoParamWatchdog(void)
#endif #endif
} }
#ifdef MARTII
void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h, int startx, int starty, int endx, int endy)
#else
void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h) void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
#endif
{ {
char buffer[64]; char buffer[64];
int _x, _y, _w, _h; int _x, _y, _w, _h;
@@ -559,10 +563,25 @@ void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
} }
else else
{ {
#ifdef MARTII
// need to do some additional adjustments because osd border is handled by blitter
x += startx;
x *= endx - startx + 1;
y += starty;
y *= endy - starty + 1;
w *= endx - startx + 1;
h *= endy - starty + 1;
#endif
_x = x * xres / osd_w; _x = x * xres / osd_w;
_w = w * xres / osd_w; _w = w * xres / osd_w;
_y = y * yres / osd_h; _y = y * yres / osd_h;
_h = h * yres / osd_h; _h = h * yres / osd_h;
#ifdef MARTII
_x /= 1280;
_y /= 720;
_w /= 1280;
_h /= 720;
#endif
} }
lt_debug("%s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", __func__, _x, _y, _w, _h, xres, yres); lt_debug("%s: x:%d y:%d w:%d h:%d xr:%d yr:%d\n", __func__, _x, _y, _w, _h, xres, yres);
sprintf(buffer, "%x %x %x %x", _x, _y, _w, _h); sprintf(buffer, "%x %x %x %x", _x, _y, _w, _h);

View File

@@ -177,10 +177,11 @@ class cVideo
void ShowPicture(const char * fname); void ShowPicture(const char * fname);
void StopPicture(); void StopPicture();
void Standby(unsigned int bOn); void Standby(unsigned int bOn);
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
#ifdef MARTII #ifdef MARTII
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600, int startx = 0, int starty = 0, int endx = 1279, int endy = 719);
void SetControl(int, int); void SetControl(int, int);
#else #else
void Pig(int x, int y, int w, int h, int osd_w = 1064, int osd_h = 600);
void SetControl(int, int) { return; }; void SetControl(int, int) { return; };
#endif #endif
void VideoParamWatchdog(void); void VideoParamWatchdog(void);