From 840f9b8678f607aecc15d47bc77248c4ac8b8574 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 4 Feb 2008 00:54:30 +0000 Subject: tweaked console client status with timer and fps core connect/disconnect --- src/game/game.cc | 29 ++++++++++++----------------- src/game/game.h | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'src/game') diff --git a/src/game/game.cc b/src/game/game.cc index 0d79195..65e9450 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -18,11 +18,13 @@ namespace game { -void Game::init() +bool Game::init() { using math::Vector3f; using filesystem::IniFile; + con_print << "Initializing game..." << std::endl; + // read game.ini IniFile f; f.open("ini/game.ini"); @@ -78,7 +80,7 @@ void Game::init() con_warn << f.name() << " unknown key '" << f.key() << "' at line " << f.line() << std::endl; } } else if (f.got_section("world")) { - con_debug << "[world] section" << std::endl; + //con_debug << "[world] section" << std::endl; } else if (f.got_section("sector")) { sector = new Sector(); sectors.push_back(sector); @@ -88,23 +90,21 @@ void Game::init() } f.close(); - con_print << "Load sectors" << std::endl; + /* + con_print << "Loading sectors..." << std::endl; for (unsigned n =0; n < sectors.size(); n++) - con_print << sectors[n]->label << " " << sectors[n]->name << std::endl; - + con_print << " " << sectors[n]->label << " " << sectors[n]->name << std::endl; + */ star.location = Vector3f(256.0f, 0.0f, 256.0f); ship.location = Vector3f(0,0,0); - - // signal the gameinterface the game is ready - core::GameInterface::init(); - - // test functions - core::cmd << "help" << std::endl; - core::cmd << "test" << std::endl; + + return true; } void Game::shutdown() { + con_print << "Shutting down game..." << std::endl; + // delete every sector object in the sectors vector for (unsigned int n =0; n< sectors.size(); n++) { delete sectors[n]; @@ -112,15 +112,10 @@ void Game::shutdown() } // clear the sectors vector sectors.clear(); - - // signal the gameinterface the game has shutdown - core::GameInterface::shutdown(); } void Game::frame(float seconds) { - GameInterface::frame(seconds); - ship.update(seconds); } diff --git a/src/game/game.h b/src/game/game.h index 29f3e1b..f9c6667 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -27,7 +27,7 @@ namespace game class Game : public core::GameInterface { public: /// initialize the game - void init(); + bool init(); /// shutdown the game void shutdown(); /// execute one game grame -- cgit v1.2.3