diff options
Diffstat (limited to 'src/core/application.cc')
-rw-r--r-- | src/core/application.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/core/application.cc b/src/core/application.cc index 5979fc7..36d1c5a 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -104,7 +104,7 @@ Application::Application() sys::quit(2); } application_instance = this; - + sys::signal(SIGHUP, signal_handler); sys::signal(SIGINT, signal_handler); sys::signal(SIGQUIT, signal_handler); @@ -125,22 +125,22 @@ void Application::init() { con_print << "Initializing core..." << std::endl; con_debug << "Debug messages enabled" << std::endl; - + // initialize core subsystems filesystem::init(); - + // register our functions func::add("print", func_print); func::add("help", func_help); func::add("quit", func_quit); - + func::add("connect", func_connect); func::add("disconnect", func_disconnect); - + func::add("list_var", func_list_var); func::add("list_func", func_list_func); func::add("list_ent", func_list_ent); - + if (game()) game()->connected = false; current_time = 0; @@ -149,12 +149,12 @@ void Application::init() void Application::shutdown() { con_print << "Shutting down core..." << std::endl; - + if (game() && game()->connected) disconnect(); - + //if (game()) unload(); - + filesystem::shutdown(); } @@ -169,14 +169,14 @@ void Application::connect() con_warn << "No game module loaded!" << std::endl; return; } - + if (game()->connected) { con_warn << "Connected. Disconnect first." << std::endl; } entity::clear(); game()->current_time = 0; - + if (game()->connected = game()->init()) { con_print << "Connected." << std::endl; } else { @@ -190,31 +190,31 @@ void Application::disconnect() con_warn << "No game module loaded!" << std::endl; return; } - + if (!game()->connected) { con_warn << "Not connected." << std::endl; return; } - + game()->shutdown(); - + game()->connected = false; game()->current_time = 0; - + entity::clear(); - + con_print << "Disconnected." << std::endl; } void Application::frame(float seconds) { current_time += seconds; - + if (game() && game()->connected) { game()->current_time += seconds; game()->frame(seconds); } - + // execute commands in the buffer commandbuffer::execute(); } |