From 79c820e7b17ba35a8289f19fa8f258f4578f9ff1 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 8 Sep 2024 07:01:26 +0200 Subject: [PATCH] win32 gui: fixed dimension_update() for 15 bpp modes. --- bochs/gui/win32.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bochs/gui/win32.cc b/bochs/gui/win32.cc index 71dba31eb..0f85d716d 100644 --- a/bochs/gui/win32.cc +++ b/bochs/gui/win32.cc @@ -1895,8 +1895,12 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, } } - bitmap_info->bmiHeader.biBitCount = bpp; if (bpp != current_bpp) { + if (bpp == 15) { + bitmap_info->bmiHeader.biBitCount = 16; + } else { + bitmap_info->bmiHeader.biBitCount = bpp; + } if (bpp == 16) { bitmap_info->bmiHeader.biCompression = BI_BITFIELDS; static RGBQUAD red_mask = {0x00, 0xF8, 0x00, 0x00}; @@ -1915,9 +1919,6 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, bitmap_info->bmiColors[2] = bitmap_info->bmiColors[258]; } bitmap_info->bmiHeader.biCompression = BI_RGB; - if (bpp == 15) { - bitmap_info->bmiHeader.biBitCount = 16; - } } } current_bpp = guest_bpp = bpp;