diff options
author | Stijn Buys <ingar@osirion.org> | 2007-12-17 14:47:30 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2007-12-17 14:47:30 +0000 |
commit | 09f307b6cb4f7c69e5b0685acc0bdd18e9d57d40 (patch) | |
tree | 08c5c8e1e516413278db3817dd89749cc3dbdac3 /src/game | |
parent | 8f1e895de4986e3a953023b31840210c5555856e (diff) |
home directory creation
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/game.cc b/src/game/game.cc index cbde6b0..cd80889 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -11,6 +11,7 @@ #include "common/console.h" #include "common/inifile.h" +#include "common/path.h" #include "osirion.h" @@ -35,6 +36,7 @@ std::vector<Sector*> sectors; void init() { using common::File; + using common::Path; using common::IniFile; using common::Vector3f; @@ -42,11 +44,16 @@ void init() condebug << "Debug messages enabled" << std::endl; // initialize game data locations - // TODO create game::homedir if it doesn't exist - File::datadir = "./data/"; - File::homedir = "~/.osirion/"; + File::datadir = "./data/"; File::basedir = "base/"; File::moddir = ""; + + // FIXME win32 + File::homedir = getenv("HOME"); + File::homedir = File::homedir + "/.osirion/"; + Path::create(File::homedir); + Path::create(File::homedir+File::basedir); + if (File::moddir.size()) Path::create(File::homedir+File::moddir); // read game.ini IniFile f; |