File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,6 @@ - (id) init
70
70
self = [super init ];
71
71
if (!self) return NULL ;
72
72
73
- // Load resources
74
- [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Interface.plist" ];
75
- [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Sprites.plist" ];
76
- [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" TilesAtlassed.plist" ];
77
-
78
73
// Make the node the same size as the parent container (i.e. the screen)
79
74
self.contentSizeType = CCSizeTypeNormalized;
80
75
self.contentSize = CGSizeMake (1 , 1 );
Original file line number Diff line number Diff line change 26
26
27
27
#import " AppDelegate.h"
28
28
#import " MainMenu.h"
29
+ #import " TestBase.h"
29
30
30
31
@implementation AppController
31
32
@@ -44,6 +45,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
44
45
[[NSBundle mainBundle ] resourcePath ],
45
46
nil ];
46
47
48
+ // Register spritesheets.
49
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Interface.plist" ];
50
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" Sprites.plist" ];
51
+ [[CCSpriteFrameCache sharedSpriteFrameCache ] registerSpriteFramesFile: @" TilesAtlassed.plist" ];
52
+
47
53
[self setupCocos2dWithOptions: @{
48
54
CCSetupDepthFormat: @GL_DEPTH24_STENCIL8,
49
55
CCSetupTabletScale2X: @YES ,
@@ -57,7 +63,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
57
63
58
64
- (CCScene*) startScene
59
65
{
60
- return [MainMenu scene ];
66
+ const char *testName = getenv (" Test" );
67
+
68
+ if (testName){
69
+ return [TestBase sceneWithTestName: [NSString stringWithCString: testName encoding: NSUTF8StringEncoding]];
70
+ } else {
71
+ return [MainMenu scene ];
72
+ }
61
73
}
62
74
63
75
// // I'm going to leave this in for testing the fixed size screen mode in the future.
Original file line number Diff line number Diff line change @@ -75,4 +75,16 @@ -(void) setupTilemap5Test
75
75
[self .contentNode addChild: scroll];
76
76
}
77
77
78
+ -(void ) setupTilemap6Test
79
+ {
80
+ self.subTitle = @" TileMaps/iso-test-bug787.tmx" ;
81
+
82
+ CCNode *map = [CCTiledMap tiledMapWithFile: self .subTitle];
83
+ CCScrollView *scroll = [[CCScrollView alloc ] initWithContentNode: map];
84
+ scroll.flipYCoordinates = NO ;
85
+
86
+ [self .contentNode addChild: scroll];
87
+ scroll.scrollPosition = ccp (map.contentSizeInPoints .width /2 - scroll.contentSizeInPoints .width /2 , 0 );
88
+ }
89
+
78
90
@end
You can’t perform that action at this time.
0 commit comments