joybox 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile.lock +1 -1
  3. data/LICENSE +1 -1
  4. data/LICENSE_Box2D +20 -0
  5. data/LICENSE_Cocos2D +24 -0
  6. data/README.md +34 -66
  7. data/Rakefile +2 -3
  8. data/bin/joybox +49 -0
  9. data/command/joybox/USAGE +24 -0
  10. data/command/joybox/templates/layer.erb +11 -0
  11. data/command/joybox/templates/layer_spec.erb +3 -0
  12. data/command/joybox/templates/scene.erb +11 -0
  13. data/command/joybox/templates/scene_spec.erb +3 -0
  14. data/command/joybox/templates/sprite.erb +11 -0
  15. data/command/joybox/templates/sprite_spec.erb +3 -0
  16. data/command/joybox_generate_command.rb +114 -0
  17. data/joybox.gemspec +44 -0
  18. data/lib/joybox/joybox-ios.rb +47 -0
  19. data/lib/joybox/joybox-osx.rb +47 -0
  20. data/lib/joybox/version.rb +1 -1
  21. data/lib/joybox.rb +18 -36
  22. data/{lib/joybox/cocos2d → motion/joybox}/actions/actions.rb +0 -0
  23. data/motion/joybox/actions/animate.rb +22 -0
  24. data/motion/joybox/actions/bezier.rb +33 -0
  25. data/motion/joybox/actions/blink.rb +24 -0
  26. data/motion/joybox/actions/ease.rb +149 -0
  27. data/motion/joybox/actions/fade.rb +38 -0
  28. data/motion/joybox/actions/jump.rb +39 -0
  29. data/{lib/joybox/cocos2d → motion/joybox}/actions/move.rb +4 -2
  30. data/motion/joybox/actions/place.rb +22 -0
  31. data/{lib/joybox/cocos2d → motion/joybox}/actions/repeat.rb +10 -1
  32. data/{lib/joybox/cocos2d → motion/joybox}/actions/rotate.rb +4 -2
  33. data/{lib/joybox/cocos2d → motion/joybox}/actions/scale.rb +4 -2
  34. data/{lib/joybox/cocos2d → motion/joybox}/actions/sequence.rb +3 -3
  35. data/{lib/joybox/cocos2d → motion/joybox}/actions/skew.rb +0 -0
  36. data/motion/joybox/actions/spawn.rb +22 -0
  37. data/motion/joybox/actions/tint.rb +37 -0
  38. data/motion/joybox/animations/animation.rb +60 -0
  39. data/{lib/joybox/cocos2d → motion/joybox}/common/color.rb +12 -1
  40. data/{lib/joybox/cocos2d → motion/joybox}/common/gc_size.rb +4 -4
  41. data/{lib/joybox/cocos2d → motion/joybox}/common/ns_set.rb +0 -0
  42. data/{lib/joybox/cocos2d → motion/joybox}/common/numeric.rb +0 -0
  43. data/{lib/joybox/cocos2d → motion/joybox}/common/screen.rb +4 -4
  44. data/motion/joybox/core/layer.rb +51 -0
  45. data/{lib/joybox/cocos2d → motion/joybox}/core/node.rb +0 -0
  46. data/{lib/joybox/cocos2d → motion/joybox}/core/scene.rb +0 -0
  47. data/{lib/joybox/cocos2d → motion/joybox}/core/sprite.rb +22 -3
  48. data/{lib/joybox/cocos2d → motion/joybox}/core/sprite_batch.rb +0 -0
  49. data/motion/joybox/core/sprite_frame_cache.rb +147 -0
  50. data/{lib/joybox/cocos2d/cocos2d.rb → motion/joybox/joybox.rb} +3 -1
  51. data/{lib/joybox/cocos2d → motion/joybox}/macros.rb +0 -0
  52. data/{lib/joybox/box2d → motion/joybox/physics}/body.rb +44 -17
  53. data/{lib/joybox/cocos2d/core → motion/joybox/physics}/physics_sprite.rb +1 -1
  54. data/motion/joybox/physics/world.rb +79 -0
  55. data/{lib/joybox/cocos2d → motion/joybox}/ui/label.rb +3 -2
  56. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu.rb +0 -0
  57. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_image.rb +0 -0
  58. data/{lib/joybox/cocos2d → motion/joybox}/ui/menu_label.rb +0 -0
  59. data/{lib/joybox/cocos2d → motion/joybox}/ui/ui.rb +0 -0
  60. data/{lib/joybox/cocos2d → motion/joybox-ios}/common/cg_point.rb +9 -2
  61. data/{lib/joybox/cocos2d → motion/joybox-ios}/common/ui_touch.rb +1 -1
  62. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/configuration.rb +0 -0
  63. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/file_utils.rb +0 -3
  64. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/gl_view.rb +0 -0
  65. data/{lib/joybox/cocos2d → motion/joybox-ios}/configuration/texture_2d.rb +0 -0
  66. data/{lib/joybox/cocos2d → motion/joybox-ios}/core/layer.rb +1 -45
  67. data/{lib/joybox/cocos2d → motion/joybox-ios}/director.rb +6 -6
  68. data/motion/joybox-osx/common/ats_point.rb +48 -0
  69. data/motion/joybox-osx/common/ns_event.rb +8 -0
  70. data/motion/joybox-osx/configuration/configuration.rb +46 -0
  71. data/motion/joybox-osx/configuration/gl_view.rb +57 -0
  72. data/motion/joybox-osx/core/layer.rb +135 -0
  73. data/motion/joybox-osx/director.rb +42 -0
  74. data/template/joybox-ios/files/Rakefile.erb +9 -0
  75. data/{app → template/joybox-ios/files/app}/app_delegate.rb +1 -5
  76. data/{resources → template/joybox-ios/files/resources}/fps_images-hd.png +0 -0
  77. data/{resources → template/joybox-ios/files/resources}/fps_images-ipadhd.png +0 -0
  78. data/{resources → template/joybox-ios/files/resources}/fps_images.png +0 -0
  79. data/template/joybox-ios/files/spec/main_spec.rb.erb +9 -0
  80. data/template/joybox-osx/files/Rakefile.erb +9 -0
  81. data/template/joybox-osx/files/app/app_delegate.rb +23 -0
  82. data/template/joybox-osx/files/app/layers/default_layer.rb +5 -0
  83. data/template/joybox-osx/files/app/menu.rb +51 -0
  84. data/template/joybox-osx/files/resources/Credits.rtf +29 -0
  85. data/template/joybox-osx/files/resources/fps_images-hd.png +0 -0
  86. data/template/joybox-osx/files/resources/fps_images-ipadhd.png +0 -0
  87. data/template/joybox-osx/files/resources/fps_images.png +0 -0
  88. data/template/joybox-osx/files/spec/main_spec.rb.erb +9 -0
  89. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D +0 -0
  90. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Box2D.framework.bridgesupport +47 -37
  91. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Box2D +0 -0
  92. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/B2DContactListener.h +0 -0
  93. data/vendor/vendor-ios/Box2D.framework/Versions/A/Headers/Collision/Shapes/B2DCircleShape.h +16 -0
  94. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DEdgeShape.h +0 -0
  95. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DPolygonShape.h +0 -0
  96. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Collision/Shapes/B2DShape.h +0 -0
  97. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DBody.h +6 -6
  98. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Headers/Dynamics/B2DWorld.h +0 -0
  99. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/Box2DConfig.cmake +0 -0
  100. data/vendor/{Box2D.framework → vendor-ios/Box2D.framework}/Versions/A/Resources/CMakeLists.txt +0 -0
  101. data/vendor/vendor-ios/Box2D.framework/Versions/A/Resources/LICENSE +22 -0
  102. data/vendor/vendor-ios/cocos_2d/cocos_2d.bridgesupport +9154 -0
  103. data/vendor/vendor-ios/cocos_2d/cocos_2d_exceptions.bridgesupport +39 -0
  104. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAction.h +23 -23
  105. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCamera.h +21 -19
  106. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionCatmullRom.h +18 -6
  107. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionEase.h +117 -31
  108. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid.h +19 -17
  109. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionGrid3D.h +45 -42
  110. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInstant.h +21 -13
  111. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionInterval.h +123 -81
  112. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionManager.h +2 -2
  113. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionPageTurn3D.h +2 -1
  114. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionProgressTimer.h +4 -4
  115. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTiledGrid.h +46 -38
  116. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCActionTween.h +3 -3
  117. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimation.h +8 -8
  118. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAnimationCache.h +2 -2
  119. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCAtlasNode.h +19 -17
  120. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCCamera.h +12 -12
  121. data/vendor/vendor-ios/cocos_2d/include/CCClippingNode.h +77 -0
  122. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCConfiguration.h +31 -13
  123. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDirector.h +51 -42
  124. data/vendor/vendor-ios/cocos_2d/include/CCDrawNode.h +65 -0
  125. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCDrawingPrimitives.h +42 -8
  126. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGLProgram.h +56 -21
  127. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrabber.h +2 -2
  128. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCGrid.h +29 -29
  129. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelAtlas.h +5 -2
  130. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelBMFont.h +56 -32
  131. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLabelTTF.h +20 -20
  132. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCLayer.h +107 -79
  133. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenu.h +10 -14
  134. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMenuItem.h +37 -32
  135. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCMotionStreak.h +18 -19
  136. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode+Debug.h +0 -0
  137. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCNode.h +87 -37
  138. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParallaxNode.h +2 -2
  139. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleBatchNode.h +2 -2
  140. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleExamples.h +22 -0
  141. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystem.h +51 -40
  142. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCParticleSystemQuad.h +4 -4
  143. data/vendor/vendor-ios/cocos_2d/include/CCPhysicsDebugNode.h +58 -0
  144. data/vendor/vendor-ios/cocos_2d/include/CCPhysicsSprite.h +82 -0
  145. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProgressTimer.h +9 -11
  146. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCProtocols.h +54 -26
  147. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCRenderTexture.h +29 -9
  148. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScene.h +4 -0
  149. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCScheduler.h +94 -40
  150. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCShaderCache.h +1 -1
  151. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSprite.h +21 -28
  152. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteBatchNode.h +16 -9
  153. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrame.h +10 -10
  154. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCSpriteFrameCache.h +6 -6
  155. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXLayer.h +16 -16
  156. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXObjectGroup.h +4 -4
  157. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXTiledMap.h +9 -9
  158. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTMXXMLParser.h +44 -33
  159. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexture2D.h +17 -25
  160. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureAtlas.h +10 -10
  161. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTextureCache.h +4 -4
  162. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTexturePVR.h +25 -8
  163. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTileMapAtlas.h +6 -6
  164. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransition.h +57 -12
  165. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionPageTurn.h +2 -2
  166. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/CCTransitionProgress.h +27 -5
  167. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCGL.h +4 -2
  168. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms}/CCNS.h +0 -0
  169. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCDirectorMac.h +110 -0
  170. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCEventDispatcher.h +343 -0
  171. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCGLView.h +103 -0
  172. data/vendor/vendor-ios/cocos_2d/include/Platforms/Mac/CCWindow.h +41 -0
  173. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCDirectorIOS.h +12 -5
  174. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCES2Renderer.h +12 -12
  175. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCESRenderer.h +0 -0
  176. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCGLView.h +28 -13
  177. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDelegateProtocol.h +4 -4
  178. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchDispatcher.h +2 -2
  179. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Platforms/iOS}/CCTouchHandler.h +7 -7
  180. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCArray.h +1 -1
  181. data/vendor/vendor-ios/cocos_2d/include/Support/CCFileUtils.h +394 -0
  182. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCProfiling.h +0 -0
  183. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CCVertex.h +1 -1
  184. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/CGPointExtension.h +4 -2
  185. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/NSThread+performBlock.h +0 -0
  186. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/OpenGL_Internal.h +0 -0
  187. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TGAlib.h +0 -0
  188. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/TransformUtils.h +0 -0
  189. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ZipUtils.h +4 -4
  190. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/base64.h +0 -0
  191. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccCArray.h +15 -15
  192. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/ccUtils.h +0 -0
  193. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/uthash.h +129 -184
  194. data/vendor/{Cocos2D/include → vendor-ios/cocos_2d/include/Support}/utlist.h +298 -55
  195. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccConfig.h +56 -9
  196. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccDeprecated.h +131 -0
  197. data/vendor/vendor-ios/cocos_2d/include/ccFPSImages.h +39 -0
  198. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccGLStateCache.h +44 -26
  199. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccMacros.h +9 -9
  200. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_frag.h +41 -0
  201. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColorLengthTexture_vert.h +47 -0
  202. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_frag.h +37 -0
  203. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionColor_vert.h +40 -0
  204. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_frag.h +41 -0
  205. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureA8Color_vert.h +45 -0
  206. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
  207. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_frag.h +39 -0
  208. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTextureColor_vert.h +45 -0
  209. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_frag.h +38 -0
  210. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_frag.h +41 -0
  211. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_uColor_vert.h +41 -0
  212. data/vendor/vendor-ios/cocos_2d/include/ccShader_PositionTexture_vert.h +41 -0
  213. data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_frag.h +37 -0
  214. data/vendor/vendor-ios/cocos_2d/include/ccShader_Position_uColor_vert.h +43 -0
  215. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/ccShaders.h +11 -0
  216. data/vendor/vendor-ios/cocos_2d/include/ccTypes.h +392 -0
  217. data/vendor/vendor-ios/cocos_2d/include/cocos2d-ios-exceptions.bridgesupport +39 -0
  218. data/vendor/{Cocos2D → vendor-ios/cocos_2d}/include/cocos2d.h +28 -3
  219. data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_bridgesupport.sh +17 -0
  220. data/vendor/vendor-ios/cocos_2d/include/gen_cocos2d_complement.sh +17 -0
  221. data/vendor/vendor-ios/cocos_2d/libcocos2d.a +0 -0
  222. data/vendor/vendor-osx/box_2d/box_2d.bridgesupport +176 -0
  223. data/vendor/vendor-osx/box_2d/include/B2DBody.h +46 -0
  224. data/vendor/vendor-osx/box_2d/include/B2DCircleShape.h +16 -0
  225. data/vendor/vendor-osx/box_2d/include/B2DContactListener.h +30 -0
  226. data/vendor/vendor-osx/box_2d/include/B2DEdgeShape.h +17 -0
  227. data/vendor/vendor-osx/box_2d/include/B2DPolygonShape.h +16 -0
  228. data/vendor/vendor-osx/box_2d/include/B2DShape.h +18 -0
  229. data/vendor/vendor-osx/box_2d/include/B2DWorld.h +44 -0
  230. data/vendor/vendor-osx/box_2d/libBox2D.a +0 -0
  231. data/vendor/vendor-osx/cocos_2d/cocos_2d.bridgesupport +8292 -0
  232. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAction.h +195 -0
  233. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCamera.h +75 -0
  234. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionCatmullRom.h +151 -0
  235. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionEase.h +245 -0
  236. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid.h +167 -0
  237. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionGrid3D.h +208 -0
  238. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInstant.h +235 -0
  239. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionInterval.h +473 -0
  240. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionManager.h +113 -0
  241. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionPageTurn3D.h +43 -0
  242. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionProgressTimer.h +59 -0
  243. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTiledGrid.h +219 -0
  244. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCActionTween.h +62 -0
  245. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimation.h +150 -0
  246. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAnimationCache.h +74 -0
  247. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCAtlasNode.h +98 -0
  248. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCCamera.h +98 -0
  249. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCClippingNode.h +77 -0
  250. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCConfiguration.h +144 -0
  251. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDirector.h +353 -0
  252. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawNode.h +65 -0
  253. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCDrawingPrimitives.h +173 -0
  254. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGLProgram.h +185 -0
  255. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrabber.h +44 -0
  256. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCGrid.h +130 -0
  257. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelAtlas.h +71 -0
  258. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelBMFont.h +240 -0
  259. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLabelTTF.h +132 -0
  260. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCLayer.h +308 -0
  261. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenu.h +96 -0
  262. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMenuItem.h +428 -0
  263. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCMotionStreak.h +86 -0
  264. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode+Debug.h +39 -0
  265. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCNode.h +619 -0
  266. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParallaxNode.h +50 -0
  267. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleBatchNode.h +99 -0
  268. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleExamples.h +117 -0
  269. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystem.h +464 -0
  270. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCParticleSystemQuad.h +73 -0
  271. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsDebugNode.h +58 -0
  272. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCPhysicsSprite.h +82 -0
  273. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProgressTimer.h +92 -0
  274. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCProtocols.h +160 -0
  275. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCRenderTexture.h +159 -0
  276. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScene.h +47 -0
  277. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCScheduler.h +284 -0
  278. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCShaderCache.h +60 -0
  279. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSprite.h +281 -0
  280. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteBatchNode.h +145 -0
  281. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrame.h +126 -0
  282. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCSpriteFrameCache.h +121 -0
  283. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXLayer.h +164 -0
  284. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXObjectGroup.h +67 -0
  285. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXTiledMap.h +145 -0
  286. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTMXXMLParser.h +228 -0
  287. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexture2D.h +349 -0
  288. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureAtlas.h +188 -0
  289. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTextureCache.h +146 -0
  290. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTexturePVR.h +146 -0
  291. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTileMapAtlas.h +83 -0
  292. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransition.h +341 -0
  293. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionPageTurn.h +60 -0
  294. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/CCTransitionProgress.h +84 -0
  295. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCGL.h +74 -0
  296. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/CCNS.h +54 -0
  297. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCDirectorMac.h +110 -0
  298. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCEventDispatcher.h +343 -0
  299. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCGLView.h +103 -0
  300. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Platforms/Mac/CCWindow.h +41 -0
  301. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCArray.h +119 -0
  302. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCFileUtils.h +394 -0
  303. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCProfiling.h +89 -0
  304. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CCVertex.h +36 -0
  305. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/CGPointExtension.h +346 -0
  306. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/NSThread+performBlock.h +22 -0
  307. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/OpenGL_Internal.h +86 -0
  308. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TGAlib.h +55 -0
  309. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/TransformUtils.h +36 -0
  310. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ZipUtils.h +91 -0
  311. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/base64.h +33 -0
  312. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccCArray.h +229 -0
  313. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/ccUtils.h +36 -0
  314. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/uthash.h +917 -0
  315. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/Support/utlist.h +733 -0
  316. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccConfig.h +292 -0
  317. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccDeprecated.h +431 -0
  318. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccFPSImages.h +39 -0
  319. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccGLStateCache.h +156 -0
  320. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccMacros.h +353 -0
  321. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_frag.h +41 -0
  322. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColorLengthTexture_vert.h +47 -0
  323. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_frag.h +37 -0
  324. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionColor_vert.h +40 -0
  325. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_frag.h +41 -0
  326. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureA8Color_vert.h +45 -0
  327. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColorAlphaTest_frag.h +47 -0
  328. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_frag.h +39 -0
  329. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTextureColor_vert.h +45 -0
  330. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_frag.h +38 -0
  331. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_frag.h +41 -0
  332. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_uColor_vert.h +41 -0
  333. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_PositionTexture_vert.h +41 -0
  334. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_frag.h +37 -0
  335. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShader_Position_uColor_vert.h +43 -0
  336. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/ccShaders.h +56 -0
  337. data/vendor/{Cocos2D/include → vendor-osx/cocos_2d/cocos_2d_include}/ccTypes.h +39 -35
  338. data/vendor/vendor-osx/cocos_2d/cocos_2d_include/cocos2d.h +203 -0
  339. data/vendor/vendor-osx/cocos_2d/libcocos2d.a +0 -0
  340. metadata +363 -195
  341. data/app/layers/box2d_layer.rb +0 -109
  342. data/app/layers/cocos2d_layer.rb +0 -14
  343. data/app/layers/cocos_motion_layer.rb +0 -145
  344. data/app/layers/menu_layer.rb +0 -59
  345. data/lib/joybox/box2d/world.rb +0 -79
  346. data/resources/box2d/blocks_sprite_sheet.png +0 -0
  347. data/resources/cocos_motion/dot.png +0 -0
  348. data/resources/cocos_motion/dot_selected.png +0 -0
  349. data/resources/cocos_motion/grossini.png +0 -0
  350. data/resources/cocos_motion/grossinis_sister.png +0 -0
  351. data/resources/cocos_motion/grossinis_sister_two.png +0 -0
  352. data/resources/cocos_motion/left_arrow.png +0 -0
  353. data/resources/cocos_motion/left_arrow_selected.png +0 -0
  354. data/resources/cocos_motion/right_arrow.png +0 -0
  355. data/resources/cocos_motion/right_arrow_selected.png +0 -0
  356. data/vendor/Cocos2D/Cocos2D.bridgesupport +0 -7808
  357. data/vendor/Cocos2D/include/CCFileUtils.h +0 -188
  358. data/vendor/Cocos2D/include/CocosDenshion/CDAudioManager.h +0 -243
  359. data/vendor/Cocos2D/include/CocosDenshion/CDConfig.h +0 -60
  360. data/vendor/Cocos2D/include/CocosDenshion/CDOpenALSupport.h +0 -77
  361. data/vendor/Cocos2D/include/CocosDenshion/CDXPropertyModifierAction.h +0 -45
  362. data/vendor/Cocos2D/include/CocosDenshion/CocosDenshion.h +0 -440
  363. data/vendor/Cocos2D/include/CocosDenshion/SimpleAudioEngine.h +0 -90
  364. data/vendor/Cocos2D/include/RubyMotionSchedule.h +0 -7
  365. data/vendor/Cocos2D/include/ccShader_PositionColor_frag.h +0 -12
  366. data/vendor/Cocos2D/include/ccShader_PositionColor_vert.h +0 -17
  367. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_frag.h +0 -16
  368. data/vendor/Cocos2D/include/ccShader_PositionTextureA8Color_vert.h +0 -21
  369. data/vendor/Cocos2D/include/ccShader_PositionTextureColorAlphaTest_frag.h +0 -23
  370. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_frag.h +0 -14
  371. data/vendor/Cocos2D/include/ccShader_PositionTextureColor_vert.h +0 -22
  372. data/vendor/Cocos2D/include/ccShader_PositionTexture_frag.h +0 -13
  373. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_frag.h +0 -16
  374. data/vendor/Cocos2D/include/ccShader_PositionTexture_uColor_vert.h +0 -18
  375. data/vendor/Cocos2D/include/ccShader_PositionTexture_vert.h +0 -17
  376. data/vendor/Cocos2D/include/ccShader_Position_uColor_frag.h +0 -12
  377. data/vendor/Cocos2D/include/ccShader_Position_uColor_vert.h +0 -19
  378. data/vendor/Cocos2D/include/kazmath/GL/mat4stack.h +0 -51
  379. data/vendor/Cocos2D/include/kazmath/GL/matrix.h +0 -58
  380. data/vendor/Cocos2D/include/kazmath/aabb.h +0 -53
  381. data/vendor/Cocos2D/include/kazmath/kazmath.h +0 -39
  382. data/vendor/Cocos2D/include/kazmath/mat3.h +0 -75
  383. data/vendor/Cocos2D/include/kazmath/mat4.h +0 -93
  384. data/vendor/Cocos2D/include/kazmath/neon_matrix_impl.h +0 -41
  385. data/vendor/Cocos2D/include/kazmath/plane.h +0 -70
  386. data/vendor/Cocos2D/include/kazmath/quaternion.h +0 -113
  387. data/vendor/Cocos2D/include/kazmath/ray2.h +0 -50
  388. data/vendor/Cocos2D/include/kazmath/utility.h +0 -74
  389. data/vendor/Cocos2D/include/kazmath/vec2.h +0 -64
  390. data/vendor/Cocos2D/include/kazmath/vec3.h +0 -68
  391. data/vendor/Cocos2D/include/kazmath/vec4.h +0 -68
  392. data/vendor/Cocos2D/libCocosDenshion.a +0 -0
  393. data/vendor/Cocos2D/libcocos2d.a +0 -0
