Perform win32 gui internal palette swapping only in case of a bpp change.

This commit is contained in:
Volker Ruppert 2024-02-18 18:20:49 +01:00
parent abdbc52f22
commit 4455da0e1b

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2023 The Bochs Project // Copyright (C) 2002-2024 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -1891,6 +1891,7 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight,
} }
bitmap_info->bmiHeader.biBitCount = bpp; bitmap_info->bmiHeader.biBitCount = bpp;
if (bpp != current_bpp) {
if (bpp == 16) { if (bpp == 16) {
bitmap_info->bmiHeader.biCompression = BI_BITFIELDS; bitmap_info->bmiHeader.biCompression = BI_BITFIELDS;
static RGBQUAD red_mask = {0x00, 0xF8, 0x00, 0x00}; static RGBQUAD red_mask = {0x00, 0xF8, 0x00, 0x00};
@ -1913,6 +1914,7 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight,
bitmap_info->bmiHeader.biBitCount = 16; bitmap_info->bmiHeader.biBitCount = 16;
} }
} }
}
current_bpp = guest_bpp = bpp; current_bpp = guest_bpp = bpp;
resize_main_window(FALSE); resize_main_window(FALSE);