diff options
Diffstat (limited to 'StarsEx/Game.cpp')
-rw-r--r-- | StarsEx/Game.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/StarsEx/Game.cpp b/StarsEx/Game.cpp index 4fda01e..41375f9 100644 --- a/StarsEx/Game.cpp +++ b/StarsEx/Game.cpp @@ -136,37 +136,20 @@ Game::Pause(bool f) // +--------------------------------------------------------------------+ -bool +void Game::GameLoop() { - bool wait_for_windows_events = true; - - if (active && !paused) { - if (!server) { - // Route Events to EventTargets - EventDispatch* ed = EventDispatch::GetInstance(); - if (ed) - ed->Dispatch(); - } - - UpdateWorld(); - GameState(); - - if (!server) { - UpdateScreen(); - } - - wait_for_windows_events = false; + if (active) { + auto dispatch = EventDispatch::GetInstance(); + if (dispatch) + dispatch->Dispatch(); } - else if (active && paused) { - if (GetKey()=='P') - Pause(false); - } - + UpdateWorld(); + GameState(); + UpdateScreen(); Clock::GetInstance()->Step(); frame_number++; Mouse::w = 0; - return wait_for_windows_events; } // +--------------------------------------------------------------------+ |