-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·56 lines (45 loc) · 1.68 KB
/
main.py
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
#! /usr/bin/env python
import sys
import os
import threading
from World import World
from RenderWorld import RenderWorld
from ThreadTransaction import ThreadTransaction
if __name__ == '__main__':
if len(sys.argv) == 2:
for i in range(1, len(sys.argv)):
if sys.argv[i].startswith('n'):
os.system('rm data/textures/maps/*')
os.system('rm data/heightmaps/maps/*')
print 'Removing maps'
trans = ThreadTransaction()
r = RenderWorld(trans)
w = World(r, trans, False)
w.create_world()
r.set_up()
background_thread = threading.Thread(target=w.start)
background_thread.start()
r.start_loop()
elif sys.argv[i].startswith('i'):
os.system('rm data/textures/maps/*')
os.system('rm data/heightmaps/maps/*')
trans = ThreadTransaction()
r = RenderWorld(trans)
w = World(r, trans, True)
w.create_world()
r.set_up()
background_thread = threading.Thread(target=w.start)
background_thread.start()
r.start_loop()
else:
trans = ThreadTransaction()
r = RenderWorld(trans)
w = World(r, trans, True)
w.create_world()
r.set_up()
background_thread = threading.Thread(target=w.start)
#graphic_thread = threading.Thread(target=r.start_loop)
background_thread.start()
r.start_loop()
#graphic_thread.start()
#RENDER = RenderWorld(None)