|
@@ -13,6 +13,7 @@ from cocos import euclid
|
13
|
13
|
from cocos.audio.pygame import mixer
|
14
|
14
|
from cocos.layer import ScrollableLayer
|
15
|
15
|
from synergine2.config import Config
|
|
16
|
+from synergine2.exceptions import SynergineException
|
16
|
17
|
from synergine2.log import get_logger
|
17
|
18
|
from synergine2.terminals import Terminal
|
18
|
19
|
from synergine2.terminals import TerminalPackage
|
|
@@ -28,6 +29,7 @@ from synergine2_cocos2d.layer import LayerManager
|
28
|
29
|
from synergine2_cocos2d.middleware import MapMiddleware
|
29
|
30
|
from synergine2_cocos2d.middleware import TMXMiddleware
|
30
|
31
|
from synergine2_cocos2d.user_action import UserAction
|
|
32
|
+from synergine2_cocos2d.util import ensure_dir_exist
|
31
|
33
|
from synergine2_xyz.physics import Physics
|
32
|
34
|
from synergine2_xyz.xyz import XYZSubjectMixin
|
33
|
35
|
|
|
@@ -733,6 +735,15 @@ class Gui(object):
|
733
|
735
|
self.terminal = terminal
|
734
|
736
|
self.cycle_duration = self.config.resolve('core.cycle_duration')
|
735
|
737
|
|
|
738
|
+ # Manager cache directory
|
|
739
|
+ cache_dir_path = self.config.resolve('global.cache_dir_path')
|
|
740
|
+ if not cache_dir_path:
|
|
741
|
+ raise SynergineException(
|
|
742
|
+ 'This code require the "global.cache_dir_path" config',
|
|
743
|
+ )
|
|
744
|
+
|
|
745
|
+ ensure_dir_exist(cache_dir_path)
|
|
746
|
+
|
736
|
747
|
cocos.director.director.init(
|
737
|
748
|
width=640,
|
738
|
749
|
height=480,
|