├── .gitignore ├── PRKit Mac example ├── PRKit Mac example.xcodeproj │ └── project.pbxproj └── PRKit Mac example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── HelloWorldLayer.h │ ├── HelloWorldLayer.m │ ├── Prefix.pch │ ├── Resources │ ├── English.lproj │ │ ├── InfoPlist.strings │ │ └── MainMenu.xib │ ├── Info.plist │ ├── fps_images.png │ ├── icon.icns │ └── pattern1.png │ ├── libs │ ├── CocosDenshion │ │ ├── CDAudioManager.h │ │ ├── CDAudioManager.m │ │ ├── CDConfig.h │ │ ├── CDOpenALSupport.h │ │ ├── CDOpenALSupport.m │ │ ├── CocosDenshion.h │ │ ├── CocosDenshion.m │ │ ├── SimpleAudioEngine.h │ │ └── SimpleAudioEngine.m │ ├── CocosDenshionExtras │ │ ├── CDXMacOSXSupport.h │ │ ├── CDXMacOSXSupport.m │ │ ├── CDXPropertyModifierAction.h │ │ └── CDXPropertyModifierAction.m │ ├── LICENSE_CocosDenshion.txt │ ├── LICENSE_Kazmath.txt │ ├── LICENSE_cocos2d.txt │ ├── cocos2d │ │ ├── CCAction.h │ │ ├── CCAction.m │ │ ├── CCActionCamera.h │ │ ├── CCActionCamera.m │ │ ├── CCActionCatmullRom.h │ │ ├── CCActionCatmullRom.m │ │ ├── CCActionEase.h │ │ ├── CCActionEase.m │ │ ├── CCActionGrid.h │ │ ├── CCActionGrid.m │ │ ├── CCActionGrid3D.h │ │ ├── CCActionGrid3D.m │ │ ├── CCActionInstant.h │ │ ├── CCActionInstant.m │ │ ├── CCActionInterval.h │ │ ├── CCActionInterval.m │ │ ├── CCActionManager.h │ │ ├── CCActionManager.m │ │ ├── CCActionPageTurn3D.h │ │ ├── CCActionPageTurn3D.m │ │ ├── CCActionProgressTimer.h │ │ ├── CCActionProgressTimer.m │ │ ├── CCActionTiledGrid.h │ │ ├── CCActionTiledGrid.m │ │ ├── CCActionTween.h │ │ ├── CCActionTween.m │ │ ├── CCAnimation.h │ │ ├── CCAnimation.m │ │ ├── CCAnimationCache.h │ │ ├── CCAnimationCache.m │ │ ├── CCAtlasNode.h │ │ ├── CCAtlasNode.m │ │ ├── CCCamera.h │ │ ├── CCCamera.m │ │ ├── CCConfiguration.h │ │ ├── CCConfiguration.m │ │ ├── CCDirector.h │ │ ├── CCDirector.m │ │ ├── CCDrawingPrimitives.h │ │ ├── CCDrawingPrimitives.m │ │ ├── CCGLProgram.h │ │ ├── CCGLProgram.m │ │ ├── CCGrabber.h │ │ ├── CCGrabber.m │ │ ├── CCGrid.h │ │ ├── CCGrid.m │ │ ├── CCLabelAtlas.h │ │ ├── CCLabelAtlas.m │ │ ├── CCLabelBMFont.h │ │ ├── CCLabelBMFont.m │ │ ├── CCLabelTTF.h │ │ ├── CCLabelTTF.m │ │ ├── CCLayer.h │ │ ├── CCLayer.m │ │ ├── CCMenu.h │ │ ├── CCMenu.m │ │ ├── CCMenuItem.h │ │ ├── CCMenuItem.m │ │ ├── CCMotionStreak.h │ │ ├── CCMotionStreak.m │ │ ├── CCNode+Debug.h │ │ ├── CCNode+Debug.m │ │ ├── CCNode.h │ │ ├── CCNode.m │ │ ├── CCParallaxNode.h │ │ ├── CCParallaxNode.m │ │ ├── CCParticleBatchNode.h │ │ ├── CCParticleBatchNode.m │ │ ├── CCParticleExamples.h │ │ ├── CCParticleExamples.m │ │ ├── CCParticleSystem.h │ │ ├── CCParticleSystem.m │ │ ├── CCParticleSystemQuad.h │ │ ├── CCParticleSystemQuad.m │ │ ├── CCProgressTimer.h │ │ ├── CCProgressTimer.m │ │ ├── CCProtocols.h │ │ ├── CCRenderTexture.h │ │ ├── CCRenderTexture.m │ │ ├── CCScene.h │ │ ├── CCScene.m │ │ ├── CCScheduler.h │ │ ├── CCScheduler.m │ │ ├── CCShaderCache.h │ │ ├── CCShaderCache.m │ │ ├── CCSprite.h │ │ ├── CCSprite.m │ │ ├── CCSpriteBatchNode.h │ │ ├── CCSpriteBatchNode.m │ │ ├── CCSpriteFrame.h │ │ ├── CCSpriteFrame.m │ │ ├── CCSpriteFrameCache.h │ │ ├── CCSpriteFrameCache.m │ │ ├── CCTMXLayer.h │ │ ├── CCTMXLayer.m │ │ ├── CCTMXObjectGroup.h │ │ ├── CCTMXObjectGroup.m │ │ ├── CCTMXTiledMap.h │ │ ├── CCTMXTiledMap.m │ │ ├── CCTMXXMLParser.h │ │ ├── CCTMXXMLParser.m │ │ ├── CCTexture2D.h │ │ ├── CCTexture2D.m │ │ ├── CCTextureAtlas.h │ │ ├── CCTextureAtlas.m │ │ ├── CCTextureCache.h │ │ ├── CCTextureCache.m │ │ ├── CCTexturePVR.h │ │ ├── CCTexturePVR.m │ │ ├── CCTileMapAtlas.h │ │ ├── CCTileMapAtlas.m │ │ ├── CCTransition.h │ │ ├── CCTransition.m │ │ ├── CCTransitionPageTurn.h │ │ ├── CCTransitionPageTurn.m │ │ ├── CCTransitionProgress.h │ │ ├── CCTransitionProgress.m │ │ ├── Platforms │ │ │ ├── CCGL.h │ │ │ ├── CCNS.h │ │ │ ├── Mac │ │ │ │ ├── CCDirectorMac.h │ │ │ │ ├── CCDirectorMac.m │ │ │ │ ├── CCEventDispatcher.h │ │ │ │ ├── CCEventDispatcher.m │ │ │ │ ├── CCGLView.h │ │ │ │ ├── CCGLView.m │ │ │ │ ├── CCWindow.h │ │ │ │ └── CCWindow.m │ │ │ └── iOS │ │ │ │ ├── CCDirectorIOS.h │ │ │ │ ├── CCDirectorIOS.m │ │ │ │ ├── CCES2Renderer.h │ │ │ │ ├── CCES2Renderer.m │ │ │ │ ├── CCESRenderer.h │ │ │ │ ├── CCGLView.h │ │ │ │ ├── CCGLView.m │ │ │ │ ├── CCTouchDelegateProtocol.h │ │ │ │ ├── CCTouchDispatcher.h │ │ │ │ ├── CCTouchDispatcher.m │ │ │ │ ├── CCTouchHandler.h │ │ │ │ └── CCTouchHandler.m │ │ ├── Support │ │ │ ├── CCArray.h │ │ │ ├── CCArray.m │ │ │ ├── CCFileUtils.h │ │ │ ├── CCFileUtils.m │ │ │ ├── CCProfiling.h │ │ │ ├── CCProfiling.m │ │ │ ├── CCVertex.h │ │ │ ├── CCVertex.m │ │ │ ├── CGPointExtension.h │ │ │ ├── CGPointExtension.m │ │ │ ├── NSThread+performBlock.h │ │ │ ├── NSThread+performBlock.m │ │ │ ├── OpenGL_Internal.h │ │ │ ├── TGAlib.h │ │ │ ├── TGAlib.m │ │ │ ├── TransformUtils.h │ │ │ ├── TransformUtils.m │ │ │ ├── ZipUtils.h │ │ │ ├── ZipUtils.m │ │ │ ├── base64.c │ │ │ ├── base64.h │ │ │ ├── ccCArray.h │ │ │ ├── ccCArray.m │ │ │ ├── ccUtils.c │ │ │ ├── ccUtils.h │ │ │ ├── uthash.h │ │ │ └── utlist.h │ │ ├── ccConfig.h │ │ ├── ccDeprecated.h │ │ ├── ccDeprecated.m │ │ ├── ccGLStateCache.h │ │ ├── ccGLStateCache.m │ │ ├── ccMacros.h │ │ ├── ccShader_PositionColor_frag.h │ │ ├── ccShader_PositionColor_vert.h │ │ ├── ccShader_PositionTextureA8Color_frag.h │ │ ├── ccShader_PositionTextureA8Color_vert.h │ │ ├── ccShader_PositionTextureColorAlphaTest_frag.h │ │ ├── ccShader_PositionTextureColor_frag.h │ │ ├── ccShader_PositionTextureColor_vert.h │ │ ├── ccShader_PositionTexture_frag.h │ │ ├── ccShader_PositionTexture_uColor_frag.h │ │ ├── ccShader_PositionTexture_uColor_vert.h │ │ ├── ccShader_PositionTexture_vert.h │ │ ├── ccShader_Position_uColor_frag.h │ │ ├── ccShader_Position_uColor_vert.h │ │ ├── ccShaders.h │ │ ├── ccShaders.m │ │ ├── ccTypes.h │ │ ├── cocos2d.h │ │ └── cocos2d.m │ └── kazmath │ │ ├── include │ │ └── kazmath │ │ │ ├── GL │ │ │ ├── mat4stack.h │ │ │ └── matrix.h │ │ │ ├── aabb.h │ │ │ ├── kazmath.h │ │ │ ├── mat3.h │ │ │ ├── mat4.h │ │ │ ├── neon_matrix_impl.h │ │ │ ├── plane.h │ │ │ ├── quaternion.h │ │ │ ├── ray2.h │ │ │ ├── utility.h │ │ │ ├── vec2.h │ │ │ ├── vec3.h │ │ │ └── vec4.h │ │ └── src │ │ ├── CMakeLists.txt │ │ ├── ChangeLog │ │ ├── GL │ │ ├── mat4stack.c │ │ └── matrix.c │ │ ├── aabb.c │ │ ├── mat3.c │ │ ├── mat4.c │ │ ├── neon_matrix_impl.c │ │ ├── plane.c │ │ ├── quaternion.c │ │ ├── ray2.c │ │ ├── utility.c │ │ ├── vec2.c │ │ ├── vec3.c │ │ └── vec4.c │ └── main.m ├── PRKit iOS example ├── PRKit iOS example.xcodeproj │ └── project.pbxproj └── PRKit iOS example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── HelloWorldLayer.h │ ├── HelloWorldLayer.m │ ├── IntroLayer.h │ ├── IntroLayer.m │ ├── Prefix.pch │ ├── Resources │ ├── Default-Landscape~ipad.png │ ├── Default.png │ ├── Icon-72.png │ ├── Icon-Small-50.png │ ├── Icon-Small.png │ ├── Icon-Small@2x.png │ ├── Icon.png │ ├── Icon@2x.png │ ├── Info.plist │ ├── fps_images-hd.png │ ├── fps_images-ipadhd.png │ ├── fps_images.png │ ├── iTunesArtwork │ └── pattern1.png │ ├── libs │ ├── CocosDenshion │ │ ├── CDAudioManager.h │ │ ├── CDAudioManager.m │ │ ├── CDConfig.h │ │ ├── CDOpenALSupport.h │ │ ├── CDOpenALSupport.m │ │ ├── CocosDenshion.h │ │ ├── CocosDenshion.m │ │ ├── SimpleAudioEngine.h │ │ └── SimpleAudioEngine.m │ ├── LICENSE_CocosDenshion.txt │ ├── LICENSE_Kazmath.txt │ ├── LICENSE_cocos2d.txt │ ├── cocos2d │ │ ├── CCAction.h │ │ ├── CCAction.m │ │ ├── CCActionCamera.h │ │ ├── CCActionCamera.m │ │ ├── CCActionCatmullRom.h │ │ ├── CCActionCatmullRom.m │ │ ├── CCActionEase.h │ │ ├── CCActionEase.m │ │ ├── CCActionGrid.h │ │ ├── CCActionGrid.m │ │ ├── CCActionGrid3D.h │ │ ├── CCActionGrid3D.m │ │ ├── CCActionInstant.h │ │ ├── CCActionInstant.m │ │ ├── CCActionInterval.h │ │ ├── CCActionInterval.m │ │ ├── CCActionManager.h │ │ ├── CCActionManager.m │ │ ├── CCActionPageTurn3D.h │ │ ├── CCActionPageTurn3D.m │ │ ├── CCActionProgressTimer.h │ │ ├── CCActionProgressTimer.m │ │ ├── CCActionTiledGrid.h │ │ ├── CCActionTiledGrid.m │ │ ├── CCActionTween.h │ │ ├── CCActionTween.m │ │ ├── CCAnimation.h │ │ ├── CCAnimation.m │ │ ├── CCAnimationCache.h │ │ ├── CCAnimationCache.m │ │ ├── CCAtlasNode.h │ │ ├── CCAtlasNode.m │ │ ├── CCCamera.h │ │ ├── CCCamera.m │ │ ├── CCConfiguration.h │ │ ├── CCConfiguration.m │ │ ├── CCDirector.h │ │ ├── CCDirector.m │ │ ├── CCDrawingPrimitives.h │ │ ├── CCDrawingPrimitives.m │ │ ├── CCGLProgram.h │ │ ├── CCGLProgram.m │ │ ├── CCGrabber.h │ │ ├── CCGrabber.m │ │ ├── CCGrid.h │ │ ├── CCGrid.m │ │ ├── CCLabelAtlas.h │ │ ├── CCLabelAtlas.m │ │ ├── CCLabelBMFont.h │ │ ├── CCLabelBMFont.m │ │ ├── CCLabelTTF.h │ │ ├── CCLabelTTF.m │ │ ├── CCLayer.h │ │ ├── CCLayer.m │ │ ├── CCMenu.h │ │ ├── CCMenu.m │ │ ├── CCMenuItem.h │ │ ├── CCMenuItem.m │ │ ├── CCMotionStreak.h │ │ ├── CCMotionStreak.m │ │ ├── CCNode+Debug.h │ │ ├── CCNode+Debug.m │ │ ├── CCNode.h │ │ ├── CCNode.m │ │ ├── CCParallaxNode.h │ │ ├── CCParallaxNode.m │ │ ├── CCParticleBatchNode.h │ │ ├── CCParticleBatchNode.m │ │ ├── CCParticleExamples.h │ │ ├── CCParticleExamples.m │ │ ├── CCParticleSystem.h │ │ ├── CCParticleSystem.m │ │ ├── CCParticleSystemQuad.h │ │ ├── CCParticleSystemQuad.m │ │ ├── CCProgressTimer.h │ │ ├── CCProgressTimer.m │ │ ├── CCProtocols.h │ │ ├── CCRenderTexture.h │ │ ├── CCRenderTexture.m │ │ ├── CCScene.h │ │ ├── CCScene.m │ │ ├── CCScheduler.h │ │ ├── CCScheduler.m │ │ ├── CCShaderCache.h │ │ ├── CCShaderCache.m │ │ ├── CCSprite.h │ │ ├── CCSprite.m │ │ ├── CCSpriteBatchNode.h │ │ ├── CCSpriteBatchNode.m │ │ ├── CCSpriteFrame.h │ │ ├── CCSpriteFrame.m │ │ ├── CCSpriteFrameCache.h │ │ ├── CCSpriteFrameCache.m │ │ ├── CCTMXLayer.h │ │ ├── CCTMXLayer.m │ │ ├── CCTMXObjectGroup.h │ │ ├── CCTMXObjectGroup.m │ │ ├── CCTMXTiledMap.h │ │ ├── CCTMXTiledMap.m │ │ ├── CCTMXXMLParser.h │ │ ├── CCTMXXMLParser.m │ │ ├── CCTexture2D.h │ │ ├── CCTexture2D.m │ │ ├── CCTextureAtlas.h │ │ ├── CCTextureAtlas.m │ │ ├── CCTextureCache.h │ │ ├── CCTextureCache.m │ │ ├── CCTexturePVR.h │ │ ├── CCTexturePVR.m │ │ ├── CCTileMapAtlas.h │ │ ├── CCTileMapAtlas.m │ │ ├── CCTransition.h │ │ ├── CCTransition.m │ │ ├── CCTransitionPageTurn.h │ │ ├── CCTransitionPageTurn.m │ │ ├── CCTransitionProgress.h │ │ ├── CCTransitionProgress.m │ │ ├── Platforms │ │ │ ├── CCGL.h │ │ │ ├── CCNS.h │ │ │ ├── Mac │ │ │ │ ├── CCDirectorMac.h │ │ │ │ ├── CCDirectorMac.m │ │ │ │ ├── CCEventDispatcher.h │ │ │ │ ├── CCEventDispatcher.m │ │ │ │ ├── CCGLView.h │ │ │ │ ├── CCGLView.m │ │ │ │ ├── CCWindow.h │ │ │ │ └── CCWindow.m │ │ │ └── iOS │ │ │ │ ├── CCDirectorIOS.h │ │ │ │ ├── CCDirectorIOS.m │ │ │ │ ├── CCES2Renderer.h │ │ │ │ ├── CCES2Renderer.m │ │ │ │ ├── CCESRenderer.h │ │ │ │ ├── CCGLView.h │ │ │ │ ├── CCGLView.m │ │ │ │ ├── CCTouchDelegateProtocol.h │ │ │ │ ├── CCTouchDispatcher.h │ │ │ │ ├── CCTouchDispatcher.m │ │ │ │ ├── CCTouchHandler.h │ │ │ │ └── CCTouchHandler.m │ │ ├── Support │ │ │ ├── CCArray.h │ │ │ ├── CCArray.m │ │ │ ├── CCFileUtils.h │ │ │ ├── CCFileUtils.m │ │ │ ├── CCProfiling.h │ │ │ ├── CCProfiling.m │ │ │ ├── CCVertex.h │ │ │ ├── CCVertex.m │ │ │ ├── CGPointExtension.h │ │ │ ├── CGPointExtension.m │ │ │ ├── NSThread+performBlock.h │ │ │ ├── NSThread+performBlock.m │ │ │ ├── OpenGL_Internal.h │ │ │ ├── TGAlib.h │ │ │ ├── TGAlib.m │ │ │ ├── TransformUtils.h │ │ │ ├── TransformUtils.m │ │ │ ├── ZipUtils.h │ │ │ ├── ZipUtils.m │ │ │ ├── base64.c │ │ │ ├── base64.h │ │ │ ├── ccCArray.h │ │ │ ├── ccCArray.m │ │ │ ├── ccUtils.c │ │ │ ├── ccUtils.h │ │ │ ├── uthash.h │ │ │ └── utlist.h │ │ ├── ccConfig.h │ │ ├── ccDeprecated.h │ │ ├── ccDeprecated.m │ │ ├── ccGLStateCache.h │ │ ├── ccGLStateCache.m │ │ ├── ccMacros.h │ │ ├── ccShader_PositionColor_frag.h │ │ ├── ccShader_PositionColor_vert.h │ │ ├── ccShader_PositionTextureA8Color_frag.h │ │ ├── ccShader_PositionTextureA8Color_vert.h │ │ ├── ccShader_PositionTextureColorAlphaTest_frag.h │ │ ├── ccShader_PositionTextureColor_frag.h │ │ ├── ccShader_PositionTextureColor_vert.h │ │ ├── ccShader_PositionTexture_frag.h │ │ ├── ccShader_PositionTexture_uColor_frag.h │ │ ├── ccShader_PositionTexture_uColor_vert.h │ │ ├── ccShader_PositionTexture_vert.h │ │ ├── ccShader_Position_uColor_frag.h │ │ ├── ccShader_Position_uColor_vert.h │ │ ├── ccShaders.h │ │ ├── ccShaders.m │ │ ├── ccTypes.h │ │ ├── cocos2d.h │ │ └── cocos2d.m │ └── kazmath │ │ ├── include │ │ └── kazmath │ │ │ ├── GL │ │ │ ├── mat4stack.h │ │ │ └── matrix.h │ │ │ ├── aabb.h │ │ │ ├── kazmath.h │ │ │ ├── mat3.h │ │ │ ├── mat4.h │ │ │ ├── neon_matrix_impl.h │ │ │ ├── plane.h │ │ │ ├── quaternion.h │ │ │ ├── ray2.h │ │ │ ├── utility.h │ │ │ ├── vec2.h │ │ │ ├── vec3.h │ │ │ └── vec4.h │ │ └── src │ │ ├── CMakeLists.txt │ │ ├── ChangeLog │ │ ├── GL │ │ ├── mat4stack.c │ │ └── matrix.c │ │ ├── aabb.c │ │ ├── mat3.c │ │ ├── mat4.c │ │ ├── neon_matrix_impl.c │ │ ├── plane.c │ │ ├── quaternion.c │ │ ├── ray2.c │ │ ├── utility.c │ │ ├── vec2.c │ │ ├── vec3.c │ │ └── vec4.c │ └── main.m ├── PRKit ├── PRFilledPolygon.h ├── PRFilledPolygon.m ├── PRRatcliffTriangulator.h ├── PRRatcliffTriangulator.mm ├── PRTriangulator.h ├── triangulate.cpp └── triangulate.h └── README.markdown /.gitignore: -------------------------------------------------------------------------------- 1 | # old school 2 | .svn 3 | 4 | # osx noise 5 | .DS_store 6 | .DS_Store 7 | profile 8 | 9 | # Mac OS X Finder 10 | .DS_Store 11 | # Sparkle distribution Private Key (Don’t check me in!) 12 | dsa_priv.pem 13 | # XCode (and ancestors) per-user config (very noisy, and not relevant) 14 | *.mode1 15 | *.mode1v3 16 | *.mode2v3 17 | *.perspective 18 | *.perspectivev3 19 | *.pbxuser 20 | # Xcode 4 21 | xcuserdata/ 22 | project.xcworkspace/ 23 | # Generated files 24 | VersionX-revision.h 25 | # build products 26 | build/ 27 | *.[oa] 28 | # Other source repository archive directories (protects when importing) 29 | .hg 30 | .svn 31 | CVS 32 | # automatic backup files 33 | *~.nib 34 | *.swp 35 | *~ 36 | *(Autosaved).rtfd/ 37 | Backup[ ]of[ ]*.pages/ 38 | Backup[ ]of[ ]*.key/ 39 | Backup[ ]of[ ]*.numbers/ 40 | *.zip 41 | *.a -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PRKit Mac example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | #import "cocos2d.h" 10 | 11 | @interface PRKit_Mac_exampleAppDelegate : NSObject 12 | { 13 | NSWindow *window_; 14 | CCGLView *glView_; 15 | } 16 | 17 | @property (assign) IBOutlet NSWindow *window; 18 | @property (assign) IBOutlet CCGLView *glView; 19 | 20 | - (IBAction)toggleFullScreen:(id)sender; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // PRKit Mac example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "HelloWorldLayer.h" 11 | 12 | @implementation PRKit_Mac_exampleAppDelegate 13 | @synthesize window=window_, glView=glView_; 14 | 15 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 16 | { 17 | CCDirectorMac *director = (CCDirectorMac*) [CCDirector sharedDirector]; 18 | 19 | // enable FPS and SPF 20 | [director setDisplayStats:YES]; 21 | 22 | // connect the OpenGL view with the director 23 | [director setView:glView_]; 24 | 25 | // EXPERIMENTAL stuff. 26 | // 'Effects' don't work correctly when autoscale is turned on. 27 | // Use kCCDirectorResize_NoScale if you don't want auto-scaling. 28 | [director setResizeMode:kCCDirectorResize_AutoScale]; 29 | 30 | // Enable "moving" mouse event. Default no. 31 | [window_ setAcceptsMouseMovedEvents:NO]; 32 | 33 | // Center main window 34 | [window_ center]; 35 | 36 | [director runWithScene:[HelloWorldLayer scene]]; 37 | } 38 | 39 | - (BOOL) applicationShouldTerminateAfterLastWindowClosed: (NSApplication *) theApplication 40 | { 41 | return YES; 42 | } 43 | 44 | - (void)dealloc 45 | { 46 | [[CCDirector sharedDirector] end]; 47 | [window_ release]; 48 | [super dealloc]; 49 | } 50 | 51 | #pragma mark AppDelegate - IBActions 52 | 53 | - (IBAction)toggleFullScreen: (id)sender 54 | { 55 | CCDirectorMac *director = (CCDirectorMac*) [CCDirector sharedDirector]; 56 | [director setFullScreen: ! [director isFullScreen] ]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/HelloWorldLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // HelloWorldLayer.h 3 | // PRKit Mac example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | 10 | // When you import this file, you import all the cocos2d classes 11 | #import "cocos2d.h" 12 | 13 | // HelloWorldLayer 14 | @interface HelloWorldLayer : CCLayer 15 | { 16 | } 17 | 18 | // returns a CCScene that contains the HelloWorldLayer as the only child 19 | +(CCScene *) scene; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'cocos2d-mac' target in the 'cocos2d-mac' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | icon 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Resources/fps_images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit Mac example/PRKit Mac example/Resources/fps_images.png -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit Mac example/PRKit Mac example/Resources/icon.icns -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/Resources/pattern1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit Mac example/PRKit Mac example/Resources/pattern1.png -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/CocosDenshionExtras/CDXPropertyModifierAction.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2010 Steve Oldmeadow 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | $Id$ 23 | */ 24 | 25 | #import "cocos2d.h" 26 | #import "SimpleAudioEngine.h" 27 | 28 | /** Base class for actions that modify audio properties 29 | @since v 1.0 30 | */ 31 | @interface CDXPropertyModifierAction : CCActionInterval { 32 | CDPropertyModifier *modifier; 33 | float lastSetValue; 34 | } 35 | /** creates the action */ 36 | +(id) actionWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; 37 | 38 | /** initializes the action */ 39 | -(id) initWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; 40 | 41 | +(void) fadeSoundEffects:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop; 42 | +(void) fadeSoundEffect:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop effect:(CDSoundSource*) effect; 43 | +(void) fadeBackgroundMusic:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType) curve shouldStop:(BOOL) stop; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/LICENSE_CocosDenshion.txt: -------------------------------------------------------------------------------- 1 | CocosDenshion Sound Engine 2 | 3 | Copyright (c) 2010 Steve Oldmeadow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/LICENSE_Kazmath.txt: -------------------------------------------------------------------------------- 1 | Kazmath is a 3D math library aimed at game programming. It is released under the modified BSD license. 2 | 3 | Authors 4 | 5 | Luke Benstead 6 | Carsten Haubold 7 | 8 | License 9 | 10 | Copyright (c) 2008, Luke Benstead. 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | * Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright notice, 19 | this list of conditions and the following disclaimer in the documentation 20 | and/or other materials provided with the distribution. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | 34 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/LICENSE_cocos2d.txt: -------------------------------------------------------------------------------- 1 | cocos2d for iPhone: http://www.cocos2d-iphone.org 2 | 3 | Copyright (c) 2011 - Zynga Inc. and contributors 4 | (see each file to see the different copyright owners) 5 | 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCActionPageTurn3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ 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 | 27 | #import "CCActionGrid3D.h" 28 | 29 | /** 30 | * This action simulates a page turn from the bottom right hand corner of the screen 31 | * It's not much use by itself but is used by the PageTurnTransition. 32 | * 33 | * Based on an original paper by L Hong et al. 34 | * http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html 35 | * 36 | * @since v0.8.2 37 | */ 38 | @interface CCPageTurn3D : CCGrid3DAction 39 | { 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCActionProgressTimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (C) 2010 Lam Pham 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 | 27 | #import 28 | #import "CCProgressTimer.h" 29 | #import "CCActionInterval.h" 30 | 31 | /** 32 | Progress to percentage 33 | @since v0.99.1 34 | */ 35 | @interface CCProgressTo : CCActionInterval 36 | { 37 | float to_; 38 | float from_; 39 | } 40 | /** Creates and initializes with a duration and a percent */ 41 | +(id) actionWithDuration:(ccTime)duration percent:(float)percent; 42 | /** Initializes with a duration and a percent */ 43 | -(id) initWithDuration:(ccTime)duration percent:(float)percent; 44 | @end 45 | 46 | /** 47 | Progress from a percentage to another percentage 48 | @since v0.99.1 49 | */ 50 | @interface CCProgressFromTo : CCActionInterval 51 | { 52 | float to_; 53 | float from_; 54 | } 55 | /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ 56 | +(id) actionWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; 57 | /** Initializes the action with a duration, a "from" percentage and a "to" percentage */ 58 | -(id) initWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; 59 | @end 60 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCActionTween.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright 2009 lhunath (Maarten Billemont) 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 | 27 | #import 28 | #import "CCActionInterval.h" 29 | 30 | /** CCActionTween 31 | 32 | CCActionTween is an action that lets you update any property of an object. 33 | For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then: 34 | 35 | id modifyWidth = [CCActionTween actionWithDuration:2 key:@"width" from:200 to:300]; 36 | [target runAction:modifyWidth]; 37 | 38 | 39 | Another example: CCScaleTo action could be rewriten using CCPropertyAction: 40 | 41 | // scaleA and scaleB are equivalents 42 | id scaleA = [CCScaleTo actionWithDuration:2 scale:3]; 43 | id scaleB = [CCActionTween actionWithDuration:2 key:@"scale" from:1 to:3]; 44 | 45 | 46 | @since v0.99.2 47 | */ 48 | @interface CCActionTween : CCActionInterval 49 | { 50 | NSString *key_; 51 | 52 | float from_, to_; 53 | float delta_; 54 | } 55 | 56 | /** creates an initializes the action with the property name (key), and the from and to parameters. */ 57 | + (id)actionWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; 58 | 59 | /** initializes the action with the property name (key), and the from and to parameters. */ 60 | - (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCActionTween.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright 2009 lhunath (Maarten Billemont) 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 "CCActionTween.h" 27 | 28 | 29 | @implementation CCActionTween 30 | 31 | + (id)actionWithDuration:(ccTime)aDuration key:(NSString *)aKey from:(float)aFrom to:(float)aTo { 32 | 33 | return [[[[self class] alloc] initWithDuration:aDuration key:aKey from:aFrom to:aTo] autorelease]; 34 | } 35 | 36 | - (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to { 37 | 38 | if ((self = [super initWithDuration:aDuration])) { 39 | 40 | key_ = [key copy]; 41 | to_ = to; 42 | from_ = from; 43 | 44 | } 45 | 46 | return self; 47 | } 48 | 49 | - (void) dealloc 50 | { 51 | [key_ release]; 52 | [super dealloc]; 53 | } 54 | 55 | - (void)startWithTarget:aTarget 56 | { 57 | [super startWithTarget:aTarget]; 58 | delta_ = to_ - from_; 59 | } 60 | 61 | - (void) update:(ccTime) dt 62 | { 63 | [target_ setValue:[NSNumber numberWithFloat:to_ - delta_ * (1 - dt)] forKey:key_]; 64 | } 65 | 66 | - (CCActionInterval *) reverse 67 | { 68 | return [[self class] actionWithDuration:duration_ key:key_ from:to_ to:from_]; 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCGrabber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 On-Core 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 | 27 | #import "Platforms/CCGL.h" 28 | #import 29 | 30 | @class CCTexture2D; 31 | 32 | /** FBO class that grabs the the contents of the screen */ 33 | @interface CCGrabber : NSObject 34 | { 35 | GLuint fbo_; 36 | GLint oldFBO_; 37 | GLfloat oldClearColor_[4]; 38 | } 39 | 40 | -(void)grab:(CCTexture2D*)texture; 41 | -(void)beforeRender:(CCTexture2D*)texture; 42 | -(void)afterRender:(CCTexture2D*)texture; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCNode+Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "CCNode.h" 26 | 27 | #ifdef DEBUG 28 | 29 | /** Debugging extensions of CCNode. 30 | They are available when the DEBUG macro is defined at compile time 31 | */ 32 | @interface CCNode (Debug) 33 | 34 | /** prints on the debug console the scene graph */ 35 | -(void) walkSceneGraph:(NSUInteger)level; 36 | 37 | @end 38 | 39 | #endif // DEBUG 40 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCNode+Debug.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "CCNode+Debug.h" 26 | 27 | #ifdef DEBUG 28 | 29 | @implementation CCNode (Debug) 30 | 31 | -(void) walkSceneGraph:(NSUInteger)level 32 | { 33 | char buf[64]; 34 | NSUInteger i=0; 35 | for( i=0; idata; 45 | i = 0; 46 | 47 | // draw children zOrder < 0 48 | for( ; i < arrayData->num; i++ ) { 49 | CCNode *child = arrayData->arr[i]; 50 | if ( [child zOrder] < 0 ) 51 | [child walkSceneGraph:level+1]; 52 | else 53 | break; 54 | } 55 | 56 | // self draw 57 | NSLog(@"walk tree: %s> %@ %p", buf, self, self); 58 | 59 | // draw children zOrder >= 0 60 | for( ; i < arrayData->num; i++ ) { 61 | CCNode *child = arrayData->arr[i]; 62 | [child walkSceneGraph:level+1]; 63 | } 64 | 65 | } else 66 | NSLog(@"walk tree: %s> %@ %p", buf, self, self); 67 | 68 | } 69 | @end 70 | 71 | #endif // DEBUG 72 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCParallaxNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | #import "CCNode.h" 28 | #import "Support/ccCArray.h" 29 | 30 | /** CCParallaxNode: A node that simulates a parallax scroller 31 | 32 | The children will be moved faster / slower than the parent according the the parallax ratio. 33 | 34 | */ 35 | @interface CCParallaxNode : CCNode 36 | { 37 | ccArray *parallaxArray_; 38 | CGPoint lastPosition; 39 | } 40 | 41 | /** array that holds the offset / ratio of the children */ 42 | @property (nonatomic,readwrite) ccArray * parallaxArray; 43 | 44 | /** Adds a child to the container with a z-order, a parallax ratio and a position offset 45 | It returns self, so you can chain several addChilds. 46 | @since v0.8 47 | */ 48 | -(void) addChild: (CCNode*)node z:(NSInteger)z parallaxRatio:(CGPoint)c positionOffset:(CGPoint)positionOffset; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCScene.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | 28 | #import "CCNode.h" 29 | 30 | /** CCScene is a subclass of CCNode that is used only as an abstract concept. 31 | 32 | CCScene an CCNode are almost identical with the difference that CCScene has its 33 | anchor point (by default) at the center of the screen. 34 | 35 | For the moment CCScene has no other logic than that, but in future releases it might have 36 | additional logic. 37 | 38 | It is a good practice to use and CCScene as the parent of all your nodes. 39 | */ 40 | @interface CCScene : CCNode 41 | { 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCScene.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | 28 | #import "CCScene.h" 29 | #import "Support/CGPointExtension.h" 30 | #import "CCDirector.h" 31 | 32 | 33 | @implementation CCScene 34 | -(id) init 35 | { 36 | if( (self=[super init]) ) { 37 | CGSize s = [[CCDirector sharedDirector] winSize]; 38 | self.ignoreAnchorPointForPosition = YES; 39 | anchorPoint_ = ccp(0.5f, 0.5f); 40 | [self setContentSize:s]; 41 | } 42 | 43 | return self; 44 | } 45 | @end 46 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCShaderCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | #import 27 | #import "ccMacros.h" 28 | #ifdef __CC_PLATFORM_IOS 29 | #import 30 | #endif // __CC_PLATFORM_IOS 31 | 32 | @class CCGLProgram; 33 | 34 | /** CCShaderCache 35 | Singleton that stores manages GL shaders 36 | @since v2.0 37 | */ 38 | @interface CCShaderCache : NSObject { 39 | 40 | NSMutableDictionary *programs_; 41 | 42 | } 43 | 44 | /** returns the shared instance */ 45 | + (CCShaderCache *)sharedShaderCache; 46 | 47 | /** purges the cache. It releases the retained instance. */ 48 | +(void)purgeSharedShaderCache; 49 | 50 | /** loads the default shaders */ 51 | -(void) loadDefaultShaders; 52 | 53 | /** returns a GL program for a given key */ 54 | -(CCGLProgram *) programForKey:(NSString*)key; 55 | 56 | /** adds a CCGLProgram to the cache for a given name */ 57 | - (void) addProgram:(CCGLProgram*)program forKey:(NSString*)key; 58 | 59 | @end 60 | 61 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCTMXObjectGroup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Neophit 5 | * 6 | * Copyright (c) 2010 Ricardo Quesada 7 | * Copyright (c) 2011 Zynga Inc. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | * 28 | * TMX Tiled Map support: 29 | * http://www.mapeditor.org 30 | * 31 | */ 32 | 33 | #import "CCNode.h" 34 | 35 | 36 | @class CCTMXObjectGroup; 37 | 38 | 39 | /** CCTMXObjectGroup represents the TMX object group. 40 | @since v0.99.0 41 | */ 42 | @interface CCTMXObjectGroup : NSObject 43 | { 44 | NSString *groupName_; 45 | CGPoint positionOffset_; 46 | NSMutableArray *objects_; 47 | NSMutableDictionary *properties_; 48 | } 49 | 50 | /** name of the group */ 51 | @property (nonatomic,readwrite,retain) NSString *groupName; 52 | /** offset position of child objects */ 53 | @property (nonatomic,readwrite,assign) CGPoint positionOffset; 54 | /** array of the objects */ 55 | @property (nonatomic,readwrite,retain) NSMutableArray *objects; 56 | /** list of properties stored in a dictionary */ 57 | @property (nonatomic,readwrite,retain) NSMutableDictionary *properties; 58 | 59 | /** return the value for the specific property name */ 60 | -(id) propertyNamed:(NSString *)propertyName; 61 | 62 | /** return the dictionary for the specific object name. 63 | It will return the 1st object found on the array for the given name. 64 | */ 65 | -(NSMutableDictionary*) objectNamed:(NSString *)objectName; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCTransitionPageTurn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ 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 | 27 | #import "CCTransition.h" 28 | 29 | /** CCTransitionPageTurn transition. 30 | * A transition which peels back the bottom right hand corner of a scene 31 | * to transition to the scene beneath it simulating a page turn 32 | * 33 | * This uses a 3DAction so it is strongly recommended that depth buffering 34 | * is turned on in CCDirector using: 35 | * 36 | * [[CCDirector sharedDirector] setDepthBufferFormat:kCCDepthBuffer16]; 37 | * 38 | * @since v0.8.2 39 | */ 40 | @interface CCTransitionPageTurn : CCTransitionScene 41 | { 42 | BOOL back_; 43 | } 44 | /** 45 | * creates a base transition with duration and incoming scene 46 | * if back is TRUE then the effect is reversed to appear as if the incoming 47 | * scene is being turned from left over the outgoing scene 48 | */ 49 | +(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; 50 | 51 | /** 52 | * creates a base transition with duration and incoming scene 53 | * if back is TRUE then the effect is reversed to appear as if the incoming 54 | * scene is being turned from left over the outgoing scene 55 | */ 56 | -(id) initWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; 57 | 58 | -(CCActionInterval*) actionWithSize:(ccGridSize) vector; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/CCTransitionProgress.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Lam Pham 5 | * 6 | * Copyright (c) 2012 Ricardo Quesada 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | * 26 | */ 27 | 28 | #import "CCTransition.h" 29 | 30 | @interface CCTransitionProgress : CCTransitionScene 31 | { 32 | float to_, from_; 33 | CCScene *sceneToBeModified_; 34 | } 35 | @end 36 | 37 | /** CCTransitionRadialCCW transition. 38 | A counter colock-wise radial transition to the next scene 39 | */ 40 | @interface CCTransitionProgressRadialCCW : CCTransitionProgress 41 | @end 42 | 43 | /** CCTransitionRadialCW transition. 44 | A counter colock-wise radial transition to the next scene 45 | */ 46 | @interface CCTransitionProgressRadialCW : CCTransitionProgress 47 | @end 48 | 49 | /** CCTransitionProgressHorizontal transition. 50 | A colock-wise radial transition to the next scene 51 | */ 52 | @interface CCTransitionProgressHorizontal : CCTransitionProgress 53 | @end 54 | 55 | @interface CCTransitionProgressVertical : CCTransitionProgress 56 | @end 57 | 58 | @interface CCTransitionProgressInOut : CCTransitionProgress 59 | @end 60 | 61 | @interface CCTransitionProgressOutIn : CCTransitionProgress 62 | @end 63 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Platforms/CCGL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | // 27 | // Common layer for OpenGL stuff 28 | // 29 | 30 | #import "../ccMacros.h" 31 | 32 | #if __CC_PLATFORM_IOS 33 | #import 34 | #import 35 | #import 36 | #import "iOS/CCGLView.h" 37 | 38 | #elif __CC_PLATFORM_MAC 39 | #import 40 | #import 41 | #import // needed for NSOpenGLView 42 | #import "Mac/CCGLView.h" 43 | #endif 44 | 45 | 46 | // iOS 47 | #if __CC_PLATFORM_IOS 48 | #define glClearDepth glClearDepthf 49 | #define glDeleteVertexArrays glDeleteVertexArraysOES 50 | #define glGenVertexArrays glGenVertexArraysOES 51 | #define glBindVertexArray glBindVertexArrayOES 52 | 53 | #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES 54 | 55 | // Mac 56 | #elif __CC_PLATFORM_MAC 57 | 58 | #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 59 | 60 | #if 1 61 | #define glDeleteVertexArrays glDeleteVertexArraysAPPLE 62 | #define glGenVertexArrays glGenVertexArraysAPPLE 63 | #define glBindVertexArray glBindVertexArrayAPPLE 64 | 65 | #else // OpenGL 3.2 Core Profile 66 | 67 | #define glDeleteVertexArrays glDeleteVertexArrays 68 | #define glGenVertexArrays glGenVertexArrays 69 | #define glBindVertexArray glBindVertexArray 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Platforms/CCNS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | // 27 | // Common layer for NS (Next-Step) stuff 28 | // 29 | 30 | #import "../ccMacros.h" 31 | 32 | #import // for NSObject 33 | 34 | #ifdef __CC_PLATFORM_IOS 35 | 36 | #define CCRectFromString(__r__) CGRectFromString(__r__) 37 | #define CCPointFromString(__p__) CGPointFromString(__p__) 38 | #define CCSizeFromString(__s__) CGSizeFromString(__s__) 39 | #define CCNSSizeToCGSize 40 | #define CCNSRectToCGRect 41 | #define CCNSPointToCGPoint 42 | 43 | 44 | #elif defined(__CC_PLATFORM_MAC) 45 | 46 | #define CCRectFromString(__r__) NSRectToCGRect( NSRectFromString(__r__) ) 47 | #define CCPointFromString(__p__) NSPointToCGPoint( NSPointFromString(__p__) ) 48 | #define CCSizeFromString(__s__) NSSizeToCGSize( NSSizeFromString(__s__) ) 49 | #define CCNSSizeToCGSize NSSizeToCGSize 50 | #define CCNSRectToCGRect NSRectToCGRect 51 | #define CCNSPointToCGPoint NSPointToCGPoint 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Platforms/Mac/CCWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 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 | // Only compile this code on Mac. These files should not be included on your iOS project. 26 | // But in case they are included, it won't be compiled. 27 | #import "../../ccMacros.h" 28 | #ifdef __CC_PLATFORM_MAC 29 | 30 | #import 31 | 32 | 33 | @interface CCWindow : NSWindow 34 | { 35 | } 36 | - (id) initWithFrame:(NSRect)frame fullscreen:(BOOL)fullscreen; 37 | 38 | @end 39 | 40 | 41 | #endif // __CC_PLATFORM_MAC 42 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Platforms/Mac/CCWindow.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 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 | // Only compile this code on Mac. These files should not be included on your iOS project. 26 | // But in case they are included, it won't be compiled. 27 | #import "../../ccMacros.h" 28 | #ifdef __CC_PLATFORM_MAC 29 | 30 | #import "CCWindow.h" 31 | 32 | 33 | @implementation CCWindow 34 | 35 | - (id) initWithFrame:(NSRect)frame fullscreen:(BOOL)fullscreen 36 | { 37 | int styleMask = fullscreen ? NSBackingStoreBuffered : ( NSTitledWindowMask | NSClosableWindowMask ); 38 | self = [self initWithContentRect:frame 39 | styleMask:styleMask 40 | backing:NSBackingStoreBuffered 41 | defer:YES]; 42 | 43 | if (self != nil) 44 | { 45 | if(fullscreen) 46 | { 47 | [self setLevel:NSMainMenuWindowLevel+1]; 48 | [self setHidesOnDeactivate:YES]; 49 | [self setHasShadow:NO]; 50 | } 51 | 52 | [self setAcceptsMouseMovedEvents:NO]; 53 | [self setOpaque:YES]; 54 | } 55 | return self; 56 | } 57 | 58 | - (BOOL) canBecomeKeyWindow 59 | { 60 | return YES; 61 | } 62 | 63 | - (BOOL) canBecomeMainWindow 64 | { 65 | return YES; 66 | } 67 | @end 68 | 69 | #endif // __CC_PLATFORM_MAC 70 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Platforms/iOS/CCESRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | * 26 | * File autogenerated with Xcode. Adapted for cocos2d needs. 27 | */ 28 | 29 | // Only compile this code on iOS. These files should NOT be included on your Mac project. 30 | // But in case they are included, it won't be compiled. 31 | #import "../../ccMacros.h" 32 | #ifdef __CC_PLATFORM_IOS 33 | 34 | #import 35 | 36 | #import 37 | #import 38 | 39 | @protocol CCESRenderer 40 | 41 | - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples; 42 | 43 | - (BOOL) resizeFromLayer:(CAEAGLLayer *)layer; 44 | 45 | - (EAGLContext*) context; 46 | - (CGSize) backingSize; 47 | 48 | - (unsigned int) colorRenderBuffer; 49 | - (unsigned int) defaultFrameBuffer; 50 | - (unsigned int) msaaFrameBuffer; 51 | - (unsigned int) msaaColorBuffer; 52 | @end 53 | 54 | #endif // __CC_PLATFORM_IOS 55 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/CCVertex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2011 ForzeField Studios S.L. http://forzefield.com 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 | #import "ccTypes.h" 26 | 27 | /** @file CCVertex.h */ 28 | 29 | /** converts a line to a polygon */ 30 | void ccVertexLineToPolygon(CGPoint *points, float stroke, ccVertex2F *vertices, NSUInteger offset, NSUInteger nuPoints); 31 | 32 | /** returns wheter or not the line intersects */ 33 | BOOL ccVertexLineIntersect(float Ax, float Ay, 34 | float Bx, float By, 35 | float Cx, float Cy, 36 | float Dx, float Dy, float *T); 37 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/NSThread+performBlock.h: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * Idea taken from: http://stackoverflow.com/a/3940757 7 | * 8 | */ 9 | 10 | #import 11 | 12 | @interface NSThread (sendBlockToBackground) 13 | /** performs a block on the thread. It won't wait until it is done. */ 14 | - (void) performBlock:(void (^)(void))block; 15 | 16 | /** performs a block on the thread. */ 17 | - (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait; 18 | 19 | /** performs a block on the thread. */ 20 | - (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilDone:(BOOL)wait; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/NSThread+performBlock.m: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * Idea taken from: http://stackoverflow.com/a/3940757 7 | * 8 | */ 9 | 10 | 11 | #import "NSThread+performBlock.h" 12 | #import "../ccMacros.h" 13 | 14 | typedef void (^BlockWithParam)(id param); 15 | @interface CCObjectWith2Params : NSObject 16 | { 17 | @public 18 | BlockWithParam block; 19 | id param; 20 | } 21 | @property (nonatomic,copy) BlockWithParam block; 22 | @property (nonatomic,readwrite,retain) id param; 23 | @end 24 | 25 | @implementation CCObjectWith2Params 26 | @synthesize block, param; 27 | - (void)dealloc { 28 | CCLOG(@"cocos2d: deallocing %@", self); 29 | [block release]; 30 | [param release]; 31 | 32 | [super dealloc]; 33 | } 34 | @end 35 | 36 | @implementation NSThread (sendBlockToBackground) 37 | 38 | - (void) performBlock: (void (^)(void))block; 39 | { 40 | return [self performBlock:block waitUntilDone:NO]; 41 | } 42 | 43 | - (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait 44 | { 45 | [self performSelector:@selector(executeBlock:) 46 | onThread:self 47 | withObject: [[block copy] autorelease] 48 | waitUntilDone: wait]; 49 | } 50 | 51 | - (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilDone:(BOOL)wait 52 | { 53 | CCObjectWith2Params * obj = [[CCObjectWith2Params alloc] init]; 54 | obj.block = block; 55 | obj.param = object; 56 | 57 | [obj autorelease]; 58 | 59 | [self performSelector:@selector(executeBlock2:) 60 | onThread:self 61 | withObject:obj 62 | waitUntilDone:wait]; 63 | } 64 | 65 | - (void) executeBlock: (void (^)(void))block; 66 | { 67 | block(); 68 | } 69 | 70 | - (void) executeBlock2:(CCObjectWith2Params*)object 71 | { 72 | BlockWithParam block = object.block; 73 | block( object.param ); 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/TGAlib.h: -------------------------------------------------------------------------------- 1 | // 2 | // TGA lib for cocos2d-iphone 3 | // 4 | // sources from: http://www.lighthouse3d.com/opengl/terrain/index.php3?tgasource 5 | // 6 | 7 | //#ifndef TGA_LIB 8 | //#define TGA_LIB 9 | 10 | /** 11 | @file 12 | TGA image support 13 | */ 14 | 15 | enum { 16 | TGA_OK, 17 | TGA_ERROR_FILE_OPEN, 18 | TGA_ERROR_READING_FILE, 19 | TGA_ERROR_INDEXED_COLOR, 20 | TGA_ERROR_MEMORY, 21 | TGA_ERROR_COMPRESSED_FILE, 22 | }; 23 | 24 | /** TGA format */ 25 | typedef struct sImageTGA { 26 | int status; 27 | unsigned char type, pixelDepth; 28 | 29 | /** map width */ 30 | short int width; 31 | 32 | /** map height */ 33 | short int height; 34 | 35 | /** raw data */ 36 | unsigned char *imageData; 37 | int flipped; 38 | } tImageTGA; 39 | 40 | /// load the image header fields. We only keep those that matter! 41 | void tgaLoadHeader(FILE *file, tImageTGA *info); 42 | 43 | /// loads the image pixels. You shouldn't call this function directly 44 | void tgaLoadImageData(FILE *file, tImageTGA *info); 45 | 46 | /// this is the function to call when we want to load an image 47 | tImageTGA * tgaLoad(const char *filename); 48 | 49 | // /converts RGB to greyscale 50 | void tgaRGBtogreyscale(tImageTGA *info); 51 | 52 | /// releases the memory used for the image 53 | void tgaDestroy(tImageTGA *info); 54 | 55 | //#endif // TGA_LIB 56 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/TransformUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Valentin Milea 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 "../ccMacros.h" 27 | #import "../Platforms/CCGL.h" 28 | 29 | #ifdef __CC_PLATFORM_IOS 30 | #import 31 | #elif defined(__CC_PLATFORM_MAC) 32 | #import 33 | #endif 34 | 35 | void CGAffineToGL(const CGAffineTransform *t, GLfloat *m); 36 | void GLToCGAffine(const GLfloat *m, CGAffineTransform *t); 37 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/TransformUtils.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Valentin Milea 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 | 27 | #import "TransformUtils.h" 28 | 29 | void CGAffineToGL(const CGAffineTransform *t, GLfloat *m) 30 | { 31 | // | m[0] m[4] m[8] m[12] | | m11 m21 m31 m41 | | a c 0 tx | 32 | // | m[1] m[5] m[9] m[13] | | m12 m22 m32 m42 | | b d 0 ty | 33 | // | m[2] m[6] m[10] m[14] | <=> | m13 m23 m33 m43 | <=> | 0 0 1 0 | 34 | // | m[3] m[7] m[11] m[15] | | m14 m24 m34 m44 | | 0 0 0 1 | 35 | 36 | m[2] = m[3] = m[6] = m[7] = m[8] = m[9] = m[11] = m[14] = 0.0f; 37 | m[10] = m[15] = 1.0f; 38 | m[0] = t->a; m[4] = t->c; m[12] = t->tx; 39 | m[1] = t->b; m[5] = t->d; m[13] = t->ty; 40 | } 41 | 42 | void GLToCGAffine(const GLfloat *m, CGAffineTransform *t) 43 | { 44 | t->a = m[0]; t->c = m[4]; t->tx = m[12]; 45 | t->b = m[1]; t->d = m[5]; t->ty = m[13]; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/ZipUtils.h: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * inflateMemory_ based on zlib example code 7 | * http://www.zlib.net 8 | * 9 | * Some ideas were taken from: 10 | * http://themanaworld.org/ 11 | * from the mapreader.cpp file 12 | * 13 | */ 14 | 15 | #ifndef __CC_ZIP_UTILS_H 16 | #define __CC_ZIP_UTILS_H 17 | 18 | #import 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* XXX: pragma pack ??? */ 25 | /** @struct CCZHeader 26 | */ 27 | struct CCZHeader { 28 | uint8_t sig[4]; // signature. Should be 'CCZ!' 4 bytes 29 | uint16_t compression_type; // should 0 30 | uint16_t version; // should be 2 (although version type==1 is also supported) 31 | uint32_t reserved; // Reserverd for users. 32 | uint32_t len; // size of the uncompressed file 33 | }; 34 | 35 | enum { 36 | CCZ_COMPRESSION_ZLIB, // zlib format. 37 | CCZ_COMPRESSION_BZIP2, // bzip2 format (not supported yet) 38 | CCZ_COMPRESSION_GZIP, // gzip format (not supported yet) 39 | CCZ_COMPRESSION_NONE, // plain (not supported yet) 40 | }; 41 | 42 | /** @file 43 | * Zip helper functions 44 | */ 45 | 46 | /** 47 | * Inflates either zlib or gzip deflated memory. The inflated memory is 48 | * expected to be freed by the caller. 49 | * 50 | * It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory. 51 | * @returns the length of the deflated buffer 52 | * 53 | @since v0.8.1 54 | */ 55 | int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **out); 56 | 57 | /** 58 | * Inflates either zlib or gzip deflated memory. The inflated memory is 59 | * expected to be freed by the caller. 60 | * 61 | * outLenghtHint is assumed to be the needed room to allocate the inflated buffer. 62 | * 63 | * @returns the length of the deflated buffer 64 | * 65 | @since v1.0.0 66 | */ 67 | int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outLenghtHint ); 68 | 69 | 70 | /** inflates a GZip file into memory 71 | * 72 | * @returns the length of the deflated buffer 73 | * 74 | * @since v0.99.5 75 | */ 76 | int ccInflateGZipFile(const char *filename, unsigned char **out); 77 | 78 | /** inflates a CCZ file into memory 79 | * 80 | * @returns the length of the deflated buffer 81 | * 82 | * @since v0.99.5 83 | */ 84 | int ccInflateCCZFile(const char *filename, unsigned char **out); 85 | 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif // __CC_ZIP_UTILS_H 92 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/base64.c: -------------------------------------------------------------------------------- 1 | /* 2 | public domain BASE64 code 3 | 4 | modified for cocos2d-iphone: http://www.cocos2d-iphone.org 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "base64.h" 11 | 12 | unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 13 | 14 | int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ); 15 | 16 | int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ) 17 | { 18 | static char inalphabet[256], decoder[256]; 19 | int i, bits, c, char_count, errors = 0; 20 | unsigned int input_idx = 0; 21 | unsigned int output_idx = 0; 22 | 23 | for (i = (sizeof alphabet) - 1; i >= 0 ; i--) { 24 | inalphabet[alphabet[i]] = 1; 25 | decoder[alphabet[i]] = i; 26 | } 27 | 28 | char_count = 0; 29 | bits = 0; 30 | for( input_idx=0; input_idx < input_len ; input_idx++ ) { 31 | c = input[ input_idx ]; 32 | if (c == '=') 33 | break; 34 | if (c > 255 || ! inalphabet[c]) 35 | continue; 36 | bits += decoder[c]; 37 | char_count++; 38 | if (char_count == 4) { 39 | output[ output_idx++ ] = (bits >> 16); 40 | output[ output_idx++ ] = ((bits >> 8) & 0xff); 41 | output[ output_idx++ ] = ( bits & 0xff); 42 | bits = 0; 43 | char_count = 0; 44 | } else { 45 | bits <<= 6; 46 | } 47 | } 48 | 49 | if( c == '=' ) { 50 | switch (char_count) { 51 | case 1: 52 | fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); 53 | errors++; 54 | break; 55 | case 2: 56 | output[ output_idx++ ] = ( bits >> 10 ); 57 | break; 58 | case 3: 59 | output[ output_idx++ ] = ( bits >> 16 ); 60 | output[ output_idx++ ] = (( bits >> 8 ) & 0xff); 61 | break; 62 | } 63 | } else if ( input_idx < input_len ) { 64 | if (char_count) { 65 | fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", 66 | ((4 - char_count) * 6)); 67 | errors++; 68 | } 69 | } 70 | 71 | *output_len = output_idx; 72 | return errors; 73 | } 74 | 75 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out) 76 | { 77 | unsigned int outLength = 0; 78 | 79 | //should be enough to store 6-bit buffers in 8-bit buffers 80 | *out = malloc( inLength * 3.0f / 4.0f + 1 ); 81 | if( *out ) { 82 | int ret = _base64Decode(in, inLength, *out, &outLength); 83 | 84 | if (ret > 0 ) 85 | { 86 | printf("Base64Utils: error decoding"); 87 | free(*out); 88 | *out = NULL; 89 | outLength = 0; 90 | } 91 | } 92 | return outLength; 93 | } 94 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | public domain BASE64 code 3 | 4 | modified for cocos2d-iphone: http://www.cocos2d-iphone.org 5 | */ 6 | 7 | #ifndef __CC_BASE64_DECODE_H 8 | #define __CC_BASE64_DECODE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** @file 16 | base64 helper functions 17 | */ 18 | 19 | /** 20 | * Decodes a 64base encoded memory. The decoded memory is 21 | * expected to be freed by the caller. 22 | * 23 | * @returns the length of the out buffer 24 | * 25 | @since v0.8.1 26 | */ 27 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif // __CC_BASE64_DECODE_H 34 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/ccUtils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | */ 5 | 6 | /* 7 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m. 8 | */ 9 | #include "ccUtils.h" 10 | 11 | unsigned long ccNextPOT(unsigned long x) 12 | { 13 | x = x - 1; 14 | x = x | (x >> 1); 15 | x = x | (x >> 2); 16 | x = x | (x >> 4); 17 | x = x | (x >> 8); 18 | x = x | (x >>16); 19 | return x + 1; 20 | } 21 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/Support/ccUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | */ 5 | 6 | #ifndef __CC_UTILS_H 7 | #define __CC_UTILS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** @file ccUtils.h 14 | Misc free functions 15 | */ 16 | 17 | /* 18 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m. 19 | */ 20 | 21 | /** returns the Next Power of Two value. 22 | 23 | Examples: 24 | - If "value" is 15, it will return 16. 25 | - If "value" is 16, it will return 16. 26 | - If "value" is 17, it will return 32. 27 | 28 | @since v0.99.5 29 | */ 30 | unsigned long ccNextPOT( unsigned long value ); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif // ! __CC_UTILS_H 37 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | \n\ 8 | void main() \n\ 9 | { \n\ 10 | gl_FragColor = v_fragmentColor; \n\ 11 | } \n\ 12 | "; 13 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec4 a_color; \n\ 4 | uniform mat4 u_MVPMatrix; \n\ 5 | \n\ 6 | #ifdef GL_ES \n\ 7 | varying lowp vec4 v_fragmentColor; \n\ 8 | #else \n\ 9 | varying vec4 v_fragmentColor; \n\ 10 | #endif \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_Position = u_MVPMatrix * a_position; \n\ 15 | v_fragmentColor = a_color; \n\ 16 | } \n\ 17 | "; 18 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTextureA8Color_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | \n\ 10 | void main() \n\ 11 | { \n\ 12 | gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\ 13 | v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform \n\ 14 | ); \n\ 15 | } \n\ 16 | "; 17 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTextureA8Color_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | attribute vec4 a_color; \n\ 5 | uniform mat4 u_MVPMatrix; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying lowp vec4 v_fragmentColor; \n\ 9 | varying mediump vec2 v_texCoord; \n\ 10 | #else \n\ 11 | varying vec4 v_fragmentColor; \n\ 12 | varying vec2 v_texCoord; \n\ 13 | #endif \n\ 14 | \n\ 15 | void main() \n\ 16 | { \n\ 17 | gl_Position = u_MVPMatrix * a_position; \n\ 18 | v_fragmentColor = a_color; \n\ 19 | v_texCoord = a_texCoord; \n\ 20 | } \n\ 21 | "; 22 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | uniform float u_alpha_value; \n\ 10 | \n\ 11 | void main() \n\ 12 | { \n\ 13 | vec4 texColor = texture2D(u_texture, v_texCoord); \n\ 14 | \n\ 15 | // mimic: glAlphaFunc(GL_GREATER) \n\ 16 | // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value \n\ 17 | \n\ 18 | if ( texColor.a <= u_alpha_value ) \n\ 19 | discard; \n\ 20 | \n\ 21 | gl_FragColor = texColor * v_fragmentColor; \n\ 22 | } \n\ 23 | "; 24 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTextureColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | \n\ 10 | void main() \n\ 11 | { \n\ 12 | gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord); \n\ 13 | } \n\ 14 | "; 15 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTextureColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | attribute vec4 a_color; \n\ 5 | \n\ 6 | uniform mat4 u_MVPMatrix; \n\ 7 | \n\ 8 | #ifdef GL_ES \n\ 9 | varying lowp vec4 v_fragmentColor; \n\ 10 | varying mediump vec2 v_texCoord; \n\ 11 | #else \n\ 12 | varying vec4 v_fragmentColor; \n\ 13 | varying vec2 v_texCoord; \n\ 14 | #endif \n\ 15 | \n\ 16 | void main() \n\ 17 | { \n\ 18 | gl_Position = u_MVPMatrix * a_position; \n\ 19 | v_fragmentColor = a_color; \n\ 20 | v_texCoord = a_texCoord; \n\ 21 | } \n\ 22 | "; 23 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTexture_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec2 v_texCoord; \n\ 7 | uniform sampler2D u_texture; \n\ 8 | \n\ 9 | void main() \n\ 10 | { \n\ 11 | gl_FragColor = texture2D(u_texture, v_texCoord); \n\ 12 | } \n\ 13 | "; 14 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTexture_uColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | uniform vec4 u_color; \n\ 7 | \n\ 8 | varying vec2 v_texCoord; \n\ 9 | \n\ 10 | uniform sampler2D u_texture; \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_FragColor = texture2D(u_texture, v_texCoord) * u_color; \n\ 15 | } \n\ 16 | "; 17 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTexture_uColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | \n\ 5 | uniform mat4 u_MVPMatrix; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying mediump vec2 v_texCoord; \n\ 9 | #else \n\ 10 | varying vec2 v_texCoord; \n\ 11 | #endif \n\ 12 | \n\ 13 | void main() \n\ 14 | { \n\ 15 | gl_Position = u_MVPMatrix * a_position; \n\ 16 | v_texCoord = a_texCoord; \n\ 17 | } \n\ 18 | "; 19 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_PositionTexture_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | uniform mat4 u_MVPMatrix; \n\ 5 | \n\ 6 | #ifdef GL_ES \n\ 7 | varying mediump vec2 v_texCoord; \n\ 8 | #else \n\ 9 | varying vec2 v_texCoord; \n\ 10 | #endif \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_Position = u_MVPMatrix * a_position; \n\ 15 | v_texCoord = a_texCoord; \n\ 16 | } \n\ 17 | "; 18 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_Position_uColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | \n\ 8 | void main() \n\ 9 | { \n\ 10 | gl_FragColor = v_fragmentColor; \n\ 11 | } \n\ 12 | "; 13 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShader_Position_uColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | uniform mat4 u_MVPMatrix; \n\ 4 | uniform vec4 u_color; \n\ 5 | uniform float u_pointSize; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying lowp vec4 v_fragmentColor; \n\ 9 | #else \n\ 10 | varying vec4 v_fragmentColor; \n\ 11 | #endif \n\ 12 | \n\ 13 | void main() \n\ 14 | { \n\ 15 | gl_Position = u_MVPMatrix * a_position; \n\ 16 | gl_PointSize = u_pointSize; \n\ 17 | v_fragmentColor = u_color; \n\ 18 | } \n\ 19 | "; 20 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShaders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "Platforms/CCGL.h" 26 | 27 | extern const GLchar * ccPosition_uColor_frag; 28 | extern const GLchar * ccPosition_uColor_vert; 29 | 30 | extern const GLchar * ccPositionColor_frag; 31 | extern const GLchar * ccPositionColor_vert; 32 | 33 | extern const GLchar * ccPositionTexture_frag; 34 | extern const GLchar * ccPositionTexture_vert; 35 | 36 | extern const GLchar * ccPositionTextureA8Color_frag; 37 | extern const GLchar * ccPositionTextureA8Color_vert; 38 | 39 | extern const GLchar * ccPositionTextureColor_frag; 40 | extern const GLchar * ccPositionTextureColor_vert; 41 | 42 | extern const GLchar * ccPositionTextureColorAlphaTest_frag; 43 | 44 | extern const GLchar * ccPositionTexture_uColor_frag; 45 | extern const GLchar * ccPositionTexture_uColor_vert; 46 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/ccShaders.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "ccShaders.h" 26 | 27 | // 28 | const GLchar * ccPosition_uColor_frag = 29 | #import "ccShader_Position_uColor_frag.h" 30 | const GLchar * ccPosition_uColor_vert = 31 | #import "ccShader_Position_uColor_vert.h" 32 | 33 | // 34 | const GLchar * ccPositionColor_frag = 35 | #import "ccShader_PositionColor_frag.h" 36 | const GLchar * ccPositionColor_vert = 37 | #import "ccShader_PositionColor_vert.h" 38 | 39 | // 40 | const GLchar * ccPositionTexture_frag = 41 | #import "ccShader_PositionTexture_frag.h" 42 | const GLchar * ccPositionTexture_vert = 43 | #import "ccShader_PositionTexture_vert.h" 44 | 45 | // 46 | const GLchar * ccPositionTextureA8Color_frag = 47 | #import "ccShader_PositionTextureA8Color_frag.h" 48 | const GLchar * ccPositionTextureA8Color_vert = 49 | #import "ccShader_PositionTextureA8Color_vert.h" 50 | 51 | // 52 | const GLchar * ccPositionTextureColor_frag = 53 | #import "ccShader_PositionTextureColor_frag.h" 54 | const GLchar * ccPositionTextureColor_vert = 55 | #import "ccShader_PositionTextureColor_vert.h" 56 | 57 | // 58 | const GLchar * ccPositionTextureColorAlphaTest_frag = 59 | #import "ccShader_PositionTextureColorAlphaTest_frag.h" 60 | 61 | // 62 | const GLchar * ccPositionTexture_uColor_frag = 63 | #import "ccShader_PositionTexture_uColor_frag.h" 64 | const GLchar * ccPositionTexture_uColor_vert = 65 | #import "ccShader_PositionTexture_uColor_vert.h" 66 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/cocos2d/cocos2d.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | 27 | #import 28 | #import "cocos2d.h" 29 | static NSString *version = @"cocos2d v2.0.0"; 30 | 31 | NSString *cocos2dVersion() 32 | { 33 | return version; 34 | } 35 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/GL/mat4stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef C_STACK_H_INCLUDED 27 | #define C_STACK_H_INCLUDED 28 | 29 | #include "../mat4.h" 30 | 31 | typedef struct km_mat4_stack { 32 | int capacity; //The total item capacity 33 | int item_count; //The number of items 34 | kmMat4* top; 35 | kmMat4* stack; 36 | } km_mat4_stack; 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | void km_mat4_stack_initialize(km_mat4_stack* stack); 43 | void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item); 44 | void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut); 45 | void km_mat4_stack_release(km_mat4_stack* stack); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif // C_STACK_H_INCLUDED 52 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/GL/matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KM_GL_MATRIX_H_INCLUDED 27 | #define KM_GL_MATRIX_H_INCLUDED 28 | 29 | #define KM_GL_MODELVIEW 0x1700 30 | #define KM_GL_PROJECTION 0x1701 31 | #define KM_GL_TEXTURE 0x1702 32 | 33 | typedef unsigned int kmGLEnum; 34 | 35 | #include "../mat4.h" 36 | #include "../vec3.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | void kmGLFreeAll(void); 43 | void kmGLPushMatrix(void); 44 | void kmGLPopMatrix(void); 45 | void kmGLMatrixMode(kmGLEnum mode); 46 | void kmGLLoadIdentity(void); 47 | void kmGLLoadMatrix(const kmMat4* pIn); 48 | void kmGLMultMatrix(const kmMat4* pIn); 49 | void kmGLTranslatef(float x, float y, float z); 50 | void kmGLRotatef(float angle, float x, float y, float z); 51 | void kmGLScalef(float x, float y, float z); 52 | void kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // MATRIX_H_INCLUDED 59 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/aabb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KAZMATH_AABB_H_INCLUDED 27 | #define KAZMATH_AABB_H_INCLUDED 28 | 29 | #include "vec3.h" 30 | #include "utility.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | * A struture that represents an axis-aligned 38 | * bounding box. 39 | */ 40 | typedef struct kmAABB { 41 | kmVec3 min; /** The max corner of the box */ 42 | kmVec3 max; /** The min corner of the box */ 43 | } kmAABB; 44 | 45 | const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox); 46 | kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn); 47 | kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/kazmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KAZMATH_H_INCLUDED 27 | #define KAZMATH_H_INCLUDED 28 | 29 | #include "vec2.h" 30 | #include "vec3.h" 31 | #include "mat3.h" 32 | #include "mat4.h" 33 | #include "utility.h" 34 | #include "quaternion.h" 35 | #include "plane.h" 36 | #include "aabb.h" 37 | #include "ray2.h" 38 | 39 | #endif // KAZMATH_H_INCLUDED 40 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/neon_matrix_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | NEON math library for the iPhone / iPod touch 3 | 4 | Copyright (c) 2009 Justin Saunders 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising 8 | from the use of this software. 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it freely, 11 | subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must 14 | not claim that you wrote the original software. If you use this 15 | software in a product, an acknowledgment in the product documentation 16 | would be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must 19 | not be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source distribution. 22 | */ 23 | 24 | #ifndef __NEON_MATRIX_IMPL_H__ 25 | #define __NEON_MATRIX_IMPL_H__ 26 | 27 | #ifdef __arm__ 28 | #include "arm/arch.h" 29 | #endif 30 | 31 | // Matrixes are assumed to be stored in column major format according to OpenGL 32 | // specification. 33 | 34 | // Multiplies two 4x4 matrices (a,b) outputing a 4x4 matrix (output) 35 | void NEON_Matrix4Mul(const float* a, const float* b, float* output ); 36 | 37 | // Multiplies a 4x4 matrix (m) with a vector 4 (v), outputing a vector 4 38 | void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output); 39 | 40 | 41 | #endif // __NEON_MATRIX_IMPL_H__ 42 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/ray2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef RAY_2_H 27 | #define RAY_2_H 28 | 29 | #include "utility.h" 30 | #include "vec2.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct kmRay2 { 37 | kmVec2 start; 38 | kmVec2 dir; 39 | } kmRay2; 40 | 41 | void kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy); 42 | kmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection); 43 | kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out); 44 | kmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/include/kazmath/utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef UTILITY_H_INCLUDED 27 | #define UTILITY_H_INCLUDED 28 | 29 | #include 30 | 31 | #ifndef kmScalar 32 | #define kmScalar float 33 | #endif 34 | 35 | #ifndef kmBool 36 | #define kmBool unsigned char 37 | #endif 38 | 39 | #ifndef kmEnum 40 | #define kmEnum unsigned int 41 | #endif 42 | 43 | #ifndef KM_FALSE 44 | #define KM_FALSE 0 45 | #endif 46 | 47 | #ifndef KM_TRUE 48 | #define KM_TRUE 1 49 | #endif 50 | 51 | #define kmPI 3.141592f 52 | #define kmPIOver180 0.017453f // PI / 180 53 | #define kmPIUnder180 57.295779f // 180 / PI 54 | #define kmEpsilon 1.0 / 64.0 55 | 56 | 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | extern kmScalar kmSQR(kmScalar s); 63 | extern kmScalar kmDegreesToRadians(kmScalar degrees); 64 | extern kmScalar kmRadiansToDegrees(kmScalar radians); 65 | 66 | extern kmScalar min(kmScalar lhs, kmScalar rhs); 67 | extern kmScalar max(kmScalar lhs, kmScalar rhs); 68 | extern kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* UTILITY_H_INCLUDED */ 75 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #ADD_LIBRARY(Kazmath STATIC ${KAZMATH_SRCS}) 3 | #INSTALL(TARGETS Kazmath ARCHIVE DESTINATION lib) 4 | 5 | INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ) 6 | 7 | ADD_LIBRARY(kazmath STATIC ${KAZMATH_SOURCES}) 8 | INSTALL(TARGETS kazmath ARCHIVE DESTINATION lib) 9 | 10 | #ADD_LIBRARY(KazmathGL STATIC ${GL_UTILS_SRCS}) 11 | #INSTALL(TARGETS KazmathGL ARCHIVE DESTINATION lib) 12 | 13 | INSTALL(FILES ${KAZMATH_HEADERS} DESTINATION include/kazmath) 14 | INSTALL(FILES ${GL_UTILS_HEADERS} DESTINATION include/kazmath/GL) 15 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/src/aabb.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "kazmath/aabb.h" 27 | 28 | /** 29 | * Returns KM_TRUE if point is in the specified AABB, returns 30 | * KM_FALSE otherwise. 31 | */ 32 | const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox) 33 | { 34 | if(pPoint->x >= pBox->min.x && pPoint->x <= pBox->max.x && 35 | pPoint->y >= pBox->min.y && pPoint->y <= pBox->max.y && 36 | pPoint->z >= pBox->min.z && pPoint->z <= pBox->max.z) { 37 | return KM_TRUE; 38 | } 39 | 40 | return KM_FALSE; 41 | } 42 | 43 | /** 44 | * Assigns pIn to pOut, returns pOut. 45 | */ 46 | kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn) 47 | { 48 | kmVec3Assign(&pOut->min, &pIn->min); 49 | kmVec3Assign(&pOut->max, &pIn->max); 50 | return pOut; 51 | } 52 | 53 | /** 54 | * Scales pIn by s, stores the resulting AABB in pOut. Returns pOut 55 | */ 56 | kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s) 57 | { 58 | assert(0 && "Not implemented"); 59 | return 0; 60 | } 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/libs/kazmath/src/utility.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "kazmath/utility.h" 27 | 28 | /** 29 | * Returns the square of s (e.g. s*s) 30 | */ 31 | kmScalar kmSQR(kmScalar s) { 32 | return s*s; 33 | } 34 | 35 | /** 36 | * Returns degrees as radians. 37 | */ 38 | kmScalar kmDegreesToRadians(kmScalar degrees) { 39 | return degrees * kmPIOver180; 40 | } 41 | 42 | /** 43 | * Returns radians as degrees 44 | */ 45 | kmScalar kmRadiansToDegrees(kmScalar radians) { 46 | return radians * kmPIUnder180; 47 | } 48 | 49 | kmScalar min(kmScalar lhs, kmScalar rhs) { 50 | return (lhs < rhs)? lhs : rhs; 51 | } 52 | 53 | kmScalar max(kmScalar lhs, kmScalar rhs) { 54 | return (lhs > rhs)? lhs : rhs; 55 | } 56 | 57 | kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs) { 58 | return (lhs + kmEpsilon > rhs && lhs - kmEpsilon < rhs); 59 | } 60 | -------------------------------------------------------------------------------- /PRKit Mac example/PRKit Mac example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // cocos2d-mac 4 | // 5 | // Created by Ricardo Quesada on 8/17/10. 6 | // Copyright 2010 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "cocos2d.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | [CCGLView load_]; 16 | return NSApplicationMain(argc, (const char **) argv); 17 | } 18 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PRKit iOS example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "cocos2d.h" 11 | 12 | @interface AppController : NSObject 13 | { 14 | UIWindow *window_; 15 | UINavigationController *navController_; 16 | 17 | CCDirectorIOS *director_; // weak ref 18 | } 19 | 20 | @property (nonatomic, retain) UIWindow *window; 21 | @property (readonly) UINavigationController *navController; 22 | @property (readonly) CCDirectorIOS *director; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/HelloWorldLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // HelloWorldLayer.h 3 | // PRKit iOS example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | // When you import this file, you import all the cocos2d classes 13 | #import "cocos2d.h" 14 | 15 | // HelloWorldLayer 16 | @interface HelloWorldLayer : CCLayer 17 | { 18 | } 19 | 20 | // returns a CCScene that contains the HelloWorldLayer as the only child 21 | +(CCScene *) scene; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/IntroLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // IntroLayer.h 3 | // PRKit iOS example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | 10 | // When you import this file, you import all the cocos2d classes 11 | #import "cocos2d.h" 12 | 13 | // HelloWorldLayer 14 | @interface IntroLayer : CCLayer 15 | { 16 | } 17 | 18 | // returns a CCScene that contains the HelloWorldLayer as the only child 19 | +(CCScene *) scene; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/IntroLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // IntroLayer.m 3 | // PRKit iOS example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | 10 | // Import the interfaces 11 | #import "IntroLayer.h" 12 | #import "HelloWorldLayer.h" 13 | 14 | 15 | #pragma mark - IntroLayer 16 | 17 | // HelloWorldLayer implementation 18 | @implementation IntroLayer 19 | 20 | // Helper class method that creates a Scene with the HelloWorldLayer as the only child. 21 | +(CCScene *) scene 22 | { 23 | // 'scene' is an autorelease object. 24 | CCScene *scene = [CCScene node]; 25 | 26 | // 'layer' is an autorelease object. 27 | IntroLayer *layer = [IntroLayer node]; 28 | 29 | // add layer as a child to scene 30 | [scene addChild: layer]; 31 | 32 | // return the scene 33 | return scene; 34 | } 35 | 36 | // 37 | -(void) onEnter 38 | { 39 | [super onEnter]; 40 | 41 | // ask director for the window size 42 | CGSize size = [[CCDirector sharedDirector] winSize]; 43 | 44 | CCSprite *background; 45 | 46 | if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) { 47 | background = [CCSprite spriteWithFile:@"Default.png"]; 48 | background.rotation = 90; 49 | } else { 50 | background = [CCSprite spriteWithFile:@"Default-Landscape~ipad.png"]; 51 | } 52 | background.position = ccp(size.width/2, size.height/2); 53 | 54 | // add the label as a child to this Layer 55 | [self addChild: background]; 56 | 57 | // In one second transition to the new scene 58 | [self scheduleOnce:@selector(makeTransition:) delay:1]; 59 | } 60 | 61 | -(void) makeTransition:(ccTime)dt 62 | { 63 | [[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:1.0 scene:[HelloWorldLayer scene] withColor:ccWHITE]]; 64 | } 65 | @end 66 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Test' target in the 'Test' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Default.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon-72.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon-Small-50.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon-Small.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/Icon@2x.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIconFiles 14 | 15 | Icon.png 16 | Icon@2x.png 17 | Icon-72.png 18 | Icon-Small-50.png 19 | Icon-Small.png 20 | Icon-Small@2x.png 21 | 22 | CFBundleIdentifier 23 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 24 | CFBundleInfoDictionaryVersion 25 | 6.0 26 | CFBundleName 27 | ${PRODUCT_NAME} 28 | CFBundlePackageType 29 | APPL 30 | CFBundleSignature 31 | ???? 32 | CFBundleVersion 33 | 1.0 34 | LSRequiresIPhoneOS 35 | 36 | UIPrerenderedIcon 37 | 38 | UIStatusBarHidden 39 | 40 | UIRequiredDeviceCapabilities 41 | 42 | accelerometer 43 | 44 | opengles-2 45 | 46 | 47 | UISupportedInterfaceOrientations 48 | 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationLandscapeLeft 55 | UIInterfaceOrientationLandscapeRight 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/fps_images-hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/fps_images-hd.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/fps_images-ipadhd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/fps_images-ipadhd.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/fps_images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/fps_images.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/iTunesArtwork -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/Resources/pattern1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asinesio/cocos2d-PRKit/49cfd40c3a9d05d22997c21dcf21f6f46eb0dce4/PRKit iOS example/PRKit iOS example/Resources/pattern1.png -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/LICENSE_CocosDenshion.txt: -------------------------------------------------------------------------------- 1 | CocosDenshion Sound Engine 2 | 3 | Copyright (c) 2010 Steve Oldmeadow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/LICENSE_Kazmath.txt: -------------------------------------------------------------------------------- 1 | Kazmath is a 3D math library aimed at game programming. It is released under the modified BSD license. 2 | 3 | Authors 4 | 5 | Luke Benstead 6 | Carsten Haubold 7 | 8 | License 9 | 10 | Copyright (c) 2008, Luke Benstead. 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without modification, 14 | are permitted provided that the following conditions are met: 15 | 16 | * Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright notice, 19 | this list of conditions and the following disclaimer in the documentation 20 | and/or other materials provided with the distribution. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 29 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | 34 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/LICENSE_cocos2d.txt: -------------------------------------------------------------------------------- 1 | cocos2d for iPhone: http://www.cocos2d-iphone.org 2 | 3 | Copyright (c) 2011 - Zynga Inc. and contributors 4 | (see each file to see the different copyright owners) 5 | 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCActionPageTurn3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ 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 | 27 | #import "CCActionGrid3D.h" 28 | 29 | /** 30 | * This action simulates a page turn from the bottom right hand corner of the screen 31 | * It's not much use by itself but is used by the PageTurnTransition. 32 | * 33 | * Based on an original paper by L Hong et al. 34 | * http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html 35 | * 36 | * @since v0.8.2 37 | */ 38 | @interface CCPageTurn3D : CCGrid3DAction 39 | { 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCActionProgressTimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (C) 2010 Lam Pham 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 | 27 | #import 28 | #import "CCProgressTimer.h" 29 | #import "CCActionInterval.h" 30 | 31 | /** 32 | Progress to percentage 33 | @since v0.99.1 34 | */ 35 | @interface CCProgressTo : CCActionInterval 36 | { 37 | float to_; 38 | float from_; 39 | } 40 | /** Creates and initializes with a duration and a percent */ 41 | +(id) actionWithDuration:(ccTime)duration percent:(float)percent; 42 | /** Initializes with a duration and a percent */ 43 | -(id) initWithDuration:(ccTime)duration percent:(float)percent; 44 | @end 45 | 46 | /** 47 | Progress from a percentage to another percentage 48 | @since v0.99.1 49 | */ 50 | @interface CCProgressFromTo : CCActionInterval 51 | { 52 | float to_; 53 | float from_; 54 | } 55 | /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ 56 | +(id) actionWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; 57 | /** Initializes the action with a duration, a "from" percentage and a "to" percentage */ 58 | -(id) initWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; 59 | @end 60 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCActionTween.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright 2009 lhunath (Maarten Billemont) 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 | 27 | #import 28 | #import "CCActionInterval.h" 29 | 30 | /** CCActionTween 31 | 32 | CCActionTween is an action that lets you update any property of an object. 33 | For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then: 34 | 35 | id modifyWidth = [CCActionTween actionWithDuration:2 key:@"width" from:200 to:300]; 36 | [target runAction:modifyWidth]; 37 | 38 | 39 | Another example: CCScaleTo action could be rewriten using CCPropertyAction: 40 | 41 | // scaleA and scaleB are equivalents 42 | id scaleA = [CCScaleTo actionWithDuration:2 scale:3]; 43 | id scaleB = [CCActionTween actionWithDuration:2 key:@"scale" from:1 to:3]; 44 | 45 | 46 | @since v0.99.2 47 | */ 48 | @interface CCActionTween : CCActionInterval 49 | { 50 | NSString *key_; 51 | 52 | float from_, to_; 53 | float delta_; 54 | } 55 | 56 | /** creates an initializes the action with the property name (key), and the from and to parameters. */ 57 | + (id)actionWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; 58 | 59 | /** initializes the action with the property name (key), and the from and to parameters. */ 60 | - (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCActionTween.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright 2009 lhunath (Maarten Billemont) 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 "CCActionTween.h" 27 | 28 | 29 | @implementation CCActionTween 30 | 31 | + (id)actionWithDuration:(ccTime)aDuration key:(NSString *)aKey from:(float)aFrom to:(float)aTo { 32 | 33 | return [[[[self class] alloc] initWithDuration:aDuration key:aKey from:aFrom to:aTo] autorelease]; 34 | } 35 | 36 | - (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to { 37 | 38 | if ((self = [super initWithDuration:aDuration])) { 39 | 40 | key_ = [key copy]; 41 | to_ = to; 42 | from_ = from; 43 | 44 | } 45 | 46 | return self; 47 | } 48 | 49 | - (void) dealloc 50 | { 51 | [key_ release]; 52 | [super dealloc]; 53 | } 54 | 55 | - (void)startWithTarget:aTarget 56 | { 57 | [super startWithTarget:aTarget]; 58 | delta_ = to_ - from_; 59 | } 60 | 61 | - (void) update:(ccTime) dt 62 | { 63 | [target_ setValue:[NSNumber numberWithFloat:to_ - delta_ * (1 - dt)] forKey:key_]; 64 | } 65 | 66 | - (CCActionInterval *) reverse 67 | { 68 | return [[self class] actionWithDuration:duration_ key:key_ from:to_ to:from_]; 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCGrabber.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 On-Core 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 | 27 | #import "Platforms/CCGL.h" 28 | #import 29 | 30 | @class CCTexture2D; 31 | 32 | /** FBO class that grabs the the contents of the screen */ 33 | @interface CCGrabber : NSObject 34 | { 35 | GLuint fbo_; 36 | GLint oldFBO_; 37 | GLfloat oldClearColor_[4]; 38 | } 39 | 40 | -(void)grab:(CCTexture2D*)texture; 41 | -(void)beforeRender:(CCTexture2D*)texture; 42 | -(void)afterRender:(CCTexture2D*)texture; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCNode+Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "CCNode.h" 26 | 27 | #ifdef DEBUG 28 | 29 | /** Debugging extensions of CCNode. 30 | They are available when the DEBUG macro is defined at compile time 31 | */ 32 | @interface CCNode (Debug) 33 | 34 | /** prints on the debug console the scene graph */ 35 | -(void) walkSceneGraph:(NSUInteger)level; 36 | 37 | @end 38 | 39 | #endif // DEBUG 40 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCNode+Debug.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "CCNode+Debug.h" 26 | 27 | #ifdef DEBUG 28 | 29 | @implementation CCNode (Debug) 30 | 31 | -(void) walkSceneGraph:(NSUInteger)level 32 | { 33 | char buf[64]; 34 | NSUInteger i=0; 35 | for( i=0; idata; 45 | i = 0; 46 | 47 | // draw children zOrder < 0 48 | for( ; i < arrayData->num; i++ ) { 49 | CCNode *child = arrayData->arr[i]; 50 | if ( [child zOrder] < 0 ) 51 | [child walkSceneGraph:level+1]; 52 | else 53 | break; 54 | } 55 | 56 | // self draw 57 | NSLog(@"walk tree: %s> %@ %p", buf, self, self); 58 | 59 | // draw children zOrder >= 0 60 | for( ; i < arrayData->num; i++ ) { 61 | CCNode *child = arrayData->arr[i]; 62 | [child walkSceneGraph:level+1]; 63 | } 64 | 65 | } else 66 | NSLog(@"walk tree: %s> %@ %p", buf, self, self); 67 | 68 | } 69 | @end 70 | 71 | #endif // DEBUG 72 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCParallaxNode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | #import "CCNode.h" 28 | #import "Support/ccCArray.h" 29 | 30 | /** CCParallaxNode: A node that simulates a parallax scroller 31 | 32 | The children will be moved faster / slower than the parent according the the parallax ratio. 33 | 34 | */ 35 | @interface CCParallaxNode : CCNode 36 | { 37 | ccArray *parallaxArray_; 38 | CGPoint lastPosition; 39 | } 40 | 41 | /** array that holds the offset / ratio of the children */ 42 | @property (nonatomic,readwrite) ccArray * parallaxArray; 43 | 44 | /** Adds a child to the container with a z-order, a parallax ratio and a position offset 45 | It returns self, so you can chain several addChilds. 46 | @since v0.8 47 | */ 48 | -(void) addChild: (CCNode*)node z:(NSInteger)z parallaxRatio:(CGPoint)c positionOffset:(CGPoint)positionOffset; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCScene.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | 28 | #import "CCNode.h" 29 | 30 | /** CCScene is a subclass of CCNode that is used only as an abstract concept. 31 | 32 | CCScene an CCNode are almost identical with the difference that CCScene has its 33 | anchor point (by default) at the center of the screen. 34 | 35 | For the moment CCScene has no other logic than that, but in future releases it might have 36 | additional logic. 37 | 38 | It is a good practice to use and CCScene as the parent of all your nodes. 39 | */ 40 | @interface CCScene : CCNode 41 | { 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCScene.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | */ 26 | 27 | 28 | #import "CCScene.h" 29 | #import "Support/CGPointExtension.h" 30 | #import "CCDirector.h" 31 | 32 | 33 | @implementation CCScene 34 | -(id) init 35 | { 36 | if( (self=[super init]) ) { 37 | CGSize s = [[CCDirector sharedDirector] winSize]; 38 | self.ignoreAnchorPointForPosition = YES; 39 | anchorPoint_ = ccp(0.5f, 0.5f); 40 | [self setContentSize:s]; 41 | } 42 | 43 | return self; 44 | } 45 | @end 46 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCShaderCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | #import 27 | #import "ccMacros.h" 28 | #ifdef __CC_PLATFORM_IOS 29 | #import 30 | #endif // __CC_PLATFORM_IOS 31 | 32 | @class CCGLProgram; 33 | 34 | /** CCShaderCache 35 | Singleton that stores manages GL shaders 36 | @since v2.0 37 | */ 38 | @interface CCShaderCache : NSObject { 39 | 40 | NSMutableDictionary *programs_; 41 | 42 | } 43 | 44 | /** returns the shared instance */ 45 | + (CCShaderCache *)sharedShaderCache; 46 | 47 | /** purges the cache. It releases the retained instance. */ 48 | +(void)purgeSharedShaderCache; 49 | 50 | /** loads the default shaders */ 51 | -(void) loadDefaultShaders; 52 | 53 | /** returns a GL program for a given key */ 54 | -(CCGLProgram *) programForKey:(NSString*)key; 55 | 56 | /** adds a CCGLProgram to the cache for a given name */ 57 | - (void) addProgram:(CCGLProgram*)program forKey:(NSString*)key; 58 | 59 | @end 60 | 61 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCTMXObjectGroup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Neophit 5 | * 6 | * Copyright (c) 2010 Ricardo Quesada 7 | * Copyright (c) 2011 Zynga Inc. 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | * 27 | * 28 | * TMX Tiled Map support: 29 | * http://www.mapeditor.org 30 | * 31 | */ 32 | 33 | #import "CCNode.h" 34 | 35 | 36 | @class CCTMXObjectGroup; 37 | 38 | 39 | /** CCTMXObjectGroup represents the TMX object group. 40 | @since v0.99.0 41 | */ 42 | @interface CCTMXObjectGroup : NSObject 43 | { 44 | NSString *groupName_; 45 | CGPoint positionOffset_; 46 | NSMutableArray *objects_; 47 | NSMutableDictionary *properties_; 48 | } 49 | 50 | /** name of the group */ 51 | @property (nonatomic,readwrite,retain) NSString *groupName; 52 | /** offset position of child objects */ 53 | @property (nonatomic,readwrite,assign) CGPoint positionOffset; 54 | /** array of the objects */ 55 | @property (nonatomic,readwrite,retain) NSMutableArray *objects; 56 | /** list of properties stored in a dictionary */ 57 | @property (nonatomic,readwrite,retain) NSMutableDictionary *properties; 58 | 59 | /** return the value for the specific property name */ 60 | -(id) propertyNamed:(NSString *)propertyName; 61 | 62 | /** return the dictionary for the specific object name. 63 | It will return the 1st object found on the array for the given name. 64 | */ 65 | -(NSMutableDictionary*) objectNamed:(NSString *)objectName; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCTransitionPageTurn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ 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 | 27 | #import "CCTransition.h" 28 | 29 | /** CCTransitionPageTurn transition. 30 | * A transition which peels back the bottom right hand corner of a scene 31 | * to transition to the scene beneath it simulating a page turn 32 | * 33 | * This uses a 3DAction so it is strongly recommended that depth buffering 34 | * is turned on in CCDirector using: 35 | * 36 | * [[CCDirector sharedDirector] setDepthBufferFormat:kCCDepthBuffer16]; 37 | * 38 | * @since v0.8.2 39 | */ 40 | @interface CCTransitionPageTurn : CCTransitionScene 41 | { 42 | BOOL back_; 43 | } 44 | /** 45 | * creates a base transition with duration and incoming scene 46 | * if back is TRUE then the effect is reversed to appear as if the incoming 47 | * scene is being turned from left over the outgoing scene 48 | */ 49 | +(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; 50 | 51 | /** 52 | * creates a base transition with duration and incoming scene 53 | * if back is TRUE then the effect is reversed to appear as if the incoming 54 | * scene is being turned from left over the outgoing scene 55 | */ 56 | -(id) initWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; 57 | 58 | -(CCActionInterval*) actionWithSize:(ccGridSize) vector; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/CCTransitionProgress.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Lam Pham 5 | * 6 | * Copyright (c) 2012 Ricardo Quesada 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | * 26 | */ 27 | 28 | #import "CCTransition.h" 29 | 30 | @interface CCTransitionProgress : CCTransitionScene 31 | { 32 | float to_, from_; 33 | CCScene *sceneToBeModified_; 34 | } 35 | @end 36 | 37 | /** CCTransitionRadialCCW transition. 38 | A counter colock-wise radial transition to the next scene 39 | */ 40 | @interface CCTransitionProgressRadialCCW : CCTransitionProgress 41 | @end 42 | 43 | /** CCTransitionRadialCW transition. 44 | A counter colock-wise radial transition to the next scene 45 | */ 46 | @interface CCTransitionProgressRadialCW : CCTransitionProgress 47 | @end 48 | 49 | /** CCTransitionProgressHorizontal transition. 50 | A colock-wise radial transition to the next scene 51 | */ 52 | @interface CCTransitionProgressHorizontal : CCTransitionProgress 53 | @end 54 | 55 | @interface CCTransitionProgressVertical : CCTransitionProgress 56 | @end 57 | 58 | @interface CCTransitionProgressInOut : CCTransitionProgress 59 | @end 60 | 61 | @interface CCTransitionProgressOutIn : CCTransitionProgress 62 | @end 63 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Platforms/CCGL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | // 27 | // Common layer for OpenGL stuff 28 | // 29 | 30 | #import "../ccMacros.h" 31 | 32 | #if __CC_PLATFORM_IOS 33 | #import 34 | #import 35 | #import 36 | #import "iOS/CCGLView.h" 37 | 38 | #elif __CC_PLATFORM_MAC 39 | #import 40 | #import 41 | #import // needed for NSOpenGLView 42 | #import "Mac/CCGLView.h" 43 | #endif 44 | 45 | 46 | // iOS 47 | #if __CC_PLATFORM_IOS 48 | #define glClearDepth glClearDepthf 49 | #define glDeleteVertexArrays glDeleteVertexArraysOES 50 | #define glGenVertexArrays glGenVertexArraysOES 51 | #define glBindVertexArray glBindVertexArrayOES 52 | 53 | #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES 54 | 55 | // Mac 56 | #elif __CC_PLATFORM_MAC 57 | 58 | #define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 59 | 60 | #if 1 61 | #define glDeleteVertexArrays glDeleteVertexArraysAPPLE 62 | #define glGenVertexArrays glGenVertexArraysAPPLE 63 | #define glBindVertexArray glBindVertexArrayAPPLE 64 | 65 | #else // OpenGL 3.2 Core Profile 66 | 67 | #define glDeleteVertexArrays glDeleteVertexArrays 68 | #define glGenVertexArrays glGenVertexArrays 69 | #define glBindVertexArray glBindVertexArray 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Platforms/CCNS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | // 27 | // Common layer for NS (Next-Step) stuff 28 | // 29 | 30 | #import "../ccMacros.h" 31 | 32 | #import // for NSObject 33 | 34 | #ifdef __CC_PLATFORM_IOS 35 | 36 | #define CCRectFromString(__r__) CGRectFromString(__r__) 37 | #define CCPointFromString(__p__) CGPointFromString(__p__) 38 | #define CCSizeFromString(__s__) CGSizeFromString(__s__) 39 | #define CCNSSizeToCGSize 40 | #define CCNSRectToCGRect 41 | #define CCNSPointToCGPoint 42 | 43 | 44 | #elif defined(__CC_PLATFORM_MAC) 45 | 46 | #define CCRectFromString(__r__) NSRectToCGRect( NSRectFromString(__r__) ) 47 | #define CCPointFromString(__p__) NSPointToCGPoint( NSPointFromString(__p__) ) 48 | #define CCSizeFromString(__s__) NSSizeToCGSize( NSSizeFromString(__s__) ) 49 | #define CCNSSizeToCGSize NSSizeToCGSize 50 | #define CCNSRectToCGRect NSRectToCGRect 51 | #define CCNSPointToCGPoint NSPointToCGPoint 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Platforms/Mac/CCWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 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 | // Only compile this code on Mac. These files should not be included on your iOS project. 26 | // But in case they are included, it won't be compiled. 27 | #import "../../ccMacros.h" 28 | #ifdef __CC_PLATFORM_MAC 29 | 30 | #import 31 | 32 | 33 | @interface CCWindow : NSWindow 34 | { 35 | } 36 | - (id) initWithFrame:(NSRect)frame fullscreen:(BOOL)fullscreen; 37 | 38 | @end 39 | 40 | 41 | #endif // __CC_PLATFORM_MAC 42 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Platforms/Mac/CCWindow.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 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 | // Only compile this code on Mac. These files should not be included on your iOS project. 26 | // But in case they are included, it won't be compiled. 27 | #import "../../ccMacros.h" 28 | #ifdef __CC_PLATFORM_MAC 29 | 30 | #import "CCWindow.h" 31 | 32 | 33 | @implementation CCWindow 34 | 35 | - (id) initWithFrame:(NSRect)frame fullscreen:(BOOL)fullscreen 36 | { 37 | int styleMask = fullscreen ? NSBackingStoreBuffered : ( NSTitledWindowMask | NSClosableWindowMask ); 38 | self = [self initWithContentRect:frame 39 | styleMask:styleMask 40 | backing:NSBackingStoreBuffered 41 | defer:YES]; 42 | 43 | if (self != nil) 44 | { 45 | if(fullscreen) 46 | { 47 | [self setLevel:NSMainMenuWindowLevel+1]; 48 | [self setHidesOnDeactivate:YES]; 49 | [self setHasShadow:NO]; 50 | } 51 | 52 | [self setAcceptsMouseMovedEvents:NO]; 53 | [self setOpaque:YES]; 54 | } 55 | return self; 56 | } 57 | 58 | - (BOOL) canBecomeKeyWindow 59 | { 60 | return YES; 61 | } 62 | 63 | - (BOOL) canBecomeMainWindow 64 | { 65 | return YES; 66 | } 67 | @end 68 | 69 | #endif // __CC_PLATFORM_MAC 70 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Platforms/iOS/CCESRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | * 25 | * 26 | * File autogenerated with Xcode. Adapted for cocos2d needs. 27 | */ 28 | 29 | // Only compile this code on iOS. These files should NOT be included on your Mac project. 30 | // But in case they are included, it won't be compiled. 31 | #import "../../ccMacros.h" 32 | #ifdef __CC_PLATFORM_IOS 33 | 34 | #import 35 | 36 | #import 37 | #import 38 | 39 | @protocol CCESRenderer 40 | 41 | - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples; 42 | 43 | - (BOOL) resizeFromLayer:(CAEAGLLayer *)layer; 44 | 45 | - (EAGLContext*) context; 46 | - (CGSize) backingSize; 47 | 48 | - (unsigned int) colorRenderBuffer; 49 | - (unsigned int) defaultFrameBuffer; 50 | - (unsigned int) msaaFrameBuffer; 51 | - (unsigned int) msaaColorBuffer; 52 | @end 53 | 54 | #endif // __CC_PLATFORM_IOS 55 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/CCVertex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2011 ForzeField Studios S.L. http://forzefield.com 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 | #import "ccTypes.h" 26 | 27 | /** @file CCVertex.h */ 28 | 29 | /** converts a line to a polygon */ 30 | void ccVertexLineToPolygon(CGPoint *points, float stroke, ccVertex2F *vertices, NSUInteger offset, NSUInteger nuPoints); 31 | 32 | /** returns wheter or not the line intersects */ 33 | BOOL ccVertexLineIntersect(float Ax, float Ay, 34 | float Bx, float By, 35 | float Cx, float Cy, 36 | float Dx, float Dy, float *T); 37 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/NSThread+performBlock.h: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * Idea taken from: http://stackoverflow.com/a/3940757 7 | * 8 | */ 9 | 10 | #import 11 | 12 | @interface NSThread (sendBlockToBackground) 13 | /** performs a block on the thread. It won't wait until it is done. */ 14 | - (void) performBlock:(void (^)(void))block; 15 | 16 | /** performs a block on the thread. */ 17 | - (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait; 18 | 19 | /** performs a block on the thread. */ 20 | - (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilDone:(BOOL)wait; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/NSThread+performBlock.m: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * Idea taken from: http://stackoverflow.com/a/3940757 7 | * 8 | */ 9 | 10 | 11 | #import "NSThread+performBlock.h" 12 | #import "../ccMacros.h" 13 | 14 | typedef void (^BlockWithParam)(id param); 15 | @interface CCObjectWith2Params : NSObject 16 | { 17 | @public 18 | BlockWithParam block; 19 | id param; 20 | } 21 | @property (nonatomic,copy) BlockWithParam block; 22 | @property (nonatomic,readwrite,retain) id param; 23 | @end 24 | 25 | @implementation CCObjectWith2Params 26 | @synthesize block, param; 27 | - (void)dealloc { 28 | CCLOG(@"cocos2d: deallocing %@", self); 29 | [block release]; 30 | [param release]; 31 | 32 | [super dealloc]; 33 | } 34 | @end 35 | 36 | @implementation NSThread (sendBlockToBackground) 37 | 38 | - (void) performBlock: (void (^)(void))block; 39 | { 40 | return [self performBlock:block waitUntilDone:NO]; 41 | } 42 | 43 | - (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait 44 | { 45 | [self performSelector:@selector(executeBlock:) 46 | onThread:self 47 | withObject: [[block copy] autorelease] 48 | waitUntilDone: wait]; 49 | } 50 | 51 | - (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilDone:(BOOL)wait 52 | { 53 | CCObjectWith2Params * obj = [[CCObjectWith2Params alloc] init]; 54 | obj.block = block; 55 | obj.param = object; 56 | 57 | [obj autorelease]; 58 | 59 | [self performSelector:@selector(executeBlock2:) 60 | onThread:self 61 | withObject:obj 62 | waitUntilDone:wait]; 63 | } 64 | 65 | - (void) executeBlock: (void (^)(void))block; 66 | { 67 | block(); 68 | } 69 | 70 | - (void) executeBlock2:(CCObjectWith2Params*)object 71 | { 72 | BlockWithParam block = object.block; 73 | block( object.param ); 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/TGAlib.h: -------------------------------------------------------------------------------- 1 | // 2 | // TGA lib for cocos2d-iphone 3 | // 4 | // sources from: http://www.lighthouse3d.com/opengl/terrain/index.php3?tgasource 5 | // 6 | 7 | //#ifndef TGA_LIB 8 | //#define TGA_LIB 9 | 10 | /** 11 | @file 12 | TGA image support 13 | */ 14 | 15 | enum { 16 | TGA_OK, 17 | TGA_ERROR_FILE_OPEN, 18 | TGA_ERROR_READING_FILE, 19 | TGA_ERROR_INDEXED_COLOR, 20 | TGA_ERROR_MEMORY, 21 | TGA_ERROR_COMPRESSED_FILE, 22 | }; 23 | 24 | /** TGA format */ 25 | typedef struct sImageTGA { 26 | int status; 27 | unsigned char type, pixelDepth; 28 | 29 | /** map width */ 30 | short int width; 31 | 32 | /** map height */ 33 | short int height; 34 | 35 | /** raw data */ 36 | unsigned char *imageData; 37 | int flipped; 38 | } tImageTGA; 39 | 40 | /// load the image header fields. We only keep those that matter! 41 | void tgaLoadHeader(FILE *file, tImageTGA *info); 42 | 43 | /// loads the image pixels. You shouldn't call this function directly 44 | void tgaLoadImageData(FILE *file, tImageTGA *info); 45 | 46 | /// this is the function to call when we want to load an image 47 | tImageTGA * tgaLoad(const char *filename); 48 | 49 | // /converts RGB to greyscale 50 | void tgaRGBtogreyscale(tImageTGA *info); 51 | 52 | /// releases the memory used for the image 53 | void tgaDestroy(tImageTGA *info); 54 | 55 | //#endif // TGA_LIB 56 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/TransformUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Valentin Milea 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 "../ccMacros.h" 27 | #import "../Platforms/CCGL.h" 28 | 29 | #ifdef __CC_PLATFORM_IOS 30 | #import 31 | #elif defined(__CC_PLATFORM_MAC) 32 | #import 33 | #endif 34 | 35 | void CGAffineToGL(const CGAffineTransform *t, GLfloat *m); 36 | void GLToCGAffine(const GLfloat *m, CGAffineTransform *t); 37 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/TransformUtils.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2009 Valentin Milea 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 | 27 | #import "TransformUtils.h" 28 | 29 | void CGAffineToGL(const CGAffineTransform *t, GLfloat *m) 30 | { 31 | // | m[0] m[4] m[8] m[12] | | m11 m21 m31 m41 | | a c 0 tx | 32 | // | m[1] m[5] m[9] m[13] | | m12 m22 m32 m42 | | b d 0 ty | 33 | // | m[2] m[6] m[10] m[14] | <=> | m13 m23 m33 m43 | <=> | 0 0 1 0 | 34 | // | m[3] m[7] m[11] m[15] | | m14 m24 m34 m44 | | 0 0 0 1 | 35 | 36 | m[2] = m[3] = m[6] = m[7] = m[8] = m[9] = m[11] = m[14] = 0.0f; 37 | m[10] = m[15] = 1.0f; 38 | m[0] = t->a; m[4] = t->c; m[12] = t->tx; 39 | m[1] = t->b; m[5] = t->d; m[13] = t->ty; 40 | } 41 | 42 | void GLToCGAffine(const GLfloat *m, CGAffineTransform *t) 43 | { 44 | t->a = m[0]; t->c = m[4]; t->tx = m[12]; 45 | t->b = m[1]; t->d = m[5]; t->ty = m[13]; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/ZipUtils.h: -------------------------------------------------------------------------------- 1 | /* cocos2d for iPhone 2 | * 3 | * http://www.cocos2d-iphone.org 4 | * 5 | * 6 | * inflateMemory_ based on zlib example code 7 | * http://www.zlib.net 8 | * 9 | * Some ideas were taken from: 10 | * http://themanaworld.org/ 11 | * from the mapreader.cpp file 12 | * 13 | */ 14 | 15 | #ifndef __CC_ZIP_UTILS_H 16 | #define __CC_ZIP_UTILS_H 17 | 18 | #import 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /* XXX: pragma pack ??? */ 25 | /** @struct CCZHeader 26 | */ 27 | struct CCZHeader { 28 | uint8_t sig[4]; // signature. Should be 'CCZ!' 4 bytes 29 | uint16_t compression_type; // should 0 30 | uint16_t version; // should be 2 (although version type==1 is also supported) 31 | uint32_t reserved; // Reserverd for users. 32 | uint32_t len; // size of the uncompressed file 33 | }; 34 | 35 | enum { 36 | CCZ_COMPRESSION_ZLIB, // zlib format. 37 | CCZ_COMPRESSION_BZIP2, // bzip2 format (not supported yet) 38 | CCZ_COMPRESSION_GZIP, // gzip format (not supported yet) 39 | CCZ_COMPRESSION_NONE, // plain (not supported yet) 40 | }; 41 | 42 | /** @file 43 | * Zip helper functions 44 | */ 45 | 46 | /** 47 | * Inflates either zlib or gzip deflated memory. The inflated memory is 48 | * expected to be freed by the caller. 49 | * 50 | * It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory. 51 | * @returns the length of the deflated buffer 52 | * 53 | @since v0.8.1 54 | */ 55 | int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **out); 56 | 57 | /** 58 | * Inflates either zlib or gzip deflated memory. The inflated memory is 59 | * expected to be freed by the caller. 60 | * 61 | * outLenghtHint is assumed to be the needed room to allocate the inflated buffer. 62 | * 63 | * @returns the length of the deflated buffer 64 | * 65 | @since v1.0.0 66 | */ 67 | int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outLenghtHint ); 68 | 69 | 70 | /** inflates a GZip file into memory 71 | * 72 | * @returns the length of the deflated buffer 73 | * 74 | * @since v0.99.5 75 | */ 76 | int ccInflateGZipFile(const char *filename, unsigned char **out); 77 | 78 | /** inflates a CCZ file into memory 79 | * 80 | * @returns the length of the deflated buffer 81 | * 82 | * @since v0.99.5 83 | */ 84 | int ccInflateCCZFile(const char *filename, unsigned char **out); 85 | 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif // __CC_ZIP_UTILS_H 92 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/base64.c: -------------------------------------------------------------------------------- 1 | /* 2 | public domain BASE64 code 3 | 4 | modified for cocos2d-iphone: http://www.cocos2d-iphone.org 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "base64.h" 11 | 12 | unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 13 | 14 | int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ); 15 | 16 | int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ) 17 | { 18 | static char inalphabet[256], decoder[256]; 19 | int i, bits, c, char_count, errors = 0; 20 | unsigned int input_idx = 0; 21 | unsigned int output_idx = 0; 22 | 23 | for (i = (sizeof alphabet) - 1; i >= 0 ; i--) { 24 | inalphabet[alphabet[i]] = 1; 25 | decoder[alphabet[i]] = i; 26 | } 27 | 28 | char_count = 0; 29 | bits = 0; 30 | for( input_idx=0; input_idx < input_len ; input_idx++ ) { 31 | c = input[ input_idx ]; 32 | if (c == '=') 33 | break; 34 | if (c > 255 || ! inalphabet[c]) 35 | continue; 36 | bits += decoder[c]; 37 | char_count++; 38 | if (char_count == 4) { 39 | output[ output_idx++ ] = (bits >> 16); 40 | output[ output_idx++ ] = ((bits >> 8) & 0xff); 41 | output[ output_idx++ ] = ( bits & 0xff); 42 | bits = 0; 43 | char_count = 0; 44 | } else { 45 | bits <<= 6; 46 | } 47 | } 48 | 49 | if( c == '=' ) { 50 | switch (char_count) { 51 | case 1: 52 | fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); 53 | errors++; 54 | break; 55 | case 2: 56 | output[ output_idx++ ] = ( bits >> 10 ); 57 | break; 58 | case 3: 59 | output[ output_idx++ ] = ( bits >> 16 ); 60 | output[ output_idx++ ] = (( bits >> 8 ) & 0xff); 61 | break; 62 | } 63 | } else if ( input_idx < input_len ) { 64 | if (char_count) { 65 | fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", 66 | ((4 - char_count) * 6)); 67 | errors++; 68 | } 69 | } 70 | 71 | *output_len = output_idx; 72 | return errors; 73 | } 74 | 75 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out) 76 | { 77 | unsigned int outLength = 0; 78 | 79 | //should be enough to store 6-bit buffers in 8-bit buffers 80 | *out = malloc( inLength * 3.0f / 4.0f + 1 ); 81 | if( *out ) { 82 | int ret = _base64Decode(in, inLength, *out, &outLength); 83 | 84 | if (ret > 0 ) 85 | { 86 | printf("Base64Utils: error decoding"); 87 | free(*out); 88 | *out = NULL; 89 | outLength = 0; 90 | } 91 | } 92 | return outLength; 93 | } 94 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | public domain BASE64 code 3 | 4 | modified for cocos2d-iphone: http://www.cocos2d-iphone.org 5 | */ 6 | 7 | #ifndef __CC_BASE64_DECODE_H 8 | #define __CC_BASE64_DECODE_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | 15 | /** @file 16 | base64 helper functions 17 | */ 18 | 19 | /** 20 | * Decodes a 64base encoded memory. The decoded memory is 21 | * expected to be freed by the caller. 22 | * 23 | * @returns the length of the out buffer 24 | * 25 | @since v0.8.1 26 | */ 27 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif // __CC_BASE64_DECODE_H 34 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/ccUtils.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | */ 5 | 6 | /* 7 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m. 8 | */ 9 | #include "ccUtils.h" 10 | 11 | unsigned long ccNextPOT(unsigned long x) 12 | { 13 | x = x - 1; 14 | x = x | (x >> 1); 15 | x = x | (x >> 2); 16 | x = x | (x >> 4); 17 | x = x | (x >> 8); 18 | x = x | (x >>16); 19 | return x + 1; 20 | } 21 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/Support/ccUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | */ 5 | 6 | #ifndef __CC_UTILS_H 7 | #define __CC_UTILS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /** @file ccUtils.h 14 | Misc free functions 15 | */ 16 | 17 | /* 18 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m. 19 | */ 20 | 21 | /** returns the Next Power of Two value. 22 | 23 | Examples: 24 | - If "value" is 15, it will return 16. 25 | - If "value" is 16, it will return 16. 26 | - If "value" is 17, it will return 32. 27 | 28 | @since v0.99.5 29 | */ 30 | unsigned long ccNextPOT( unsigned long value ); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif // ! __CC_UTILS_H 37 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | \n\ 8 | void main() \n\ 9 | { \n\ 10 | gl_FragColor = v_fragmentColor; \n\ 11 | } \n\ 12 | "; 13 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec4 a_color; \n\ 4 | uniform mat4 u_MVPMatrix; \n\ 5 | \n\ 6 | #ifdef GL_ES \n\ 7 | varying lowp vec4 v_fragmentColor; \n\ 8 | #else \n\ 9 | varying vec4 v_fragmentColor; \n\ 10 | #endif \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_Position = u_MVPMatrix * a_position; \n\ 15 | v_fragmentColor = a_color; \n\ 16 | } \n\ 17 | "; 18 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTextureA8Color_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | \n\ 10 | void main() \n\ 11 | { \n\ 12 | gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\ 13 | v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform \n\ 14 | ); \n\ 15 | } \n\ 16 | "; 17 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTextureA8Color_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | attribute vec4 a_color; \n\ 5 | uniform mat4 u_MVPMatrix; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying lowp vec4 v_fragmentColor; \n\ 9 | varying mediump vec2 v_texCoord; \n\ 10 | #else \n\ 11 | varying vec4 v_fragmentColor; \n\ 12 | varying vec2 v_texCoord; \n\ 13 | #endif \n\ 14 | \n\ 15 | void main() \n\ 16 | { \n\ 17 | gl_Position = u_MVPMatrix * a_position; \n\ 18 | v_fragmentColor = a_color; \n\ 19 | v_texCoord = a_texCoord; \n\ 20 | } \n\ 21 | "; 22 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | uniform float u_alpha_value; \n\ 10 | \n\ 11 | void main() \n\ 12 | { \n\ 13 | vec4 texColor = texture2D(u_texture, v_texCoord); \n\ 14 | \n\ 15 | // mimic: glAlphaFunc(GL_GREATER) \n\ 16 | // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value \n\ 17 | \n\ 18 | if ( texColor.a <= u_alpha_value ) \n\ 19 | discard; \n\ 20 | \n\ 21 | gl_FragColor = texColor * v_fragmentColor; \n\ 22 | } \n\ 23 | "; 24 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTextureColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | varying vec2 v_texCoord; \n\ 8 | uniform sampler2D u_texture; \n\ 9 | \n\ 10 | void main() \n\ 11 | { \n\ 12 | gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord); \n\ 13 | } \n\ 14 | "; 15 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTextureColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | attribute vec4 a_color; \n\ 5 | \n\ 6 | uniform mat4 u_MVPMatrix; \n\ 7 | \n\ 8 | #ifdef GL_ES \n\ 9 | varying lowp vec4 v_fragmentColor; \n\ 10 | varying mediump vec2 v_texCoord; \n\ 11 | #else \n\ 12 | varying vec4 v_fragmentColor; \n\ 13 | varying vec2 v_texCoord; \n\ 14 | #endif \n\ 15 | \n\ 16 | void main() \n\ 17 | { \n\ 18 | gl_Position = u_MVPMatrix * a_position; \n\ 19 | v_fragmentColor = a_color; \n\ 20 | v_texCoord = a_texCoord; \n\ 21 | } \n\ 22 | "; 23 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTexture_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec2 v_texCoord; \n\ 7 | uniform sampler2D u_texture; \n\ 8 | \n\ 9 | void main() \n\ 10 | { \n\ 11 | gl_FragColor = texture2D(u_texture, v_texCoord); \n\ 12 | } \n\ 13 | "; 14 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTexture_uColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | uniform vec4 u_color; \n\ 7 | \n\ 8 | varying vec2 v_texCoord; \n\ 9 | \n\ 10 | uniform sampler2D u_texture; \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_FragColor = texture2D(u_texture, v_texCoord) * u_color; \n\ 15 | } \n\ 16 | "; 17 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTexture_uColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | \n\ 5 | uniform mat4 u_MVPMatrix; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying mediump vec2 v_texCoord; \n\ 9 | #else \n\ 10 | varying vec2 v_texCoord; \n\ 11 | #endif \n\ 12 | \n\ 13 | void main() \n\ 14 | { \n\ 15 | gl_Position = u_MVPMatrix * a_position; \n\ 16 | v_texCoord = a_texCoord; \n\ 17 | } \n\ 18 | "; 19 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_PositionTexture_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | attribute vec2 a_texCoord; \n\ 4 | uniform mat4 u_MVPMatrix; \n\ 5 | \n\ 6 | #ifdef GL_ES \n\ 7 | varying mediump vec2 v_texCoord; \n\ 8 | #else \n\ 9 | varying vec2 v_texCoord; \n\ 10 | #endif \n\ 11 | \n\ 12 | void main() \n\ 13 | { \n\ 14 | gl_Position = u_MVPMatrix * a_position; \n\ 15 | v_texCoord = a_texCoord; \n\ 16 | } \n\ 17 | "; 18 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_Position_uColor_frag.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | #ifdef GL_ES \n\ 3 | precision lowp float; \n\ 4 | #endif \n\ 5 | \n\ 6 | varying vec4 v_fragmentColor; \n\ 7 | \n\ 8 | void main() \n\ 9 | { \n\ 10 | gl_FragColor = v_fragmentColor; \n\ 11 | } \n\ 12 | "; 13 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShader_Position_uColor_vert.h: -------------------------------------------------------------------------------- 1 | " \n\ 2 | attribute vec4 a_position; \n\ 3 | uniform mat4 u_MVPMatrix; \n\ 4 | uniform vec4 u_color; \n\ 5 | uniform float u_pointSize; \n\ 6 | \n\ 7 | #ifdef GL_ES \n\ 8 | varying lowp vec4 v_fragmentColor; \n\ 9 | #else \n\ 10 | varying vec4 v_fragmentColor; \n\ 11 | #endif \n\ 12 | \n\ 13 | void main() \n\ 14 | { \n\ 15 | gl_Position = u_MVPMatrix * a_position; \n\ 16 | gl_PointSize = u_pointSize; \n\ 17 | v_fragmentColor = u_color; \n\ 18 | } \n\ 19 | "; 20 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/ccShaders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2012 Zynga Inc. 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 | #import "Platforms/CCGL.h" 26 | 27 | extern const GLchar * ccPosition_uColor_frag; 28 | extern const GLchar * ccPosition_uColor_vert; 29 | 30 | extern const GLchar * ccPositionColor_frag; 31 | extern const GLchar * ccPositionColor_vert; 32 | 33 | extern const GLchar * ccPositionTexture_frag; 34 | extern const GLchar * ccPositionTexture_vert; 35 | 36 | extern const GLchar * ccPositionTextureA8Color_frag; 37 | extern const GLchar * ccPositionTextureA8Color_vert; 38 | 39 | extern const GLchar * ccPositionTextureColor_frag; 40 | extern const GLchar * ccPositionTextureColor_vert; 41 | 42 | extern const GLchar * ccPositionTextureColorAlphaTest_frag; 43 | 44 | extern const GLchar * ccPositionTexture_uColor_frag; 45 | extern const GLchar * ccPositionTexture_uColor_vert; 46 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/cocos2d/cocos2d.m: -------------------------------------------------------------------------------- 1 | /* 2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org 3 | * 4 | * Copyright (c) 2008-2010 Ricardo Quesada 5 | * Copyright (c) 2011 Zynga Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ 25 | 26 | 27 | #import 28 | #import "cocos2d.h" 29 | static NSString *version = @"cocos2d v2.0.0"; 30 | 31 | NSString *cocos2dVersion() 32 | { 33 | return version; 34 | } 35 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/GL/mat4stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef C_STACK_H_INCLUDED 27 | #define C_STACK_H_INCLUDED 28 | 29 | #include "../mat4.h" 30 | 31 | typedef struct km_mat4_stack { 32 | int capacity; //The total item capacity 33 | int item_count; //The number of items 34 | kmMat4* top; 35 | kmMat4* stack; 36 | } km_mat4_stack; 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | void km_mat4_stack_initialize(km_mat4_stack* stack); 43 | void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item); 44 | void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut); 45 | void km_mat4_stack_release(km_mat4_stack* stack); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif // C_STACK_H_INCLUDED 52 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/GL/matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KM_GL_MATRIX_H_INCLUDED 27 | #define KM_GL_MATRIX_H_INCLUDED 28 | 29 | #define KM_GL_MODELVIEW 0x1700 30 | #define KM_GL_PROJECTION 0x1701 31 | #define KM_GL_TEXTURE 0x1702 32 | 33 | typedef unsigned int kmGLEnum; 34 | 35 | #include "../mat4.h" 36 | #include "../vec3.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | void kmGLFreeAll(void); 43 | void kmGLPushMatrix(void); 44 | void kmGLPopMatrix(void); 45 | void kmGLMatrixMode(kmGLEnum mode); 46 | void kmGLLoadIdentity(void); 47 | void kmGLLoadMatrix(const kmMat4* pIn); 48 | void kmGLMultMatrix(const kmMat4* pIn); 49 | void kmGLTranslatef(float x, float y, float z); 50 | void kmGLRotatef(float angle, float x, float y, float z); 51 | void kmGLScalef(float x, float y, float z); 52 | void kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // MATRIX_H_INCLUDED 59 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/aabb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KAZMATH_AABB_H_INCLUDED 27 | #define KAZMATH_AABB_H_INCLUDED 28 | 29 | #include "vec3.h" 30 | #include "utility.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /** 37 | * A struture that represents an axis-aligned 38 | * bounding box. 39 | */ 40 | typedef struct kmAABB { 41 | kmVec3 min; /** The max corner of the box */ 42 | kmVec3 max; /** The min corner of the box */ 43 | } kmAABB; 44 | 45 | const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox); 46 | kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn); 47 | kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/kazmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef KAZMATH_H_INCLUDED 27 | #define KAZMATH_H_INCLUDED 28 | 29 | #include "vec2.h" 30 | #include "vec3.h" 31 | #include "mat3.h" 32 | #include "mat4.h" 33 | #include "utility.h" 34 | #include "quaternion.h" 35 | #include "plane.h" 36 | #include "aabb.h" 37 | #include "ray2.h" 38 | 39 | #endif // KAZMATH_H_INCLUDED 40 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/neon_matrix_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | NEON math library for the iPhone / iPod touch 3 | 4 | Copyright (c) 2009 Justin Saunders 5 | 6 | This software is provided 'as-is', without any express or implied warranty. 7 | In no event will the authors be held liable for any damages arising 8 | from the use of this software. 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it freely, 11 | subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must 14 | not claim that you wrote the original software. If you use this 15 | software in a product, an acknowledgment in the product documentation 16 | would be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must 19 | not be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source distribution. 22 | */ 23 | 24 | #ifndef __NEON_MATRIX_IMPL_H__ 25 | #define __NEON_MATRIX_IMPL_H__ 26 | 27 | #ifdef __arm__ 28 | #include "arm/arch.h" 29 | #endif 30 | 31 | // Matrixes are assumed to be stored in column major format according to OpenGL 32 | // specification. 33 | 34 | // Multiplies two 4x4 matrices (a,b) outputing a 4x4 matrix (output) 35 | void NEON_Matrix4Mul(const float* a, const float* b, float* output ); 36 | 37 | // Multiplies a 4x4 matrix (m) with a vector 4 (v), outputing a vector 4 38 | void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output); 39 | 40 | 41 | #endif // __NEON_MATRIX_IMPL_H__ 42 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/ray2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef RAY_2_H 27 | #define RAY_2_H 28 | 29 | #include "utility.h" 30 | #include "vec2.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | typedef struct kmRay2 { 37 | kmVec2 start; 38 | kmVec2 dir; 39 | } kmRay2; 40 | 41 | void kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy); 42 | kmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection); 43 | kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out); 44 | kmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/include/kazmath/utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef UTILITY_H_INCLUDED 27 | #define UTILITY_H_INCLUDED 28 | 29 | #include 30 | 31 | #ifndef kmScalar 32 | #define kmScalar float 33 | #endif 34 | 35 | #ifndef kmBool 36 | #define kmBool unsigned char 37 | #endif 38 | 39 | #ifndef kmEnum 40 | #define kmEnum unsigned int 41 | #endif 42 | 43 | #ifndef KM_FALSE 44 | #define KM_FALSE 0 45 | #endif 46 | 47 | #ifndef KM_TRUE 48 | #define KM_TRUE 1 49 | #endif 50 | 51 | #define kmPI 3.141592f 52 | #define kmPIOver180 0.017453f // PI / 180 53 | #define kmPIUnder180 57.295779f // 180 / PI 54 | #define kmEpsilon 1.0 / 64.0 55 | 56 | 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | extern kmScalar kmSQR(kmScalar s); 63 | extern kmScalar kmDegreesToRadians(kmScalar degrees); 64 | extern kmScalar kmRadiansToDegrees(kmScalar radians); 65 | 66 | extern kmScalar min(kmScalar lhs, kmScalar rhs); 67 | extern kmScalar max(kmScalar lhs, kmScalar rhs); 68 | extern kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* UTILITY_H_INCLUDED */ 75 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #ADD_LIBRARY(Kazmath STATIC ${KAZMATH_SRCS}) 3 | #INSTALL(TARGETS Kazmath ARCHIVE DESTINATION lib) 4 | 5 | INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ) 6 | 7 | ADD_LIBRARY(kazmath STATIC ${KAZMATH_SOURCES}) 8 | INSTALL(TARGETS kazmath ARCHIVE DESTINATION lib) 9 | 10 | #ADD_LIBRARY(KazmathGL STATIC ${GL_UTILS_SRCS}) 11 | #INSTALL(TARGETS KazmathGL ARCHIVE DESTINATION lib) 12 | 13 | INSTALL(FILES ${KAZMATH_HEADERS} DESTINATION include/kazmath) 14 | INSTALL(FILES ${GL_UTILS_HEADERS} DESTINATION include/kazmath/GL) 15 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/src/aabb.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "kazmath/aabb.h" 27 | 28 | /** 29 | * Returns KM_TRUE if point is in the specified AABB, returns 30 | * KM_FALSE otherwise. 31 | */ 32 | const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox) 33 | { 34 | if(pPoint->x >= pBox->min.x && pPoint->x <= pBox->max.x && 35 | pPoint->y >= pBox->min.y && pPoint->y <= pBox->max.y && 36 | pPoint->z >= pBox->min.z && pPoint->z <= pBox->max.z) { 37 | return KM_TRUE; 38 | } 39 | 40 | return KM_FALSE; 41 | } 42 | 43 | /** 44 | * Assigns pIn to pOut, returns pOut. 45 | */ 46 | kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn) 47 | { 48 | kmVec3Assign(&pOut->min, &pIn->min); 49 | kmVec3Assign(&pOut->max, &pIn->max); 50 | return pOut; 51 | } 52 | 53 | /** 54 | * Scales pIn by s, stores the resulting AABB in pOut. Returns pOut 55 | */ 56 | kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s) 57 | { 58 | assert(0 && "Not implemented"); 59 | return 0; 60 | } 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/libs/kazmath/src/utility.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008, Luke Benstead. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #include "kazmath/utility.h" 27 | 28 | /** 29 | * Returns the square of s (e.g. s*s) 30 | */ 31 | kmScalar kmSQR(kmScalar s) { 32 | return s*s; 33 | } 34 | 35 | /** 36 | * Returns degrees as radians. 37 | */ 38 | kmScalar kmDegreesToRadians(kmScalar degrees) { 39 | return degrees * kmPIOver180; 40 | } 41 | 42 | /** 43 | * Returns radians as degrees 44 | */ 45 | kmScalar kmRadiansToDegrees(kmScalar radians) { 46 | return radians * kmPIUnder180; 47 | } 48 | 49 | kmScalar min(kmScalar lhs, kmScalar rhs) { 50 | return (lhs < rhs)? lhs : rhs; 51 | } 52 | 53 | kmScalar max(kmScalar lhs, kmScalar rhs) { 54 | return (lhs > rhs)? lhs : rhs; 55 | } 56 | 57 | kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs) { 58 | return (lhs + kmEpsilon > rhs && lhs - kmEpsilon < rhs); 59 | } 60 | -------------------------------------------------------------------------------- /PRKit iOS example/PRKit iOS example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PRKit iOS example 4 | // 5 | // Created by Andy Sinesio on 2/24/13. 6 | // Copyright __MyCompanyName__ 2013. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /PRKit/PRRatcliffTriangulator.h: -------------------------------------------------------------------------------- 1 | /* 2 | PRRatcliffTriangulator.h 3 | 4 | PRKit: Precognitive Research additions to Cocos2D. http://cocos2d-iphone.org 5 | Contact us if you like it: http://precognitiveresearch.com 6 | 7 | Created by Andy Sinesio on 6/25/10. 8 | Copyright 2011 Precognitive Research, LLC. All rights reserved. 9 | 10 | This class fills a polygon as described by an array of NSValue-encapsulated points with a texture. 11 | 12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | * 19 | * The above copyright notice and this permission notice shall be included in 20 | * all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | * THE SOFTWARE. 29 | * 30 | */ 31 | 32 | 33 | #import 34 | #import "PRTriangulator.h" 35 | 36 | 37 | @interface PRRatcliffTriangulator : NSObject { 38 | 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /PRKit/PRTriangulator.h: -------------------------------------------------------------------------------- 1 | /* 2 | PRTriangulator.h 3 | 4 | PRKit: Precognitive Research additions to Cocos2D. http://cocos2d-iphone.org 5 | Contact us if you like it: http://precognitiveresearch.com 6 | 7 | Created by Andy Sinesio on 6/25/10. 8 | Copyright 2011 Precognitive Research, LLC. All rights reserved. 9 | 10 | This class fills a polygon as described by an array of NSValue-encapsulated points with a texture. 11 | 12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | * 19 | * The above copyright notice and this permission notice shall be included in 20 | * all copies or substantial portions of the Software. 21 | * 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | * THE SOFTWARE. 29 | * 30 | */ 31 | 32 | 33 | #import 34 | 35 | 36 | @protocol PRTriangulator 37 | 38 | - (NSArray *) triangulateVertices: (NSArray *) vertices; 39 | 40 | @end 41 | --------------------------------------------------------------------------------