# HG changeset patch # User nick # Date 1003582400 0 # Node ID 82c17b13494687d66ea935c855a45db8ae8cdc0b # Parent 0769b2fb3ce23a69fb952088e45d3aac48fc74ff Fixed half-image bug and added computing of correct aspect during zooming diff -r 0769b2fb3ce2 -r 82c17b134946 libvo/vo_vesa.c --- a/libvo/vo_vesa.c Sat Oct 20 11:58:45 2001 +0000 +++ b/libvo/vo_vesa.c Sat Oct 20 12:53:20 2001 +0000 @@ -212,16 +212,17 @@ */ static void __vbeCopyData(uint8_t *image) { - unsigned long i,image_offset,offset; + unsigned long i,j,image_offset,offset,limit; unsigned pixel_size,image_line_size,screen_line_size,x_shift; pixel_size = (video_mode_info.BitsPerPixel+7)/8; screen_line_size = video_mode_info.XResolution*pixel_size; image_line_size = image_width*pixel_size; x_shift = x_offset*pixel_size; - for(i=y_offset;i yres) + { + *image_height = yres; + *image_width = yres * factor; + if(verbose) printf("vo_vesa: Y > X tehrefore *image=%ux%u\n",*image_width,*image_height); + } +} + static char *model2str(unsigned char type) { char *retval; @@ -459,8 +477,11 @@ if( format==IMGFMT_YV12 ) { /* software scale */ - image_width = video_mode_info.XResolution; - image_height = video_mode_info.YResolution; + vesa_aspect(width,height, + video_mode_info.XResolution,video_mode_info.YResolution, + &image_width,&image_height); +/* image_width = video_mode_info.XResolution; + image_height = video_mode_info.YResolution; */ scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */ scale_yinc=(height << 16) / image_height + 2; SwScale_Init(); @@ -490,6 +511,11 @@ win.high= video_mode_info.WinSize*1024; x_offset = (video_mode_info.XResolution - image_width) / 2; y_offset = (video_mode_info.YResolution - image_height) / 2; + if(verbose) + printf("vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n" + ,image_width,image_height + ,video_mode_info.XResolution,video_mode_info.YResolution + ,x_offset,y_offset); if((err=vbeSaveState(&init_state)) != VBE_OK) { PRINT_VBE_ERR("vbeSaveState",err);