Skip to content

Commit 616b4c4

Browse files
author
Thayer J Andrews
committed
CCEffectLighting - Condition the intensity properties
1 parent 8e63fb9 commit 616b4c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cocos2d/CCLightNode.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,16 @@ +(id)lightWithType:(CCLightType)type color:(CCColor *)color intensity:(float)int
3636
return [[self alloc] initWithType:type color:color intensity:intensity ambientColor:ambientColor ambientIntensity:ambientIntensity];
3737
}
3838

39+
-(void)setIntensity:(float)intensity
40+
{
41+
NSCAssert((intensity >= 0.0) && (intensity <= 1.0), @"Supplied intensity out of range [0..1].");
42+
_intensity = intensity;
43+
}
44+
45+
-(void)setAmbientIntensity:(float)intensity
46+
{
47+
NSCAssert((intensity >= 0.0) && (intensity <= 1.0), @"Supplied intensity out of range [0..1].");
48+
_ambientIntensity = intensity;
49+
}
50+
3951
@end

0 commit comments

Comments
 (0)