@@ -43,9 +43,9 @@
43
43
  */
44
44
  @interface CCAnimationFrame : NSObject <NSCopying>
45
45
  {
46
- CCSpriteFrame* spriteFrame_;
47
- float delayUnits_;
48
- NSDictionary *userInfo_;
46
+ CCSpriteFrame* _spriteFrame;
47
+ float _delayUnits;
48
+ NSDictionary *_userInfo;
49
49
  }
50
50
  /** CCSpriteFrameName to be used */
51
51
  @property (nonatomic, readwrite, retain) CCSpriteFrame* spriteFrame;
@@ -70,11 +70,11 @@
70
70
  */
71
71
  @interface CCAnimation : NSObject <NSCopying>
72
72
  {
73
- NSMutableArray *frames_;
74
- float totalDelayUnits_;
75
- float delayPerUnit_;
76
- BOOL restoreOriginalFrame_;
77
- NSUInteger loops_;
73
+ NSMutableArray *_frames;
74
+ float _totalDelayUnits;
75
+ float _delayPerUnit;
76
+ BOOL _restoreOriginalFrame;
77
+ NSUInteger _loops;
78
78
  }
79
79
 
80
80
  /** total Delay units of the CCAnimation. */
@@ -35,10 +35,10 @@
35
35
  */
