-
Notifications
You must be signed in to change notification settings - Fork 0
/
GlobalVariables.d
67 lines (53 loc) · 1.57 KB
/
GlobalVariables.d
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
57
58
59
60
61
62
63
64
65
66
67
module GlobalVariables;
import ChunkManager;
import InputManager;
import NoiseManager;
import RenderManager;
import TextureManager;
import ThreadManager;
import GUIManager;
import IPlayer;
import LocalPlayer;
const static float blockHeight = 40.0f;
const static int blockHeightInt = cast(int)blockHeight;
const static float halfBlockHeight = blockHeight/2.0f;
const static int groundLevel = 64;
const static float moveSpeed = blockHeight * 5.0f;
const static int xResolution = 800;
const static int yResolution = 600;
const static int bitsPerPixel = 32;
const static bool fullscreen = false;
const static float fogDensity = blockHeight/40000.0f;
const static float fogColor[4] = [0.5295f, 0.8078f, 0.9804f, 1.0f];
shared NoiseManager noise;
ChunkManager chunk;
GUIManager gui;
RenderManager render;
ThreadManager thread;
InputManager input;
TextureManager texture;
IPlayer[] players;
LocalPlayer localPlayer;
//UGH, UGLY!!! TODO: Find a way around this...
shared ChunkManager chunkShared;
static shared class GV {
static bool init() {
thread = new ThreadManager();
render = new RenderManager();
noise = new shared(NoiseManager)();
chunk = new ChunkManager();
texture = new TextureManager();
input = new InputManager();
gui = new GUIManager();
chunkShared = cast(shared ChunkManager)chunk;
if(!render.init()) return false;
if(!input.init()) return false;
if(!noise.init()) return false;
if(!texture.init()) return false;
if(!chunk.init()) return false;
if(!thread.init()) return false;
render.generateFont();
if(!gui.init()) return false;
return true;
}
}