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 classes and file extensions to CCSB / .sb #1244

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions UnitTests/CCAnimationTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import <XCTest/XCTest.h>
#import "cocos2d.h"
#import "CCAnimationManager.h"
#import "CCBSequence.h"
#import "CCBKeyframe.h"
#import "CCSequence.h"
#import "CCKeyframe.h"
#import "CCAnimationManager_Private.h"

#define NUM_ELEMENTS(array) (sizeof(array)/sizeof(array[0]))
Expand Down Expand Up @@ -60,14 +60,14 @@ - (void)testSmallKeyframesTest
node.position = ccp(0.0f,0.0f);


CCBSequence* seq = [[CCBSequence alloc] init];
CCSequence* seq = [[CCSequence alloc] init];
seq.duration = 5.0f;
seq.name = @"TestSequence";
seq.sequenceId = 0;
seq.chainedSequenceId = 0;
[animationManager.sequences addObject:seq];

CCBSequenceProperty* seqProp = [[CCBSequenceProperty alloc] init];
CCSequenceProperty* seqProp = [[CCSequenceProperty alloc] init];

seqProp.name = @"position";
seqProp.type = 0;
Expand All @@ -84,10 +84,10 @@ - (void)testSmallKeyframesTest

for (int k = 0; k < numKeyframes; k++)
{
CCBKeyframe* keyframe = [[CCBKeyframe alloc] init];
CCKeyframe* keyframe = [[CCKeyframe alloc] init];
keyframe.time = (float)k * seq.duration / (float)(numKeyframes - 1);

keyframe.easingType = kCCBKeyframeEasingLinear;
keyframe.easingType = kCCKeyframeEasingLinear;
keyframe.easingOpt = 0;
keyframe.value = points[k];

Expand Down Expand Up @@ -145,18 +145,18 @@ - (void)testSmallKeyframesTest

const int kSequencerID = 0; //for now;

CCBSequenceProperty* seqProp = [[CCBSequenceProperty alloc] init];
CCSequenceProperty* seqProp = [[CCSequenceProperty alloc] init];

seqProp.name = @"position";
seqProp.type = 0;


for (int k = 0; k < count; k++)
{
CCBKeyframe* keyframe = [[CCBKeyframe alloc] init];
CCKeyframe* keyframe = [[CCKeyframe alloc] init];
keyframe.time = keyframes[k].time;

keyframe.easingType = kCCBKeyframeEasingLinear;
keyframe.easingType = kCCKeyframeEasingLinear;
keyframe.easingOpt = 0;
keyframe.value = @[@(keyframes[k].position.x),@(keyframes[k].position.y)];

Expand All @@ -175,7 +175,7 @@ - (void)testSmallKeyframesTest
- (void)testAnimationSync
{
CCAnimationManager * animationManager = [[CCAnimationManager alloc] init];
CCBSequence* seq = [[CCBSequence alloc] init];
CCSequence* seq = [[CCSequence alloc] init];
seq.duration = 4.0f;
seq.name = @"TestSequence";
seq.sequenceId = 0;
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/CCPackageCocos2dEnablerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "CCPackage.h"
#import "CCFileUtils.h"
#import "CCSprite.h"
#import "CCBReader.h"
#import "CCSBReader.h"
#import "AppDelegate.h"
#import "CCPackage_private.h"
#import "CCPackageHelper.h"
Expand Down
6 changes: 3 additions & 3 deletions UnitTests/CCPhysicsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1044,12 +1044,12 @@ -(void)testKineticNodeActionsAdvanced1
[scheduler update:0.10f]; // first tick is always ignored, the action is not run.
[scheduler update:0.10f]; // second tick runs the action at time zero, regardless of the delta time.

const float accuracy = 1e-3;
// const float accuracy = 1e-3;
//test actions are fixed.
for(int i = 0; i < 10; i++)
{
float desired = (float)i * 0.1f * 100.0f/10.0f + (float)i * 0.1f * 200.0f/10.0f;
NSLog(@"node1.position.x= %0.2f desired = %0.2f",body1.absolutePosition.x, desired);
// float desired = (float)i * 0.1f * 100.0f/10.0f + (float)i * 0.1f * 200.0f/10.0f;
// NSLog(@"node1.position.x= %0.2f desired = %0.2f",body1.absolutePosition.x, desired);
// XCTAssertEqualWithAccuracy(body1.absolutePosition.x, desired, accuracy, @"Not in the right position");
[scheduler update:0.10f];
}
Expand Down
8 changes: 4 additions & 4 deletions UnitTests/CCReaderTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <XCTest/XCTest.h>
#import "cocos2d.h"
#import "CCBReader.h"
#import "CCSBReader.h"
#include <mach/mach.h>
#include <mach/mach_time.h>

Expand Down Expand Up @@ -56,17 +56,17 @@ - (void)setUp
-(void)testReaderPerformance
{
/*
NSString *filePath =[[NSBundle mainBundle] pathsForResourcesOfType:@"ccbi" inDirectory:@"Resources-shared/Tests"][0];
NSString *filePath =[[NSBundle mainBundle] pathsForResourcesOfType:@"sbi" inDirectory:@"Resources-shared/Tests"][0];
XCTAssertNotNil(filePath);

NSData * fileData = [[NSData alloc] initWithContentsOfFile:filePath];

CCBReader * ccbReader = [[CCBReader alloc] init];
CCSBReader * CCSBReader = [[CCSBReader alloc] init];

machGetClockDiffS();
for (int i = 0; i < 100; i++)
{
[ccbReader loadWithData:fileData owner:self];
[CCSBReader loadWithData:fileData owner:self];
}

NSLog(@"TimeToRun: %0.8f", machGetClockDiffS());
Expand Down
2 changes: 1 addition & 1 deletion UnitTests/CCTextureTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import "cocos2d.h"

#import "CCTextureCache.h"
#import "CCBReader.h"
#import "CCSBReader.h"
#import "AppDelegate.h"

@interface CCTextureTests : XCTestCase
Expand Down
6 changes: 4 additions & 2 deletions cocos2d-tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
75C72C091A82AD7900814F60 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 75C72C031A82AD6600814F60 /* main.m */; };
75C72C0A1A82AD7B00814F60 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 75C72C021A82AD6600814F60 /* AppDelegate.m */; };
75DAC8B11A4240BE003F8244 /* CCImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 75DAC8B01A4240BE003F8244 /* CCImageTests.m */; };
75DCC9DA1A9285C7003F0592 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 758A6C6B1843E5C500D1A8D2 /* Images */; };
75F4EA251A69847C000E637B /* CCActionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 75F4EA241A69847C000E637B /* CCActionsTest.m */; };
75F76497185A831B00E2FAFE /* Sounds in Resources */ = {isa = PBXBuildFile; fileRef = 75F76496185A831B00E2FAFE /* Sounds */; };
75F9BF5E1A38EE8C009185BF /* CCViewportNodeTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D35C2D261A1BC83F00FF96B0 /* CCViewportNodeTest.m */; };
Expand Down Expand Up @@ -383,7 +384,7 @@
75F76496185A831B00E2FAFE /* Sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Sounds; path = Resources/Sounds; sourceTree = SOURCE_ROOT; };
830F10971A6D37D50074F583 /* OCMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OCMock.xcodeproj; path = external/OCMock/Source/OCMock.xcodeproj; sourceTree = "<group>"; };
839B149E19CC1E440000E5E2 /* CCPackageTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CCPackageTest.m; path = "cocos2d-ui-tests/tests/CCPackageTest.m"; sourceTree = SOURCE_ROOT; };
92324E2918EB635500D78D3F /* CCReaderTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCReaderTest.m; sourceTree = "<group>"; };
92324E2918EB635500D78D3F /* CCReaderTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCReaderTest.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
92FE241018F5F06F00647961 /* CCAnimationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimationTest.m; sourceTree = "<group>"; };
9D96557219D6113500428E79 /* CCEffectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEffectTests.m; sourceTree = "<group>"; };
A6167B92189A7D4D0044D391 /* VertexZTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VertexZTest.m; path = "cocos2d-ui-tests/tests/VertexZTest.m"; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -532,7 +533,7 @@
E525F98589D25C8CCF99E8B6 /* CCFileLocatorDatabaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCFileLocatorDatabaseTests.m; sourceTree = "<group>"; };
E525F99055258F35DFF00ECD /* CCPackageHelperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPackageHelperTests.m; sourceTree = "<group>"; };
E525FB2B6BB1C2E3BD1457A7 /* CCUnitTestHelperMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUnitTestHelperMacros.h; sourceTree = "<group>"; };
E525FB8A3CC89D071A8377B1 /* CCPackageCocos2dEnablerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPackageCocos2dEnablerTests.m; sourceTree = "<group>"; };
E525FB8A3CC89D071A8377B1 /* CCPackageCocos2dEnablerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCPackageCocos2dEnablerTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E525FBE3FAFA47AD441E6E03 /* FileSystemTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemTestCase.h; sourceTree = "<group>"; };
E525FBF58DFECF27272F5D6F /* CCPackageInstallerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPackageInstallerTests.m; sourceTree = "<group>"; };
E525FCB52B23A4F29E8D6D64 /* CCPackagesTestFixturesAndHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPackagesTestFixturesAndHelpers.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1142,6 +1143,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
75DCC9DA1A9285C7003F0592 /* Images in Resources */,
9269312A1923D8A700CE6285 /* Resources-shared in Resources */,
75556A1B1856374700ED1B0F /* InfoPlist.strings in Resources */,
75556A15185636FB00ED1B0F /* powered.png in Resources */,
Expand Down
2 changes: 1 addition & 1 deletion cocos2d-ui-tests/ios/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)configureFileUtilsSearchPathAndRegisterSpriteSheets
[[NSUserDefaults standardUserDefaults] synchronize];

