changeset 411:53203545daa7

-bpp added.
author se7encode
date Sat, 14 Apr 2001 18:19:40 +0000
parents ad05b8b1aa7e
children 6f32e624118a
files libvo/vo_svga.c
diffstat 1 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_svga.c	Sat Apr 14 18:09:46 2001 +0000
+++ b/libvo/vo_svga.c	Sat Apr 14 18:19:40 2001 +0000
@@ -89,8 +89,33 @@
   }
 
   pformat = format;
-  if (format == IMGFMT_YV12) bpp = 32;
-  else bpp = format & 255;
+  
+  // -bpp check
+  if (!vo_dbpp) {
+    if (format == IMGFMT_YV12) bpp = 32;
+    else bpp = format & 255;
+  } else {
+      bpp = vo_dbpp;
+      switch (bpp) {
+        case 32: if (!(vid_modes[_640x480x16M32] | vid_modes[_800x600x16M32] | vid_modes[_1024x768x16M32])) {
+	           printf("vo_svga: %dbpp not supported by HW or SVGAlib",bpp);
+		   return(1);
+                 }
+        case 24: if (!(vid_modes[_640x480x16M] | vid_modes[_800x600x16M] | vid_modes[_1024x768x16M])) {
+	           printf("vo_svga: %dbpp not supported by HW or SVGAlib",bpp);
+		   return(1);
+                 }
+        case 16: if (!(vid_modes[_640x480x64K] | vid_modes[_800x600x64K] | vid_modes[_1024x768x64K])) {
+	           printf("vo_svga: %dbpp not supported by HW or SVGAlib",bpp);
+		   return(1);
+                 }
+        case 15: if (!(vid_modes[_640x480x32K] | vid_modes[_800x600x32K] | vid_modes[_1024x768x32K])) {
+	           printf("vo_svga: %dbpp not supported by HW or SVGAlib",bpp);
+		   return(1);
+                 }
+      }
+    }
+  
   if (wid > 800)
     switch (bpp) {
       case 32: vid_mode = 36; break;