├── .gitignore
├── Cocos2dxExt
├── Cocos2dxExt.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── Cocos2dxExt.xccheckout
│ │ └── xcuserdata
│ │ │ └── liuyanghui.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── liuyanghui.xcuserdatad
│ │ ├── xcdebugger
│ │ ├── Breakpoints.xcbkptlist
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── Cocos2dxExt.xcscheme
│ │ └── xcschememanagement.plist
└── Cocos2dxExt
│ ├── Classes
│ ├── AppDelegate.cpp
│ ├── AppDelegate.h
│ ├── EXMainMenuScene.cpp
│ ├── EXMainMenuScene.h
│ ├── EXTestScene.cpp
│ ├── EXTestScene.h
│ ├── HelloWorldScene.cpp
│ ├── HelloWorldScene.h
│ ├── TestDynamicLabel
│ │ ├── EXDynamicLabel.cpp
│ │ ├── EXDynamicLabel.h
│ │ ├── EXTestDynamicLabelLayer.cpp
│ │ └── EXTestDynamicLabelLayer.h
│ ├── TestGraySprite
│ │ ├── EXGraySprite.cpp
│ │ ├── EXGraySprite.h
│ │ ├── EXGrayUtility.cpp
│ │ ├── EXGrayUtility.h
│ │ ├── EXTestGraySpriteLayer.cpp
│ │ └── EXTestGraySpriteLayer.h
│ ├── TestMemDataHolder
│ │ └── EXMemValue.h
│ ├── TestTriangleSprite
│ │ ├── EXTestTriangleSpriteLayer.cpp
│ │ └── EXTestTriangleSpriteLayer.h
│ ├── TestTurnCard
│ │ ├── EXTestTurnCardLayer.cpp
│ │ ├── EXTestTurnCardLayer.h
│ │ ├── EXTurnCard.cpp
│ │ └── EXTurnCard.h
│ ├── TestWebView
│ │ ├── EXTestWebViewLayer.cpp
│ │ ├── EXTestWebViewLayer.h
│ │ ├── EXUIWebViewBridge.h
│ │ ├── EXUIWebViewBridge.mm
│ │ ├── EXWebViewLayer.h
│ │ └── EXWebViewLayer.mm
│ └── ZoomController
│ │ ├── EXTestZoomControllerLayer.cpp
│ │ ├── EXTestZoomControllerLayer.h
│ │ ├── EXZoomController.cpp
│ │ └── EXZoomController.h
│ ├── Prefix.pch
│ ├── Resources
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── CloseNormal.png
│ ├── CloseSelected.png
│ ├── Default.png
│ ├── HelloWorld.png
│ ├── Icon-72.png
│ ├── Icon-Small-50.png
│ ├── Icon-Small.png
│ ├── Icon-Small@2x.png
│ ├── Icon.png
│ ├── Icon@2x.png
│ ├── Info.plist
│ ├── bg_theme1.png
│ ├── coc.jpg
│ └── iTunesArtwork
│ ├── ios
│ ├── AppController.h
│ ├── AppController.mm
│ ├── RootViewController.h
│ ├── RootViewController.mm
│ └── main.m
│ └── libs
│ ├── CocosDenshion
│ ├── include
│ │ ├── Export.h
│ │ └── SimpleAudioEngine.h
│ ├── ios
│ │ ├── CDAudioManager.h
│ │ ├── CDAudioManager.m
│ │ ├── CDConfig.h
│ │ ├── CDOpenALSupport.h
│ │ ├── CDOpenALSupport.m
│ │ ├── CocosDenshion.h
│ │ ├── CocosDenshion.m
│ │ ├── SimpleAudioEngine.mm
│ │ ├── SimpleAudioEngine_objc.h
│ │ └── SimpleAudioEngine_objc.m
│ └── proj.ios
│ │ └── CocosDenshion.xcodeproj
│ │ └── project.pbxproj
│ ├── chipmunk
│ ├── LICENSE.txt
│ ├── README.txt
│ ├── chipmunk-docs.html
│ ├── include
│ │ └── chipmunk
│ │ │ ├── chipmunk.h
│ │ │ ├── chipmunk_ffi.h
│ │ │ ├── chipmunk_private.h
│ │ │ ├── chipmunk_types.h
│ │ │ ├── chipmunk_unsafe.h
│ │ │ ├── constraints
│ │ │ ├── cpConstraint.h
│ │ │ ├── cpDampedRotarySpring.h
│ │ │ ├── cpDampedSpring.h
│ │ │ ├── cpGearJoint.h
│ │ │ ├── cpGrooveJoint.h
│ │ │ ├── cpPinJoint.h
│ │ │ ├── cpPivotJoint.h
│ │ │ ├── cpRatchetJoint.h
│ │ │ ├── cpRotaryLimitJoint.h
│ │ │ ├── cpSimpleMotor.h
│ │ │ ├── cpSlideJoint.h
│ │ │ └── util.h
│ │ │ ├── cpArbiter.h
│ │ │ ├── cpBB.h
│ │ │ ├── cpBody.h
│ │ │ ├── cpPolyShape.h
│ │ │ ├── cpShape.h
│ │ │ ├── cpSpace.h
│ │ │ ├── cpSpatialIndex.h
│ │ │ └── cpVect.h
│ └── src
│ │ ├── CMakeLists.txt
│ │ ├── chipmunk.c
│ │ ├── constraints
│ │ ├── cpConstraint.c
│ │ ├── cpDampedRotarySpring.c
│ │ ├── cpDampedSpring.c
│ │ ├── cpGearJoint.c
│ │ ├── cpGrooveJoint.c
│ │ ├── cpPinJoint.c
│ │ ├── cpPivotJoint.c
│ │ ├── cpRatchetJoint.c
│ │ ├── cpRotaryLimitJoint.c
│ │ ├── cpSimpleMotor.c
│ │ └── cpSlideJoint.c
│ │ ├── cpArbiter.c
│ │ ├── cpArray.c
│ │ ├── cpBB.c
│ │ ├── cpBBTree.c
│ │ ├── cpBody.c
│ │ ├── cpCollision.c
│ │ ├── cpHashSet.c
│ │ ├── cpPolyShape.c
│ │ ├── cpShape.c
│ │ ├── cpSpace.c
│ │ ├── cpSpaceComponent.c
│ │ ├── cpSpaceHash.c
│ │ ├── cpSpaceQuery.c
│ │ ├── cpSpaceStep.c
│ │ ├── cpSpatialIndex.c
│ │ ├── cpSweep1D.c
│ │ ├── cpVect.c
│ │ └── prime.h
│ ├── cocos2dx
│ ├── CCCamera.cpp
│ ├── CCCamera.h
│ ├── CCConfiguration.cpp
│ ├── CCConfiguration.h
│ ├── CCDirector.cpp
│ ├── CCDirector.h
│ ├── CCScheduler.cpp
│ ├── CCScheduler.h
│ ├── actions
│ │ ├── CCAction.cpp
│ │ ├── CCAction.h
│ │ ├── CCActionCamera.cpp
│ │ ├── CCActionCamera.h
│ │ ├── CCActionCatmullRom.cpp
│ │ ├── CCActionCatmullRom.h
│ │ ├── CCActionEase.cpp
│ │ ├── CCActionEase.h
│ │ ├── CCActionGrid.cpp
│ │ ├── CCActionGrid.h
│ │ ├── CCActionGrid3D.cpp
│ │ ├── CCActionGrid3D.h
│ │ ├── CCActionInstant.cpp
│ │ ├── CCActionInstant.h
│ │ ├── CCActionInterval.cpp
│ │ ├── CCActionInterval.h
│ │ ├── CCActionManager.cpp
│ │ ├── CCActionManager.h
│ │ ├── CCActionPageTurn3D.cpp
│ │ ├── CCActionPageTurn3D.h
│ │ ├── CCActionProgressTimer.cpp
│ │ ├── CCActionProgressTimer.h
│ │ ├── CCActionTiledGrid.cpp
│ │ ├── CCActionTiledGrid.h
│ │ ├── CCActionTween.cpp
│ │ └── CCActionTween.h
│ ├── base_nodes
│ │ ├── CCAtlasNode.cpp
│ │ ├── CCAtlasNode.h
│ │ ├── CCNode.cpp
│ │ └── CCNode.h
│ ├── ccFPSImages.c
│ ├── ccFPSImages.h
│ ├── cocoa
│ │ ├── CCAffineTransform.cpp
│ │ ├── CCAffineTransform.h
│ │ ├── CCArray.cpp
│ │ ├── CCArray.h
│ │ ├── CCAutoreleasePool.cpp
│ │ ├── CCAutoreleasePool.h
│ │ ├── CCBool.h
│ │ ├── CCDataVisitor.cpp
│ │ ├── CCDataVisitor.h
│ │ ├── CCDictionary.cpp
│ │ ├── CCDictionary.h
│ │ ├── CCDouble.h
│ │ ├── CCFloat.h
│ │ ├── CCGeometry.cpp
│ │ ├── CCGeometry.h
│ │ ├── CCInteger.h
│ │ ├── CCNS.cpp
│ │ ├── CCNS.h
│ │ ├── CCObject.cpp
│ │ ├── CCObject.h
│ │ ├── CCSet.cpp
│ │ ├── CCSet.h
│ │ ├── CCString.cpp
│ │ ├── CCString.h
│ │ ├── CCZone.cpp
│ │ └── CCZone.h
│ ├── cocos2d.cpp
│ ├── draw_nodes
│ │ ├── CCDrawNode.cpp
│ │ ├── CCDrawNode.h
│ │ ├── CCDrawingPrimitives.cpp
│ │ └── CCDrawingPrimitives.h
│ ├── effects
│ │ ├── CCGrabber.cpp
│ │ ├── CCGrabber.h
│ │ ├── CCGrid.cpp
│ │ └── CCGrid.h
│ ├── include
│ │ ├── CCEventType.h
│ │ ├── CCProtocols.h
│ │ ├── ccConfig.h
│ │ ├── ccMacros.h
│ │ ├── ccTypeInfo.h
│ │ ├── ccTypes.h
│ │ └── cocos2d.h
│ ├── 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
│ ├── keypad_dispatcher
│ │ ├── CCKeypadDelegate.cpp
│ │ ├── CCKeypadDelegate.h
│ │ ├── CCKeypadDispatcher.cpp
│ │ └── CCKeypadDispatcher.h
│ ├── label_nodes
│ │ ├── CCLabelAtlas.cpp
│ │ ├── CCLabelAtlas.h
│ │ ├── CCLabelBMFont.cpp
│ │ ├── CCLabelBMFont.h
│ │ ├── CCLabelTTF.cpp
│ │ └── CCLabelTTF.h
│ ├── layers_scenes_transitions_nodes
│ │ ├── CCLayer.cpp
│ │ ├── CCLayer.h
│ │ ├── CCScene.cpp
│ │ ├── CCScene.h
│ │ ├── CCTransition.cpp
│ │ ├── CCTransition.h
│ │ ├── CCTransitionPageTurn.cpp
│ │ ├── CCTransitionPageTurn.h
│ │ ├── CCTransitionProgress.cpp
│ │ └── CCTransitionProgress.h
│ ├── menu_nodes
│ │ ├── CCMenu.cpp
│ │ ├── CCMenu.h
│ │ ├── CCMenuItem.cpp
│ │ └── CCMenuItem.h
│ ├── misc_nodes
│ │ ├── CCClippingNode.cpp
│ │ ├── CCClippingNode.h
│ │ ├── CCMotionStreak.cpp
│ │ ├── CCMotionStreak.h
│ │ ├── CCProgressTimer.cpp
│ │ ├── CCProgressTimer.h
│ │ ├── CCRenderTexture.cpp
│ │ └── CCRenderTexture.h
│ ├── particle_nodes
│ │ ├── CCParticleBatchNode.cpp
│ │ ├── CCParticleBatchNode.h
│ │ ├── CCParticleExamples.cpp
│ │ ├── CCParticleExamples.h
│ │ ├── CCParticleSystem.cpp
│ │ ├── CCParticleSystem.h
│ │ ├── CCParticleSystemQuad.cpp
│ │ ├── CCParticleSystemQuad.h
│ │ └── firePngData.h
│ ├── platform
│ │ ├── CCAccelerometerDelegate.h
│ │ ├── CCApplicationProtocol.h
│ │ ├── CCCommon.h
│ │ ├── CCDevice.h
│ │ ├── CCEGLViewProtocol.cpp
│ │ ├── CCEGLViewProtocol.h
│ │ ├── CCFileUtils.cpp
│ │ ├── CCFileUtils.h
│ │ ├── CCImage.h
│ │ ├── CCImageCommonWebp.cpp
│ │ ├── CCPlatformConfig.h
│ │ ├── CCPlatformMacros.h
│ │ ├── CCSAXParser.cpp
│ │ ├── CCSAXParser.h
│ │ ├── CCThread.h
│ │ ├── ios
│ │ │ ├── AccelerometerDelegateWrapper.h
│ │ │ ├── AccelerometerDelegateWrapper.mm
│ │ │ ├── CCAccelerometer.h
│ │ │ ├── CCAccelerometer.mm
│ │ │ ├── CCApplication.h
│ │ │ ├── CCApplication.mm
│ │ │ ├── CCCommon.mm
│ │ │ ├── CCDevice.mm
│ │ │ ├── CCDirectorCaller.h
│ │ │ ├── CCDirectorCaller.mm
│ │ │ ├── CCEGLView.h
│ │ │ ├── CCEGLView.mm
│ │ │ ├── CCES2Renderer.h
│ │ │ ├── CCES2Renderer.m
│ │ │ ├── CCESRenderer.h
│ │ │ ├── CCFileUtilsIOS.h
│ │ │ ├── CCFileUtilsIOS.mm
│ │ │ ├── CCGL.h
│ │ │ ├── CCImage.mm
│ │ │ ├── CCLock.cpp
│ │ │ ├── CCLock.h
│ │ │ ├── CCPlatformDefine.h
│ │ │ ├── CCStdC.h
│ │ │ ├── CCThread.mm
│ │ │ ├── EAGLView.h
│ │ │ ├── EAGLView.mm
│ │ │ ├── OpenGL_Internal.h
│ │ │ └── Simulation
│ │ │ │ ├── AccelerometerSimulation.h
│ │ │ │ └── AccelerometerSimulation.m
│ │ ├── platform.cpp
│ │ ├── platform.h
│ │ └── third_party
│ │ │ └── ios
│ │ │ ├── curl
│ │ │ ├── curl.h
│ │ │ ├── curlbuild.h
│ │ │ ├── curlrules.h
│ │ │ ├── curlver.h
│ │ │ ├── easy.h
│ │ │ ├── mprintf.h
│ │ │ ├── multi.h
│ │ │ ├── stdcheaders.h
│ │ │ └── typecheck-gcc.h
│ │ │ ├── libraries
│ │ │ ├── libcurl.a
│ │ │ └── libwebp.a
│ │ │ └── webp
│ │ │ ├── decode.h
│ │ │ ├── encode.h
│ │ │ └── types.h
│ ├── script_support
│ │ ├── CCScriptSupport.cpp
│ │ └── CCScriptSupport.h
│ ├── shaders
│ │ ├── CCGLProgram.cpp
│ │ ├── CCGLProgram.h
│ │ ├── CCShaderCache.cpp
│ │ ├── CCShaderCache.h
│ │ ├── ccGLStateCache.cpp
│ │ ├── ccGLStateCache.h
│ │ ├── ccShaderEx_SwitchMask_frag.h
│ │ ├── ccShader_PositionColorLengthTexture_frag.h
│ │ ├── ccShader_PositionColorLengthTexture_vert.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.cpp
│ │ └── ccShaders.h
│ ├── sprite_nodes
│ │ ├── CCAnimation.cpp
│ │ ├── CCAnimation.h
│ │ ├── CCAnimationCache.cpp
│ │ ├── CCAnimationCache.h
│ │ ├── CCSprite.cpp
│ │ ├── CCSprite.h
│ │ ├── CCSpriteBatchNode.cpp
│ │ ├── CCSpriteBatchNode.h
│ │ ├── CCSpriteFrame.cpp
│ │ ├── CCSpriteFrame.h
│ │ ├── CCSpriteFrameCache.cpp
│ │ └── CCSpriteFrameCache.h
│ ├── support
│ │ ├── CCNotificationCenter.cpp
│ │ ├── CCNotificationCenter.h
│ │ ├── CCPointExtension.cpp
│ │ ├── CCPointExtension.h
│ │ ├── CCProfiling.cpp
│ │ ├── CCProfiling.h
│ │ ├── CCVertex.cpp
│ │ ├── CCVertex.h
│ │ ├── TransformUtils.cpp
│ │ ├── TransformUtils.h
│ │ ├── base64.cpp
│ │ ├── base64.h
│ │ ├── ccUTF8.cpp
│ │ ├── ccUTF8.h
│ │ ├── ccUtils.cpp
│ │ ├── ccUtils.h
│ │ ├── component
│ │ │ ├── CCComponent.cpp
│ │ │ ├── CCComponent.h
│ │ │ ├── CCComponentContainer.cpp
│ │ │ └── CCComponentContainer.h
│ │ ├── data_support
│ │ │ ├── ccCArray.cpp
│ │ │ ├── ccCArray.h
│ │ │ ├── uthash.h
│ │ │ └── utlist.h
│ │ ├── image_support
│ │ │ ├── TGAlib.cpp
│ │ │ └── TGAlib.h
│ │ ├── tinyxml2
│ │ │ ├── tinyxml2.cpp
│ │ │ └── tinyxml2.h
│ │ ├── user_default
│ │ │ ├── CCUserDefault.h
│ │ │ └── CCUserDefault.mm
│ │ └── zip_support
│ │ │ ├── ZipUtils.cpp
│ │ │ ├── ZipUtils.h
│ │ │ ├── ioapi.cpp
│ │ │ ├── ioapi.h
│ │ │ ├── unzip.cpp
│ │ │ └── unzip.h
│ ├── text_input_node
│ │ ├── CCIMEDelegate.h
│ │ ├── CCIMEDispatcher.cpp
│ │ ├── CCIMEDispatcher.h
│ │ ├── CCTextFieldTTF.cpp
│ │ └── CCTextFieldTTF.h
│ ├── textures
│ │ ├── CCTexture2D.cpp
│ │ ├── CCTexture2D.h
│ │ ├── CCTextureAtlas.cpp
│ │ ├── CCTextureAtlas.h
│ │ ├── CCTextureCache.cpp
│ │ ├── CCTextureCache.h
│ │ ├── CCTextureETC.cpp
│ │ ├── CCTextureETC.h
│ │ ├── CCTexturePVR.cpp
│ │ └── CCTexturePVR.h
│ ├── tilemap_parallax_nodes
│ │ ├── CCParallaxNode.cpp
│ │ ├── CCParallaxNode.h
│ │ ├── CCTMXLayer.cpp
│ │ ├── CCTMXLayer.h
│ │ ├── CCTMXObjectGroup.cpp
│ │ ├── CCTMXObjectGroup.h
│ │ ├── CCTMXTiledMap.cpp
│ │ ├── CCTMXTiledMap.h
│ │ ├── CCTMXXMLParser.cpp
│ │ ├── CCTMXXMLParser.h
│ │ ├── CCTileMapAtlas.cpp
│ │ └── CCTileMapAtlas.h
│ └── touch_dispatcher
│ │ ├── CCTouch.cpp
│ │ ├── CCTouch.h
│ │ ├── CCTouchDelegateProtocol.h
│ │ ├── CCTouchDispatcher.cpp
│ │ ├── CCTouchDispatcher.h
│ │ ├── CCTouchHandler.cpp
│ │ └── CCTouchHandler.h
│ ├── extensions
│ ├── AssetsManager
│ │ ├── AssetsManager.cpp
│ │ └── AssetsManager.h
│ ├── CCBReader
│ │ ├── CCBAnimationManager.cpp
│ │ ├── CCBAnimationManager.h
│ │ ├── CCBFileLoader.cpp
│ │ ├── CCBFileLoader.h
│ │ ├── CCBKeyframe.cpp
│ │ ├── CCBKeyframe.h
│ │ ├── CCBMemberVariableAssigner.h
│ │ ├── CCBReader.cpp
│ │ ├── CCBReader.h
│ │ ├── CCBSelectorResolver.h
│ │ ├── CCBSequence.cpp
│ │ ├── CCBSequence.h
│ │ ├── CCBSequenceProperty.cpp
│ │ ├── CCBSequenceProperty.h
│ │ ├── CCBValue.cpp
│ │ ├── CCBValue.h
│ │ ├── CCControlButtonLoader.cpp
│ │ ├── CCControlButtonLoader.h
│ │ ├── CCControlLoader.cpp
│ │ ├── CCControlLoader.h
│ │ ├── CCData.cpp
│ │ ├── CCData.h
│ │ ├── CCLabelBMFontLoader.cpp
│ │ ├── CCLabelBMFontLoader.h
│ │ ├── CCLabelTTFLoader.cpp
│ │ ├── CCLabelTTFLoader.h
│ │ ├── CCLayerColorLoader.cpp
│ │ ├── CCLayerColorLoader.h
│ │ ├── CCLayerGradientLoader.cpp
│ │ ├── CCLayerGradientLoader.h
│ │ ├── CCLayerLoader.cpp
│ │ ├── CCLayerLoader.h
│ │ ├── CCMenuItemImageLoader.cpp
│ │ ├── CCMenuItemImageLoader.h
│ │ ├── CCMenuItemLoader.cpp
│ │ ├── CCMenuItemLoader.h
│ │ ├── CCMenuLoader.h
│ │ ├── CCNode+CCBRelativePositioning.cpp
│ │ ├── CCNode+CCBRelativePositioning.h
│ │ ├── CCNodeLoader.cpp
│ │ ├── CCNodeLoader.h
│ │ ├── CCNodeLoaderLibrary.cpp
│ │ ├── CCNodeLoaderLibrary.h
│ │ ├── CCNodeLoaderListener.h
│ │ ├── CCParticleSystemQuadLoader.cpp
│ │ ├── CCParticleSystemQuadLoader.h
│ │ ├── CCScale9SpriteLoader.cpp
│ │ ├── CCScale9SpriteLoader.h
│ │ ├── CCScrollViewLoader.cpp
│ │ ├── CCScrollViewLoader.h
│ │ ├── CCSpriteLoader.cpp
│ │ └── CCSpriteLoader.h
│ ├── Components
│ │ ├── CCComAttribute.cpp
│ │ ├── CCComAttribute.h
│ │ ├── CCComAudio.cpp
│ │ ├── CCComAudio.h
│ │ ├── CCComController.cpp
│ │ ├── CCComController.h
│ │ ├── CCInputDelegate.cpp
│ │ └── CCInputDelegate.h
│ ├── ExtensionMacros.h
│ ├── GUI
│ │ ├── CCControlExtension
│ │ │ ├── CCControl.cpp
│ │ │ ├── CCControl.h
│ │ │ ├── CCControlButton.cpp
│ │ │ ├── CCControlButton.h
│ │ │ ├── CCControlColourPicker.cpp
│ │ │ ├── CCControlColourPicker.h
│ │ │ ├── CCControlExtensions.h
│ │ │ ├── CCControlHuePicker.cpp
│ │ │ ├── CCControlHuePicker.h
│ │ │ ├── CCControlPotentiometer.cpp
│ │ │ ├── CCControlPotentiometer.h
│ │ │ ├── CCControlSaturationBrightnessPicker.cpp
│ │ │ ├── CCControlSaturationBrightnessPicker.h
│ │ │ ├── CCControlSlider.cpp
│ │ │ ├── CCControlSlider.h
│ │ │ ├── CCControlStepper.cpp
│ │ │ ├── CCControlStepper.h
│ │ │ ├── CCControlSwitch.cpp
│ │ │ ├── CCControlSwitch.h
│ │ │ ├── CCControlUtils.cpp
│ │ │ ├── CCControlUtils.h
│ │ │ ├── CCInvocation.cpp
│ │ │ ├── CCInvocation.h
│ │ │ ├── CCScale9Sprite.cpp
│ │ │ └── CCScale9Sprite.h
│ │ ├── CCEditBox
│ │ │ ├── CCEditBox.cpp
│ │ │ ├── CCEditBox.h
│ │ │ ├── CCEditBoxImpl.h
│ │ │ ├── CCEditBoxImplIOS.h
│ │ │ ├── CCEditBoxImplIOS.mm
│ │ │ ├── CCEditBoxImplMac.h
│ │ │ ├── CCEditBoxImplMac.mm
│ │ │ ├── CCEditBoxImplNone.cpp
│ │ │ ├── CCEditBoxImplTizen.cpp
│ │ │ ├── CCEditBoxImplTizen.h
│ │ │ ├── CCEditBoxImplWin.cpp
│ │ │ └── CCEditBoxImplWin.h
│ │ └── CCScrollView
│ │ │ ├── CCScrollView.cpp
│ │ │ ├── CCScrollView.h
│ │ │ ├── CCSorting.cpp
│ │ │ ├── CCSorting.h
│ │ │ ├── CCTableView.cpp
│ │ │ ├── CCTableView.h
│ │ │ ├── CCTableViewCell.cpp
│ │ │ └── CCTableViewCell.h
│ ├── LocalStorage
│ │ ├── LocalStorage.cpp
│ │ ├── LocalStorage.h
│ │ └── LocalStorageAndroid.cpp
│ ├── cocos-ext.h
│ ├── network
│ │ ├── HttpClient.cpp
│ │ ├── HttpClient.h
│ │ ├── HttpRequest.h
│ │ ├── HttpResponse.h
│ │ ├── WebSocket.cpp
│ │ └── WebSocket.h
│ ├── physics_nodes
│ │ ├── CCPhysicsDebugNode.cpp
│ │ ├── CCPhysicsDebugNode.h
│ │ ├── CCPhysicsSprite.cpp
│ │ └── CCPhysicsSprite.h
│ └── spine
│ │ ├── Animation.cpp
│ │ ├── Animation.h
│ │ ├── AnimationState.cpp
│ │ ├── AnimationState.h
│ │ ├── AnimationStateData.cpp
│ │ ├── AnimationStateData.h
│ │ ├── Atlas.cpp
│ │ ├── Atlas.h
│ │ ├── AtlasAttachmentLoader.cpp
│ │ ├── AtlasAttachmentLoader.h
│ │ ├── Attachment.cpp
│ │ ├── Attachment.h
│ │ ├── AttachmentLoader.cpp
│ │ ├── AttachmentLoader.h
│ │ ├── Bone.cpp
│ │ ├── Bone.h
│ │ ├── BoneData.cpp
│ │ ├── BoneData.h
│ │ ├── CCSkeleton.cpp
│ │ ├── CCSkeleton.h
│ │ ├── CCSkeletonAnimation.cpp
│ │ ├── CCSkeletonAnimation.h
│ │ ├── Json.cpp
│ │ ├── Json.h
│ │ ├── RegionAttachment.cpp
│ │ ├── RegionAttachment.h
│ │ ├── Skeleton.cpp
│ │ ├── Skeleton.h
│ │ ├── SkeletonData.cpp
│ │ ├── SkeletonData.h
│ │ ├── SkeletonJson.cpp
│ │ ├── SkeletonJson.h
│ │ ├── Skin.cpp
│ │ ├── Skin.h
│ │ ├── Slot.cpp
│ │ ├── Slot.h
│ │ ├── SlotData.cpp
│ │ ├── SlotData.h
│ │ ├── extension.cpp
│ │ ├── extension.h
│ │ ├── spine-cocos2dx.cpp
│ │ ├── spine-cocos2dx.h
│ │ └── spine.h
│ └── libwebsockets
│ └── ios
│ ├── include
│ └── libwebsockets.h
│ └── lib
│ └── libwebsockets.a
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 |
6 | # Compiled Dynamic libraries
7 | *.so
8 | *.dylib
9 |
10 | # Compiled Static libraries
11 | *.lai
12 | *.la
13 |
14 | # Mac igonre file
15 | *.DS_Store
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/project.xcworkspace/xcshareddata/Cocos2dxExt.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | CE6B3229-C22D-4084-8339-AB21C60524AD
9 | IDESourceControlProjectName
10 | Cocos2dxExt
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 586DD322-5D1F-40A9-99D4-43D16E1685FC
14 | https://github.com/sunny-liu/cocos2dx-extensions.git
15 |
16 | IDESourceControlProjectPath
17 | Cocos2dxExt/Cocos2dxExt.xcodeproj/project.xcworkspace
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 586DD322-5D1F-40A9-99D4-43D16E1685FC
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/sunny-liu/cocos2dx-extensions.git
25 | IDESourceControlProjectVersion
26 | 110
27 | IDESourceControlProjectWCCIdentifier
28 | 586DD322-5D1F-40A9-99D4-43D16E1685FC
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 586DD322-5D1F-40A9-99D4-43D16E1685FC
36 | IDESourceControlWCCName
37 | cocos2dx-extensions
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/project.xcworkspace/xcuserdata/liuyanghui.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt.xcodeproj/project.xcworkspace/xcuserdata/liuyanghui.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/xcuserdata/liuyanghui.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/xcuserdata/liuyanghui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt.xcodeproj/xcuserdata/liuyanghui.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Cocos2dxExt.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | E00FDA13178573E300D021D6
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/AppDelegate.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Cocos2dxExtAppDelegate.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #include "AppDelegate.h"
10 |
11 | #include "cocos2d.h"
12 | #include "SimpleAudioEngine.h"
13 | #include "EXMainMenuScene.h"
14 |
15 | USING_NS_CC;
16 | using namespace CocosDenshion;
17 |
18 | AppDelegate::AppDelegate()
19 | {
20 |
21 | }
22 |
23 | AppDelegate::~AppDelegate()
24 | {
25 | }
26 |
27 | bool AppDelegate::applicationDidFinishLaunching()
28 | {
29 | // initialize director
30 | CCDirector *pDirector = CCDirector::sharedDirector();
31 | pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
32 |
33 | // turn on display FPS
34 | pDirector->setDisplayStats(true);
35 |
36 | // set FPS. the default value is 1.0/60 if you don't call this
37 | pDirector->setAnimationInterval(1.0 / 60);
38 |
39 | // create a scene. it's an autorelease object
40 | CCScene *pScene = EXMainMenuScene::scene();
41 |
42 | // run
43 | pDirector->runWithScene(pScene);
44 |
45 | return true;
46 | }
47 |
48 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too
49 | void AppDelegate::applicationDidEnterBackground()
50 | {
51 | CCDirector::sharedDirector()->stopAnimation();
52 | SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
53 | SimpleAudioEngine::sharedEngine()->pauseAllEffects();
54 | }
55 |
56 | // this function will be called when the app is active again
57 | void AppDelegate::applicationWillEnterForeground()
58 | {
59 | CCDirector::sharedDirector()->startAnimation();
60 | SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
61 | SimpleAudioEngine::sharedEngine()->resumeAllEffects();
62 | }
63 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // Cocos2dxExtAppDelegate.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #ifndef _APP_DELEGATE_H_
10 | #define _APP_DELEGATE_H_
11 |
12 | #include "CCApplication.h"
13 |
14 | /**
15 | @brief The cocos2d Application.
16 |
17 | The reason to implement with private inheritance is to hide some interface details of CCDirector.
18 | */
19 | class AppDelegate : private cocos2d::CCApplication
20 | {
21 | public:
22 | AppDelegate();
23 | virtual ~AppDelegate();
24 |
25 | /**
26 | @brief Implement CCDirector and CCScene init code here.
27 | @return true Initialize success, app continue.
28 | @return false Initialize failed, app terminate.
29 | */
30 | virtual bool applicationDidFinishLaunching();
31 |
32 | /**
33 | @brief The function is called when the application enters the background
34 | @param the pointer of the application instance
35 | */
36 | virtual void applicationDidEnterBackground();
37 |
38 | /**
39 | @brief The function is called when the application enters the foreground
40 | @param the pointer of the application instance
41 | */
42 | virtual void applicationWillEnterForeground();
43 | };
44 |
45 | #endif // _APP_DELEGATE_H_
46 |
47 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/EXMainMenuScene.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXMainMenuScene.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXMainMenuScene__
10 | #define __Cocos2dxExt__EXMainMenuScene__
11 |
12 | #include "cocos2d.h"
13 | #include "cocos-ext.h"
14 | USING_NS_CC_EXT;
15 | USING_NS_CC;
16 |
17 | class EXMainMenuScene : public CCLayer, public CCTableViewDataSource, public CCTableViewDelegate
18 | {
19 | public:
20 | EXMainMenuScene();
21 | ~EXMainMenuScene();
22 | virtual bool init();
23 | static CCScene* scene();
24 | CREATE_FUNC(EXMainMenuScene);
25 |
26 | virtual void scrollViewDidScroll(cocos2d::extension::CCScrollView* view) {};
27 | virtual void scrollViewDidZoom(cocos2d::extension::CCScrollView* view) {}
28 | virtual void tableCellTouched(cocos2d::extension::CCTableView* table, cocos2d::extension::CCTableViewCell* cell);
29 | virtual cocos2d::CCSize tableCellSizeForIndex(cocos2d::extension::CCTableView *table, unsigned int idx);
30 | virtual cocos2d::extension::CCTableViewCell* tableCellAtIndex(cocos2d::extension::CCTableView *table, unsigned int idx);
31 | virtual unsigned int numberOfCellsInTableView(cocos2d::extension::CCTableView *table);
32 |
33 | private:
34 | CCSize m_winSize;
35 | CCArray* m_listData;
36 | CCTableView* m_tableView;
37 |
38 | void initData();
39 | };
40 |
41 | #endif /* defined(__Cocos2dxExt__EXMainMenuScene__) */
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/EXTestScene.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestScene.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestScene__
10 | #define __Cocos2dxExt__EXTestScene__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestScene : public CCLayer
16 | {
17 | public:
18 | EXTestScene();
19 | ~EXTestScene();
20 | static EXTestScene* create(int testId, const char* titleStr);
21 | virtual bool init(int testId, const char* titleStr);
22 | static CCScene* scene(int testId, const char* titleStr);
23 | void menuCloseCallback(CCObject* pSender);
24 |
25 | private:
26 | void initData(int testId, const char* titleStr);
27 | };
28 |
29 | #endif /* defined(__Cocos2dxExt__EXTestScene__) */
30 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/HelloWorldScene.cpp:
--------------------------------------------------------------------------------
1 | #include "HelloWorldScene.h"
2 |
3 | HelloWorld::HelloWorld()
4 | {
5 |
6 | }
7 |
8 | HelloWorld::~HelloWorld()
9 | {
10 |
11 | }
12 |
13 | CCScene* HelloWorld::scene()
14 | {
15 | CCScene *scene = CCScene::create();
16 | HelloWorld *layer = HelloWorld::create();
17 | scene->addChild(layer);
18 | return scene;
19 | }
20 |
21 | bool HelloWorld::init()
22 | {
23 | if ( !CCLayer::init() )
24 | {
25 | return false;
26 | }
27 | initData();
28 | return true;
29 | }
30 |
31 | void HelloWorld::initData()
32 | {
33 |
34 | CCSize size = CCDirector::sharedDirector()->getWinSize();
35 |
36 | CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
37 | "CloseNormal.png",
38 | "CloseSelected.png",
39 | this,
40 | menu_selector(HelloWorld::menuCloseCallback) );
41 | pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) );
42 | CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
43 | pMenu->setPosition( CCPointZero );
44 | this->addChild(pMenu, 1);
45 |
46 | CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Thonburi", 34);
47 | pLabel->setPosition( ccp(size.width / 2, size.height - 20) );
48 | this->addChild(pLabel, 1);
49 | }
50 |
51 | void HelloWorld::menuCloseCallback(CCObject* pSender)
52 | {
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/HelloWorldScene.h:
--------------------------------------------------------------------------------
1 | #ifndef __HELLOWORLD_SCENE_H__
2 | #define __HELLOWORLD_SCENE_H__
3 |
4 | #include "cocos2d.h"
5 | USING_NS_CC;
6 |
7 | class HelloWorld : public CCLayer
8 | {
9 | public:
10 | HelloWorld();
11 | ~HelloWorld();
12 | virtual bool init();
13 | static CCScene* scene();
14 | void menuCloseCallback(CCObject* pSender);
15 | CREATE_FUNC(HelloWorld);
16 |
17 | private:
18 | void initData();
19 | };
20 |
21 | #endif // __HELLOWORLD_SCENE_H__
22 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestDynamicLabel/EXDynamicLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXDynamicLabel.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-5.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXDynamicLabel__
10 | #define __Cocos2dxExt__EXDynamicLabel__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXDynamicLabel : public CCLabelTTF {
16 | public:
17 | EXDynamicLabel();
18 | ~EXDynamicLabel();
19 |
20 | static EXDynamicLabel* create(const char *string, const char *fontName, float fontSize);
21 | static EXDynamicLabel* create(const char *string, const char *fontName, float fontSize,
22 | const CCSize& dimensions, CCTextAlignment hAlignment);
23 | static EXDynamicLabel* create(const char *string, const char *fontName, float fontSize,
24 | const CCSize& dimensions, CCTextAlignment hAlignment,
25 | CCVerticalTextAlignment vAlignment);
26 | static EXDynamicLabel* createWithFontDefinition(const char *string, ccFontDefinition &textDefinition);
27 |
28 | private:
29 | int m_curValue;
30 | bool m_isInUpdate;
31 | void initData();
32 | void updateDynamicValue(float dt);
33 |
34 | public:
35 | void setDynamicValue(int value);
36 | inline int getDynamicValue(){return m_curValue;}
37 | };
38 |
39 | #endif /* defined(__Cocos2dxExt__EXDynamicLabel__) */
40 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestDynamicLabel/EXTestDynamicLabelLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestDynamicLabelLayer.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #include "EXTestDynamicLabelLayer.h"
10 | #include "EXDynamicLabel.h"
11 |
12 | EXTestDynamicLabelLayer::EXTestDynamicLabelLayer()
13 | {
14 |
15 | }
16 |
17 | EXTestDynamicLabelLayer::~EXTestDynamicLabelLayer()
18 | {
19 |
20 | }
21 |
22 | bool EXTestDynamicLabelLayer::init()
23 | {
24 | if ( !CCLayer::init() )
25 | {
26 | return false;
27 | }
28 | initData();
29 | return true;
30 | }
31 |
32 | void EXTestDynamicLabelLayer::initData()
33 | {
34 | CCSize size = CCDirector::sharedDirector()->getWinSize();
35 |
36 | EXDynamicLabel* label = EXDynamicLabel::create("", "Arial", 30);
37 | label->setPosition(ccp(size.width * .5, size.height * .5));
38 | addChild(label);
39 | label->setDynamicValue(9000);
40 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestDynamicLabel/EXTestDynamicLabelLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestDynamicLabelLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestDynamicLabelLayer__
10 | #define __Cocos2dxExt__EXTestDynamicLabelLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestDynamicLabelLayer : public CCLayer
16 | {
17 | public:
18 | EXTestDynamicLabelLayer();
19 | ~EXTestDynamicLabelLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestDynamicLabelLayer);
22 |
23 | private:
24 | void initData();
25 | };
26 |
27 | #endif /* defined(__Cocos2dxExt__EXTestDynamicLabelLayer__) */
28 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestGraySprite/EXGraySprite.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXGraySprite.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXGraySprite__
10 | #define __Cocos2dxExt__EXGraySprite__
11 |
12 | #include "sprite_nodes/CCSprite.h"
13 | #include "textures/CCTexture2D.h"
14 | #include "cocoa/CCGeometry.h"
15 | #include "cocos2d.h"
16 | USING_NS_CC;
17 |
18 | class EXGraySprite : public CCSprite
19 | {
20 | public:
21 | EXGraySprite();
22 | virtual ~EXGraySprite();
23 | static EXGraySprite* create(const char* pszFileName);
24 | static EXGraySprite* createWithSpriteFrameName(const char *pszSpriteFrameName);
25 | static EXGraySprite* createWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
26 |
27 | bool initWithTexture(cocos2d::CCTexture2D* pTexture, const cocos2d::CCRect& tRect);
28 | virtual void draw();
29 | };
30 |
31 |
32 | #endif /* defined(__Cocos2dxExt__EXGraySprite__) */
33 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestGraySprite/EXGrayUtility.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXGrayUtility.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-9-24.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXGrayUtility__
10 | #define __Cocos2dxExt__EXGrayUtility__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 | class EXGrayUtility {
15 | public:
16 | static void enableGray(CCSprite* sp);
17 | static void disableGray(CCSprite* sp);
18 |
19 |
20 | };
21 |
22 | #endif /* defined(__Cocos2dxExt__EXGrayUtility__) */
23 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestGraySprite/EXTestGraySpriteLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestGraySpriteLayer.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #include "EXTestGraySpriteLayer.h"
10 | #include "EXGraySprite.h"
11 | #include "EXGrayUtility.h"
12 |
13 | EXTestGraySpriteLayer::EXTestGraySpriteLayer()
14 | {
15 |
16 | }
17 |
18 | EXTestGraySpriteLayer::~EXTestGraySpriteLayer()
19 | {
20 |
21 | }
22 |
23 | bool EXTestGraySpriteLayer::init()
24 | {
25 | if ( !CCLayer::init() )
26 | {
27 | return false;
28 | }
29 | initData();
30 | return true;
31 | }
32 |
33 | void EXTestGraySpriteLayer::initData()
34 | {
35 | CCSize size = CCDirector::sharedDirector()->getWinSize();
36 |
37 | CCLayerColor* bgLayer = CCLayerColor::create(ccc4(255, 255, 255, 255));
38 | addChild(bgLayer);
39 |
40 | CCSprite* normalSprite = CCSprite::create("Icon.png");
41 | normalSprite->setPosition(ccp(size.width * .35, size.height * .5));
42 | addChild(normalSprite);
43 |
44 | m_isGray = true;
45 | m_graySprite1 = CCSprite::create("Icon.png");
46 | m_graySprite1->setPosition(ccp(size.width * .5, size.height * .5));
47 | addChild(m_graySprite1);
48 | EXGrayUtility::enableGray(m_graySprite1);
49 |
50 | EXGraySprite* graySprite2 = EXGraySprite::create("Icon.png");
51 | graySprite2->setPosition(ccp(size.width * .65, size.height * .5));
52 | addChild(graySprite2);
53 |
54 | CCLabelTTF* label = CCLabelTTF::create("Click Change Gray", "Arial", 30);
55 | label->setColor(ccc3(255, 0, 0));
56 | CCMenuItemLabel* item = CCMenuItemLabel::create(label, this, menu_selector(EXTestGraySpriteLayer::menuCallback));
57 | item->setPosition(ccp(0, size.height * -.2));
58 | CCMenu* menu = CCMenu::createWithItem(item);
59 | addChild(menu);
60 | }
61 |
62 | void EXTestGraySpriteLayer::menuCallback(CCObject* sender)
63 | {
64 | m_isGray = !m_isGray;
65 | if (m_isGray) {
66 | EXGrayUtility::enableGray(m_graySprite1);
67 | }else{
68 | EXGrayUtility::disableGray(m_graySprite1);
69 | }
70 |
71 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestGraySprite/EXTestGraySpriteLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestGraySpriteLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestGraySpriteLayer__
10 | #define __Cocos2dxExt__EXTestGraySpriteLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestGraySpriteLayer : public CCLayer
16 | {
17 | public:
18 | EXTestGraySpriteLayer();
19 | ~EXTestGraySpriteLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestGraySpriteLayer);
22 |
23 | private:
24 | bool m_isGray;
25 | CCSprite* m_graySprite1;
26 | void initData();
27 | void menuCallback(CCObject* sender);
28 | };
29 |
30 | #endif /* defined(__Cocos2dxExt__EXTestGraySpriteLayer__) */
31 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestMemDataHolder/EXMemValue.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXMemValue.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-8-8.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXMemValue__
10 | #define __Cocos2dxExt__EXMemValue__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | template
16 | class EXMemValue
17 | {
18 | public:
19 | EXMemValue()
20 | : m_value(0)
21 | {
22 | }
23 | ~EXMemValue()
24 | {
25 | }
26 |
27 | T getValue()
28 | {
29 | return m_value ^ m_memKey;
30 | }
31 |
32 | void setValue(T value)
33 | {
34 | m_value = value;
35 | m_memKey = arc4random();
36 | m_value ^= m_memKey;
37 | }
38 |
39 | void offset(T value)
40 | {
41 | setValue(getValue() + value);
42 | }
43 |
44 | public:
45 | T m_value;
46 | int m_memKey;
47 | };
48 |
49 | typedef EXMemValue DynamicValueInt;
50 | typedef EXMemValue DynamicValueFloat;
51 | typedef EXMemValue DynamicValueBool;
52 |
53 | #endif /* defined(__Cocos2dxExt__EXMemValue__) */
54 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestTriangleSprite/EXTestTriangleSpriteLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestTriangleSpriteLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-19.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestTriangleSpriteLayer__
10 | #define __Cocos2dxExt__EXTestTriangleSpriteLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestTriangleSpriteLayer : public CCLayer
16 | {
17 | public:
18 | EXTestTriangleSpriteLayer();
19 | ~EXTestTriangleSpriteLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestTriangleSpriteLayer);
22 |
23 | private:
24 | void initData();
25 | CCDrawNode* shape();
26 | };
27 |
28 | #endif /* defined(__Cocos2dxExt__EXTestTriangleSpriteLayer__) */
29 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestTurnCard/EXTestTurnCardLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestTurnCardLayer.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #include "EXTestTurnCardLayer.h"
10 | #include "EXTurnCard.h"
11 |
12 | EXTestTurnCardLayer::EXTestTurnCardLayer()
13 | {
14 |
15 | }
16 |
17 | EXTestTurnCardLayer::~EXTestTurnCardLayer()
18 | {
19 |
20 | }
21 |
22 | bool EXTestTurnCardLayer::init()
23 | {
24 | if ( !CCLayer::init() )
25 | {
26 | return false;
27 | }
28 | initData();
29 | return true;
30 | }
31 |
32 | void EXTestTurnCardLayer::initData()
33 | {
34 | CCSize size = CCDirector::sharedDirector()->getWinSize();
35 |
36 | EXTurnCard* turnCard = EXTurnCard::create("2.jpg", "1.jpg", 1);
37 | turnCard->setPosition(ccp(size.width * .5, size.height * .5));
38 | addChild(turnCard);
39 | turnCard->openCard();
40 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestTurnCard/EXTestTurnCardLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestTurnCardLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestTurnCardLayer__
10 | #define __Cocos2dxExt__EXTestTurnCardLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestTurnCardLayer : public CCLayer
16 | {
17 | public:
18 | EXTestTurnCardLayer();
19 | ~EXTestTurnCardLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestTurnCardLayer);
22 |
23 | private:
24 | void initData();
25 | };
26 |
27 | #endif /* defined(__Cocos2dxExt__EXTestTurnCardLayer__) */
28 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestTurnCard/EXTurnCard.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTurnCard.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTurnCard__
10 | #define __Cocos2dxExt__EXTurnCard__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTurnCard : public CCSprite
16 | {
17 | public:
18 | EXTurnCard();
19 | ~EXTurnCard();
20 | static EXTurnCard* create(const char* inCardImageName, const char* outCardImageName, float duration);
21 | virtual bool init(const char* inCardImageName, const char* outCardImageName, float duration);
22 |
23 | private:
24 | bool m_isOpened;
25 | CCActionInterval* m_openAnimIn;
26 | CCActionInterval* m_openAnimOut;
27 |
28 |
29 | void initData(const char* inCardImageName, const char* outCardImageName, float duration);
30 |
31 | public:
32 | void openCard();
33 | };
34 |
35 | #endif /* defined(__Cocos2dxExt__EXTurnCard__) */
36 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestWebView/EXTestWebViewLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestWebViewLayer.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-8-1.
6 | //
7 | //
8 |
9 | #include "EXTestWebViewLayer.h"
10 | #include "EXWebViewLayer.h"
11 |
12 | EXTestWebViewLayer::EXTestWebViewLayer()
13 | {
14 |
15 | }
16 |
17 | EXTestWebViewLayer::~EXTestWebViewLayer()
18 | {
19 |
20 | }
21 |
22 | bool EXTestWebViewLayer::init()
23 | {
24 | if ( !CCLayer::init() )
25 | {
26 | return false;
27 | }
28 | initData();
29 | return true;
30 | }
31 |
32 | void EXTestWebViewLayer::initData()
33 | {
34 | EXWebViewLayer* web = EXWebViewLayer::create("http://www.cocos2dev.com");
35 | web->setPosition(CCPointZero);
36 | addChild(web);
37 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestWebView/EXTestWebViewLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestWebViewLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-8-1.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestWebViewLayer__
10 | #define __Cocos2dxExt__EXTestWebViewLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestWebViewLayer : public CCLayer
16 | {
17 | public:
18 | EXTestWebViewLayer();
19 | ~EXTestWebViewLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestWebViewLayer);
22 |
23 | private:
24 | void initData();
25 | };
26 |
27 |
28 |
29 | #endif /* defined(__Cocos2dxExt__EXTestWebViewLayer__) */
30 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestWebView/EXUIWebViewBridge.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXUIWebViewBridge.h
3 | // COG
4 | //
5 | // Created by Liu Yanghui on 12-12-28.
6 | // Copyright (c) 2012年 BoyoJoy. All rights reserved.
7 | //
8 |
9 |
10 | #import
11 | #import
12 | #import
13 | #import "EXWebViewLayer.h"
14 |
15 | @interface EXUIWebViewBridge : NSObject{
16 | EXWebViewLayer * mLayerWebView;
17 | UIView *mView;
18 | UIWebView *mWebView;
19 | UIToolbar *mToolbar;
20 | UIBarButtonItem *mBackButton;
21 | }
22 |
23 | -(void) setLayerWebView : (EXWebViewLayer*) iLayerWebView URLString:(const char*) urlString;
24 | -(void) backClicked:(id)sender;
25 |
26 | @end
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestWebView/EXWebViewLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXWebViewLayer.h
3 | // COG
4 | //
5 | // Created by Liu Yanghui on 12-12-28.
6 | // Copyright (c) 2012年 BoyoJoy. All rights reserved.
7 | //
8 |
9 | #ifndef COG_EXWebViewLayer_h
10 | #define COG_EXWebViewLayer_h
11 |
12 | #include "CCCommon.h"
13 | #include "cocos2d.h"
14 | USING_NS_CC;
15 |
16 | class EXWebViewLayer : public CCLayer{
17 | public:
18 | EXWebViewLayer();
19 | ~EXWebViewLayer();
20 | virtual bool init(std::string url);
21 | static EXWebViewLayer* create(std::string url);
22 |
23 | void webViewDidFinishLoad();
24 |
25 | void onBackbuttonClick();
26 |
27 | private:
28 | int mWebViewLoadCounter;
29 | };
30 | #endif
31 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/TestWebView/EXWebViewLayer.mm:
--------------------------------------------------------------------------------
1 | //
2 | // EXWebViewLayer.mm
3 | // COG
4 | //
5 | // Created by Liu Yanghui on 12-12-28.
6 | // Copyright (c) 2012年 BoyoJoy. All rights reserved.
7 | //
8 |
9 | #include "EXWebViewLayer.h"
10 | #include "EXUIWebViewBridge.h"
11 |
12 | static EXUIWebViewBridge *g_EXUIWebViewBridge=nil;
13 |
14 | EXWebViewLayer::EXWebViewLayer(){
15 |
16 | }
17 |
18 | EXWebViewLayer::~EXWebViewLayer(){
19 | [g_EXUIWebViewBridge release];
20 | }
21 |
22 | void EXWebViewLayer::webViewDidFinishLoad(){
23 |
24 | }
25 |
26 | void EXWebViewLayer::onBackbuttonClick(){
27 | this->removeFromParentAndCleanup(true);
28 | }
29 |
30 | bool EXWebViewLayer::init(std::string url){
31 | if ( !CCLayer::init() ){
32 | return false;
33 | }
34 | g_EXUIWebViewBridge = [[EXUIWebViewBridge alloc] init];
35 | [g_EXUIWebViewBridge setLayerWebView : this URLString:url.c_str()];
36 | return true;
37 | }
38 |
39 | EXWebViewLayer *EXWebViewLayer::create(std::string url){
40 | EXWebViewLayer *pRet = new EXWebViewLayer();
41 | if (pRet && pRet->init(url)){
42 | pRet->autorelease();
43 | return pRet;
44 | }else{
45 | CC_SAFE_DELETE(pRet);
46 | return NULL;
47 | }
48 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/ZoomController/EXTestZoomControllerLayer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestZoomControllerLayer.cpp
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #include "EXTestZoomControllerLayer.h"
10 | #include "EXZoomController.h"
11 |
12 | EXTestZoomControllerLayer::EXTestZoomControllerLayer()
13 | {
14 |
15 | }
16 |
17 | EXTestZoomControllerLayer::~EXTestZoomControllerLayer()
18 | {
19 |
20 | }
21 |
22 | bool EXTestZoomControllerLayer::init()
23 | {
24 | if ( !CCLayer::init() )
25 | {
26 | return false;
27 | }
28 | initData();
29 | return true;
30 | }
31 |
32 | void EXTestZoomControllerLayer::initData()
33 | {
34 | CCSprite* normalSprite = CCSprite::create("coc.jpg");
35 | normalSprite->setAnchorPoint(CCPointZero);
36 | normalSprite->setPosition(CCPointZero);
37 | addChild(normalSprite);
38 |
39 | EXZoomController* controller = EXZoomController::controllerWithNode(this);
40 | controller->setWindowRect(CCRectMake(0, 0, 1024, 768));
41 | CCRect r = normalSprite->getTextureRect();
42 | controller->setBoundingRect(r);
43 | controller->zoomOutLimit = controller->getOptimalZoomOutLimit();
44 | controller->zoomInLimit = 2.0f;
45 | addChild(controller);
46 | controller->enableWithTouchPriority(0,true);
47 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Classes/ZoomController/EXTestZoomControllerLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // EXTestZoomControllerLayer.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-10.
6 | //
7 | //
8 |
9 | #ifndef __Cocos2dxExt__EXTestZoomControllerLayer__
10 | #define __Cocos2dxExt__EXTestZoomControllerLayer__
11 |
12 | #include "cocos2d.h"
13 | USING_NS_CC;
14 |
15 | class EXTestZoomControllerLayer : public CCLayer
16 | {
17 | public:
18 | EXTestZoomControllerLayer();
19 | ~EXTestZoomControllerLayer();
20 | virtual bool init();
21 | CREATE_FUNC(EXTestZoomControllerLayer);
22 |
23 | private:
24 | void initData();
25 | };
26 |
27 |
28 |
29 | #endif /* defined(__Cocos2dxExt__EXTestZoomControllerLayer__) */
30 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'Cocos2dxExt' target in the 'Cocos2dxExt' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #import
8 | #endif
9 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/1.jpg
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/2.jpg
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/CloseNormal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/CloseNormal.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/CloseSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/CloseSelected.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Default.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/HelloWorld.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/HelloWorld.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon-72.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small-50.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/Icon@2x.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/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-1
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/bg_theme1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/bg_theme1.png
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/coc.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/coc.jpg
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/Resources/iTunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/Resources/iTunesArtwork
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/ios/AppController.h:
--------------------------------------------------------------------------------
1 | //
2 | // Cocos2dxExtAppController.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | @class RootViewController;
10 |
11 | @interface AppController : NSObject {
12 | UIWindow *window;
13 | RootViewController *viewController;
14 | }
15 |
16 | @property (nonatomic, retain) UIWindow *window;
17 | @property (nonatomic, retain) RootViewController *viewController;
18 |
19 | @end
20 |
21 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/ios/RootViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // Cocos2dxExtAppController.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface RootViewController : UIViewController {
13 |
14 | }
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/ios/RootViewController.mm:
--------------------------------------------------------------------------------
1 | //
2 | // Cocos2dxExtAppController.h
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
6 | // Copyright __MyCompanyName__ 2013年. All rights reserved.
7 | //
8 |
9 | #import "RootViewController.h"
10 |
11 |
12 | @implementation RootViewController
13 |
14 | /*
15 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
16 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
17 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
18 | // Custom initialization
19 | }
20 | return self;
21 | }
22 | */
23 |
24 | /*
25 | // Implement loadView to create a view hierarchy programmatically, without using a nib.
26 | - (void)loadView {
27 | }
28 | */
29 |
30 | /*
31 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
32 | - (void)viewDidLoad {
33 | [super viewDidLoad];
34 | }
35 |
36 | */
37 | // Override to allow orientations other than the default portrait orientation.
38 | // This method is deprecated on ios6
39 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
40 | return UIInterfaceOrientationIsLandscape( interfaceOrientation );
41 | }
42 |
43 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
44 | - (NSUInteger) supportedInterfaceOrientations{
45 | #ifdef __IPHONE_6_0
46 | return UIInterfaceOrientationMaskLandscape;
47 | #endif
48 | }
49 |
50 | - (BOOL) shouldAutorotate {
51 | return YES;
52 | }
53 |
54 | - (void)didReceiveMemoryWarning {
55 | // Releases the view if it doesn't have a superview.
56 | [super didReceiveMemoryWarning];
57 |
58 | // Release any cached data, images, etc that aren't in use.
59 | }
60 |
61 | - (void)viewDidUnload {
62 | [super viewDidUnload];
63 | // Release any retained subviews of the main view.
64 | // e.g. self.myOutlet = nil;
65 | }
66 |
67 |
68 | - (void)dealloc {
69 | [super dealloc];
70 | }
71 |
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/ios/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Cocos2dxExt
4 | //
5 | // Created by LiuYanghui on 13-7-4.
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 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/CocosDenshion/include/Export.h:
--------------------------------------------------------------------------------
1 | #ifndef __EXPORT_COMMON__
2 | #define __EXPORT_COMMON__
3 |
4 | #if defined(SHP)
5 | #include
6 | #define EXPORT_DLL _EXPORT_
7 | #elif defined(_WIN32)
8 | #if defined(_EXPORT_DLL_)
9 | #define EXPORT_DLL __declspec(dllexport)
10 | #elif defined(IGNORE_EXPORT)
11 | #define EXPORT_DLL
12 | #else /* use a DLL library */
13 | #define EXPORT_DLL __declspec(dllimport)
14 | #endif
15 | #else
16 | #if defined(_SHARED_)
17 | #define EXPORT_DLL __attribute__((visibility("default")))
18 | #elif defined(IGNORE_EXPORT)
19 | #define EXPORT_DLL
20 | #else
21 | #define EXPORT_DLL
22 | #endif
23 | #endif
24 |
25 | #endif // end of __EXPORT_COMMON__
26 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2007 Scott Lembcke and Howling Moon Software
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/include/chipmunk/constraints/cpGearJoint.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | /// @defgroup cpGearJoint cpGearJoint
23 | /// @{
24 |
25 | const cpConstraintClass *cpGearJointGetClass(void);
26 |
27 | /// @private
28 | typedef struct cpGearJoint {
29 | cpConstraint constraint;
30 | cpFloat phase, ratio;
31 | cpFloat ratio_inv;
32 |
33 | cpFloat iSum;
34 |
35 | cpFloat bias;
36 | cpFloat jAcc;
37 | } cpGearJoint;
38 |
39 | /// Allocate a gear joint.
40 | cpGearJoint* cpGearJointAlloc(void);
41 | /// Initialize a gear joint.
42 | cpGearJoint* cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);
43 | /// Allocate and initialize a gear joint.
44 | cpConstraint* cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);
45 |
46 | CP_DefineConstraintProperty(cpGearJoint, cpFloat, phase, Phase)
47 | CP_DefineConstraintGetter(cpGearJoint, cpFloat, ratio, Ratio)
48 | /// Set the ratio of a gear joint.
49 | void cpGearJointSetRatio(cpConstraint *constraint, cpFloat value);
50 |
51 | /// @}
52 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/include/chipmunk/constraints/cpPinJoint.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | /// @defgroup cpPinJoint cpPinJoint
23 | /// @{
24 |
25 | const cpConstraintClass *cpPinJointGetClass(void);
26 |
27 | /// @private
28 | typedef struct cpPinJoint {
29 | cpConstraint constraint;
30 | cpVect anchr1, anchr2;
31 | cpFloat dist;
32 |
33 | cpVect r1, r2;
34 | cpVect n;
35 | cpFloat nMass;
36 |
37 | cpFloat jnAcc;
38 | cpFloat bias;
39 | } cpPinJoint;
40 |
41 | /// Allocate a pin joint.
42 | cpPinJoint* cpPinJointAlloc(void);
43 | /// Initialize a pin joint.
44 | cpPinJoint* cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);
45 | /// Allocate and initialize a pin joint.
46 | cpConstraint* cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);
47 |
48 | CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr1, Anchr1)
49 | CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr2, Anchr2)
50 | CP_DefineConstraintProperty(cpPinJoint, cpFloat, dist, Dist)
51 |
52 | ///@}
53 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/include/chipmunk/constraints/cpRotaryLimitJoint.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | /// @defgroup cpRotaryLimitJoint cpRotaryLimitJoint
23 | /// @{
24 |
25 | const cpConstraintClass *cpRotaryLimitJointGetClass(void);
26 |
27 | /// @private
28 | typedef struct cpRotaryLimitJoint {
29 | cpConstraint constraint;
30 | cpFloat min, max;
31 |
32 | cpFloat iSum;
33 |
34 | cpFloat bias;
35 | cpFloat jAcc;
36 | } cpRotaryLimitJoint;
37 |
38 | /// Allocate a damped rotary limit joint.
39 | cpRotaryLimitJoint* cpRotaryLimitJointAlloc(void);
40 | /// Initialize a damped rotary limit joint.
41 | cpRotaryLimitJoint* cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max);
42 | /// Allocate and initialize a damped rotary limit joint.
43 | cpConstraint* cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max);
44 |
45 | CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, min, Min)
46 | CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, max, Max)
47 |
48 | /// @}
49 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/include/chipmunk/constraints/cpSimpleMotor.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | /// @defgroup cpSimpleMotor cpSimpleMotor
23 | /// @{
24 |
25 | const cpConstraintClass *cpSimpleMotorGetClass(void);
26 |
27 | /// @private
28 | typedef struct cpSimpleMotor {
29 | cpConstraint constraint;
30 | cpFloat rate;
31 |
32 | cpFloat iSum;
33 |
34 | cpFloat jAcc;
35 | } cpSimpleMotor;
36 |
37 | /// Allocate a simple motor.
38 | cpSimpleMotor* cpSimpleMotorAlloc(void);
39 | /// initialize a simple motor.
40 | cpSimpleMotor* cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate);
41 | /// Allocate and initialize a simple motor.
42 | cpConstraint* cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate);
43 |
44 | CP_DefineConstraintProperty(cpSimpleMotor, cpFloat, rate, Rate)
45 |
46 | /// @}
47 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB chipmunk_source_files "*.c" "constraints/*.c")
2 | file(GLOB chipmunk_public_header "${chipmunk_SOURCE_DIR}/include/chipmunk/*.h")
3 | file(GLOB chipmunk_constraint_header "${chipmunk_SOURCE_DIR}/include/chipmunk/constraints/*.h")
4 |
5 | include_directories(${chipmunk_SOURCE_DIR}/include/chipmunk)
6 |
7 | if(BUILD_SHARED)
8 | add_library(chipmunk SHARED
9 | ${chipmunk_source_files}
10 | )
11 | # set the lib's version number
12 | set_target_properties(chipmunk PROPERTIES VERSION 6.1.2)
13 | install(TARGETS chipmunk RUNTIME DESTINATION lib LIBRARY DESTINATION lib)
14 | endif(BUILD_SHARED)
15 |
16 | if(BUILD_STATIC)
17 | add_library(chipmunk_static STATIC
18 | ${chipmunk_source_files}
19 | )
20 | # Sets chipmunk_static to output "libchipmunk.a" not "libchipmunk_static.a"
21 | set_target_properties(chipmunk_static PROPERTIES OUTPUT_NAME chipmunk)
22 | if(INSTALL_STATIC)
23 | install(TARGETS chipmunk_static ARCHIVE DESTINATION lib)
24 | endif(INSTALL_STATIC)
25 | endif(BUILD_STATIC)
26 |
27 | if(BUILD_SHARED OR INSTALL_STATIC)
28 | # FIXME: change to PUBLIC_HEADER to allow building frameworks
29 | install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk)
30 | install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints)
31 | endif(BUILD_SHARED OR INSTALL_STATIC)
32 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/src/constraints/cpConstraint.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | #include "chipmunk_private.h"
23 | #include "constraints/util.h"
24 |
25 | // TODO: Comment me!
26 |
27 | void cpConstraintDestroy(cpConstraint *constraint){}
28 |
29 | void
30 | cpConstraintFree(cpConstraint *constraint)
31 | {
32 | if(constraint){
33 | cpConstraintDestroy(constraint);
34 | cpfree(constraint);
35 | }
36 | }
37 |
38 | // *** declared in util.h TODO move declaration to chipmunk_private.h
39 |
40 | void
41 | cpConstraintInit(cpConstraint *constraint, const cpConstraintClass *klass, cpBody *a, cpBody *b)
42 | {
43 | constraint->klass = klass;
44 |
45 | constraint->a = a;
46 | constraint->b = b;
47 | constraint->space = NULL;
48 |
49 | constraint->next_a = NULL;
50 | constraint->next_b = NULL;
51 |
52 | constraint->maxForce = (cpFloat)INFINITY;
53 | constraint->errorBias = cpfpow(1.0f - 0.1f, 60.0f);
54 | constraint->maxBias = (cpFloat)INFINITY;
55 |
56 | constraint->preSolve = NULL;
57 | constraint->postSolve = NULL;
58 | }
59 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/src/cpBB.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | #include "chipmunk_private.h"
23 |
24 | cpVect
25 | cpBBWrapVect(const cpBB bb, const cpVect v)
26 | {
27 | cpFloat ix = cpfabs(bb.r - bb.l);
28 | cpFloat modx = cpfmod(v.x - bb.l, ix);
29 | cpFloat x = (modx > 0.0f) ? modx : modx + ix;
30 |
31 | cpFloat iy = cpfabs(bb.t - bb.b);
32 | cpFloat mody = cpfmod(v.y - bb.b, iy);
33 | cpFloat y = (mody > 0.0f) ? mody : mody + iy;
34 |
35 | return cpv(x + bb.l, y + bb.b);
36 | }
37 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/src/cpVect.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | #include
23 |
24 | #include "chipmunk_private.h"
25 |
26 | inline cpVect
27 | cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t)
28 | {
29 | cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));
30 | cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));
31 |
32 | if(omega == 0.0){
33 | return v1;
34 | } else {
35 | cpFloat denom = 1.0f/cpfsin(omega);
36 | return cpvadd(cpvmult(v1, cpfsin((1.0f - t)*omega)*denom), cpvmult(v2, cpfsin(t*omega)*denom));
37 | }
38 | }
39 |
40 | cpVect
41 | cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a)
42 | {
43 | cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));
44 | cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));
45 |
46 | return cpvslerp(v1, v2, cpfmin(a, omega)/omega);
47 | }
48 |
49 | char*
50 | cpvstr(const cpVect v)
51 | {
52 | static char str[256];
53 | sprintf(str, "(% .3f, % .3f)", v.x, v.y);
54 | return str;
55 | }
56 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/chipmunk/src/prime.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Scott Lembcke
2 | *
3 | * Permission is hereby granted, free of charge, to any person obtaining a copy
4 | * of this software and associated documentation files (the "Software"), to deal
5 | * in the Software without restriction, including without limitation the rights
6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | * copies of the Software, and to permit persons to whom the Software is
8 | * furnished to do so, subject to the following conditions:
9 | *
10 | * The above copyright notice and this permission notice shall be included in
11 | * all copies or substantial portions of the Software.
12 | *
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | * SOFTWARE.
20 | */
21 |
22 | // Used for resizing hash tables.
23 | // Values approximately double.
24 | // http://planetmath.org/encyclopedia/GoodHashTablePrimes.html
25 | static int primes[] = {
26 | 5,
27 | 13,
28 | 23,
29 | 47,
30 | 97,
31 | 193,
32 | 389,
33 | 769,
34 | 1543,
35 | 3079,
36 | 6151,
37 | 12289,
38 | 24593,
39 | 49157,
40 | 98317,
41 | 196613,
42 | 393241,
43 | 786433,
44 | 1572869,
45 | 3145739,
46 | 6291469,
47 | 12582917,
48 | 25165843,
49 | 50331653,
50 | 100663319,
51 | 201326611,
52 | 402653189,
53 | 805306457,
54 | 1610612741,
55 | 0,
56 | };
57 |
58 | static inline int
59 | next_prime(int n)
60 | {
61 | int i = 0;
62 | while(n > primes[i]){
63 | i++;
64 | cpAssertHard(primes[i], "Tried to resize a hash table to a size greater than 1610612741 O_o"); // realistically this should never happen
65 | }
66 |
67 | return primes[i];
68 | }
69 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/actions/CCActionInterval.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/actions/CCActionInterval.cpp
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/actions/CCActionTiledGrid.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/actions/CCActionTiledGrid.cpp
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/ccFPSImages.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 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | extern unsigned char cc_fps_images_png[];
30 | unsigned int cc_fps_images_len(void);
31 |
32 | #ifdef __cplusplus
33 | }
34 | #endif
35 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/cocoa/CCInteger.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCINTEGER_H__
2 | #define __CCINTEGER_H__
3 |
4 | #include "CCObject.h"
5 |
6 | NS_CC_BEGIN
7 |
8 | /**
9 | * @addtogroup data_structures
10 | * @{
11 | */
12 |
13 | class CC_DLL CCInteger : public CCObject
14 | {
15 | public:
16 | CCInteger(int v)
17 | : m_nValue(v) {}
18 | int getValue() const {return m_nValue;}
19 |
20 | static CCInteger* create(int v)
21 | {
22 | CCInteger* pRet = new CCInteger(v);
23 | pRet->autorelease();
24 | return pRet;
25 | }
26 |
27 | /* override functions */
28 | virtual void acceptVisitor(CCDataVisitor &visitor) { visitor.visit(this); }
29 |
30 | private:
31 | int m_nValue;
32 | };
33 |
34 | // end of data_structure group
35 | /// @}
36 |
37 | NS_CC_END
38 |
39 | #endif /* __CCINTEGER_H__ */
40 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/cocoa/CCZone.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #include "CCZone.h"
25 | #include "CCObject.h"
26 |
27 | NS_CC_BEGIN
28 |
29 | CCZone::CCZone(CCObject *pObject)
30 | {
31 | m_pCopyObject = pObject;
32 | }
33 |
34 | NS_CC_END
35 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/cocoa/CCZone.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CC_ZONE_H__
26 | #define __CC_ZONE_H__
27 |
28 | #include "platform/CCPlatformMacros.h"
29 | #include
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup data_structures
35 | * @{
36 | */
37 |
38 | class CCObject;
39 |
40 | class CC_DLL CCZone
41 | {
42 | public:
43 | CCZone(CCObject *pObject = NULL);
44 |
45 | public:
46 | CCObject *m_pCopyObject;
47 | };
48 |
49 | // end of data_structure group
50 | /// @}
51 |
52 | NS_CC_END
53 |
54 | #endif // __CC_ZONE_H__
55 |
56 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/cocos2d.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2008-2010 Ricardo Quesada
4 | Copyright (c) 2011 Zynga Inc.
5 |
6 | http://www.cocos2d-x.org
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 | #include "cocos2d.h"
28 |
29 | NS_CC_BEGIN
30 |
31 | const char* cocos2dVersion()
32 | {
33 | return "2.1rc0-x-2.1.4";
34 | }
35 |
36 | NS_CC_END
37 |
38 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/include/CCEventType.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __CCEVENT_TYPE_H__
3 | #define __CCEVENT_TYPE_H__
4 |
5 | /**
6 | * This header is used for defining event types using in CCNotificationCenter
7 | */
8 |
9 | // The application will come to foreground.
10 | // This message is used for reloading resources before come to foreground on Android.
11 | // This message is posted in main.cpp.
12 | #define EVNET_COME_TO_FOREGROUND "event_come_to_foreground"
13 |
14 | // The application will come to background.
15 | // This message is used for doing something before coming to background, such as save CCRenderTexture.
16 | // This message is posted in cocos2dx/platform/android/jni/MessageJni.cpp.
17 | #define EVENT_COME_TO_BACKGROUND "event_come_to_background"
18 |
19 | #endif // __CCEVENT_TYPE_H__
20 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/include/ccTypeInfo.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef cocos2dx_ccTypeInfo_h
26 | #define cocos2dx_ccTypeInfo_h
27 |
28 | #include "platform/CCPlatformMacros.h"
29 |
30 | #include
31 | #include
32 | #include
33 |
34 | NS_CC_BEGIN
35 |
36 | class TypeInfo
37 | {
38 | public:
39 | virtual long getClassTypeInfo() = 0;
40 | };
41 |
42 | static inline unsigned int getHashCodeByString(const char *key)
43 | {
44 | unsigned int len = strlen(key);
45 | const char *end=key+len;
46 | unsigned int hash;
47 |
48 | for (hash = 0; key < end; key++)
49 | {
50 | hash *= 16777619;
51 | hash ^= (unsigned int) (unsigned char) toupper(*key);
52 | }
53 | return (hash);
54 | }
55 | NS_CC_END
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/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 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/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 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/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 | #if defined(__QNX__) || defined(ANDROID) || defined(I3D_ARCH_ARM) || defined(__native_client__) // MARMALADE CHANGE: Added for Marmalade support
29 | // blackberry and android don't have arm/arch.h but it defines __arm__
30 | #else
31 | #include "arm/arch.h"
32 | #endif
33 | #endif // __arm__
34 |
35 | // Matrices are assumed to be stored in column major format according to OpenGL
36 | // specification.
37 |
38 | // Multiplies two 4x4 matrices (a,b) outputting a 4x4 matrix (output)
39 | void NEON_Matrix4Mul(const float* a, const float* b, float* output );
40 |
41 | // Multiplies a 4x4 matrix (m) with a vector 4 (v), outputting a vector 4
42 | void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output);
43 |
44 |
45 | #endif // __NEON_MATRIX_IMPL_H__
46 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/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 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/CCAccelerometerDelegate.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CCACCELEROMETER_DELEGATE_H__
26 | #define __CCACCELEROMETER_DELEGATE_H__
27 |
28 | #include "CCCommon.h"
29 |
30 | NS_CC_BEGIN
31 | /**
32 | @brief The device accelerometer reports values for each axis in units of g-force
33 | */
34 | class CCAcceleration
35 | {
36 | public:
37 | double x;
38 | double y;
39 | double z;
40 |
41 | double timestamp;
42 | };
43 |
44 | /**
45 | @brief
46 | The CCAccelerometerDelegate defines a single method for
47 | receiving acceleration-related data from the system.
48 | */
49 | class CC_DLL CCAccelerometerDelegate
50 | {
51 | public:
52 | virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);}
53 | };
54 |
55 | NS_CC_END
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/CCApplicationProtocol.h:
--------------------------------------------------------------------------------
1 | #ifndef __CC_APPLICATION_PROTOCOL_H__
2 | #define __CC_APPLICATION_PROTOCOL_H__
3 |
4 | NS_CC_BEGIN
5 |
6 | enum TargetPlatform
7 | {
8 | kTargetWindows,
9 | kTargetLinux,
10 | kTargetMacOS,
11 | kTargetAndroid,
12 | kTargetIphone,
13 | kTargetIpad,
14 | kTargetBlackBerry,
15 | kTargetNaCl,
16 | kTargetEmscripten,
17 | kTargetTizen
18 | };
19 |
20 | /**
21 | * @addtogroup platform
22 | * @{
23 | */
24 |
25 | class CC_DLL CCApplicationProtocol
26 | {
27 | public:
28 |
29 | virtual ~CCApplicationProtocol() {}
30 |
31 | /**
32 | @brief Implement CCDirector and CCScene init code here.
33 | @return true Initialize success, app continue.
34 | @return false Initialize failed, app terminate.
35 | */
36 | virtual bool applicationDidFinishLaunching() = 0;
37 |
38 | /**
39 | @brief The function be called when the application enter background
40 | @param the pointer of the application
41 | */
42 | virtual void applicationDidEnterBackground() = 0;
43 |
44 | /**
45 | @brief The function be called when the application enter foreground
46 | @param the pointer of the application
47 | */
48 | virtual void applicationWillEnterForeground() = 0;
49 |
50 | /**
51 | @brief Callback by CCDirector for limit FPS.
52 | @interval The time, expressed in seconds, between current frame and next.
53 | */
54 | virtual void setAnimationInterval(double interval) = 0;
55 |
56 | /**
57 | @brief Get current language config
58 | @return Current language config
59 | */
60 | virtual ccLanguageType getCurrentLanguage() = 0;
61 |
62 | /**
63 | @brief Get target platform
64 | */
65 | virtual TargetPlatform getTargetPlatform() = 0;
66 | };
67 |
68 | // end of platform group
69 | /// @}
70 |
71 | NS_CC_END
72 |
73 | #endif // __CC_APPLICATION_PROTOCOL_H__
74 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/CCDevice.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCDEVICE_H__
2 | #define __CCDEVICE_H__
3 |
4 | #include "CCPlatformMacros.h"
5 |
6 | NS_CC_BEGIN
7 |
8 | class CC_DLL CCDevice
9 | {
10 | private:
11 | CCDevice();
12 | public:
13 | /**
14 | * Gets the DPI of device
15 | * @return The DPI of device.
16 | */
17 | static int getDPI();
18 | };
19 |
20 |
21 | NS_CC_END
22 |
23 | #endif /* __CCDEVICE_H__ */
24 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/CCThread.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CC_PLATFORM_THREAD_H__
26 | #define __CC_PLATFORM_THREAD_H__
27 |
28 | #include "CCCommon.h"
29 | #include "CCPlatformMacros.h"
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup platform
35 | * @{
36 | */
37 |
38 | /* On iOS, should create autorelease pool when create a new thread
39 | * and release it when the thread end.
40 | */
41 | class CC_DLL CCThread
42 | {
43 | public:
44 | CCThread() : m_pAutoreasePool(0) {}
45 | ~CCThread();
46 |
47 | void createAutoreleasePool();
48 |
49 | private:
50 | void *m_pAutoreasePool;
51 | };
52 |
53 | // end of platform group
54 | /// @}
55 |
56 | NS_CC_END
57 |
58 | #endif // __CC_PLATFORM_THREAD_H__
59 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/AccelerometerDelegateWrapper.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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
26 | #import "CCAccelerometerDelegate.h"
27 | #import
28 |
29 | @interface AccelerometerDispatcher : NSObject
30 | {
31 | cocos2d::CCAccelerometerDelegate *delegate_;
32 | cocos2d::CCAcceleration *acceleration_;
33 | }
34 |
35 | @property(readwrite) cocos2d::CCAccelerometerDelegate *delegate_;
36 | @property(readwrite) cocos2d::CCAcceleration *acceleration_;
37 |
38 | + (id) sharedAccelerometerDispather;
39 | - (id) init;
40 | - (void) addDelegate: (cocos2d::CCAccelerometerDelegate *) delegate;
41 | - (void) setAccelerometerInterval:(float)interval;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCAccelerometer.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __PLATFORM_IPHONE_CCACCELEROMETER_H__
26 | #define __PLATFORM_IPHONE_CCACCELEROMETER_H__
27 |
28 | #include "platform/CCAccelerometerDelegate.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | class CC_DLL CCAccelerometer
33 | {
34 | public:
35 | CCAccelerometer();
36 | ~CCAccelerometer();
37 |
38 | void setDelegate(CCAccelerometerDelegate* pDelegate);
39 | void setAccelerometerInterval(float interval);
40 | };
41 |
42 | NS_CC_END
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCAccelerometer.mm:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #include "CCAccelerometer.h"
26 | #include "AccelerometerDelegateWrapper.h"
27 |
28 | NS_CC_BEGIN
29 |
30 | CCAccelerometer::CCAccelerometer()
31 | {
32 | }
33 |
34 | CCAccelerometer::~CCAccelerometer()
35 | {
36 | }
37 |
38 | void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate)
39 | {
40 | [[AccelerometerDispatcher sharedAccelerometerDispather] addDelegate:pDelegate];
41 | }
42 |
43 | void CCAccelerometer::setAccelerometerInterval(float interval)
44 | {
45 | [[AccelerometerDispatcher sharedAccelerometerDispather] setAccelerometerInterval:interval];
46 | }
47 |
48 | NS_CC_END
49 |
50 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCDevice.mm:
--------------------------------------------------------------------------------
1 | #include "CCDevice.h"
2 | #import
3 |
4 | NS_CC_BEGIN
5 |
6 | int CCDevice::getDPI()
7 | {
8 | static int dpi = -1;
9 |
10 | if (dpi == -1)
11 | {
12 | float scale = 1.0f;
13 |
14 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
15 | scale = [[UIScreen mainScreen] scale];
16 | }
17 |
18 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
19 | dpi = 132 * scale;
20 | } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
21 | dpi = 163 * scale;
22 | } else {
23 | dpi = 160 * scale;
24 | }
25 | }
26 | return dpi;
27 | }
28 |
29 | NS_CC_END
30 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCDirectorCaller.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #import
25 |
26 | @interface CCDirectorCaller : NSObject {
27 | id displayLink;
28 | int interval;
29 | }
30 | @property (readwrite) int interval;
31 | -(void) startMainLoop;
32 | -(void) doCaller: (id) sender;
33 | -(void) setAnimationInterval:(double)interval;
34 | +(id) sharedDirectorCaller;
35 | +(void) destroy;
36 | @end
37 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCEGLView.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CC_EGLVIEW_IPHONE_H__
26 | #define __CC_EGLVIEW_IPHONE_H__
27 |
28 | #include "platform/CCCommon.h"
29 | #include "platform/CCEGLViewProtocol.h"
30 |
31 | NS_CC_BEGIN
32 |
33 |
34 |
35 | class CC_DLL CCEGLView : public CCEGLViewProtocol
36 | {
37 | public:
38 | CCEGLView();
39 | ~CCEGLView();
40 |
41 | virtual bool isOpenGLReady();
42 | virtual bool setContentScaleFactor(float contentScaleFactor);
43 |
44 | // keep compatible
45 | virtual void end();
46 | virtual void swapBuffers();
47 |
48 | virtual void setIMEKeyboardState(bool bOpen);
49 |
50 | static CCEGLView* sharedOpenGLView();
51 |
52 | };
53 |
54 | NS_CC_END
55 |
56 | #endif // end of __CC_EGLVIEW_IPHONE_H__
57 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCGL.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CCGL_H__
26 | #define __CCGL_H__
27 |
28 | #define glClearDepth glClearDepthf
29 | #define glDeleteVertexArrays glDeleteVertexArraysOES
30 | #define glGenVertexArrays glGenVertexArraysOES
31 | #define glBindVertexArray glBindVertexArrayOES
32 | #define glMapBuffer glMapBufferOES
33 | #define glUnmapBuffer glUnmapBufferOES
34 |
35 | #define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
36 | #define GL_WRITE_ONLY GL_WRITE_ONLY_OES
37 |
38 | #include
39 | #include
40 |
41 |
42 | #endif // __CCGL_H__
43 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCLock.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #include "CCLock.h"
25 |
26 | NS_CC_BEGIN
27 |
28 | CCLock::CCLock(void)
29 | {
30 | }
31 |
32 | CCLock::~CCLock(void)
33 | {
34 |
35 | }
36 |
37 | void CCLock::lock(void)
38 | {
39 |
40 | }
41 |
42 | void CCLock::unlock(void)
43 | {
44 |
45 | }
46 |
47 | NS_CC_END
48 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCLock.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
26 | #define __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
27 |
28 | #include "CCPlatformMacros.h"
29 |
30 | NS_CC_BEGIN
31 |
32 | class CCLock
33 | {
34 | public:
35 | CCLock(void);
36 | ~CCLock(void);
37 |
38 | void lock(void);
39 | void unlock(void);
40 | };
41 |
42 | NS_CC_END
43 |
44 | #endif // __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__
45 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCPlatformDefine.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCPLATFORMDEFINE_H__
2 | #define __CCPLATFORMDEFINE_H__
3 |
4 | #include
5 |
6 | #define CC_DLL
7 |
8 | #define CC_ASSERT(cond) assert(cond)
9 |
10 |
11 | #define CC_UNUSED_PARAM(unusedparam) (void)unusedparam
12 |
13 | /* Define NULL pointer value */
14 | #ifndef NULL
15 | #ifdef __cplusplus
16 | #define NULL 0
17 | #else
18 | #define NULL ((void *)0)
19 | #endif
20 | #endif
21 |
22 |
23 |
24 | #endif /* __CCPLATFORMDEFINE_H__*/
25 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCStdC.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CC_STD_C_H__
26 | #define __CC_STD_C_H__
27 |
28 | #include "platform/CCPlatformMacros.h"
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 |
39 | #ifndef MIN
40 | #define MIN(x,y) (((x) > (y)) ? (y) : (x))
41 | #endif // MIN
42 |
43 | #ifndef MAX
44 | #define MAX(x,y) (((x) < (y)) ? (y) : (x))
45 | #endif // MAX
46 |
47 | #endif // __CC_STD_C_H__
48 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/CCThread.mm:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #import
25 | #include "CCThread.h"
26 |
27 | NS_CC_BEGIN
28 |
29 | CCThread::~CCThread()
30 | {
31 | [(id)m_pAutoreasePool release];
32 | }
33 |
34 | void CCThread::createAutoreleasePool()
35 | {
36 | m_pAutoreasePool = [[NSAutoreleasePool alloc] init];
37 | }
38 |
39 | NS_CC_END
40 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/ios/Simulation/AccelerometerSimulation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AccelerometerSimulation.h
3 | * AccelerometerGraph
4 | *
5 | * Created by Otto Chrons on 9/26/08.
6 | * Copyright 2008 Seastringo Oy. All rights reserved.
7 | *
8 | */
9 | #import
10 |
11 | // when compiling to ARM (iPhone device), hide everything and use system defaults
12 | // if you wish to use simulation mode even on the device, remove the #if/#endif
13 | #if !TARGET_CPU_ARM
14 | #import
15 |
16 | // this is exactly the same as UIAcceleration, but we can modify the member variables
17 | @interface UIAccelerationSimulation: NSObject
18 | {
19 | NSTimeInterval timestamp;
20 | UIAccelerationValue x, y, z;
21 | }
22 | @property(nonatomic, readonly) NSTimeInterval timestamp;
23 | @property(nonatomic, readonly) UIAccelerationValue x, y, z;
24 |
25 | @end
26 |
27 | // override UIAccelerometer behavior
28 | @interface UIAccelerometer (Simulation)
29 | + (UIAccelerometer *)sharedAccelerometer;
30 | @end
31 |
32 | // our own version of the Accelerometer
33 | @interface AccelerometerSimulation : UIAccelerometer
34 | {
35 |
36 | //CFSocketRef udpSocket;
37 | int udpSocket;
38 | NSThread *thread;
39 | BOOL isExiting;
40 | id accelDelegate;
41 | UIAccelerationSimulation *accObject;
42 | // Threaded notification support
43 | NSMutableArray *notifications;
44 | NSThread *notificationThread;
45 | NSLock *notificationLock;
46 | NSMachPort *notificationPort;
47 | }
48 |
49 | @property(nonatomic, assign) id delegate;
50 |
51 | - (void) setUpThreadingSupport;
52 | - (void) handleMachMessage:(void *) msg;
53 | - (void) processNotification:(NSNotification *) notification;
54 | + (AccelerometerSimulation *)getAccelerometer;
55 | - (AccelerometerSimulation *)initialize;
56 |
57 | @end
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/platform.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #include "platform.h"
26 |
27 | #include "CCStdC.h"
28 |
29 | NS_CC_BEGIN
30 |
31 | int CCTime::gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp)
32 | {
33 | CC_UNUSED_PARAM(tzp);
34 | if (tp)
35 | {
36 | gettimeofday((struct timeval *)tp, 0);
37 | }
38 | return 0;
39 | }
40 |
41 | double CCTime::timersubCocos2d(struct cc_timeval *start, struct cc_timeval *end)
42 | {
43 | if (! start || ! end)
44 | {
45 | return 0;
46 | }
47 |
48 | return ((end->tv_sec*1000.0+end->tv_usec/1000.0) - (start->tv_sec*1000.0+start->tv_usec/1000.0));
49 | }
50 |
51 | NS_CC_END
52 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/platform.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __PLATFORM_H__
26 | #define __PLATFORM_H__
27 |
28 | #include "CCThread.h"
29 | #include "CCPlatformMacros.h"
30 |
31 | NS_CC_BEGIN
32 |
33 | /**
34 | * @addtogroup platform
35 | * @{
36 | */
37 |
38 | struct CC_DLL cc_timeval
39 | {
40 | #ifdef __native_client__
41 | time_t tv_sec; // seconds
42 | #else
43 | long tv_sec; // seconds
44 | #endif
45 | int tv_usec; // microSeconds
46 | };
47 |
48 | class CC_DLL CCTime
49 | {
50 | public:
51 | static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp);
52 | static double timersubCocos2d(struct cc_timeval *start, struct cc_timeval *end);
53 | };
54 |
55 | // end of platform group
56 | /// @}
57 |
58 | NS_CC_END
59 |
60 | #endif // __PLATFORM_H__
61 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/curl/stdcheaders.h:
--------------------------------------------------------------------------------
1 | #ifndef __STDC_HEADERS_H
2 | #define __STDC_HEADERS_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at http://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 |
27 | size_t fread (void *, size_t, size_t, FILE *);
28 | size_t fwrite (const void *, size_t, size_t, FILE *);
29 |
30 | int strcasecmp(const char *, const char *);
31 | int strncasecmp(const char *, const char *, size_t);
32 |
33 | #endif /* __STDC_HEADERS_H */
34 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/libraries/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/libraries/libcurl.a
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/libraries/libwebp.a
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/platform/third_party/ios/webp/types.h:
--------------------------------------------------------------------------------
1 | // Copyright 2010 Google Inc. All Rights Reserved.
2 | //
3 | // This code is licensed under the same terms as WebM:
4 | // Software License Agreement: http://www.webmproject.org/license/software/
5 | // Additional IP Rights Grant: http://www.webmproject.org/license/additional/
6 | // -----------------------------------------------------------------------------
7 | //
8 | // Common types
9 | //
10 | // Author: Skal (pascal.massimino@gmail.com)
11 |
12 | #ifndef WEBP_WEBP_TYPES_H_
13 | #define WEBP_WEBP_TYPES_H_
14 |
15 | #include // for size_t
16 |
17 | #ifndef _MSC_VER
18 | #include
19 | #ifdef __STRICT_ANSI__
20 | #define WEBP_INLINE
21 | #else /* __STRICT_ANSI__ */
22 | #define WEBP_INLINE inline
23 | #endif
24 | #else
25 | typedef signed char int8_t;
26 | typedef unsigned char uint8_t;
27 | typedef signed short int16_t;
28 | typedef unsigned short uint16_t;
29 | typedef signed int int32_t;
30 | typedef unsigned int uint32_t;
31 | typedef unsigned long long int uint64_t;
32 | typedef long long int int64_t;
33 | #define WEBP_INLINE __forceinline
34 | #endif /* _MSC_VER */
35 |
36 | #ifndef WEBP_EXTERN
37 | // This explicitly marks library functions and allows for changing the
38 | // signature for e.g., Windows DLL builds.
39 | #define WEBP_EXTERN(type) extern type
40 | #endif /* WEBP_EXTERN */
41 |
42 | // Macro to check ABI compatibility (same major revision number)
43 | #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
44 |
45 | #endif /* WEBP_WEBP_TYPES_H_ */
46 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShaderEx_SwitchMask_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 sampler2D u_mask; \n\
10 | \n\
11 | void main() \n\
12 | { \n\
13 | vec4 texColor = texture2D(u_texture, v_texCoord); \n\
14 | vec4 maskColor = texture2D(u_mask, v_texCoord); \n\
15 | vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n\
16 | gl_FragColor = v_fragmentColor * finalColor; \n\
17 | } \n\
18 | ";
19 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionColor_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | varying vec4 v_fragmentColor; \n\
32 | \n\
33 | void main() \n\
34 | { \n\
35 | gl_FragColor = v_fragmentColor; \n\
36 | } \n\
37 | ";
38 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionColor_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | attribute vec4 a_color; \n\
29 | #ifdef GL_ES \n\
30 | varying lowp vec4 v_fragmentColor; \n\
31 | #else \n\
32 | varying vec4 v_fragmentColor; \n\
33 | #endif \n\
34 | \n\
35 | void main() \n\
36 | { \n\
37 | gl_Position = CC_MVPMatrix * a_position; \n\
38 | v_fragmentColor = a_color; \n\
39 | } \n\
40 | ";
41 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTextureA8Color_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | varying vec4 v_fragmentColor; \n\
32 | varying vec2 v_texCoord; \n\
33 | uniform sampler2D CC_Texture0; \n\
34 | \n\
35 | void main() \n\
36 | { \n\
37 | gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\
38 | v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a // A from texture & uniform \n\
39 | ); \n\
40 | } \n\
41 | ";
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTextureA8Color_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | attribute vec2 a_texCoord; \n\
29 | attribute vec4 a_color; \n\
30 | \n\
31 | #ifdef GL_ES \n\
32 | varying lowp vec4 v_fragmentColor; \n\
33 | varying mediump vec2 v_texCoord; \n\
34 | #else \n\
35 | varying vec4 v_fragmentColor; \n\
36 | varying vec2 v_texCoord; \n\
37 | #endif \n\
38 | \n\
39 | void main() \n\
40 | { \n\
41 | gl_Position = CC_MVPMatrix * a_position; \n\
42 | v_fragmentColor = a_color; \n\
43 | v_texCoord = a_texCoord; \n\
44 | } \n\
45 | ";
46 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTextureColorAlphaTest_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Brian Chapados
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 | " \n\
26 | #ifdef GL_ES \n\
27 | precision lowp float; \n\
28 | #endif \n\
29 | \n\
30 | varying vec4 v_fragmentColor; \n\
31 | varying vec2 v_texCoord; \n\
32 | uniform sampler2D CC_Texture0; \n\
33 | uniform float CC_alpha_value; \n\
34 | \n\
35 | void main() \n\
36 | { \n\
37 | vec4 texColor = texture2D(CC_Texture0, v_texCoord); \n\
38 | \n\
39 | // mimic: glAlphaFunc(GL_GREATER) \n\
40 | // pass if ( incoming_pixel >= CC_alpha_value ) => fail if incoming_pixel < CC_alpha_value \n\
41 | \n\
42 | if ( texColor.a <= CC_alpha_value ) \n\
43 | discard; \n\
44 | \n\
45 | gl_FragColor = texColor * v_fragmentColor; \n\
46 | } \n\
47 | ";
48 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTextureColor_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | varying vec4 v_fragmentColor; \n\
32 | varying vec2 v_texCoord; \n\
33 | uniform sampler2D CC_Texture0; \n\
34 | \n\
35 | void main() \n\
36 | { \n\
37 | gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n\
38 | } \n\
39 | ";
40 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTextureColor_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | attribute vec2 a_texCoord; \n\
29 | attribute vec4 a_color; \n\
30 | \n\
31 | #ifdef GL_ES \n\
32 | varying lowp vec4 v_fragmentColor; \n\
33 | varying mediump vec2 v_texCoord; \n\
34 | #else \n\
35 | varying vec4 v_fragmentColor; \n\
36 | varying vec2 v_texCoord; \n\
37 | #endif \n\
38 | \n\
39 | void main() \n\
40 | { \n\
41 | gl_Position = CC_MVPMatrix * a_position; \n\
42 | v_fragmentColor = a_color; \n\
43 | v_texCoord = a_texCoord; \n\
44 | } \n\
45 | ";
46 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTexture_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | varying vec2 v_texCoord; \n\
32 | uniform sampler2D CC_Texture0; \n\
33 | \n\
34 | void main() \n\
35 | { \n\
36 | gl_FragColor = texture2D(CC_Texture0, v_texCoord); \n\
37 | } \n\
38 | ";
39 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTexture_uColor_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | uniform vec4 u_color; \n\
32 | \n\
33 | varying vec2 v_texCoord; \n\
34 | \n\
35 | uniform sampler2D CC_Texture0; \n\
36 | \n\
37 | void main() \n\
38 | { \n\
39 | gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; \n\
40 | } \n\
41 | ";
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTexture_uColor_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | attribute vec2 a_texCoord; \n\
29 | \n\
30 | #ifdef GL_ES \n\
31 | varying mediump vec2 v_texCoord; \n\
32 | #else \n\
33 | varying vec2 v_texCoord; \n\
34 | #endif \n\
35 | \n\
36 | void main() \n\
37 | { \n\
38 | gl_Position = CC_MVPMatrix * a_position; \n\
39 | v_texCoord = a_texCoord; \n\
40 | } \n\
41 | ";
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_PositionTexture_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | attribute vec2 a_texCoord; \n\
29 | \n\
30 | #ifdef GL_ES \n\
31 | varying mediump vec2 v_texCoord; \n\
32 | #else \n\
33 | varying vec2 v_texCoord; \n\
34 | #endif \n\
35 | \n\
36 | void main() \n\
37 | { \n\
38 | gl_Position = CC_MVPMatrix * a_position; \n\
39 | v_texCoord = a_texCoord; \n\
40 | } \n\
41 | ";
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_Position_uColor_frag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | #ifdef GL_ES \n\
28 | precision lowp float; \n\
29 | #endif \n\
30 | \n\
31 | varying vec4 v_fragmentColor; \n\
32 | \n\
33 | void main() \n\
34 | { \n\
35 | gl_FragColor = v_fragmentColor; \n\
36 | } \n\
37 | ";
38 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/shaders/ccShader_Position_uColor_vert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org
3 | *
4 | * Copyright (c) 2011 Ricardo Quesada
5 | * Copyright (c) 2012 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 | " \n\
27 | attribute vec4 a_position; \n\
28 | uniform vec4 u_color; \n\
29 | uniform float u_pointSize; \n\
30 | \n\
31 | #ifdef GL_ES \n\
32 | varying lowp vec4 v_fragmentColor; \n\
33 | #else \n\
34 | varying vec4 v_fragmentColor; \n\
35 | #endif \n\
36 | \n\
37 | void main() \n\
38 | { \n\
39 | gl_Position = CC_MVPMatrix * a_position; \n\
40 | gl_PointSize = u_pointSize; \n\
41 | v_fragmentColor = u_color; \n\
42 | } \n\
43 | ";
44 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/support/TransformUtils.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010-2012 cocos2d-x.org
3 | Copyright (c) 2009 Valentin Milea
4 |
5 | http://www.cocos2d-x.org
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 | #ifndef __SUPPORT_TRANSFORM_UTILS_H__
27 | #define __SUPPORT_TRANSFORM_UTILS_H__
28 |
29 | // todo:
30 | // when in MAC or windows, it includes
31 | #include "CCGL.h"
32 |
33 | namespace cocos2d {
34 |
35 | struct CCAffineTransform;
36 |
37 | void CGAffineToGL(const CCAffineTransform *t, GLfloat *m);
38 | void GLToCGAffine(const GLfloat *m, CCAffineTransform *t);
39 | }//namespace cocos2d
40 |
41 | #endif // __SUPPORT_TRANSFORM_UTILS_H__
42 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/support/base64.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __SUPPORT_BASE64_H__
26 | #define __SUPPORT_BASE64_H__
27 |
28 | #ifdef __cplusplus
29 | extern "C" {
30 | #endif
31 |
32 | namespace cocos2d {
33 |
34 | /** @file
35 | base64 helper functions
36 | */
37 |
38 | /**
39 | * Decodes a 64base encoded memory. The decoded memory is
40 | * expected to be freed by the caller.
41 | *
42 | * @returns the length of the out buffer
43 | *
44 | @since v0.8.1
45 | */
46 | int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out);
47 |
48 | }//namespace cocos2d
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
54 | #endif // __SUPPORT_BASE64_H__
55 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/support/ccUtils.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #include "ccUtils.h"
25 |
26 | namespace cocos2d {
27 |
28 | unsigned long ccNextPOT(unsigned long x)
29 | {
30 | x = x - 1;
31 | x = x | (x >> 1);
32 | x = x | (x >> 2);
33 | x = x | (x >> 4);
34 | x = x | (x >> 8);
35 | x = x | (x >>16);
36 | return x + 1;
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/support/ccUtils.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2010 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __SUPPORT_CC_UTILS_H__
25 | #define __SUPPORT_CC_UTILS_H__
26 |
27 | /** @file ccUtils.h
28 | Misc free functions
29 | */
30 |
31 | namespace cocos2d {
32 | /*
33 | ccNextPOT function is licensed under the same license that is used in CCTexture2D.m.
34 | */
35 |
36 | /** returns the Next Power of Two value.
37 |
38 | Examples:
39 | - If "value" is 15, it will return 16.
40 | - If "value" is 16, it will return 16.
41 | - If "value" is 17, it will return 32.
42 |
43 | @since v0.99.5
44 | */
45 |
46 | unsigned long ccNextPOT( unsigned long value );
47 |
48 | }
49 |
50 | #endif // __SUPPORT_CC_UTILS_H__
51 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/cocos2dx/textures/CCTextureETC.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2013 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CCETCTEXTURE_H__
26 | #define __CCETCTEXTURE_H__
27 |
28 | #include "cocoa/CCObject.h"
29 | #include "platform/CCPlatformMacros.h"
30 | #include "CCGL.h"
31 |
32 | NS_CC_BEGIN
33 |
34 | class CC_DLL CCTextureETC : public CCObject
35 | {
36 | public:
37 | CCTextureETC();
38 | virtual ~CCTextureETC();
39 |
40 | bool initWithFile(const char* file);
41 |
42 | unsigned int getName() const;
43 | unsigned int getWidth() const;
44 | unsigned int getHeight() const;
45 |
46 | private:
47 | bool loadTexture(const char* file);
48 |
49 | private:
50 | GLuint _name;
51 | unsigned int _width;
52 | unsigned int _height;
53 | };
54 |
55 | NS_CC_END
56 |
57 | #endif /* defined(__CCETCTEXTURE_H__) */
58 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBFileLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBFileLoader.h"
2 |
3 |
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | #define PROPERTY_CCBFILE "ccbFile"
8 |
9 | void CCBFileLoader::onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader) {
10 | if(strcmp(pPropertyName, PROPERTY_CCBFILE) == 0) {
11 | ((CCBFile*)pNode)->setCCBFileNode(pCCBFileNode);
12 | } else {
13 | CCNodeLoader::onHandlePropTypeCCBFile(pNode, pParent, pPropertyName, pCCBFileNode, pCCBReader);
14 | }
15 | }
16 |
17 | NS_CC_EXT_END
18 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBFileLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCBFILELOADER_H_
2 | #define _CCB_CCBFILELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "CCBReader.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCBFileLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCBFileLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBFileLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile);
19 |
20 | virtual void onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader);
21 | };
22 |
23 | NS_CC_EXT_END
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBKeyframe.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBKeyframe.h"
2 |
3 | using namespace cocos2d;
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | CCBKeyframe::CCBKeyframe()
8 | : mValue(NULL)
9 | , mTime(0.0f)
10 | , mEasingType(0)
11 | , mEasingOpt(0.0f)
12 | {}
13 |
14 | CCBKeyframe::~CCBKeyframe()
15 | {
16 | CC_SAFE_RELEASE_NULL(mValue);
17 | }
18 |
19 | CCObject* CCBKeyframe::getValue()
20 | {
21 | return mValue;
22 | }
23 |
24 | void CCBKeyframe::setValue(CCObject *pValue)
25 | {
26 | CC_SAFE_RELEASE(mValue);
27 | mValue = pValue;
28 | CC_SAFE_RETAIN(mValue);
29 | }
30 |
31 | float CCBKeyframe::getTime()
32 | {
33 | return mTime;
34 | }
35 |
36 | void CCBKeyframe::setTime(float fTime)
37 | {
38 | mTime = fTime;
39 | }
40 |
41 | int CCBKeyframe::getEasingType()
42 | {
43 | return mEasingType;
44 | }
45 |
46 | void CCBKeyframe::setEasingType(int nEasingType)
47 | {
48 | mEasingType = nEasingType;
49 | }
50 |
51 | float CCBKeyframe::getEasingOpt()
52 | {
53 | return mEasingOpt;
54 | }
55 |
56 | void CCBKeyframe::setEasingOpt(float fEasingOpt)
57 | {
58 | mEasingOpt = fEasingOpt;
59 | }
60 |
61 | NS_CC_EXT_END
62 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBKeyframe.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_KEYFRAME_H__
2 | #define __CCB_KEYFRAME_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | class CCBKeyframe : public CCObject
10 | {
11 | private:
12 | CCObject *mValue;
13 | float mTime;
14 | int mEasingType;
15 | float mEasingOpt;
16 |
17 | public:
18 | CCBKeyframe();
19 | ~CCBKeyframe();
20 |
21 | CCObject* getValue();
22 | void setValue(CCObject *pValue); // retain
23 |
24 | float getTime();
25 | void setTime(float fTime);
26 |
27 | int getEasingType();
28 | void setEasingType(int nEasingType);
29 |
30 | float getEasingOpt();
31 | void setEasingOpt(float fEasingOpt);
32 | };
33 |
34 | NS_CC_EXT_END
35 |
36 | #endif // __CCB_KEYFRAME_H__
37 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBSelectorResolver.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCBSELECTORRESOLVER_H_
2 | #define _CCB_CCBSELECTORRESOLVER_H_
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 | #include "../GUI/CCControlExtension/CCInvocation.h"
7 |
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | #define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
12 | return menu_selector(METHOD); \
13 | }
14 |
15 | #define CCB_SELECTORRESOLVER_CCCONTROL_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
16 | return cccontrol_selector(METHOD); \
17 | }
18 |
19 | #define CCB_SELECTORRESOLVER_CALLFUNC_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \
20 | return callfuncN_selector(METHOD); \
21 | }
22 |
23 | class CCBSelectorResolver {
24 | public:
25 | virtual ~CCBSelectorResolver() {};
26 | virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(CCObject * pTarget, const char* pSelectorName) = 0;
27 | virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(CCObject * pTarget, const char* pSelectorName) { return NULL; };
28 | virtual SEL_CCControlHandler onResolveCCBCCControlSelector(CCObject * pTarget, const char* pSelectorName) = 0;
29 | };
30 |
31 |
32 | class CCBScriptOwnerProtocol {
33 | public:
34 | virtual ~CCBScriptOwnerProtocol() {};
35 | virtual CCBSelectorResolver * createNew() = 0;
36 | };
37 |
38 | NS_CC_EXT_END
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBSequence.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBSequence.h"
2 |
3 | using namespace cocos2d;
4 | using namespace std;
5 |
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | CCBSequence::CCBSequence()
10 | : mDuration(0.0f)
11 | , mName("")
12 | , mSequenceId(0)
13 | , mChainedSequenceId(0)
14 | , mCallbackChannel(NULL)
15 | , mSoundChannel(NULL)
16 | {}
17 |
18 | CCBSequence::~CCBSequence() {
19 | CC_SAFE_RELEASE(mCallbackChannel);
20 | CC_SAFE_RELEASE(mSoundChannel);
21 | }
22 |
23 | float CCBSequence::getDuration()
24 | {
25 | return mDuration;
26 | }
27 |
28 | void CCBSequence::setDuration(float fDuration)
29 | {
30 | mDuration = fDuration;
31 | }
32 |
33 | const char* CCBSequence::getName()
34 | {
35 | return mName.c_str();
36 | }
37 |
38 | void CCBSequence::setName(const char *pName)
39 | {
40 | mName = pName;
41 | }
42 |
43 | int CCBSequence::getSequenceId()
44 | {
45 | return mSequenceId;
46 | }
47 |
48 | void CCBSequence::setSequenceId(int nSequenceId)
49 | {
50 | mSequenceId = nSequenceId;
51 | }
52 |
53 | CCBSequenceProperty* CCBSequence::getCallbackChannel()
54 | {
55 | return mCallbackChannel;
56 | }
57 |
58 | void CCBSequence::setCallbackChannel(CCBSequenceProperty* callbackChannel)
59 | {
60 | CC_SAFE_RELEASE(mCallbackChannel);
61 | mCallbackChannel = callbackChannel;
62 | CC_SAFE_RETAIN(mCallbackChannel);
63 | }
64 |
65 |
66 | CCBSequenceProperty* CCBSequence::getSoundChannel()
67 | {
68 | return mSoundChannel;
69 | }
70 |
71 | void CCBSequence::setSoundChannel(CCBSequenceProperty* soundChannel)
72 | {
73 | CC_SAFE_RELEASE(mSoundChannel);
74 | mSoundChannel = soundChannel;
75 | CC_SAFE_RETAIN(mSoundChannel);
76 | }
77 |
78 |
79 | int CCBSequence::getChainedSequenceId()
80 | {
81 | return mChainedSequenceId;
82 | }
83 |
84 | void CCBSequence::setChainedSequenceId(int nChainedSequenceId)
85 | {
86 | mChainedSequenceId = nChainedSequenceId;
87 | }
88 |
89 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBSequence.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_CCSEQUENCE_H__
2 | #define __CCB_CCSEQUENCE_H__
3 |
4 | #include
5 | #include "cocos2d.h"
6 | #include "ExtensionMacros.h"
7 | #include "CCBSequenceProperty.h"
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | class CCBSequence : public CCObject
12 | {
13 | private:
14 | float mDuration;
15 | std::string mName;
16 | int mSequenceId;
17 | int mChainedSequenceId;
18 | CCBSequenceProperty* mCallbackChannel;
19 | CCBSequenceProperty* mSoundChannel;
20 |
21 | public:
22 | CCBSequence();
23 | ~CCBSequence();
24 | float getDuration();
25 | void setDuration(float fDuration);
26 |
27 | CCBSequenceProperty* getCallbackChannel();
28 | void setCallbackChannel(CCBSequenceProperty* callbackChannel);
29 |
30 | CCBSequenceProperty* getSoundChannel();
31 | void setSoundChannel(CCBSequenceProperty* soundChannel);
32 |
33 | const char* getName();
34 | void setName(const char *pName);
35 |
36 | int getSequenceId();
37 | void setSequenceId(int nSequenceId);
38 |
39 | int getChainedSequenceId();
40 | void setChainedSequenceId(int nChainedSequenceId);
41 | };
42 |
43 |
44 | NS_CC_EXT_END
45 |
46 |
47 | #endif // __CCB_CCSEQUENCE_H__
48 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBSequenceProperty.cpp:
--------------------------------------------------------------------------------
1 | #include "CCBSequenceProperty.h"
2 |
3 | using namespace cocos2d;
4 | using namespace std;
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | CCBSequenceProperty::CCBSequenceProperty()
9 | : mName("")
10 | , mType(0)
11 | {
12 | init();
13 | }
14 |
15 | bool CCBSequenceProperty::init()
16 | {
17 | mKeyframes = new CCArray();
18 |
19 | return true;
20 | }
21 |
22 | CCBSequenceProperty::~CCBSequenceProperty()
23 | {
24 | CC_SAFE_RELEASE_NULL(mKeyframes);
25 | }
26 |
27 | const char* CCBSequenceProperty::getName()
28 | {
29 | return mName.c_str();
30 | }
31 |
32 | void CCBSequenceProperty::setName(const char *pName)
33 | {
34 | mName = pName;
35 | }
36 |
37 | int CCBSequenceProperty::getType()
38 | {
39 | return mType;
40 | }
41 |
42 | void CCBSequenceProperty::setType(int nType)
43 | {
44 | mType = nType;
45 | }
46 |
47 | CCArray* CCBSequenceProperty::getKeyframes()
48 | {
49 | return mKeyframes;
50 | }
51 |
52 | NS_CC_EXT_END
53 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBSequenceProperty.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_SEQUENCE_PROPERTY_H__
2 | #define __CCB_SEQUENCE_PROPERTY_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 | #include "CCBKeyframe.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | class CCBSequenceProperty : public CCObject
11 | {
12 | private:
13 | std::string mName;
14 | int mType;
15 | CCArray *mKeyframes;
16 |
17 | public:
18 | CCBSequenceProperty();
19 | ~CCBSequenceProperty();
20 |
21 | virtual bool init();
22 |
23 | const char* getName();
24 | void setName(const char* pName);
25 |
26 | int getType();
27 | void setType(int nType);
28 |
29 | CCArray* getKeyframes();
30 | };
31 |
32 | NS_CC_EXT_END
33 |
34 | #endif // __CCB_SEQUENCE_PROPERTY_H__
35 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCBValue.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_VALUE_H__
2 | #define __CCB_VALUE_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | /*
8 | These classes are wrapper of basic types, such as ccColor3B
9 | */
10 |
11 | NS_CC_EXT_BEGIN
12 |
13 | class ccColor3BWapper : public CCObject
14 | {
15 | private:
16 | ccColor3B color;
17 |
18 | public:
19 | static ccColor3BWapper* create(const ccColor3B& color);
20 |
21 | const ccColor3B& getColor() const;
22 | };
23 |
24 | enum
25 | {
26 | kIntValue,
27 | kFloatValue,
28 | kBoolValue,
29 | kUnsignedCharValue,
30 | kStringValue,
31 | kArrayValue
32 | };
33 |
34 | class CCBValue : public CCObject
35 | {
36 | private:
37 | union
38 | {
39 | int nValue;
40 | float fValue;
41 | } mValue;
42 |
43 | std::string m_strValue;
44 | CCArray* m_arrValue;
45 | int mType;
46 |
47 | public:
48 | static CCBValue* create(int nValue);
49 | static CCBValue* create(bool bValue);
50 | static CCBValue* create(float fValue);
51 | static CCBValue* create(unsigned char byte);
52 | static CCBValue* create(const char* pStr);
53 | static CCBValue* create(CCArray* pArr);
54 |
55 |
56 | int getIntValue();
57 | float getFloatValue();
58 | bool getBoolValue();
59 | unsigned char getByteValue();
60 | const char* getStringValue();
61 | CCArray *getArrayValue();
62 |
63 | int getType();
64 | };
65 |
66 | NS_CC_EXT_END
67 |
68 | #endif // __CCB_VALUE_H__
69 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCControlButtonLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCCONTROLBUTTONLOADER_H_
2 | #define _CCB_CCCONTROLBUTTONLOADER_H_
3 |
4 | #include "CCControlLoader.h"
5 | #include "../GUI/CCControlExtension/CCControlButton.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCControlButtonLoader : public CCControlLoader {
13 | public:
14 | virtual ~CCControlButtonLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCControlButtonLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCControlButton);
19 |
20 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeString(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char * pString, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFontTTF(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFloatScale(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float pFloatScale, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
27 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
28 | };
29 |
30 | NS_CC_EXT_END
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCControlLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCControlLoader.h"
2 |
3 |
4 | NS_CC_EXT_BEGIN
5 |
6 | #define PROPERTY_ENABLED "enabled"
7 | #define PROPERTY_SELECTED "selected"
8 | #define PROPERTY_CCCONTROL "ccControl"
9 |
10 | void CCControlLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
11 | if(strcmp(pPropertyName, PROPERTY_ENABLED) == 0) {
12 | ((CCControl *)pNode)->setEnabled(pCheck);
13 | } else if(strcmp(pPropertyName, PROPERTY_SELECTED) == 0) {
14 | ((CCControl *)pNode)->setSelected(pCheck);
15 | } else {
16 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
17 | }
18 | }
19 |
20 | void CCControlLoader::onHandlePropTypeBlockCCControl(CCNode * pNode, CCNode * pParent, const char * pPropertyName, BlockCCControlData * pBlockCCControlData, CCBReader * pCCBReader) {
21 | if(strcmp(pPropertyName, PROPERTY_CCCONTROL) == 0) {
22 | ((CCControl *)pNode)->addTargetWithActionForControlEvents(pBlockCCControlData->mTarget, pBlockCCControlData->mSELCCControlHandler, pBlockCCControlData->mControlEvents);
23 | } else {
24 | CCNodeLoader::onHandlePropTypeBlockCCControl(pNode, pParent, pPropertyName, pBlockCCControlData, pCCBReader);
25 | }
26 | }
27 |
28 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCControlLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCCONTROLLOADER_H_
2 | #define _CCB_CCCONTROLLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "../GUI/CCControlExtension/CCControl.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCControlLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCControlLoader() {};
15 |
16 | protected:
17 | CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCControl);
18 |
19 | virtual void onHandlePropTypeBlockCCControl(CCNode * pNode, CCNode * pParent, const char * pPropertyName, BlockCCControlData * pBlockCCControlData, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader);
21 | };
22 |
23 | NS_CC_EXT_END
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCData.cpp:
--------------------------------------------------------------------------------
1 | #include "CCData.h"
2 |
3 | NS_CC_EXT_BEGIN
4 |
5 | CCData::CCData(unsigned char *pBytes, const unsigned long nSize)
6 | {
7 | m_nSize = nSize;
8 | m_pBytes = new unsigned char[m_nSize];
9 | memcpy(m_pBytes, pBytes, m_nSize);
10 | }
11 |
12 | CCData::CCData(CCData *pData)
13 | {
14 | m_nSize = pData->m_nSize;
15 | m_pBytes = new unsigned char[m_nSize];
16 | memcpy(m_pBytes, pData->m_pBytes, m_nSize);
17 | }
18 |
19 | CCData::~CCData()
20 | {
21 | CC_SAFE_DELETE_ARRAY(m_pBytes);
22 | }
23 |
24 | unsigned char* CCData::getBytes()
25 | {
26 | return m_pBytes;
27 | }
28 |
29 | unsigned long CCData::getSize()
30 | {
31 | return m_nSize;
32 | }
33 |
34 | NS_CC_EXT_END
35 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCData.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef __CCB_CCDATA_H__
3 | #define __CCB_CCDATA_H__
4 |
5 | #include "cocos2d.h"
6 | #include "ExtensionMacros.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | class CCData : public CCObject
11 | {
12 | public:
13 | CCData(unsigned char *pBytes, const unsigned long nSize);
14 | CCData(CCData *pData);
15 | ~CCData();
16 |
17 | unsigned char* getBytes();
18 | unsigned long getSize();
19 |
20 | private:
21 | unsigned char* m_pBytes;
22 | unsigned long m_nSize;
23 | };
24 |
25 | NS_CC_EXT_END
26 |
27 | #endif // __CCB_CCDATA_H__
28 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLabelBMFontLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLABELBMFONTLOADER_H_
2 | #define _CCB_CCLABELBMFONTLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLabelBMFontLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLabelBMFontLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelBMFontLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLabelBMFont);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFntFile(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeText(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char* pText, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLabelTTFLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLABELTTFLOADER_H_
2 | #define _CCB_CCLABELTTFLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLabelTTFLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLabelTTFLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLabelTTFLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLabelTTF);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFontTTF(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeText(CCNode * pNode, CCNode * pParent, const char * pPropertyName, const char * pText, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeFloatScale(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float pFloatScale, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLayerColorLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCLayerColorLoader.h"
2 |
3 |
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | #define PROPERTY_COLOR "color"
8 | #define PROPERTY_OPACITY "opacity"
9 | #define PROPERTY_BLENDFUNC "blendFunc"
10 |
11 | void CCLayerColorLoader::onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader) {
12 | if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {
13 | ((CCLayerColor *)pNode)->setColor(pCCColor3B);
14 | } else {
15 | CCLayerLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pCCColor3B, pCCBReader);
16 | }
17 | }
18 |
19 | void CCLayerColorLoader::onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader) {
20 | if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {
21 | ((CCLayerColor *)pNode)->setOpacity(pByte);
22 | } else {
23 | CCLayerLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, pCCBReader);
24 | }
25 | }
26 |
27 | void CCLayerColorLoader::onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader) {
28 | if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {
29 | ((CCLayerColor *)pNode)->setBlendFunc(pCCBlendFunc);
30 | } else {
31 | CCLayerLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pCCBlendFunc, pCCBReader);
32 | }
33 | }
34 |
35 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLayerColorLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERCOLORLOADER_H_
2 | #define _CCB_CCLAYERCOLORLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerColorLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCLayerColorLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerColorLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayerColor);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
22 | };
23 |
24 | NS_CC_EXT_END
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLayerGradientLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERGRADIENTLOADER_H_
2 | #define _CCB_CCLAYERGRADIENTLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerGradientLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCLayerGradientLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerGradientLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayerGradient);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
23 | };
24 |
25 | NS_CC_EXT_END
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLayerLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCLayerLoader.h"
2 |
3 |
4 |
5 |
6 | #define PROPERTY_TOUCH_ENABLED "isTouchEnabled"
7 | #define PROPERTY_ACCELEROMETER_ENABLED "isAccelerometerEnabled"
8 | #define PROPERTY_MOUSE_ENABLED "isMouseEnabled"
9 | #define PROPERTY_KEYBOARD_ENABLED "isKeyboardEnabled"
10 |
11 | NS_CC_EXT_BEGIN
12 |
13 | void CCLayerLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
14 | if(strcmp(pPropertyName, PROPERTY_TOUCH_ENABLED) == 0) {
15 | ((CCLayer *)pNode)->setTouchEnabled(pCheck);
16 | } else if(strcmp(pPropertyName, PROPERTY_ACCELEROMETER_ENABLED) == 0) {
17 | ((CCLayer *)pNode)->setAccelerometerEnabled(pCheck);
18 | } else if(strcmp(pPropertyName, PROPERTY_MOUSE_ENABLED) == 0) {
19 | // TODO XXX
20 | CCLOG("The property '%s' is not supported!", PROPERTY_MOUSE_ENABLED);
21 | } else if(strcmp(pPropertyName, PROPERTY_KEYBOARD_ENABLED) == 0) {
22 | // TODO XXX
23 | CCLOG("The property '%s' is not supported!", PROPERTY_KEYBOARD_ENABLED);
24 | // This comes closest: ((CCLayer *)pNode)->setKeypadEnabled(pCheck);
25 | } else {
26 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
27 | }
28 | }
29 |
30 | NS_CC_EXT_END
31 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCLayerLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCLAYERLOADER_H_
2 | #define _CCB_CCLAYERLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCLayerLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCLayerLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCLayerLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCLayer);
18 |
19 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCMenuItemImageLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCMenuItemImageLoader.h"
2 |
3 |
4 |
5 | #define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame"
6 | #define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame"
7 | #define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame"
8 |
9 | NS_CC_EXT_BEGIN
10 |
11 | void CCMenuItemImageLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
12 | if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) {
13 | if(pCCSpriteFrame != NULL) {
14 | ((CCMenuItemImage *)pNode)->setNormalSpriteFrame(pCCSpriteFrame);
15 | }
16 | } else if(strcmp(pPropertyName, PROPERTY_SELECTEDDISPLAYFRAME) == 0) {
17 | if(pCCSpriteFrame != NULL) {
18 | ((CCMenuItemImage *)pNode)->setSelectedSpriteFrame(pCCSpriteFrame);
19 | }
20 | } else if(strcmp(pPropertyName, PROPERTY_DISABLEDDISPLAYFRAME) == 0) {
21 | if(pCCSpriteFrame != NULL) {
22 | ((CCMenuItemImage *)pNode)->setDisabledSpriteFrame(pCCSpriteFrame);
23 | }
24 | } else {
25 | CCMenuItemLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
26 | }
27 | }
28 |
29 | NS_CC_EXT_END
30 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCMenuItemImageLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENUITEMIMAGELOADER_H_
2 | #define _CCB_CCMENUITEMIMAGELOADER_H_
3 |
4 | #include "CCMenuItemLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuItemImageLoader : public CCMenuItemLoader {
12 | public:
13 | virtual ~CCMenuItemImageLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuItemImageLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenuItemImage);
18 |
19 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCMenuItemLoader.cpp:
--------------------------------------------------------------------------------
1 | #include "CCMenuItemLoader.h"
2 |
3 |
4 |
5 | #define PROPERTY_BLOCK "block"
6 | #define PROPERTY_ISENABLED "isEnabled"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | void CCMenuItemLoader::onHandlePropTypeBlock(CCNode * pNode, CCNode * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * pCCBReader) {
11 | if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) {
12 | if (NULL != pBlockData) // Add this condition to allow CCMenuItemImage without target/selector predefined
13 | {
14 | ((CCMenuItem *)pNode)->setTarget(pBlockData->mTarget, pBlockData->mSELMenuHandler);
15 | }
16 | } else {
17 | CCNodeLoader::onHandlePropTypeBlock(pNode, pParent, pPropertyName, pBlockData, pCCBReader);
18 | }
19 | }
20 |
21 | void CCMenuItemLoader::onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader) {
22 | if(strcmp(pPropertyName, PROPERTY_ISENABLED) == 0) {
23 | ((CCMenuItem *)pNode)->setEnabled(pCheck);
24 | } else {
25 | CCNodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, pCCBReader);
26 | }
27 | }
28 |
29 | NS_CC_EXT_END
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCMenuItemLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENUITEMLOADER_H_
2 | #define _CCB_CCMENUITEMLOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuItemLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCMenuItemLoader() {};
14 |
15 | protected:
16 | CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenuItem);
17 |
18 | virtual void onHandlePropTypeBlock(CCNode * pNode, CCNode * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * pCCBReader);
19 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader);
20 | };
21 |
22 | NS_CC_EXT_END
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCMenuLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCMENULOADER_H_
2 | #define _CCB_CCMENULOADER_H_
3 |
4 | #include "CCLayerLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCMenuLoader : public CCLayerLoader {
12 | public:
13 | virtual ~CCMenuLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCMenuLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCMenu);
18 | };
19 |
20 | NS_CC_EXT_END
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCNode+CCBRelativePositioning.cpp:
--------------------------------------------------------------------------------
1 | #include "CCNode+CCBRelativePositioning.h"
2 | #include "CCBReader.h"
3 |
4 | using namespace cocos2d;
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName)
9 | {
10 | CCPoint absPt = ccp(0,0);
11 | if (nType == kCCBPositionTypeRelativeBottomLeft)
12 | {
13 | absPt = pt;
14 | }
15 | else if (nType == kCCBPositionTypeRelativeTopLeft)
16 | {
17 | absPt.x = pt.x;
18 | absPt.y = containerSize.height - pt.y;
19 | }
20 | else if (nType == kCCBPositionTypeRelativeTopRight)
21 | {
22 | absPt.x = containerSize.width - pt.x;
23 | absPt.y = containerSize.height - pt.y;
24 | }
25 | else if (nType == kCCBPositionTypeRelativeBottomRight)
26 | {
27 | absPt.x = containerSize.width - pt.x;
28 | absPt.y = pt.y;
29 | }
30 | else if (nType == kCCBPositionTypePercent)
31 | {
32 | absPt.x = (int)(containerSize.width * pt.x / 100.0f);
33 | absPt.y = (int)(containerSize.height * pt.y / 100.0f);
34 | }
35 | else if (nType == kCCBPositionTypeMultiplyResolution)
36 | {
37 | float resolutionScale = CCBReader::getResolutionScale();
38 |
39 | absPt.x = pt.x * resolutionScale;
40 | absPt.y = pt.y * resolutionScale;
41 | }
42 |
43 | return absPt;
44 | }
45 |
46 | void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName)
47 | {
48 | CCAssert(pNode, "pNode should not be null");
49 |
50 | if (nType == kCCBScaleTypeMultiplyResolution)
51 | {
52 | float resolutionScale = CCBReader::getResolutionScale();
53 |
54 | fScaleX *= resolutionScale;
55 | fScaleY *= resolutionScale;
56 | }
57 |
58 | pNode->setScaleX(fScaleX);
59 | pNode->setScaleY(fScaleY);
60 | }
61 |
62 | NS_CC_EXT_END
63 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCNode+CCBRelativePositioning.h:
--------------------------------------------------------------------------------
1 | #ifndef __CCB_CCNODE_RELATIVEPOSITIONING_H__
2 | #define __CCB_CCNODE_RELATIVEPOSITIONING_H__
3 |
4 | #include "cocos2d.h"
5 | #include "ExtensionMacros.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | extern CCPoint getAbsolutePosition(const CCPoint &pt, int nType, const CCSize &containerSize, const char *pPropName);
10 |
11 | extern void setRelativeScale(CCNode *pNode, float fScaleX, float fScaleY, int nType, const char* pPropName);
12 |
13 | NS_CC_EXT_END
14 |
15 | #endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__
16 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCNodeLoaderLibrary.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCNODELOADERLIBRARY_H_
2 | #define _CCB_CCNODELOADERLIBRARY_H_
3 |
4 | #include "cocos2d.h"
5 | #include "CCBReader.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | class CCNodeLoader;
10 |
11 | typedef std::map CCNodeLoaderMap;
12 | typedef std::pair CCNodeLoaderMapEntry;
13 |
14 | class CCNodeLoaderLibrary : public CCObject {
15 | private:
16 | CCNodeLoaderMap mCCNodeLoaders;
17 |
18 | public:
19 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCNodeLoaderLibrary, library);
20 |
21 | CCNodeLoaderLibrary();
22 | virtual ~CCNodeLoaderLibrary();
23 |
24 | void registerDefaultCCNodeLoaders();
25 | void registerCCNodeLoader(const char * pClassName, CCNodeLoader * pCCNodeLoader);
26 | //void registerCCNodeLoader(CCString * pClassName, CCNodeLoader * pCCNodeLoader);
27 | void unregisterCCNodeLoader(const char * pClassName);
28 | //void unregisterCCNodeLoader(CCString * pClassName);
29 | CCNodeLoader * getCCNodeLoader(const char * pClassName);
30 | //CCNodeLoader * getCCNodeLoader(CCString * pClassName);
31 | void purge(bool pDelete);
32 |
33 | public:
34 | static CCNodeLoaderLibrary * sharedCCNodeLoaderLibrary();
35 | static void purgeSharedCCNodeLoaderLibrary();
36 |
37 | static CCNodeLoaderLibrary * newDefaultCCNodeLoaderLibrary();
38 | };
39 |
40 | NS_CC_EXT_END
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCNodeLoaderListener.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCNODELOADERLISTENER_H_
2 | #define _CCB_CCNODELOADERLISTENER_H_
3 |
4 | #include "cocos2d.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | class CCNodeLoaderListener {
9 | public:
10 | virtual ~CCNodeLoaderListener() {};
11 |
12 | virtual void onNodeLoaded(CCNode * pNode, CCNodeLoader * pNodeLoader) = 0;
13 | };
14 |
15 | NS_CC_EXT_END
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCParticleSystemQuadLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCPARTICLESYSTEMQUADLOADER_H_
2 | #define _CCB_CCPARTICLESYSTEMQUADLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCParticleSystemQuadLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCParticleSystemQuadLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCParticleSystemQuadLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCParticleSystemQuad);
18 |
19 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypePoint(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCPoint pPoint, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float pFloat, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeInteger(CCNode * pNode, CCNode * pParent, const char * pPropertyName, int pInteger, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFloatVar(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeColor4FVar(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor4F * pCCColor4FVar, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeTexture(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCTexture2D * pCCTexture2D, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCScale9SpriteLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSCALE9SPRITELOADER_H_
2 | #define _CCB_CCSCALE9SPRITELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "CCScale9SpriteLoader.h"
6 | #include "../GUI/CCControlExtension/CCScale9Sprite.h"
7 |
8 | NS_CC_EXT_BEGIN
9 |
10 | /* Forward declaration. */
11 | class CCBReader;
12 |
13 | class CCScale9SpriteLoader : public CCNodeLoader {
14 | public:
15 | virtual ~CCScale9SpriteLoader() {};
16 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCScale9SpriteLoader, loader);
17 |
18 | protected:
19 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCScale9Sprite);
20 |
21 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBlendFunc, CCBReader * pCCBReader);
24 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
25 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
26 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float pFloat, CCBReader * pCCBReader);
27 | };
28 |
29 | NS_CC_EXT_END
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCScrollViewLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSCROLLVIEWLOADER_H_
2 | #define _CCB_CCSCROLLVIEWLOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 | #include "../GUI/CCScrollView/CCScrollView.h"
6 |
7 | NS_CC_EXT_BEGIN
8 |
9 | /* Forward declaration. */
10 | class CCBReader;
11 |
12 | class CCScrollViewLoader : public CCNodeLoader {
13 | public:
14 | virtual ~CCScrollViewLoader() {};
15 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCScrollViewLoader, loader);
16 |
17 | protected:
18 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCScrollView);
19 | virtual void onHandlePropTypeSize(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSize pSize, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeCCBFile(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCNode * pCCBFileNode, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeCheck(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool pCheck, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeFloat(CCNode * pNode, CCNode * pParent, const char * pPropertyName, float pFloat, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeIntegerLabeled(CCNode * pNode, CCNode * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/CCBReader/CCSpriteLoader.h:
--------------------------------------------------------------------------------
1 | #ifndef _CCB_CCSPRITELOADER_H_
2 | #define _CCB_CCSPRITELOADER_H_
3 |
4 | #include "CCNodeLoader.h"
5 |
6 | NS_CC_EXT_BEGIN
7 |
8 | /* Forward declaration. */
9 | class CCBReader;
10 |
11 | class CCSpriteLoader : public CCNodeLoader {
12 | public:
13 | virtual ~CCSpriteLoader() {};
14 | CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCSpriteLoader, loader);
15 |
16 | protected:
17 | CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCSprite);
18 |
19 | virtual void onHandlePropTypeColor3(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccColor3B pCCColor3B, CCBReader * pCCBReader);
20 | virtual void onHandlePropTypeByte(CCNode * pNode, CCNode * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * pCCBReader);
21 | virtual void onHandlePropTypeBlendFunc(CCNode * pNode, CCNode * pParent, const char * pPropertyName, ccBlendFunc pCCBBlendFunc, CCBReader * pCCBReader);
22 | virtual void onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader);
23 | virtual void onHandlePropTypeFlip(CCNode * pNode, CCNode * pParent, const char * pPropertyName, bool * pFlip, CCBReader * pCCBReader);
24 | };
25 |
26 | NS_CC_EXT_END
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/Components/CCComController.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2013 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__
26 | #define __CC_EXTENTIONS_CCCOMCONTROLLER_H__
27 |
28 | #include "cocos2d.h"
29 | #include "CCInputDelegate.h"
30 |
31 | NS_CC_EXT_BEGIN
32 |
33 | class CCComController : public cocos2d::CCComponent, public CCInputDelegate
34 | {
35 | protected:
36 | CCComController(void);
37 |
38 | public:
39 | virtual ~CCComController(void);
40 | virtual bool init();
41 | virtual void onEnter();
42 | virtual void onExit();
43 | virtual void update(float delta);
44 | virtual bool isEnabled() const;
45 | virtual void setEnabled(bool b);
46 |
47 | static CCComController* create(void);
48 | };
49 |
50 | NS_CC_EXT_END
51 |
52 | #endif // __FUNDATION__CCCOMPONENT_H__
53 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/ExtensionMacros.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __EXTENSIONMARCROS_H__
26 | #define __EXTENSIONMARCROS_H__
27 |
28 | #define NS_CC_EXT_BEGIN namespace cocos2d { namespace extension {
29 | #define NS_CC_EXT_END }}
30 | #define USING_NS_CC_EXT using namespace cocos2d::extension
31 |
32 |
33 | #endif /* __EXTENSIONMARCROS_H__ */
34 |
35 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControl.h
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControlExtensions.h:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 |
4 | http://www.cocos2d-x.org
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 | #ifndef __CCCONTROL_EXTENSIONS_H__
26 | #define __CCCONTROL_EXTENSIONS_H__
27 |
28 | #include "CCScale9Sprite.h"
29 | #include "CCControl.h"
30 | #include "CCControlButton.h"
31 | #include "CCControlColourPicker.h"
32 | #include "CCControlPotentiometer.h"
33 | #include "CCControlSlider.h"
34 | #include "CCControlStepper.h"
35 | #include "CCControlSwitch.h"
36 |
37 | #endif
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControlSlider.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCControlSlider.h
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCControlExtension/CCInvocation.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2012 cocos2d-x.org
3 | * http://www.cocos2d-x.org
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.
22 | *
23 | *
24 | * Converted to c++ / cocos2d-x by Angus C
25 | */
26 |
27 | #include "CCInvocation.h"
28 |
29 | NS_CC_EXT_BEGIN
30 |
31 | CCInvocation* CCInvocation::create(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent)
32 | {
33 | CCInvocation* pRet = new CCInvocation(target, action, controlEvent);
34 | if (pRet != NULL)
35 | {
36 | pRet->autorelease();
37 | }
38 | return pRet;
39 | }
40 |
41 | CCInvocation::CCInvocation(CCObject* target, SEL_CCControlHandler action, CCControlEvent controlEvent)
42 | {
43 | m_target=target;
44 | m_action=action;
45 | m_controlEvent=controlEvent;
46 | }
47 |
48 | void CCInvocation::invoke(CCObject* sender)
49 | {
50 | if (m_target && m_action)
51 | {
52 | (m_target->*m_action)(sender, m_controlEvent);
53 | }
54 | }
55 |
56 | NS_CC_EXT_END
57 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp:
--------------------------------------------------------------------------------
1 | #include "CCEditBox.h"
2 |
3 | #if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN)
4 |
5 | NS_CC_EXT_BEGIN
6 |
7 | CCEditBoxImpl* __createSystemEditBox(CCEditBox* pEditBox)
8 | {
9 | return NULL;
10 | }
11 |
12 | NS_CC_EXT_END
13 |
14 | #endif /* #if (..) */
15 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/GUI/CCScrollView/CCTableViewCell.cpp:
--------------------------------------------------------------------------------
1 | /****************************************************************************
2 | Copyright (c) 2012 cocos2d-x.org
3 | Copyright (c) 2010 Sangwoo Im
4 |
5 | http://www.cocos2d-x.org
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 | #include "CCTableViewCell.h"
27 |
28 | NS_CC_EXT_BEGIN
29 |
30 | void CCTableViewCell::reset()
31 | {
32 | m_uIdx = CC_INVALID_INDEX;
33 | }
34 |
35 | void CCTableViewCell::setObjectID(unsigned int uIdx)
36 | {
37 | m_uIdx = uIdx;
38 | }
39 |
40 | unsigned int CCTableViewCell::getObjectID()
41 | {
42 | return m_uIdx;
43 | }
44 |
45 | unsigned int CCTableViewCell::getIdx()
46 | {
47 | return m_uIdx;
48 | }
49 |
50 | void CCTableViewCell::setIdx(unsigned int uIdx)
51 | {
52 | m_uIdx = uIdx;
53 | }
54 |
55 | NS_CC_EXT_END
56 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/LocalStorage/LocalStorage.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (c) 2012 - Zynga Inc.
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.
22 |
23 | */
24 |
25 | /*
26 | Local Storage support for the JS Bindings for iOS.
27 | Works on cocos2d-iphone and cocos2d-x.
28 | */
29 |
30 | #ifndef __JSB_LOCALSTORAGE_H
31 | #define __JSB_LOCALSTORAGE_H
32 |
33 | #include
34 | #include
35 |
36 | /** Initializes the database. If path is null, it will create an in-memory DB */
37 | void localStorageInit( const char *fullpath);
38 |
39 | /** Frees the allocated resources */
40 | void localStorageFree();
41 |
42 | /** sets an item in the LS */
43 | void localStorageSetItem( const char *key, const char *value);
44 |
45 | /** gets an item from the LS */
46 | const char* localStorageGetItem( const char *key );
47 |
48 | /** removes an item from the LS */
49 | void localStorageRemoveItem( const char *key );
50 |
51 | #endif // __JSB_LOCALSTORAGE_H
52 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/cocos-ext.h:
--------------------------------------------------------------------------------
1 | #ifndef __COCOS2D_EXT_H__
2 | #define __COCOS2D_EXT_H__
3 |
4 | #include "ExtensionMacros.h"
5 |
6 | #include "CCBReader/CCBFileLoader.h"
7 | #include "CCBReader/CCBMemberVariableAssigner.h"
8 | #include "CCBReader/CCBReader.h"
9 | #include "CCBReader/CCBSelectorResolver.h"
10 | #include "CCBReader/CCControlButtonLoader.h"
11 | #include "CCBReader/CCControlLoader.h"
12 | #include "CCBReader/CCLabelBMFontLoader.h"
13 | #include "CCBReader/CCLabelTTFLoader.h"
14 | #include "CCBReader/CCLayerColorLoader.h"
15 | #include "CCBReader/CCLayerGradientLoader.h"
16 | #include "CCBReader/CCLayerLoader.h"
17 | #include "CCBReader/CCMenuItemImageLoader.h"
18 | #include "CCBReader/CCMenuItemLoader.h"
19 | #include "CCBReader/CCMenuLoader.h"
20 | #include "CCBReader/CCNodeLoader.h"
21 | #include "CCBReader/CCNodeLoaderLibrary.h"
22 | #include "CCBReader/CCNodeLoaderListener.h"
23 | #include "CCBReader/CCParticleSystemQuadLoader.h"
24 | #include "CCBReader/CCScale9SpriteLoader.h"
25 | #include "CCBReader/CCScrollViewLoader.h"
26 | #include "CCBReader/CCSpriteLoader.h"
27 | #include "CCBReader/CCBAnimationManager.h"
28 | #include "CCBReader/CCBKeyframe.h"
29 | #include "CCBReader/CCBSequence.h"
30 | #include "CCBReader/CCBSequenceProperty.h"
31 | #include "CCBReader/CCBValue.h"
32 | #include "CCBReader/CCData.h"
33 | #include "CCBReader/CCNode+CCBRelativePositioning.h"
34 |
35 | #include "GUI/CCControlExtension/CCControlExtensions.h"
36 | #include "GUI/CCScrollView/CCScrollView.h"
37 | #include "GUI/CCScrollView/CCTableView.h"
38 | #include "GUI/CCEditBox/CCEditBox.h"
39 |
40 | #include "network/HttpRequest.h"
41 | #include "network/HttpResponse.h"
42 | #include "network/HttpClient.h"
43 |
44 | // Physics integration
45 | #if CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION
46 | #include "physics_nodes/CCPhysicsDebugNode.h"
47 | #include "physics_nodes/CCPhysicsSprite.h"
48 | #endif
49 |
50 | #include "spine/spine-cocos2dx.h"
51 |
52 | #include "Components/CCComAttribute.h"
53 | #include "Components/CCComAudio.h"
54 | #include "Components/CCComController.h"
55 |
56 | #endif /* __COCOS2D_EXT_H__ */
57 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/spine/AtlasAttachmentLoader.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013, Esoteric Software
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. 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
21 | * ON 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 SPINE_ATLASATTACHMENTLOADER_H_
27 | #define SPINE_ATLASATTACHMENTLOADER_H_
28 |
29 | #include
30 | #include
31 |
32 | namespace cocos2d { namespace extension {
33 |
34 | typedef struct {
35 | AttachmentLoader super;
36 | Atlas* atlas;
37 | } AtlasAttachmentLoader;
38 |
39 | AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas);
40 |
41 | }} // namespace cocos2d { namespace extension {
42 |
43 | #endif /* SPINE_ATLASATTACHMENTLOADER_H_ */
44 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/spine/BoneData.cpp:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013, Esoteric Software
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. 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
21 | * ON 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
27 | #include
28 |
29 | namespace cocos2d { namespace extension {
30 |
31 | BoneData* BoneData_create (const char* name, BoneData* parent) {
32 | BoneData* self = NEW(BoneData);
33 | MALLOC_STR(self->name, name);
34 | CONST_CAST(BoneData*, self->parent) = parent;
35 | self->scaleX = 1;
36 | self->scaleY = 1;
37 | return self;
38 | }
39 |
40 | void BoneData_dispose (BoneData* self) {
41 | FREE(self->name);
42 | FREE(self);
43 | }
44 |
45 | }} // namespace cocos2d { namespace extension {
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/spine/BoneData.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013, Esoteric Software
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. 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
21 | * ON 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 SPINE_BONEDATA_H_
27 | #define SPINE_BONEDATA_H_
28 |
29 | namespace cocos2d { namespace extension {
30 |
31 | typedef struct BoneData BoneData;
32 | struct BoneData {
33 | const char* const name;
34 | BoneData* const parent;
35 | float length;
36 | float x, y;
37 | float rotation;
38 | float scaleX, scaleY;
39 | };
40 |
41 | BoneData* BoneData_create (const char* name, BoneData* parent);
42 | void BoneData_dispose (BoneData* self);
43 |
44 | }} // namespace cocos2d { namespace extension {
45 |
46 | #endif /* SPINE_BONEDATA_H_ */
47 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/extensions/spine/spine-cocos2dx.h:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2013, Esoteric Software
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. 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
21 | * ON 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 SPINE_COCOS2DX_H_
27 | #define SPINE_COCOS2DX_H_
28 |
29 | #include
30 | #include "cocos2d.h"
31 | #include
32 | #include
33 |
34 | namespace cocos2d { namespace extension {
35 |
36 | void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, cocos2d::ccV3F_C4B_T2F_Quad* quad, bool premultiplied = false);
37 |
38 | }} // namespace cocos2d { namespace extension {
39 |
40 | #endif /* SPINE_COCOS2DX_H_ */
41 |
--------------------------------------------------------------------------------
/Cocos2dxExt/Cocos2dxExt/libs/libwebsockets/ios/lib/libwebsockets.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PlayApple/cocos2dx-extensions/883fd833d4fd69d64f743bdae6371876a4a9fe04/Cocos2dxExt/Cocos2dxExt/libs/libwebsockets/ios/lib/libwebsockets.a
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | cocos2dx-extensions
2 | ===================
3 |
4 | Extensions for Cocos2dx:
5 |
6 | 1.Dynamic CCLabelTTF - 动态显示数字
7 |
8 | 2.Gray Sprite - 创建灰色图
9 |
10 | 3.Turn Card - 翻牌效果
11 |
12 | 4.Zoom Controller - 场景多点聚焦缩放
13 |
14 |
15 |
--------------------------------------------------------------------------------