提交 749ecd99 编写于 作者: B blueswir1

Fix detection of 15 bit display depth

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4936 c046a42c-6fe2-441c-8c8c-71466251a162
上级 6926be2a
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册