From 151a2ac2434f4b4c23c107d9c21e4a18dd1a3c68 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 4 Feb 2008 18:42:05 +0000 Subject: converted client:: singleton classes to namespaces --- src/client/application.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/client/application.cc') diff --git a/src/client/application.cc b/src/client/application.cc index 7a88155..c8eaab4 100644 --- a/src/client/application.cc +++ b/src/client/application.cc @@ -31,26 +31,25 @@ void Application::quit(int status) void Application::init() { + con_print << "Initializing client..." << std::endl; // initialize core core::ApplicationInterface::init(); - con_print << "Initializing client..." << std::endl; - // Initialize the video subsystem - video.init(); - if (!video.initialized) { + if (!client::video::init()) quit(1); - } // initialize input - input.init(); + input::init(); // register our engine functions - core::func_register("con_toggle", func_con_toggle); + core::func::add("con_toggle", func_con_toggle); } void Application::run() { + con_print << "Running client..." << std::endl; + Uint32 chrono = SDL_GetTicks(); while (true) { @@ -61,19 +60,19 @@ void Application::run() chrono = current; } - // update the core chronometer + // run a core frame float seconds = ((float)(current - chrono)) / 1000.0f; frame(seconds); - // update the video chronometers and draw - video.frame(seconds); + // run a video frame + video::frame(seconds); if (seconds > 0) current_fps = floorf(1/seconds); else current_fps = 9999; // process input - input.frame(); + input::frame(seconds); // update the main loop chronometer chrono = current; @@ -83,13 +82,13 @@ void Application::run() void Application::shutdown() { - con_debug << "Shutting down client..." << std::endl; + con_print << "Shutting down client..." << std::endl; console.flush(); - input.shutdown(); + input::shutdown(); console.flush(); - video.shutdown(); + video::shutdown(); console.flush(); core::ApplicationInterface::shutdown(); @@ -98,4 +97,5 @@ void Application::shutdown() quit(0); } -} +} // namespace client + -- cgit v1.2.3