NetHackW: fix focus flashing when using far look

Changed when we update the map window back buffer.  We now defer all
back buffer renderig until mswin_map_update is called.  We update
the window only within the main message loop thus we should only
get fully coherent map state rendered prior to getting input.
This commit is contained in:
Bart House
2021-01-23 11:44:35 -08:00
parent 093c53bead
commit d6b435a1d8
3 changed files with 51 additions and 38 deletions
+5 -3
View File
@@ -2120,9 +2120,11 @@ mswin_putmsghistory(const char *msg, BOOLEAN_P restoring)
void
mswin_main_loop()
{
MSG msg;
while (!mswin_have_input()) {
MSG msg;
mswin_map_update(mswin_hwnd_from_winid(WIN_MAP));
if (!iflags.debug_fuzzer || PeekMessage(&msg, NULL, 0, 0, FALSE)) {
if(GetMessage(&msg, NULL, 0, 0) != 0) {
if (GetNHApp()->regNetHackMode
@@ -2214,7 +2216,7 @@ initMapTiles(void)
map_size.cx = GetNHApp()->mapTile_X * COLNO;
map_size.cy = GetNHApp()->mapTile_Y * ROWNO;
mswin_map_stretch(mswin_hwnd_from_winid(WIN_MAP), &map_size, TRUE);
mswin_map_layout(mswin_hwnd_from_winid(WIN_MAP), &map_size);
return TRUE;
}