Skip to content

Commit c0f043d

Browse files
committed
Minor adjustments to launch process to be flexible enough for Testbed tests.
1 parent 3282021 commit c0f043d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cocos2d/Platforms/CCAppController.m

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,14 @@ - (void)setupApplication
7070
#endif
7171
}
7272

73-
// Override if you want to create your first scene somehow other than by loading a ccb file.
73+
/*
74+
Instantiate and return the first scene
75+
*/
7476
- (CCScene *)createFirstScene
7577
{
7678
return [CCBReader loadAsScene:self.firstSceneName];
7779
}
7880

79-
80-
/*
81-
Instantiate and return the first scene
82-
*/
8381
- (CCScene *)startScene
8482
{
8583
NSAssert(_glView.director, @"Require a valid director to decode the CCB file!");
@@ -99,10 +97,15 @@ - (NSDictionary*)iosConfig
9997
configPath = [configPath stringByAppendingPathComponent:@"configCocos2d.plist"];
10098

10199
NSMutableDictionary *config = [NSMutableDictionary dictionaryWithContentsOfFile:configPath];
102-
100+
if(config == nil){
101+
config = [NSMutableDictionary dictionary];
102+
}
103+
103104
// Fixed size. As wide as iPhone 5 at 2x and as high as the iPad at 2x.
104105
config[CCScreenModeFixedDimensions] = [NSValue valueWithCGSize:CGSizeMake(586, 384)];
105106

107+
[CCBReader configureCCFileUtils];
108+
106109
return config;
107110
}
108111

@@ -112,8 +115,6 @@ - (void)setupIOS
112115
{
113116
_cocosConfig = [self iosConfig];
114117

115-
[CCBReader configureCCFileUtils];
116-
117118
[self applyConfigurationToCocos:_cocosConfig];
118119
[self setFirstScene];
119120
}

0 commit comments

Comments
 (0)