Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: b7201989bf8487dbe17bc86f4737999ec9880a0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
   filesystem/filesystem.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 "filesystem/filesystem.h"
#include "sys/sys.h"

std::string filesystem::datadir = "";
std::string filesystem::homedir = "";
std::string filesystem::basedir = "";
std::string filesystem::moddir = "";

void filesystem::init() {
	con_debug << "Initializing filesystem..." << std::endl;

	// FIXME datadir should by set by ./configure and read from config.h

	// initialize game data locations
	datadir = "./data/";	
	basedir = "base/";
	moddir = "";

	// FIXME win32
	homedir = getenv("HOME");
	homedir = homedir + "/.osirion/";
	Path::create(homedir);
	Path::create(homedir+basedir);
	if (moddir.size() && !Path::exists(homedir+moddir)) 
		Path::create(homedir+moddir);
}

void filesystem::shutdown() {
	con_debug << "Shutting down filesystem..." << std::endl;
}