diff options
Diffstat (limited to 'src/client/client.cc')
-rw-r--r-- | src/client/client.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/client/client.cc b/src/client/client.cc index ba1c0bc..993e849 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -44,6 +44,14 @@ public: Client app; +//--- engine functions -------------------------------------------- + +extern "C" void func_r_restart(std::stringstream &args) +{ + video::shutdown(); + video::init(); +} + //--- public ------------------------------------------------------ game::Game game; @@ -73,6 +81,9 @@ void Client::init() // initialize core core::Application::init(); + // initialize SDL, but do not initialize any subsystems + SDL_Init(0); + // Initialize the video subsystem if (!client::video::init()) quit(1); @@ -82,6 +93,9 @@ void Client::init() // initialize input input::init(); + + // add engine functions + core::func::add("r_restart", func_r_restart); } void Client::run() @@ -119,6 +133,9 @@ void Client::shutdown() con_print << "Shutting down client..." << std::endl; console::flush(); + // remove engine functions + core::func::remove("r_restart"); + console::shutdown(); console::flush(); |