blob: 0ac9accc3b78590380ff26f7018cba48efe5fef9 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*
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 "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
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;
f.open("game.ini");
f.close();
// all done, ready to run
initialized = true;
}
void shutdown()
{
initialized = false;
}
void update(float elapsed)
{
ship.update(elapsed);
}
}; // namespace game
|