Changeset - r24846:16646cbe730e
[Not reviewed]
master
0 1 0
Patric Stout - 3 years ago 2021-02-20 09:30:50
truebrain@openttd.org
Fix: [Win32] run InteractiveRandom() once every tick, not once every message

Win32 was the only video driver doing this. It is just a bit too
much random.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/video/win32_v.cpp
Show inline comments
 
@@ -1156,26 +1156,27 @@ void VideoDriver_Win32::MainLoop()
 
			} else {
 
				DEBUG(driver, 1, "Threaded drawing enabled");
 
				/* Wait till the draw thread has started itself. */
 
				_draw_signal->wait(*_draw_mutex);
 
			}
 
		}
 
	}
 

	
 
	_wnd.running = true;
 

	
 
	CheckPaletteAnim();
 
	for (;;) {
 
		InteractiveRandom(); // randomness
 

	
 
		while (PeekMessage(&mesg, nullptr, 0, 0, PM_REMOVE)) {
 
			InteractiveRandom(); // randomness
 
			/* Convert key messages to char messages if we want text input. */
 
			if (EditBoxInGlobalFocus()) TranslateMessage(&mesg);
 
			DispatchMessage(&mesg);
 
		}
 
		if (_exit_game) break;
 

	
 
#if defined(_DEBUG)
 
		if (_wnd.has_focus && GetAsyncKeyState(VK_SHIFT) < 0 &&
 
#else
 
		/* Speed up using TAB, but disable for ALT+TAB of course */
 
		if (_wnd.has_focus && GetAsyncKeyState(VK_TAB) < 0 && GetAsyncKeyState(VK_MENU) >= 0 &&
 
#endif
0 comments (0 inline, 0 general)