File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11
11
#import " CCPackageManagerDelegate.h"
12
12
#import " CCPackage.h"
13
13
#import " CCPackageConstants.h"
14
- #import " AppDelegate.h"
15
14
16
15
17
16
@interface CCPackageTest : TestBase <CCPackageManagerDelegate>
@@ -83,7 +82,21 @@ - (void)removeAllPackages
83
82
84
83
- (void )resetCocos2d
85
84
{
86
- [(AppController *) [UIApplication sharedApplication ].delegate configureFileUtilsSearchPathAndRegisterSpriteSheets ];
85
+ // on android, we can't rely on UIKit (eg, -[UIApplication delegate], so don't.
86
+ CCFileUtils* sharedFileUtils = [CCFileUtils sharedFileUtils ];
87
+
88
+ sharedFileUtils.searchPath =
89
+ [NSArray arrayWithObjects:
90
+ [[[NSBundle mainBundle ] resourcePath ] stringByAppendingPathComponent: @" Images" ],
91
+ [[[NSBundle mainBundle ] resourcePath ] stringByAppendingPathComponent: @" Fonts" ],
92
+ [[[NSBundle mainBundle ] resourcePath ] stringByAppendingPathComponent: @" Resources-shared" ],
93
+ [[NSBundle mainBundle ] resourcePath ],
94
+ nil ];
95
+
96
+ // Register spritesheets.
97
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Interface.plist" ];
98
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Sprites.plist" ];
99
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" TilesAtlassed.plist" ];
87
100
}
88
101
89
102
- (void )cleanDirectories
You can’t perform that action at this time.
0 commit comments