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 1111#import " CCPackageManagerDelegate.h"
1212#import " CCPackage.h"
1313#import " CCPackageConstants.h"
14- #import " AppDelegate.h"
1514
1615
1716@interface CCPackageTest : TestBase <CCPackageManagerDelegate>
@@ -83,7 +82,21 @@ - (void)removeAllPackages
8382
8483- (void )resetCocos2d
8584{
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" ];
87100}
88101
89102- (void )cleanDirectories
You can’t perform that action at this time.
0 commit comments