Skip to content

Commit 9d2c296

Browse files
committed
Remove all resource callbacks
1 parent e687deb commit 9d2c296

File tree

1 file changed

+5
-42
lines changed

1 file changed

+5
-42
lines changed

demosys/resources/__init__.py

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,12 @@
2020
]
2121

2222

23-
class States:
24-
on_loaded_funcs = []
25-
on_load_funcs = []
26-
loaded = False
27-
28-
@classmethod
29-
def sort_callbacks(cls):
30-
cls.on_load_funcs = sorted(cls.on_load_funcs, key=lambda x: x[0])
31-
cls.on_loaded_funcs = sorted(cls.on_loaded_funcs, key=lambda x: x[0])
32-
33-
3423
def load():
35-
States.sort_callbacks()
36-
37-
for func in reversed(States.on_load_funcs):
38-
func[1]()
39-
40-
scenes.load()
41-
shaders.load()
42-
textures.load()
43-
tracks.load()
44-
data.load()
45-
46-
States.loaded = True
47-
for func in reversed(States.on_loaded_funcs):
48-
func[1]()
24+
scenes.load_pool()
25+
shaders.load_pool()
26+
textures.load_pool()
27+
data.load_pool()
4928

5029

5130
def count():
52-
return shaders.count + textures.count
53-
54-
55-
def loading_complete():
56-
return States.loaded
57-
58-
59-
def on_load(func, priority=0):
60-
States.on_load_funcs.append((priority, func))
61-
62-
63-
def on_loaded(func, priority=0):
64-
if loading_complete():
65-
func()
66-
return
67-
68-
States.on_loaded_funcs.append((priority, func))
31+
return scenes.count + shaders.count + textures.count + data.count

0 commit comments

Comments
 (0)