Skip to content

Commit 17da75a

Browse files
committed
Merge pull request #1370 from oxeron/develop-v3.5-ext
Header modifications for -ext
2 parents 1911148 + e456079 commit 17da75a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+479
-918
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please note, that the official site has moved. Please update your bookmarks
1414
[The Official Forum][3]
1515

1616
[Cocos2D-ObjC][1] is a framework for building 2D games, demos, and other
17-
graphical/interactive applications for iOS, Mac and Android.
17+
graphical/interactive applications for iOS, Mac and tvOS.
1818
It is based on the [Cocos2D][2] design, but instead of using Python it uses Swift and / or Objective-C.
1919

2020
Cocos2D-ObjC is:

cocos2d-ext/CCBReader/CCAnimationManager+FrameAnimation.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import "CCAnimationManager+FrameAnimation.h"
10-
#import "CCAnimationManager_Private.h"
10+
#import "CCAnimationManager.h"
1111

1212
@implementation CCAnimationManager (FrameAnimation)
1313

cocos2d-ext/CCBReader/CCAnimationManager.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424

2525
#import <Foundation/Foundation.h>
26-
#import "cocos2d.h"
2726
#import "CCBSequenceProperty.h"
2827

2928
@class CCBSequence;
@@ -130,4 +129,35 @@
130129
/// @see CCBAnimationManagerDelegate
131130
@property (nonatomic,weak) NSObject<CCBAnimationManagerDelegate>* delegate;
132131

132+
// Sequence Array
133+
@property (nonatomic,readonly) NSMutableArray* sequences;
134+
135+
136+
// Auto play sequence id.
137+
@property (nonatomic,assign) int autoPlaySequenceId;
138+
139+
// Base node.
140+
@property (nonatomic,unsafe_unretained) CCNode* rootNode;
141+
142+
// (CCB) Optional owner
143+
@property (nonatomic,unsafe_unretained) id owner;
144+
145+
// (CCB) Resolution and default container size.
146+
@property (nonatomic,assign) CGSize rootContainerSize;
147+
148+
// (CCB) Node Management
149+
- (CGSize) containerSize:(CCNode*)node;
150+
- (void) addNode:(CCNode*)node andSequences:(NSDictionary*)seq;
151+
- (void) moveAnimationsFromNode:(CCNode*)fromNode toNode:(CCNode*)toNode;
152+
153+
// Reset node state.
154+
- (void) setBaseValue:(id)value forNode:(CCNode*)node propertyName:(NSString*)propName;
155+
156+
- (void) runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuration;
157+
158+
- (void)timeSeekForSequenceId:(int)seqId time:(float)time;
159+
160+
#pragma mark Simple Sequence Builder
161+
- (void)addKeyFramesForSequenceNamed:(NSString*)name propertyType:(CCBSequencePropertyType)propertyType frameArray:(NSArray*)frameArray node:(CCNode *)node loop:(BOOL)loop;
162+
133163
@end

cocos2d-ext/CCBReader/CCAnimationManager.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424

2525
#import "CCAnimationManager.h"
26-
#import "CCAnimationManager_Private.h"
2726
#import "CCBKeyframe.h"
2827
#import "CCBSequence.h"
2928
#import "CCBSequenceProperty.h"
@@ -32,9 +31,17 @@
3231
#import <objc/runtime.h>
3332

3433
#import "CCDirector.h"
35-
#import "CCBReader_Private.h"
34+
#import "CCBReader.h"
3635
#import "CCActionManager.h"
3736

37+
#if CC_LIGHTING
38+
#import "CCLightNode.h"
39+
#endif
40+
41+
#if CC_OBJECT_AL
42+
#import "CCActionAudio.h"
43+
#endif
44+
3845
// Unique Manager ID
3946
static NSInteger ccbAnimationManagerID = 0;
4047

cocos2d-ext/CCBReader/CCAnimationManager_Private.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

