Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename .ccb, .ccbi, and .ccbproj extensions to .sb, .sbi, .sbproj #1368

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6b1ef3f
Update template.
rkachowski Jan 23, 2015
0c12b50
Move Controller file in template.
rkachowski Jan 23, 2015
637ae67
Refactor file renaming / interpolation within CCBProjectCreator.
rkachowski Jan 23, 2015
ac3c624
Fixing template creation for iOS.
rkachowski Jan 23, 2015
13b5ad7
Refer to AppDelegate in main.m and expose AppController class methods.
rkachowski Jan 23, 2015
44a2b3c
Update Controller formatting.
rkachowski Feb 4, 2015
f035c2d
Extracting references to .ccb files to constants. No renaming yet.
andykorth Feb 17, 2015
4ada7f4
Flip the switch to .sb and .sbi files.
andykorth Feb 17, 2015
13ce514
Rename template main scene
andykorth Feb 18, 2015
d4d5d6c
Fix SB to build with my cocos2d branch
andykorth Feb 18, 2015
078cd03
Fixing more ccb extension references.
andykorth Feb 18, 2015
00abf6c
Hard code exporter so the 'ccbi' stored in the preferences won't be u…
andykorth Feb 18, 2015
f7ee868
Change file type associations.
andykorth Feb 18, 2015
c7fb075
Moving template files
andykorth Feb 18, 2015
1f4e1b1
Update Spritebuilder tests to compile.
andykorth Feb 18, 2015
5584bc1
SB can read both .ccbproj and .sbproj files, but creates only .sbproj…
andykorth Feb 19, 2015
b96fa0c
Fixes for opening .sbproj, better error display when failing to load …
andykorth Feb 19, 2015
6b20cd1
Update unit test assets. All tests are passing!
andykorth Feb 19, 2015
4df4c2c
update cocos2d submodule to point at the correct cocos2d commit in a …
andykorth Feb 20, 2015
414d2ce
Fix issue caused by rebase merge conflicts
andykorth Feb 23, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion SpriteBuilder/Cocos2D iPhone/CCBXCocos2diPhone.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

#import "CCBXCocos2diPhone.h"
#import "CCBBinaryWriter.h"
#import "ProjectSettings.h"

@implementation CCBXCocos2diPhone

- (NSString*) extension
{
return @"ccbi";
return kCCBDefaultExportPlugIn;
}

- (NSData *)exportDocument:(NSDictionary *)doc
Expand Down
18 changes: 9 additions & 9 deletions SpriteBuilder/SpriteBuilder Tests/CCAnimation_Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#import "CCBXCocos2diPhone.h"
#import "PlugInManager.h"
#import "PlugInExport.h"
#import "CCBReader.h"
#import "CCSBReader.h"
#import "CCAnimationManager.h"
#import "CCAnimationManager_Private.h"
#import "CCBSequence.h"
#import "CCSequence.h"
#import "Cocos2dTestHelpers.h"

#define IS_NEAR(a,b,accuracy) (fabsf(a - b) < kAccuracy)
Expand All @@ -25,15 +25,15 @@

@implementation CCAnimationManager (Test)

-(CCBSequence*)runningSequence
-(CCSequence*)runningSequence
{
return _runningSequence;
}

@end

typedef void (^CallbackBlock) ();
@interface CCAnimationDelegateTester : NSObject<CCBAnimationManagerDelegate>
@interface CCAnimationDelegateTester : NSObject<CCAnimationManagerDelegate>
{
CallbackBlock _sequenceFinished;
}
Expand Down Expand Up @@ -148,7 +148,7 @@ - (void)testAnimationSync1
float totalElapsed = 0.0f;
__block float currentAnimElapsed = 0.0f;

CCBSequence * seq = rootNode.animationManager.sequences[0];
CCSequence * seq = rootNode.animationManager.sequences[0];

