Skip to content

Commit 116f8e8

Browse files
committed
Mostly header refactoring for using -ext
1 parent 57c9bd6 commit 116f8e8

File tree

13 files changed

+37
-18
lines changed

13 files changed

+37
-18
lines changed

cocos2d-ext/CCBReader/CCAnimationManager.h

Lines changed: 0 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;

cocos2d-ext/CCBReader/CCAnimationManager.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
#import "CCBReader_Private.h"
3636
#import "CCActionManager.h"
3737

38+
#if CC_LIGHTING
39+
#import "CCLightNode.h"
40+
#endif
41+
42+
#if CC_OBJECT_AL
43+
#import "CCActionAudio.h"
44+
#endif
45+
3846
// Unique Manager ID
3947
static NSInteger ccbAnimationManagerID = 0;
4048

cocos2d-ext/CCEffects/CCEffectGlass.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#import "CCTexture.h"
1616

1717
#import "CCEffect_Private.h"
18-
#import "CCSprite_Private.h"
18+
#import "CCSprite.h"
1919

2020

2121
static const float CCEffectGlassDefaultFresnelBias = 0.1f;

cocos2d-ext/CCEffects/CCEffectLighting.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#import "CCTexture.h"
2020

2121
#import "CCEffect_Private.h"
22-
#import "CCSprite_Private.h"
22+
#import "CCSprite.h"
2323

2424

2525
typedef struct _CCLightKey
@@ -328,10 +328,10 @@ +(NSArray *)buildRenderPassesWithInterface:(CCEffectLighting *)interface
328328
passInputs.shaderUniforms[passInputs.uniformTranslationTable[lightSpecularColorLabel]] = [NSValue valueWithGLKVector4:lightSpecularColor];
329329
}
330330
}
331-
331+
#if CC_LIGHTING
332332
CCColor *ambientColor = [CCEffectUtilsGetNodeScene(passInputs.sprite).lights findAmbientSumForLightsWithMask:weakInterface.groupMask];
333333
passInputs.shaderUniforms[passInputs.uniformTranslationTable[@"u_globalAmbientColor"]] = [NSValue valueWithGLKVector4:ambientColor.glkVector4];
334-
334+
#endif
335335
if (weakInterface.needsSpecular)
336336
{
337337
passInputs.shaderUniforms[passInputs.uniformTranslationTable[@"u_specularExponent"]] = weakInterface.conditionedShininess;
@@ -382,7 +382,7 @@ - (CCEffectPrepareResult)prepareForRenderingWithSprite:(CCSprite *)sprite
382382
_needsNormalMap = (sprite.normalMapSpriteFrame != nil);
383383

384384
CGPoint spritePosition = CGPointApplyAffineTransform(sprite.anchorPointInPoints, sprite.nodeToWorldTransform);
385-
385+
#if CC_LIGHTING
386386
CCLightCollection *lightCollection = CCEffectUtilsGetNodeScene(sprite).lights;
387387
if (self.groupMaskDirty)
388388
{
@@ -406,6 +406,7 @@ - (CCEffectPrepareResult)prepareForRenderingWithSprite:(CCSprite *)sprite
406406
result.status = CCEffectPrepareSuccess;
407407
result.changes = CCEffectPrepareShaderChanged | CCEffectPrepareUniformsChanged;
408408
}
409+
#endif
409410
return result;
410411
}
411412

cocos2d-ext/CCEffects/CCEffectNode.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#import "Support/CCFileUtils.h"
1818
#import "Support/CGPointExtension.h"
1919

20-
#import "CCTexture_Private.h"
21-
#import "CCDirector_Private.h"
22-
#import "CCNode_Private.h"
20+
#import "CCTexture.h"
21+
#import "CCDirector.h"
22+
#import "CCNode.h"
2323
#import "CCRenderer_Private.h"
2424
#import "CCRenderTexture_Private.h"
2525
#import "CCEffect_Private.h"

cocos2d-ext/CCEffects/CCEffectReflection.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#import "CCTexture.h"
1616

1717
#import "CCEffect_Private.h"
18-
#import "CCSprite_Private.h"
18+
#import "CCSprite.h"
1919

2020

2121

cocos2d-ext/CCEffects/CCEffectRefraction.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#import "CCTexture.h"
1616

1717
#import "CCEffect_Private.h"
18-
#import "CCSprite_Private.h"
18+
#import "CCSprite.h"
1919

2020

2121
@interface CCEffectRefraction ()

cocos2d-ext/CCEffects/CCEffectRenderer.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
#import "CCEffect_Private.h"
1818
#import "CCRenderer_Private.h"
19-
#import "CCSprite_Private.h"
20-
#import "CCTexture_Private.h"
19+
#import "CCSprite.h"
20+
#import "CCTexture.h"
2121

2222

2323
typedef NS_ENUM(NSUInteger, CCEffectTexCoordSource)

cocos2d-ext/CCEffects/CCEffect_Private.h

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

99
#import "CCEffect.h"
10-
#import "CCEffectStackProtocol.h"
10+
#import "CCSprite.h"
1111

1212

1313
extern NSString * const CCShaderUniformPreviousPassTexture;

cocos2d-ext/CCLighting/CCLightNode.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,32 @@ +(instancetype)lightWithType:(CCLightType)type groups:(NSArray*)groups color:(CC
6666
- (void)onEnter
6767
{
6868
[super onEnter];
69+
#if CC_LIGHTING
6970
[self.scene.lights addLight:self];
7071

7172
CCLightCollection *lightCollection = self.scene.lights;
7273
NSAssert(lightCollection, @"The light node is in a scene but there's no light collection.");
7374
_groupMask = [lightCollection maskForGroups:_groups];
75+
#endif
7476
}
7577

7678
- (void)onExit
7779
{
7880
_groupMask = 0;
79-
81+
#if CC_LIGHTING
8082
[self.scene.lights removeLight:self];
83+
#endif
8184
[super onExit];
8285
}
8386

8487
-(void)setGroups:(NSArray *)groups
8588
{
8689
_groups = [groups copy];
87-
90+
#if CC_LIGHTING
8891
CCLightCollection *lightCollection = self.scene.lights;
92+
8993
_groupMask = [lightCollection maskForGroups:_groups];
94+
#endif
9095
}
9196

9297
-(void)setIntensity:(float)intensity

0 commit comments

Comments
 (0)