Fullscreen mode fixes for the win32 gui.

Clear screen on top of dimension_update() to get rid of artifacts from previous resolution.
Adjust tile height at the bottom of the display if necessary.
This commit is contained in:
Volker Ruppert 2024-05-30 13:46:27 +02:00
parent 244e35af87
commit dc10a4195d

View File

@ -1839,18 +1839,22 @@ void bx_win32_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
{ {
HDC hdc; HDC hdc;
HGDIOBJ oldObj; HGDIOBJ oldObj;
unsigned yt = y_tilesize;
if ((y0 + y_tilesize) > dimension_y) {
yt = dimension_y - y0;
}
EnterCriticalSection(&stInfo.drawCS); EnterCriticalSection(&stInfo.drawCS);
hdc = GetDC(stInfo.simWnd); hdc = GetDC(stInfo.simWnd);
oldObj = SelectObject(MemoryDC, MemoryBitmap); oldObj = SelectObject(MemoryDC, MemoryBitmap);
StretchDIBits(MemoryDC, x0, y0, x_tilesize, y_tilesize, 0, 0, StretchDIBits(MemoryDC, x0, y0, x_tilesize, yt, 0, 0,
x_tilesize, y_tilesize, tile, bitmap_info, DIB_RGB_COLORS, SRCCOPY); x_tilesize, yt, tile, bitmap_info, DIB_RGB_COLORS, SRCCOPY);
SelectObject(MemoryDC, oldObj); SelectObject(MemoryDC, oldObj);
updateUpdated(x0, y0, x0 + x_tilesize - 1, y0 + y_tilesize - 1); updateUpdated(x0, y0, x0 + x_tilesize - 1, y0 + yt - 1);
ReleaseDC(stInfo.simWnd, hdc); ReleaseDC(stInfo.simWnd, hdc);
LeaveCriticalSection(&stInfo.drawCS); LeaveCriticalSection(&stInfo.drawCS);
@ -1872,6 +1876,10 @@ void bx_win32_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight,
if ((x == dimension_x) && (y == dimension_y) && (bpp == current_bpp)) if ((x == dimension_x) && (y == dimension_y) && (bpp == current_bpp))
return; return;
if (fullscreenMode) {
clear_screen();
flush();
}
dimension_x = x; dimension_x = x;
dimension_y = y; dimension_y = y;