36
36
  @interface CCAnimationCache : NSObject
37
37
  {
38
- NSMutableDictionary *animations_;
38
+ NSMutableDictionary *_animations;
39
39
  }
40
40
 
41
- /** Retruns ths shared instance of the Animation cache */
41
+ /** Returns the shared instance of the Animation cache */
42
42
  + (CCAnimationCache *) sharedAnimationCache;
43
43
 
44
44
  /** Purges the cache. It releases all the CCAnimation objects and the shared instance.
@@ -29,44 +29,44 @@
29
29
  #import "CCNode.h"
30
30
  #import "CCProtocols.h"
31
31
 
32
+ @class CCTexture2D;
33
+
32
34
  /** CCAtlasNode is a subclass of CCNode that implements the CCRGBAProtocol and
33
35
  CCTextureProtocol protocol
34
36
 
35
37
  It knows how to render a TextureAtlas object.
36
- If you are going to render a TextureAtlas consider subclassing CCAtlasNode (or a subclass of CCAtlasNode)
38
+ If you are going to render a TextureAtlas consider sub-classing CCAtlasNode (or a subclass of CCAtlasNode)
37
39
 
38
40
  All features from CCNode are valid, plus the following features:
39
41
  - opacity and RGB colors
40
42
  */
41
- @interface CCAtlasNode : CCNode <CCRGBAProtocol, CCTextureProtocol>
43
+ @interface CCAtlasNode : CCNodeRGBA <CCTextureProtocol>
42
44
  {
43
45
  // texture atlas
44
- CCTextureAtlas *textureAtlas_;
46
+ CCTextureAtlas *_textureAtlas;
45
47
 
46
48
  // chars per row
47
- NSUInteger itemsPerRow_;
49
+ NSUInteger _itemsPerRow;
48
50
  // chars per column
49
- NSUInteger itemsPerColumn_;
51
+ NSUInteger _itemsPerColumn;
50
52
 
51
53
  // width of each char
52
- NSUInteger itemWidth_;
54
+ NSUInteger _itemWidth;
53
55
  // height of each char
54
- NSUInteger itemHeight_;
56
+ NSUInteger _itemHeight;
55
57
 
56
58
  // quads to draw
57
- NSUInteger quadsToDraw_;
59
+ NSUInteger _quadsToDraw;
58
60
 
59
61
  // blend function
60
- ccBlendFunc blendFunc_;
62
+ ccBlendFunc _blendFunc;
61
63
 
62
64
  // texture RGBA.
63
- GLubyte opacity_;
64
- ccColor3B color_;
65
- ccColor3B colorUnmodified_;
66
- BOOL opacityModifyRGB_;
65
+ ccColor3B _colorUnmodified;
66
+ BOOL _opacityModifyRGB;
67
67
 
68
68
  // color uniform
69
- GLint uniformColor_;
69
+ GLint _uniformColor;
70
70
  }
