From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/core/application.cc | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/core/application.cc') diff --git a/src/core/application.cc b/src/core/application.cc index 4132c33..1d7ded2 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -58,7 +58,7 @@ extern "C" void signal_handler(int signum) break; } } -#endif +#endif /* ---- class Application ------------------------------------------ */ @@ -84,7 +84,7 @@ Application::Application() sys::signal(SIGWINCH, signal_handler); #endif #endif - + } Application::~Application() @@ -96,7 +96,7 @@ void Application::init(int count, char **arguments) { con_print << "^BInitializing core...\n"; con_debug << " debug messages enabled\n"; - + filesystem::init(arguments[0], "base", ""); Loader::load("base"); @@ -162,7 +162,7 @@ void Application::init(int count, char **arguments) // Initialize win32 socket library WSADATA wsa_data; WORD wsa_version = MAKEWORD(2, 0); - if (WSAStartup(wsa_version, &wsa_data) != 0 ) { + if (WSAStartup(wsa_version, &wsa_data) != 0) { con_warn << "Could not initialize socket library!" << std::endl; } #endif @@ -175,7 +175,7 @@ void Application::init(int count, char **arguments) func = Func::add("quit", Application::func_quit); func->set_info("exit the application"); - + func = Func::add("load", Application::func_load); func->set_info("[string] load a game module"); @@ -218,7 +218,7 @@ void Application::shutdown() Func::remove("say"); Func::remove("help"); Func::remove("quit"); - + Func::remove("connect"); Func::remove("disconnect"); Func::remove("load"); @@ -268,7 +268,7 @@ void Application::connect(std::string const &host) if (application_game) { disconnect(); } - + if (host.size()) { notify_connect(); application_game = new GameConnection(host); @@ -282,7 +282,7 @@ void Application::connect(std::string const &host) application_game = new GameServer(); if (application_game->running()) { - con_print << "^BConnected to local game.\n"; + con_print << "^BConnected to local game.\n"; } else { delete application_game; application_game = 0; @@ -293,7 +293,7 @@ void Application::connect(std::string const &host) void Application::disconnect() { - if(application_game) { + if (application_game) { delete application_game; application_game = 0; notify_disconnect(); @@ -310,11 +310,11 @@ void Application::frame(unsigned long timestamp) if (!connected()) return; - - // run a game interface frame + + // run a game interface frame application_game->frame(timestamp); - - if (!application_game->running()) + + if (!application_game->running()) disconnect(); } @@ -345,7 +345,7 @@ void Application::save_config() for (Cvar::Registry::iterator it = Cvar::registry().begin(); it != Cvar::registry().end(); it++) { if (((*it).second->flags() & Cvar::Archive) == Cvar::Archive) { ofs << "# " << (*it).first << " " << (*it).second->info() << std::endl; - ofs << "set " << (*it).first << " " << (*it).second->str() << std::endl; + ofs << "set " << (*it).first << " " << (*it).second->str() << std::endl; ofs << std::endl; } } @@ -369,18 +369,18 @@ void Application::load_config() con_print << " reading configuration from " << filename << std::endl; char line[MAXCMDSIZE]; - while (ifs.getline(line, MAXCMDSIZE-1)) { + while (ifs.getline(line, MAXCMDSIZE - 1)) { if (line[0] && line[0] != '#' && line[0] != ';') cmd() << line << '\n'; } - + // execute commands in the buffer CommandBuffer::exec(); } void Application::load_autoexec() { - if (Cvar::sv_dedicated->value()) + if (Cvar::sv_dedicated->value()) return; std::string filename(filesystem::writedir()); @@ -391,12 +391,12 @@ void Application::load_autoexec() con_warn << "Could not read " << filename << std::endl; std::ofstream ofs(filename.c_str()); - + if (!ofs.is_open()) { con_warn << "Could not write " << filename << std::endl; return; } - + ofs << "# autoexec.cfg - osirion client custom settings" << std::endl; ofs << "# put your custom settings here" << std::endl; ofs.close(); @@ -405,13 +405,13 @@ void Application::load_autoexec() } else { con_print << " reading configuration from " << filename << std::endl; - + char line[MAXCMDSIZE]; - while (ifs.getline(line, MAXCMDSIZE-1)) { + while (ifs.getline(line, MAXCMDSIZE - 1)) { if (line[0] && line[0] != '#' && line[0] != ';') cmd() << line << '\n'; } - + CommandBuffer::exec(); } } @@ -421,9 +421,9 @@ void Application::load_commandline(int count, char **arguments) if (count < 2) return; - for (int i=1; i < count; i++) { + for (int i = 1; i < count; i++) { if (arguments[i][0] == '+') { - if (i >1) + if (i > 1) cmd() << '\n'; if (arguments[i][1]) @@ -535,7 +535,7 @@ void Application::func_rcon(std::string const &args) if (rconpassword && rconpassword->str().size()) { connection()->rcon(args); } else { - con_warn << "rconpassword not set!" << std::endl; + con_warn << "rconpassword not set!" << std::endl; } } else if (server()) { cmd() << args << "\n"; -- cgit v1.2.3