3636#import " CCActionEase.h"
3737
3838#ifndef M_PI_X_2
39- #define M_PI_X_2 ( float ) M_PI * 2 .0f
39+ #define M_PI_X_2 M_PI * 2.0
4040#endif
4141
4242#pragma mark EaseAction
@@ -98,7 +98,7 @@ -(CCActionInterval*) reverse
9898@implementation CCActionEaseSineIn
9999-(void ) update : (CCTime) t
100100{
101- [_inner update: -1 *cosf (t * ( float ) M_PI_2) +1 ];
101+ [_inner update: -1 *cosf (t * M_PI_2) +1 ];
102102}
103103
104104- (CCActionInterval*) reverse
@@ -113,7 +113,7 @@ - (CCActionInterval*) reverse
113113@implementation CCActionEaseSineOut
114114-(void ) update : (CCTime) t
115115{
116- [_inner update: sinf (t * ( float ) M_PI_2)];
116+ [_inner update: sinf (t * M_PI_2)];
117117}
118118
119119- (CCActionInterval*) reverse
@@ -128,7 +128,7 @@ - (CCActionInterval*) reverse
128128@implementation CCActionEaseSineInOut
129129-(void ) update : (CCTime) t
130130{
131- [_inner update: -0 .5f *(cosf ( ( float ) M_PI*t) - 1 )];
131+ [_inner update: -0.5 *(cosf ( M_PI*t) - 1 )];
132132}
133133@end
134134
@@ -138,12 +138,12 @@ -(void) update: (CCTime) t
138138
139139@implementation CCActionEaseRate
140140@synthesize rate=_rate;
141- +(instancetype ) actionWithAction : (CCActionInterval*) action rate : (float )rate
141+ +(instancetype ) actionWithAction : (CCActionInterval*) action rate : (CGFloat )rate
142142{
143143 return [[self alloc ] initWithAction: action rate: rate];
144144}
145145
146- -(id ) initWithAction : (CCActionInterval*) action rate : (float )rate
146+ -(id ) initWithAction : (CCActionInterval*) action rate : (CGFloat )rate
147147{
148148 if ( (self=[super initWithAction: action ]) )
149149 self.rate = rate;
@@ -176,7 +176,7 @@ -(void) update: (CCTime) t
176176@implementation CCActionEaseOut
177177-(void ) update : (CCTime) t
178178{
179- [_inner update: 1 .0f - powf (1 .0f - t, _rate)];
179+ [_inner update: 1.0 - powf (1.0 - t, _rate)];
180180}
181181@end
182182
@@ -186,10 +186,10 @@ -(void) update: (CCTime) t
186186{
187187 t *= 2 ;
188188 if (t < 1 ) {
189- [_inner update: 0 .5f * powf (t, _rate)];
189+ [_inner update: 0.5 * powf (t, _rate)];
190190 }
191191 else {
192- [_inner update: 1 .0f - 0 .5f * powf (2 -t, _rate)];
192+ [_inner update: 1.0 - 0.5 * powf (2 -t, _rate)];
193193 }
194194}
195195
@@ -211,20 +211,20 @@ @implementation CCActionEaseElastic
211211
212212+(instancetype ) actionWithAction : (CCActionInterval*) action
213213{
214- return [[self alloc ] initWithAction: action period: 0 .3f ];
214+ return [[self alloc ] initWithAction: action period: 0.3 ];
215215}
216216
217- +(instancetype ) actionWithAction : (CCActionInterval*) action period : (float )period
217+ +(instancetype ) actionWithAction : (CCActionInterval*) action period : (CGFloat )period
218218{
219219 return [[self alloc ] initWithAction: action period: period];
220220}
221221
222222-(id ) initWithAction : (CCActionInterval*) action
223223{
224- return [self initWithAction: action period: 0 .3f ];
224+ return [self initWithAction: action period: 0.3 ];
225225}
226226
227- -(id ) initWithAction : (CCActionInterval*) action period : (float )period
227+ -(id ) initWithAction : (CCActionInterval*) action period : (CGFloat )period
228228{
229229 if ( (self=[super initWithAction: action]) )
230230 _period = period;
@@ -255,7 +255,7 @@ -(void) update: (CCTime) t
255255 newT = t;
256256
257257 else {
258- float s = _period / 4 ;
258+ CGFloat s = _period / 4 ;
259259 t = t - 1 ;
260260 newT = -powf (2 , 10 * t) * sinf ( (t-s) *M_PI_X_2 / _period);
261261 }
@@ -279,7 +279,7 @@ -(void) update: (CCTime) t
279279 newT = t;
280280
281281 } else {
282- float s = _period / 4 ;
282+ CGFloat s = _period / 4 ;
283283 newT = powf (2 , -10 * t) * sinf ( (t-s) *M_PI_X_2 / _period) + 1 ;
284284 }
285285 [_inner update: newT];
@@ -303,14 +303,14 @@ -(void) update: (CCTime) t
303303 else {
304304 t = t * 2 ;
305305 if (! _period )
306- _period = 0 .3f * 1 .5f ;
306+ _period = 0.3 * 1.5 ;
307307 CCTime s = _period / 4 ;
308308
309309 t = t -1 ;
310310 if ( t < 0 )
311- newT = -0 .5f * powf (2 , 10 * t) * sinf ((t - s) * M_PI_X_2 / _period);
311+ newT = -0.5 * powf (2 , 10 * t) * sinf ((t - s) * M_PI_X_2 / _period);
312312 else
313- newT = powf (2 , -10 * t) * sinf ((t - s) * M_PI_X_2 / _period) * 0 .5f + 1 ;
313+ newT = powf (2 , -10 * t) * sinf ((t - s) * M_PI_X_2 / _period) * 0.5 + 1 ;
314314 }
315315 [_inner update: newT];
316316}
@@ -330,19 +330,19 @@ @implementation CCActionEaseBounce
330330-(CCTime) bounceTime : (CCTime) t
331331{
332332 if (t < 1 / 2.75 ) {
333- return 7 .5625f * t * t;
333+ return 7.5625 * t * t;
334334 }
335335 else if (t < 2 / 2.75 ) {
336- t -= 1 .5f / 2 .75f ;
337- return 7 .5625f * t * t + 0 .75f ;
336+ t -= 1.5 / 2.75 ;
337+ return 7.5625 * t * t + 0.75 ;
338338 }
339339 else if (t < 2.5 / 2.75 ) {
340- t -= 2 .25f / 2 .75f ;
341- return 7 .5625f * t * t + 0 .9375f ;
340+ t -= 2.25 / 2.75 ;
341+ return 7.5625 * t * t + 0.9375 ;
342342 }
343343
344- t -= 2 .625f / 2 .75f ;
345- return 7 .5625f * t * t + 0 .984375f ;
344+ t -= 2.625 / 2.75 ;
345+ return 7.5625 * t * t + 0.984375 ;
346346}
347347@end
348348
@@ -397,9 +397,9 @@ -(void) update: (CCTime) t
397397 newT = t;
398398 else if (t < 0.5 ) {
399399 t = t * 2 ;
400- newT = (1 - [self bounceTime: 1 -t] ) * 0 .5f ;
400+ newT = (1 - [self bounceTime: 1 -t] ) * 0.5 ;
401401 } else
402- newT = [self bounceTime: t * 2 - 1 ] * 0 .5f + 0 .5f ;
402+ newT = [self bounceTime: t * 2 - 1 ] * 0.5 + 0.5 ;
403403
404404 [_inner update: newT];
405405}
@@ -413,7 +413,7 @@ @implementation CCActionEaseBackIn
413413
414414-(void ) update : (CCTime) t
415415{
416- CCTime overshoot = 1 .70158f ;
416+ CCTime overshoot = 1.70158 ;
417417 [_inner update: t * t * ((overshoot + 1 ) * t - overshoot)];
418418}
419419
@@ -427,7 +427,7 @@ - (CCActionInterval*) reverse
427427@implementation CCActionEaseBackOut
428428-(void ) update : (CCTime) t
429429{
430- CCTime overshoot = 1 .70158f ;
430+ CCTime overshoot = 1.70158 ;
431431
432432 t = t - 1 ;
433433 [_inner update: t * t * ((overshoot + 1 ) * t + overshoot) + 1 ];
@@ -444,7 +444,7 @@ @implementation CCActionEaseBackInOut
444444
445445-(void ) update : (CCTime) t
446446{
447- CCTime overshoot = 1 .70158f * 1 .525f ;
447+ CCTime overshoot = 1.70158 * 1.525 ;
448448
449449 t = t * 2 ;
450450 if (t < 1 )
0 commit comments