71
71
 
72
72
  /** conforms to CCTextureProtocol protocol */
@@ -75,8 +75,6 @@
75
75
  /** conforms to CCTextureProtocol protocol */
76
76
  @property (nonatomic,readwrite) ccBlendFunc blendFunc;
77
77
 
78
- /** conforms to CCRGBAProtocol protocol */
79
- @property (nonatomic,readwrite) GLubyte opacity;
80
78
  /** conforms to CCRGBAProtocol protocol */
81
79
  @property (nonatomic,readwrite) ccColor3B color;
82
80
 
@@ -89,8 +87,12 @@
89
87
  /** initializes an CCAtlasNode with an Atlas file the width and height of each item measured in points and the quantity of items to render*/
90
88
  -(id) initWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c;
91
89
 
90
+ /** initializes an CCAtlasNode with a texture the width and height of each item measured in points and the quantity of items to render*/
91
+ -(id) initWithTexture:(CCTexture2D*)texture tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c;
92
+
93
+
92
94
  /** updates the Atlas (indexed vertex array).
93
- * Shall be overriden in subclasses
95
+ * Shall be overridden in subclasses
94
96
  */
95
97
  -(void) updateAtlasValues;
96
98
  @end
@@ -47,27 +47,27 @@
47
47
 
48
48
  - It doesn't work on batched nodes like CCSprite objects when they are parented to a CCSpriteBatchNode object.
