Changeset - r24848:4573f310a629
[Not reviewed]
master
0 1 0
Patric Stout - 3 years ago 2021-02-19 09:45:25
truebrain@openttd.org
Codechange: [Win32] make fast-forward check the same as with other drivers

It was of all the drivers the only one doing this slightly different.
When trying to unify more code, that was rather annoying.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/video/win32_v.cpp
Show inline comments
 
@@ -1166,31 +1166,31 @@ void VideoDriver_Win32::MainLoop()
 
	CheckPaletteAnim();
 
	for (;;) {
 
		InteractiveRandom(); // randomness
 

	
 
		while (PeekMessage(&mesg, nullptr, 0, 0, PM_REMOVE)) {
 
			/* 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 &&
 
		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 &&
 
		if (_wnd.has_focus && GetAsyncKeyState(VK_TAB) < 0 && GetAsyncKeyState(VK_MENU) >= 0)
 
#endif
 
			  !_networking && _game_mode != GM_MENU) {
 
			_fast_forward |= 2;
 
		{
 
			if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2;
 
		} else if (_fast_forward & 2) {
 
			_fast_forward = 0;
 
		}
 

	
 
		cur_ticks = std::chrono::steady_clock::now();
 

	
 
		/* If more than a millisecond has passed, increase the _realtime_tick. */
 
		if (cur_ticks - last_realtime_tick > std::chrono::milliseconds(1)) {
 
			auto delta = std::chrono::duration_cast<std::chrono::milliseconds>(cur_ticks - last_realtime_tick);
 
			_realtime_tick += delta.count();
 
			last_realtime_tick += delta;
 
		}
0 comments (0 inline, 0 general)