From 5cb317f177b3c8f9571eef75a7f7c8c486107586 Mon Sep 17 00:00:00 2001 From: Tametomo Date: Sat, 11 Apr 2009 11:32:30 -0600 Subject: Moved keyboard input polling outside of the clock time loop. This isn't necessary so long as you're at least getting 1-2 fps (which would result in a typing speed between 60-120 wpm). Even then, you've got more serious things to be thinking about at that point than if all of your input is being tracked, and having it inside the clock time loop just cuts performance for everyone else. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This loop should get removed altogether, but there are a few items left in it at the moment which would need to get reworked first before it can be eliminated. In cases where you can't accurately know where something would be because it's random, we should just scale the random formulas to take a more drastic adjustment to compensate for that lag. Signed-off-by: Tametomo Manual-merge-by: Thorbjørn Lindeijer --- src/game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game.cpp b/src/game.cpp index 85dabbc9..56a25faf 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -444,10 +444,11 @@ void Game::exec() if (mCurrentMap) mCurrentMap->update(get_elapsed_time(gameTime)); + handleInput(); + // Handle all necessary game logic while (get_elapsed_time(gameTime) > 0) { - handleInput(); beingManager->logic(); particleEngine->update(); gui->logic(); -- cgit v1.2.3-70-g09d2