// The testbed uses a different directory dictionary than is created by the default CCFileUtils constructor- it uses the file utils one
[CCBReader configureCCFileUtils];
[CCSBReader configureCCFileUtils];
CCFileUtils* sharedFileUtils = [CCFileUtils sharedFileUtils];

// Testbed needs special directory search paths:
Expand Down
2 changes: 1 addition & 1 deletion cocos2d-ui/CCBReader/CCAnimationManager+FrameAnimation.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)animationWithSpriteFrames:animFrames delay:(float)delay name:(NSString*)
[keyFrames addObject:frameDict];

// Add Animation Sequence
[self addKeyFramesForSequenceNamed:name propertyType:CCBSequencePropertyTypeSpriteFrame frameArray:keyFrames node:node loop:loop];
[self addKeyFramesForSequenceNamed:name propertyType:CCSequencePropertyTypeSpriteFrame frameArray:keyFrames node:node loop:loop];
}

#pragma mark Legacy Animation Support
Expand Down
10 changes: 5 additions & 5 deletions cocos2d-ui/CCBReader/CCAnimationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
@class CCNode;


@class CCBSequence;
@class CCSequence;

#pragma mark Animation Manager Delegate

/**
The animation manager delegate receives callbacks when animation sequences finishes playing.
Used by CCAnimationManager.
*/
@protocol CCBAnimationManagerDelegate <NSObject>
@protocol CCAnimationManagerDelegate <NSObject>

/**
* Called when an animation sequence has finished playing.
Expand All @@ -60,8 +60,8 @@
NSMutableDictionary* _baseValues;

NSString *_animationManagerId;
CCBSequence* _runningSequence;
CCBSequence* _lastSequence;
CCSequence* _runningSequence;
CCSequence* _lastSequence;

void (^block)(id sender);

Expand Down Expand Up @@ -130,6 +130,6 @@

/// The animation manager delegate receives updates about the animation playback state.
/// @see CCBAnimationManagerDelegate
@property (nonatomic,weak) NSObject<CCBAnimationManagerDelegate>* delegate;
@property (nonatomic,weak) NSObject<CCAnimationManagerDelegate>* delegate;

@end
Loading