49
49
 
50
- - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effecs, use the action CCFollow or position/scale/rotate.
50
+ - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action CCFollow or position/scale/rotate.
51
51
 
52
52
  */
53
53
 
54
54
  @interface CCCamera : NSObject
55
55
  {
56
- float eyeX_;
57
- float eyeY_;
58
- float eyeZ_;
56
+ float _eyeX;
57
+ float _eyeY;
58
+ float _eyeZ;
59
59
 
60
- float centerX_;
61
- float centerY_;
62
- float centerZ_;
60
+ float _centerX;
61
+ float _centerY;
62
+ float _centerZ;
63
63
 
64
- float upX_;
65
- float upY_;
66
- float upZ_;
64
+ float _upX;
65
+ float _upY;
66
+ float _upZ;
67
67
 
68
- BOOL dirty_;
68
+ BOOL _dirty;
69
69
 
70
- kmMat4 lookupMatrix_;
70
+ kmMat4 _lookupMatrix;
71
71
  }
72
72
 
73
73
  /** whether of not the camera is dirty */
@@ -0,0 +1,77 @@
1
+ /*
2
+ * cocos2d for iPhone: http://www.cocos2d-iphone.org
3
+ *
4
+ * Copyright (c) 2012 Pierre-David Bélanger
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ * THE SOFTWARE.
23
+ *
24
+ */
25
+
26
+ #import "CCNode.h"
27
+
28
+ /** CCClippingNode is a subclass of CCNode.
29
+ It draws its content (childs) clipped using a stencil.
30
+ The stencil is an other CCNode that will not be drawn.
31
+ The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
32
+ */
33
+ @interface CCClippingNode : CCNode
34
+ {
35
+ CCNode *_stencil;
36
+ GLfloat _alphaThreshold;
37
+ BOOL _inverted;
38
+ }
39
+
40
+ /** The CCNode to use as a stencil to do the clipping.
41
+ The stencil node will be retained.
42
+ This default to nil.
43
+ */
44
+ @property (nonatomic, retain) CCNode *stencil;
45
+
46
+ /** The alpha threshold.
47
+ The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.
48
+ Should be a float between 0 and 1.
49
+ This default to 1 (so alpha test is disabled).
50
+ */
51
+ @property (nonatomic) GLfloat alphaThreshold;
52
+
53
+ /** Inverted. If this is set to YES,
54
+ the stencil is inverted, so the content is drawn where the stencil is NOT drawn.
55
+ This default to NO.
56
+ */
57
+ @property (nonatomic) BOOL inverted;
58
+
59
+ /** Creates and initializes a clipping node without a stencil.
60
+ */
61
+ + (id)clippingNode;
62
+
63
+ /** Creates and initializes a clipping node with an other node as its stencil.
64
+ The stencil node will be retained.
65
+ */
66
+ + (id)clippingNodeWithStencil:(CCNode *)stencil;
67
+
68
+ /** Initializes a clipping node without a stencil.
69
+ */
70
+ - (id)init;
71
+
72
+ /** Initializes a clipping node with an other node as its stencil.
73
+ The stencil node will be retained, and its parent will be set to this clipping node.
74
+ */
75
+ - (id)initWithStencil:(CCNode *)stencil;
76
+
77
+ @end
@@ -51,30 +51,41 @@ enum {
51
51
  kCCMacVersion_10_8 = 0x0a080000,
52
52
  };
