diff options
Diffstat (limited to 'src/client/client.cc')
-rw-r--r-- | src/client/client.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/client/client.cc b/src/client/client.cc index 993e849..8970dea 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -49,7 +49,12 @@ Client app; extern "C" void func_r_restart(std::stringstream &args) { video::shutdown(); - video::init(); + console::flush(); + + if (!video::init()) { + console::flush(); + app.quit(1); + } } //--- public ------------------------------------------------------ @@ -85,15 +90,17 @@ void Client::init() SDL_Init(0); // Initialize the video subsystem - if (!client::video::init()) + if (!video::init()) { + console::flush(); quit(1); + } // initialize console console::init(); - + // initialize input input::init(); - + // add engine functions core::func::add("r_restart", func_r_restart); } @@ -115,13 +122,13 @@ void Client::run() // run a core frame float seconds = ((float)(current - chrono)) / 1000.0f; core::Application::frame(seconds); - + // run a video frame video::frame(seconds); - + // process input input::frame(seconds); - + // update the main loop chronometer chrono = current; } |