qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4936] Fix detection of 15 bit display depth
@ 2008-07-24 11:25 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2008-07-24 11:25 UTC (permalink / raw)
  To: qemu-devel

Revision: 4936
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4936
Author:   blueswir1
Date:     2008-07-24 11:25:30 +0000 (Thu, 24 Jul 2008)

Log Message:
-----------
Fix detection of 15 bit display depth

Modified Paths:
--------------
    trunk/sdl.c

Modified: trunk/sdl.c
===================================================================
--- trunk/sdl.c	2008-07-23 20:01:27 UTC (rev 4935)
+++ trunk/sdl.c	2008-07-24 11:25:30 UTC (rev 4936)
@@ -89,6 +89,17 @@
     ds->data = screen->pixels;
     ds->linesize = screen->pitch;
     ds->depth = screen->format->BitsPerPixel;
+    /* SDL BitsPerPixel never indicates any values other than
+       multiples of 8, so we need to check for strange depths. */
+    if (ds->depth == 16) {
+        uint32_t mask;
+
+        mask = screen->format->Rmask;
+        mask |= screen->format->Gmask;
+        mask |= screen->format->Bmask;
+        if ((mask & 0x8000) == 0)
+            ds->depth = 15;
+    }
     if (ds->depth == 32 && screen->format->Rshift == 0) {
         ds->bgr = 1;
     } else {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-24 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 11:25 [Qemu-devel] [4936] Fix detection of 15 bit display depth Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).