Mercurial > mplayer.hg
changeset 2676:d3393d940aa5
Fixed rgb2rgb in DGA mode
author | nick |
---|---|
date | Sun, 04 Nov 2001 11:50:52 +0000 |
parents | cd2841d7d35e |
children | 794dec2fae64 |
files | libvo/vo_vesa.c |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_vesa.c Sun Nov 04 11:43:29 2001 +0000 +++ b/libvo/vo_vesa.c Sun Nov 04 11:50:52 2001 +0000 @@ -87,7 +87,7 @@ static struct VesaModeInfoBlock video_mode_info; static int flip_trigger = 0; static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); -static void (*rgb2rgb_fnc)(uint8_t *src,uint8_t *dst,uint32_t src_size); +static void (*rgb2rgb_fnc)(const uint8_t *src,uint8_t *dst,uint32_t src_size); /* multibuffering */ uint8_t* video_base; /* should be never changed */ @@ -165,7 +165,8 @@ int shift_b = video_mode_info.BlueFieldPosition; int pixel_size = (video_mode_info.BitsPerPixel+7)/8; int bpl = video_mode_info.BytesPerScanLine; - int color, offset; + int color; + unsigned offset; if (x < 0 || x >= x_res || y < 0 || y >= y_res) return; r >>= 8 - video_mode_info.RedMaskSize; @@ -206,8 +207,8 @@ */ #define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8) -#define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*pixel_size) -#define IMAGE_LINE_SIZE(pixel_size) (image_width*pixel_size) +#define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) ) +#define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size)) static void __vbeCopyData(uint8_t *image) { @@ -343,11 +344,12 @@ if(HAS_DGA()) { size_t i, psize, ssize, dsize; - uint8_t *dest, *sptr; + uint8_t *dest; + const uint8_t *sptr; psize = PIXEL_SIZE(); dsize = SCREEN_LINE_SIZE(psize); - ssize = IMAGE_LINE_SIZE(image_bpp); - dest = dga_buffer/* + y_offset*dsize + x_offset*psize*/; + ssize = IMAGE_LINE_SIZE((image_bpp+7)/8); + dest = dga_buffer + y_offset*dsize + x_offset*psize; sptr = src[0]; for(i=0;i<image_height;i++) {