cocos2d-ext/CCBReader/CCBReader.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,89 @@
6060
6161
Nodes created from a SpriteBuilder document will also have a valid CCAnimationManager instance assigned to their [CCNode animationManager] property.
6262
*/
63+
64+
#define kCCBVersion 10
65+
66+
enum {
67+
kCCBPropTypePosition = 0,
68+
kCCBPropTypeSize,
69+
kCCBPropTypePoint,
70+
kCCBPropTypePointLock,
71+
kCCBPropTypeScaleLock,
72+
kCCBPropTypeDegrees,
73+
kCCBPropTypeInteger,
74+
kCCBPropTypeFloat,
75+
kCCBPropTypeFloatVar,
76+
kCCBPropTypeCheck,
77+
kCCBPropTypeSpriteFrame,
78+
kCCBPropTypeTexture,
79+
kCCBPropTypeByte,
80+
kCCBPropTypeColor3,
81+
kCCBPropTypeColor4FVar,
82+
kCCBPropTypeFlip,
83+
kCCBPropTypeBlendmode,
84+
kCCBPropTypeFntFile,
85+
kCCBPropTypeText,
86+
kCCBPropTypeFontTTF,
87+
kCCBPropTypeIntegerLabeled,
88+
kCCBPropTypeBlock,
89+
kCCBPropTypeAnimation,
90+
kCCBPropTypeCCBFile,
91+
kCCBPropTypeString,
92+
kCCBPropTypeBlockCCControl,
93+
kCCBPropTypeFloatScale,
94+
kCCBPropTypeFloatXY,
95+
kCCBPropTypeColor4,
96+
kCCBPropTypeNodeReference,
97+
kCCBPropTypeFloatCheck,
98+
kCCBPropTypeEffects,
99+
kCCBPropTypeTokenArray
100+
};
101+
102+
enum {
103+
kCCBFloat0 = 0,
104+
kCCBFloat1,
105+
kCCBFloatMinus1,
106+
kCCBFloat05,
107+
kCCBFloatInteger,
108+
kCCBFloatFull
109+
};
110+
111+
enum {
112+
kCCBPlatformAll = 0,
113+
kCCBPlatformIOS,
114+
kCCBPlatformMac
115+
};
116+
117+
enum {
118+
kCCBTargetTypeNone = 0,
119+
kCCBTargetTypeDocumentRoot = 1,
120+
kCCBTargetTypeOwner = 2,
121+
};
122+
123+
enum
124+
{
125+
kCCBKeyframeEasingInstant,
126+
127+
kCCBKeyframeEasingLinear,
128+
129+
kCCBKeyframeEasingCubicIn,
130+
kCCBKeyframeEasingCubicOut,
131+
kCCBKeyframeEasingCubicInOut,
132+
133+
kCCBKeyframeEasingElasticIn,
134+
kCCBKeyframeEasingElasticOut,
135+
kCCBKeyframeEasingElasticInOut,
136+
137+
kCCBKeyframeEasingBounceIn,
138+
kCCBKeyframeEasingBounceOut,
139+
kCCBKeyframeEasingBounceInOut,
140+
141+
kCCBKeyframeEasingBackIn,
142+
kCCBKeyframeEasingBackOut,
143+
kCCBKeyframeEasingBackInOut,
144+
};
145+
63146
@interface CCBReader : NSObject
64147
{
65148
NSData* data;

cocos2d-ext/CCBReader/CCBReader.m

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@
3232
#import "CCBSequenceProperty.h"
3333
#import "CCBKeyframe.h"
3434
#import "CCBLocalizationManager.h"
35-
#import "CCBReader_Private.h"
35+
#import "CCBReader.h"
3636
#import "CCNode.h"
3737
#import "CCDirector.h"
3838
#if CC_PHYSICS
3939
#import "CCPhysics+ObjectiveChipmunk.h"
4040
#endif
41-
#import "CCAnimationManager_Private.h"
4241
#if CC_EFFECTS
4342
#import "CCEffectStack.h"
4443
#endif
@@ -95,20 +94,12 @@ + (void) configureCCFileUtils
9594
@"resources-phonehd", CCFileUtilsSuffixMacHD,
9695
@"", CCFileUtilsSuffixDefault,
9796
nil];
98-
99-
#if __CC_PLATFORM_ANDROID
100-
sharedFileUtils.searchPath =
101-
[NSArray arrayWithObjects:
102-
[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Published-Android"],
103-
[[NSBundle mainBundle] resourcePath],
104-
nil];
105-
#else
97+
10698
sharedFileUtils.searchPath =
10799
[NSArray arrayWithObjects:
108100
[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Published-iOS"],
109101
[[NSBundle mainBundle] resourcePath],
110102
nil];
111-
#endif
112103

113104
sharedFileUtils.enableiPhoneResourcesOniPad = YES;
114105
sharedFileUtils.searchMode = CCFileUtilsSearchModeDirectory;
@@ -420,7 +411,7 @@ - (void) readPropertyForNode:(CCNode*) node parent:(CCNode*)parent isExtraProp:(
420411

421412
if (setProp)
422413
{
423-
#if __CC_PLATFORM_IOS || __CC_PLATFORM_ANDROID
414+
#if __CC_PLATFORM_IOS
424415
[node setValue:[NSValue valueWithCGPoint:ccp(x,y)] forKey:name];
425416
#elif __CC_PLATFORM_MAC
426417
[node setValue:[NSValue valueWithPoint:ccp(x,y)] forKey:name];
@@ -455,7 +446,7 @@ - (void) readPropertyForNode:(CCNode*) node parent:(CCNode*)parent isExtraProp:(
455446
if (setProp)
456447
{
457448
CGPoint pt = ccp(x,y);
458-
#if __CC_PLATFORM_IOS || __CC_PLATFORM_ANDROID
449+
#if __CC_PLATFORM_IOS
459450
[node setValue:[NSValue valueWithCGPoint:pt] forKey:name];
460451
#else
461452
[node setValue:[NSValue valueWithPoint:NSPointFromCGPoint(pt)] forKey:name];
@@ -476,7 +467,7 @@ - (void) readPropertyForNode:(CCNode*) node parent:(CCNode*)parent isExtraProp:(
476467
if (setProp)
477468
{
478469
CGSize size = CGSizeMake(w, h);
479-
#if __CC_PLATFORM_IOS || __CC_PLATFORM_ANDROID
470+
#if __CC_PLATFORM_IOS
480471
[node setValue:[NSValue valueWithCGSize:size] forKey:name];
481472
#elif __CC_PLATFORM_MAC
482473
[node setValue:[NSValue valueWithSize:size] forKey:name];

cocos2d-ext/CCBReader/CCBReader_Private.h

Lines changed: 0 additions & 95 deletions
This file was deleted.

0 commit comments

Comments
 (0)