Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/game.cc29
-rw-r--r--src/game/game.h2
2 files changed, 13 insertions, 18 deletions
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