← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/lock_game_logic into lp:widelands

 

Hello SirVer:

Id propose a small change, mostly comments only

=== modified file 'src/ui_basic/panel.cc'
--- src/ui_basic/panel.cc	2016-02-13 19:17:06 +0000
+++ src/ui_basic/panel.cc	2016-02-14 11:20:39 +0000
@@ -148,9 +148,10 @@
 	// Panel-specific startup code. This might call end_modal()!
 	start();
 
-	// think() is called at most 15 times per second.
+	// think() is called at most 15 times per second, thats every 66ms
 	const uint32_t kGameLogicDelay = 1000 / 15;
 
+	// with a default of 30 FPS the gemay will be drawn every 33ms
 	const uint32_t draw_delay =
 	   1000 / std::max(5, g_options.pull_section("global").get_int("maxfps", 30));
 
@@ -163,8 +164,9 @@
 		Panel::ui_mousewheel
 	};
 
-	uint32_t next_think_time = SDL_GetTicks() + kGameLogicDelay;
-	uint32_t next_draw_time = SDL_GetTicks() + draw_delay;
+	uint32_t sdl_ticks = SDL_GetTicks();
+	uint32_t next_think_time = sdl_ticks + kGameLogicDelay;
+	uint32_t next_draw_time  = sdl_ticks + draw_delay;
 	while (_running) {
 		const uint32_t start_time = SDL_GetTicks();


I would like to test this „in the wild“ for a while.



-- 
https://code.launchpad.net/~widelands-dev/widelands/lock_game_logic/+merge/285980
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/lock_game_logic.


References