36
36
#import " CCActionEase.h"
37
37
38
38
#ifndef M_PI_X_2
39
- #define M_PI_X_2 ( float ) M_PI * 2.0
39
+ #define M_PI_X_2 M_PI * 2.0
40
40
#endif
41
41
42
42
#pragma mark EaseAction
@@ -98,7 +98,7 @@ -(CCActionInterval*) reverse
98
98
@implementation CCActionEaseSineIn
99
99
-(void ) update : (CCTime) t
100
100
{
101
- [_inner update: -1 *cosf (t * ( float ) M_PI_2) +1 ];
101
+ [_inner update: -1 *cosf (t * M_PI_2) +1 ];
102
102
}
103
103
104
104
- (CCActionInterval*) reverse
@@ -113,7 +113,7 @@ - (CCActionInterval*) reverse
113
113
@implementation CCActionEaseSineOut
114
114
-(void ) update : (CCTime) t
115
115
{
116
- [_inner update: sinf (t * ( float ) M_PI_2)];
116
+ [_inner update: sinf (t * M_PI_2)];
117
117
}
118
118
119
119
- (CCActionInterval*) reverse
@@ -128,7 +128,7 @@ - (CCActionInterval*) reverse
128
128
@implementation CCActionEaseSineInOut
129
129
-(void ) update : (CCTime) t
130
130
{
131
- [_inner update: -0.5 *(cosf ( ( float ) M_PI*t) - 1 )];
131
+ [_inner update: -0.5 *(cosf ( M_PI*t) - 1 )];
132
132
}
133
133
@end
134
134
@@ -138,12 +138,12 @@ -(void) update: (CCTime) t
138
138
139
139
@implementation CCActionEaseRate
140
140
@synthesize rate=_rate;
141
- +(instancetype ) actionWithAction : (CCActionInterval*) action rate : (float )rate
141
+ +(instancetype ) actionWithAction : (CCActionInterval*) action rate : (CGFloat )rate
142
142
{
143
143
return [[self alloc ] initWithAction: action rate: rate];
144
144
}
145
145
146
- -(id ) initWithAction : (CCActionInterval*) action rate : (float )rate
146
+ -(id ) initWithAction : (CCActionInterval*) action rate : (CGFloat )rate
147
147
{
148
148
if ( (self=[super initWithAction: action ]) )
149
149
self.rate = rate;
@@ -214,7 +214,7 @@ +(instancetype) actionWithAction: (CCActionInterval*) action
214
214
return [[self alloc ] initWithAction: action period: 0.3 ];
215
215
}
216
216
217
- +(instancetype ) actionWithAction : (CCActionInterval*) action period : (float )period
217
+ +(instancetype ) actionWithAction : (CCActionInterval*) action period : (CGFloat )period
218
218
{
219
219
return [[self alloc ] initWithAction: action period: period];
220
220
}
@@ -224,7 +224,7 @@ -(id) initWithAction: (CCActionInterval*) action
224
224
return [self initWithAction: action period: 0.3 ];
225
225
}
226
226
227
- -(id ) initWithAction : (CCActionInterval*) action period : (float )period
227
+ -(id ) initWithAction : (CCActionInterval*) action period : (CGFloat )period
228
228
{
229
229
if ( (self=[super initWithAction: action]) )
230
230
_period = period;
@@ -255,7 +255,7 @@ -(void) update: (CCTime) t
255
255
newT = t;
256
256
257
257
else {
258
- float s = _period / 4 ;
258
+ CGFloat s = _period / 4 ;
259
259
t = t - 1 ;
260
260
newT = -powf (2 , 10 * t) * sinf ( (t-s) *M_PI_X_2 / _period);
261
261
}
@@ -279,7 +279,7 @@ -(void) update: (CCTime) t
279
279
newT = t;
280
280
281
281
} else {
282
- float s = _period / 4 ;
282
+ CGFloat s = _period / 4 ;
283
283
newT = powf (2 , -10 * t) * sinf ( (t-s) *M_PI_X_2 / _period) + 1 ;
284
284
}
285
285
[_inner update: newT];
0 commit comments