summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-24 11:25:30 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-24 11:25:30 +0000
commit749ecd9953a2d624be9c52a3a12c915dd252274b (patch)
treeb1a8555ea79a63e7ea8a82c2515f741239fd25c5 /sdl.c
parent6926be2a594bb03a87cc7e946926d7ca6d683104 (diff)
Fix detection of 15 bit display depth
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4936 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sdl.c b/sdl.c
index 719e2bd5a..0edc4a092 100644
--- a/sdl.c
+++ b/sdl.c
@@ -89,6 +89,17 @@ static void sdl_resize(DisplayState *ds, int w, int h)
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 {