Skip to content

Commit a60d523

Browse files
author
Thayer J Andrews
committed
CCLightNode and CCEffectLighting - CCLightNodeType -> CCLightType
1 parent 7ec7276 commit a60d523

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

cocos2d/CCEffectLighting.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ +(NSMutableArray *)buildVertexFunctionsWithLights:(NSArray*)lights
122122
{
123123
CCLightNode *light = lights[lightIndex];
124124

125-
if (light.type == CCLightNodeDirectional)
125+
if (light.type == CCLightDirectional)
126126
{
127127
[effectBody appendFormat:@"v_tangentSpaceLightDir%lu = u_lightVector%lu;", (unsigned long)lightIndex, (unsigned long)lightIndex];
128128
}
@@ -168,7 +168,7 @@ -(void)buildRenderPasses
168168

169169
// Compute the light's position in the effect node's coordinate system.
170170
GLKVector4 lightVector = GLKVector4Make(0.0f, 0.0f, 0.0f, 0.0f);
171-
if (light.type == CCLightNodeDirectional)
171+
if (light.type == CCLightDirectional)
172172
{
173173
lightVector = GLKMatrix4MultiplyVector4(lightNodeToEffectNode, GLKVector4Make(0.0f, 1.0f, 1.0f, 0.0f));
174174
}

cocos2d/CCLightNode.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
#import "CCNode.h"
1010

1111

12-
typedef NS_ENUM(NSUInteger, CCLightNodeType)
12+
typedef NS_ENUM(NSUInteger, CCLightType)
1313
{
14-
CCLightNodePoint = 0,
15-
CCLightNodeDirectional = 1,
16-
CCLightNodeSpot = 2,
14+
CCLightPoint = 0,
15+
CCLightDirectional = 1,
16+
CCLightSpot = 2,
1717
};
1818

19+
1920
/**
2021
* CCLightNode allows the user to define lights that will be used with
2122
* CCEffectLighting.
@@ -36,7 +37,7 @@ typedef NS_ENUM(NSUInteger, CCLightNodeType)
3637
* the light to the node exceeds the cutoff angle then the light no longer
3738
* contributes to the lighting of the node.
3839
*/
39-
@property (nonatomic, assign) CCLightNodeType type;
40+
@property (nonatomic, assign) CCLightType type;
4041

4142
/** The primary color of the light. As described below, the color is modulated by the
4243
* intensity value to determine the contribution of the light to the lighting
@@ -91,7 +92,7 @@ typedef NS_ENUM(NSUInteger, CCLightNodeType)
9192
*
9293
* @return The CCLighttNode object.
9394
*/
94-
-(id)initWithType:(CCLightNodeType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity;
95+
-(id)initWithType:(CCLightType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity;
9596

9697

9798
/// -----------------------------------------------------------------------
@@ -109,7 +110,7 @@ typedef NS_ENUM(NSUInteger, CCLightNodeType)
109110
*
110111
* @return An initialized CCLightNode object.
111112
*/
112-
+(id)lightWithType:(CCLightNodeType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity;
113+
+(id)lightWithType:(CCLightType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity;
113114

114115

115116
@end

cocos2d/CCLightNode.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ @implementation CCLightNode
1313

1414
-(id)init
1515
{
16-
return [self initWithType:CCLightNodePoint color:[CCColor whiteColor] intensity:1.0f ambientColor:[CCColor whiteColor] ambientIntensity:0.5f];
16+
return [self initWithType:CCLightPoint color:[CCColor whiteColor] intensity:1.0f ambientColor:[CCColor whiteColor] ambientIntensity:0.5f];
1717
}
1818

1919

20-
-(id)initWithType:(CCLightNodeType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity
20+
-(id)initWithType:(CCLightType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity
2121
{
2222
if ((self = [super init]))
2323
{
@@ -31,7 +31,7 @@ -(id)initWithType:(CCLightNodeType)type color:(CCColor *)color intensity:(float)
3131
return self;
3232
}
3333

34-
+(id)lightWithType:(CCLightNodeType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity
34+
+(id)lightWithType:(CCLightType)type color:(CCColor *)color intensity:(float)intensity ambientColor:(CCColor *)ambientColor ambientIntensity:(float)ambientIntensity
3535
{
3636
return [[self alloc] initWithType:type color:color intensity:intensity ambientColor:ambientColor ambientIntensity:ambientIntensity];
3737
}

0 commit comments

Comments
 (0)