Cocos2d Performance Tips
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Cocos2d Performance Tips

on

  • 2,929 views

cocos2dパフォーマンスチューニングの翻訳記事

cocos2dパフォーマンスチューニングの翻訳記事

Statistics

Views

Total Views
2,929
Views on SlideShare
1,663
Embed Views
1,266

Actions

Likes
4
Downloads
10
Comments
1

6 Embeds 1,266

http://blog.seasons.cc 644
http://d.hatena.ne.jp 612
http://webcache.googleusercontent.com 7
http://cache.yahoofs.jp 1
http://translate.googleusercontent.com 1
http://seasons.hateblo.jp 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Cocos2d Performance Tips Presentation Transcript

  • 1. cocos2d performance tips
  • 2. 1. nonatomic !!@property(nonatomic,assign) float altitude;
  • 3. 2. NSMutableArray NSArray CCArray enumerator for ( CellObject *object in objects ) { ... }
  • 4. cocos2d ( 0.9.x )CC_ARRAY_FOREACHCellObject *object;CC_ARRAY_FOREACH(objects,object) { ...}
  • 5. forfor ( int i = 0;i < self.numObjects; i++ ) {... hoge[i]} indexOfObject
  • 6. 3. float count length
  • 7. 4. float double float 32bit double 64bit 100
  • 8. 5.break
  • 9. 6. tips2 (x1,y1),(x2,y2)
  • 10. float xd = endpoint.x - startpoint.x;float yd = endpoint.y - endpoint.y;float comparedist = 100 * 100;distance = xd * xd + yd * yd;if (distance > comparedist) {...}
  • 11. sqrthttp://en.wikipedia.org/wiki/Fast_inverse_square_root float fast_sqrt(float number) { long i; float x, y; const float f = 1.5f; x = number * 0.5f; y = number; i = *(long*) &y; i = 0x5f3759df - ( i >> 1 ); y = *(float*) &i; y = y * ( f - ( x * y * y ) ); y = y * ( f - ( x * y * y ) ); return number * y; }
  • 12. http://iphonedevelopment.blogspot.com/2009/03/speed-with- catch.html iPhone InvSqrt Normalize
  • 13. 7.
  • 14. RELEASE
  • 15. Challenge optimizing your code!!