53
53
 
54
+ enum {
55
+ kCCDeviceiPhone,
56
+ kCCDeviceiPhoneRetinaDisplay,
57
+ kCCDeviceiPhone5,
58
+ kCCDeviceiPhone5RetinaDisplay,
59
+ kCCDeviceiPad,
60
+ kCCDeviceiPadRetinaDisplay,
61
+
62
+ kCCDeviceMac,
63
+ kCCDeviceMacRetinaDisplay,
64
+ };
65
+
54
66
  /**
55
67
  CCConfiguration contains some openGL variables
56
68
  @since v0.99.0
57
69
  */
58
70
  @interface CCConfiguration : NSObject {
59
71
 
60
- GLint maxTextureSize_;
61
- GLint maxModelviewStackDepth_;
62
- BOOL supportsPVRTC_;
63
- BOOL supportsNPOT_;
64
- BOOL supportsBGRA8888_;
65
- BOOL supportsDiscardFramebuffer_;
66
- BOOL supportsShareableVAO_;
67
- unsigned int OSVersion_;
68
- GLint maxSamplesAllowed_;
69
- GLint maxTextureUnits_;
72
+ BOOL _openGLInitialized;
73
+
74
+ GLint _maxTextureSize;
75
+ BOOL _supportsPVRTC;
76
+ BOOL _supportsNPOT;
77
+ BOOL _supportsBGRA8888;
78
+ BOOL _supportsDiscardFramebuffer;
79
+ BOOL _supportsShareableVAO;
80
+ GLint _maxSamplesAllowed;
81
+ GLint _maxTextureUnits;
82
+
83
+ unsigned int _OSVersion;
70
84
  }
71
85
 
72
86
  /** OpenGL Max texture size. */
73
87
  @property (nonatomic, readonly) GLint maxTextureSize;
74
88
 
75
- /** OpenGL Max Modelview Stack Depth. */
76
- @property (nonatomic, readonly) GLint maxModelviewStackDepth;
77
-
78
89
  /** returns the maximum texture units
79
90
  @since v2.0.0
80
91
  */