[rootNode.animationManager setCompletedAnimationCallbackBlock:^(CCAnimationManager * manager) {
XCTAssertTrue(fabsf(currentAnimElapsed - seq.duration) < kAccuracy, @"The animation should have taken 4 seconds. Possible divergenc.");
Expand Down Expand Up @@ -193,7 +193,7 @@ -(void)testAnimationCallback1
CCBReader * reader = [CCBReader reader];
CCNode * rootNode = [reader loadWithData:animData owner:callbackTest];

CCBSequence * seq = rootNode.animationManager.sequences[0];
CCSequence * seq = rootNode.animationManager.sequences[0];
rootNode.animationManager.delegate = callbackTest;


Expand Down Expand Up @@ -252,7 +252,7 @@ -(void)testAnimationTween1

XCTAssertTrue([node0.name isEqualToString:@"node0"]);

CCBSequence * seq = rootNode.animationManager.sequences[0];
CCSequence * seq = rootNode.animationManager.sequences[0];
rootNode.animationManager.delegate = callbackTest;

const CGFloat kXTranslation = 500.0f;
Expand Down Expand Up @@ -392,7 +392,7 @@ -(void)testAnimationLoop1

XCTAssertTrue([node0.name isEqualToString:@"node0"]);

CCBSequence * seq = rootNode.animationManager.sequences[0];
CCSequence * seq = rootNode.animationManager.sequences[0];
rootNode.animationManager.delegate = callbackHelper;

const CGFloat kXTranslation = 500.0f;
Expand Down Expand Up @@ -455,7 +455,7 @@ -(void)testAnimationSeeking1

XCTAssertTrue([node0.name isEqualToString:@"node0"]);

CCBSequence * seq = rootNode.animationManager.sequences[0];
CCSequence * seq = rootNode.animationManager.sequences[0];

const CGFloat kXTranslation = 500.0f;

Expand Down
4 changes: 2 additions & 2 deletions SpriteBuilder/SpriteBuilder Tests/CCBDictionaryReader_Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "CCLayoutBox.h"
#import "SBErrors.h"
#import "CCBDictionaryKeys.h"

#import "ProjectSettings.h"

@interface CCBDictionaryReader_Tests : XCTestCase

Expand Down Expand Up @@ -552,7 +552,7 @@ - (void)testNodeGraphFromDocumentDict_physicsnode
- (NSDictionary *)loadCCBFile:(NSString *)ccbName
{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *path = [bundle pathForResource:ccbName ofType:@"ccb"];
NSString *path = [bundle pathForResource:ccbName ofType:kCCBDefaultExtension];

XCTAssertNotNil(path, @"CCB file loading failed, no path found for ccb %@.ccb", ccbName);

Expand Down
4 changes: 2 additions & 2 deletions SpriteBuilder/SpriteBuilder Tests/CCBPublisher_Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ - (void)testPublishCCBs
sequenceId:0];

NSMutableDictionary *doc = [documentCreator createData];
[doc writeToFile:[self fullPathForFile:@"baa.spritebuilder/Packages/foo.sbpack/mainScene.ccb"] atomically:YES];
[doc writeToFile:[self fullPathForFile:@"baa.spritebuilder/Packages/foo.sbpack/mainScene.sb"] atomically:YES];

[_publisher addPublishingTarget:_targetIOS];
[_publisher start];

[self assertFileExists:@"Published-iOS/mainScene.ccbi"];
[self assertFileExists:@"Published-iOS/mainScene.sbi"];
}

- (void)testCustomScalingFactorsForImages
Expand Down
2 changes: 1 addition & 1 deletion SpriteBuilder/SpriteBuilder Tests/CCBReader_EffectsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <XCTest/XCTest.h>
#import "Cocos2dTestHelpers.h"
#import "CCBReader.h"
#import "CCSBReader.h"

@interface CCBReader_EffectsTest : XCTestCase

Expand Down
4 changes: 2 additions & 2 deletions SpriteBuilder/SpriteBuilder Tests/CCBReader_Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import <XCTest/XCTest.h>
#import "CCBBinaryWriter.h"
#import "CCBReader_Private.h"
#import "Cocos2dTestHelpers.h"
#import "CCSBReader_Private.h"

@interface CCBReader_Tests : XCTestCase

Expand All @@ -31,7 +31,7 @@ - (void)tearDown

- (void)testCCBVersionCompatibility
{
XCTAssertEqual(kCCBVersion, kCCBBinaryVersion, @"CCB version %d read by CCBReader is incompatible with version %d written by SpriteBuilder. Is cocos2d up to date?", kCCBVersion, kCCBBinaryVersion);
XCTAssertEqual(kCCVersion, kCCBBinaryVersion, @"SB version %d read by CCSBReader is incompatible with version %d written by SpriteBuilder. Is cocos2d up to date?", kCCVersion, kCCBBinaryVersion);
}

@end
4 changes: 2 additions & 2 deletions SpriteBuilder/SpriteBuilder Tests/ProjectSettings_Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ - (void)testInitWithDictionary
@"publishEnvironment":@(0),
@"publishEnablediPhone":@(YES),
@"publishToZipFile":@(NO),
@"exporter":@"ccbi",
@"exporter":kCCBDefaultExportPlugIn,
@"versionStr":@"Version: 1.x\n-n GitHub: \nfcec170fc2\n",
@"publishResolution_ios_phone":@(YES),
@"publishResolution_ios_tablethd":@(YES),
Expand Down Expand Up @@ -268,7 +268,7 @@ - (void)testInitWithDictionary
XCTAssertEqual(project.designTarget, 0);

XCTAssertEqual(project.engine, CCBTargetEngineCocos2d);
SBAssertStringsEqual(project.exporter, @"ccbi");
SBAssertStringsEqual(project.exporter, kCCBDefaultExportPlugIn);

XCTAssertFalse(project.publishToZipFile);
XCTAssertEqual(project.publishEnvironment, kCCBPublishEnvironmentDevelop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import <Foundation/Foundation.h>
#import "CCDeprecated.h"

@interface Cocos2dTestHelpers : NSObject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
#import "Cocos2dTestHelpers.h"
#import "PlugInManager.h"
#import "PlugInExport.h"
#import "ProjectSettings.h"

@implementation Cocos2dTestHelpers


+(NSData*)readCCB:(NSString*)srcFileName
{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *path = [bundle pathForResource:srcFileName ofType:@"ccb"];
NSString *path = [bundle pathForResource:srcFileName ofType:kCCBDefaultExtension];
NSDictionary * doc = [NSDictionary dictionaryWithContentsOfFile:path];
NSAssert(doc, @"Can't find animation File %@",srcFileName);
if(doc == nil)
return nil;

PlugInExport *plugIn = [[PlugInManager sharedManager] plugInExportForExtension:@"ccbi"];
PlugInExport *plugIn = [[PlugInManager sharedManager] plugInExportForExtension:kCCBDefaultExportPlugIn];
NSData *data = [plugIn exportDocument:doc];
return data;
}
Expand Down
Loading