changeset 976:90408bd383a5

Scaling bug fixed.
author se7encode
date Sun, 03 Jun 2001 23:10:37 +0000
parents 65353ed24ac5
children d3354ad8aa7b
files libvo/vo_svga.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_svga.c	Sun Jun 03 21:33:03 2001 +0000
+++ b/libvo/vo_svga.c	Sun Jun 03 23:10:37 2001 +0000
@@ -130,7 +130,7 @@
   uint32_t req_w = (d_width > 0 ? d_width : width);
   uint32_t req_h = (d_height > 0 ? d_height : height);
   uint16_t vid_mode = 0;
-  uint8_t widescreen = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0;
+  uint8_t res_widescr, vid_widescr = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0;
   uint16_t buf_w = USHRT_MAX, buf_h = USHRT_MAX;
   vga_modelist_t *list = modelist;
   
@@ -256,6 +256,7 @@
                      vid_mode = list->modenum;
                      buf_w = list->modeinfo.width;
                      buf_h = list->modeinfo.height;
+		     res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
 		   }
 		 break;
         case 24: if (list->modeinfo.bytesperpixel == 3)
@@ -263,6 +264,7 @@
                      vid_mode = list->modenum;
                      buf_w = list->modeinfo.width;
                      buf_h = list->modeinfo.height;
+		     res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
 		   }
 		 break;
         case 16: if (list->modeinfo.colors == 65536)
@@ -270,6 +272,7 @@
                      vid_mode = list->modenum;
                      buf_w = list->modeinfo.width;
                      buf_h = list->modeinfo.height;
+		     res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
 		   }
 		 break;
         case 15: if (list->modeinfo.colors == 32768)
@@ -277,6 +280,7 @@
                      vid_mode = list->modenum;
                      buf_w = list->modeinfo.width;
                      buf_h = list->modeinfo.height;
+		     res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0;
 		   }
 		 break;
       }
@@ -320,8 +324,8 @@
 
   orig_w = width;
   orig_h = height;
-  if ((fullscreen & 0x04) && (WIDTH != orig_w)) {
-    if (!widescreen) {
+  if ((fullscreen & 0x04) && (WIDTH != orig_w) && (HEIGHT != orig_h)) {
+    if (!vid_widescr || !res_widescr) {
       maxh = HEIGHT;
       scaling = maxh / (orig_h * 1.0);
       maxw = (uint32_t) (orig_w * scaling);
@@ -492,9 +496,6 @@
   uint32_t sw, sh;
   
   yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, orig_w * BYTESPERPIXEL, stride[0], stride[1]);
-//#ifdef HAVE_MMX
-//  emms();
-//#endif
   sw = (uint32_t) (w * scaling);
   sh = (uint32_t) (h * scaling);
   if (scalebuf != NULL) {