@@ -115,12 +126,19 @@ enum {
115
126
  */
116
127
  @property (nonatomic, readonly) unsigned int OSVersion;
117
128
 
129
+
118
130
  /** returns a shared instance of the CCConfiguration */
119
131
  +(CCConfiguration *) sharedConfiguration;
120
132
 
121
133
  /** returns whether or not an OpenGL is supported */
122
134
  - (BOOL) checkForGLExtension:(NSString *)searchName;
123
135
 
136
+ /** returns the current device */
137
+ -(NSInteger) runningDevice;
124
138
 
139
+ /** dumps in the console the CCConfiguration information.
140
+ @since v2.1
141
+ */
142
+ -(void) dumpInfo;
125
143
 
126
144
  @end
@@ -66,7 +66,7 @@ typedef enum {
66
66
  /**Class that creates and handle the main Window and manages how
67
67
  and when to execute the Scenes.
68
68
 
69
- The CCDirector is also resposible for:
69
+ The CCDirector is also responsible for:
70
70
  - initializing the OpenGL ES context
71
71
  - setting the OpenGL pixel format (default on is RGB565)
72
72
  - setting the OpenGL buffer depth (default one is 0-bit)
@@ -84,74 +84,74 @@ and when to execute the Scenes.
84
84
  @interface CCDirector : CC_VIEWCONTROLLER
85
85
  {
86
86
  // internal timer
87
- NSTimeInterval animationInterval_;
88
- NSTimeInterval oldAnimationInterval_;
87
+ NSTimeInterval _animationInterval;
88
+ NSTimeInterval _oldAnimationInterval;
89
89
 
90
90
  /* stats */
91
- BOOL displayStats_;
91
+ BOOL _displayStats;
92
92
 
93
- NSUInteger frames_;
94
- NSUInteger totalFrames_;
95
- ccTime secondsPerFrame_;
93
+ NSUInteger _frames;
94
+ NSUInteger _totalFrames;
95
+ ccTime _secondsPerFrame;
96
96
 
97
- ccTime accumDt_;
98
- ccTime frameRate_;
99
- CCLabelAtlas *FPSLabel_;
100
- CCLabelAtlas *SPFLabel_;
101
- CCLabelAtlas *drawsLabel_;
97
+ ccTime _accumDt;
98
+ ccTime _frameRate;
99
+ CCLabelAtlas *_FPSLabel;
100
+ CCLabelAtlas *_SPFLabel;
101
+ CCLabelAtlas *_drawsLabel;
102
102
 
103
103
  /* is the running scene paused */
104
- BOOL isPaused_;
104
+ BOOL _isPaused;
105
105
 
106
106
  /* Is the director running */
107
- BOOL isAnimating_;
107
+ BOOL _isAnimating;
108
108
 
109
109
  /* The running scene */
110
- CCScene *runningScene_;
110
+ CCScene *_runningScene;
111
111
 
112
112
  /* This object will be visited after the scene. Useful to hook a notification node */
113
- id notificationNode_;
113
+ id _notificationNode;
114
114
 
115
115
  /* will be the next 'runningScene' in the next frame
116
116
  nextScene is a weak reference. */
117
- CCScene *nextScene_;
117
+ CCScene *_nextScene;
118
118
 
119
119
  /* If YES, then "old" scene will receive the cleanup message */
120
- BOOL sendCleanupToScene_;
120
+ BOOL _sendCleanupToScene;
121
121
 
122
122
  /* scheduled scenes */
123
- NSMutableArray *scenesStack_;
123
+ NSMutableArray *_scenesStack;
124
124
 
125
125
  /* last time the main loop was updated */
126
- struct timeval lastUpdate_;
126
+ struct timeval _lastUpdate;
127
127
  /* delta time since last tick to main loop */
128
- ccTime dt;
128
+ ccTime _dt;
129
129
  /* whether or not the next delta time will be zero */
130
- BOOL nextDeltaTimeZero_;
130
+ BOOL _nextDeltaTimeZero;
131
131
 
132
132
  /* projection used */
133
- ccDirectorProjection projection_;
133
+ ccDirectorProjection _projection;
134
134
 
135
135
  /* CCDirector delegate */
136
- id<CCDirectorDelegate> delegate_;
136
+ id<CCDirectorDelegate> _delegate;
137
137
 
138
138
  /* window size in points */
139
- CGSize winSizeInPoints_;
139
+ CGSize _winSizeInPoints;
140
140
 
141
141
  /* window size in pixels */
142
- CGSize winSizeInPixels_;
142
+ CGSize _winSizeInPixels;
143
143
 
144
144
  /* the cocos2d running thread */
145
- NSThread *runningThread_;
145
+ NSThread *_runningThread;
146
146
 
147
147
  /* scheduler associated with this director */
148
- CCScheduler *scheduler_;
148
+ CCScheduler *_scheduler;
149
149
 
150
150
  /* action manager associated with this director */
151
- CCActionManager *actionManager_;
151
+ CCActionManager *_actionManager;
152
152
 
153
153
  /* OpenGLView. On iOS it is a copy of self.view */
154
- CCGLView *view_;
154
+ CCGLView *__view;
155
155
  }
156
156
 
157
157
  /** returns the cocos2d thread.
@@ -169,7 +169,7 @@ and when to execute the Scenes.
169
169
  /** whether or not the next delta time will be zero */
170
170
  @property (nonatomic,readwrite,assign) BOOL nextDeltaTimeZero;
171
171
  /** Whether or not the Director is paused */
172
- @property (nonatomic,readonly) BOOL isPaused;
172
+ @property (nonatomic,readonly,getter=isPaused) BOOL paused;
173
173
  /** Whether or not the Director is active (animating) */
174
174
  @property (nonatomic,readonly) BOOL isAnimating;
175
175
  /** Sets an OpenGL projection */
@@ -193,10 +193,10 @@ and when to execute the Scenes.
193
193
  */
194
194
  @property (nonatomic, readwrite, retain) id notificationNode;
195
195
 
196
- /** CCDirector delegate. It shall implemente the CCDirectorDelegate protocol
196
+ /** CCDirector delegate. It shall implement the CCDirectorDelegate protocol
197
197
  @since v0.99.5
198
198
  */
199
- @property (nonatomic, readwrite, retain) id<CCDirectorDelegate> delegate;
199
+ @property (nonatomic, readwrite, assign) id<CCDirectorDelegate> delegate;
200
200
 
201
201
  /** CCScheduler associated with this director
202
202
  @since v2.0
@@ -226,8 +226,11 @@ and when to execute the Scenes.
226
226
  /** changes the projection size */
227
227
  -(void) reshapeProjection:(CGSize)newWindowSize;
228
228
 
229
+ /** Sets the glViewport*/
230
+ -(void) setViewport;
231
+
229
232
  /** converts a UIKit coordinate to an OpenGL coordinate
230
- Useful to convert (multi) touchs coordinates to the current layout (portrait or landscape)
233
+ Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)
231
234
  */
232
235
  -(CGPoint) convertToGL: (CGPoint) p;
233
236
  /** converts an OpenGL coordinate to a UIKit coordinate
@@ -240,7 +243,7 @@ and when to execute the Scenes.
240
243
 
241
244
  #pragma mark Director - Scene Management
242
245
 
243
- /**Enters the Director's main loop with the given Scene.
246
+ /** Enters the Director's main loop with the given Scene.
244
247
  * Call it to run only your FIRST scene.
245
248
  * Don't call it if there is already a running scene.
246
249
  *
@@ -248,14 +251,14 @@ and when to execute the Scenes.
248
251
  */
249
252
  - (void) runWithScene:(CCScene*) scene;
250
253
 
251
- /**Suspends the execution of the running scene, pushing it on the stack of suspended scenes.
254
+ /** Suspends the execution of the running scene, pushing it on the stack of suspended scenes.
252
255
  * The new scene will be executed.
253
256
  * Try to avoid big stacks of pushed scenes to reduce memory allocation.
254
257
  * ONLY call it if there is a running scene.
255
258
  */
256
259
  - (void) pushScene:(CCScene*) scene;
257
260
 
258
- /**Pops out a scene from the queue.
261
+ /** Pops out a scene from the queue.
259
262
  * This scene will replace the running one.
260
263
  * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.
261
264
  * ONLY call it if there is a running scene.
@@ -264,11 +267,17 @@ and when to execute the Scenes.
264
267
 
265
268
  /**Pops out all scenes from the queue until the root scene in the queue.
266
269
  * This scene will replace the running one.
267
- * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.
268
- * ONLY call it if there is a running scene.
270
+ * Internally it will call `popToSceneStackLevel:1`
269
271
  */
270
272
  - (void) popToRootScene;
271
273
 
274
+ /** Pops out all scenes from the queue until it reaches `level`.
275
+ If level is 0, it will end the director.
276
+ If level is 1, it will pop all scenes until it reaches to root scene.
277
+ If level is <= than the current stack level, it won't do anything.
278
+ */
279
+ -(void) popToSceneStackLevel:(NSUInteger)level;
280
+
272
281
  /** Replaces the running scene with a new one. The running scene is terminated.
273
282
  * ONLY call it if there is a running scene.
274
283
  */
@@ -281,7 +290,7 @@ and when to execute the Scenes.
281
290
 
282
291
  /** Pauses the running scene.
283
292
  The running scene will be _drawed_ but all scheduled timers will be paused
284
- While paused, the draw rate will be 4 FPS to reduce CPU consuption
293
+ While paused, the draw rate will be 4 FPS to reduce CPU consumption
285
294
  */
286
295
  -(void) pause;
287
296
 
@@ -292,13 +301,13 @@ and when to execute the Scenes.
292
301
  -(void) resume;
293
302
 
294
303
  /** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore.
295
- If you wan't to pause your animation call [pause] instead.
304
+ If you want to pause your animation call [pause] instead.
296
305
  */
297
306
  -(void) stopAnimation;
298
307
 
299
308
  /** The main loop is triggered again.
300
309
  Call this function only if [stopAnimation] was called earlier
301
- @warning Dont' call this function to start the main loop. To run the main loop call runWithScene
310
+ @warning Don't call this function to start the main loop. To run the main loop call runWithScene
302
311
  */
303
312
  -(void) startAnimation;
304
313
 
@@ -0,0 +1,65 @@
1
+ /* Copyright (c) 2012 Scott Lembcke and Howling Moon Software
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to deal
5
+ * in the Software without restriction, including without limitation the rights
6
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ * copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ * SOFTWARE.
20
+ */
21
+
22
+ /*
23
+ * Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol
24
+ *
25
+ * Renamed and added some changes for cocos2d
26
+ *
27
+ */
28
+
29
+ #import "CCNode.h"
30
+
31
+ /** CCDrawNode
32
+ Node that draws dots, segments and polygons.
33
+ Faster than the "drawing primitives" since they it draws everything in one single batch.
34
+
35
+ @since v2.1
36
+ */
37
+ @interface CCDrawNode : CCNode
38
+ {
39
+ GLuint _vao;
40
+ GLuint _vbo;
41
+
42
+ NSUInteger _bufferCapacity;
43
+ GLsizei _bufferCount;
44
+ ccV2F_C4B_T2F *_buffer;
45
+
46
+ ccBlendFunc _blendFunc;
47
+
48
+ BOOL _dirty;
49
+ }
50
+
51
+ @property(nonatomic, assign) ccBlendFunc blendFunc;
52
+
53
+ /** draw a dot at a position, with a given radius and color */
54
+ -(void)drawDot:(CGPoint)pos radius:(CGFloat)radius color:(ccColor4F)color;
55
+
56
+ /** draw a segment with a radius and color */
57
+ -(void)drawSegmentFrom:(CGPoint)a to:(CGPoint)b radius:(CGFloat)radius color:(ccColor4F)color;
58
+
59
+ /** draw a polygon with a fill color and line color */
60
+ -(void)drawPolyWithVerts:(CGPoint*)verts count:(NSUInteger)count fillColor:(ccColor4F)fill borderWidth:(CGFloat)width borderColor:(ccColor4F)line;
61
+
62
+ /** Clear the geometry in the node's buffer. */
63
+ -(void)clear;
64
+
65
+ @end