From a237a2d7723b94df6cd3e91401ec28388de6f1a0 Mon Sep 17 00:00:00 2001
From: Stijn Buys <ingar@osirion.org>
Date: Sun, 21 Oct 2007 23:02:47 +0000
Subject: namespace cleanup

---
 src/game/game.cc  | 20 ++++++++++++--------
 src/game/game.h   | 15 ++++-----------
 src/game/player.h |  3 ++-
 src/game/sector.h |  3 ++-
 src/game/ship.cc  | 16 ++++++++++------
 src/game/ship.h   | 13 +++++++++----
 src/game/star.cc  |  9 +++++----
 src/game/star.h   | 17 +++++++++++------
 src/game/world.h  |  9 +++++----
 9 files changed, 60 insertions(+), 45 deletions(-)

(limited to 'src/game')

diff --git a/src/game/game.cc b/src/game/game.cc
index e34a7b8..0ac9acc 100644
--- a/src/game/game.cc
+++ b/src/game/game.cc
@@ -1,34 +1,38 @@
-/* game.h
+/*
+   game/game.cc
    This file is part of the Osirion project and is distributed under 
    the terms of the GNU General Public License version 2 
 */
 
-
 // project headers
 #include "ship.h"
 #include "star.h"
-#include "file.h"
+
+#include "common/file.h"
 
 namespace game {
 
+using common::File;
+using common::Vector3f;
+
 Ship ship;
 Star star;
 bool initialized = false;
 
 // TODO datadir should by set by ./configure and read from config.h
 // FIXME win32
-std::string datadir("./data/");
-std::string homedir("~/.osirion/");
-std::string basedir("base/");
-std::string moddir;
-
 void init() 
 {
 	// load the world
 	star.location = Vector3f(256.0f, 0.0f, 256.0f);
 	ship.location = Vector3f(0,0,0);
 	
+	// initialize game data locations
 	// TODO create game::homedir if it doesn't exist
+	File::datadir = "./data/";
+	File::homedir = "~/.osirion/";
+	File::basedir = "base/";
+	File::moddir = "";
 
 	// read game.ini
 	File f;
diff --git a/src/game/game.h b/src/game/game.h
index 9f3b19a..9609884 100644
--- a/src/game/game.h
+++ b/src/game/game.h
@@ -1,5 +1,7 @@
-/* 	game.h
-	This file is part of the Osirion project
+/*
+   game/game.h
+   This file is part of the Osirion project and is distributed under 
+   the terms of the GNU General Public License version 2 
 */
 
 #ifndef __INCLUDED_GAME_H__
@@ -28,15 +30,6 @@ namespace game
 
 	/// true while the game is running
 	extern bool initialized;
-
-	/// location of the main data files, includes trailing /
-	extern std::string datadir;
-	/// location of the personal data files, includes trailing /
-	extern std::string homedir;
-	/// subdirectory with the base data files, includes trailing /
-	extern std::string basedir;
-	/// subdirectory for the current mod, includes trailing /
-	extern std::string moddir;
 };
 
 #endif // __INCLUDED_GAME_H__
diff --git a/src/game/player.h b/src/game/player.h
index a3850a5..d2f2316 100644
--- a/src/game/player.h
+++ b/src/game/player.h
@@ -1,4 +1,5 @@
-/* player.h
+/*
+   game/player.h
    This file is part of the Osirion project and is distributed under 
    the terms and conditions of the GNU General Public License version 2 
 */
diff --git a/src/game/sector.h b/src/game/sector.h
index 3f6b3e4..75e6446 100644
--- a/src/game/sector.h
+++ b/src/game/sector.h
@@ -1,4 +1,5 @@
-/* sector.h
+/*
+   game/sector.h
    This file is part of the Osirion project and is distributed under 
    the terms and conditions of the GNU General Public License version 2 
 */
diff --git a/src/game/ship.cc b/src/game/ship.cc
index 84e9f41..f0c40c4 100644
--- a/src/game/ship.cc
+++ b/src/game/ship.cc
@@ -1,14 +1,17 @@
-/* 	ship.cc
-	This file is part of the Osirion project
+/*
+   game/ship.cc
+   This file is part of the Osirion project and is distributed under 
+   the terms and conditions of the GNU General Public License version 2 
 */
 
-// C++ headers
-#include <iostream>
-
 // project headers
+#include "ship.h"
 #include "common/functions.h"
 
-#include "ship.h"
+// C++ headers
+#include <iostream>
+
+namespace game {
 
 Ship::Ship()
 {
@@ -82,3 +85,4 @@ void Ship::turn_right()
 		yaw_offset = - max_yaw_offset;
 }
 
+} // namespace game
diff --git a/src/game/ship.h b/src/game/ship.h
index d6a00ba..31266a4 100644
--- a/src/game/ship.h
+++ b/src/game/ship.h
@@ -1,5 +1,7 @@
-/* 	ship.h
-	This file is part of the Osirion project
+/*
+   game/ship.h
+   This file is part of the Osirion project and is distributed under 
+   the terms and conditions of the GNU General Public License version 2 
 */
 
 #ifndef __INCLUDED_SHIP_H__
@@ -8,6 +10,8 @@
 // project headers
 #include "common/vector3f.h"
 
+namespace game {
+
 class Ship 
 {
 public:
@@ -18,7 +22,7 @@ public:
 	void update(float elapsed);
 
 	/// location of the ship in space
-	Vector3f location;
+	common::Vector3f location;
 	/// speed vector in units/second
 	float speed;
 
@@ -50,5 +54,6 @@ private:
 	float yaw_offset;
 };
 
-#endif // __INCLUDED_SHIP_H__
+} // namespace game
 
+#endif // __INCLUDED_SHIP_H__
diff --git a/src/game/star.cc b/src/game/star.cc
index 6aa82ac..924bb96 100644
--- a/src/game/star.cc
+++ b/src/game/star.cc
@@ -1,10 +1,9 @@
-/* star.h
-   This file is part of the Osirion project and is distributed under 
-   the terms and conditions of the GNU General Public License version 2 
-*/
+
 
 #include "star.h"
 
+namespace game {
+
 Star::Star() : 
 	location(0,0,0), 
 	color(1,1,1,1)
@@ -15,3 +14,5 @@ Star::Star() :
 Star::~Star()
 {
 }
+
+} // namespace game
diff --git a/src/game/star.h b/src/game/star.h
index ef33ad5..e65a9fb 100644
--- a/src/game/star.h
+++ b/src/game/star.h
@@ -1,4 +1,5 @@
-/* star.h
+/*
+   game/star.h
    This file is part of the Osirion project and is distributed under 
    the terms and conditions of the GNU General Public License version 2 
 */
@@ -6,24 +7,28 @@
 #ifndef __INCLUDED_STAR_H__
 #define __INCLUDED_STAR_H__
 
-// C++ headers
-#include <string>
-
 // project headers
 #include "common/vector3f.h"
 #include "common/color.h"
 
+// C++ headers
+#include <string>
+
+namespace game {
+
 /// A star, that shines so bright
 class Star {
 public:
 	Star();
 	~Star();
 
-	Vector3f location;
-	Color color;
+	common::Vector3f location;
+	common::Color color;
 	float radius;
 
 	std::string name;
 };
 
+} // namespace game
+
 #endif // __INCLUDED_STAR_H__
diff --git a/src/game/world.h b/src/game/world.h
index 8cbc232..27909fc 100644
--- a/src/game/world.h
+++ b/src/game/world.h
@@ -1,4 +1,5 @@
-/* world.h
+/*
+   game/world.h
    This file is part of the Osirion project and is distributed under 
    the terms and conditions of the GNU General Public License version 2 
 */
@@ -12,11 +13,11 @@ namespace game
 {
 
 /// The game world
-namespace World {
+class World {
 	/// load the intial game world into memory 
-	void init();
+	static void init();
 	/// unload the game world
-	void shutdown();
+	static void shutdown();
 };
 
 } // namespace game
-- 
cgit v1.2.3