diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index ea4a9890a6..81b945434f 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -cef7f2eb0a7ce536df264b4b3fa72470af8213d0 \ No newline at end of file +7658fe75258895d82e9432317ff63b182547bcdc \ No newline at end of file diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..04a9dc0568 --- /dev/null +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +f0ce606901bf2ba3acceae9e9562214dde6a4c69 \ No newline at end of file diff --git a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id deleted file mode 100644 index a1c65992b0..0000000000 --- a/build/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -f3d0c334145f571e5338f3e0fa051f7713668e3f \ No newline at end of file diff --git a/cocos/2d/Android.mk b/cocos/2d/Android.mk index 6caa61be36..20017089fe 100644 --- a/cocos/2d/Android.mk +++ b/cocos/2d/Android.mk @@ -7,176 +7,178 @@ LOCAL_MODULE := cocos2dx_static LOCAL_MODULE_FILENAME := libcocos2d LOCAL_SRC_FILES := \ +base64.cpp \ +CCAction.cpp \ +CCActionCamera.cpp \ +CCActionCatmullRom.cpp \ +CCActionEase.cpp \ +CCActionGrid.cpp \ +CCActionGrid3D.cpp \ +CCActionInstant.cpp \ +CCActionInterval.cpp \ +CCActionManager.cpp \ +CCActionPageTurn3D.cpp \ +CCActionProgressTimer.cpp \ +CCActionTiledGrid.cpp \ +CCActionTween.cpp \ +CCAnimation.cpp \ +CCAnimationCache.cpp \ +CCAtlasNode.cpp \ CCCamera.cpp \ +ccCArray.cpp \ +CCClippingNode.cpp \ +CCComponent.cpp \ +CCComponentContainer.cpp \ CCConfiguration.cpp \ CCDeprecated.cpp \ CCDirector.cpp \ +CCDrawingPrimitives.cpp \ +CCDrawNode.cpp \ +CCEvent.cpp \ +CCEventAcceleration.cpp \ +CCEventCustom.cpp \ +CCEventDispatcher.cpp \ +CCEventKeyboard.cpp \ +CCEventListener.cpp \ +CCEventListenerAcceleration.cpp \ +CCEventListenerCustom.cpp \ +CCEventListenerKeyboard.cpp \ +CCEventListenerTouch.cpp \ +CCEventTouch.cpp \ +CCFont.cpp \ +CCFontAtlas.cpp \ +CCFontAtlasCache.cpp \ +CCFontAtlasFactory.cpp \ +CCFontDefinition.cpp \ +CCFontFNT.cpp \ +CCFontFreeType.cpp \ ccFPSImages.c \ +CCGLBufferedNode.cpp \ +CCGLProgram.cpp \ +ccGLStateCache.cpp \ +CCGrabber.cpp \ +CCGrid.cpp \ +CCIMEDispatcher.cpp \ +CCLabel.cpp \ +CCLabelAtlas.cpp \ +CCLabelBMFont.cpp \ +CCLabelTextFormatter.cpp \ +CCLabelTTF.cpp \ +CCLayer.cpp \ +CCMenu.cpp \ +CCMenuItem.cpp \ +CCMotionStreak.cpp \ +CCNode.cpp \ +CCNotificationCenter.cpp \ +CCParallaxNode.cpp \ +CCParticleBatchNode.cpp \ +CCParticleExamples.cpp \ +CCParticleSystem.cpp \ +CCParticleSystemQuad.cpp \ +CCProfiling.cpp \ +CCProgressTimer.cpp \ +CCRenderTexture.cpp \ +CCScene.cpp \ CCScheduler.cpp \ +CCScriptSupport.cpp \ +CCShaderCache.cpp \ +ccShaders.cpp \ +CCSprite.cpp \ +CCSpriteBatchNode.cpp \ +CCSpriteFrame.cpp \ +CCSpriteFrameCache.cpp \ +CCTextFieldTTF.cpp \ +CCTextImage.cpp \ +CCTexture2D.cpp \ +CCTextureAtlas.cpp \ +CCTextureCache.cpp \ +CCTileMapAtlas.cpp \ +CCTMXLayer.cpp \ +CCTMXObjectGroup.cpp \ +CCTMXTiledMap.cpp \ +CCTMXXMLParser.cpp \ +CCTouch.cpp \ +CCTransition.cpp \ +CCTransitionPageTurn.cpp \ +CCTransitionProgress.cpp \ ccTypes.cpp \ +CCUserDefault.cpp \ +CCUserDefaultAndroid.cpp \ +ccUTF8.cpp \ +ccUtils.cpp \ +CCVertex.cpp \ cocos2d.cpp \ -actions/CCAction.cpp \ -actions/CCActionCamera.cpp \ -actions/CCActionCatmullRom.cpp \ -actions/CCActionEase.cpp \ -actions/CCActionGrid.cpp \ -actions/CCActionGrid3D.cpp \ -actions/CCActionInstant.cpp \ -actions/CCActionInterval.cpp \ -actions/CCActionManager.cpp \ -actions/CCActionPageTurn3D.cpp \ -actions/CCActionProgressTimer.cpp \ -actions/CCActionTiledGrid.cpp \ -actions/CCActionTween.cpp \ -base_nodes/CCAtlasNode.cpp \ -base_nodes/CCNode.cpp \ -cocoa/CCAffineTransform.cpp \ -cocoa/CCArray.cpp \ -cocoa/CCAutoreleasePool.cpp \ -cocoa/CCData.cpp \ -cocoa/CCDataVisitor.cpp \ -cocoa/CCDictionary.cpp \ -cocoa/CCGeometry.cpp \ -cocoa/CCNS.cpp \ -cocoa/CCObject.cpp \ -cocoa/CCSet.cpp \ -cocoa/CCString.cpp \ -draw_nodes/CCDrawingPrimitives.cpp \ -draw_nodes/CCDrawNode.cpp \ -effects/CCGrabber.cpp \ -effects/CCGrid.cpp \ -event_dispatcher/CCEventAcceleration.cpp \ -event_dispatcher/CCEventListenerAcceleration.cpp \ -event_dispatcher/CCEventCustom.cpp \ -event_dispatcher/CCEventListenerCustom.cpp \ -event_dispatcher/CCEvent.cpp \ -event_dispatcher/CCEventDispatcher.cpp \ -event_dispatcher/CCEventListener.cpp \ -event_dispatcher/CCEventKeyboard.cpp \ -event_dispatcher/CCEventListenerKeyboard.cpp \ -event_dispatcher/CCTouch.cpp \ -event_dispatcher/CCEventTouch.cpp \ -event_dispatcher/CCEventListenerTouch.cpp \ -kazmath/src/aabb.c \ -kazmath/src/mat3.c \ -kazmath/src/mat4.c \ -kazmath/src/neon_matrix_impl.c \ -kazmath/src/plane.c \ -kazmath/src/quaternion.c \ -kazmath/src/ray2.c \ -kazmath/src/utility.c \ -kazmath/src/vec2.c \ -kazmath/src/vec3.c \ -kazmath/src/vec4.c \ -kazmath/src/GL/mat4stack.c \ -kazmath/src/GL/matrix.c \ -label_nodes/CCFont.cpp \ -label_nodes/CCFontAtlas.cpp \ -label_nodes/CCFontAtlasCache.cpp \ -label_nodes/CCFontAtlasFactory.cpp \ -label_nodes/CCFontDefinition.cpp \ -label_nodes/CCFontFNT.cpp \ -label_nodes/CCFontFreeType.cpp \ -label_nodes/CCLabel.cpp \ -label_nodes/CCLabelAtlas.cpp \ -label_nodes/CCLabelBMFont.cpp \ -label_nodes/CCLabelTextFormatter.cpp \ -label_nodes/CCLabelTTF.cpp \ -label_nodes/CCTextImage.cpp \ -layers_scenes_transitions_nodes/CCLayer.cpp \ -layers_scenes_transitions_nodes/CCScene.cpp \ -layers_scenes_transitions_nodes/CCTransition.cpp \ -layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp \ -layers_scenes_transitions_nodes/CCTransitionProgress.cpp \ -menu_nodes/CCMenu.cpp \ -menu_nodes/CCMenuItem.cpp \ -misc_nodes/CCClippingNode.cpp \ -misc_nodes/CCMotionStreak.cpp \ -misc_nodes/CCProgressTimer.cpp \ -misc_nodes/CCRenderTexture.cpp \ -particle_nodes/CCParticleBatchNode.cpp \ -particle_nodes/CCParticleExamples.cpp \ -particle_nodes/CCParticleSystem.cpp \ -particle_nodes/CCParticleSystemQuad.cpp \ -physics/CCPhysicsBody.cpp \ -physics/CCPhysicsContact.cpp \ -physics/CCPhysicsJoint.cpp \ -physics/CCPhysicsShape.cpp \ -physics/CCPhysicsWorld.cpp \ -physics/Box2D/CCPhysicsBodyInfo.cpp \ -physics/Box2D/CCPhysicsContactInfo.cpp \ -physics/Box2D/CCPhysicsJointInfo.cpp \ -physics/Box2D/CCPhysicsShapeInfo.cpp \ -physics/Box2D/CCPhysicsWorldInfo.cpp \ -physics/chipmunk/CCPhysicsBodyInfo.cpp \ -physics/chipmunk/CCPhysicsContactInfo.cpp \ -physics/chipmunk/CCPhysicsJointInfo.cpp \ -physics/chipmunk/CCPhysicsShapeInfo.cpp \ -physics/chipmunk/CCPhysicsWorldInfo.cpp \ +TGAlib.cpp \ +TransformUtils.cpp \ +ZipUtils.cpp \ platform/CCEGLViewProtocol.cpp \ platform/CCFileUtils.cpp \ platform/CCSAXParser.cpp \ platform/CCThread.cpp \ -platform/third_party/common/atitc/atitc.cpp \ -platform/third_party/common/etc/etc1.cpp \ -platform/third_party/common/s3tc/s3tc.cpp \ -script_support/CCScriptSupport.cpp \ -shaders/CCGLProgram.cpp \ -shaders/ccGLStateCache.cpp \ -shaders/CCShaderCache.cpp \ -shaders/ccShaders.cpp \ -sprite_nodes/CCAnimation.cpp \ -sprite_nodes/CCAnimationCache.cpp \ -sprite_nodes/CCSprite.cpp \ -sprite_nodes/CCSpriteBatchNode.cpp \ -sprite_nodes/CCSpriteFrame.cpp \ -sprite_nodes/CCSpriteFrameCache.cpp \ -support/base64.cpp \ -support/CCNotificationCenter.cpp \ -support/CCProfiling.cpp \ -support/ccUTF8.cpp \ -support/ccUtils.cpp \ -support/CCVertex.cpp \ -support/TransformUtils.cpp \ -support/component/CCComponent.cpp \ -support/component/CCComponentContainer.cpp \ -support/data_support/ccCArray.cpp \ -support/image_support/TGAlib.cpp \ -support/tinyxml2/tinyxml2.cpp \ -support/user_default/CCUserDefaultAndroid.cpp \ -support/zip_support/ioapi.cpp \ -support/zip_support/unzip.cpp \ -support/zip_support/ZipUtils.cpp \ -text_input_node/CCIMEDispatcher.cpp \ -text_input_node/CCTextFieldTTF.cpp \ -textures/CCTexture2D.cpp \ -textures/CCTextureAtlas.cpp \ -textures/CCTextureCache.cpp \ -tilemap_parallax_nodes/CCParallaxNode.cpp \ -tilemap_parallax_nodes/CCTileMapAtlas.cpp \ -tilemap_parallax_nodes/CCTMXLayer.cpp \ -tilemap_parallax_nodes/CCTMXObjectGroup.cpp \ -tilemap_parallax_nodes/CCTMXTiledMap.cpp \ -tilemap_parallax_nodes/CCTMXXMLParser.cpp +../base/atitc.cpp \ +../base/CCAffineTransform.cpp \ +../base/CCArray.cpp \ +../base/CCAutoreleasePool.cpp \ +../base/CCData.cpp \ +../base/CCDataVisitor.cpp \ +../base/CCDictionary.cpp \ +../base/CCGeometry.cpp \ +../base/CCNS.cpp \ +../base/CCObject.cpp \ +../base/CCSet.cpp \ +../base/CCString.cpp \ +../base/etc1.cpp \ +../base/s3tc.cpp \ +../math/kazmath/src/aabb.c \ +../math/kazmath/src/mat3.c \ +../math/kazmath/src/mat4.c \ +../math/kazmath/src/neon_matrix_impl.c \ +../math/kazmath/src/plane.c \ +../math/kazmath/src/quaternion.c \ +../math/kazmath/src/ray2.c \ +../math/kazmath/src/utility.c \ +../math/kazmath/src/vec2.c \ +../math/kazmath/src/vec3.c \ +../math/kazmath/src/vec4.c \ +../math/kazmath/src/GL/mat4stack.c \ +../math/kazmath/src/GL/matrix.c \ +../physics/CCPhysicsBody.cpp \ +../physics/CCPhysicsContact.cpp \ +../physics/CCPhysicsJoint.cpp \ +../physics/CCPhysicsShape.cpp \ +../physics/CCPhysicsWorld.cpp \ +../physics/box2d/CCPhysicsBodyInfo.cpp \ +../physics/box2d/CCPhysicsContactInfo.cpp \ +../physics/box2d/CCPhysicsJointInfo.cpp \ +../physics/box2d/CCPhysicsShapeInfo.cpp \ +../physics/box2d/CCPhysicsWorldInfo.cpp \ +../physics/chipmunk/CCPhysicsBodyInfo.cpp \ +../physics/chipmunk/CCPhysicsContactInfo.cpp \ +../physics/chipmunk/CCPhysicsJointInfo.cpp \ +../physics/chipmunk/CCPhysicsShapeInfo.cpp \ +../physics/chipmunk/CCPhysicsWorldInfo.cpp \ +../../external/tinyxml2/tinyxml2.cpp \ +../../external/unzip/ioapi.cpp \ +../../external/unzip/unzip.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/kazmath/include \ - $(LOCAL_PATH)/platform/android \ - $(LOCAL_PATH)/platform/third_party/common/etc \ - $(LOCAL_PATH)/platform/third_party/common/s3tc \ - $(LOCAL_PATH)/platform/third_party/common/atitc \ - $(LOCAL_PATH)/../external/chipmunk/include/chipmunk + $(LOCAL_PATH)/../math/kazmath/include \ + platform/android \ + $(LOCAL_PATH)/../physics \ + $(LOCAL_PATH)/../base \ + $(LOCAL_PATH)/../../external/tinyxml2 \ + $(LOCAL_PATH)/../../external/unzip \ + $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk LOCAL_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/kazmath/include \ + $(LOCAL_PATH)/../math/kazmath/include \ $(LOCAL_PATH)/platform/android \ - $(LOCAL_PATH)/platform/third_party/common/etc \ - $(LOCAL_PATH)/platform/third_party/common/s3tc \ - $(LOCAL_PATH)/platform/third_party/common/atitc \ - $(LOCAL_PATH)/../external/chipmunk/include/chipmunk + $(LOCAL_PATH)/../physics \ + $(LOCAL_PATH)/../base \ + $(LOCAL_PATH)/../../external/tinyxml2 \ + $(LOCAL_PATH)/../../external/unzip \ + $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk LOCAL_LDLIBS := -lGLESv2 \ @@ -196,6 +198,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libtiff_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libwebp_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_freetype2_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static # define the macro to compile through support/zip_support/ioapi.c LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API @@ -203,9 +206,10 @@ LOCAL_EXPORT_CFLAGS := -Wno-psabi -DUSE_FILE32API include $(BUILD_STATIC_LIBRARY) -$(call import-module,libjpeg) -$(call import-module,libpng) -$(call import-module,libtiff) -$(call import-module,libwebp) -$(call import-module,libfreetype2) -$(call import-module,external/chipmunk) +$(call import-module,jpeg/prebuilt/android) +$(call import-module,png/prebuilt/android) +$(call import-module,tiff/prebuilt/android) +$(call import-module,webp/prebuilt/android) +$(call import-module,freetype2/prebuilt/android) +$(call import-module,chipmunk) +$(call import-module,2d/platform/android) diff --git a/cocos/2d/actions/CCAction.cpp b/cocos/2d/CCAction.cpp similarity index 99% rename from cocos/2d/actions/CCAction.cpp rename to cocos/2d/CCAction.cpp index 515aa53f14..3a6f66953c 100644 --- a/cocos/2d/actions/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCAction.h" #include "CCActionInterval.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/actions/CCAction.h b/cocos/2d/CCAction.h similarity index 98% rename from cocos/2d/actions/CCAction.h rename to cocos/2d/CCAction.h index ccb787fcda..2ead2ad96e 100644 --- a/cocos/2d/actions/CCAction.h +++ b/cocos/2d/CCAction.h @@ -27,9 +27,9 @@ THE SOFTWARE. #ifndef __ACTIONS_CCACTION_H__ #define __ACTIONS_CCACTION_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" -#include "platform/CCPlatformMacros.h" +#include "CCObject.h" +#include "CCGeometry.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/actions/CCActionCamera.cpp b/cocos/2d/CCActionCamera.cpp similarity index 99% rename from cocos/2d/actions/CCActionCamera.cpp rename to cocos/2d/CCActionCamera.cpp index 395d5277c7..8b9673914a 100644 --- a/cocos/2d/actions/CCActionCamera.cpp +++ b/cocos/2d/CCActionCamera.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionCamera.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCCamera.h" #include "CCStdC.h" diff --git a/cocos/2d/actions/CCActionCamera.h b/cocos/2d/CCActionCamera.h similarity index 100% rename from cocos/2d/actions/CCActionCamera.h rename to cocos/2d/CCActionCamera.h diff --git a/cocos/2d/actions/CCActionCatmullRom.cpp b/cocos/2d/CCActionCatmullRom.cpp similarity index 100% rename from cocos/2d/actions/CCActionCatmullRom.cpp rename to cocos/2d/CCActionCatmullRom.cpp diff --git a/cocos/2d/actions/CCActionCatmullRom.h b/cocos/2d/CCActionCatmullRom.h similarity index 99% rename from cocos/2d/actions/CCActionCatmullRom.h rename to cocos/2d/CCActionCatmullRom.h index ca864ea820..7b4452d1bc 100644 --- a/cocos/2d/actions/CCActionCatmullRom.h +++ b/cocos/2d/CCActionCatmullRom.h @@ -40,8 +40,8 @@ #include #include "CCActionInterval.h" -#include "base_nodes/CCNode.h" -#include "cocoa/CCGeometry.h" +#include "CCNode.h" +#include "CCGeometry.h" NS_CC_BEGIN; diff --git a/cocos/2d/actions/CCActionEase.cpp b/cocos/2d/CCActionEase.cpp similarity index 100% rename from cocos/2d/actions/CCActionEase.cpp rename to cocos/2d/CCActionEase.cpp diff --git a/cocos/2d/actions/CCActionEase.h b/cocos/2d/CCActionEase.h similarity index 100% rename from cocos/2d/actions/CCActionEase.h rename to cocos/2d/CCActionEase.h diff --git a/cocos/2d/actions/CCActionGrid.cpp b/cocos/2d/CCActionGrid.cpp similarity index 99% rename from cocos/2d/actions/CCActionGrid.cpp rename to cocos/2d/CCActionGrid.cpp index 57f61a384f..c174f3cf0f 100644 --- a/cocos/2d/actions/CCActionGrid.cpp +++ b/cocos/2d/CCActionGrid.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionGrid.h" #include "CCDirector.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" NS_CC_BEGIN // implementation of GridAction diff --git a/cocos/2d/actions/CCActionGrid.h b/cocos/2d/CCActionGrid.h similarity index 100% rename from cocos/2d/actions/CCActionGrid.h rename to cocos/2d/CCActionGrid.h diff --git a/cocos/2d/actions/CCActionGrid3D.cpp b/cocos/2d/CCActionGrid3D.cpp similarity index 100% rename from cocos/2d/actions/CCActionGrid3D.cpp rename to cocos/2d/CCActionGrid3D.cpp diff --git a/cocos/2d/actions/CCActionGrid3D.h b/cocos/2d/CCActionGrid3D.h similarity index 100% rename from cocos/2d/actions/CCActionGrid3D.h rename to cocos/2d/CCActionGrid3D.h diff --git a/cocos/2d/actions/CCActionInstant.cpp b/cocos/2d/CCActionInstant.cpp similarity index 99% rename from cocos/2d/actions/CCActionInstant.cpp rename to cocos/2d/CCActionInstant.cpp index 21e1a1c745..f71a361a02 100644 --- a/cocos/2d/actions/CCActionInstant.cpp +++ b/cocos/2d/CCActionInstant.cpp @@ -25,9 +25,9 @@ ****************************************************************************/ #include "CCActionInstant.h" -#include "base_nodes/CCNode.h" -#include "sprite_nodes/CCSprite.h" -#include "script_support/CCScriptSupport.h" +#include "CCNode.h" +#include "CCSprite.h" +#include "CCScriptSupport.h" #if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) #pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/cocos/2d/actions/CCActionInstant.h b/cocos/2d/CCActionInstant.h similarity index 100% rename from cocos/2d/actions/CCActionInstant.h rename to cocos/2d/CCActionInstant.h diff --git a/cocos/2d/actions/CCActionInterval.cpp b/cocos/2d/CCActionInterval.cpp similarity index 99% rename from cocos/2d/actions/CCActionInterval.cpp rename to cocos/2d/CCActionInterval.cpp index d5a9d88704..0fe7e055b9 100644 --- a/cocos/2d/actions/CCActionInterval.cpp +++ b/cocos/2d/CCActionInterval.cpp @@ -25,8 +25,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionInterval.h" -#include "sprite_nodes/CCSprite.h" -#include "base_nodes/CCNode.h" +#include "CCSprite.h" +#include "CCNode.h" #include "CCStdC.h" #include "CCActionInstant.h" #include diff --git a/cocos/2d/actions/CCActionInterval.h b/cocos/2d/CCActionInterval.h similarity index 99% rename from cocos/2d/actions/CCActionInterval.h rename to cocos/2d/CCActionInterval.h index 6e3a5371e0..270dca3414 100644 --- a/cocos/2d/actions/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -27,11 +27,11 @@ THE SOFTWARE. #ifndef __ACTION_CCINTERVAL_ACTION_H__ #define __ACTION_CCINTERVAL_ACTION_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCAction.h" #include "CCProtocols.h" -#include "sprite_nodes/CCSpriteFrame.h" -#include "sprite_nodes/CCAnimation.h" +#include "CCSpriteFrame.h" +#include "CCAnimation.h" #include NS_CC_BEGIN diff --git a/cocos/2d/actions/CCActionManager.cpp b/cocos/2d/CCActionManager.cpp similarity index 98% rename from cocos/2d/actions/CCActionManager.cpp rename to cocos/2d/CCActionManager.cpp index ba964f73a2..9d1fb1ee93 100644 --- a/cocos/2d/actions/CCActionManager.cpp +++ b/cocos/2d/CCActionManager.cpp @@ -26,12 +26,12 @@ THE SOFTWARE. ****************************************************************************/ #include "CCActionManager.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCScheduler.h" #include "ccMacros.h" -#include "support/data_support/ccCArray.h" -#include "support/data_support/uthash.h" -#include "cocoa/CCSet.h" +#include "ccCArray.h" +#include "uthash.h" +#include "CCSet.h" NS_CC_BEGIN // diff --git a/cocos/2d/actions/CCActionManager.h b/cocos/2d/CCActionManager.h similarity index 98% rename from cocos/2d/actions/CCActionManager.h rename to cocos/2d/CCActionManager.h index 6b20f0e806..72427a5648 100644 --- a/cocos/2d/actions/CCActionManager.h +++ b/cocos/2d/CCActionManager.h @@ -29,8 +29,8 @@ THE SOFTWARE. #define __ACTION_CCACTION_MANAGER_H__ #include "CCAction.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCObject.h" +#include "CCArray.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/2d/actions/CCActionPageTurn3D.cpp b/cocos/2d/CCActionPageTurn3D.cpp similarity index 100% rename from cocos/2d/actions/CCActionPageTurn3D.cpp rename to cocos/2d/CCActionPageTurn3D.cpp diff --git a/cocos/2d/actions/CCActionPageTurn3D.h b/cocos/2d/CCActionPageTurn3D.h similarity index 100% rename from cocos/2d/actions/CCActionPageTurn3D.h rename to cocos/2d/CCActionPageTurn3D.h diff --git a/cocos/2d/actions/CCActionProgressTimer.cpp b/cocos/2d/CCActionProgressTimer.cpp similarity index 98% rename from cocos/2d/actions/CCActionProgressTimer.cpp rename to cocos/2d/CCActionProgressTimer.cpp index 4fa9de2f31..cf9e11f436 100644 --- a/cocos/2d/actions/CCActionProgressTimer.cpp +++ b/cocos/2d/CCActionProgressTimer.cpp @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCActionProgressTimer.h" -#include "misc_nodes/CCProgressTimer.h" +#include "CCProgressTimer.h" NS_CC_BEGIN diff --git a/cocos/2d/actions/CCActionProgressTimer.h b/cocos/2d/CCActionProgressTimer.h similarity index 100% rename from cocos/2d/actions/CCActionProgressTimer.h rename to cocos/2d/CCActionProgressTimer.h diff --git a/cocos/2d/actions/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp similarity index 99% rename from cocos/2d/actions/CCActionTiledGrid.cpp rename to cocos/2d/CCActionTiledGrid.cpp index 63ccb223f4..269a798b1d 100644 --- a/cocos/2d/actions/CCActionTiledGrid.cpp +++ b/cocos/2d/CCActionTiledGrid.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include "CCActionTiledGrid.h" #include "CCDirector.h" #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include NS_CC_BEGIN diff --git a/cocos/2d/actions/CCActionTiledGrid.h b/cocos/2d/CCActionTiledGrid.h similarity index 100% rename from cocos/2d/actions/CCActionTiledGrid.h rename to cocos/2d/CCActionTiledGrid.h diff --git a/cocos/2d/actions/CCActionTween.cpp b/cocos/2d/CCActionTween.cpp similarity index 100% rename from cocos/2d/actions/CCActionTween.cpp rename to cocos/2d/CCActionTween.cpp diff --git a/cocos/2d/actions/CCActionTween.h b/cocos/2d/CCActionTween.h similarity index 100% rename from cocos/2d/actions/CCActionTween.h rename to cocos/2d/CCActionTween.h diff --git a/cocos/2d/sprite-nodes/CCAnimation.cpp b/cocos/2d/CCAnimation.cpp similarity index 97% rename from cocos/2d/sprite-nodes/CCAnimation.cpp rename to cocos/2d/CCAnimation.cpp index 65f88953aa..5fa37cd85c 100644 --- a/cocos/2d/sprite-nodes/CCAnimation.cpp +++ b/cocos/2d/CCAnimation.cpp @@ -24,10 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCAnimation.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTexture2D.h" +#include "CCTextureCache.h" +#include "CCTexture2D.h" #include "ccMacros.h" -#include "sprite_nodes/CCSpriteFrame.h" +#include "CCSpriteFrame.h" NS_CC_BEGIN diff --git a/cocos/2d/sprite-nodes/CCAnimation.h b/cocos/2d/CCAnimation.h similarity index 98% rename from cocos/2d/sprite-nodes/CCAnimation.h rename to cocos/2d/CCAnimation.h index 24799355c4..cc38ca6d84 100644 --- a/cocos/2d/sprite-nodes/CCAnimation.h +++ b/cocos/2d/CCAnimation.h @@ -26,11 +26,11 @@ THE SOFTWARE. #ifndef __CC_ANIMATION_H__ #define __CC_ANIMATION_H__ -#include "platform/CCPlatformConfig.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformConfig.h" +#include "CCObject.h" +#include "CCArray.h" +#include "CCDictionary.h" +#include "CCGeometry.h" #include "CCSpriteFrame.h" #include diff --git a/cocos/2d/sprite-nodes/CCAnimationCache.cpp b/cocos/2d/CCAnimationCache.cpp similarity index 99% rename from cocos/2d/sprite-nodes/CCAnimationCache.cpp rename to cocos/2d/CCAnimationCache.cpp index 4c36fa0231..37f516347a 100644 --- a/cocos/2d/sprite-nodes/CCAnimationCache.cpp +++ b/cocos/2d/CCAnimationCache.cpp @@ -28,7 +28,7 @@ THE SOFTWARE. #include "CCAnimation.h" #include "CCSpriteFrame.h" #include "CCSpriteFrameCache.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "platform/CCFileUtils.h" using namespace std; diff --git a/cocos/2d/sprite-nodes/CCAnimationCache.h b/cocos/2d/CCAnimationCache.h similarity index 98% rename from cocos/2d/sprite-nodes/CCAnimationCache.h rename to cocos/2d/CCAnimationCache.h index 8fc0b62f6a..f30d6ee94f 100644 --- a/cocos/2d/sprite-nodes/CCAnimationCache.h +++ b/cocos/2d/CCAnimationCache.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CC_ANIMATION_CACHE_H__ #define __CC_ANIMATION_CACHE_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCDictionary.h" +#include "CCObject.h" +#include "CCDictionary.h" #include diff --git a/cocos/2d/base-nodes/CCAtlasNode.cpp b/cocos/2d/CCAtlasNode.cpp similarity index 96% rename from cocos/2d/base-nodes/CCAtlasNode.cpp rename to cocos/2d/CCAtlasNode.cpp index 02338220f8..7d5a64dba7 100644 --- a/cocos/2d/base-nodes/CCAtlasNode.cpp +++ b/cocos/2d/CCAtlasNode.cpp @@ -25,14 +25,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCAtlasNode.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/base-nodes/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h similarity index 100% rename from cocos/2d/base-nodes/CCAtlasNode.h rename to cocos/2d/CCAtlasNode.h diff --git a/cocos/2d/CCCamera.cpp b/cocos/2d/CCCamera.cpp index 2d97fe2678..36487c88fc 100644 --- a/cocos/2d/CCCamera.cpp +++ b/cocos/2d/CCCamera.cpp @@ -24,10 +24,10 @@ THE SOFTWARE. ****************************************************************************/ #include "CCCamera.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "CCGL.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCDrawingPrimitives.h" #include "CCDirector.h" #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/CCCamera.h b/cocos/2d/CCCamera.h index 9e8f0d1d49..cb99787855 100644 --- a/cocos/2d/CCCamera.h +++ b/cocos/2d/CCCamera.h @@ -29,7 +29,7 @@ THE SOFTWARE. #include -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" #include "kazmath/mat4.h" diff --git a/cocos/2d/misc-nodes/CCClippingNode.cpp b/cocos/2d/CCClippingNode.cpp similarity index 99% rename from cocos/2d/misc-nodes/CCClippingNode.cpp rename to cocos/2d/CCClippingNode.cpp index 7b797617cb..d51fcc5002 100644 --- a/cocos/2d/misc-nodes/CCClippingNode.cpp +++ b/cocos/2d/CCClippingNode.cpp @@ -27,10 +27,10 @@ #include "CCClippingNode.h" #include "kazmath/GL/matrix.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "CCDirector.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCDrawingPrimitives.h" NS_CC_BEGIN diff --git a/cocos/2d/misc-nodes/CCClippingNode.h b/cocos/2d/CCClippingNode.h similarity index 99% rename from cocos/2d/misc-nodes/CCClippingNode.h rename to cocos/2d/CCClippingNode.h index 3ad7f1f944..ca2a17b8d7 100644 --- a/cocos/2d/misc-nodes/CCClippingNode.h +++ b/cocos/2d/CCClippingNode.h @@ -28,7 +28,7 @@ #ifndef __MISCNODE_CCCLIPPING_NODE_H__ #define __MISCNODE_CCCLIPPING_NODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/2d/support/component/CCComponent.cpp b/cocos/2d/CCComponent.cpp similarity index 98% rename from cocos/2d/support/component/CCComponent.cpp rename to cocos/2d/CCComponent.cpp index e0bfd75031..b073051e06 100644 --- a/cocos/2d/support/component/CCComponent.cpp +++ b/cocos/2d/CCComponent.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "support/component/CCComponent.h" +#include "CCComponent.h" NS_CC_BEGIN diff --git a/cocos/2d/support/component/CCComponent.h b/cocos/2d/CCComponent.h similarity index 98% rename from cocos/2d/support/component/CCComponent.h rename to cocos/2d/CCComponent.h index e658d10eee..58023fe9fb 100644 --- a/cocos/2d/support/component/CCComponent.h +++ b/cocos/2d/CCComponent.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMPONENT_H__ #define __CC_FRAMEWORK_COMPONENT_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include NS_CC_BEGIN diff --git a/cocos/2d/support/component/CCComponentContainer.cpp b/cocos/2d/CCComponentContainer.cpp similarity index 97% rename from cocos/2d/support/component/CCComponentContainer.cpp rename to cocos/2d/CCComponentContainer.cpp index ea0fc99d3b..b0f5bc3fd9 100644 --- a/cocos/2d/support/component/CCComponentContainer.cpp +++ b/cocos/2d/CCComponentContainer.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ -#include "support/component/CCComponentContainer.h" -#include "support/component/CCComponent.h" +#include "CCComponentContainer.h" +#include "CCComponent.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/support/component/CCComponentContainer.h b/cocos/2d/CCComponentContainer.h similarity index 98% rename from cocos/2d/support/component/CCComponentContainer.h rename to cocos/2d/CCComponentContainer.h index 2125e2d28a..57622a7d1b 100644 --- a/cocos/2d/support/component/CCComponentContainer.h +++ b/cocos/2d/CCComponentContainer.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_FRAMEWORK_COMCONTAINER_H__ #define __CC_FRAMEWORK_COMCONTAINER_H__ -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/CCConfiguration.cpp b/cocos/2d/CCConfiguration.cpp index cf88679366..6e5b5cf966 100644 --- a/cocos/2d/CCConfiguration.cpp +++ b/cocos/2d/CCConfiguration.cpp @@ -27,9 +27,9 @@ THE SOFTWARE. #include #include "ccMacros.h" #include "ccConfig.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCInteger.h" -#include "cocoa/CCBool.h" +#include "CCDictionary.h" +#include "CCInteger.h" +#include "CCBool.h" #include "cocos2d.h" #include "platform/CCFileUtils.h" diff --git a/cocos/2d/CCConfiguration.h b/cocos/2d/CCConfiguration.h index 2b2a4f98ee..eb78275ef9 100644 --- a/cocos/2d/CCConfiguration.h +++ b/cocos/2d/CCConfiguration.h @@ -26,9 +26,9 @@ THE SOFTWARE. #ifndef __CCCONFIGURATION_H__ #define __CCCONFIGURATION_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include diff --git a/cocos/2d/include/CCDeprecated.h b/cocos/2d/CCDeprecated.h similarity index 99% rename from cocos/2d/include/CCDeprecated.h rename to cocos/2d/CCDeprecated.h index 0e201a9668..323be9f642 100644 --- a/cocos/2d/include/CCDeprecated.h +++ b/cocos/2d/CCDeprecated.h @@ -29,7 +29,7 @@ #define __COCOS2D_CCDEPRECATED_H__ #include -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index 3046957708..8d1d8cb5df 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -31,31 +31,31 @@ THE SOFTWARE. #include #include "ccFPSImages.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "cocoa/CCNS.h" -#include "layers_scenes_transitions_nodes/CCScene.h" -#include "cocoa/CCArray.h" +#include "CCDrawingPrimitives.h" +#include "CCNS.h" +#include "CCScene.h" +#include "CCArray.h" #include "CCScheduler.h" #include "ccMacros.h" -#include "support/CCNotificationCenter.h" -#include "layers_scenes_transitions_nodes/CCTransition.h" -#include "textures/CCTextureCache.h" -#include "sprite_nodes/CCSpriteFrameCache.h" -#include "cocoa/CCAutoreleasePool.h" +#include "CCNotificationCenter.h" +#include "CCTransition.h" +#include "CCTextureCache.h" +#include "CCSpriteFrameCache.h" +#include "CCAutoreleasePool.h" #include "platform/CCFileUtils.h" #include "CCApplication.h" -#include "label_nodes/CCLabelBMFont.h" -#include "label_nodes/CCLabelAtlas.h" -#include "actions/CCActionManager.h" -#include "sprite_nodes/CCAnimationCache.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "support/user_default/CCUserDefault.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" +#include "CCLabelBMFont.h" +#include "CCLabelAtlas.h" +#include "CCActionManager.h" +#include "CCAnimationCache.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCUserDefault.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" #include "kazmath/kazmath.h" #include "kazmath/GL/matrix.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" #include "platform/CCImage.h" #include "CCEGLView.h" #include "CCConfiguration.h" diff --git a/cocos/2d/CCDirector.h b/cocos/2d/CCDirector.h index 9cc20393ea..4da35a96a8 100644 --- a/cocos/2d/CCDirector.h +++ b/cocos/2d/CCDirector.h @@ -27,15 +27,15 @@ THE SOFTWARE. #ifndef __CCDIRECTOR_H__ #define __CCDIRECTOR_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccTypes.h" -#include "cocoa/CCGeometry.h" -#include "cocoa/CCArray.h" +#include "CCGeometry.h" +#include "CCArray.h" #include "CCGL.h" #include "kazmath/mat4.h" -#include "label_nodes/CCLabelAtlas.h" +#include "CCLabelAtlas.h" NS_CC_BEGIN diff --git a/cocos/2d/draw-nodes/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp similarity index 99% rename from cocos/2d/draw-nodes/CCDrawNode.cpp rename to cocos/2d/CCDrawNode.cpp index 541bd8974c..3623266864 100644 --- a/cocos/2d/draw-nodes/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -21,9 +21,9 @@ */ #include "CCDrawNode.h" -#include "shaders/CCShaderCache.h" +#include "CCShaderCache.h" #include "CCGL.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" NS_CC_BEGIN diff --git a/cocos/2d/draw-nodes/CCDrawNode.h b/cocos/2d/CCDrawNode.h similarity index 99% rename from cocos/2d/draw-nodes/CCDrawNode.h rename to cocos/2d/CCDrawNode.h index 9349430880..3e128d26ea 100644 --- a/cocos/2d/draw-nodes/CCDrawNode.h +++ b/cocos/2d/CCDrawNode.h @@ -30,7 +30,7 @@ #ifndef __CCDRAWNODES_CCDRAW_NODE_H__ #define __CCDRAWNODES_CCDRAW_NODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/draw-nodes/CCDrawingPrimitives.cpp b/cocos/2d/CCDrawingPrimitives.cpp similarity index 99% rename from cocos/2d/draw-nodes/CCDrawingPrimitives.cpp rename to cocos/2d/CCDrawingPrimitives.cpp index 632ca57ea8..4e22032e21 100644 --- a/cocos/2d/draw-nodes/CCDrawingPrimitives.cpp +++ b/cocos/2d/CCDrawingPrimitives.cpp @@ -40,10 +40,10 @@ THE SOFTWARE. #include "ccMacros.h" #include "CCGL.h" #include "CCDirector.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "actions/CCActionCatmullRom.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCActionCatmullRom.h" #include #include diff --git a/cocos/2d/draw-nodes/CCDrawingPrimitives.h b/cocos/2d/CCDrawingPrimitives.h similarity index 99% rename from cocos/2d/draw-nodes/CCDrawingPrimitives.h rename to cocos/2d/CCDrawingPrimitives.h index ba4f2c1955..c46c88a0ad 100644 --- a/cocos/2d/draw-nodes/CCDrawingPrimitives.h +++ b/cocos/2d/CCDrawingPrimitives.h @@ -42,7 +42,7 @@ THE SOFTWARE. #include "ccTypes.h" #include "ccMacros.h" -#include "cocoa/CCGeometry.h" // for Point +#include "CCGeometry.h" // for Point /** @file diff --git a/cocos/2d/event-dispatcher/CCEvent.cpp b/cocos/2d/CCEvent.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEvent.cpp rename to cocos/2d/CCEvent.cpp diff --git a/cocos/2d/event-dispatcher/CCEvent.h b/cocos/2d/CCEvent.h similarity index 98% rename from cocos/2d/event-dispatcher/CCEvent.h rename to cocos/2d/CCEvent.h index dd7e36a47a..1652066fd3 100644 --- a/cocos/2d/event-dispatcher/CCEvent.h +++ b/cocos/2d/CCEvent.h @@ -29,7 +29,7 @@ #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/event-dispatcher/CCEventAcceleration.cpp b/cocos/2d/CCEventAcceleration.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventAcceleration.cpp rename to cocos/2d/CCEventAcceleration.cpp diff --git a/cocos/2d/event-dispatcher/CCEventAcceleration.h b/cocos/2d/CCEventAcceleration.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventAcceleration.h rename to cocos/2d/CCEventAcceleration.h diff --git a/cocos/2d/event-dispatcher/CCEventCustom.cpp b/cocos/2d/CCEventCustom.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventCustom.cpp rename to cocos/2d/CCEventCustom.cpp diff --git a/cocos/2d/event-dispatcher/CCEventCustom.h b/cocos/2d/CCEventCustom.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventCustom.h rename to cocos/2d/CCEventCustom.h diff --git a/cocos/2d/event-dispatcher/CCEventDispatcher.cpp b/cocos/2d/CCEventDispatcher.cpp similarity index 99% rename from cocos/2d/event-dispatcher/CCEventDispatcher.cpp rename to cocos/2d/CCEventDispatcher.cpp index 468db2f39b..14be190f68 100644 --- a/cocos/2d/event-dispatcher/CCEventDispatcher.cpp +++ b/cocos/2d/CCEventDispatcher.cpp @@ -25,7 +25,7 @@ #include "CCEvent.h" #include "CCEventTouch.h" #include "CCEventListenerTouch.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCDirector.h" #include diff --git a/cocos/2d/event-dispatcher/CCEventDispatcher.h b/cocos/2d/CCEventDispatcher.h similarity index 99% rename from cocos/2d/event-dispatcher/CCEventDispatcher.h rename to cocos/2d/CCEventDispatcher.h index 2fdd0ae24e..06b6e430c7 100644 --- a/cocos/2d/event-dispatcher/CCEventDispatcher.h +++ b/cocos/2d/CCEventDispatcher.h @@ -25,7 +25,7 @@ #ifndef __CC_EVENT_DISPATCHER_H__ #define __CC_EVENT_DISPATCHER_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCEventListener.h" #include diff --git a/cocos/2d/event-dispatcher/CCEventKeyboard.cpp b/cocos/2d/CCEventKeyboard.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventKeyboard.cpp rename to cocos/2d/CCEventKeyboard.cpp diff --git a/cocos/2d/event-dispatcher/CCEventKeyboard.h b/cocos/2d/CCEventKeyboard.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventKeyboard.h rename to cocos/2d/CCEventKeyboard.h diff --git a/cocos/2d/event-dispatcher/CCEventListener.cpp b/cocos/2d/CCEventListener.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListener.cpp rename to cocos/2d/CCEventListener.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListener.h b/cocos/2d/CCEventListener.h similarity index 97% rename from cocos/2d/event-dispatcher/CCEventListener.h rename to cocos/2d/CCEventListener.h index 156d644f17..82c47445e0 100644 --- a/cocos/2d/event-dispatcher/CCEventListener.h +++ b/cocos/2d/CCEventListener.h @@ -25,8 +25,8 @@ #ifndef cocos2d_libs_EventListener_h #define cocos2d_libs_EventListener_h -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCPlatformMacros.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp b/cocos/2d/CCEventListenerAcceleration.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerAcceleration.cpp rename to cocos/2d/CCEventListenerAcceleration.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerAcceleration.h b/cocos/2d/CCEventListenerAcceleration.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerAcceleration.h rename to cocos/2d/CCEventListenerAcceleration.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerCustom.cpp b/cocos/2d/CCEventListenerCustom.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerCustom.cpp rename to cocos/2d/CCEventListenerCustom.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerCustom.h b/cocos/2d/CCEventListenerCustom.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerCustom.h rename to cocos/2d/CCEventListenerCustom.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp b/cocos/2d/CCEventListenerKeyboard.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerKeyboard.cpp rename to cocos/2d/CCEventListenerKeyboard.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerKeyboard.h b/cocos/2d/CCEventListenerKeyboard.h similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerKeyboard.h rename to cocos/2d/CCEventListenerKeyboard.h diff --git a/cocos/2d/event-dispatcher/CCEventListenerTouch.cpp b/cocos/2d/CCEventListenerTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventListenerTouch.cpp rename to cocos/2d/CCEventListenerTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCEventListenerTouch.h b/cocos/2d/CCEventListenerTouch.h similarity index 98% rename from cocos/2d/event-dispatcher/CCEventListenerTouch.h rename to cocos/2d/CCEventListenerTouch.h index 62cd4c3e6d..3002676bda 100644 --- a/cocos/2d/event-dispatcher/CCEventListenerTouch.h +++ b/cocos/2d/CCEventListenerTouch.h @@ -27,7 +27,7 @@ #define __cocos2d_libs__CCTouchEventListener__ #include "CCEventListener.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include diff --git a/cocos/2d/event-dispatcher/CCEventTouch.cpp b/cocos/2d/CCEventTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCEventTouch.cpp rename to cocos/2d/CCEventTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCEventTouch.h b/cocos/2d/CCEventTouch.h similarity index 98% rename from cocos/2d/event-dispatcher/CCEventTouch.h rename to cocos/2d/CCEventTouch.h index a005073173..3d54cecea7 100644 --- a/cocos/2d/event-dispatcher/CCEventTouch.h +++ b/cocos/2d/CCEventTouch.h @@ -26,7 +26,7 @@ #define __cocos2d_libs__TouchEvent__ #include "CCEvent.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include NS_CC_BEGIN diff --git a/cocos/2d/include/CCEventType.h b/cocos/2d/CCEventType.h similarity index 100% rename from cocos/2d/include/CCEventType.h rename to cocos/2d/CCEventType.h diff --git a/cocos/2d/label-nodes/CCFont.cpp b/cocos/2d/CCFont.cpp similarity index 99% rename from cocos/2d/label-nodes/CCFont.cpp rename to cocos/2d/CCFont.cpp index 7274ddcaf9..63fe7af7d1 100644 --- a/cocos/2d/label-nodes/CCFont.cpp +++ b/cocos/2d/CCFont.cpp @@ -23,7 +23,7 @@ ****************************************************************************/ #include "CCFont.h" -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCFontFNT.h" #include "CCFontFreeType.h" diff --git a/cocos/2d/label-nodes/CCFont.h b/cocos/2d/CCFont.h similarity index 100% rename from cocos/2d/label-nodes/CCFont.h rename to cocos/2d/CCFont.h diff --git a/cocos/2d/label-nodes/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlas.cpp rename to cocos/2d/CCFontAtlas.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlas.h rename to cocos/2d/CCFontAtlas.h diff --git a/cocos/2d/label-nodes/CCFontAtlasCache.cpp b/cocos/2d/CCFontAtlasCache.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasCache.cpp rename to cocos/2d/CCFontAtlasCache.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlasCache.h b/cocos/2d/CCFontAtlasCache.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasCache.h rename to cocos/2d/CCFontAtlasCache.h diff --git a/cocos/2d/label-nodes/CCFontAtlasFactory.cpp b/cocos/2d/CCFontAtlasFactory.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasFactory.cpp rename to cocos/2d/CCFontAtlasFactory.cpp diff --git a/cocos/2d/label-nodes/CCFontAtlasFactory.h b/cocos/2d/CCFontAtlasFactory.h similarity index 100% rename from cocos/2d/label-nodes/CCFontAtlasFactory.h rename to cocos/2d/CCFontAtlasFactory.h diff --git a/cocos/2d/label-nodes/CCFontDefinition.cpp b/cocos/2d/CCFontDefinition.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontDefinition.cpp rename to cocos/2d/CCFontDefinition.cpp diff --git a/cocos/2d/label-nodes/CCFontDefinition.h b/cocos/2d/CCFontDefinition.h similarity index 100% rename from cocos/2d/label-nodes/CCFontDefinition.h rename to cocos/2d/CCFontDefinition.h diff --git a/cocos/2d/label-nodes/CCFontFNT.cpp b/cocos/2d/CCFontFNT.cpp similarity index 100% rename from cocos/2d/label-nodes/CCFontFNT.cpp rename to cocos/2d/CCFontFNT.cpp diff --git a/cocos/2d/label-nodes/CCFontFNT.h b/cocos/2d/CCFontFNT.h similarity index 100% rename from cocos/2d/label-nodes/CCFontFNT.h rename to cocos/2d/CCFontFNT.h diff --git a/cocos/2d/label-nodes/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp similarity index 99% rename from cocos/2d/label-nodes/CCFontFreeType.cpp rename to cocos/2d/CCFontFreeType.cpp index 33157aab88..c0522f522b 100644 --- a/cocos/2d/label-nodes/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -24,7 +24,7 @@ #include -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCFontFreeType.h" #include "CCTextImage.h" #include "CCFont.h" diff --git a/cocos/2d/label-nodes/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h similarity index 100% rename from cocos/2d/label-nodes/CCFontFreeType.h rename to cocos/2d/CCFontFreeType.h diff --git a/cocos/2d/base-nodes/CCGLBufferedNode.cpp b/cocos/2d/CCGLBufferedNode.cpp similarity index 100% rename from cocos/2d/base-nodes/CCGLBufferedNode.cpp rename to cocos/2d/CCGLBufferedNode.cpp diff --git a/cocos/2d/base-nodes/CCGLBufferedNode.h b/cocos/2d/CCGLBufferedNode.h similarity index 100% rename from cocos/2d/base-nodes/CCGLBufferedNode.h rename to cocos/2d/CCGLBufferedNode.h diff --git a/cocos/2d/shaders/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp similarity index 99% rename from cocos/2d/shaders/CCGLProgram.cpp rename to cocos/2d/CCGLProgram.cpp index 85fdbfe029..83da8f9bdc 100644 --- a/cocos/2d/shaders/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -30,8 +30,8 @@ THE SOFTWARE. #include "ccGLStateCache.h" #include "ccMacros.h" #include "platform/CCFileUtils.h" -#include "support/data_support/uthash.h" -#include "cocoa/CCString.h" +#include "uthash.h" +#include "CCString.h" // extern #include "kazmath/GL/matrix.h" #include "kazmath/kazmath.h" diff --git a/cocos/2d/shaders/CCGLProgram.h b/cocos/2d/CCGLProgram.h similarity index 99% rename from cocos/2d/shaders/CCGLProgram.h rename to cocos/2d/CCGLProgram.h index 8174f7632a..cea1add0b2 100644 --- a/cocos/2d/shaders/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -29,7 +29,7 @@ THE SOFTWARE. #define __CCGLPROGRAM_H__ #include "ccMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" diff --git a/cocos/2d/effects/CCGrabber.cpp b/cocos/2d/CCGrabber.cpp similarity index 98% rename from cocos/2d/effects/CCGrabber.cpp rename to cocos/2d/CCGrabber.cpp index ad07a7e99e..4486e58712 100644 --- a/cocos/2d/effects/CCGrabber.cpp +++ b/cocos/2d/CCGrabber.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCGrabber.h" #include "ccMacros.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/2d/effects/CCGrabber.h b/cocos/2d/CCGrabber.h similarity index 98% rename from cocos/2d/effects/CCGrabber.h rename to cocos/2d/CCGrabber.h index 8556101703..9fef542459 100644 --- a/cocos/2d/effects/CCGrabber.h +++ b/cocos/2d/CCGrabber.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __EFFECTS_CCGRABBER_H__ #include "CCConfiguration.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCGL.h" NS_CC_BEGIN diff --git a/cocos/2d/effects/CCGrid.cpp b/cocos/2d/CCGrid.cpp similarity index 98% rename from cocos/2d/effects/CCGrid.cpp rename to cocos/2d/CCGrid.cpp index 04da5fa6b7..fc2152ab13 100644 --- a/cocos/2d/effects/CCGrid.cpp +++ b/cocos/2d/CCGrid.cpp @@ -23,15 +23,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCDirector.h" -#include "effects/CCGrabber.h" -#include "support/ccUtils.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCGrabber.h" +#include "ccUtils.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCGL.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" #include "kazmath/kazmath.h" #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/effects/CCGrid.h b/cocos/2d/CCGrid.h similarity index 97% rename from cocos/2d/effects/CCGrid.h rename to cocos/2d/CCGrid.h index 7d91fbf620..97904cdf3e 100644 --- a/cocos/2d/effects/CCGrid.h +++ b/cocos/2d/CCGrid.h @@ -25,15 +25,15 @@ THE SOFTWARE. #ifndef __EFFECTS_CCGRID_H__ #define __EFFECTS_CCGRID_H__ -#include "cocoa/CCObject.h" -#include "base_nodes/CCNode.h" +#include "CCObject.h" +#include "CCNode.h" #include "CCCamera.h" #include "ccTypes.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include "CCDirector.h" #include "kazmath/mat4.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/text-input-node/CCIMEDelegate.h b/cocos/2d/CCIMEDelegate.h similarity index 99% rename from cocos/2d/text-input-node/CCIMEDelegate.h rename to cocos/2d/CCIMEDelegate.h index 3ab7387af5..d7fee2e59b 100644 --- a/cocos/2d/text-input-node/CCIMEDelegate.h +++ b/cocos/2d/CCIMEDelegate.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_IME_DELEGATE_H__ #define __CC_IME_DELEGATE_H__ -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/text-input-node/CCIMEDispatcher.cpp b/cocos/2d/CCIMEDispatcher.cpp similarity index 100% rename from cocos/2d/text-input-node/CCIMEDispatcher.cpp rename to cocos/2d/CCIMEDispatcher.cpp diff --git a/cocos/2d/text-input-node/CCIMEDispatcher.h b/cocos/2d/CCIMEDispatcher.h similarity index 100% rename from cocos/2d/text-input-node/CCIMEDispatcher.h rename to cocos/2d/CCIMEDispatcher.h diff --git a/cocos/2d/label-nodes/CCLabel.cpp b/cocos/2d/CCLabel.cpp similarity index 100% rename from cocos/2d/label-nodes/CCLabel.cpp rename to cocos/2d/CCLabel.cpp diff --git a/cocos/2d/label-nodes/CCLabel.h b/cocos/2d/CCLabel.h similarity index 99% rename from cocos/2d/label-nodes/CCLabel.h rename to cocos/2d/CCLabel.h index 65688258db..e65c27eb7b 100644 --- a/cocos/2d/label-nodes/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -26,7 +26,7 @@ #ifndef _COCOS2D_CCLABEL_H_ #define _COCOS2D_CCLABEL_H_ -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCSpriteBatchNode.h" #include "CCLabelTextFormatProtocol.h" #include "ccTypes.h" diff --git a/cocos/2d/label-nodes/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp similarity index 96% rename from cocos/2d/label-nodes/CCLabelAtlas.cpp rename to cocos/2d/CCLabelAtlas.cpp index 9c659d91cc..e96df277b5 100644 --- a/cocos/2d/label-nodes/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -24,16 +24,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCLabelAtlas.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" +#include "CCDrawingPrimitives.h" #include "ccConfig.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "cocoa/CCInteger.h" +#include "TransformUtils.h" +#include "CCInteger.h" #include "platform/CCFileUtils.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/label-nodes/CCLabelAtlas.h b/cocos/2d/CCLabelAtlas.h similarity index 99% rename from cocos/2d/label-nodes/CCLabelAtlas.h rename to cocos/2d/CCLabelAtlas.h index 4ec488203a..2c7d98ea5b 100644 --- a/cocos/2d/label-nodes/CCLabelAtlas.h +++ b/cocos/2d/CCLabelAtlas.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCLABEL_ATLAS_H__ #define __CCLABEL_ATLAS_H__ -#include "base_nodes/CCAtlasNode.h" +#include "CCAtlasNode.h" NS_CC_BEGIN diff --git a/cocos/2d/label-nodes/CCLabelBMFont.cpp b/cocos/2d/CCLabelBMFont.cpp similarity index 99% rename from cocos/2d/label-nodes/CCLabelBMFont.cpp rename to cocos/2d/CCLabelBMFont.cpp index 863f6d947e..601187d619 100644 --- a/cocos/2d/label-nodes/CCLabelBMFont.cpp +++ b/cocos/2d/CCLabelBMFont.cpp @@ -31,15 +31,15 @@ http://www.angelcode.com/products/bmfont/ (Free, Windows only) ****************************************************************************/ #include "CCLabelBMFont.h" -#include "cocoa/CCString.h" -#include "cocoa/CCDictionary.h" +#include "CCString.h" +#include "CCDictionary.h" #include "CCConfiguration.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "sprite_nodes/CCSprite.h" +#include "CCDrawingPrimitives.h" +#include "CCSprite.h" #include "platform/CCFileUtils.h" #include "CCDirector.h" -#include "textures/CCTextureCache.h" -#include "support/ccUTF8.h" +#include "CCTextureCache.h" +#include "ccUTF8.h" using namespace std; diff --git a/cocos/2d/label-nodes/CCLabelBMFont.h b/cocos/2d/CCLabelBMFont.h similarity index 99% rename from cocos/2d/label-nodes/CCLabelBMFont.h rename to cocos/2d/CCLabelBMFont.h index bd218b65a2..11ff078ac5 100644 --- a/cocos/2d/label-nodes/CCLabelBMFont.h +++ b/cocos/2d/CCLabelBMFont.h @@ -33,8 +33,8 @@ Use any of these editors to generate BMFonts: #ifndef __CCBITMAP_FONT_ATLAS_H__ #define __CCBITMAP_FONT_ATLAS_H__ -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "support/data_support/uthash.h" +#include "CCSpriteBatchNode.h" +#include "uthash.h" #include #include #include diff --git a/cocos/2d/label-nodes/CCLabelTTF.cpp b/cocos/2d/CCLabelTTF.cpp similarity index 99% rename from cocos/2d/label-nodes/CCLabelTTF.cpp rename to cocos/2d/CCLabelTTF.cpp index 91dba16fe6..bead3ea020 100644 --- a/cocos/2d/label-nodes/CCLabelTTF.cpp +++ b/cocos/2d/CCLabelTTF.cpp @@ -24,8 +24,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCLabelTTF.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "CCApplication.h" NS_CC_BEGIN diff --git a/cocos/2d/label-nodes/CCLabelTTF.h b/cocos/2d/CCLabelTTF.h similarity index 99% rename from cocos/2d/label-nodes/CCLabelTTF.h rename to cocos/2d/CCLabelTTF.h index acdd67017c..9243a50e1c 100644 --- a/cocos/2d/label-nodes/CCLabelTTF.h +++ b/cocos/2d/CCLabelTTF.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCLABELTTF_H__ #define __CCLABELTTF_H__ -#include "sprite_nodes/CCSprite.h" -#include "textures/CCTexture2D.h" +#include "CCSprite.h" +#include "CCTexture2D.h" NS_CC_BEGIN diff --git a/cocos/2d/label-nodes/CCLabelTextFormatProtocol.h b/cocos/2d/CCLabelTextFormatProtocol.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelTextFormatProtocol.h rename to cocos/2d/CCLabelTextFormatProtocol.h diff --git a/cocos/2d/label-nodes/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp similarity index 99% rename from cocos/2d/label-nodes/CCLabelTextFormatter.cpp rename to cocos/2d/CCLabelTextFormatter.cpp index 2a3853740a..0c674a5345 100644 --- a/cocos/2d/label-nodes/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -25,7 +25,7 @@ #include #include "cocos2d.h" -#include "support/ccUTF8.h" +#include "ccUTF8.h" #include "CCLabelTextFormatter.h" using namespace std; diff --git a/cocos/2d/label-nodes/CCLabelTextFormatter.h b/cocos/2d/CCLabelTextFormatter.h similarity index 100% rename from cocos/2d/label-nodes/CCLabelTextFormatter.h rename to cocos/2d/CCLabelTextFormatter.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp b/cocos/2d/CCLayer.cpp similarity index 98% rename from cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp rename to cocos/2d/CCLayer.cpp index 37037b456a..19346ea844 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -27,20 +27,20 @@ THE SOFTWARE. #include #include "CCLayer.h" #include "CCDirector.h" -#include "script_support/CCScriptSupport.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/TransformUtils.h" +#include "CCScriptSupport.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "TransformUtils.h" // extern #include "kazmath/GL/matrix.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "event_dispatcher/CCEventListenerKeyboard.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventListenerAcceleration.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" +#include "CCEventTouch.h" +#include "CCEventKeyboard.h" +#include "CCEventListenerKeyboard.h" +#include "CCEventAcceleration.h" +#include "CCEventListenerAcceleration.h" #include "platform/CCDevice.h" #include "CCScene.h" diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.h b/cocos/2d/CCLayer.h similarity index 98% rename from cocos/2d/layers-scenes-transitions-nodes/CCLayer.h rename to cocos/2d/CCLayer.h index 1d8f143b51..0dad16ff21 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -27,15 +27,15 @@ THE SOFTWARE. #ifndef __CCLAYER_H__ #define __CCLAYER_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN -#include "physics/CCPhysicsSetting.h" +#include "CCPhysicsSetting.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCEventKeyboard.h" NS_CC_BEGIN diff --git a/cocos/2d/menu-nodes/CCMenu.cpp b/cocos/2d/CCMenu.cpp similarity index 99% rename from cocos/2d/menu-nodes/CCMenu.cpp rename to cocos/2d/CCMenu.cpp index 48613dfb00..c0c10e9cdb 100644 --- a/cocos/2d/menu-nodes/CCMenu.cpp +++ b/cocos/2d/CCMenu.cpp @@ -25,10 +25,10 @@ THE SOFTWARE. #include "CCMenu.h" #include "CCDirector.h" #include "CCApplication.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCStdC.h" -#include "cocoa/CCInteger.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCInteger.h" +#include "CCEventListenerTouch.h" #include diff --git a/cocos/2d/menu-nodes/CCMenu.h b/cocos/2d/CCMenu.h similarity index 97% rename from cocos/2d/menu-nodes/CCMenu.h rename to cocos/2d/CCMenu.h index 92dd66f788..bd685786c4 100644 --- a/cocos/2d/menu-nodes/CCMenu.h +++ b/cocos/2d/CCMenu.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CCMENU_H_ #include "CCMenuItem.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" +#include "CCLayer.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCEventTouch.h" NS_CC_BEGIN diff --git a/cocos/2d/menu-nodes/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp similarity index 99% rename from cocos/2d/menu-nodes/CCMenuItem.cpp rename to cocos/2d/CCMenuItem.cpp index 1df5075647..c735677e9f 100644 --- a/cocos/2d/menu-nodes/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -25,11 +25,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCMenuItem.h" -#include "actions/CCActionInterval.h" -#include "sprite_nodes/CCSprite.h" -#include "label_nodes/CCLabelAtlas.h" -#include "label_nodes/CCLabelTTF.h" -#include "script_support/CCScriptSupport.h" +#include "CCActionInterval.h" +#include "CCSprite.h" +#include "CCLabelAtlas.h" +#include "CCLabelTTF.h" +#include "CCScriptSupport.h" #include #include diff --git a/cocos/2d/menu-nodes/CCMenuItem.h b/cocos/2d/CCMenuItem.h similarity index 99% rename from cocos/2d/menu-nodes/CCMenuItem.h rename to cocos/2d/CCMenuItem.h index 65e75ae28a..021832df30 100644 --- a/cocos/2d/menu-nodes/CCMenuItem.h +++ b/cocos/2d/CCMenuItem.h @@ -31,9 +31,9 @@ THE SOFTWARE. #include // cocos2d includes -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/misc-nodes/CCMotionStreak.cpp b/cocos/2d/CCMotionStreak.cpp similarity index 98% rename from cocos/2d/misc-nodes/CCMotionStreak.cpp rename to cocos/2d/CCMotionStreak.cpp index 8ef2a4124e..47cb43a207 100644 --- a/cocos/2d/misc-nodes/CCMotionStreak.cpp +++ b/cocos/2d/CCMotionStreak.cpp @@ -23,13 +23,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCMotionStreak.h" -#include "textures/CCTextureCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" +#include "CCTextureCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" #include "ccMacros.h" -#include "support/CCVertex.h" +#include "CCVertex.h" NS_CC_BEGIN diff --git a/cocos/2d/misc-nodes/CCMotionStreak.h b/cocos/2d/CCMotionStreak.h similarity index 97% rename from cocos/2d/misc-nodes/CCMotionStreak.h rename to cocos/2d/CCMotionStreak.h index 6b6535f371..c0fc986c73 100644 --- a/cocos/2d/misc-nodes/CCMotionStreak.h +++ b/cocos/2d/CCMotionStreak.h @@ -26,11 +26,11 @@ THE SOFTWARE. #define __CCMOTION_STREAK_H__ #include "CCProtocols.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include "ccTypes.h" -#include "base_nodes/CCNode.h" +#include "CCNode.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/base-nodes/CCNode.cpp b/cocos/2d/CCNode.cpp similarity index 98% rename from cocos/2d/base-nodes/CCNode.cpp rename to cocos/2d/CCNode.cpp index 4db892fdd6..5c6a47e822 100644 --- a/cocos/2d/base-nodes/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -29,29 +29,29 @@ THE SOFTWARE. #include -#include "cocoa/CCString.h" -#include "support/data_support/ccCArray.h" -#include "support/TransformUtils.h" +#include "CCString.h" +#include "ccCArray.h" +#include "TransformUtils.h" #include "CCCamera.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCDirector.h" #include "CCScheduler.h" -#include "event_dispatcher/CCTouch.h" -#include "actions/CCActionManager.h" -#include "script_support/CCScriptSupport.h" -#include "shaders/CCGLProgram.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEvent.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCTouch.h" +#include "CCActionManager.h" +#include "CCScriptSupport.h" +#include "CCGLProgram.h" +#include "CCEventDispatcher.h" +#include "CCEvent.h" +#include "CCEventTouch.h" #ifdef CC_USE_PHYSICS -#include "physics/CCPhysicsBody.h" +#include "CCPhysicsBody.h" #endif // externals #include "kazmath/GL/matrix.h" -#include "support/component/CCComponent.h" -#include "support/component/CCComponentContainer.h" +#include "CCComponent.h" +#include "CCComponentContainer.h" diff --git a/cocos/2d/base-nodes/CCNode.h b/cocos/2d/CCNode.h similarity index 99% rename from cocos/2d/base-nodes/CCNode.h rename to cocos/2d/CCNode.h index 605b178bbf..133968d19b 100644 --- a/cocos/2d/base-nodes/CCNode.h +++ b/cocos/2d/CCNode.h @@ -29,16 +29,16 @@ #define __PLATFORM_CCNODE_H__ #include "ccMacros.h" -#include "cocoa/CCAffineTransform.h" -#include "cocoa/CCArray.h" +#include "CCAffineTransform.h" +#include "CCArray.h" #include "CCGL.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" #include "kazmath/kazmath.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" #include "CCProtocols.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "physics/CCPhysicsSetting.h" +#include "CCEventDispatcher.h" +#include "CCPhysicsSetting.h" #include diff --git a/cocos/2d/support/CCNotificationCenter.cpp b/cocos/2d/CCNotificationCenter.cpp similarity index 99% rename from cocos/2d/support/CCNotificationCenter.cpp rename to cocos/2d/CCNotificationCenter.cpp index a7f19d5ff0..8b109daacc 100644 --- a/cocos/2d/support/CCNotificationCenter.cpp +++ b/cocos/2d/CCNotificationCenter.cpp @@ -23,8 +23,8 @@ THE SOFTWARE. ****************************************************************************/ #include "CCNotificationCenter.h" -#include "cocoa/CCArray.h" -#include "script_support/CCScriptSupport.h" +#include "CCArray.h" +#include "CCScriptSupport.h" #include using namespace std; diff --git a/cocos/2d/support/CCNotificationCenter.h b/cocos/2d/CCNotificationCenter.h similarity index 99% rename from cocos/2d/support/CCNotificationCenter.h rename to cocos/2d/CCNotificationCenter.h index 62587a02f7..41025bdf87 100644 --- a/cocos/2d/support/CCNotificationCenter.h +++ b/cocos/2d/CCNotificationCenter.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCNOTIFICATIONCENTER_H__ #define __CCNOTIFICATIONCENTER_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" +#include "CCObject.h" +#include "CCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp b/cocos/2d/CCParallaxNode.cpp similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp rename to cocos/2d/CCParallaxNode.cpp index 29f16ea2a4..781147b457 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.cpp +++ b/cocos/2d/CCParallaxNode.cpp @@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCParallaxNode.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h b/cocos/2d/CCParallaxNode.h similarity index 97% rename from cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h rename to cocos/2d/CCParallaxNode.h index eeaa2be707..36c3a192a9 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCParallaxNode.h +++ b/cocos/2d/CCParallaxNode.h @@ -26,8 +26,8 @@ THE SOFTWARE. #ifndef __CCPARALLAX_NODE_H__ #define __CCPARALLAX_NODE_H__ -#include "base_nodes/CCNode.h" -/*#include "support/data_support/ccArray.h"*/ +#include "CCNode.h" +/*#include "ccArray.h"*/ NS_CC_BEGIN diff --git a/cocos/2d/particle-nodes/CCParticleBatchNode.cpp b/cocos/2d/CCParticleBatchNode.cpp similarity index 97% rename from cocos/2d/particle-nodes/CCParticleBatchNode.cpp rename to cocos/2d/CCParticleBatchNode.cpp index f0f82c8f98..a7dbdc14d1 100644 --- a/cocos/2d/particle-nodes/CCParticleBatchNode.cpp +++ b/cocos/2d/CCParticleBatchNode.cpp @@ -28,20 +28,20 @@ */ #include "CCParticleBatchNode.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureCache.h" +#include "CCTextureAtlas.h" #include "ccConfig.h" #include "ccMacros.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" #include "CCParticleSystem.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/base64.h" -#include "support/zip_support/ZipUtils.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "base64.h" +#include "ZipUtils.h" #include "platform/CCFileUtils.h" #include "kazmath/GL/matrix.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" NS_CC_BEGIN diff --git a/cocos/2d/particle-nodes/CCParticleBatchNode.h b/cocos/2d/CCParticleBatchNode.h similarity index 99% rename from cocos/2d/particle-nodes/CCParticleBatchNode.h rename to cocos/2d/CCParticleBatchNode.h index b63e72c1c6..9b5808be45 100644 --- a/cocos/2d/particle-nodes/CCParticleBatchNode.h +++ b/cocos/2d/CCParticleBatchNode.h @@ -29,7 +29,7 @@ #ifndef __CCPARTICLEBATCHNODE_H__ #define __CCPARTICLEBATCHNODE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" NS_CC_BEGIN diff --git a/cocos/2d/particle-nodes/CCParticleExamples.cpp b/cocos/2d/CCParticleExamples.cpp similarity index 99% rename from cocos/2d/particle-nodes/CCParticleExamples.cpp rename to cocos/2d/CCParticleExamples.cpp index 465e4af325..c7e2946172 100644 --- a/cocos/2d/particle-nodes/CCParticleExamples.cpp +++ b/cocos/2d/CCParticleExamples.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. ****************************************************************************/ #include "CCParticleExamples.h" #include "CCDirector.h" -#include "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "firePngData.h" #include "platform/CCImage.h" diff --git a/cocos/2d/particle-nodes/CCParticleExamples.h b/cocos/2d/CCParticleExamples.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleExamples.h rename to cocos/2d/CCParticleExamples.h diff --git a/cocos/2d/particle-nodes/CCParticleSystem.cpp b/cocos/2d/CCParticleSystem.cpp similarity index 99% rename from cocos/2d/particle-nodes/CCParticleSystem.cpp rename to cocos/2d/CCParticleSystem.cpp index 04f2bf3c5c..a42ac234cb 100644 --- a/cocos/2d/particle-nodes/CCParticleSystem.cpp +++ b/cocos/2d/CCParticleSystem.cpp @@ -47,14 +47,14 @@ THE SOFTWARE. #include "CCParticleBatchNode.h" #include "ccTypes.h" -#include "textures/CCTextureCache.h" -#include "textures/CCTextureAtlas.h" -#include "support/base64.h" +#include "CCTextureCache.h" +#include "CCTextureAtlas.h" +#include "base64.h" #include "platform/CCFileUtils.h" #include "platform/CCImage.h" -#include "support/zip_support/ZipUtils.h" +#include "ZipUtils.h" #include "CCDirector.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" // opengl #include "CCGL.h" diff --git a/cocos/2d/particle-nodes/CCParticleSystem.h b/cocos/2d/CCParticleSystem.h similarity index 99% rename from cocos/2d/particle-nodes/CCParticleSystem.h rename to cocos/2d/CCParticleSystem.h index c26d12840c..ae22671c4c 100644 --- a/cocos/2d/particle-nodes/CCParticleSystem.h +++ b/cocos/2d/CCParticleSystem.h @@ -27,9 +27,9 @@ THE SOFTWARE. #define __CCPARTICLE_SYSTEM_H__ #include "CCProtocols.h" -#include "base_nodes/CCNode.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCString.h" +#include "CCNode.h" +#include "CCDictionary.h" +#include "CCString.h" NS_CC_BEGIN diff --git a/cocos/2d/particle-nodes/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp similarity index 98% rename from cocos/2d/particle-nodes/CCParticleSystemQuad.cpp rename to cocos/2d/CCParticleSystemQuad.cpp index 5a8912b203..3cf7d9e1d4 100644 --- a/cocos/2d/particle-nodes/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -27,15 +27,15 @@ THE SOFTWARE. #include "CCGL.h" #include "CCParticleSystemQuad.h" -#include "sprite_nodes/CCSpriteFrame.h" +#include "CCSpriteFrame.h" #include "CCDirector.h" #include "CCParticleBatchNode.h" -#include "textures/CCTextureAtlas.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" -#include "support/TransformUtils.h" -#include "support/CCNotificationCenter.h" +#include "CCTextureAtlas.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" +#include "TransformUtils.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" // extern diff --git a/cocos/2d/particle-nodes/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h similarity index 100% rename from cocos/2d/particle-nodes/CCParticleSystemQuad.h rename to cocos/2d/CCParticleSystemQuad.h diff --git a/cocos/2d/support/CCProfiling.cpp b/cocos/2d/CCProfiling.cpp similarity index 100% rename from cocos/2d/support/CCProfiling.cpp rename to cocos/2d/CCProfiling.cpp diff --git a/cocos/2d/support/CCProfiling.h b/cocos/2d/CCProfiling.h similarity index 98% rename from cocos/2d/support/CCProfiling.h rename to cocos/2d/CCProfiling.h index 9b02b490e5..d68dc6f918 100644 --- a/cocos/2d/support/CCProfiling.h +++ b/cocos/2d/CCProfiling.h @@ -28,8 +28,8 @@ THE SOFTWARE. #include #include #include "ccConfig.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCDictionary.h" +#include "CCObject.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/misc-nodes/CCProgressTimer.cpp b/cocos/2d/CCProgressTimer.cpp similarity index 98% rename from cocos/2d/misc-nodes/CCProgressTimer.cpp rename to cocos/2d/CCProgressTimer.cpp index 01f9ae107c..d370866d1b 100644 --- a/cocos/2d/misc-nodes/CCProgressTimer.cpp +++ b/cocos/2d/CCProgressTimer.cpp @@ -25,13 +25,13 @@ THE SOFTWARE. #include "CCProgressTimer.h" #include "ccMacros.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" +#include "CCTextureCache.h" +#include "CCGLProgram.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "draw_nodes/CCDrawingPrimitives.h" +#include "TransformUtils.h" +#include "CCDrawingPrimitives.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/misc-nodes/CCProgressTimer.h b/cocos/2d/CCProgressTimer.h similarity index 98% rename from cocos/2d/misc-nodes/CCProgressTimer.h rename to cocos/2d/CCProgressTimer.h index 6bd7d56542..e09e34be0f 100644 --- a/cocos/2d/misc-nodes/CCProgressTimer.h +++ b/cocos/2d/CCProgressTimer.h @@ -25,9 +25,9 @@ THE SOFTWARE. #ifndef __MISC_NODE_CCPROGRESS_TIMER_H__ #define __MISC_NODE_CCPROGRESS_TIMER_H__ -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/include/CCProtocols.h b/cocos/2d/CCProtocols.h similarity index 99% rename from cocos/2d/include/CCProtocols.h rename to cocos/2d/CCProtocols.h index bde86e318d..01b7ebc011 100644 --- a/cocos/2d/include/CCProtocols.h +++ b/cocos/2d/CCProtocols.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCPROTOCOLS_H__ #include "ccTypes.h" -#include "textures/CCTexture2D.h" +#include "CCTexture2D.h" #include NS_CC_BEGIN diff --git a/cocos/2d/misc-nodes/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp similarity index 98% rename from cocos/2d/misc-nodes/CCRenderTexture.cpp rename to cocos/2d/CCRenderTexture.cpp index 3a217fef8d..5bace186cf 100644 --- a/cocos/2d/misc-nodes/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -24,19 +24,19 @@ THE SOFTWARE. ****************************************************************************/ #include "CCConfiguration.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCRenderTexture.h" #include "CCDirector.h" #include "platform/CCImage.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCConfiguration.h" -#include "support/ccUtils.h" -#include "textures/CCTextureCache.h" +#include "ccUtils.h" +#include "CCTextureCache.h" #include "platform/CCFileUtils.h" #include "CCGL.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" -#include "effects/CCGrid.h" +#include "CCGrid.h" // extern #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/misc-nodes/CCRenderTexture.h b/cocos/2d/CCRenderTexture.h similarity index 99% rename from cocos/2d/misc-nodes/CCRenderTexture.h rename to cocos/2d/CCRenderTexture.h index 9105d55d38..5318e83fdf 100644 --- a/cocos/2d/misc-nodes/CCRenderTexture.h +++ b/cocos/2d/CCRenderTexture.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCRENDER_TEXTURE_H__ #define __CCRENDER_TEXTURE_H__ -#include "base_nodes/CCNode.h" -#include "sprite_nodes/CCSprite.h" +#include "CCNode.h" +#include "CCSprite.h" #include "kazmath/mat4.h" #include "platform/CCImage.h" diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp b/cocos/2d/CCScene.cpp similarity index 97% rename from cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp rename to cocos/2d/CCScene.cpp index c48f95c860..cc8654204b 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -27,9 +27,9 @@ THE SOFTWARE. #include "CCScene.h" #include "CCDirector.h" #include "CCLayer.h" -#include "sprite_nodes/CCSprite.h" -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "physics/CCPhysicsWorld.h" +#include "CCSprite.h" +#include "CCSpriteBatchNode.h" +#include "CCPhysicsWorld.h" NS_CC_BEGIN diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCScene.h b/cocos/2d/CCScene.h similarity index 97% rename from cocos/2d/layers-scenes-transitions-nodes/CCScene.h rename to cocos/2d/CCScene.h index c2e2aa7bcb..11e3e0fbb5 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCScene.h +++ b/cocos/2d/CCScene.h @@ -27,8 +27,8 @@ THE SOFTWARE. #ifndef __CCSCENE_H__ #define __CCSCENE_H__ -#include "base_nodes/CCNode.h" -#include "physics/CCPhysicsWorld.h" +#include "CCNode.h" +#include "CCPhysicsWorld.h" NS_CC_BEGIN diff --git a/cocos/2d/CCScheduler.cpp b/cocos/2d/CCScheduler.cpp index 2bf62c1fef..3f9c9da9f8 100644 --- a/cocos/2d/CCScheduler.cpp +++ b/cocos/2d/CCScheduler.cpp @@ -27,10 +27,10 @@ THE SOFTWARE. #include "CCScheduler.h" #include "ccMacros.h" #include "CCDirector.h" -#include "support/data_support/utlist.h" -#include "support/data_support/ccCArray.h" -#include "cocoa/CCArray.h" -#include "script_support/CCScriptSupport.h" +#include "utlist.h" +#include "ccCArray.h" +#include "CCArray.h" +#include "CCScriptSupport.h" using namespace std; diff --git a/cocos/2d/CCScheduler.h b/cocos/2d/CCScheduler.h index e4b3526ae2..221781f776 100644 --- a/cocos/2d/CCScheduler.h +++ b/cocos/2d/CCScheduler.h @@ -27,8 +27,8 @@ THE SOFTWARE. #ifndef __CCSCHEDULER_H__ #define __CCSCHEDULER_H__ -#include "cocoa/CCObject.h" -#include "support/data_support/uthash.h" +#include "CCObject.h" +#include "uthash.h" NS_CC_BEGIN diff --git a/cocos/2d/script-support/CCScriptSupport.cpp b/cocos/2d/CCScriptSupport.cpp similarity index 100% rename from cocos/2d/script-support/CCScriptSupport.cpp rename to cocos/2d/CCScriptSupport.cpp diff --git a/cocos/2d/script-support/CCScriptSupport.h b/cocos/2d/CCScriptSupport.h similarity index 98% rename from cocos/2d/script-support/CCScriptSupport.h rename to cocos/2d/CCScriptSupport.h index 324d337ed8..0c7f502a8b 100644 --- a/cocos/2d/script-support/CCScriptSupport.h +++ b/cocos/2d/CCScriptSupport.h @@ -26,10 +26,10 @@ #define __SCRIPT_SUPPORT_H__ #include "platform/CCCommon.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "cocoa/CCSet.h" +#include "CCTouch.h" +#include "CCEventTouch.h" +#include "CCEventKeyboard.h" +#include "CCSet.h" #include #include #include diff --git a/cocos/2d/shaders/CCShaderCache.cpp b/cocos/2d/CCShaderCache.cpp similarity index 100% rename from cocos/2d/shaders/CCShaderCache.cpp rename to cocos/2d/CCShaderCache.cpp diff --git a/cocos/2d/shaders/CCShaderCache.h b/cocos/2d/CCShaderCache.h similarity index 98% rename from cocos/2d/shaders/CCShaderCache.h rename to cocos/2d/CCShaderCache.h index ec326b50cf..ee65bc33b9 100644 --- a/cocos/2d/shaders/CCShaderCache.h +++ b/cocos/2d/CCShaderCache.h @@ -30,7 +30,7 @@ THE SOFTWARE. #include #include -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/sprite-nodes/CCSprite.cpp b/cocos/2d/CCSprite.cpp similarity index 98% rename from cocos/2d/sprite-nodes/CCSprite.cpp rename to cocos/2d/CCSprite.cpp index e1cfd9b5da..db9f4544f2 100644 --- a/cocos/2d/sprite-nodes/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -33,17 +33,17 @@ THE SOFTWARE. #include "CCSprite.h" #include "CCSpriteFrame.h" #include "CCSpriteFrameCache.h" -#include "textures/CCTextureCache.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCGLProgram.h" +#include "CCTextureCache.h" +#include "CCDrawingPrimitives.h" +#include "CCShaderCache.h" +#include "ccGLStateCache.h" +#include "CCGLProgram.h" #include "CCDirector.h" -#include "cocoa/CCGeometry.h" -#include "textures/CCTexture2D.h" -#include "cocoa/CCAffineTransform.h" -#include "support/TransformUtils.h" -#include "support/CCProfiling.h" +#include "CCGeometry.h" +#include "CCTexture2D.h" +#include "CCAffineTransform.h" +#include "TransformUtils.h" +#include "CCProfiling.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/sprite-nodes/CCSprite.h b/cocos/2d/CCSprite.h similarity index 99% rename from cocos/2d/sprite-nodes/CCSprite.h rename to cocos/2d/CCSprite.h index d150c55213..cc6470c7da 100644 --- a/cocos/2d/sprite-nodes/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -27,16 +27,16 @@ THE SOFTWARE. #ifndef __SPITE_NODE_CCSPRITE_H__ #define __SPITE_NODE_CCSPRITE_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureAtlas.h" #include "ccTypes.h" -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" #include #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN -#include "physics/CCPhysicsBody.h" +#include "CCPhysicsBody.h" NS_CC_BEGIN diff --git a/cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp similarity index 98% rename from cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp rename to cocos/2d/CCSpriteBatchNode.cpp index 6df8215bd0..b4be9bd045 100644 --- a/cocos/2d/sprite-nodes/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -31,17 +31,17 @@ THE SOFTWARE. #include "ccConfig.h" #include "CCSprite.h" -#include "effects/CCGrid.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" +#include "CCGrid.h" +#include "CCDrawingPrimitives.h" +#include "CCTextureCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" #include "CCDirector.h" -#include "support/TransformUtils.h" -#include "support/CCProfiling.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" -#include "layers_scenes_transitions_nodes/CCScene.h" +#include "TransformUtils.h" +#include "CCProfiling.h" +#include "CCLayer.h" +#include "CCScene.h" // external #include "kazmath/GL/matrix.h" diff --git a/cocos/2d/sprite-nodes/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h similarity index 99% rename from cocos/2d/sprite-nodes/CCSpriteBatchNode.h rename to cocos/2d/CCSpriteBatchNode.h index 091c012160..6ba402fe57 100644 --- a/cocos/2d/sprite-nodes/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -30,9 +30,9 @@ THE SOFTWARE. #include -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "textures/CCTextureAtlas.h" +#include "CCTextureAtlas.h" #include "ccMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/sprite-nodes/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp similarity index 99% rename from cocos/2d/sprite-nodes/CCSpriteFrame.cpp rename to cocos/2d/CCSpriteFrame.cpp index 2cb21824b5..8bc0bafa6d 100644 --- a/cocos/2d/sprite-nodes/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -23,7 +23,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "CCSpriteFrame.h" #include "CCDirector.h" diff --git a/cocos/2d/sprite-nodes/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h similarity index 98% rename from cocos/2d/sprite-nodes/CCSpriteFrame.h rename to cocos/2d/CCSpriteFrame.h index 30899290a4..f9b2d68c4a 100644 --- a/cocos/2d/sprite-nodes/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -27,10 +27,10 @@ THE SOFTWARE. #ifndef __SPRITE_CCSPRITE_FRAME_H__ #define __SPRITE_CCSPRITE_FRAME_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCProtocols.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp similarity index 98% rename from cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp rename to cocos/2d/CCSpriteFrameCache.cpp index 1d19773c60..78fc2f8fa6 100644 --- a/cocos/2d/sprite-nodes/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -26,17 +26,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "cocoa/CCNS.h" +#include "CCNS.h" #include "ccMacros.h" -#include "textures/CCTextureCache.h" +#include "CCTextureCache.h" #include "CCSpriteFrameCache.h" #include "CCSpriteFrame.h" #include "CCSprite.h" -#include "support/TransformUtils.h" +#include "TransformUtils.h" #include "platform/CCFileUtils.h" -#include "cocoa/CCString.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" +#include "CCString.h" +#include "CCArray.h" +#include "CCDictionary.h" #include using namespace std; diff --git a/cocos/2d/sprite-nodes/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h similarity index 98% rename from cocos/2d/sprite-nodes/CCSpriteFrameCache.h rename to cocos/2d/CCSpriteFrameCache.h index 7a9129018e..c7249d222c 100644 --- a/cocos/2d/sprite-nodes/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -34,9 +34,9 @@ THE SOFTWARE. * http://zwoptex.zwopple.com/ */ -#include "sprite_nodes/CCSpriteFrame.h" -#include "textures/CCTexture2D.h" -#include "cocoa/CCObject.h" +#include "CCSpriteFrame.h" +#include "CCTexture2D.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp rename to cocos/2d/CCTMXLayer.cpp index c0a1b1e10f..4b801ea83e 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -26,11 +26,11 @@ THE SOFTWARE. #include "CCTMXLayer.h" #include "CCTMXXMLParser.h" #include "CCTMXTiledMap.h" -#include "sprite_nodes/CCSprite.h" -#include "textures/CCTextureCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/CCGLProgram.h" -#include "support/data_support/ccCArray.h" +#include "CCSprite.h" +#include "CCTextureCache.h" +#include "CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccCArray.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h similarity index 98% rename from cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h rename to cocos/2d/CCTMXLayer.h index c5a8340b80..b85de82c1e 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -27,10 +27,10 @@ THE SOFTWARE. #define __CCTMX_LAYER_H__ #include "CCTMXObjectGroup.h" -#include "base_nodes/CCAtlasNode.h" -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCAtlasNode.h" +#include "CCSpriteBatchNode.h" #include "CCTMXXMLParser.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_BEGIN class TMXMapInfo; diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp b/cocos/2d/CCTMXObjectGroup.cpp similarity index 100% rename from cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.cpp rename to cocos/2d/CCTMXObjectGroup.cpp diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h b/cocos/2d/CCTMXObjectGroup.h similarity index 96% rename from cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h rename to cocos/2d/CCTMXObjectGroup.h index c4c5462946..7a06e4b961 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXObjectGroup.h +++ b/cocos/2d/CCTMXObjectGroup.h @@ -27,10 +27,10 @@ THE SOFTWARE. #ifndef __CCTMX_OBJECT_GROUP_H__ #define __CCTMX_OBJECT_GROUP_H__ -#include "cocoa/CCGeometry.h" -#include "cocoa/CCString.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" +#include "CCGeometry.h" +#include "CCString.h" +#include "CCArray.h" +#include "CCDictionary.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp rename to cocos/2d/CCTMXTiledMap.cpp index a856f577a4..c6c47b3abd 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCTMXTiledMap.h" #include "CCTMXXMLParser.h" #include "CCTMXLayer.h" -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h rename to cocos/2d/CCTMXTiledMap.h index f3c92c91ae..82ea45bd13 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -26,7 +26,7 @@ THE SOFTWARE. #ifndef __CCTMX_TILE_MAP_H__ #define __CCTMX_TILE_MAP_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCTMXObjectGroup.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp rename to cocos/2d/CCTMXXMLParser.cpp index 8f95cc5487..8497638cf7 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -31,8 +31,8 @@ THE SOFTWARE. #include "CCTMXTiledMap.h" #include "ccMacros.h" #include "platform/CCFileUtils.h" -#include "support/zip_support/ZipUtils.h" -#include "support/base64.h" +#include "ZipUtils.h" +#include "base64.h" using namespace std; diff --git a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h rename to cocos/2d/CCTMXXMLParser.h index 6cad378de0..7b4851386c 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -28,9 +28,9 @@ THE SOFTWARE. #ifndef __CC_TM_XML_PARSER__ #define __CC_TM_XML_PARSER__ -#include "cocoa/CCArray.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCGeometry.h" +#include "CCArray.h" +#include "CCDictionary.h" +#include "CCGeometry.h" #include "platform/CCSAXParser.h" #include diff --git a/cocos/2d/text-input-node/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp similarity index 100% rename from cocos/2d/text-input-node/CCTextFieldTTF.cpp rename to cocos/2d/CCTextFieldTTF.cpp diff --git a/cocos/2d/text-input-node/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h similarity index 98% rename from cocos/2d/text-input-node/CCTextFieldTTF.h rename to cocos/2d/CCTextFieldTTF.h index 18a58c3ffb..79feb55d7c 100644 --- a/cocos/2d/text-input-node/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_TEXT_FIELD_H__ #define __CC_TEXT_FIELD_H__ -#include "label_nodes/CCLabelTTF.h" -#include "text_input_node/CCIMEDelegate.h" +#include "CCLabelTTF.h" +#include "CCIMEDelegate.h" NS_CC_BEGIN diff --git a/cocos/2d/label-nodes/CCTextImage.cpp b/cocos/2d/CCTextImage.cpp similarity index 100% rename from cocos/2d/label-nodes/CCTextImage.cpp rename to cocos/2d/CCTextImage.cpp diff --git a/cocos/2d/label-nodes/CCTextImage.h b/cocos/2d/CCTextImage.h similarity index 100% rename from cocos/2d/label-nodes/CCTextImage.h rename to cocos/2d/CCTextImage.h diff --git a/cocos/2d/textures/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp similarity index 99% rename from cocos/2d/textures/CCTexture2D.cpp rename to cocos/2d/CCTexture2D.cpp index 7ff46a3e83..84a6822dda 100644 --- a/cocos/2d/textures/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -36,12 +36,12 @@ THE SOFTWARE. #include "CCConfiguration.h" #include "platform/CCImage.h" #include "CCGL.h" -#include "support/ccUtils.h" -#include "platform/CCPlatformMacros.h" +#include "ccUtils.h" +#include "CCPlatformMacros.h" #include "CCDirector.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" #if CC_ENABLE_CACHE_TEXTURE_DATA #include "CCTextureCache.h" diff --git a/cocos/2d/textures/CCTexture2D.h b/cocos/2d/CCTexture2D.h similarity index 99% rename from cocos/2d/textures/CCTexture2D.h rename to cocos/2d/CCTexture2D.h index f962560c7b..6f15273f9c 100644 --- a/cocos/2d/textures/CCTexture2D.h +++ b/cocos/2d/CCTexture2D.h @@ -29,11 +29,11 @@ THE SOFTWARE. #include #include -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #include "ccTypes.h" #ifdef EMSCRIPTEN -#include "base_nodes/CCGLBufferedNode.h" +#include "CCGLBufferedNode.h" #endif // EMSCRIPTEN NS_CC_BEGIN diff --git a/cocos/2d/textures/CCTextureAtlas.cpp b/cocos/2d/CCTextureAtlas.cpp similarity index 99% rename from cocos/2d/textures/CCTextureAtlas.cpp rename to cocos/2d/CCTextureAtlas.cpp index 239294e7a3..c83a042dde 100644 --- a/cocos/2d/textures/CCTextureAtlas.cpp +++ b/cocos/2d/CCTextureAtlas.cpp @@ -28,14 +28,14 @@ THE SOFTWARE. #include "CCTextureAtlas.h" #include "CCTextureCache.h" #include "ccMacros.h" -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "support/CCNotificationCenter.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCNotificationCenter.h" #include "CCEventType.h" #include "CCGL.h" // support #include "CCTexture2D.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include //According to some tests GL_TRIANGLE_STRIP is slower, MUCH slower. Probably I'm doing something very wrong diff --git a/cocos/2d/textures/CCTextureAtlas.h b/cocos/2d/CCTextureAtlas.h similarity index 99% rename from cocos/2d/textures/CCTextureAtlas.h rename to cocos/2d/CCTextureAtlas.h index afed7e16dc..4c1bb6436a 100644 --- a/cocos/2d/textures/CCTextureAtlas.h +++ b/cocos/2d/CCTextureAtlas.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCTEXTURE_ATLAS_H__ #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccConfig.h" #include diff --git a/cocos/2d/textures/CCTextureCache.cpp b/cocos/2d/CCTextureCache.cpp similarity index 99% rename from cocos/2d/textures/CCTextureCache.cpp rename to cocos/2d/CCTextureCache.cpp index 82fc78cbe7..95c02f8ff4 100644 --- a/cocos/2d/textures/CCTextureCache.cpp +++ b/cocos/2d/CCTextureCache.cpp @@ -35,9 +35,9 @@ THE SOFTWARE. #include "CCDirector.h" #include "platform/CCFileUtils.h" #include "platform/CCThread.h" -#include "support/ccUtils.h" +#include "ccUtils.h" #include "CCScheduler.h" -#include "cocoa/CCString.h" +#include "CCString.h" #ifdef EMSCRIPTEN diff --git a/cocos/2d/textures/CCTextureCache.h b/cocos/2d/CCTextureCache.h similarity index 99% rename from cocos/2d/textures/CCTextureCache.h rename to cocos/2d/CCTextureCache.h index c1c403f12c..ec87d891d8 100644 --- a/cocos/2d/textures/CCTextureCache.h +++ b/cocos/2d/CCTextureCache.h @@ -35,8 +35,8 @@ THE SOFTWARE. #include #include -#include "cocoa/CCObject.h" -#include "textures/CCTexture2D.h" +#include "CCObject.h" +#include "CCTexture2D.h" #include "platform/CCImage.h" #if CC_ENABLE_CACHE_TEXTURE_DATA diff --git a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp b/cocos/2d/CCTileMapAtlas.cpp similarity index 98% rename from cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp rename to cocos/2d/CCTileMapAtlas.cpp index 0863c2f097..9b7bc85ad3 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.cpp +++ b/cocos/2d/CCTileMapAtlas.cpp @@ -25,11 +25,11 @@ THE SOFTWARE. ****************************************************************************/ #include "CCTileMapAtlas.h" #include "platform/CCFileUtils.h" -#include "textures/CCTextureAtlas.h" -#include "support/image_support/TGAlib.h" +#include "CCTextureAtlas.h" +#include "TGAlib.h" #include "ccConfig.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCInteger.h" +#include "CCDictionary.h" +#include "CCInteger.h" #include "CCDirector.h" NS_CC_BEGIN diff --git a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h b/cocos/2d/CCTileMapAtlas.h similarity index 99% rename from cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h rename to cocos/2d/CCTileMapAtlas.h index 86d7e8a06d..865f47295a 100644 --- a/cocos/2d/tilemap-parallax-nodes/CCTileMapAtlas.h +++ b/cocos/2d/CCTileMapAtlas.h @@ -27,7 +27,7 @@ THE SOFTWARE. #define __CCTILE_MAP_ATLAS__ -#include "base_nodes/CCAtlasNode.h" +#include "CCAtlasNode.h" NS_CC_BEGIN diff --git a/cocos/2d/event-dispatcher/CCTouch.cpp b/cocos/2d/CCTouch.cpp similarity index 100% rename from cocos/2d/event-dispatcher/CCTouch.cpp rename to cocos/2d/CCTouch.cpp diff --git a/cocos/2d/event-dispatcher/CCTouch.h b/cocos/2d/CCTouch.h similarity index 98% rename from cocos/2d/event-dispatcher/CCTouch.h rename to cocos/2d/CCTouch.h index 9cc22ef498..1ed19d3112 100644 --- a/cocos/2d/event-dispatcher/CCTouch.h +++ b/cocos/2d/CCTouch.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_TOUCH_H__ #define __CC_TOUCH_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp b/cocos/2d/CCTransition.cpp similarity index 99% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp rename to cocos/2d/CCTransition.cpp index 7232645d2a..5dea9ae721 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCTransition.cpp +++ b/cocos/2d/CCTransition.cpp @@ -27,14 +27,14 @@ THE SOFTWARE. #include "CCTransition.h" #include "CCCamera.h" #include "CCDirector.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionEase.h" -#include "actions/CCActionCamera.h" -#include "actions/CCActionTiledGrid.h" -#include "actions/CCActionGrid.h" +#include "CCActionInterval.h" +#include "CCActionInstant.h" +#include "CCActionEase.h" +#include "CCActionCamera.h" +#include "CCActionTiledGrid.h" +#include "CCActionGrid.h" #include "CCLayer.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCRenderTexture.h" NS_CC_BEGIN diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransition.h b/cocos/2d/CCTransition.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransition.h rename to cocos/2d/CCTransition.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp b/cocos/2d/CCTransitionPageTurn.cpp similarity index 96% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp rename to cocos/2d/CCTransitionPageTurn.cpp index 58bf240123..3bde055c59 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.cpp +++ b/cocos/2d/CCTransitionPageTurn.cpp @@ -25,10 +25,10 @@ THE SOFTWARE. #include "CCTransitionPageTurn.h" #include "CCDirector.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionGrid.h" -#include "actions/CCActionPageTurn3D.h" +#include "CCActionInterval.h" +#include "CCActionInstant.h" +#include "CCActionGrid.h" +#include "CCActionPageTurn3D.h" NS_CC_BEGIN diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h b/cocos/2d/CCTransitionPageTurn.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionPageTurn.h rename to cocos/2d/CCTransitionPageTurn.h diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp b/cocos/2d/CCTransitionProgress.cpp similarity index 98% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp rename to cocos/2d/CCTransitionProgress.cpp index fc6a79ca87..1d53f9cbed 100644 --- a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.cpp +++ b/cocos/2d/CCTransitionProgress.cpp @@ -27,11 +27,11 @@ THE SOFTWARE. #include "CCTransitionProgress.h" #include "CCDirector.h" -#include "misc_nodes/CCRenderTexture.h" -#include "misc_nodes/CCProgressTimer.h" +#include "CCRenderTexture.h" +#include "CCProgressTimer.h" #include "CCLayer.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionProgressTimer.h" +#include "CCActionInstant.h" +#include "CCActionProgressTimer.h" NS_CC_BEGIN diff --git a/cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h b/cocos/2d/CCTransitionProgress.h similarity index 100% rename from cocos/2d/layers-scenes-transitions-nodes/CCTransitionProgress.h rename to cocos/2d/CCTransitionProgress.h diff --git a/cocos/2d/support/user_default/CCUserDefault.cpp b/cocos/2d/CCUserDefault.cpp similarity index 99% rename from cocos/2d/support/user_default/CCUserDefault.cpp rename to cocos/2d/CCUserDefault.cpp index 63997ac1f9..ab30c805a0 100644 --- a/cocos/2d/support/user_default/CCUserDefault.cpp +++ b/cocos/2d/CCUserDefault.cpp @@ -24,8 +24,8 @@ THE SOFTWARE. #include "CCUserDefault.h" #include "platform/CCCommon.h" #include "platform/CCFileUtils.h" -#include "../tinyxml2/tinyxml2.h" -#include "support/base64.h" +#include "tinyxml2.h" +#include "base64.h" #if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) diff --git a/cocos/2d/support/user_default/CCUserDefault.h b/cocos/2d/CCUserDefault.h similarity index 98% rename from cocos/2d/support/user_default/CCUserDefault.h rename to cocos/2d/CCUserDefault.h index 89609e1559..a18fb00b6a 100644 --- a/cocos/2d/support/user_default/CCUserDefault.h +++ b/cocos/2d/CCUserDefault.h @@ -24,9 +24,9 @@ THE SOFTWARE. #ifndef __SUPPORT_CCUSERDEFAULT_H__ #define __SUPPORT_CCUSERDEFAULT_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include -#include "cocoa/CCData.h" +#include "CCData.h" NS_CC_BEGIN diff --git a/cocos/2d/support/user_default/CCUserDefault.mm b/cocos/2d/CCUserDefault.mm similarity index 99% rename from cocos/2d/support/user_default/CCUserDefault.mm rename to cocos/2d/CCUserDefault.mm index dcf355e6f9..b55acfcf24 100644 --- a/cocos/2d/support/user_default/CCUserDefault.mm +++ b/cocos/2d/CCUserDefault.mm @@ -25,9 +25,9 @@ #import "CCUserDefault.h" #import #import "platform/CCFileUtils.h" -#import "../tinyxml2/tinyxml2.h" -#import "platform/CCPlatformConfig.h" -#import "platform/CCPlatformMacros.h" +#import "tinyxml2.h" +#import "CCPlatformConfig.h" +#import "CCPlatformMacros.h" #import "base64.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) diff --git a/cocos/2d/support/user_default/CCUserDefaultAndroid.cpp b/cocos/2d/CCUserDefaultAndroid.cpp similarity index 99% rename from cocos/2d/support/user_default/CCUserDefaultAndroid.cpp rename to cocos/2d/CCUserDefaultAndroid.cpp index 91ef890aed..38c09c2a90 100644 --- a/cocos/2d/support/user_default/CCUserDefaultAndroid.cpp +++ b/cocos/2d/CCUserDefaultAndroid.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCUserDefault.h" -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #include "platform/CCCommon.h" -#include "support/base64.h" +#include "base64.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #include "platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" diff --git a/cocos/2d/support/CCVertex.cpp b/cocos/2d/CCVertex.cpp similarity index 100% rename from cocos/2d/support/CCVertex.cpp rename to cocos/2d/CCVertex.cpp diff --git a/cocos/2d/support/CCVertex.h b/cocos/2d/CCVertex.h similarity index 100% rename from cocos/2d/support/CCVertex.h rename to cocos/2d/CCVertex.h diff --git a/cocos/2d/proj.linux/Makefile b/cocos/2d/Makefile similarity index 100% rename from cocos/2d/proj.linux/Makefile rename to cocos/2d/Makefile diff --git a/cocos/2d/support/image_support/TGAlib.cpp b/cocos/2d/TGAlib.cpp similarity index 100% rename from cocos/2d/support/image_support/TGAlib.cpp rename to cocos/2d/TGAlib.cpp diff --git a/cocos/2d/support/image_support/TGAlib.h b/cocos/2d/TGAlib.h similarity index 100% rename from cocos/2d/support/image_support/TGAlib.h rename to cocos/2d/TGAlib.h diff --git a/cocos/2d/support/TransformUtils.cpp b/cocos/2d/TransformUtils.cpp similarity index 98% rename from cocos/2d/support/TransformUtils.cpp rename to cocos/2d/TransformUtils.cpp index d64a63ffd1..85dbfc86e5 100644 --- a/cocos/2d/support/TransformUtils.cpp +++ b/cocos/2d/TransformUtils.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "TransformUtils.h" -#include "cocoa/CCAffineTransform.h" +#include "CCAffineTransform.h" namespace cocos2d { diff --git a/cocos/2d/support/TransformUtils.h b/cocos/2d/TransformUtils.h similarity index 100% rename from cocos/2d/support/TransformUtils.h rename to cocos/2d/TransformUtils.h diff --git a/cocos/2d/support/zip_support/ZipUtils.cpp b/cocos/2d/ZipUtils.cpp similarity index 100% rename from cocos/2d/support/zip_support/ZipUtils.cpp rename to cocos/2d/ZipUtils.cpp diff --git a/cocos/2d/support/zip_support/ZipUtils.h b/cocos/2d/ZipUtils.h similarity index 99% rename from cocos/2d/support/zip_support/ZipUtils.h rename to cocos/2d/ZipUtils.h index d7202a091d..5564807540 100644 --- a/cocos/2d/support/zip_support/ZipUtils.h +++ b/cocos/2d/ZipUtils.h @@ -25,7 +25,7 @@ THE SOFTWARE. #define __SUPPORT_ZIPUTILS_H__ #include -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #include "CCPlatformDefine.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/cocos/2d/support/base64.cpp b/cocos/2d/base64.cpp similarity index 99% rename from cocos/2d/support/base64.cpp rename to cocos/2d/base64.cpp index 6a44597441..131b0d81f7 100644 --- a/cocos/2d/support/base64.cpp +++ b/cocos/2d/base64.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. #include #include -#include "support/base64.h" +#include "base64.h" namespace cocos2d { diff --git a/cocos/2d/support/base64.h b/cocos/2d/base64.h similarity index 100% rename from cocos/2d/support/base64.h rename to cocos/2d/base64.h diff --git a/cocos/2d/support/data_support/ccCArray.cpp b/cocos/2d/ccCArray.cpp similarity index 99% rename from cocos/2d/support/data_support/ccCArray.cpp rename to cocos/2d/ccCArray.cpp index 7271675ede..cd8f275311 100644 --- a/cocos/2d/support/data_support/ccCArray.cpp +++ b/cocos/2d/ccCArray.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ccCArray.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/2d/support/data_support/ccCArray.h b/cocos/2d/ccCArray.h similarity index 99% rename from cocos/2d/support/data_support/ccCArray.h rename to cocos/2d/ccCArray.h index 0a788769d4..fff5152904 100644 --- a/cocos/2d/support/data_support/ccCArray.h +++ b/cocos/2d/ccCArray.h @@ -43,7 +43,7 @@ THE SOFTWARE. #define CC_ARRAY_H #include "ccMacros.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include #include diff --git a/cocos/2d/include/ccConfig.h b/cocos/2d/ccConfig.h similarity index 99% rename from cocos/2d/include/ccConfig.h rename to cocos/2d/ccConfig.h index ee8fba0828..f801066bfe 100644 --- a/cocos/2d/include/ccConfig.h +++ b/cocos/2d/ccConfig.h @@ -27,7 +27,7 @@ THE SOFTWARE. #ifndef __CCCONFIG_H__ #define __CCCONFIG_H__ -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" /** @file diff --git a/cocos/2d/shaders/ccGLStateCache.cpp b/cocos/2d/ccGLStateCache.cpp similarity index 100% rename from cocos/2d/shaders/ccGLStateCache.cpp rename to cocos/2d/ccGLStateCache.cpp diff --git a/cocos/2d/shaders/ccGLStateCache.h b/cocos/2d/ccGLStateCache.h similarity index 99% rename from cocos/2d/shaders/ccGLStateCache.h rename to cocos/2d/ccGLStateCache.h index 3ea973918a..32bf5584be 100644 --- a/cocos/2d/shaders/ccGLStateCache.h +++ b/cocos/2d/ccGLStateCache.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCGLSTATE_H__ #include "CCGL.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/include/ccMacros.h b/cocos/2d/ccMacros.h similarity index 100% rename from cocos/2d/include/ccMacros.h rename to cocos/2d/ccMacros.h diff --git a/cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h b/cocos/2d/ccShaderEx_SwitchMask_frag.h similarity index 100% rename from cocos/2d/shaders/ccShaderEx_SwitchMask_frag.h rename to cocos/2d/ccShaderEx_SwitchMask_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h b/cocos/2d/ccShader_PositionColorLengthTexture_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColorLengthTexture_frag.h rename to cocos/2d/ccShader_PositionColorLengthTexture_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h b/cocos/2d/ccShader_PositionColorLengthTexture_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColorLengthTexture_vert.h rename to cocos/2d/ccShader_PositionColorLengthTexture_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionColor_frag.h b/cocos/2d/ccShader_PositionColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColor_frag.h rename to cocos/2d/ccShader_PositionColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionColor_vert.h b/cocos/2d/ccShader_PositionColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionColor_vert.h rename to cocos/2d/ccShader_PositionColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h b/cocos/2d/ccShader_PositionTextureA8Color_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureA8Color_frag.h rename to cocos/2d/ccShader_PositionTextureA8Color_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h b/cocos/2d/ccShader_PositionTextureA8Color_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureA8Color_vert.h rename to cocos/2d/ccShader_PositionTextureA8Color_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h b/cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColorAlphaTest_frag.h rename to cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColor_frag.h b/cocos/2d/ccShader_PositionTextureColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColor_frag.h rename to cocos/2d/ccShader_PositionTextureColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTextureColor_vert.h b/cocos/2d/ccShader_PositionTextureColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTextureColor_vert.h rename to cocos/2d/ccShader_PositionTextureColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_frag.h b/cocos/2d/ccShader_PositionTexture_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_frag.h rename to cocos/2d/ccShader_PositionTexture_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h b/cocos/2d/ccShader_PositionTexture_uColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_uColor_frag.h rename to cocos/2d/ccShader_PositionTexture_uColor_frag.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h b/cocos/2d/ccShader_PositionTexture_uColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_uColor_vert.h rename to cocos/2d/ccShader_PositionTexture_uColor_vert.h diff --git a/cocos/2d/shaders/ccShader_PositionTexture_vert.h b/cocos/2d/ccShader_PositionTexture_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_PositionTexture_vert.h rename to cocos/2d/ccShader_PositionTexture_vert.h diff --git a/cocos/2d/shaders/ccShader_Position_uColor_frag.h b/cocos/2d/ccShader_Position_uColor_frag.h similarity index 100% rename from cocos/2d/shaders/ccShader_Position_uColor_frag.h rename to cocos/2d/ccShader_Position_uColor_frag.h diff --git a/cocos/2d/shaders/ccShader_Position_uColor_vert.h b/cocos/2d/ccShader_Position_uColor_vert.h similarity index 100% rename from cocos/2d/shaders/ccShader_Position_uColor_vert.h rename to cocos/2d/ccShader_Position_uColor_vert.h diff --git a/cocos/2d/shaders/ccShaders.cpp b/cocos/2d/ccShaders.cpp similarity index 100% rename from cocos/2d/shaders/ccShaders.cpp rename to cocos/2d/ccShaders.cpp diff --git a/cocos/2d/shaders/ccShaders.h b/cocos/2d/ccShaders.h similarity index 98% rename from cocos/2d/shaders/ccShaders.h rename to cocos/2d/ccShaders.h index f0bcfd4b42..b7bea82383 100644 --- a/cocos/2d/shaders/ccShaders.h +++ b/cocos/2d/ccShaders.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CCSHADER_H__ #include "CCGL.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/ccTypes.cpp b/cocos/2d/ccTypes.cpp index f669095ea7..adf9677ea2 100644 --- a/cocos/2d/ccTypes.cpp +++ b/cocos/2d/ccTypes.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. ****************************************************************************/ -#include "include/ccTypes.h" +#include "ccTypes.h" NS_CC_BEGIN diff --git a/cocos/2d/include/ccTypes.h b/cocos/2d/ccTypes.h similarity index 99% rename from cocos/2d/include/ccTypes.h rename to cocos/2d/ccTypes.h index 409b9734a1..f7bb8d19cb 100644 --- a/cocos/2d/include/ccTypes.h +++ b/cocos/2d/ccTypes.h @@ -28,7 +28,7 @@ THE SOFTWARE. #define __CCTYPES_H__ #include -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "CCGL.h" diff --git a/cocos/2d/support/ccUTF8.cpp b/cocos/2d/ccUTF8.cpp similarity index 100% rename from cocos/2d/support/ccUTF8.cpp rename to cocos/2d/ccUTF8.cpp diff --git a/cocos/2d/support/ccUTF8.h b/cocos/2d/ccUTF8.h similarity index 98% rename from cocos/2d/support/ccUTF8.h rename to cocos/2d/ccUTF8.h index 48543dcd17..9bd8b521df 100644 --- a/cocos/2d/support/ccUTF8.h +++ b/cocos/2d/ccUTF8.h @@ -8,7 +8,7 @@ #ifndef __cocos2dx__ccUTF8__ #define __cocos2dx__ccUTF8__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include NS_CC_BEGIN diff --git a/cocos/2d/support/ccUtils.cpp b/cocos/2d/ccUtils.cpp similarity index 100% rename from cocos/2d/support/ccUtils.cpp rename to cocos/2d/ccUtils.cpp diff --git a/cocos/2d/support/ccUtils.h b/cocos/2d/ccUtils.h similarity index 100% rename from cocos/2d/support/ccUtils.h rename to cocos/2d/ccUtils.h diff --git a/cocos/2d/include/cocos2d.h b/cocos/2d/cocos2d.h similarity index 50% rename from cocos/2d/include/cocos2d.h rename to cocos/2d/cocos2d.h index bb270d265a..a1a28e7f0c 100644 --- a/cocos/2d/include/cocos2d.h +++ b/cocos/2d/cocos2d.h @@ -37,47 +37,47 @@ THE SOFTWARE. #include "ccConfig.h" // actions -#include "actions/CCAction.h" -#include "actions/CCActionInterval.h" -#include "actions/CCActionCamera.h" -#include "actions/CCActionManager.h" -#include "actions/CCActionEase.h" -#include "actions/CCActionPageTurn3D.h" -#include "actions/CCActionGrid.h" -#include "actions/CCActionProgressTimer.h" -#include "actions/CCActionGrid3D.h" -#include "actions/CCActionTiledGrid.h" -#include "actions/CCActionInstant.h" -#include "actions/CCActionTween.h" -#include "actions/CCActionCatmullRom.h" +#include "CCAction.h" +#include "CCActionInterval.h" +#include "CCActionCamera.h" +#include "CCActionManager.h" +#include "CCActionEase.h" +#include "CCActionPageTurn3D.h" +#include "CCActionGrid.h" +#include "CCActionProgressTimer.h" +#include "CCActionGrid3D.h" +#include "CCActionTiledGrid.h" +#include "CCActionInstant.h" +#include "CCActionTween.h" +#include "CCActionCatmullRom.h" // base_nodes -#include "base_nodes/CCNode.h" -#include "base_nodes/CCAtlasNode.h" +#include "CCNode.h" +#include "CCAtlasNode.h" // cocoa -#include "cocoa/CCAffineTransform.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCObject.h" -#include "cocoa/CCArray.h" -#include "cocoa/CCGeometry.h" -#include "cocoa/CCSet.h" -#include "cocoa/CCAutoreleasePool.h" -#include "cocoa/CCInteger.h" -#include "cocoa/CCFloat.h" -#include "cocoa/CCDouble.h" -#include "cocoa/CCBool.h" -#include "cocoa/CCString.h" -#include "cocoa/CCNS.h" -#include "cocoa/CCData.h" +#include "CCAffineTransform.h" +#include "CCDictionary.h" +#include "CCObject.h" +#include "CCArray.h" +#include "CCGeometry.h" +#include "CCSet.h" +#include "CCAutoreleasePool.h" +#include "CCInteger.h" +#include "CCFloat.h" +#include "CCDouble.h" +#include "CCBool.h" +#include "CCString.h" +#include "CCNS.h" +#include "CCData.h" // draw nodes -#include "draw_nodes/CCDrawingPrimitives.h" -#include "draw_nodes/CCDrawNode.h" +#include "CCDrawingPrimitives.h" +#include "CCDrawNode.h" // effects -#include "effects/CCGrabber.h" -#include "effects/CCGrid.h" +#include "CCGrabber.h" +#include "CCGrid.h" // include #include "CCEventType.h" @@ -87,40 +87,44 @@ THE SOFTWARE. #include "ccTypes.h" // label_nodes -#include "label_nodes/CCLabelAtlas.h" -#include "label_nodes/CCLabelTTF.h" -#include "label_nodes/CCLabelBMFont.h" -#include "label_nodes/CCLabel.h" +#include "CCLabelAtlas.h" +#include "CCLabelTTF.h" +#include "CCLabelBMFont.h" +#include "CCLabel.h" // layers_scenes_transitions_nodes -#include "layers_scenes_transitions_nodes/CCLayer.h" -#include "layers_scenes_transitions_nodes/CCScene.h" -#include "layers_scenes_transitions_nodes/CCTransition.h" -#include "layers_scenes_transitions_nodes/CCTransitionPageTurn.h" -#include "layers_scenes_transitions_nodes/CCTransitionProgress.h" +#include "CCLayer.h" +#include "CCScene.h" +#include "CCTransition.h" +#include "CCTransitionPageTurn.h" +#include "CCTransitionProgress.h" // menu_nodes -#include "menu_nodes/CCMenu.h" -#include "menu_nodes/CCMenuItem.h" +#include "CCMenu.h" +#include "CCMenuItem.h" // misc_nodes -#include "misc_nodes/CCClippingNode.h" -#include "misc_nodes/CCMotionStreak.h" -#include "misc_nodes/CCProgressTimer.h" -#include "misc_nodes/CCRenderTexture.h" +#include "CCClippingNode.h" +#include "CCMotionStreak.h" +#include "CCProgressTimer.h" +#include "CCRenderTexture.h" // particle_nodes -#include "particle_nodes/CCParticleBatchNode.h" -#include "particle_nodes/CCParticleSystem.h" -#include "particle_nodes/CCParticleExamples.h" -#include "particle_nodes/CCParticleSystemQuad.h" +#include "CCParticleBatchNode.h" +#include "CCParticleSystem.h" +#include "CCParticleExamples.h" +#include "CCParticleSystemQuad.h" // physics -#include "physics/CCPhysicsBody.h" -#include "physics/CCPhysicsContact.h" -#include "physics/CCPhysicsShape.h" -#include "physics/CCPhysicsJoint.h" -#include "physics/CCPhysicsWorld.h" +#include "CCPhysicsBody.h" +#include "CCPhysicsContact.h" +#include "CCPhysicsShape.h" +#include "CCPhysicsJoint.h" +#include "CCPhysicsWorld.h" + +// kazmath +#include "kazmath/kazmath.h" +#include "kazmath/GL/matrix.h" // platform #include "platform/CCDevice.h" @@ -129,8 +133,8 @@ THE SOFTWARE. #include "platform/CCImage.h" #include "platform/CCSAXParser.h" #include "platform/CCThread.h" -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformConfig.h" +#include "CCPlatformMacros.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #include "platform/ios/CCApplication.h" @@ -175,58 +179,57 @@ THE SOFTWARE. #endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX // script_support -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" // shaders -#include "shaders/CCGLProgram.h" -#include "shaders/ccGLStateCache.h" -#include "shaders/CCShaderCache.h" -#include "shaders/ccShaders.h" +#include "CCGLProgram.h" +#include "ccGLStateCache.h" +#include "CCShaderCache.h" +#include "ccShaders.h" // sprite_nodes -#include "sprite_nodes/CCAnimation.h" -#include "sprite_nodes/CCAnimationCache.h" -#include "sprite_nodes/CCSprite.h" -#include "sprite_nodes/CCSpriteBatchNode.h" -#include "sprite_nodes/CCSpriteFrame.h" -#include "sprite_nodes/CCSpriteFrameCache.h" +#include "CCAnimation.h" +#include "CCAnimationCache.h" +#include "CCSprite.h" +#include "CCSpriteBatchNode.h" +#include "CCSpriteFrame.h" +#include "CCSpriteFrameCache.h" // support -#include "support/ccUTF8.h" -#include "support/CCNotificationCenter.h" -#include "support/CCProfiling.h" -#include "support/user_default/CCUserDefault.h" -#include "support/CCVertex.h" -#include "support/tinyxml2/tinyxml2.h" +#include "ccUTF8.h" +#include "CCNotificationCenter.h" +#include "CCProfiling.h" +#include "CCUserDefault.h" +#include "CCVertex.h" // text_input_node -#include "text_input_node/CCIMEDelegate.h" -#include "text_input_node/CCIMEDispatcher.h" -#include "text_input_node/CCTextFieldTTF.h" +#include "CCIMEDelegate.h" +#include "CCIMEDispatcher.h" +#include "CCTextFieldTTF.h" // textures -#include "textures/CCTexture2D.h" -#include "textures/CCTextureAtlas.h" -#include "textures/CCTextureCache.h" +#include "CCTexture2D.h" +#include "CCTextureAtlas.h" +#include "CCTextureCache.h" // tilemap_parallax_nodes -#include "tilemap_parallax_nodes/CCParallaxNode.h" -#include "tilemap_parallax_nodes/CCTMXLayer.h" -#include "tilemap_parallax_nodes/CCTMXObjectGroup.h" -#include "tilemap_parallax_nodes/CCTMXTiledMap.h" -#include "tilemap_parallax_nodes/CCTMXXMLParser.h" -#include "tilemap_parallax_nodes/CCTileMapAtlas.h" +#include "CCParallaxNode.h" +#include "CCTMXLayer.h" +#include "CCTMXObjectGroup.h" +#include "CCTMXTiledMap.h" +#include "CCTMXXMLParser.h" +#include "CCTileMapAtlas.h" // EventDispatcher -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" -#include "event_dispatcher/CCEventTouch.h" -#include "event_dispatcher/CCEventListenerKeyboard.h" -#include "event_dispatcher/CCEventKeyboard.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventListenerAcceleration.h" -#include "event_dispatcher/CCEventCustom.h" -#include "event_dispatcher/CCEventListenerCustom.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" +#include "CCEventTouch.h" +#include "CCEventListenerKeyboard.h" +#include "CCEventKeyboard.h" +#include "CCEventAcceleration.h" +#include "CCEventListenerAcceleration.h" +#include "CCEventCustom.h" +#include "CCEventListenerCustom.h" // root #include "CCCamera.h" @@ -235,8 +238,8 @@ THE SOFTWARE. #include "CCScheduler.h" // component -#include "support/component/CCComponent.h" -#include "support/component/CCComponentContainer.h" +#include "CCComponent.h" +#include "CCComponentContainer.h" // Deprecated include #include "CCDeprecated.h" diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj rename to cocos/2d/cocos2d.vcxproj diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj.filters b/cocos/2d/cocos2d.vcxproj.filters similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj.filters rename to cocos/2d/cocos2d.vcxproj.filters diff --git a/cocos/2d/proj.win32/cocos2d.vcxproj.user b/cocos/2d/cocos2d.vcxproj.user similarity index 100% rename from cocos/2d/proj.win32/cocos2d.vcxproj.user rename to cocos/2d/cocos2d.vcxproj.user diff --git a/cocos/2d/proj.linux/cocos2dx.mk b/cocos/2d/cocos2dx.mk similarity index 100% rename from cocos/2d/proj.linux/cocos2dx.mk rename to cocos/2d/cocos2dx.mk diff --git a/cocos/2d/proj.win32/cocos2dx.props b/cocos/2d/cocos2dx.props similarity index 100% rename from cocos/2d/proj.win32/cocos2dx.props rename to cocos/2d/cocos2dx.props diff --git a/cocos/2d/particle-nodes/firePngData.h b/cocos/2d/firePngData.h similarity index 100% rename from cocos/2d/particle-nodes/firePngData.h rename to cocos/2d/firePngData.h diff --git a/cocos/2d/platform/CCEGLViewProtocol.cpp b/cocos/2d/platform/CCEGLViewProtocol.cpp index 985cbb51c7..7c5359b092 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.cpp +++ b/cocos/2d/platform/CCEGLViewProtocol.cpp @@ -1,8 +1,8 @@ #include "CCEGLViewProtocol.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCDirector.h" -#include "cocoa/CCSet.h" -#include "event_dispatcher/CCEventDispatcher.h" +#include "CCSet.h" +#include "CCEventDispatcher.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/CCEGLViewProtocol.h b/cocos/2d/platform/CCEGLViewProtocol.h index 718c415850..b8744d0dd1 100644 --- a/cocos/2d/platform/CCEGLViewProtocol.h +++ b/cocos/2d/platform/CCEGLViewProtocol.h @@ -2,7 +2,7 @@ #define __CCEGLVIEWPROTOCOL_H__ #include "ccTypes.h" -#include "event_dispatcher/CCEventTouch.h" +#include "CCEventTouch.h" #include diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index 6f286607fb..e9e01589e2 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -24,11 +24,11 @@ THE SOFTWARE. #include "CCFileUtils.h" #include "CCDirector.h" -#include "cocoa/CCDictionary.h" -#include "cocoa/CCString.h" +#include "CCDictionary.h" +#include "CCString.h" #include "CCSAXParser.h" -#include "support/tinyxml2/tinyxml2.h" -#include "support/zip_support/unzip.h" +#include "tinyxml2.h" +#include "unzip.h" #include using namespace std; diff --git a/cocos/2d/platform/CCImage.h b/cocos/2d/platform/CCImage.h index f6eba03132..25f09dade2 100644 --- a/cocos/2d/platform/CCImage.h +++ b/cocos/2d/platform/CCImage.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CC_IMAGE_H__ #define __CC_IMAGE_H__ -#include "cocoa/CCObject.h" -#include "textures/CCTexture2D.h" +#include "CCObject.h" +#include "CCTexture2D.h" // premultiply alpha, or the effect will wrong when want to use other pixel format in Texture2D, // such as RGB888, RGB5A1 diff --git a/cocos/2d/platform/CCImageCommon_cpp.h b/cocos/2d/platform/CCImageCommon_cpp.h index 8c62e2288e..be7480a0ae 100644 --- a/cocos/2d/platform/CCImageCommon_cpp.h +++ b/cocos/2d/platform/CCImageCommon_cpp.h @@ -40,25 +40,20 @@ extern "C" #include "etc1.h" #include "jpeglib.h" } -#include "third_party/common/s3tc/s3tc.h" -#include "third_party/common/atitc/atitc.h" -#if defined(__native_client__) || defined(EMSCRIPTEN) -// TODO(sbc): I'm pretty sure all platforms should be including -// webph headers in this way. -#include "webp/decode.h" -#else +#include "s3tc.h" +#include "atitc.h" + #include "decode.h" -#endif #include "ccMacros.h" -#include "platform/CCCommon.h" +#include "CCCommon.h" #include "CCStdC.h" #include "CCFileUtils.h" #include "CCConfiguration.h" -#include "support/ccUtils.h" -#include "support/zip_support/ZipUtils.h" +#include "ccUtils.h" +#include "ZipUtils.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include "platform/android/CCFileUtilsAndroid.h" +#include "android/CCFileUtilsAndroid.h" #endif #define CC_GL_ATC_RGB_AMD 0x8C92 diff --git a/cocos/2d/platform/CCSAXParser.cpp b/cocos/2d/platform/CCSAXParser.cpp index 7a857452e0..0f823f938d 100644 --- a/cocos/2d/platform/CCSAXParser.cpp +++ b/cocos/2d/platform/CCSAXParser.cpp @@ -23,9 +23,9 @@ ****************************************************************************/ #include "CCSAXParser.h" -#include "cocoa/CCDictionary.h" +#include "CCDictionary.h" #include "CCFileUtils.h" -#include "support/tinyxml2/tinyxml2.h" +#include "tinyxml2.h" #include // because its based on windows 8 build :P diff --git a/cocos/2d/platform/android/Android.mk b/cocos/2d/platform/android/Android.mk index a599507dc3..2aca5c8ed3 100644 --- a/cocos/2d/platform/android/Android.mk +++ b/cocos/2d/platform/android/Android.mk @@ -24,9 +24,9 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/../.. \ - $(LOCAL_PATH)/../../include \ - $(LOCAL_PATH)/../../kazmath/include \ - $(LOCAL_PATH)/../../platform/third_party/common/etc + $(LOCAL_PATH)/../../../base \ + $(LOCAL_PATH)/../../../math/kazmath/include \ + $(LOCAL_PATH)/../../../physics LOCAL_LDLIBS := -lGLESv1_CM \ -lGLESv2 \ @@ -47,8 +47,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES := android_native_app_glue cocos_libpng_static coco include $(BUILD_STATIC_LIBRARY) -$(call import-module,libjpeg) -$(call import-module,libpng) -$(call import-module,libtiff) -$(call import-module,libwebp) +$(call import-module,jpeg/prebuilt/android) +$(call import-module,png/prebuilt/android) +$(call import-module,tiff/prebuilt/android) +$(call import-module,webp/prebuilt/android) $(call import-module,android/native_app_glue) diff --git a/cocos/2d/platform/android/CCEGLView.cpp b/cocos/2d/platform/android/CCEGLView.cpp index 384773f119..0347d70a87 100644 --- a/cocos/2d/platform/android/CCEGLView.cpp +++ b/cocos/2d/platform/android/CCEGLView.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "CCEGLView.h" -#include "cocoa/CCSet.h" +#include "CCSet.h" #include "CCDirector.h" #include "ccMacros.h" #include "jni/IMEJni.h" diff --git a/cocos/2d/platform/android/CCEGLView.h b/cocos/2d/platform/android/CCEGLView.h index 2432a2cee7..cab0754d3e 100644 --- a/cocos/2d/platform/android/CCEGLView.h +++ b/cocos/2d/platform/android/CCEGLView.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_EGLVIEW_ANDROID_H__ #define __CC_EGLVIEW_ANDROID_H__ -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/CCFileUtilsAndroid.h b/cocos/2d/platform/android/CCFileUtilsAndroid.h index a0e020bc85..87a2445f48 100644 --- a/cocos/2d/platform/android/CCFileUtilsAndroid.h +++ b/cocos/2d/platform/android/CCFileUtilsAndroid.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_ANDROID_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/android/CCImage.cpp b/cocos/2d/platform/android/CCImage.cpp index 8c4c636422..0fdfe6445e 100644 --- a/cocos/2d/platform/android/CCImage.cpp +++ b/cocos/2d/platform/android/CCImage.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #define __CC_PLATFORM_IMAGE_CPP__ #include "platform/CCImageCommon_cpp.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "platform/CCImage.h" #include "platform/CCFileUtils.h" #include "jni/JniHelper.h" diff --git a/cocos/2d/platform/android/CCStdC.h b/cocos/2d/platform/android/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/android/CCStdC.h +++ b/cocos/2d/platform/android/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/android/jni/IMEJni.cpp b/cocos/2d/platform/android/jni/IMEJni.cpp index e9b0f0321c..1529374275 100644 --- a/cocos/2d/platform/android/jni/IMEJni.cpp +++ b/cocos/2d/platform/android/jni/IMEJni.cpp @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "IMEJni.h" -#include "text_input_node/CCIMEDispatcher.h" +#include "CCIMEDispatcher.h" #include "JniHelper.h" #include diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp index 21977aadd1..5ed0fc7279 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp @@ -4,7 +4,7 @@ #include "../CCApplication.h" #include "platform/CCFileUtils.h" #include "CCEventType.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include using namespace cocos2d; diff --git a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp index afcc4b7d3e..6af1c6b1f7 100644 --- a/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp +++ b/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp @@ -3,7 +3,7 @@ #include #include #include "JniHelper.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include "Java_org_cocos2dx_lib_Cocos2dxHelper.h" #define LOG_TAG "Java_org_cocos2dx_lib_Cocos2dxHelper.cpp" diff --git a/cocos/2d/platform/android/jni/JniHelper.h b/cocos/2d/platform/android/jni/JniHelper.h index fe1bf38814..20955acf7e 100644 --- a/cocos/2d/platform/android/jni/JniHelper.h +++ b/cocos/2d/platform/android/jni/JniHelper.h @@ -26,7 +26,7 @@ THE SOFTWARE. #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/android/nativeactivity.cpp b/cocos/2d/platform/android/nativeactivity.cpp index b591953fb8..fa4fb434d4 100644 --- a/cocos/2d/platform/android/nativeactivity.cpp +++ b/cocos/2d/platform/android/nativeactivity.cpp @@ -16,17 +16,17 @@ #include "CCDirector.h" #include "CCApplication.h" #include "CCEventType.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #include "CCFileUtilsAndroid.h" #include "jni/JniHelper.h" #include "CCEGLView.h" -#include "draw_nodes/CCDrawingPrimitives.h" -#include "shaders/CCShaderCache.h" -#include "textures/CCTextureCache.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventAcceleration.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCDrawingPrimitives.h" +#include "CCShaderCache.h" +#include "CCTextureCache.h" +#include "CCEventDispatcher.h" +#include "CCEventAcceleration.h" +#include "CCEventKeyboard.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.mm b/cocos/2d/platform/apple/CCFileUtilsApple.mm index 34de65fee6..811a4189b1 100644 --- a/cocos/2d/platform/apple/CCFileUtilsApple.mm +++ b/cocos/2d/platform/apple/CCFileUtilsApple.mm @@ -26,12 +26,12 @@ THE SOFTWARE. #include #include -#include "cocoa/CCString.h" +#include "CCString.h" #include "CCFileUtils.h" #include "CCDirector.h" #include "CCSAXParser.h" #include "CCDictionary.h" -#include "support/zip_support/unzip.h" +#include "unzip.h" #include "CCFileUtilsApple.h" diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm index e84eb4196d..83212d575d 100644 --- a/cocos/2d/platform/ios/CCDevice.mm +++ b/cocos/2d/platform/ios/CCDevice.mm @@ -1,7 +1,7 @@ #include "CCDevice.h" #include "ccTypes.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventAcceleration.h" +#include "CCEventDispatcher.h" +#include "CCEventAcceleration.h" #import diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h index 7dfb474c8e..944be4926a 100644 --- a/cocos/2d/platform/ios/CCESRenderer.h +++ b/cocos/2d/platform/ios/CCESRenderer.h @@ -28,7 +28,7 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #import #import diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/ios/CCStdC.h +++ b/cocos/2d/platform/ios/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/linux/CCEGLView.cpp b/cocos/2d/platform/linux/CCEGLView.cpp index 384bd05796..452d5738a3 100644 --- a/cocos/2d/platform/linux/CCEGLView.cpp +++ b/cocos/2d/platform/linux/CCEGLView.cpp @@ -9,10 +9,10 @@ #include "CCGL.h" #include "ccMacros.h" #include "CCDirector.h" -#include "event_dispatcher/CCTouch.h" -#include "text_input_node/CCIMEDispatcher.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "/CCIMEDispatcher.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" #include NS_CC_BEGIN diff --git a/cocos/2d/platform/linux/CCEGLView.h b/cocos/2d/platform/linux/CCEGLView.h index 5dae9ec609..9d29d9c188 100644 --- a/cocos/2d/platform/linux/CCEGLView.h +++ b/cocos/2d/platform/linux/CCEGLView.h @@ -9,7 +9,7 @@ #define EGLVIEW_H_ #include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" #include "platform/third_party/linux/glfw/glfw3.h" #include diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp index 13a88a1c3d..227c59b0ba 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.cpp +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.cpp @@ -8,7 +8,7 @@ #include "platform/CCCommon.h" #include "ccMacros.h" #include "CCApplication.h" -#include "cocoa/CCString.h" +#include "CCString.h" #include #include #include diff --git a/cocos/2d/platform/linux/CCFileUtilsLinux.h b/cocos/2d/platform/linux/CCFileUtilsLinux.h index 9aed872e80..366f8d08f5 100644 --- a/cocos/2d/platform/linux/CCFileUtilsLinux.h +++ b/cocos/2d/platform/linux/CCFileUtilsLinux.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_LINUX_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/linux/CCImage.cpp b/cocos/2d/platform/linux/CCImage.cpp index 9c70245d19..551595c709 100644 --- a/cocos/2d/platform/linux/CCImage.cpp +++ b/cocos/2d/platform/linux/CCImage.cpp @@ -7,7 +7,7 @@ #include #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #define __CC_PLATFORM_IMAGE_CPP__ #include "platform/CCImageCommon_cpp.h" #include "platform/CCImage.h" diff --git a/cocos/2d/platform/linux/CCStdC.h b/cocos/2d/platform/linux/CCStdC.h index 399de60778..7fd6339bef 100644 --- a/cocos/2d/platform/linux/CCStdC.h +++ b/cocos/2d/platform/linux/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include diff --git a/cocos/2d/platform/mac/CCEGLView.h b/cocos/2d/platform/mac/CCEGLView.h index 222bba5348..5f001b9061 100644 --- a/cocos/2d/platform/mac/CCEGLView.h +++ b/cocos/2d/platform/mac/CCEGLView.h @@ -27,7 +27,7 @@ #include "platform/CCCommon.h" #include "platform/CCEGLViewProtocol.h" -#include "platform/third_party/mac/glfw/glfw3.h" +#include "glfw3.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCEGLView.mm b/cocos/2d/platform/mac/CCEGLView.mm index 3c371b2457..d8dce7ba57 100644 --- a/cocos/2d/platform/mac/CCEGLView.mm +++ b/cocos/2d/platform/mac/CCEGLView.mm @@ -25,9 +25,9 @@ #include "EAGLView.h" #include "CCDirector.h" #include "CCSet.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" #include "CCIMEDispatcher.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/mac/CCEventDispatcher.mm b/cocos/2d/platform/mac/CCEventDispatcher.mm index f316b170c7..6487d877a1 100644 --- a/cocos/2d/platform/mac/CCEventDispatcher.mm +++ b/cocos/2d/platform/mac/CCEventDispatcher.mm @@ -29,7 +29,7 @@ #import "CCEventDispatcher.h" #import "ccConfig.h" -#include "support/data_support/utlist.h" +#include "utlist.h" #include "CCDirector.h" #include "platform/mac/CCEventDispatcher.h" diff --git a/cocos/2d/platform/mac/CCStdC.h b/cocos/2d/platform/mac/CCStdC.h index 16fb8d768b..475142b51a 100644 --- a/cocos/2d/platform/mac/CCStdC.h +++ b/cocos/2d/platform/mac/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #include #include diff --git a/cocos/2d/platform/win32/CCEGLView.cpp b/cocos/2d/platform/win32/CCEGLView.cpp index cefcc9f038..4099331cf9 100644 --- a/cocos/2d/platform/win32/CCEGLView.cpp +++ b/cocos/2d/platform/win32/CCEGLView.cpp @@ -23,14 +23,14 @@ THE SOFTWARE. ****************************************************************************/ #include "CCEGLView.h" -#include "cocoa/CCSet.h" +#include "CCSet.h" #include "ccMacros.h" #include "CCDirector.h" -#include "text_input_node/CCIMEDispatcher.h" +#include "/CCIMEDispatcher.h" #include "CCApplication.h" -#include "event_dispatcher/CCTouch.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventKeyboard.h" +#include "CCTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventKeyboard.h" NS_CC_BEGIN diff --git a/cocos/2d/platform/win32/CCEGLView.h b/cocos/2d/platform/win32/CCEGLView.h index 5c5a2b4407..643b500c66 100644 --- a/cocos/2d/platform/win32/CCEGLView.h +++ b/cocos/2d/platform/win32/CCEGLView.h @@ -27,7 +27,7 @@ THE SOFTWARE. #include "CCStdC.h" #include "platform/CCCommon.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include "platform/CCEGLViewProtocol.h" #include "platform/third_party/win32/GLFW/glfw3.h" diff --git a/cocos/2d/platform/win32/CCFileUtilsWin32.h b/cocos/2d/platform/win32/CCFileUtilsWin32.h index bd52a82ede..4f01adabeb 100644 --- a/cocos/2d/platform/win32/CCFileUtilsWin32.h +++ b/cocos/2d/platform/win32/CCFileUtilsWin32.h @@ -25,7 +25,7 @@ #define __CC_FILEUTILS_WIN32_H__ #include "platform/CCFileUtils.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "ccTypes.h" #include #include diff --git a/cocos/2d/platform/win32/CCStdC.h b/cocos/2d/platform/win32/CCStdC.h index a361e5b056..4716dc6524 100644 --- a/cocos/2d/platform/win32/CCStdC.h +++ b/cocos/2d/platform/win32/CCStdC.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include // for math.h on win32 platform diff --git a/cocos/2d/proj.linux/.cproject b/cocos/2d/proj.linux/.cproject deleted file mode 100755 index aaae232fb4..0000000000 --- a/cocos/2d/proj.linux/.cproject +++ /dev/null @@ -1,602 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cocos/2d/proj.linux/.project b/cocos/2d/proj.linux/.project deleted file mode 100755 index 8811b56dd0..0000000000 --- a/cocos/2d/proj.linux/.project +++ /dev/null @@ -1,256 +0,0 @@ - - - libcocos2d - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/cocos2dx-base/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - CCCamera.cpp - 1 - PARENT-1-PROJECT_LOC/CCCamera.cpp - - - CCConfiguration.cpp - 1 - PARENT-1-PROJECT_LOC/CCConfiguration.cpp - - - CCConfiguration.h - 1 - PARENT-1-PROJECT_LOC/CCConfiguration.h - - - ccFPSImages.c - 1 - PARENT-1-PROJECT_LOC/ccFPSImages.c - - - ccFPSImages.h - 1 - PARENT-1-PROJECT_LOC/ccFPSImages.h - - - ccTypes.cpp - 1 - PARENT-1-PROJECT_LOC/ccTypes.cpp - - - CCDirector.cpp - 1 - PARENT-1-PROJECT_LOC/CCDirector.cpp - - - CCScheduler.cpp - 1 - PARENT-1-PROJECT_LOC/CCScheduler.cpp - - - actions - 2 - PARENT-1-PROJECT_LOC/actions - - - base_nodes - 2 - PARENT-1-PROJECT_LOC/base_nodes - - - cocoa - 2 - PARENT-1-PROJECT_LOC/cocoa - - - cocos2d.cpp - 1 - PARENT-1-PROJECT_LOC/cocos2d.cpp - - - draw_nodes - 2 - PARENT-1-PROJECT_LOC/draw_nodes - - - effects - 2 - PARENT-1-PROJECT_LOC/effects - - - include - 2 - PARENT-1-PROJECT_LOC/include - - - kazmath - 2 - PARENT-1-PROJECT_LOC/kazmath - - - keypad_dispatcher - 2 - PARENT-1-PROJECT_LOC/keypad_dispatcher - - - keyboard_dispatcher - 2 - PARENT-1-PROJECT_LOC/keyboard_dispatcher - - - label_nodes - 2 - PARENT-1-PROJECT_LOC/label_nodes - - - layers_scenes_transitions_nodes - 2 - PARENT-1-PROJECT_LOC/layers_scenes_transitions_nodes - - - menu_nodes - 2 - PARENT-1-PROJECT_LOC/menu_nodes - - - misc_nodes - 2 - PARENT-1-PROJECT_LOC/misc_nodes - - - particle_nodes - 2 - PARENT-1-PROJECT_LOC/particle_nodes - - - platform - 2 - PARENT-1-PROJECT_LOC/platform - - - script_support - 2 - PARENT-1-PROJECT_LOC/script_support - - - shaders - 2 - PARENT-1-PROJECT_LOC/shaders - - - sprite_nodes - 2 - PARENT-1-PROJECT_LOC/sprite_nodes - - - support - 2 - PARENT-1-PROJECT_LOC/support - - - text_input_node - 2 - PARENT-1-PROJECT_LOC/text_input_node - - - textures - 2 - PARENT-1-PROJECT_LOC/textures - - - tilemap_parallax_nodes - 2 - PARENT-1-PROJECT_LOC/tilemap_parallax_nodes - - - touch_dispatcher - 2 - PARENT-1-PROJECT_LOC/touch_dispatcher - - - - - 1360135975775 - platform - 9 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-true-false-linux - - - - diff --git a/cocos/2d/proj.linux/cocos2dx.prf b/cocos/2d/proj.linux/cocos2dx.prf deleted file mode 100644 index 1122180b53..0000000000 --- a/cocos/2d/proj.linux/cocos2dx.prf +++ /dev/null @@ -1,37 +0,0 @@ -################################################################################ -# Do not include this file in your project: see cocos2dx.pri. -################################################################################ - -linux { - # Use OpenAL in default QtCreator project. - isEmpty(COCOS2D_USE_FMOD):COCOS2D_USE_FMOD=0 - - # Variables used when building libraries. - CC_LIBRARY_DIR = $$PWD/../../lib/linux/release - CC_MAKE_FLAGS = -s - CONFIG(debug, debug|release) { - # Override in debug build. - CC_MAKE_FLAGS += DEBUG=1 - CC_LIBRARY_DIR = $$PWD/../../lib/linux/debug - } - contains(COCOS2D_MODULES,box2d) { - CC_MAKE_FLAGS += USE_BOX2D=1 - } - !equals(COCOS2D_USE_FMOD, 1) { - CC_MAKE_FLAGS += OPENAL=1 - } - - # We will compile cocos2d shared library on demand using Makefile. - build_cocos2d.name = Build cocos2d shared library - build_cocos2d.input = $$PWD/Makefile - build_cocos2d.output = $$CC_LIBRARY_DIR/libcocos2d.so - build_cocos2d.target = $$CC_LIBRARY_DIR/libcocos2d.so - build_cocos2d.CONFIG = no_link target_predeps - build_cocos2d.commands = cd $$PWD && make $$CC_MAKE_FLAGS ${QMAKE_FILE_IN} - - QMAKE_EXTRA_COMPILERS += build_cocos2d - QMAKE_EXTRA_TARGETS += build_cocos2d - - PRE_TARGETDEPS += $$CC_LIBRARY_DIR/libcocos2d.so - LIBS += -L$$CC_LIBRARY_DIR -lcocos2d -Wl,-rpath,\'$$CC_LIBRARY_DIR\' -} diff --git a/cocos/2d/proj.linux/cocos2dx.pri b/cocos/2d/proj.linux/cocos2dx.pri deleted file mode 100644 index 84bbb6d987..0000000000 --- a/cocos/2d/proj.linux/cocos2dx.pri +++ /dev/null @@ -1,70 +0,0 @@ - -################################################################################ -# -# If you want enable extra modules, set COCOS2D_MODULES variable before include -# this file, example: -# COCOS2D_MODULES += CocosDenshion -# COCOS2D_MODULES += extensions -# COCOS2D_MODULES += box2d -# or -# COCOS2D_MODULES += chipmunk -# note: you cannot include both box2d and chipmunk. -# -# By default, QtCreator project will use OpenAL audio backend (because FMOD is -# free only for non-commercial use). If you are legal FMOD user, set variable -# COCOS2D_USE_FMOD to use FMOD audio backend: -# COCOS2D_USE_FMOD = 1 -# -################################################################################ - -INCLUDEPATH += $$PWD/../ -INCLUDEPATH += $$PWD/../cocoa/ -INCLUDEPATH += $$PWD/../include/ -INCLUDEPATH += $$PWD/../platform/ -INCLUDEPATH += $$PWD/../kazmath/include - -*-msvc* { - # Use equivalents of -Wno-overloaded-virtual -Wno-unused-parameter. - QMAKE_CXXFLAGS_WARN_ON += /wd4263 /wd4100 -} else { - QMAKE_CXXFLAGS_WARN_ON += -Wno-ignored-qualifiers -Wno-overloaded-virtual -Wno-unused-parameter -Wno-unused-function - QMAKE_CXXFLAGS += -std=c++0x -} - -include($$PWD/cocos2dx.prf) - -linux { - DEFINES += LINUX - INCLUDEPATH += $$PWD/../platform/linux - LIBS += -lpthread -} - -contains(COCOS2D_MODULES,CocosDenshion) { - INCLUDEPATH += $$PWD/../../CocosDenshion/include - include($$PWD/../../CocosDenshion/proj.linux/CocosDenshion.prf) -} - -contains(COCOS2D_MODULES,extensions) { - INCLUDEPATH += $$PWD/../../extensions - LIBS += -lcurl - include($$PWD/../../extensions/proj.linux/extensions.prf) -} - -contains(COCOS2D_MODULES,box2d) { - INCLUDEPATH += $$PWD/../../external - include($$PWD/../../external/Box2D/proj.linux/box2d.prf) -} - -contains(COCOS2D_MODULES,chipmunk) { - contains(COCOS2D_MODULES,box2d):error("COCOS2D_MODULES cannot contain both box2d and chipmunk: choose one and remove another.") - - INCLUDEPATH += $$PWD/../../external/chipmunk/include/chipmunk - include($$PWD/../../external/chipmunk/proj.linux/chipmunk.prf) -} - -CONFIG(debug, debug|release) { - DEFINES += COCOS2D_DEBUG=1 -} -else { - DEFINES += COCOS2D_DEBUG=0 -} diff --git a/cocos/2d/support/tinyxml2/tinyxml2.cpp b/cocos/2d/support/tinyxml2/tinyxml2.cpp deleted file mode 100644 index f181b9050c..0000000000 --- a/cocos/2d/support/tinyxml2/tinyxml2.cpp +++ /dev/null @@ -1,2101 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#include "tinyxml2.h" - -#include // yes, this one new style header, is in the Android SDK. -# if defined(ANDROID_NDK) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -# include -#else -# include -#endif - -static const char LINE_FEED = (char)0x0a; // all line endings are normalized to LF -static const char LF = LINE_FEED; -static const char CARRIAGE_RETURN = (char)0x0d; // CR gets filtered out -static const char CR = CARRIAGE_RETURN; -static const char SINGLE_QUOTE = '\''; -static const char DOUBLE_QUOTE = '\"'; - -// Bunch of unicode info at: -// http://www.unicode.org/faq/utf_bom.html -// ef bb bf (Microsoft "lead bytes") - designates UTF-8 - -static const unsigned char TIXML_UTF_LEAD_0 = 0xefU; -static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; -static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; - - -#define DELETE_NODE( node ) { \ - if ( node ) { \ - MemPool* pool = node->_memPool; \ - node->~XMLNode(); \ - pool->Free( node ); \ - } \ - } -#define DELETE_ATTRIBUTE( attrib ) { \ - if ( attrib ) { \ - MemPool* pool = attrib->_memPool; \ - attrib->~XMLAttribute(); \ - pool->Free( attrib ); \ - } \ - } - -namespace tinyxml2 -{ - -struct Entity { - const char* pattern; - int length; - char value; -}; - -static const int NUM_ENTITIES = 5; -static const Entity entities[NUM_ENTITIES] = { - { "quot", 4, DOUBLE_QUOTE }, - { "amp", 3, '&' }, - { "apos", 4, SINGLE_QUOTE }, - { "lt", 2, '<' }, - { "gt", 2, '>' } -}; - - -StrPair::~StrPair() -{ - Reset(); -} - - -void StrPair::Reset() -{ - if ( _flags & NEEDS_DELETE ) { - delete [] _start; - } - _flags = 0; - _start = 0; - _end = 0; -} - - -void StrPair::SetStr( const char* str, int flags ) -{ - Reset(); - size_t len = strlen( str ); - _start = new char[ len+1 ]; - memcpy( _start, str, len+1 ); - _end = _start + len; - _flags = flags | NEEDS_DELETE; -} - - -char* StrPair::ParseText( char* p, const char* endTag, int strFlags ) -{ - TIXMLASSERT( endTag && *endTag ); - - char* start = p; // fixme: hides a member - char endChar = *endTag; - size_t length = strlen( endTag ); - - // Inner loop of text parsing. - while ( *p ) { - if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) { - Set( start, p, strFlags ); - return p + length; - } - ++p; - } - return 0; -} - - -char* StrPair::ParseName( char* p ) -{ - char* start = p; - - if ( !start || !(*start) ) { - return 0; - } - - while( *p && ( - XMLUtil::IsAlphaNum( (unsigned char) *p ) - || *p == '_' - || *p == ':' - || (*p == '-' && p>start ) // can be in a name, but not lead it. - || (*p == '.' && p>start ) )) { // can be in a name, but not lead it. - ++p; - } - - if ( p > start ) { - Set( start, p, 0 ); - return p; - } - return 0; -} - - -void StrPair::CollapseWhitespace() -{ - // Trim leading space. - _start = XMLUtil::SkipWhiteSpace( _start ); - - if ( _start && *_start ) { - char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( *p ) { - if ( XMLUtil::IsWhiteSpace( *p )) { - p = XMLUtil::SkipWhiteSpace( p ); - if ( *p == 0 ) { - break; // don't write to q; this trims the trailing space. - } - *q = ' '; - ++q; - } - *q = *p; - ++q; - ++p; - } - *q = 0; - } -} - - -const char* StrPair::GetStr() -{ - if ( _flags & NEEDS_FLUSH ) { - *_end = 0; - _flags ^= NEEDS_FLUSH; - - if ( _flags ) { - char* p = _start; // the read pointer - char* q = _start; // the write pointer - - while( p < _end ) { - if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) { - // CR-LF pair becomes LF - // CR alone becomes LF - // LF-CR becomes LF - if ( *(p+1) == LF ) { - p += 2; - } - else { - ++p; - } - *q++ = LF; - } - else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) { - if ( *(p+1) == CR ) { - p += 2; - } - else { - ++p; - } - *q++ = LF; - } - else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) { - // Entities handled by tinyXML2: - // - special entities in the entity table [in/out] - // - numeric character reference [in] - // 中 or 中 - - if ( *(p+1) == '#' ) { - char buf[10] = { 0 }; - int len; - p = const_cast( XMLUtil::GetCharacterRef( p, buf, &len ) ); - for( int i=0; i(p); - // Check for BOM: - if ( *(pu+0) == TIXML_UTF_LEAD_0 - && *(pu+1) == TIXML_UTF_LEAD_1 - && *(pu+2) == TIXML_UTF_LEAD_2 ) { - *bom = true; - p += 3; - } - return p; -} - - -void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) -{ - const unsigned long BYTE_MASK = 0xBF; - const unsigned long BYTE_MARK = 0x80; - const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - - if (input < 0x80) { - *length = 1; - } - else if ( input < 0x800 ) { - *length = 2; - } - else if ( input < 0x10000 ) { - *length = 3; - } - else if ( input < 0x200000 ) { - *length = 4; - } - else { - *length = 0; // This code won't covert this correctly anyway. - return; - } - - output += *length; - - // Scary scary fall throughs. - switch (*length) { - case 4: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 3: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 2: - --output; - *output = (char)((input | BYTE_MARK) & BYTE_MASK); - input >>= 6; - case 1: - --output; - *output = (char)(input | FIRST_BYTE_MARK[*length]); - default: - break; - } -} - - -const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length ) -{ - // Presume an entity, and pull it out. - *length = 0; - - if ( *(p+1) == '#' && *(p+2) ) { - unsigned long ucs = 0; - ptrdiff_t delta = 0; - unsigned mult = 1; - - if ( *(p+2) == 'x' ) { - // Hexadecimal. - if ( !*(p+3) ) { - return 0; - } - - const char* q = p+3; - q = strchr( q, ';' ); - - if ( !q || !*q ) { - return 0; - } - - delta = q-p; - --q; - - while ( *q != 'x' ) { - if ( *q >= '0' && *q <= '9' ) { - ucs += mult * (*q - '0'); - } - else if ( *q >= 'a' && *q <= 'f' ) { - ucs += mult * (*q - 'a' + 10); - } - else if ( *q >= 'A' && *q <= 'F' ) { - ucs += mult * (*q - 'A' + 10 ); - } - else { - return 0; - } - mult *= 16; - --q; - } - } - else { - // Decimal. - if ( !*(p+2) ) { - return 0; - } - - const char* q = p+2; - q = strchr( q, ';' ); - - if ( !q || !*q ) { - return 0; - } - - delta = q-p; - --q; - - while ( *q != '#' ) { - if ( *q >= '0' && *q <= '9' ) { - ucs += mult * (*q - '0'); - } - else { - return 0; - } - mult *= 10; - --q; - } - } - // convert the UCS to UTF-8 - ConvertUTF32ToUTF8( ucs, value, length ); - return p + delta + 1; - } - return p+1; -} - - -void XMLUtil::ToStr( int v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ); -} - - -void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%u", v ); -} - - -void XMLUtil::ToStr( bool v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 ); -} - - -void XMLUtil::ToStr( float v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); -} - - -void XMLUtil::ToStr( double v, char* buffer, int bufferSize ) -{ - TIXML_SNPRINTF( buffer, bufferSize, "%g", v ); -} - - -bool XMLUtil::ToInt( const char* str, int* value ) -{ - if ( TIXML_SSCANF( str, "%d", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToUnsigned( const char* str, unsigned *value ) -{ - if ( TIXML_SSCANF( str, "%u", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToBool( const char* str, bool* value ) -{ - int ival = 0; - if ( ToInt( str, &ival )) { - *value = (ival==0) ? false : true; - return true; - } - if ( StringEqual( str, "true" ) ) { - *value = true; - return true; - } - else if ( StringEqual( str, "false" ) ) { - *value = false; - return true; - } - return false; -} - - -bool XMLUtil::ToFloat( const char* str, float* value ) -{ - if ( TIXML_SSCANF( str, "%f", value ) == 1 ) { - return true; - } - return false; -} - -bool XMLUtil::ToDouble( const char* str, double* value ) -{ - if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) { - return true; - } - return false; -} - - -char* XMLDocument::Identify( char* p, XMLNode** node ) -{ - XMLNode* returnNode = 0; - char* start = p; - p = XMLUtil::SkipWhiteSpace( p ); - if( !p || !*p ) { - return p; - } - - // What is this thing? - // - Elements start with a letter or underscore, but xml is reserved. - // - Comments: - // - // With a special case: - // - // - // - // - // Where the closing element (/foo) *must* be the next thing after the opening - // element, and the names must match. BUT the tricky bit is that the closing - // element will be read by the child. - // - // 'endTag' is the end tag for this node, it is returned by a call to a child. - // 'parentEnd' is the end tag for the parent, which is filled in and returned. - - while( p && *p ) { - XMLNode* node = 0; - - p = _document->Identify( p, &node ); - if ( p == 0 || node == 0 ) { - break; - } - - StrPair endTag; - p = node->ParseDeep( p, &endTag ); - if ( !p ) { - DELETE_NODE( node ); - node = 0; - if ( !_document->Error() ) { - _document->SetError( XML_ERROR_PARSING, 0, 0 ); - } - break; - } - - // We read the end tag. Return it to the parent. - if ( node->ToElement() && node->ToElement()->ClosingType() == XMLElement::CLOSING ) { - if ( parentEnd ) { - *parentEnd = static_cast(node)->_value; - } - node->_memPool->SetTracked(); // created and then immediately deleted. - DELETE_NODE( node ); - return p; - } - - // Handle an end tag returned to this level. - // And handle a bunch of annoying errors. - XMLElement* ele = node->ToElement(); - if ( ele ) { - if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - else if ( !endTag.Empty() ) { - if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) { - _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 ); - p = 0; - } - } - } - if ( p == 0 ) { - DELETE_NODE( node ); - node = 0; - } - if ( node ) { - this->InsertEndChild( node ); - } - } - return 0; -} - -// --------- XMLText ---------- // -char* XMLText::ParseDeep( char* p, StrPair* ) -{ - const char* start = p; - if ( this->CData() ) { - p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 ); - } - return p; - } - else { - int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES; - if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) { - flags |= StrPair::COLLAPSE_WHITESPACE; - } - - p = _value.ParseText( p, "<", flags ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 ); - } - if ( p && *p ) { - return p-1; - } - } - return 0; -} - - -XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLText* text = doc->NewText( Value() ); // fixme: this will always allocate memory. Intern? - text->SetCData( this->CData() ); - return text; -} - - -bool XMLText::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToText() && XMLUtil::StringEqual( compare->ToText()->Value(), Value() )); -} - - -bool XMLText::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -// --------- XMLComment ---------- // - -XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLComment::~XMLComment() -{ -} - - -char* XMLComment::ParseDeep( char* p, StrPair* ) -{ - // Comment parses as text. - const char* start = p; - p = _value.ParseText( p, "-->", StrPair::COMMENT ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 ); - } - return p; -} - - -XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLComment* comment = doc->NewComment( Value() ); // fixme: this will always allocate memory. Intern? - return comment; -} - - -bool XMLComment::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToComment() && XMLUtil::StringEqual( compare->ToComment()->Value(), Value() )); -} - - -bool XMLComment::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - - -// --------- XMLDeclaration ---------- // - -XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLDeclaration::~XMLDeclaration() -{ - //printf( "~XMLDeclaration\n" ); -} - - -char* XMLDeclaration::ParseDeep( char* p, StrPair* ) -{ - // Declaration parses as text. - const char* start = p; - p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( p == 0 ) { - _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 ); - } - return p; -} - - -XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLDeclaration* dec = doc->NewDeclaration( Value() ); // fixme: this will always allocate memory. Intern? - return dec; -} - - -bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToDeclaration() && XMLUtil::StringEqual( compare->ToDeclaration()->Value(), Value() )); -} - - - -bool XMLDeclaration::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - -// --------- XMLUnknown ---------- // - -XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc ) -{ -} - - -XMLUnknown::~XMLUnknown() -{ -} - - -char* XMLUnknown::ParseDeep( char* p, StrPair* ) -{ - // Unknown parses as text. - const char* start = p; - - p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION ); - if ( !p ) { - _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 ); - } - return p; -} - - -XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLUnknown* text = doc->NewUnknown( Value() ); // fixme: this will always allocate memory. Intern? - return text; -} - - -bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const -{ - return ( compare->ToUnknown() && XMLUtil::StringEqual( compare->ToUnknown()->Value(), Value() )); -} - - -bool XMLUnknown::Accept( XMLVisitor* visitor ) const -{ - return visitor->Visit( *this ); -} - -// --------- XMLAttribute ---------- // -char* XMLAttribute::ParseDeep( char* p, bool processEntities ) -{ - // Parse using the name rules: bug fix, was using ParseText before - p = _name.ParseName( p ); - if ( !p || !*p ) { - return 0; - } - - // Skip white space before = - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p || *p != '=' ) { - return 0; - } - - ++p; // move up to opening quote - p = XMLUtil::SkipWhiteSpace( p ); - if ( *p != '\"' && *p != '\'' ) { - return 0; - } - - char endTag[2] = { *p, 0 }; - ++p; // move past opening quote - - p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES ); - return p; -} - - -void XMLAttribute::SetName( const char* n ) -{ - _name.SetStr( n ); -} - - -XMLError XMLAttribute::QueryIntValue( int* value ) const -{ - if ( XMLUtil::ToInt( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const -{ - if ( XMLUtil::ToUnsigned( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryBoolValue( bool* value ) const -{ - if ( XMLUtil::ToBool( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryFloatValue( float* value ) const -{ - if ( XMLUtil::ToFloat( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -XMLError XMLAttribute::QueryDoubleValue( double* value ) const -{ - if ( XMLUtil::ToDouble( Value(), value )) { - return XML_NO_ERROR; - } - return XML_WRONG_ATTRIBUTE_TYPE; -} - - -void XMLAttribute::SetAttribute( const char* v ) -{ - _value.SetStr( v ); -} - - -void XMLAttribute::SetAttribute( int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute( unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -void XMLAttribute::SetAttribute( bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - -void XMLAttribute::SetAttribute( float v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - _value.SetStr( buf ); -} - - -// --------- XMLElement ---------- // -XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ), - _closingType( 0 ), - _rootAttribute( 0 ) -{ -} - - -XMLElement::~XMLElement() -{ - while( _rootAttribute ) { - XMLAttribute* next = _rootAttribute->_next; - DELETE_ATTRIBUTE( _rootAttribute ); - _rootAttribute = next; - } -} - - -XMLAttribute* XMLElement::FindAttribute( const char* name ) -{ - XMLAttribute* a = 0; - for( a=_rootAttribute; a; a = a->_next ) { - if ( XMLUtil::StringEqual( a->Name(), name ) ) { - return a; - } - } - return 0; -} - - -const XMLAttribute* XMLElement::FindAttribute( const char* name ) const -{ - XMLAttribute* a = 0; - for( a=_rootAttribute; a; a = a->_next ) { - if ( XMLUtil::StringEqual( a->Name(), name ) ) { - return a; - } - } - return 0; -} - - -const char* XMLElement::Attribute( const char* name, const char* value ) const -{ - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return 0; - } - if ( !value || XMLUtil::StringEqual( a->Value(), value )) { - return a->Value(); - } - return 0; -} - - -const char* XMLElement::GetText() const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - return FirstChild()->ToText()->Value(); - } - return 0; -} - - -XMLError XMLElement::QueryIntText( int* ival ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToInt( t, ival ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToUnsigned( t, uval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryBoolText( bool* bval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToBool( t, bval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryDoubleText( double* dval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToDouble( t, dval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - -XMLError XMLElement::QueryFloatText( float* fval ) const -{ - if ( FirstChild() && FirstChild()->ToText() ) { - const char* t = FirstChild()->ToText()->Value(); - if ( XMLUtil::ToFloat( t, fval ) ) { - return XML_SUCCESS; - } - return XML_CAN_NOT_CONVERT_TEXT; - } - return XML_NO_TEXT_NODE; -} - - - -XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name ) -{ - XMLAttribute* last = 0; - XMLAttribute* attrib = 0; - for( attrib = _rootAttribute; - attrib; - last = attrib, attrib = attrib->_next ) { - if ( XMLUtil::StringEqual( attrib->Name(), name ) ) { - break; - } - } - if ( !attrib ) { - attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); - attrib->_memPool = &_document->_attributePool; - if ( last ) { - last->_next = attrib; - } - else { - _rootAttribute = attrib; - } - attrib->SetName( name ); - attrib->_memPool->SetTracked(); // always created and linked. - } - return attrib; -} - - -void XMLElement::DeleteAttribute( const char* name ) -{ - XMLAttribute* prev = 0; - for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) { - if ( XMLUtil::StringEqual( name, a->Name() ) ) { - if ( prev ) { - prev->_next = a->_next; - } - else { - _rootAttribute = a->_next; - } - DELETE_ATTRIBUTE( a ); - break; - } - prev = a; - } -} - - -char* XMLElement::ParseAttributes( char* p ) -{ - const char* start = p; - XMLAttribute* prevAttribute = 0; - - // Read the attributes. - while( p ) { - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p || !(*p) ) { - _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() ); - return 0; - } - - // attribute. - if ( XMLUtil::IsAlpha( *p ) ) { - XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute(); - attrib->_memPool = &_document->_attributePool; - attrib->_memPool->SetTracked(); - - p = attrib->ParseDeep( p, _document->ProcessEntities() ); - if ( !p || Attribute( attrib->Name() ) ) { - DELETE_ATTRIBUTE( attrib ); - _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p ); - return 0; - } - // There is a minor bug here: if the attribute in the source xml - // document is duplicated, it will not be detected and the - // attribute will be doubly added. However, tracking the 'prevAttribute' - // avoids re-scanning the attribute list. Preferring performance for - // now, may reconsider in the future. - if ( prevAttribute ) { - prevAttribute->_next = attrib; - } - else { - _rootAttribute = attrib; - } - prevAttribute = attrib; - } - // end of the tag - else if ( *p == '/' && *(p+1) == '>' ) { - _closingType = CLOSED; - return p+2; // done; sealed element. - } - // end of the tag - else if ( *p == '>' ) { - ++p; - break; - } - else { - _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p ); - return 0; - } - } - return p; -} - - -// -// -// foobar -// -char* XMLElement::ParseDeep( char* p, StrPair* strPair ) -{ - // Read the element name. - p = XMLUtil::SkipWhiteSpace( p ); - if ( !p ) { - return 0; - } - - // The closing element is the form. It is - // parsed just like a regular element then deleted from - // the DOM. - if ( *p == '/' ) { - _closingType = CLOSING; - ++p; - } - - p = _value.ParseName( p ); - if ( _value.Empty() ) { - return 0; - } - - p = ParseAttributes( p ); - if ( !p || !*p || _closingType ) { - return p; - } - - p = XMLNode::ParseDeep( p, strPair ); - return p; -} - - - -XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const -{ - if ( !doc ) { - doc = _document; - } - XMLElement* element = doc->NewElement( Value() ); // fixme: this will always allocate memory. Intern? - for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) { - element->SetAttribute( a->Name(), a->Value() ); // fixme: this will always allocate memory. Intern? - } - return element; -} - - -bool XMLElement::ShallowEqual( const XMLNode* compare ) const -{ - const XMLElement* other = compare->ToElement(); - if ( other && XMLUtil::StringEqual( other->Value(), Value() )) { - - const XMLAttribute* a=FirstAttribute(); - const XMLAttribute* b=other->FirstAttribute(); - - while ( a && b ) { - if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) { - return false; - } - a = a->Next(); - b = b->Next(); - } - if ( a || b ) { - // different count - return false; - } - return true; - } - return false; -} - - -bool XMLElement::Accept( XMLVisitor* visitor ) const -{ - if ( visitor->VisitEnter( *this, _rootAttribute ) ) { - for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) { - if ( !node->Accept( visitor ) ) { - break; - } - } - } - return visitor->VisitExit( *this ); -} - - -// --------- XMLDocument ----------- // -XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) : - XMLNode( 0 ), - _writeBOM( false ), - _processEntities( processEntities ), - _errorID( XML_NO_ERROR ), - _whitespace( whitespace ), - _errorStr1( 0 ), - _errorStr2( 0 ), - _charBuffer( 0 ) -{ - _document = this; // avoid warning about 'this' in initializer list -} - - -XMLDocument::~XMLDocument() -{ - DeleteChildren(); - delete [] _charBuffer; - -#if 0 - textPool.Trace( "text" ); - elementPool.Trace( "element" ); - commentPool.Trace( "comment" ); - attributePool.Trace( "attribute" ); -#endif - -#ifdef DEBUG - if ( Error() == false ) { - TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); - TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); - TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); - TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); - } -#endif -} - - -void XMLDocument::InitDocument() -{ - _errorID = XML_NO_ERROR; - _errorStr1 = 0; - _errorStr2 = 0; - - delete [] _charBuffer; - _charBuffer = 0; -} - - -XMLElement* XMLDocument::NewElement( const char* name ) -{ - XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this ); - ele->_memPool = &_elementPool; - ele->SetName( name ); - return ele; -} - - -XMLComment* XMLDocument::NewComment( const char* str ) -{ - XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this ); - comment->_memPool = &_commentPool; - comment->SetValue( str ); - return comment; -} - - -XMLText* XMLDocument::NewText( const char* str ) -{ - XMLText* text = new (_textPool.Alloc()) XMLText( this ); - text->_memPool = &_textPool; - text->SetValue( str ); - return text; -} - - -XMLDeclaration* XMLDocument::NewDeclaration( const char* str ) -{ - XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this ); - dec->_memPool = &_commentPool; - dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" ); - return dec; -} - - -XMLUnknown* XMLDocument::NewUnknown( const char* str ) -{ - XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this ); - unk->_memPool = &_commentPool; - unk->SetValue( str ); - return unk; -} - - -XMLError XMLDocument::LoadFile( const char* filename ) -{ - DeleteChildren(); - InitDocument(); - FILE* fp = 0; - -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - errno_t err = fopen_s(&fp, filename, "rb" ); - if ( !fp || err) { -#else - fp = fopen( filename, "rb" ); - if ( !fp) { -#endif - SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 ); - return _errorID; - } - LoadFile( fp ); - fclose( fp ); - return _errorID; -} - - -XMLError XMLDocument::LoadFile( FILE* fp ) -{ - DeleteChildren(); - InitDocument(); - - fseek( fp, 0, SEEK_END ); - size_t size = ftell( fp ); - fseek( fp, 0, SEEK_SET ); - - if ( size == 0 ) { - return _errorID; - } - - _charBuffer = new char[size+1]; - size_t read = fread( _charBuffer, 1, size, fp ); - if ( read != size ) { - SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 ); - return _errorID; - } - - _charBuffer[size] = 0; - - const char* p = _charBuffer; - p = XMLUtil::SkipWhiteSpace( p ); - p = XMLUtil::ReadBOM( p, &_writeBOM ); - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - - ParseDeep( _charBuffer + (p-_charBuffer), 0 ); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( const char* filename, bool compact ) -{ - FILE* fp = 0; -#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - errno_t err = fopen_s(&fp, filename, "w" ); - if ( !fp || err) { -#else - fp = fopen( filename, "w" ); - if ( !fp) { -#endif - SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 ); - return _errorID; - } - SaveFile(fp, compact); - fclose( fp ); - return _errorID; -} - - -XMLError XMLDocument::SaveFile( FILE* fp, bool compact ) -{ - XMLPrinter stream( fp, compact ); - Print( &stream ); - return _errorID; -} - - -XMLError XMLDocument::Parse( const char* p, size_t len ) -{ - DeleteChildren(); - InitDocument(); - - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - if ( len == (size_t)(-1) ) { - len = strlen( p ); - } - _charBuffer = new char[ len+1 ]; - memcpy( _charBuffer, p, len ); - _charBuffer[len] = 0; - - p = XMLUtil::SkipWhiteSpace( p ); - p = XMLUtil::ReadBOM( p, &_writeBOM ); - if ( !p || !*p ) { - SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 ); - return _errorID; - } - - ParseDeep( _charBuffer, 0 ); - return _errorID; -} - - -void XMLDocument::Print( XMLPrinter* streamer ) -{ - XMLPrinter stdStreamer( stdout ); - if ( !streamer ) { - streamer = &stdStreamer; - } - Accept( streamer ); -} - - -void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 ) -{ - _errorID = error; - _errorStr1 = str1; - _errorStr2 = str2; -} - - -void XMLDocument::PrintError() const -{ - if ( _errorID ) { - static const int LEN = 20; - char buf1[LEN] = { 0 }; - char buf2[LEN] = { 0 }; - - if ( _errorStr1 ) { - TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 ); - } - if ( _errorStr2 ) { - TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 ); - } - - printf( "XMLDocument error id=%d str1=%s str2=%s\n", - _errorID, buf1, buf2 ); - } -} - - -XMLPrinter::XMLPrinter( FILE* file, bool compact ) : - _elementJustOpened( false ), - _firstElement( true ), - _fp( file ), - _depth( 0 ), - _textDepth( -1 ), - _processEntities( true ), - _compactMode( compact ) -{ - for( int i=0; i'] = true; // not required, but consistency is nice - _buffer.Push( 0 ); -} - - -void XMLPrinter::Print( const char* format, ... ) -{ - va_list va; - va_start( va, format ); - - if ( _fp ) { - vfprintf( _fp, format, va ); - } - else { - // This seems brutally complex. Haven't figured out a better - // way on windows. -#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE) - int len = -1; - int expand = 1000; - while ( len < 0 ) { - len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va ); - if ( len < 0 ) { - expand *= 3/2; - _accumulator.PushArr( expand ); - } - } - char* p = _buffer.PushArr( len ) - 1; - memcpy( p, _accumulator.Mem(), len+1 ); -#else - int len = vsnprintf( 0, 0, format, va ); - // Close out and re-start the va-args - va_end( va ); - va_start( va, format ); - char* p = _buffer.PushArr( len ) - 1; - vsnprintf( p, len+1, format, va ); -#endif - } - va_end( va ); -} - - -void XMLPrinter::PrintSpace( int depth ) -{ - for( int i=0; i 0 && *q < ENTITY_RANGE ) { - // Check for entities. If one is found, flush - // the stream up until the entity, write the - // entity, and keep looking. - if ( flag[(unsigned)(*q)] ) { - while ( p < q ) { - Print( "%c", *p ); - ++p; - } - for( int i=0; i 0) ) { - Print( "%s", p ); - } -} - - -void XMLPrinter::PushHeader( bool writeBOM, bool writeDec ) -{ - static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 }; - if ( writeBOM ) { - Print( "%s", bom ); - } - if ( writeDec ) { - PushDeclaration( "xml version=\"1.0\"" ); - } -} - - -void XMLPrinter::OpenElement( const char* name ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - _stack.Push( name ); - - if ( _textDepth < 0 && !_firstElement && !_compactMode ) { - Print( "\n" ); - PrintSpace( _depth ); - } - - Print( "<%s", name ); - _elementJustOpened = true; - _firstElement = false; - ++_depth; -} - - -void XMLPrinter::PushAttribute( const char* name, const char* value ) -{ - TIXMLASSERT( _elementJustOpened ); - Print( " %s=\"", name ); - PrintString( value, false ); - Print( "\"" ); -} - - -void XMLPrinter::PushAttribute( const char* name, int v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, unsigned v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, bool v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::PushAttribute( const char* name, double v ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( v, buf, BUF_SIZE ); - PushAttribute( name, buf ); -} - - -void XMLPrinter::CloseElement() -{ - --_depth; - const char* name = _stack.Pop(); - - if ( _elementJustOpened ) { - Print( "/>" ); - } - else { - if ( _textDepth < 0 && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - Print( "", name ); - } - - if ( _textDepth == _depth ) { - _textDepth = -1; - } - if ( _depth == 0 && !_compactMode) { - Print( "\n" ); - } - _elementJustOpened = false; -} - - -void XMLPrinter::SealElement() -{ - _elementJustOpened = false; - Print( ">" ); -} - - -void XMLPrinter::PushText( const char* text, bool cdata ) -{ - _textDepth = _depth-1; - - if ( _elementJustOpened ) { - SealElement(); - } - if ( cdata ) { - Print( "" ); - } - else { - PrintString( text, true ); - } -} - -void XMLPrinter::PushText( int value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( unsigned value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( bool value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( float value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushText( double value ) -{ - char buf[BUF_SIZE]; - XMLUtil::ToStr( value, buf, BUF_SIZE ); - PushText( buf, false ); -} - - -void XMLPrinter::PushComment( const char* comment ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", comment ); -} - - -void XMLPrinter::PushDeclaration( const char* value ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", value ); -} - - -void XMLPrinter::PushUnknown( const char* value ) -{ - if ( _elementJustOpened ) { - SealElement(); - } - if ( _textDepth < 0 && !_firstElement && !_compactMode) { - Print( "\n" ); - PrintSpace( _depth ); - } - _firstElement = false; - Print( "", value ); -} - - -bool XMLPrinter::VisitEnter( const XMLDocument& doc ) -{ - _processEntities = doc.ProcessEntities(); - if ( doc.HasBOM() ) { - PushHeader( true, false ); - } - return true; -} - - -bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute ) -{ - OpenElement( element.Name() ); - while ( attribute ) { - PushAttribute( attribute->Name(), attribute->Value() ); - attribute = attribute->Next(); - } - return true; -} - - -bool XMLPrinter::VisitExit( const XMLElement& ) -{ - CloseElement(); - return true; -} - - -bool XMLPrinter::Visit( const XMLText& text ) -{ - PushText( text.Value(), text.CData() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLComment& comment ) -{ - PushComment( comment.Value() ); - return true; -} - -bool XMLPrinter::Visit( const XMLDeclaration& declaration ) -{ - PushDeclaration( declaration.Value() ); - return true; -} - - -bool XMLPrinter::Visit( const XMLUnknown& unknown ) -{ - PushUnknown( unknown.Value() ); - return true; -} - -} // namespace tinyxml2 - diff --git a/cocos/2d/support/tinyxml2/tinyxml2.h b/cocos/2d/support/tinyxml2/tinyxml2.h deleted file mode 100644 index eeffa1096f..0000000000 --- a/cocos/2d/support/tinyxml2/tinyxml2.h +++ /dev/null @@ -1,1914 +0,0 @@ -/* -Original code by Lee Thomason (www.grinninglizard.com) - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any -damages arising from the use of this software. - -Permission is granted to anyone to use this software for any -purpose, including commercial applications, and to alter it and -redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must -not claim that you wrote the original software. If you use this -software in a product, an acknowledgment in the product documentation -would be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and -must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source -distribution. -*/ - -#ifndef TINYXML2_INCLUDED -#define TINYXML2_INCLUDED - -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" - -#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -# include -# include -# include -# include -# include -# include -#else -# include -# include -# include -# include -# include -# include -#endif - -/* - TODO: intern strings instead of allocation. -*/ -/* - gcc: - g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe - - Formatting, Artistic Style: - AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h -*/ - -#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__) -# ifndef DEBUG -# define DEBUG -# endif -#endif - - -#if defined(DEBUG) -# if defined(_MSC_VER) -# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak() -# elif defined (ANDROID_NDK) -# include -# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); } -# else -# include -# define TIXMLASSERT assert -# endif -# else -# define TIXMLASSERT( x ) {} -#endif - - -#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)) -// Microsoft visual studio, version 2005 and higher. -/*int _snprintf_s( - char *buffer, - size_t sizeOfBuffer, - size_t count, - const char *format [, - argument] ... -);*/ -inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... ) -{ - va_list va; - va_start( va, format ); - int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va ); - va_end( va ); - return result; -} -#define TIXML_SSCANF sscanf_s -#else -// GCC version 3 and higher -//#warning( "Using sn* functions." ) -#define TIXML_SNPRINTF snprintf -#define TIXML_SSCANF sscanf -#endif - -static const int TIXML2_MAJOR_VERSION = 1; -static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 9; - -namespace tinyxml2 -{ -class XMLDocument; -class XMLElement; -class XMLAttribute; -class XMLComment; -class XMLNode; -class XMLText; -class XMLDeclaration; -class XMLUnknown; - -class XMLPrinter; - -/* - A class that wraps strings. Normally stores the start and end - pointers into the XML file itself, and will apply normalization - and entity translation if actually read. Can also store (and memory - manage) a traditional char[] -*/ -class CC_DLL StrPair -{ -public: - enum { - NEEDS_ENTITY_PROCESSING = 0x01, - NEEDS_NEWLINE_NORMALIZATION = 0x02, - COLLAPSE_WHITESPACE = 0x04, - - TEXT_ELEMENT = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - TEXT_ELEMENT_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_NAME = 0, - ATTRIBUTE_VALUE = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION, - ATTRIBUTE_VALUE_LEAVE_ENTITIES = NEEDS_NEWLINE_NORMALIZATION, - COMMENT = NEEDS_NEWLINE_NORMALIZATION - }; - - StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {} - ~StrPair(); - - void Set( char* start, char* end, int flags ) { - Reset(); - _start = start; - _end = end; - _flags = flags | NEEDS_FLUSH; - } - - const char* GetStr(); - - bool Empty() const { - return _start == _end; - } - - void SetInternedStr( const char* str ) { - Reset(); - _start = const_cast(str); - } - - void SetStr( const char* str, int flags=0 ); - - char* ParseText( char* in, const char* endTag, int strFlags ); - char* ParseName( char* in ); - -private: - void Reset(); - void CollapseWhitespace(); - - enum { - NEEDS_FLUSH = 0x100, - NEEDS_DELETE = 0x200 - }; - - // After parsing, if *end != 0, it can be set to zero. - int _flags; - char* _start; - char* _end; -}; - - -/* - A dynamic array of Plain Old Data. Doesn't support constructors, etc. - Has a small initial memory pool, so that low or no usage will not - cause a call to new/delete -*/ -template -class CC_DLL DynArray -{ -public: - DynArray< T, INIT >() { - _mem = _pool; - _allocated = INIT; - _size = 0; - } - - ~DynArray() { - if ( _mem != _pool ) { - delete [] _mem; - } - } - - void Push( T t ) { - EnsureCapacity( _size+1 ); - _mem[_size++] = t; - } - - T* PushArr( int count ) { - EnsureCapacity( _size+count ); - T* ret = &_mem[_size]; - _size += count; - return ret; - } - - T Pop() { - return _mem[--_size]; - } - - void PopArr( int count ) { - TIXMLASSERT( _size >= count ); - _size -= count; - } - - bool Empty() const { - return _size == 0; - } - - T& operator[](int i) { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - const T& operator[](int i) const { - TIXMLASSERT( i>= 0 && i < _size ); - return _mem[i]; - } - - int Size() const { - return _size; - } - - int Capacity() const { - return _allocated; - } - - const T* Mem() const { - return _mem; - } - - T* Mem() { - return _mem; - } - -private: - void EnsureCapacity( int cap ) { - if ( cap > _allocated ) { - int newAllocated = cap * 2; - T* newMem = new T[newAllocated]; - memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs - if ( _mem != _pool ) { - delete [] _mem; - } - _mem = newMem; - _allocated = newAllocated; - } - } - - T* _mem; - T _pool[INIT]; - int _allocated; // objects allocated - int _size; // number objects in use -}; - - -/* - Parent virtual class of a pool for fast allocation - and deallocation of objects. -*/ -class CC_DLL MemPool -{ -public: - MemPool() {} - virtual ~MemPool() {} - - virtual int ItemSize() const = 0; - virtual void* Alloc() = 0; - virtual void Free( void* ) = 0; - virtual void SetTracked() = 0; -}; - - -/* - Template child class to create pools of the correct type. -*/ -template< int SIZE > -class CC_DLL MemPoolT : public MemPool -{ -public: - MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0) {} - ~MemPoolT() { - // Delete the blocks. - for( int i=0; i<_blockPtrs.Size(); ++i ) { - delete _blockPtrs[i]; - } - } - - virtual int ItemSize() const { - return SIZE; - } - int CurrentAllocs() const { - return _currentAllocs; - } - - virtual void* Alloc() { - if ( !_root ) { - // Need a new block. - Block* block = new Block(); - _blockPtrs.Push( block ); - - for( int i=0; ichunk[i].next = &block->chunk[i+1]; - } - block->chunk[COUNT-1].next = 0; - _root = block->chunk; - } - void* result = _root; - _root = _root->next; - - ++_currentAllocs; - if ( _currentAllocs > _maxAllocs ) { - _maxAllocs = _currentAllocs; - } - _nAllocs++; - _nUntracked++; - return result; - } - virtual void Free( void* mem ) { - if ( !mem ) { - return; - } - --_currentAllocs; - Chunk* chunk = (Chunk*)mem; -#ifdef DEBUG - memset( chunk, 0xfe, sizeof(Chunk) ); -#endif - chunk->next = _root; - _root = chunk; - } - void Trace( const char* name ) { - printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n", - name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() ); - } - - void SetTracked() { - _nUntracked--; - } - - int Untracked() const { - return _nUntracked; - } - - enum { COUNT = 1024/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private - -private: - union Chunk { - Chunk* next; - char mem[SIZE]; - }; - struct Block { - Chunk chunk[COUNT]; - }; - DynArray< Block*, 10 > _blockPtrs; - Chunk* _root; - - int _currentAllocs; - int _nAllocs; - int _maxAllocs; - int _nUntracked; -}; - - - -/** - Implements the interface to the "Visitor pattern" (see the Accept() method.) - If you call the Accept() method, it requires being passed a XMLVisitor - class to handle callbacks. For nodes that contain other nodes (Document, Element) - you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs - are simply called with Visit(). - - If you return 'true' from a Visit method, recursive parsing will continue. If you return - false, no children of this node or its sibilings will be visited. - - All flavors of Visit methods have a default implementation that returns 'true' (continue - visiting). You need to only override methods that are interesting to you. - - Generally Accept() is called on the TiXmlDocument, although all nodes support visiting. - - You should never change the document from a callback. - - @sa XMLNode::Accept() -*/ -class CC_DLL XMLVisitor -{ -public: - virtual ~XMLVisitor() {} - - /// Visit a document. - virtual bool VisitEnter( const XMLDocument& /*doc*/ ) { - return true; - } - /// Visit a document. - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - /// Visit an element. - virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ ) { - return true; - } - /// Visit an element. - virtual bool VisitExit( const XMLElement& /*element*/ ) { - return true; - } - - /// Visit a declaration. - virtual bool Visit( const XMLDeclaration& /*declaration*/ ) { - return true; - } - /// Visit a text node. - virtual bool Visit( const XMLText& /*text*/ ) { - return true; - } - /// Visit a comment node. - virtual bool Visit( const XMLComment& /*comment*/ ) { - return true; - } - /// Visit an unknown node. - virtual bool Visit( const XMLUnknown& /*unknown*/ ) { - return true; - } -}; - - -/* - Utility functionality. -*/ -class CC_DLL XMLUtil -{ -public: - // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't - // correct, but simple, and usually works. - static const char* SkipWhiteSpace( const char* p ) { - while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { - ++p; - } - return p; - } - static char* SkipWhiteSpace( char* p ) { - while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast(p) ) ) { - ++p; - } - return p; - } - static bool IsWhiteSpace( char p ) { - return !IsUTF8Continuation(p) && isspace( static_cast(p) ); - } - - inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX ) { - int n = 0; - if ( p == q ) { - return true; - } - while( *p && *q && *p == *q && n(const_cast(this)->FirstChildElement( value )); - } - - /// Get the last child node, or null if none exists. - const XMLNode* LastChild() const { - return _lastChild; - } - - XMLNode* LastChild() { - return const_cast(const_cast(this)->LastChild() ); - } - - /** Get the last child element or optionally the last child - element with the specified name. - */ - const XMLElement* LastChildElement( const char* value=0 ) const; - - XMLElement* LastChildElement( const char* value=0 ) { - return const_cast(const_cast(this)->LastChildElement(value) ); - } - - /// Get the previous (left) sibling node of this node. - const XMLNode* PreviousSibling() const { - return _prev; - } - - XMLNode* PreviousSibling() { - return _prev; - } - - /// Get the previous (left) sibling element of this node, with an opitionally supplied name. - const XMLElement* PreviousSiblingElement( const char* value=0 ) const ; - - XMLElement* PreviousSiblingElement( const char* value=0 ) { - return const_cast(const_cast(this)->PreviousSiblingElement( value ) ); - } - - /// Get the next (right) sibling node of this node. - const XMLNode* NextSibling() const { - return _next; - } - - XMLNode* NextSibling() { - return _next; - } - - /// Get the next (right) sibling element of this node, with an opitionally supplied name. - const XMLElement* NextSiblingElement( const char* value=0 ) const; - - XMLElement* NextSiblingElement( const char* value=0 ) { - return const_cast(const_cast(this)->NextSiblingElement( value ) ); - } - - /** - Add a child node as the last (right) child. - */ - XMLNode* InsertEndChild( XMLNode* addThis ); - - XMLNode* LinkEndChild( XMLNode* addThis ) { - return InsertEndChild( addThis ); - } - /** - Add a child node as the first (left) child. - */ - XMLNode* InsertFirstChild( XMLNode* addThis ); - /** - Add a node after the specified child node. - */ - XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis ); - - /** - Delete all the children of this node. - */ - void DeleteChildren(); - - /** - Delete a child of this node. - */ - void DeleteChild( XMLNode* node ); - - /** - Make a copy of this node, but not its children. - You may pass in a Document pointer that will be - the owner of the new Node. If the 'document' is - null, then the node returned will be allocated - from the current Document. (this->GetDocument()) - - Note: if called on a XMLDocument, this will return null. - */ - virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0; - - /** - Test if 2 nodes are the same, but don't test children. - The 2 nodes do not need to be in the same Document. - - Note: if called on a XMLDocument, this will return false. - */ - virtual bool ShallowEqual( const XMLNode* compare ) const = 0; - - /** Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the - XML tree will be conditionally visited and the host will be called back - via the TiXmlVisitor interface. - - This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse - the XML for the callbacks, so the performance of TinyXML is unchanged by using this - interface versus any other.) - - The interface has been based on ideas from: - - - http://www.saxproject.org/ - - http://c2.com/cgi/wiki?HierarchicalVisitorPattern - - Which are both good references for "visiting". - - An example of using Accept(): - @verbatim - TiXmlPrinter printer; - tinyxmlDoc.Accept( &printer ); - const char* xmlcstr = printer.CStr(); - @endverbatim - */ - virtual bool Accept( XMLVisitor* visitor ) const = 0; - - // internal - virtual char* ParseDeep( char*, StrPair* ); - -protected: - XMLNode( XMLDocument* ); - virtual ~XMLNode(); - XMLNode( const XMLNode& ); // not supported - XMLNode& operator=( const XMLNode& ); // not supported - - XMLDocument* _document; - XMLNode* _parent; - mutable StrPair _value; - - XMLNode* _firstChild; - XMLNode* _lastChild; - - XMLNode* _prev; - XMLNode* _next; - -private: - MemPool* _memPool; - void Unlink( XMLNode* child ); -}; - - -/** XML text. - - Note that a text node can have child element nodes, for example: - @verbatim - This is bold - @endverbatim - - A text node can have 2 ways to output the next. "normal" output - and CDATA. It will default to the mode it was parsed from the XML file and - you generally want to leave it alone, but you can change the output mode with - SetCDATA() and query it with CDATA(). -*/ -class CC_DLL XMLText : public XMLNode -{ - friend class XMLBase; - friend class XMLDocument; -public: - virtual bool Accept( XMLVisitor* visitor ) const; - - virtual XMLText* ToText() { - return this; - } - virtual const XMLText* ToText() const { - return this; - } - - /// Declare whether this should be CDATA or standard text. - void SetCData( bool isCData ) { - _isCData = isCData; - } - /// Returns true if this is a CDATA text element. - bool CData() const { - return _isCData; - } - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLText( XMLDocument* doc ) : XMLNode( doc ), _isCData( false ) {} - virtual ~XMLText() {} - XMLText( const XMLText& ); // not supported - XMLText& operator=( const XMLText& ); // not supported - -private: - bool _isCData; -}; - - -/** An XML Comment. */ -class CC_DLL XMLComment : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLComment* ToComment() { - return this; - } - virtual const XMLComment* ToComment() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLComment( XMLDocument* doc ); - virtual ~XMLComment(); - XMLComment( const XMLComment& ); // not supported - XMLComment& operator=( const XMLComment& ); // not supported - -private: -}; - - -/** In correct XML the declaration is the first entry in the file. - @verbatim - - @endverbatim - - TinyXML2 will happily read or write files without a declaration, - however. - - The text of the declaration isn't interpreted. It is parsed - and written as a string. -*/ -class CC_DLL XMLDeclaration : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLDeclaration* ToDeclaration() { - return this; - } - virtual const XMLDeclaration* ToDeclaration() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLDeclaration( XMLDocument* doc ); - virtual ~XMLDeclaration(); - XMLDeclaration( const XMLDeclaration& ); // not supported - XMLDeclaration& operator=( const XMLDeclaration& ); // not supported -}; - - -/** Any tag that tinyXml doesn't recognize is saved as an - unknown. It is a tag of text, but should not be modified. - It will be written back to the XML, unchanged, when the file - is saved. - - DTD tags get thrown into TiXmlUnknowns. -*/ -class CC_DLL XMLUnknown : public XMLNode -{ - friend class XMLDocument; -public: - virtual XMLUnknown* ToUnknown() { - return this; - } - virtual const XMLUnknown* ToUnknown() const { - return this; - } - - virtual bool Accept( XMLVisitor* visitor ) const; - - char* ParseDeep( char*, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -protected: - XMLUnknown( XMLDocument* doc ); - virtual ~XMLUnknown(); - XMLUnknown( const XMLUnknown& ); // not supported - XMLUnknown& operator=( const XMLUnknown& ); // not supported -}; - - -enum XMLError { - XML_NO_ERROR = 0, - XML_SUCCESS = 0, - - XML_NO_ATTRIBUTE, - XML_WRONG_ATTRIBUTE_TYPE, - - XML_ERROR_FILE_NOT_FOUND, - XML_ERROR_FILE_COULD_NOT_BE_OPENED, - XML_ERROR_FILE_READ_ERROR, - XML_ERROR_ELEMENT_MISMATCH, - XML_ERROR_PARSING_ELEMENT, - XML_ERROR_PARSING_ATTRIBUTE, - XML_ERROR_IDENTIFYING_TAG, - XML_ERROR_PARSING_TEXT, - XML_ERROR_PARSING_CDATA, - XML_ERROR_PARSING_COMMENT, - XML_ERROR_PARSING_DECLARATION, - XML_ERROR_PARSING_UNKNOWN, - XML_ERROR_EMPTY_DOCUMENT, - XML_ERROR_MISMATCHED_ELEMENT, - XML_ERROR_PARSING, - - XML_CAN_NOT_CONVERT_TEXT, - XML_NO_TEXT_NODE -}; - - -/** An attribute is a name-value pair. Elements have an arbitrary - number of attributes, each with a unique name. - - @note The attributes are not XMLNodes. You may only query the - Next() attribute in a list. -*/ -class CC_DLL XMLAttribute -{ - friend class XMLElement; -public: - /// The name of the attribute. - const char* Name() const { - return _name.GetStr(); - } - /// The value of the attribute. - const char* Value() const { - return _value.GetStr(); - } - /// The next attribute in the list. - const XMLAttribute* Next() const { - return _next; - } - - /** IntAttribute interprets the attribute as an integer, and returns the value. - If the value isn't an integer, 0 will be returned. There is no error checking; - use QueryIntAttribute() if you need error checking. - */ - int IntValue() const { - int i=0; - QueryIntValue( &i ); - return i; - } - /// Query as an unsigned integer. See IntAttribute() - unsigned UnsignedValue() const { - unsigned i=0; - QueryUnsignedValue( &i ); - return i; - } - /// Query as a boolean. See IntAttribute() - bool BoolValue() const { - bool b=false; - QueryBoolValue( &b ); - return b; - } - /// Query as a double. See IntAttribute() - double DoubleValue() const { - double d=0; - QueryDoubleValue( &d ); - return d; - } - /// Query as a float. See IntAttribute() - float FloatValue() const { - float f=0; - QueryFloatValue( &f ); - return f; - } - - /** QueryIntAttribute interprets the attribute as an integer, and returns the value - in the provided paremeter. The function will return XML_NO_ERROR on success, - and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful. - */ - XMLError QueryIntValue( int* value ) const; - /// See QueryIntAttribute - XMLError QueryUnsignedValue( unsigned int* value ) const; - /// See QueryIntAttribute - XMLError QueryBoolValue( bool* value ) const; - /// See QueryIntAttribute - XMLError QueryDoubleValue( double* value ) const; - /// See QueryIntAttribute - XMLError QueryFloatValue( float* value ) const; - - /// Set the attribute to a string value. - void SetAttribute( const char* value ); - /// Set the attribute to value. - void SetAttribute( int value ); - /// Set the attribute to value. - void SetAttribute( unsigned value ); - /// Set the attribute to value. - void SetAttribute( bool value ); - /// Set the attribute to value. - void SetAttribute( double value ); - /// Set the attribute to value. - void SetAttribute( float value ); - -private: - enum { BUF_SIZE = 200 }; - - XMLAttribute() : _next( 0 ) {} - virtual ~XMLAttribute() {} - - XMLAttribute( const XMLAttribute& ); // not supported - void operator=( const XMLAttribute& ); // not supported - void SetName( const char* name ); - - char* ParseDeep( char* p, bool processEntities ); - - mutable StrPair _name; - mutable StrPair _value; - XMLAttribute* _next; - MemPool* _memPool; -}; - - -/** The element is a container class. It has a value, the element name, - and can contain other elements, text, comments, and unknowns. - Elements also contain an arbitrary number of attributes. -*/ -class CC_DLL XMLElement : public XMLNode -{ - friend class XMLBase; - friend class XMLDocument; -public: - /// Get the name of an element (which is the Value() of the node.) - const char* Name() const { - return Value(); - } - /// Set the name of the element. - void SetName( const char* str, bool staticMem=false ) { - SetValue( str, staticMem ); - } - - virtual XMLElement* ToElement() { - return this; - } - virtual const XMLElement* ToElement() const { - return this; - } - virtual bool Accept( XMLVisitor* visitor ) const; - - /** Given an attribute name, Attribute() returns the value - for the attribute of that name, or null if none - exists. For example: - - @verbatim - const char* value = ele->Attribute( "foo" ); - @endverbatim - - The 'value' parameter is normally null. However, if specified, - the attribute will only be returned if the 'name' and 'value' - match. This allow you to write code: - - @verbatim - if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar(); - @endverbatim - - rather than: - @verbatim - if ( ele->Attribute( "foo" ) ) { - if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar(); - } - @endverbatim - */ - const char* Attribute( const char* name, const char* value=0 ) const; - - /** Given an attribute name, IntAttribute() returns the value - of the attribute interpreted as an integer. 0 will be - returned if there is an error. For a method with error - checking, see QueryIntAttribute() - */ - int IntAttribute( const char* name ) const { - int i=0; - QueryIntAttribute( name, &i ); - return i; - } - /// See IntAttribute() - unsigned UnsignedAttribute( const char* name ) const { - unsigned i=0; - QueryUnsignedAttribute( name, &i ); - return i; - } - /// See IntAttribute() - bool BoolAttribute( const char* name ) const { - bool b=false; - QueryBoolAttribute( name, &b ); - return b; - } - /// See IntAttribute() - double DoubleAttribute( const char* name ) const { - double d=0; - QueryDoubleAttribute( name, &d ); - return d; - } - /// See IntAttribute() - float FloatAttribute( const char* name ) const { - float f=0; - QueryFloatAttribute( name, &f ); - return f; - } - - /** Given an attribute name, QueryIntAttribute() returns - XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion - can't be performed, or XML_NO_ATTRIBUTE if the attribute - doesn't exist. If successful, the result of the conversion - will be written to 'value'. If not successful, nothing will - be written to 'value'. This allows you to provide default - value: - - @verbatim - int value = 10; - QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10 - @endverbatim - */ - XMLError QueryIntAttribute( const char* name, int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryIntValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryUnsignedValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryBoolAttribute( const char* name, bool* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryBoolValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryDoubleAttribute( const char* name, double* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryDoubleValue( value ); - } - /// See QueryIntAttribute() - XMLError QueryFloatAttribute( const char* name, float* value ) const { - const XMLAttribute* a = FindAttribute( name ); - if ( !a ) { - return XML_NO_ATTRIBUTE; - } - return a->QueryFloatValue( value ); - } - - /// Sets the named attribute to value. - void SetAttribute( const char* name, const char* value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, int value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, unsigned value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, bool value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - /// Sets the named attribute to value. - void SetAttribute( const char* name, double value ) { - XMLAttribute* a = FindOrCreateAttribute( name ); - a->SetAttribute( value ); - } - - /** - Delete an attribute. - */ - void DeleteAttribute( const char* name ); - - /// Return the first attribute in the list. - const XMLAttribute* FirstAttribute() const { - return _rootAttribute; - } - /// Query a specific attribute in the list. - const XMLAttribute* FindAttribute( const char* name ) const; - - /** Convenience function for easy access to the text inside an element. Although easy - and concise, GetText() is limited compared to getting the TiXmlText child - and accessing it directly. - - If the first child of 'this' is a TiXmlText, the GetText() - returns the character string of the Text node, else null is returned. - - This is a convenient method for getting the text of simple contained text: - @verbatim - This is text - const char* str = fooElement->GetText(); - @endverbatim - - 'str' will be a pointer to "This is text". - - Note that this function can be misleading. If the element foo was created from - this XML: - @verbatim - This is text - @endverbatim - - then the value of str would be null. The first child node isn't a text node, it is - another element. From this XML: - @verbatim - This is text - @endverbatim - GetText() will return "This is ". - */ - const char* GetText() const; - - /** - Convenience method to query the value of a child text node. This is probably best - shown by example. Given you have a document is this form: - @verbatim - - 1 - 1.4 - - @endverbatim - - The QueryIntText() and similar functions provide a safe and easier way to get to the - "value" of x and y. - - @verbatim - int x = 0; - float y = 0; // types of x and y are contrived for example - const XMLElement* xElement = pointElement->FirstChildElement( "x" ); - const XMLElement* yElement = pointElement->FirstChildElement( "y" ); - xElement->QueryIntText( &x ); - yElement->QueryFloatText( &y ); - @endverbatim - - @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted - to the requested type, and XML_NO_TEXT_NODE if there is no child text to query. - - */ - XMLError QueryIntText( int* ival ) const; - /// See QueryIntText() - XMLError QueryUnsignedText( unsigned* uval ) const; - /// See QueryIntText() - XMLError QueryBoolText( bool* bval ) const; - /// See QueryIntText() - XMLError QueryDoubleText( double* dval ) const; - /// See QueryIntText() - XMLError QueryFloatText( float* fval ) const; - - // internal: - enum { - OPEN, // - CLOSED, // - CLOSING // - }; - int ClosingType() const { - return _closingType; - } - char* ParseDeep( char* p, StrPair* endTag ); - virtual XMLNode* ShallowClone( XMLDocument* document ) const; - virtual bool ShallowEqual( const XMLNode* compare ) const; - -private: - XMLElement( XMLDocument* doc ); - virtual ~XMLElement(); - XMLElement( const XMLElement& ); // not supported - void operator=( const XMLElement& ); // not supported - - XMLAttribute* FindAttribute( const char* name ); - XMLAttribute* FindOrCreateAttribute( const char* name ); - //void LinkAttribute( XMLAttribute* attrib ); - char* ParseAttributes( char* p ); - - int _closingType; - // The attribute list is ordered; there is no 'lastAttribute' - // because the list needs to be scanned for dupes before adding - // a new attribute. - XMLAttribute* _rootAttribute; -}; - - -enum Whitespace { - PRESERVE_WHITESPACE, - COLLAPSE_WHITESPACE -}; - - -/** A Document binds together all the functionality. - It can be saved, loaded, and printed to the screen. - All Nodes are connected and allocated to a Document. - If the Document is deleted, all its Nodes are also deleted. -*/ -class CC_DLL XMLDocument : public XMLNode -{ - friend class XMLElement; -public: - /// constructor - XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE ); - ~XMLDocument(); - - virtual XMLDocument* ToDocument() { - return this; - } - virtual const XMLDocument* ToDocument() const { - return this; - } - - /** - Parse an XML file from a character string. - Returns XML_NO_ERROR (0) on success, or - an errorID. - - You may optionally pass in the 'nBytes', which is - the number of bytes which will be parsed. If not - specified, TinyXML will assume 'xml' points to a - null terminated string. - */ - XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) ); - - /** - Load an XML file from disk. - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError LoadFile( const char* filename ); - - /** - Load an XML file from disk. You are responsible - for providing and closing the FILE*. - - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError LoadFile( FILE* ); - - /** - Save the XML file to disk. - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError SaveFile( const char* filename, bool compact = false ); - - /** - Save the XML file to disk. You are responsible - for providing and closing the FILE*. - - Returns XML_NO_ERROR (0) on success, or - an errorID. - */ - XMLError SaveFile( FILE* fp, bool compact = false ); - - bool ProcessEntities() const { - return _processEntities; - } - Whitespace WhitespaceMode() const { - return _whitespace; - } - - /** - Returns true if this document has a leading Byte Order Mark of UTF8. - */ - bool HasBOM() const { - return _writeBOM; - } - /** Sets whether to write the BOM when writing the file. - */ - void SetBOM( bool useBOM ) { - _writeBOM = useBOM; - } - - /** Return the root element of DOM. Equivalent to FirstChildElement(). - To get the first node, use FirstChild(). - */ - XMLElement* RootElement() { - return FirstChildElement(); - } - const XMLElement* RootElement() const { - return FirstChildElement(); - } - - /** Print the Document. If the Printer is not provided, it will - print to stdout. If you provide Printer, this can print to a file: - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Or you can use a printer to print to memory: - @verbatim - XMLPrinter printer; - doc->Print( &printer ); - // printer.CStr() has a const char* to the XML - @endverbatim - */ - void Print( XMLPrinter* streamer=0 ); - virtual bool Accept( XMLVisitor* visitor ) const; - - /** - Create a new Element associated with - this Document. The memory for the Element - is managed by the Document. - */ - XMLElement* NewElement( const char* name ); - /** - Create a new Comment associated with - this Document. The memory for the Comment - is managed by the Document. - */ - XMLComment* NewComment( const char* comment ); - /** - Create a new Text associated with - this Document. The memory for the Text - is managed by the Document. - */ - XMLText* NewText( const char* text ); - /** - Create a new Declaration associated with - this Document. The memory for the object - is managed by the Document. - - If the 'text' param is null, the standard - declaration is used.: - @verbatim - - @endverbatim - */ - XMLDeclaration* NewDeclaration( const char* text=0 ); - /** - Create a new Unknown associated with - this Document. The memory forthe object - is managed by the Document. - */ - XMLUnknown* NewUnknown( const char* text ); - - /** - Delete a node associated with this document. - It will be unlinked from the DOM. - */ - void DeleteNode( XMLNode* node ) { - node->_parent->DeleteChild( node ); - } - - void SetError( XMLError error, const char* str1, const char* str2 ); - - /// Return true if there was an error parsing the document. - bool Error() const { - return _errorID != XML_NO_ERROR; - } - /// Return the errorID. - XMLError ErrorID() const { - return _errorID; - } - /// Return a possibly helpful diagnostic location or string. - const char* GetErrorStr1() const { - return _errorStr1; - } - /// Return a possibly helpful secondary diagnostic location or string. - const char* GetErrorStr2() const { - return _errorStr2; - } - /// If there is an error, print it to stdout. - void PrintError() const; - - // internal - char* Identify( char* p, XMLNode** node ); - - virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const { - return 0; - } - virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const { - return false; - } - -private: - XMLDocument( const XMLDocument& ); // not supported - void operator=( const XMLDocument& ); // not supported - void InitDocument(); - - bool _writeBOM; - bool _processEntities; - XMLError _errorID; - Whitespace _whitespace; - const char* _errorStr1; - const char* _errorStr2; - char* _charBuffer; - - MemPoolT< sizeof(XMLElement) > _elementPool; - MemPoolT< sizeof(XMLAttribute) > _attributePool; - MemPoolT< sizeof(XMLText) > _textPool; - MemPoolT< sizeof(XMLComment) > _commentPool; -}; - - -/** - A XMLHandle is a class that wraps a node pointer with null checks; this is - an incredibly useful thing. Note that XMLHandle is not part of the TinyXML - DOM structure. It is a separate utility class. - - Take an example: - @verbatim - - - - - - - @endverbatim - - Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very - easy to write a *lot* of code that looks like: - - @verbatim - XMLElement* root = document.FirstChildElement( "Document" ); - if ( root ) - { - XMLElement* element = root->FirstChildElement( "Element" ); - if ( element ) - { - XMLElement* child = element->FirstChildElement( "Child" ); - if ( child ) - { - XMLElement* child2 = child->NextSiblingElement( "Child" ); - if ( child2 ) - { - // Finally do something useful. - @endverbatim - - And that doesn't even cover "else" cases. XMLHandle addresses the verbosity - of such code. A XMLHandle checks for null pointers so it is perfectly safe - and correct to use: - - @verbatim - XMLHandle docHandle( &document ); - XMLElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild().NextSibling().ToElement(); - if ( child2 ) - { - // do something useful - @endverbatim - - Which is MUCH more concise and useful. - - It is also safe to copy handles - internally they are nothing more than node pointers. - @verbatim - XMLHandle handleCopy = handle; - @endverbatim - - See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects. -*/ -class CC_DLL XMLHandle -{ -public: - /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. - XMLHandle( XMLNode* node ) { - _node = node; - } - /// Create a handle from a node. - XMLHandle( XMLNode& node ) { - _node = &node; - } - /// Copy constructor - XMLHandle( const XMLHandle& ref ) { - _node = ref._node; - } - /// Assignment - XMLHandle& operator=( const XMLHandle& ref ) { - _node = ref._node; - return *this; - } - - /// Get the first child of this handle. - XMLHandle FirstChild() { - return XMLHandle( _node ? _node->FirstChild() : 0 ); - } - /// Get the first child element of this handle. - XMLHandle FirstChildElement( const char* value=0 ) { - return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 ); - } - /// Get the last child of this handle. - XMLHandle LastChild() { - return XMLHandle( _node ? _node->LastChild() : 0 ); - } - /// Get the last child element of this handle. - XMLHandle LastChildElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 ); - } - /// Get the previous sibling of this handle. - XMLHandle PreviousSibling() { - return XMLHandle( _node ? _node->PreviousSibling() : 0 ); - } - /// Get the previous sibling element of this handle. - XMLHandle PreviousSiblingElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); - } - /// Get the next sibling of this handle. - XMLHandle NextSibling() { - return XMLHandle( _node ? _node->NextSibling() : 0 ); - } - /// Get the next sibling element of this handle. - XMLHandle NextSiblingElement( const char* _value=0 ) { - return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); - } - - /// Safe cast to XMLNode. This can return null. - XMLNode* ToNode() { - return _node; - } - /// Safe cast to XMLElement. This can return null. - XMLElement* ToElement() { - return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); - } - /// Safe cast to XMLText. This can return null. - XMLText* ToText() { - return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); - } - /// Safe cast to XMLUnknown. This can return null. - XMLUnknown* ToUnknown() { - return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); - } - /// Safe cast to XMLDeclaration. This can return null. - XMLDeclaration* ToDeclaration() { - return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); - } - -private: - XMLNode* _node; -}; - - -/** - A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the - same in all regards, except for the 'const' qualifiers. See XMLHandle for API. -*/ -class CC_DLL XMLConstHandle -{ -public: - XMLConstHandle( const XMLNode* node ) { - _node = node; - } - XMLConstHandle( const XMLNode& node ) { - _node = &node; - } - XMLConstHandle( const XMLConstHandle& ref ) { - _node = ref._node; - } - - XMLConstHandle& operator=( const XMLConstHandle& ref ) { - _node = ref._node; - return *this; - } - - const XMLConstHandle FirstChild() const { - return XMLConstHandle( _node ? _node->FirstChild() : 0 ); - } - const XMLConstHandle FirstChildElement( const char* value=0 ) const { - return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 ); - } - const XMLConstHandle LastChild() const { - return XMLConstHandle( _node ? _node->LastChild() : 0 ); - } - const XMLConstHandle LastChildElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 ); - } - const XMLConstHandle PreviousSibling() const { - return XMLConstHandle( _node ? _node->PreviousSibling() : 0 ); - } - const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 ); - } - const XMLConstHandle NextSibling() const { - return XMLConstHandle( _node ? _node->NextSibling() : 0 ); - } - const XMLConstHandle NextSiblingElement( const char* _value=0 ) const { - return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 ); - } - - - const XMLNode* ToNode() const { - return _node; - } - const XMLElement* ToElement() const { - return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 ); - } - const XMLText* ToText() const { - return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 ); - } - const XMLUnknown* ToUnknown() const { - return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 ); - } - const XMLDeclaration* ToDeclaration() const { - return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 ); - } - -private: - const XMLNode* _node; -}; - - -/** - Printing functionality. The XMLPrinter gives you more - options than the XMLDocument::Print() method. - - It can: - -# Print to memory. - -# Print to a file you provide. - -# Print XML without a XMLDocument. - - Print to Memory - - @verbatim - XMLPrinter printer; - doc->Print( &printer ); - SomeFunction( printer.CStr() ); - @endverbatim - - Print to a File - - You provide the file pointer. - @verbatim - XMLPrinter printer( fp ); - doc.Print( &printer ); - @endverbatim - - Print without a XMLDocument - - When loading, an XML parser is very useful. However, sometimes - when saving, it just gets in the way. The code is often set up - for streaming, and constructing the DOM is just overhead. - - The Printer supports the streaming case. The following code - prints out a trivially simple XML file without ever creating - an XML document. - - @verbatim - XMLPrinter printer( fp ); - printer.OpenElement( "foo" ); - printer.PushAttribute( "foo", "bar" ); - printer.CloseElement(); - @endverbatim -*/ -class CC_DLL XMLPrinter : public XMLVisitor -{ -public: - /** Construct the printer. If the FILE* is specified, - this will print to the FILE. Else it will print - to memory, and the result is available in CStr(). - If 'compact' is set to true, then output is created - with only required whitespace and newlines. - */ - XMLPrinter( FILE* file=0, bool compact = false ); - ~XMLPrinter() {} - - /** If streaming, write the BOM and declaration. */ - void PushHeader( bool writeBOM, bool writeDeclaration ); - /** If streaming, start writing an element. - The element must be closed with CloseElement() - */ - void OpenElement( const char* name ); - /// If streaming, add an attribute to an open element. - void PushAttribute( const char* name, const char* value ); - void PushAttribute( const char* name, int value ); - void PushAttribute( const char* name, unsigned value ); - void PushAttribute( const char* name, bool value ); - void PushAttribute( const char* name, double value ); - /// If streaming, close the Element. - void CloseElement(); - - /// Add a text node. - void PushText( const char* text, bool cdata=false ); - /// Add a text node from an integer. - void PushText( int value ); - /// Add a text node from an unsigned. - void PushText( unsigned value ); - /// Add a text node from a bool. - void PushText( bool value ); - /// Add a text node from a float. - void PushText( float value ); - /// Add a text node from a double. - void PushText( double value ); - - /// Add a comment - void PushComment( const char* comment ); - - void PushDeclaration( const char* value ); - void PushUnknown( const char* value ); - - virtual bool VisitEnter( const XMLDocument& /*doc*/ ); - virtual bool VisitExit( const XMLDocument& /*doc*/ ) { - return true; - } - - virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute ); - virtual bool VisitExit( const XMLElement& element ); - - virtual bool Visit( const XMLText& text ); - virtual bool Visit( const XMLComment& comment ); - virtual bool Visit( const XMLDeclaration& declaration ); - virtual bool Visit( const XMLUnknown& unknown ); - - /** - If in print to memory mode, return a pointer to - the XML file in memory. - */ - const char* CStr() const { - return _buffer.Mem(); - } - /** - If in print to memory mode, return the size - of the XML file in memory. (Note the size returned - includes the terminating null.) - */ - int CStrSize() const { - return _buffer.Size(); - } - -private: - void SealElement(); - void PrintSpace( int depth ); - void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities. - void Print( const char* format, ... ); - - bool _elementJustOpened; - bool _firstElement; - FILE* _fp; - int _depth; - int _textDepth; - bool _processEntities; - bool _compactMode; - - enum { - ENTITY_RANGE = 64, - BUF_SIZE = 200 - }; - bool _entityFlag[ENTITY_RANGE]; - bool _restrictedEntityFlag[ENTITY_RANGE]; - - DynArray< const char*, 10 > _stack; - DynArray< char, 20 > _buffer; -#ifdef _MSC_VER - DynArray< char, 20 > _accumulator; -#endif -}; - - -} // tinyxml2 - - -#endif // TINYXML2_INCLUDED diff --git a/cocos/2d/support/zip_support/ioapi.cpp b/cocos/2d/support/zip_support/ioapi.cpp deleted file mode 100644 index 669ea36927..0000000000 --- a/cocos/2d/support/zip_support/ioapi.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - -*/ - -#include "ioapi.h" - -namespace cocos2d { - -voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) -{ - if (pfilefunc->zfile_func64.zopen64_file != NULL) - return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); - else - { - return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); - } -} - -long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); - else - { - uLong offsetTruncated = (uLong)offset; - if (offsetTruncated != offset) - return -1; - else - return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); - } -} - -ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) -{ - if (pfilefunc->zfile_func64.zseek64_file != NULL) - return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); - else - { - uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); - if ((tell_uLong) == ((uLong)-1)) - return (ZPOS64_T)-1; - else - return tell_uLong; - } -} - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) -{ - p_filefunc64_32->zfile_func64.zopen64_file = NULL; - p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; - p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; - p_filefunc64_32->zfile_func64.ztell64_file = NULL; - p_filefunc64_32->zfile_func64.zseek64_file = NULL; - p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; - p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; - p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; - p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; - p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; -} - - - -static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); -static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); -static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); -static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); -static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); - -static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - file = fopen(filename, mode_fopen); - return file; -} - -static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) -{ - FILE* file = NULL; - const char* mode_fopen = NULL; - if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) - mode_fopen = "rb"; - else - if (mode & ZLIB_FILEFUNC_MODE_EXISTING) - mode_fopen = "r+b"; - else - if (mode & ZLIB_FILEFUNC_MODE_CREATE) - mode_fopen = "wb"; - - if ((filename!=NULL) && (mode_fopen != NULL)) - { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - file = NULL; -#else - file = fopen64((const char*)filename, mode_fopen); -#endif - } - - return file; -} - - -static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) -{ - uLong ret; - ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); - return ret; -} - -static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) -{ - long ret; - ret = ftell((FILE *)stream); - return ret; -} - - -static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) -{ - ZPOS64_T ret; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - ret = 0; -#else - ret = ftello64((FILE *)stream); -#endif - return ret; -} - -static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) -{ - int fseek_origin=0; - long ret; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - ret = 0; - if (fseek((FILE *)stream, offset, fseek_origin) != 0) - ret = -1; - return ret; -} - -static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) -{ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - return -1; -#else - int fseek_origin=0; - switch (origin) - { - case ZLIB_FILEFUNC_SEEK_CUR : - fseek_origin = SEEK_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END : - fseek_origin = SEEK_END; - break; - case ZLIB_FILEFUNC_SEEK_SET : - fseek_origin = SEEK_SET; - break; - default: return -1; - } - if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) - return -1; - return 0; -#endif -} - - -static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = fclose((FILE *)stream); - return ret; -} - -static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) -{ - int ret; - ret = ferror((FILE *)stream); - return ret; -} - -void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen_file = fopen_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell_file = ftell_file_func; - pzlib_filefunc_def->zseek_file = fseek_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) -{ - pzlib_filefunc_def->zopen64_file = fopen64_file_func; - pzlib_filefunc_def->zread_file = fread_file_func; - pzlib_filefunc_def->zwrite_file = fwrite_file_func; - pzlib_filefunc_def->ztell64_file = ftell64_file_func; - pzlib_filefunc_def->zseek64_file = fseek64_file_func; - pzlib_filefunc_def->zclose_file = fclose_file_func; - pzlib_filefunc_def->zerror_file = ferror_file_func; - pzlib_filefunc_def->opaque = NULL; -} - -} // end of namespace cocos2d diff --git a/cocos/2d/support/zip_support/ioapi.h b/cocos/2d/support/zip_support/ioapi.h deleted file mode 100644 index 575f44ece4..0000000000 --- a/cocos/2d/support/zip_support/ioapi.h +++ /dev/null @@ -1,201 +0,0 @@ -/* ioapi.h -- IO base function header for compress/uncompress .zip - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications for Zip64 support - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - Changes - - Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) - Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. - More if/def section may be needed to support other platforms - Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. - (but you should use iowin32.c for windows instead) - -*/ - -#ifndef _ZLIBIOAPI64_H -#define _ZLIBIOAPI64_H - -#include "platform/CCPlatformConfig.h" - -#if (!defined(_WIN32)) && (!defined(WIN32)) - - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - - #ifndef __USE_FILE_OFFSET64 - #define __USE_FILE_OFFSET64 - #endif - #ifndef __USE_LARGEFILE64 - #define __USE_LARGEFILE64 - #endif - #ifndef _LARGEFILE64_SOURCE - #define _LARGEFILE64_SOURCE - #endif - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif -#endif - -#include -#include -#include "zlib.h" - -namespace cocos2d { - -#ifndef OF -#define OF _Z_OF -#endif - -#if defined(USE_FILE32API) -#define fopen64 fopen -#define ftello64 ftell -#define fseeko64 fseek -#else -#ifdef _MSC_VER - #define fopen64 fopen - #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) - #define ftello64 _ftelli64 - #define fseeko64 _fseeki64 - #else // old MSC - #define ftello64 ftell - #define fseeko64 fseek - #endif -#endif -#endif - -/* -#ifndef ZPOS64_T - #ifdef _WIN32 - #define ZPOS64_T fpos_t - #else - #include - #define ZPOS64_T uint64_t - #endif -#endif -*/ - -#ifdef HAVE_MINIZIP64_CONF_H -#include "mz64conf.h" -#endif - -/* a type chosen by DEFINE */ -#ifdef HAVE_64BIT_INT_CUSTOM -typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; -#else -#ifdef HAS_STDINT_H -#include "stdint.h" -typedef uint64_t ZPOS64_T; -#else - - -#if defined(_MSC_VER) || defined(__BORLANDC__) -typedef unsigned __int64 ZPOS64_T; -#else -typedef unsigned long long int ZPOS64_T; -#endif -#endif -#endif - - - -#define ZLIB_FILEFUNC_SEEK_CUR (1) -#define ZLIB_FILEFUNC_SEEK_END (2) -#define ZLIB_FILEFUNC_SEEK_SET (0) - -#define ZLIB_FILEFUNC_MODE_READ (1) -#define ZLIB_FILEFUNC_MODE_WRITE (2) -#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) - -#define ZLIB_FILEFUNC_MODE_EXISTING (4) -#define ZLIB_FILEFUNC_MODE_CREATE (8) - - -#ifndef ZCALLBACK - #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) - #define ZCALLBACK CALLBACK - #else - #define ZCALLBACK - #endif -#endif - - - - -typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); -typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); -typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); -typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); -typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); - -typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); - - -/* here is the "old" 32 bits structure structure */ -typedef struct zlib_filefunc_def_s -{ - open_file_func zopen_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell_file_func ztell_file; - seek_file_func zseek_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc_def; - -typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); -typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); -typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); - -typedef struct zlib_filefunc64_def_s -{ - open64_file_func zopen64_file; - read_file_func zread_file; - write_file_func zwrite_file; - tell64_file_func ztell64_file; - seek64_file_func zseek64_file; - close_file_func zclose_file; - testerror_file_func zerror_file; - voidpf opaque; -} zlib_filefunc64_def; - -void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); -void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); - -/* now internal definition, only for zip.c and unzip.h */ -typedef struct zlib_filefunc64_32_def_s -{ - zlib_filefunc64_def zfile_func64; - open_file_func zopen32_file; - tell_file_func ztell32_file; - seek_file_func zseek32_file; -} zlib_filefunc64_32_def; - - -#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) -#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) -#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) - -voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); -long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); -ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); - -void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); - -#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) -#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) -#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) - -} // end of namespace cocos2d - -#endif diff --git a/cocos/2d/support/zip_support/unzip.cpp b/cocos/2d/support/zip_support/unzip.cpp deleted file mode 100644 index 66cfeff16a..0000000000 --- a/cocos/2d/support/zip_support/unzip.cpp +++ /dev/null @@ -1,2161 +0,0 @@ -/* unzip.c -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - - ------------------------------------------------------------------------------------ - Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of - compatibility with older software. The following is from the original crypt.c. - Code woven in by Terry Thorsen 1/2003. - - Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - - See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. - If, for some reason, all these files are missing, the Info-ZIP license - also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - - crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - - The encryption/decryption parts of this source code (as opposed to the - non-echoing password parts) were originally written in Europe. The - whole source package can be freely distributed, including from the USA. - (Prior to January 2000, re-export from the US was a violation of US law.) - - This encryption code is a direct transcription of the algorithm from - Roger Schlafly, described by Phil Katz in the file appnote.txt. This - file (appnote.txt) is distributed with the PKZIP program (even in the - version without encryption capabilities). - - ------------------------------------------------------------------------------------ - - Changes in unzip.c - - 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos - 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* - 2007-2008 - Even Rouault - Remove old C style function prototypes - 2007-2008 - Even Rouault - Add unzip support for ZIP64 - - Copyright (C) 2007-2008 Even Rouault - - - Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). - Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G - should only read the compressed/uncompressed size from the Zip64 format if - the size from normal header was 0xFFFFFFFF - Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant - Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required) - Patch created by Daniel Borca - - Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer - - Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson - -*/ - - -#include -#include -#include - -#ifndef NOUNCRYPT - #define NOUNCRYPT -#endif - -#include "zlib.h" -#include "unzip.h" - -#ifdef STDC -# include -# include -# include -#endif -#ifdef NO_ERRNO_H - extern int errno; -#else -# include -#endif - -namespace cocos2d { - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - - -#ifndef CASESENSITIVITYDEFAULT_NO -# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) -# define CASESENSITIVITYDEFAULT_NO -# endif -#endif - - -#ifndef UNZ_BUFSIZE -#define UNZ_BUFSIZE (16384) -#endif - -#ifndef UNZ_MAXFILENAMEINZIP -#define UNZ_MAXFILENAMEINZIP (256) -#endif - -#ifndef ALLOC -# define ALLOC(size) (malloc(size)) -#endif -#ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} -#endif - -#define SIZECENTRALDIRITEM (0x2e) -#define SIZEZIPLOCALHEADER (0x1e) - - -const char unz_copyright[] = - " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; - -/* unz_file_info_interntal contain internal info about a file in zipfile*/ -typedef struct unz_file_info64_internal_s -{ - ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ -} unz_file_info64_internal; - - -/* file_in_zip_read_info_s contain internal information about a file in zipfile, - when reading and decompress it */ -typedef struct -{ - char *read_buffer; /* internal buffer for compressed data */ - z_stream stream; /* zLib stream structure for inflate */ - -#ifdef HAVE_BZIP2 - bz_stream bstream; /* bzLib stream structure for bziped */ -#endif - - ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ - uLong stream_initialised; /* flag set if stream structure is initialized*/ - - ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ - uInt size_local_extrafield;/* size of the local extra field */ - ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ - ZPOS64_T total_out_64; - - uLong crc32; /* crc32 of all data uncompressed */ - uLong crc32_wait; /* crc32 we must obtain after decompress all */ - ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ - ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ - zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structure of the zipfile */ - uLong compression_method; /* compression method (0==store) */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - int raw; -} file_in_zip64_read_info_s; - - -/* unz64_s contain internal information about the zipfile -*/ -typedef struct -{ - zlib_filefunc64_32_def z_filefunc; - int is64bitOpenFunction; - voidpf filestream; /* io structure of the zipfile */ - unz_global_info64 gi; /* public global information */ - ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ - ZPOS64_T num_file; /* number of the current file in the zipfile*/ - ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ - ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ - ZPOS64_T central_pos; /* position of the beginning of the central dir*/ - - ZPOS64_T size_central_dir; /* size of the central directory */ - ZPOS64_T offset_central_dir; /* offset of start of central directory with - respect to the starting disk number */ - - unz_file_info64 cur_file_info; /* public info about the current file in zip*/ - unz_file_info64_internal cur_file_info_internal; /* private info about it*/ - file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current - file if we are decompressing it */ - int encrypted; - - int isZip64; - -# ifndef NOUNCRYPT - unsigned long keys[3]; /* keys defining the pseudo-random sequence */ - const unsigned long* pcrc_32_tab; -# endif -} unz64_s; - - -#ifndef NOUNCRYPT -#include "crypt.h" -#endif - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been successfully opened for reading. -*/ - - -local int unz64local_getByte OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - int *pi)); - -local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) -{ - unsigned char c; - int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); - if (err==1) - { - *pi = (int)c; - return UNZ_OK; - } - else - { - if (ZERROR64(*pzlib_filefunc_def,filestream)) - return UNZ_ERRNO; - else - return UNZ_EOF; - } -} - - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets -*/ -local int unz64local_getShort OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX)); - -local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - uLong *pX) -{ - uLong x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (uLong)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((uLong)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x += ((uLong)i)<<24; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -local int unz64local_getLong64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX)); - - -local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream, - ZPOS64_T *pX) -{ - ZPOS64_T x ; - int i = 0; - int err; - - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x = (ZPOS64_T)i; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<8; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<16; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<24; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<32; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<40; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<48; - - if (err==UNZ_OK) - err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); - x |= ((ZPOS64_T)i)<<56; - - if (err==UNZ_OK) - *pX = x; - else - *pX = 0; - return err; -} - -/* My own strcmpi / strcasecmp */ -local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) -{ - for (;;) - { - char c1=*(fileName1++); - char c2=*(fileName2++); - if ((c1>='a') && (c1<='z')) - c1 -= 0x20; - if ((c2>='a') && (c2<='z')) - c2 -= 0x20; - if (c1=='\0') - return ((c2=='\0') ? 0 : -1); - if (c2=='\0') - return 1; - if (c1c2) - return 1; - } -} - - -#ifdef CASESENSITIVITYDEFAULT_NO -#define CASESENSITIVITYDEFAULTVALUE 2 -#else -#define CASESENSITIVITYDEFAULTVALUE 1 -#endif - -#ifndef STRCMPCASENOSENTIVEFUNCTION -#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal -#endif - -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is default of your operating system - (like 1 on Unix, 2 on Windows) - -*/ -int ZEXPORT unzStringFileNameCompare (const char* fileName1, - const char* fileName2, - int iCaseSensitivity) - -{ - if (iCaseSensitivity==0) - iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; - - if (iCaseSensitivity==1) - return strcmp(fileName1,fileName2); - - return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); -} - -#ifndef BUFREADCOMMENT -#define BUFREADCOMMENT (0x400) -#endif - -/* - Locate the Central directory of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); -local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - return uPosFound; -} - - -/* - Locate the Central directory 64 of a zipfile (at the end, just before - the global comment) -*/ -local ZPOS64_T unz64local_SearchCentralDir64 OF(( - const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream)); - -local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, - voidpf filestream) -{ - unsigned char* buf; - ZPOS64_T uSizeFile; - ZPOS64_T uBackRead; - ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ - ZPOS64_T uPosFound=0; - uLong uL; - ZPOS64_T relativeOffset; - - if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) - return 0; - - - uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); - - if (uMaxBack>uSizeFile) - uMaxBack = uSizeFile; - - buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); - if (buf==NULL) - return 0; - - uBackRead = 4; - while (uBackReaduMaxBack) - uBackRead = uMaxBack; - else - uBackRead+=BUFREADCOMMENT; - uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? - (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); - if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) - break; - - if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) - break; - - for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && - ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) - { - uPosFound = uReadPos+i; - break; - } - - if (uPosFound!=0) - break; - } - TRYFREE(buf); - if (uPosFound == 0) - return 0; - - /* Zip64 end of central directory locator */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature, already checked */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - /* number of the disk with the start of the zip64 end of central directory */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 0) - return 0; - - /* relative offset of the zip64 end of central directory record */ - if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) - return 0; - - /* total number of disks */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - if (uL != 1) - return 0; - - /* Goto end of central directory record */ - if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) - return 0; - - /* the signature */ - if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) - return 0; - - if (uL != 0x06064b50) - return 0; - - return relativeOffset; -} - -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer - "zlib/zlib114.zip". - If the zipfile cannot be opened (file doesn't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. -*/ -local unzFile unzOpenInternal (const void *path, - zlib_filefunc64_32_def* pzlib_filefunc64_32_def, - int is64bitOpenFunction) -{ - unz64_s us; - unz64_s *s; - ZPOS64_T central_pos; - uLong uL; - - uLong number_disk; /* number of the current dist, used for - spanning ZIP, unsupported, always 0*/ - uLong number_disk_with_CD; /* number the the disk with central dir, used - for spanning ZIP, unsupported, always 0*/ - ZPOS64_T number_entry_CD; /* total number of entries in - the central dir - (same than number_entry on nospan) */ - - int err=UNZ_OK; - - if (unz_copyright[0]!=' ') - return NULL; - - us.z_filefunc.zseek32_file = NULL; - us.z_filefunc.ztell32_file = NULL; - if (pzlib_filefunc64_32_def==NULL) - fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); - else - us.z_filefunc = *pzlib_filefunc64_32_def; - us.is64bitOpenFunction = is64bitOpenFunction; - - - - us.filestream = ZOPEN64(us.z_filefunc, - path, - ZLIB_FILEFUNC_MODE_READ | - ZLIB_FILEFUNC_MODE_EXISTING); - if (us.filestream==NULL) - return NULL; - - central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); - if (central_pos) - { - uLong uS; - ZPOS64_T uL64; - - us.isZip64 = 1; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* size of zip64 end of central directory record */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version made by */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* version needed to extract */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory on this disk */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) - err=UNZ_ERRNO; - - us.gi.size_comment = 0; - } - else - { - central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); - if (central_pos==0) - err=UNZ_ERRNO; - - us.isZip64 = 0; - - if (ZSEEK64(us.z_filefunc, us.filestream, - central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - /* the signature, already checked */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) - err=UNZ_ERRNO; - - /* number of the disk with the start of the central directory */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) - err=UNZ_ERRNO; - - /* total number of entries in the central dir on this disk */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.gi.number_entry = uL; - - /* total number of entries in the central dir */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - number_entry_CD = uL; - - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || - (number_disk!=0)) - err=UNZ_BADZIPFILE; - - /* size of the central directory */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.size_central_dir = uL; - - /* offset of start of central directory with respect to the - starting disk number */ - if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) - err=UNZ_ERRNO; - us.offset_central_dir = uL; - - /* zipfile comment length */ - if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) - err=UNZ_ERRNO; - } - - if ((central_pospfile_in_zip_read!=NULL) - unzCloseCurrentFile(file); - - ZCLOSE64(s->z_filefunc, s->filestream); - TRYFREE(s); - return UNZ_OK; -} - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ -int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - *pglobal_info=s->gi; - return UNZ_OK; -} - -int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) -{ - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - /* to do : check if number_entry is not truncated */ - pglobal_info32->number_entry = (uLong)s->gi.number_entry; - pglobal_info32->size_comment = s->gi.size_comment; - return UNZ_OK; -} -/* - Translate date/time from Dos format to tm_unz (readable more easily) -*/ -local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) -{ - ZPOS64_T uDate; - uDate = (ZPOS64_T)(ulDosDate>>16); - ptm->tm_mday = (uInt)(uDate&0x1f) ; - ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; - ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; - - ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); - ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; - ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; -} - -/* - Get Info about the current file in the zipfile, with internal only info -*/ -local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -local int unz64local_GetCurrentFileInfoInternal (unzFile file, - unz_file_info64 *pfile_info, - unz_file_info64_internal - *pfile_info_internal, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize) -{ - unz64_s* s; - unz_file_info64 file_info; - unz_file_info64_internal file_info_internal; - int err=UNZ_OK; - uLong uMagic; - long lSeek=0; - uLong uL; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pos_in_central_dir+s->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - err=UNZ_ERRNO; - - - /* we check the magic */ - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x02014b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) - err=UNZ_ERRNO; - - unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.compressed_size = uL; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info.uncompressed_size = uL; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) - err=UNZ_ERRNO; - - // relative offset of local header - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - file_info_internal.offset_curfile = uL; - - lSeek+=file_info.size_filename; - if ((err==UNZ_OK) && (szFileName!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_filename0) && (fileNameBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - lSeek -= uSizeRead; - } - - // Read extrafield - if ((err==UNZ_OK) && (extraField!=NULL)) - { - ZPOS64_T uSizeRead ; - if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - - lSeek += file_info.size_file_extra - (uLong)uSizeRead; - } - else - lSeek += file_info.size_file_extra; - - - if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) - { - uLong acc = 0; - - // since lSeek now points to after the extra field we need to move back - lSeek -= file_info.size_file_extra; - - if (lSeek!=0) - { - if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - } - - while(acc < file_info.size_file_extra) - { - uLong headerId; - uLong dataSize; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) - err=UNZ_ERRNO; - - /* ZIP64 extra fields */ - if (headerId == 0x0001) - { - uLong uL; - - if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) - { - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) - { - /* Relative Header offset */ - if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) - err=UNZ_ERRNO; - } - - if(file_info.disk_num_start == (unsigned long)-1) - { - /* Disk Start Number */ - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) - err=UNZ_ERRNO; - } - - } - else - { - if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) - err=UNZ_ERRNO; - } - - acc += 2 + 2 + dataSize; - } - } - - if ((err==UNZ_OK) && (szComment!=NULL)) - { - uLong uSizeRead ; - if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) { - //lSeek=0; - } - else - err=UNZ_ERRNO; - } - - if ((file_info.size_file_comment>0) && (commentBufferSize>0)) - if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) - err=UNZ_ERRNO; - //lSeek+=file_info.size_file_comment - uSizeRead; - } - //else - // lSeek+=file_info.size_file_comment; - - - if ((err==UNZ_OK) && (pfile_info!=NULL)) - *pfile_info=file_info; - - if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) - *pfile_info_internal=file_info_internal; - - return err; -} - - - -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. -*/ -int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - unz_file_info64 * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); -} - -int ZEXPORT unzGetCurrentFileInfo (unzFile file, - unz_file_info * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, - char* szComment, uLong commentBufferSize) -{ - int err; - unz_file_info64 file_info64; - err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, - szFileName,fileNameBufferSize, - extraField,extraFieldBufferSize, - szComment,commentBufferSize); - if (err==UNZ_OK) - { - pfile_info->version = file_info64.version; - pfile_info->version_needed = file_info64.version_needed; - pfile_info->flag = file_info64.flag; - pfile_info->compression_method = file_info64.compression_method; - pfile_info->dosDate = file_info64.dosDate; - pfile_info->crc = file_info64.crc; - - pfile_info->size_filename = file_info64.size_filename; - pfile_info->size_file_extra = file_info64.size_file_extra; - pfile_info->size_file_comment = file_info64.size_file_comment; - - pfile_info->disk_num_start = file_info64.disk_num_start; - pfile_info->internal_fa = file_info64.internal_fa; - pfile_info->external_fa = file_info64.external_fa; - - pfile_info->tmu_date = file_info64.tmu_date, - - - pfile_info->compressed_size = (uLong)file_info64.compressed_size; - pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; - - } - return err; -} - -/* - Set the current file of the zipfile to the first file - with retrieving an information about the file. - return UNZ_OK if there is no problem -*/ -int ZEXPORT unzGoToFirstFile64 (unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize) -{ - int err=UNZ_OK; - unz64_s* s; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - s->pos_in_central_dir=s->offset_central_dir; - s->num_file=0; - err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - szFileName,fileNameBufferSize,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - if (pfile_info) - *pfile_info = s->cur_file_info; - return err; -} - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ -int ZEXPORT unzGoToFirstFile (unzFile file) -{ - return unzGoToFirstFile64(file, NULL, NULL, 0); -} - -/* - Set the current file of the zipfile to the next file - with retrieving an information about the file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -int ZEXPORT unzGoToNextFile64 (unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ - if (s->num_file+1==s->gi.number_entry) - return UNZ_END_OF_LIST_OF_FILE; - - s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + - s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; - s->num_file++; - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - szFileName,fileNameBufferSize,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - if (pfile_info) - *pfile_info = s->cur_file_info; - return err; -} - -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ -int ZEXPORT unzGoToNextFile (unzFile file) -{ - return unzGoToNextFile64(file, NULL, NULL, 0); -} - - -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzipStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ -int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) -{ - unz64_s* s; - int err; - - /* We remember the 'current' position in the file so that we can jump - * back there if we fail. - */ - unz_file_info64 cur_file_infoSaved; - unz_file_info64_internal cur_file_info_internalSaved; - ZPOS64_T num_fileSaved; - ZPOS64_T pos_in_central_dirSaved; - - - if (file==NULL) - return UNZ_PARAMERROR; - - if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) - return UNZ_PARAMERROR; - - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - /* Save the current state */ - num_fileSaved = s->num_file; - pos_in_central_dirSaved = s->pos_in_central_dir; - cur_file_infoSaved = s->cur_file_info; - cur_file_info_internalSaved = s->cur_file_info_internal; - - err = unzGoToFirstFile(file); - - while (err == UNZ_OK) - { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - err = unzGetCurrentFileInfo64(file,NULL, - szCurrentFileName,sizeof(szCurrentFileName)-1, - NULL,0,NULL,0); - if (err == UNZ_OK) - { - if (unzStringFileNameCompare(szCurrentFileName, - szFileName,iCaseSensitivity)==0) - return UNZ_OK; - err = unzGoToNextFile(file); - } - } - - /* We failed, so restore the state of the 'current file' to where we - * were. - */ - s->num_file = num_fileSaved ; - s->pos_in_central_dir = pos_in_central_dirSaved ; - s->cur_file_info = cur_file_infoSaved; - s->cur_file_info_internal = cur_file_info_internalSaved; - return err; -} - - -/* -/////////////////////////////////////////// -// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) -// I need random access -// -// Further optimization could be realized by adding an ability -// to cache the directory in memory. The goal being a single -// comprehensive file read to put the file I need in a memory. -*/ - -/* -typedef struct unz_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; // offset in file - ZPOS64_T num_of_file; // # of file -} unz_file_pos; -*/ - -int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) -{ - unz64_s* s; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_END_OF_LIST_OF_FILE; - - file_pos->pos_in_zip_directory = s->pos_in_central_dir; - file_pos->num_of_file = s->num_file; - - return UNZ_OK; -} - -int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - int err = unzGetFilePos64(file,&file_pos64); - if (err==UNZ_OK) - { - file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; - file_pos->num_of_file = (uLong)file_pos64.num_of_file; - } - return err; -} - -int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) -{ - unz64_s* s; - int err; - - if (file==NULL || file_pos==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - /* jump to the right spot */ - s->pos_in_central_dir = file_pos->pos_in_zip_directory; - s->num_file = file_pos->num_of_file; - - /* set the current file */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - /* return results */ - s->current_file_ok = (err == UNZ_OK); - return err; -} - -int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos) -{ - unz64_file_pos file_pos64; - if (file_pos == NULL) - return UNZ_PARAMERROR; - - file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; - file_pos64.num_of_file = file_pos->num_of_file; - return unzGoToFilePos64(file,&file_pos64); -} - -/* -// Unzip Helper Functions - should be here? -/////////////////////////////////////////// -*/ - -/* - Read the local header of the current zipfile - Check the coherency of the local header and info in the end of central - directory about this file - store in *piSizeVar the size of extra info in local header - (filename and size of extra field data) -*/ -local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, - ZPOS64_T * poffset_local_extrafield, - uInt * psize_local_extrafield) -{ - uLong uMagic,uData,uFlags; - uLong size_filename; - uLong size_extra_field; - int err=UNZ_OK; - - *piSizeVar = 0; - *poffset_local_extrafield = 0; - *psize_local_extrafield = 0; - - if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + - s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - - if (err==UNZ_OK) - { - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) - err=UNZ_ERRNO; - else if (uMagic!=0x04034b50) - err=UNZ_BADZIPFILE; - } - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; -/* - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) - err=UNZ_BADZIPFILE; -*/ - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) - err=UNZ_ERRNO; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) - err=UNZ_BADZIPFILE; - - if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ - err=UNZ_ERRNO; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ - err=UNZ_ERRNO; - else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) - err=UNZ_BADZIPFILE; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) - err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) - err=UNZ_BADZIPFILE; - - *piSizeVar += (uInt)size_filename; - - if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) - err=UNZ_ERRNO; - *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + - SIZEZIPLOCALHEADER + size_filename; - *psize_local_extrafield = (uInt)size_extra_field; - - *piSizeVar += (uInt)size_extra_field; - - return err; -} - -/* - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. -*/ -int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - int* level, int raw, const char* password) -{ - int err=UNZ_OK; - uInt iSizeVar; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ - uInt size_local_extrafield; /* size of the local extra field */ -# ifndef NOUNCRYPT - char source[12]; -# else - if (password != NULL) - return UNZ_PARAMERROR; -# endif - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return UNZ_PARAMERROR; - - if (s->pfile_in_zip_read != NULL) - unzCloseCurrentFile(file); - - if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) - return UNZ_BADZIPFILE; - - pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); - if (pfile_in_zip_read_info==NULL) - return UNZ_INTERNALERROR; - - pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); - pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; - pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; - pfile_in_zip_read_info->pos_local_extrafield=0; - pfile_in_zip_read_info->raw=raw; - - if (pfile_in_zip_read_info->read_buffer==NULL) - { - TRYFREE(pfile_in_zip_read_info); - return UNZ_INTERNALERROR; - } - - pfile_in_zip_read_info->stream_initialised=0; - - if (method!=NULL) - *method = (int)s->cur_file_info.compression_method; - - if (level!=NULL) - { - *level = 6; - switch (s->cur_file_info.flag & 0x06) - { - case 6 : *level = 1; break; - case 4 : *level = 2; break; - case 2 : *level = 9; break; - } - } - - if ((s->cur_file_info.compression_method!=0) && -/* #ifdef HAVE_BZIP2 */ - (s->cur_file_info.compression_method!=Z_BZIP2ED) && -/* #endif */ - (s->cur_file_info.compression_method!=Z_DEFLATED)) { - - //err=UNZ_BADZIPFILE; - } - pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; - pfile_in_zip_read_info->crc32=0; - pfile_in_zip_read_info->total_out_64=0; - pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; - pfile_in_zip_read_info->filestream=s->filestream; - pfile_in_zip_read_info->z_filefunc=s->z_filefunc; - pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; - - pfile_in_zip_read_info->stream.total_out = 0; - - if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) - { -#ifdef HAVE_BZIP2 - pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; - pfile_in_zip_read_info->bstream.bzfree = (free_func)0; - pfile_in_zip_read_info->bstream.opaque = (voidpf)0; - pfile_in_zip_read_info->bstream.state = (voidpf)0; - - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = (voidpf)0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } -#else - pfile_in_zip_read_info->raw=1; -#endif - } - else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) - { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - pfile_in_zip_read_info->stream.next_in = 0; - pfile_in_zip_read_info->stream.avail_in = 0; - - err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); - if (err == Z_OK) - pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; - else - { - TRYFREE(pfile_in_zip_read_info); - return err; - } - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the - * size of both compressed and uncompressed data - */ - } - pfile_in_zip_read_info->rest_read_compressed = - s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = - s->cur_file_info.uncompressed_size ; - - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + - iSizeVar; - - pfile_in_zip_read_info->stream.avail_in = (uInt)0; - - s->pfile_in_zip_read = pfile_in_zip_read_info; - s->encrypted = 0; - -# ifndef NOUNCRYPT - if (password != NULL) - { - int i; - s->pcrc_32_tab = get_crc_table(); - init_keys(password,s->keys,s->pcrc_32_tab); - if (ZSEEK64(s->z_filefunc, s->filestream, - s->pfile_in_zip_read->pos_in_zipfile + - s->pfile_in_zip_read->byte_before_the_zipfile, - SEEK_SET)!=0) - return UNZ_INTERNALERROR; - if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) - return UNZ_INTERNALERROR; - - for (i = 0; i<12; i++) - zdecode(s->keys,s->pcrc_32_tab,source[i]); - - s->pfile_in_zip_read->pos_in_zipfile+=12; - s->encrypted=1; - } -# endif - - - return UNZ_OK; -} - -int ZEXPORT unzOpenCurrentFile (unzFile file) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); -} - -int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) -{ - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); -} - -int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) -{ - return unzOpenCurrentFile3(file, method, level, raw, NULL); -} - -/** Addition for GDAL : START */ - -ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - s=(unz64_s*)file; - if (file==NULL) - return 0; //UNZ_PARAMERROR; - pfile_in_zip_read_info=s->pfile_in_zip_read; - if (pfile_in_zip_read_info==NULL) - return 0; //UNZ_PARAMERROR; - return pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile; -} - -/** Addition for GDAL : END */ - -/* - Read bytes from the current file. - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if some bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ -int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) -{ - int err=UNZ_OK; - uInt iRead = 0; - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if (pfile_in_zip_read_info->read_buffer == NULL) - return UNZ_END_OF_LIST_OF_FILE; - if (len==0) - return 0; - - pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; - - pfile_in_zip_read_info->stream.avail_out = (uInt)len; - - if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && - (!(pfile_in_zip_read_info->raw))) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - - if ((len>pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in) && - (pfile_in_zip_read_info->raw)) - pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed+ - pfile_in_zip_read_info->stream.avail_in; - - while (pfile_in_zip_read_info->stream.avail_out>0) - { - if ((pfile_in_zip_read_info->stream.avail_in==0) && - (pfile_in_zip_read_info->rest_read_compressed>0)) - { - uInt uReadThis = UNZ_BUFSIZE; - if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; - if (uReadThis == 0) - return UNZ_EOF; - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->pos_in_zipfile + - pfile_in_zip_read_info->byte_before_the_zipfile, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->read_buffer, - uReadThis)!=uReadThis) - return UNZ_ERRNO; - - -# ifndef NOUNCRYPT - if(s->encrypted) - { - uInt i; - for(i=0;iread_buffer[i] = - zdecode(s->keys,s->pcrc_32_tab, - pfile_in_zip_read_info->read_buffer[i]); - } -# endif - - - pfile_in_zip_read_info->pos_in_zipfile += uReadThis; - - pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = - (Bytef*)pfile_in_zip_read_info->read_buffer; - pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; - } - - if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) - { - uInt uDoCopy,i ; - - if ((pfile_in_zip_read_info->stream.avail_in == 0) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - return (iRead==0) ? UNZ_EOF : iRead; - - if (pfile_in_zip_read_info->stream.avail_out < - pfile_in_zip_read_info->stream.avail_in) - uDoCopy = pfile_in_zip_read_info->stream.avail_out ; - else - uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - - for (i=0;istream.next_out+i) = - *(pfile_in_zip_read_info->stream.next_in+i); - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, - pfile_in_zip_read_info->stream.next_out, - uDoCopy); - pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; - pfile_in_zip_read_info->stream.avail_in -= uDoCopy; - pfile_in_zip_read_info->stream.avail_out -= uDoCopy; - pfile_in_zip_read_info->stream.next_out += uDoCopy; - pfile_in_zip_read_info->stream.next_in += uDoCopy; - pfile_in_zip_read_info->stream.total_out += uDoCopy; - iRead += uDoCopy; - } - else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) - { -#ifdef HAVE_BZIP2 - uLong uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - uLong uOutThis; - - pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; - pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; - pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; - pfile_in_zip_read_info->bstream.total_in_hi32 = 0; - pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; - pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; - pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; - pfile_in_zip_read_info->bstream.total_out_hi32 = 0; - - uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; - bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; - - err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); - - uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); - pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; - pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; - pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; - pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; - pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; - pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; - - if (err==BZ_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=BZ_OK) - break; -#endif - } // end Z_BZIP2ED - else - { - ZPOS64_T uTotalOutBefore,uTotalOutAfter; - const Bytef *bufBefore; - ZPOS64_T uOutThis; - int flush=Z_SYNC_FLUSH; - - uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; - bufBefore = pfile_in_zip_read_info->stream.next_out; - - /* - if ((pfile_in_zip_read_info->rest_read_uncompressed == - pfile_in_zip_read_info->stream.avail_out) && - (pfile_in_zip_read_info->rest_read_compressed == 0)) - flush = Z_FINISH; - */ - err=inflate(&pfile_in_zip_read_info->stream,flush); - - if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) - err = Z_DATA_ERROR; - - uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; - uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; - - pfile_in_zip_read_info->crc32 = - crc32(pfile_in_zip_read_info->crc32,bufBefore, - (uInt)(uOutThis)); - - pfile_in_zip_read_info->rest_read_uncompressed -= - uOutThis; - - iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - - if (err==Z_STREAM_END) - return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) - break; - } - } - - if (err==Z_OK) - return iRead; - return err; -} - - -/* - Give the current position in uncompressed data -*/ -z_off_t ZEXPORT unztell (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - return (z_off_t)pfile_in_zip_read_info->stream.total_out; -} - -ZPOS64_T ZEXPORT unztell64 (unzFile file) -{ - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return (ZPOS64_T)-1; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return (ZPOS64_T)-1; - - return pfile_in_zip_read_info->total_out_64; -} - - -/* - return 1 if the end of file was reached, 0 elsewhere -*/ -int ZEXPORT unzeof (unzFile file) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - if (pfile_in_zip_read_info->rest_read_uncompressed == 0) - return 1; - else - return 0; -} - - - -/* -Read extra field from the current file (opened by unzOpenCurrentFile) -This is the local-header version of the extra field (sometimes, there is -more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field that can be read - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ -int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) -{ - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - uInt read_now; - ZPOS64_T size_to_read; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - - pfile_in_zip_read_info->pos_local_extrafield); - - if (buf==NULL) - return (int)size_to_read; - - if (len>size_to_read) - read_now = (uInt)size_to_read; - else - read_now = (uInt)len ; - - if (read_now==0) - return 0; - - if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - pfile_in_zip_read_info->offset_local_extrafield + - pfile_in_zip_read_info->pos_local_extrafield, - ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (ZREAD64(pfile_in_zip_read_info->z_filefunc, - pfile_in_zip_read_info->filestream, - buf,read_now)!=read_now) - return UNZ_ERRNO; - - return (int)read_now; -} - -/* - Close the file in zip opened with unzipOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ -int ZEXPORT unzCloseCurrentFile (unzFile file) -{ - int err=UNZ_OK; - - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - pfile_in_zip_read_info=s->pfile_in_zip_read; - - if (pfile_in_zip_read_info==NULL) - return UNZ_PARAMERROR; - - - if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && - (!pfile_in_zip_read_info->raw)) - { - if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) - err=UNZ_CRCERROR; - } - - - TRYFREE(pfile_in_zip_read_info->read_buffer); - pfile_in_zip_read_info->read_buffer = NULL; - if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) - inflateEnd(&pfile_in_zip_read_info->stream); -#ifdef HAVE_BZIP2 - else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) - BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); -#endif - - - pfile_in_zip_read_info->stream_initialised = 0; - TRYFREE(pfile_in_zip_read_info); - - s->pfile_in_zip_read=NULL; - - return err; -} - - -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ -int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) -{ - unz64_s* s; - uLong uReadThis ; - if (file==NULL) - return (int)UNZ_PARAMERROR; - s=(unz64_s*)file; - - uReadThis = uSizeBuf; - if (uReadThis>s->gi.size_comment) - uReadThis = s->gi.size_comment; - - if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) - return UNZ_ERRNO; - - if (uReadThis>0) - { - *szComment='\0'; - if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) - return UNZ_ERRNO; - } - - if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) - *(szComment+s->gi.size_comment)='\0'; - return (int)uReadThis; -} - -/* Additions by RX '2004 */ -ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) -{ - unz64_s* s; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - s=(unz64_s*)file; - if (!s->current_file_ok) - return 0; - if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) - if (s->num_file==s->gi.number_entry) - return 0; - return s->pos_in_central_dir; -} - -uLong ZEXPORT unzGetOffset (unzFile file) -{ - ZPOS64_T offset64; - - if (file==NULL) - return 0; //UNZ_PARAMERROR; - offset64 = unzGetOffset64(file); - return (uLong)offset64; -} - -int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) -{ - unz64_s* s; - int err; - - if (file==NULL) - return UNZ_PARAMERROR; - s=(unz64_s*)file; - - s->pos_in_central_dir = pos; - s->num_file = s->gi.number_entry; /* hack */ - err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, - &s->cur_file_info_internal, - NULL,0,NULL,0,NULL,0); - s->current_file_ok = (err == UNZ_OK); - return err; -} - -int ZEXPORT unzSetOffset (unzFile file, uLong pos) -{ - return unzSetOffset64(file,pos); -} - -} // end of namespace cocos2d diff --git a/cocos/2d/support/zip_support/unzip.h b/cocos/2d/support/zip_support/unzip.h deleted file mode 100644 index 54e73a55ea..0000000000 --- a/cocos/2d/support/zip_support/unzip.h +++ /dev/null @@ -1,455 +0,0 @@ -/* unzip.h -- IO for uncompress .zip files using zlib - Version 1.1, February 14h, 2010 - part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) - - Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - - Modifications of Unzip for Zip64 - Copyright (C) 2007-2008 Even Rouault - - Modifications for Zip64 support on both zip and unzip - Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - - For more info read MiniZip_info.txt - - --------------------------------------------------------------------------------- - - Condition of use and distribution are the same than zlib : - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - --------------------------------------------------------------------------------- - - Changes - - See header of unzip64.c - -*/ - -#ifndef _unz64_H -#define _unz64_H - -#include "CCPlatformDefine.h" - -#ifndef _ZLIB_H -#include "zlib.h" -#endif - -#ifndef _ZLIBIOAPI_H -#include "ioapi.h" -#endif - -#ifdef HAVE_BZIP2 -#include "bzlib.h" -#endif - -#define Z_BZIP2ED 12 - -#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) -/* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; -typedef unzFile__ *unzFile; -#else -typedef voidp unzFile; -#endif - - -#define UNZ_OK (0) -#define UNZ_END_OF_LIST_OF_FILE (-100) -#define UNZ_ERRNO (Z_ERRNO) -#define UNZ_EOF (0) -#define UNZ_PARAMERROR (-102) -#define UNZ_BADZIPFILE (-103) -#define UNZ_INTERNALERROR (-104) -#define UNZ_CRCERROR (-105) - -namespace cocos2d { - -/* tm_unz contain date/time info */ -typedef struct tm_unz_s -{ - uInt tm_sec; /* seconds after the minute - [0,59] */ - uInt tm_min; /* minutes after the hour - [0,59] */ - uInt tm_hour; /* hours since midnight - [0,23] */ - uInt tm_mday; /* day of the month - [1,31] */ - uInt tm_mon; /* months since January - [0,11] */ - uInt tm_year; /* years - [1980..2044] */ -} tm_unz; - -/* unz_global_info structure contain global data about the ZIPfile - These data comes from the end of central dir */ -typedef struct unz_global_info64_s -{ - ZPOS64_T number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info64; - -typedef struct unz_global_info_s -{ - uLong number_entry; /* total number of entries in - the central dir on this disk */ - uLong size_comment; /* size of the global comment of the zipfile */ -} unz_global_info; - -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_info64_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - ZPOS64_T compressed_size; /* compressed size 8 bytes */ - ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info64; - -typedef struct unz_file_info_s -{ - uLong version; /* version made by 2 bytes */ - uLong version_needed; /* version needed to extract 2 bytes */ - uLong flag; /* general purpose bit flag 2 bytes */ - uLong compression_method; /* compression method 2 bytes */ - uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ - uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ - uLong size_filename; /* filename length 2 bytes */ - uLong size_file_extra; /* extra field length 2 bytes */ - uLong size_file_comment; /* file comment length 2 bytes */ - - uLong disk_num_start; /* disk number start 2 bytes */ - uLong internal_fa; /* internal file attributes 2 bytes */ - uLong external_fa; /* external file attributes 4 bytes */ - - tm_unz tmu_date; -} unz_file_info; - -int CC_DLL unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); -/* - Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi - or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is default of your operating system - (like 1 on Unix, 2 on Windows) -*/ - - -unzFile CC_DLL unzOpen OF((const char *path)); -unzFile CC_DLL unzOpen64 OF((const void *path)); -/* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer - "zlib/zlib113.zip". - If the zipfile cannot be opened (file don't exist or in not valid), the - return value is NULL. - Else, the return value is a unzFile Handle, usable with other function - of this unzip package. - the "64" function take a const void* pointer, because the path is just the - value passed to the open64_file_func callback. - Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path - is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* - does not describe the reality -*/ - - -unzFile CC_DLL unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -unzFile CC_DLL unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); -/* - Open a Zip file, like unz64Open, but provide a set of file low level API - for read/write the zip file (see ioapi.h) -*/ - -int CC_DLL unzClose OF((unzFile file)); -/* - Close a ZipFile opened with unzipOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzipCloseCurrentFile before call unzipClose. - return UNZ_OK if there is no problem. */ - -int CC_DLL unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); - -int CC_DLL unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); -/* - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ - - -int CC_DLL unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); -/* - Get the global comment string of the ZipFile, in the szComment buffer. - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 -*/ - - -/***************************************************************************/ -/* Unzip package allow you browse the directory of the zipfile */ - -int CC_DLL unzGoToFirstFile OF((unzFile file)); - -/* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem -*/ - -int CC_DLL unzGoToFirstFile64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize)); -/* - Set the current file of the zipfile to the first file - with retrieving an information about the file. - return UNZ_OK if there is no problem -*/ - -int CC_DLL unzGoToNextFile OF((unzFile file)); -/* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -int CC_DLL unzGoToNextFile64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize)); -/* - Set the current file of the zipfile to the next file - with retrieving an information about the file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. -*/ - -int CC_DLL unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); -/* - Try locate the file szFileName in the zipfile. - For the iCaseSensitivity signification, see unzStringFileNameCompare - - return value : - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found -*/ - - -/* ****************************************** */ -/* Ryan supplied functions */ -/* unz_file_info contain information about a file in the zipfile */ -typedef struct unz_file_pos_s -{ - uLong pos_in_zip_directory; /* offset in zip file directory */ - uLong num_of_file; /* # of file */ -} unz_file_pos; - -int CC_DLL unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - -int CC_DLL unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -typedef struct unz64_file_pos_s -{ - ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ - ZPOS64_T num_of_file; /* # of file */ -} unz64_file_pos; - -int CC_DLL unzGetFilePos64( - unzFile file, - unz64_file_pos* file_pos); - -int CC_DLL unzGoToFilePos64( - unzFile file, - const unz64_file_pos* file_pos); - -/* ****************************************** */ - -int CC_DLL unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); - -int CC_DLL unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, - void *extraField, - uLong extraFieldBufferSize, - char *szComment, - uLong commentBufferSize)); -/* - Get Info about the current file - if pfile_info!=NULL, the *pfile_info structure will contain some info about - the current file - if szFileName!=NULL, the filename string will be copied in szFileName - (fileNameBufferSize is the size of the buffer) - if extraField!=NULL, the extra field information will be copied in extraField - (extraFieldBufferSize is the size of the buffer). - This is the Central-header version of the extra field - if szComment!=NULL, the comment string of the file will be copied in szComment - (commentBufferSize is the size of the buffer) -*/ - - -/** Addition for GDAL : START */ - -ZPOS64_T CC_DLL unzGetCurrentFileZStreamPos64 OF((unzFile file)); - -/** Addition for GDAL : END */ - - -/***************************************************************************/ -/* for reading the content of the current zipfile, you can open it, read data - from it, and close it (you can close it before reading all the file) - */ - -int CC_DLL unzOpenCurrentFile OF((unzFile file)); -/* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. -*/ - -int CC_DLL unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); -/* - Open for reading data the current file in the zipfile. - password is a crypting password - If there is no error, the return value is UNZ_OK. -*/ - -int CC_DLL unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - -int CC_DLL unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, - const char* password)); -/* - Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) - if raw==1 - *method will receive method of compression, *level will receive level of - compression - note : you can set level parameter as NULL (if you did not want known level, - but you CANNOT set method parameter as NULL -*/ - - -int CC_DLL unzCloseCurrentFile OF((unzFile file)); -/* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good -*/ - -int CC_DLL unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read bytes from the current file (opened by unzOpenCurrentFile) - buf contain buffer where data must be copied - len the size of buf. - - return the number of byte copied if some bytes are copied - return 0 if the end of file was reached - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) -*/ - -z_off_t CC_DLL unztell OF((unzFile file)); - -ZPOS64_T CC_DLL unztell64 OF((unzFile file)); -/* - Give the current position in uncompressed data -*/ - -int CC_DLL unzeof OF((unzFile file)); -/* - return 1 if the end of file was reached, 0 elsewhere -*/ - -int CC_DLL unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); -/* - Read extra field from the current file (opened by unzOpenCurrentFile) - This is the local-header version of the extra field (sometimes, there is - more info in the local-header version than in the central-header) - - if buf==NULL, it return the size of the local extra field - - if buf!=NULL, len is the size of the buffer, the extra header is copied in - buf. - the return value is the number of bytes copied in buf, or (if <0) - the error code -*/ - -/***************************************************************************/ - -/* Get the current file offset */ -ZPOS64_T CC_DLL unzGetOffset64 (unzFile file); -uLong CC_DLL unzGetOffset (unzFile file); - -/* Set the current file offset */ -int CC_DLL unzSetOffset64 (unzFile file, ZPOS64_T pos); -int CC_DLL unzSetOffset (unzFile file, uLong pos); - -} // end of namespace cocos2d - -#endif /* _unz64_H */ diff --git a/cocos/2d/support/data_support/uthash.h b/cocos/2d/uthash.h similarity index 100% rename from cocos/2d/support/data_support/uthash.h rename to cocos/2d/uthash.h diff --git a/cocos/2d/support/data_support/utlist.h b/cocos/2d/utlist.h similarity index 100% rename from cocos/2d/support/data_support/utlist.h rename to cocos/2d/utlist.h diff --git a/cocos/audio/android/Android.mk b/cocos/audio/android/Android.mk index 2704964c93..ed44e77cf7 100644 --- a/cocos/audio/android/Android.mk +++ b/cocos/audio/android/Android.mk @@ -13,10 +13,11 @@ LOCAL_SRC_FILES := cddSimpleAudioEngine.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../include LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../../cocos2dx \ - $(LOCAL_PATH)/../../cocos2dx/include \ - $(LOCAL_PATH)/../../cocos2dx/kazmath/include \ - $(LOCAL_PATH)/../../cocos2dx/platform/android + $(LOCAL_PATH)/../../math/kazmath/include \ + $(LOCAL_PATH)/../../2d \ + $(LOCAL_PATH)/../../2d/platform/android \ + $(LOCAL_PATH)/../../base \ + $(LOCAL_PATH)/../../physics LOCAL_CFLAGS += -Wno-psabi LOCAL_EXPORT_CFLAGS += -Wno-psabi diff --git a/cocos/base/cocoa/CCAffineTransform.cpp b/cocos/base/CCAffineTransform.cpp similarity index 100% rename from cocos/base/cocoa/CCAffineTransform.cpp rename to cocos/base/CCAffineTransform.cpp diff --git a/cocos/base/cocoa/CCAffineTransform.h b/cocos/base/CCAffineTransform.h similarity index 98% rename from cocos/base/cocoa/CCAffineTransform.h rename to cocos/base/CCAffineTransform.h index 667b5d9b46..66c76fc5f0 100644 --- a/cocos/base/cocoa/CCAffineTransform.h +++ b/cocos/base/CCAffineTransform.h @@ -26,7 +26,7 @@ THE SOFTWARE. #define __COCOA_CGAFFINETRANSFORM_H__ #include "CCGeometry.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCArray.cpp b/cocos/base/CCArray.cpp similarity index 100% rename from cocos/base/cocoa/CCArray.cpp rename to cocos/base/CCArray.cpp diff --git a/cocos/platform/cocoa/CCArray.h b/cocos/base/CCArray.h similarity index 99% rename from cocos/platform/cocoa/CCArray.h rename to cocos/base/CCArray.h index 4f5beea501..7f67569faa 100644 --- a/cocos/platform/cocoa/CCArray.h +++ b/cocos/base/CCArray.h @@ -30,10 +30,10 @@ THE SOFTWARE. #if CC_USE_ARRAY_VECTOR #include #include -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" #else -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" #endif diff --git a/cocos/base/cocoa/CCAutoreleasePool.cpp b/cocos/base/CCAutoreleasePool.cpp similarity index 100% rename from cocos/base/cocoa/CCAutoreleasePool.cpp rename to cocos/base/CCAutoreleasePool.cpp diff --git a/cocos/base/cocoa/CCAutoreleasePool.h b/cocos/base/CCAutoreleasePool.h similarity index 100% rename from cocos/base/cocoa/CCAutoreleasePool.h rename to cocos/base/CCAutoreleasePool.h diff --git a/cocos/base/cocoa/CCBool.h b/cocos/base/CCBool.h similarity index 100% rename from cocos/base/cocoa/CCBool.h rename to cocos/base/CCBool.h diff --git a/cocos/base/cocoa/CCData.cpp b/cocos/base/CCData.cpp similarity index 100% rename from cocos/base/cocoa/CCData.cpp rename to cocos/base/CCData.cpp diff --git a/cocos/platform/cocoa/CCData.h b/cocos/base/CCData.h similarity index 98% rename from cocos/platform/cocoa/CCData.h rename to cocos/base/CCData.h index 889a2d557b..27cb43da61 100644 --- a/cocos/platform/cocoa/CCData.h +++ b/cocos/base/CCData.h @@ -25,7 +25,7 @@ #ifndef __CCDATA_H__ #define __CCDATA_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCDataVisitor.cpp b/cocos/base/CCDataVisitor.cpp similarity index 100% rename from cocos/base/cocoa/CCDataVisitor.cpp rename to cocos/base/CCDataVisitor.cpp diff --git a/cocos/platform/cocoa/CCDataVisitor.h b/cocos/base/CCDataVisitor.h similarity index 98% rename from cocos/platform/cocoa/CCDataVisitor.h rename to cocos/base/CCDataVisitor.h index 3395b43dea..93d2463f29 100644 --- a/cocos/platform/cocoa/CCDataVisitor.h +++ b/cocos/base/CCDataVisitor.h @@ -25,7 +25,7 @@ #ifndef __CCDATAVISITOR_H__ #define __CCDATAVISITOR_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCDictionary.cpp b/cocos/base/CCDictionary.cpp similarity index 100% rename from cocos/base/cocoa/CCDictionary.cpp rename to cocos/base/CCDictionary.cpp diff --git a/cocos/platform/cocoa/CCDictionary.h b/cocos/base/CCDictionary.h similarity index 99% rename from cocos/platform/cocoa/CCDictionary.h rename to cocos/base/CCDictionary.h index b0f1c98a9c..63082109b3 100644 --- a/cocos/platform/cocoa/CCDictionary.h +++ b/cocos/base/CCDictionary.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCDICTIONARY_H__ #define __CCDICTIONARY_H__ -#include "support/data_support/uthash.h" +#include "uthash.h" #include "CCObject.h" #include "CCArray.h" #include "CCString.h" diff --git a/cocos/base/cocoa/CCDouble.h b/cocos/base/CCDouble.h similarity index 100% rename from cocos/base/cocoa/CCDouble.h rename to cocos/base/CCDouble.h diff --git a/cocos/base/cocoa/CCFloat.h b/cocos/base/CCFloat.h similarity index 100% rename from cocos/base/cocoa/CCFloat.h rename to cocos/base/CCFloat.h diff --git a/cocos/base/cocoa/CCGeometry.cpp b/cocos/base/CCGeometry.cpp similarity index 100% rename from cocos/base/cocoa/CCGeometry.cpp rename to cocos/base/CCGeometry.cpp diff --git a/cocos/base/cocoa/CCGeometry.h b/cocos/base/CCGeometry.h similarity index 99% rename from cocos/base/cocoa/CCGeometry.h rename to cocos/base/CCGeometry.h index 47e2fdf9ac..ac9f08ec03 100644 --- a/cocos/base/cocoa/CCGeometry.h +++ b/cocos/base/CCGeometry.h @@ -28,7 +28,7 @@ THE SOFTWARE. #include #include -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "CCObject.h" #include "ccMacros.h" diff --git a/cocos/base/cocoa/CCInteger.h b/cocos/base/CCInteger.h similarity index 100% rename from cocos/base/cocoa/CCInteger.h rename to cocos/base/CCInteger.h diff --git a/cocos/base/cocoa/CCNS.cpp b/cocos/base/CCNS.cpp similarity index 100% rename from cocos/base/cocoa/CCNS.cpp rename to cocos/base/CCNS.cpp diff --git a/cocos/base/cocoa/CCNS.h b/cocos/base/CCNS.h similarity index 100% rename from cocos/base/cocoa/CCNS.h rename to cocos/base/CCNS.h diff --git a/cocos/base/cocoa/CCObject.cpp b/cocos/base/CCObject.cpp similarity index 98% rename from cocos/base/cocoa/CCObject.cpp rename to cocos/base/CCObject.cpp index 13fa0e3236..75d01c5937 100644 --- a/cocos/base/cocoa/CCObject.cpp +++ b/cocos/base/CCObject.cpp @@ -26,7 +26,7 @@ THE SOFTWARE. #include "CCObject.h" #include "CCAutoreleasePool.h" #include "ccMacros.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" NS_CC_BEGIN diff --git a/cocos/base/cocoa/CCObject.h b/cocos/base/CCObject.h similarity index 99% rename from cocos/base/cocoa/CCObject.h rename to cocos/base/CCObject.h index 8de1ff9d8b..3c3e6c5321 100644 --- a/cocos/base/cocoa/CCObject.h +++ b/cocos/base/CCObject.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __CCOBJECT_H__ #define __CCOBJECT_H__ -#include "cocoa/CCDataVisitor.h" +#include "CCDataVisitor.h" #include "ccMacros.h" #ifdef EMSCRIPTEN diff --git a/cocos/base/cocoa/CCSet.cpp b/cocos/base/CCSet.cpp similarity index 100% rename from cocos/base/cocoa/CCSet.cpp rename to cocos/base/CCSet.cpp diff --git a/cocos/base/cocoa/CCSet.h b/cocos/base/CCSet.h similarity index 100% rename from cocos/base/cocoa/CCSet.h rename to cocos/base/CCSet.h diff --git a/cocos/base/cocoa/CCString.cpp b/cocos/base/CCString.cpp similarity index 100% rename from cocos/base/cocoa/CCString.cpp rename to cocos/base/CCString.cpp diff --git a/cocos/base/cocoa/CCString.h b/cocos/base/CCString.h similarity index 100% rename from cocos/base/cocoa/CCString.h rename to cocos/base/CCString.h diff --git a/cocos/base/atitc/atitc.cpp b/cocos/base/atitc.cpp similarity index 100% rename from cocos/base/atitc/atitc.cpp rename to cocos/base/atitc.cpp diff --git a/cocos/base/atitc/atitc.h b/cocos/base/atitc.h similarity index 100% rename from cocos/base/atitc/atitc.h rename to cocos/base/atitc.h diff --git a/cocos/base/cocoa/CCArray.h b/cocos/base/cocoa/CCArray.h deleted file mode 100644 index 4f5beea501..0000000000 --- a/cocos/base/cocoa/CCArray.h +++ /dev/null @@ -1,557 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#ifndef __CCARRAY_H__ -#define __CCARRAY_H__ - -#define CC_USE_ARRAY_VECTOR 0 - -#if CC_USE_ARRAY_VECTOR -#include -#include -#include "cocoa/CCObject.h" -#include "ccMacros.h" -#else -#include "support/data_support/ccCArray.h" -#endif - - -#if CC_USE_ARRAY_VECTOR -/** - * A reference counting-managed pointer for classes derived from RCBase which can - * be used as C pointer - * Original code: http://www.codeproject.com/Articles/64111/Building-a-Quick-and-Handy-Reference-Counting-Clas - * License: http://www.codeproject.com/info/cpol10.aspx - */ -template < class T > -class RCPtr -{ -public: - //Construct using a C pointer - //e.g. RCPtr< T > x = new T(); - RCPtr(T* ptr = nullptr) - : _ptr(ptr) - { - if(ptr != nullptr) {ptr->retain();} - } - - //Copy constructor - RCPtr(const RCPtr &ptr) - : _ptr(ptr._ptr) - { -// printf("Array: copy constructor: %p\n", this); - if(_ptr != NULL) {_ptr->retain();} - } - - //Move constructor - RCPtr(RCPtr &&ptr) - : _ptr(ptr._ptr) - { -// printf("Array: Move Constructor: %p\n", this); - ptr._ptr = nullptr; - } - - ~RCPtr() - { -// printf("Array: Destructor: %p\n", this); - if(_ptr != nullptr) {_ptr->release();} - } - - //Assign a pointer - //e.g. x = new T(); - RCPtr &operator=(T* ptr) - { -// printf("Array: operator= T*: %p\n", this); - - //The following grab and release operations have to be performed - //in that order to handle the case where ptr == _ptr - //(See comment below by David Garlisch) - if(ptr != nullptr) {ptr->retain();} - if(_ptr != nullptr) {_ptr->release();} - _ptr = ptr; - return (*this); - } - - //Assign another RCPtr - RCPtr &operator=(const RCPtr &ptr) - { -// printf("Array: operator= const&: %p\n", this); - return (*this) = ptr._ptr; - } - - //Retrieve actual pointer - T* get() const - { - return _ptr; - } - - //Some overloaded operators to facilitate dealing with an RCPtr - //as a conventional C pointer. - //Without these operators, one can still use the less transparent - //get() method to access the pointer. - T* operator->() const {return _ptr;} //x->member - T &operator*() const {return *_ptr;} //*x, (*x).member - explicit operator T*() const {return _ptr;} //T* y = x; - explicit operator bool() const {return _ptr != nullptr;} //if(x) {/*x is not NULL*/} - bool operator==(const RCPtr &ptr) {return _ptr == ptr._ptr;} - bool operator==(const T *ptr) {return _ptr == ptr;} - -private: - T *_ptr; //Actual pointer -}; -#endif // CC_USE_ARRAY_VECTOR - - -/** - * @addtogroup data_structures - * @{ - */ - -/** @def CCARRAY_FOREACH -A convenience macro to iterate over a Array using. It is faster than the "fast enumeration" interface. -@since v0.99.4 -*/ - -/* -In cocos2d-iphone 1.0.0, This macro have been update to like this: - -#define CCARRAY_FOREACH(__array__, __object__) \ -if (__array__ && __array__->data->num > 0) \ -for(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ -__arr__ <= end && ((__object__ = *__arr__) != nil || true); \ -__arr__++) - -I found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin -*/ - -#if CC_USE_ARRAY_VECTOR -#define CCARRAY_FOREACH(__array__, __object__) \ - if (__array__) \ - for( auto __it__ = (__array__)->data.begin(); \ - __it__ != (__array__)->data.end() && ((__object__) = __it__->get()) != nullptr; \ - ++__it__) - - -#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ - if (__array__) \ - for( auto __it__ = (__array__)->data.rbegin(); \ - __it__ != (__array__)->data.rend() && ((__object__) = __it__->get()) != nullptr; \ - ++__it__ ) - - -#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) - -#else // ! CC_USE_ARRAY_VECTOR -------------------------- - -#define CCARRAY_FOREACH(__array__, __object__) \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1; \ - __arr__ <= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ - __arr__++) - -#define CCARRAY_FOREACH_REVERSE(__array__, __object__) \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr; \ - __arr__ >= __end__ && (((__object__) = *__arr__) != NULL/* || true*/); \ - __arr__--) - -#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) -#define CCARRAY_VERIFY_TYPE(__array__, __type__) \ - do { \ - if ((__array__) && (__array__)->data->num > 0) \ - for(Object** __arr__ = (__array__)->data->arr, \ - **__end__ = (__array__)->data->arr + (__array__)->data->num-1; __arr__ <= __end__; __arr__++) \ - CCASSERT(dynamic_cast<__type__>(*__arr__), "element type is wrong!"); \ - } while(false) -#else -#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0) -#endif - -#endif // ! CC_USE_ARRAY_VECTOR - - -// Common defines ----------------------------------------------------------------------------------------------- - -#define arrayMakeObjectsPerformSelector(pArray, func, elementType) \ -do { \ - if(pArray && pArray->count() > 0) \ - { \ - Object* child; \ - CCARRAY_FOREACH(pArray, child) \ - { \ - elementType pNode = static_cast(child); \ - if(pNode) \ - { \ - pNode->func(); \ - } \ - } \ - } \ -} \ -while(false) - -#define arrayMakeObjectsPerformSelectorWithObject(pArray, func, object, elementType) \ -do { \ - if(pArray && pArray->count() > 0) \ - { \ - Object* child; \ - CCARRAY_FOREACH(pArray, child) \ - { \ - elementType pNode = static_cast(child); \ - if(pNode) \ - { \ - pNode->func(object); \ - } \ - } \ - } \ -} \ -while(false) - - -NS_CC_BEGIN - -class CC_DLL Array : public Object, public Clonable -{ -public: - - /** Creates an empty array. Default capacity is 10 - * @js NA - * @lua NA - */ - static Array* create(); - /** Create an array with objects - * @js NA - */ - static Array* create(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; - /** Create an array with one object - * @js NA - */ - static Array* createWithObject(Object* object); - /** Create an array with a default capacity - * @js NA - */ - static Array* createWithCapacity(int capacity); - /** Create an array with from an existing array - * @js NA - */ - static Array* createWithArray(Array* otherArray); - /** - @brief Generate a Array pointer by file - @param pFileName The file name of *.plist file - @return The Array pointer generated from the file - * @js NA - */ - static Array* createWithContentsOfFile(const char* pFileName); - - /* - @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the - invoker should call release(). - * @js NA - * @lua NA - */ - static Array* createWithContentsOfFileThreadSafe(const char* pFileName); - /** - * @js NA - * @lua NA - */ - ~Array(); - - /** Initializes an array - * @js NA - * @lua NA - */ - bool init(); - /** Initializes an array with one object - * @js NA - * @lua NA - */ - bool initWithObject(Object* object); - /** Initializes an array with some objects - * @js NA - * @lua NA - */ - bool initWithObjects(Object* object, ...) CC_REQUIRES_NULL_TERMINATION; - /** Initializes an array with capacity - * @js NA - * @lua NA - */ - bool initWithCapacity(int capacity); - /** Initializes an array with an existing array - * @js NA - * @lua NA - */ - bool initWithArray(Array* otherArray); - - // Querying an Array - - /** Returns element count of the array - * @js NA - */ - int count() const - { -#if CC_USE_ARRAY_VECTOR - return data.size(); -#else - return data->num; -#endif - } - /** Returns capacity of the array - * @js NA - */ - int capacity() const - { -#if CC_USE_ARRAY_VECTOR - return data.capacity(); -#else - return data->max; -#endif - } - /** Returns index of a certain object, return UINT_MAX if doesn't contain the object - * @js NA - * @lua NA - */ - int getIndexOfObject(Object* object) const; - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE int indexOfObject(Object* object) const { return getIndexOfObject(object); } - - /** Returns an element with a certain index - * @js NA - * @lua NA - */ - Object* getObjectAtIndex(int index) - { - CCASSERT(index>=0 && index < count(), "index out of range in getObjectAtIndex()"); -#if CC_USE_ARRAY_VECTOR - return data[index].get(); -#else - return data->arr[index]; -#endif - } - CC_DEPRECATED_ATTRIBUTE Object* objectAtIndex(int index) { return getObjectAtIndex(index); } - /** Returns the last element of the array - * @js NA - */ - Object* getLastObject() - { -#if CC_USE_ARRAY_VECTOR - return data.back().get(); -#else - if(data->num > 0) - return data->arr[data->num-1]; - - return nullptr; -#endif - } - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE Object* lastObject() { return getLastObject(); } - /** Returns a random element - * @js NA - * @lua NA - */ - Object* getRandomObject(); - /** - * @js NA - */ - CC_DEPRECATED_ATTRIBUTE Object* randomObject() { return getRandomObject(); } - /** Returns a Boolean value that indicates whether object is present in array. - * @js NA - */ - bool containsObject(Object* object) const; - /** @since 1.1 - * @js NA - */ - bool isEqualToArray(Array* otherArray); - // Adding Objects - - /** Add a certain object - * @js NA - */ - void addObject(Object* object); - /** - * @js NA - */ - /** Add all elements of an existing array - * @js NA - */ - void addObjectsFromArray(Array* otherArray); - /** Insert a certain object at a certain index - * @js NA - */ - void insertObject(Object* object, int index); - /** sets a certain object at a certain index - * @js NA - * @lua NA - */ - void setObject(Object* object, int index); - /** sets a certain object at a certain index without retaining. Use it with caution - * @js NA - * @lua NA - */ - void fastSetObject(Object* object, int index) - { -#if CC_USE_ARRAY_VECTOR - setObject(object, index); -#else - // no retain - data->arr[index] = object; -#endif - } - /** - * @js NA - * @lua NA - */ - void swap( int indexOne, int indexTwo ) - { - CCASSERT(indexOne >=0 && indexOne < count() && indexTwo >= 0 && indexTwo < count(), "Invalid indices"); -#if CC_USE_ARRAY_VECTOR - std::swap(data[indexOne], data[indexTwo]); -#else - std::swap(data->arr[indexOne], data->arr[indexTwo]); -#endif - } - - // Removing Objects - - /** Remove last object - * @js NA - */ - void removeLastObject(bool releaseObj = true); - /** Remove a certain object - * @js NA - */ - void removeObject(Object* object, bool releaseObj = true); - /** Remove an element with a certain index - * @js NA - */ - void removeObjectAtIndex(int index, bool releaseObj = true); - /** Remove all elements - * @js NA - */ - void removeObjectsInArray(Array* otherArray); - /** Remove all objects - * @js NA - */ - void removeAllObjects(); - /** Fast way to remove a certain object - * @js NA - */ - void fastRemoveObject(Object* object); - /** Fast way to remove an element with a certain index - * @js NA - */ - void fastRemoveObjectAtIndex(int index); - - // Rearranging Content - - /** Swap two elements - * @js NA - */ - void exchangeObject(Object* object1, Object* object2); - /** Swap two elements with certain indexes - * @js NA - */ - void exchangeObjectAtIndex(int index1, int index2); - - /** Replace object at index with another object. - * @js NA - */ - void replaceObjectAtIndex(int index, Object* object, bool releaseObject = true); - - /** Revers the array - * @js NA - */ - void reverseObjects(); - /* Shrinks the array so the memory footprint corresponds with the number of items - * @js NA - */ - void reduceMemoryFootprint(); - - /* override functions - * @js NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual Array* clone() const; - - // ------------------------------------------ - // Iterators - // ------------------------------------------ -#if CC_USE_ARRAY_VECTOR - typedef std::vector>::iterator iterator; - typedef std::vector>::const_iterator const_iterator; - /** - * @js NA - * @lua NA - */ - iterator begin() { return data.begin(); } - /** - * @js NA - * @lua NA - */ - iterator end() { return data.end(); } - const_iterator cbegin() { return data.cbegin(); } - /** - * @js NA - * @lua NA - */ - const_iterator cend() { return data.cend(); } - - std::vector> data; - -#else - /** - * @js NA - * @lua NA - */ - Object** begin() { return &data->arr[0]; } - /** - * @js NA - * @lua NA - */ - Object** end() { return &data->arr[data->num]; } - - ccArray* data; - -#endif - -//protected: - /** - * @js NA - * @lua NA - */ - Array(); -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCARRAY_H__ diff --git a/cocos/base/cocoa/CCData.h b/cocos/base/cocoa/CCData.h deleted file mode 100644 index 889a2d557b..0000000000 --- a/cocos/base/cocoa/CCData.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCDATA_H__ -#define __CCDATA_H__ - -#include "platform/CCPlatformMacros.h" -#include "CCObject.h" - -NS_CC_BEGIN - -class CC_DLL Data : public Object -{ -public: - /** - * @js NA - * @lua NA - */ - Data(unsigned char *pBytes, const unsigned long nSize); - /** - * @js NA - * @lua NA - */ - Data(Data *pData); - /** - * @js NA - * @lua NA - */ - ~Data(); - /** - * @js NA - * @lua NA - */ - static Data* create(unsigned char *pBytes, const unsigned long nSize) - { - Data* pRet = new Data(pBytes, nSize); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - /** - * @js NA - * @lua NA - */ - unsigned char* getBytes() const; - /** - * @js NA - * @lua NA - */ - unsigned long getSize() const; - - /** override functions - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - -private: - unsigned char* _bytes; - unsigned long _size; -}; - -NS_CC_END - -#endif // __CCDATA_H__ diff --git a/cocos/base/cocoa/CCDataVisitor.h b/cocos/base/cocoa/CCDataVisitor.h deleted file mode 100644 index 3395b43dea..0000000000 --- a/cocos/base/cocoa/CCDataVisitor.h +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCDATAVISITOR_H__ -#define __CCDATAVISITOR_H__ - -#include "platform/CCPlatformMacros.h" -#include - -NS_CC_BEGIN - -class Object; -class Bool; -class Integer; -class Float; -class Double; -class String; -class Array; -class Dictionary; -class Set; -class Data; - -/** - * @addtogroup data_structures - * @{ - */ - -/** - * Visitor that helps to perform action that depends on polymorphic object type - * - * Use cases: - * - data serialization, - * - pretty printing of Object * - * - safe value reading from Array, Dictionary, Set - * - * Usage: - * 1. subclass DataVisitor - * 2. overload visit() methods for object that you need to handle - * 3. handle other objects in visitObject() - * 4. pass your visitor to Object::acceptVisitor() - */ -class CC_DLL DataVisitor -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~DataVisitor() {} - - /** default method, called from non-overloaded methods and for unrecognized objects */ - virtual void visitObject(const Object *p) = 0; - - virtual void visit(const Bool *p); - virtual void visit(const Integer *p); - virtual void visit(const Float *p); - virtual void visit(const Double *p); - virtual void visit(const String *p); - virtual void visit(const Array *p); - virtual void visit(const Dictionary *p); - virtual void visit(const Set *p); - virtual void visit(const Data *p); -}; - - -class CC_DLL PrettyPrinter : public DataVisitor -{ -public: - PrettyPrinter(int indentLevel = 0); - - virtual void clear(); - virtual std::string getResult(); - - virtual void visitObject(const Object *p); - virtual void visit(const Bool * p); - virtual void visit(const Integer *p); - virtual void visit(const Float *p); - virtual void visit(const Double *p); - virtual void visit(const String *p); - virtual void visit(const Array *p); - virtual void visit(const Dictionary *p); - virtual void visit(const Set *p); - virtual void visit(const Data *p); -private: - void setIndentLevel(int indentLevel); - int _indentLevel; - std::string _indentStr; - std::string _result; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCDATAVISITOR_H__ diff --git a/cocos/base/cocoa/CCDictionary.h b/cocos/base/cocoa/CCDictionary.h deleted file mode 100644 index b0f1c98a9c..0000000000 --- a/cocos/base/cocoa/CCDictionary.h +++ /dev/null @@ -1,458 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 - 2013 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCDICTIONARY_H__ -#define __CCDICTIONARY_H__ - -#include "support/data_support/uthash.h" -#include "CCObject.h" -#include "CCArray.h" -#include "CCString.h" - -NS_CC_BEGIN - -class Dictionary; - -/** - * @addtogroup data_structures - * @{ - */ - - -/** - * DictElement is used for traversing Dictionary. - * - * A DictElement is one element of Dictionary, it contains two properties, key and object. - * Its key has two different type (integer and string). - * - * @note The key type is unique, all the elements in Dictionary has the same key type(integer or string). - * @code - * DictElement* pElement; - * CCDICT_FOREACH(dict, pElement) - * { - * const char*key = pElement->getStrKey(); - * // You certainly know the type of value, so we assume that it's a Sprite. - * Sprite* pSprite = static_cast(pElement->getObject()); - * // ...... - * } - * @endcode - * - */ -class CC_DLL DictElement -{ -private: - /** - * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. - * - * @param pszKey The string key of this element. - * @param pObject The object of this element. - */ - DictElement(const char* pszKey, Object* pObject); - - /** - * Constructor of DictElement. It's only for internal usage. Dictionary is its friend class. - * - * @param iKey The integer key of this element. - * @param pObject The object of this element. - */ - DictElement(intptr_t iKey, Object* pObject); - -public: - /** - * The destructor of DictElement. - * @js NA - * @lua NA - */ - ~DictElement(); - - // Inline functions need to be implemented in header file on Android. - - /** - * Get the string key of this element. - * @note This method assumes you know the key type in the element. - * If the element's key type is integer, invoking this method will cause an assert. - * - * @return The string key of this element. - */ - inline const char* getStrKey() const - { - CCASSERT(_strKey[0] != '\0', "Should not call this function for integer dictionary"); - return _strKey; - } - - /** - * Get the integer key of this element. - * @note This method assumes you know the key type in the element. - * If the element's key type is string, invoking this method will cause an assert. - * - * @return The integer key of this element. - */ - inline intptr_t getIntKey() const - { - CCASSERT(_strKey[0] == '\0', "Should not call this function for string dictionary"); - return _intKey; - } - - /** - * Get the object of this element. - * - * @return The object of this element. - */ - inline Object* getObject() const { return _object; } - -private: - // The max length of string key. - #define MAX_KEY_LEN 256 - // char array is needed for HASH_ADD_STR in UT_HASH. - // So it's a pain that all elements will allocate 256 bytes for this array. - char _strKey[MAX_KEY_LEN]; // hash key of string type - intptr_t _intKey; // hash key of integer type - Object* _object; // hash value -public: - UT_hash_handle hh; // makes this class hashable - friend class Dictionary; // declare Dictionary as friend class -}; - -/** The macro for traversing dictionary - * - * @note It's faster than getting all keys and traversing keys to get objects by objectForKey. - * It's also safe to remove elements while traversing. - */ -#define CCDICT_FOREACH(__dict__, __el__) \ - DictElement* pTmp##__dict__##__el__ = nullptr; \ - if (__dict__) \ - HASH_ITER(hh, (__dict__)->_elements, __el__, pTmp##__dict__##__el__) - - - -/** - * Dictionary is a class like NSDictionary in Obj-C . - * - * @note Only the pointer of Object or its subclass can be inserted to Dictionary. - * @code - * // Create a dictionary, return an autorelease object. - * Dictionary* pDict = Dictionary::create(); - * - * // Insert objects to dictionary - * String* pValue1 = String::create("100"); - * String* pValue2 = String::create("120"); - * Integer* pValue3 = Integer::create(200); - * pDict->setObject(pValue1, "key1"); - * pDict->setObject(pValue2, "key2"); - * pDict->setObject(pValue3, "key3"); - * - * // Get the object for key - * String* pStr1 = (String*)pDict->objectForKey("key1"); - * log("{ key1: %s }", pStr1->getCString()); - * Integer* pInteger = (Integer*)pDict->objectForKey("key3"); - * log("{ key3: %d }", pInteger->getValue()); - * @endcode - * - */ - -class CC_DLL Dictionary : public Object, public Clonable -{ -public: - /** - * The constructor of Dictionary. - * @js NA - * @lua NA - */ - Dictionary(); - - /** - * The destructor of Dictionary - * @js NA - * @lua NA - */ - ~Dictionary(); - - /** Initializes the dictionary. It returns true if the initializations was successful. - * @js NA - * @lua NA - */ - bool init(); - /** - * Get the count of elements in Dictionary. - * - * @return The count of elements. - * @js NA - */ - unsigned int count(); - - /** - * Return all keys of elements. - * - * @return The array contains all keys of elements. It's an autorelease object yet. - * @js NA - */ - Array* allKeys(); - - /** - * Get all keys according to the specified object. - * @warning We use '==' to compare two objects - * @return The array contains all keys for the specified object. It's an autorelease object yet. - * @js NA - */ - Array* allKeysForObject(Object* object); - - /** - * Get the object according to the specified string key. - * - * @note The dictionary needs to use string as key. If integer is passed, an assert will appear. - * @param key The string key for searching. - * @return The object matches the key. You need to force convert it to the type you know. - * @code - * // Assume that the elements are String* pointers. Convert it by following code. - * String* pStr = (String*)pDict->objectForKey("key1"); - * // Do something about pStr. - * // If you don't know the object type, properly you need to use dynamic_cast to check it. - * String* pStr2 = dynamic_cast(pDict->objectForKey("key1")); - * if (pStr2 != NULL) { - * // Do something about pStr2 - * } - * @endcode - * @see objectForKey(intptr_t) - * @js NA - */ - Object* objectForKey(const std::string& key); - - /** - * Get the object according to the specified integer key. - * - * @note The dictionary needs to use integer as key. If string is passed, an assert will appear. - * @param key The integer key for searching. - * @return The object matches the key. - * @see objectForKey(const std::string&) - * @js NA - */ - Object* objectForKey(intptr_t key); - - /** Get the value according to the specified string key. - * - * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. - * @param key The string key for searching - * @return An instance of String. - * It will return an empty string if the objects aren't String pointer or the key wasn't found. - * @see valueForKey(intptr_t) - * @js NA - */ - const String* valueForKey(const std::string& key); - - /** Get the value according to the specified integer key. - * - * @note Be careful to use this function since it assumes the objects in the dictionary are String pointer. - * @param key The string key for searching. - * @return An instance of String. - * It will return an empty string if the objects aren't String pointer or the key wasn't found. - * @see valueForKey(intptr_t) - * @js NA - */ - const String* valueForKey(intptr_t key); - - /** Insert an object to dictionary, and match it with the specified string key. - * - * @note Whe the first time this method is invoked, the key type will be set to string. - * After that you can't setObject with an integer key. - * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. - * Then the new object will be inserted after that. - * - * @param pObject The Object to be inserted. - * @param key The string key for searching. - * @see setObject(Object*, intptr_t) - * @js NA - */ - void setObject(Object* pObject, const std::string& key); - - /** Insert an object to dictionary, and match it with the specified string key. - * - * @note Then the first time this method is invoked, the key type will be set to string. - * After that you can't setObject with an integer key. - * If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary. - * Then the new object will be inserted after that. - * @param pObject The Object to be inserted. - * @param key The string key for searching. - * @see setObject(Object*, const std::string&) - * @js NA - */ - void setObject(Object* pObject, intptr_t key); - - /** - * Remove an object by the specified string key. - * - * @param key The string key for searching. - * @see removeObjectForKey(intptr_t), removeObjectsForKeys(Array*), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectForKey(const std::string& key); - - /** - * Remove an object by the specified integer key. - * - * @param key The integer key for searching. - * @see removeObjectForKey(const std::string&), removeObjectsForKeys(Array*), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectForKey(intptr_t key); - - /** - * Remove objects by an array of keys. - * - * @param pKeyArray The array contains keys to be removed. - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectForElememt(DictElement*), removeAllObjects(). - * @js NA - */ - void removeObjectsForKeys(Array* pKeyArray); - - /** - * Remove an object by an element. - * - * @param pElement The element need to be removed. - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectsForKeys(Array*), removeAllObjects(). - * @js NA - * @lua NA - */ - void removeObjectForElememt(DictElement* pElement); - - /** - * Remove all objects in the dictionary. - * - * @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t), - * removeObjectsForKeys(Array*), removeObjectForElememt(DictElement*). - * @js NA - */ - void removeAllObjects(); - - /** - * Return a random object in the dictionary. - * - * @return The random object. - * @see objectForKey(intptr_t), objectForKey(const std::string&) - * @js NA - * @lua NA - */ - Object* randomObject(); - - /** - * Create a dictionary. - * @return A dictionary which is an autorelease object. - * @see createWithDictionary(Dictionary*), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* create(); - - /** - * Create a dictionary with an existing dictionary. - * - * @param srcDict The exist dictionary. - * @return A dictionary which is an autorelease object. - * @see create(), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* createWithDictionary(Dictionary* srcDict); - - /** - * Create a dictionary with a plist file. - * @param pFileName The name of the plist file. - * @return A dictionary which is an autorelease object. - * @see create(), createWithDictionary(Dictionary*), createWithContentsOfFileThreadSafe(const char*). - * @js NA - */ - static Dictionary* createWithContentsOfFile(const char *pFileName); - - /** - * Write a dictionary to a plist file. - * @param fullPath The full path of the plist file. You can get writeable path by getWritablePath() - * @return true if successed, false if failed - * @js NA - * @lua NA - */ - bool writeToFile(const char *fullPath); - - /** - * Create a dictionary with a plist file. - * - * @note the return object isn't an autorelease object. - * This can make sure not using autorelease pool in a new thread. - * Therefore, you need to manage the lifecycle of the return object. - * It means that when you don't need it, CC_SAFE_RELEASE needs to be invoked. - * - * @param pFileName The name of the plist file. - * @return A dictionary which isn't an autorelease object. - * @js NA - * @lua NA - */ - static Dictionary* createWithContentsOfFileThreadSafe(const char *pFileName); - - /* override functions - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual Dictionary* clone() const; - -private: - /** - * For internal usage, invoked by setObject. - */ - void setObjectUnSafe(Object* pObject, const std::string& key); - void setObjectUnSafe(Object* pObject, const intptr_t key); - -public: - /** - * All the elements in dictionary. - * - * @note For internal usage, we need to declare this member variable as public since it's used in UT_HASH. - */ - DictElement* _elements; -private: - - /** The support type of dictionary, it's confirmed when setObject is invoked. */ - enum DictType - { - kDictUnknown = 0, - kDictStr, - kDictInt - }; - - /** - * The type of dictionary, it's assigned to kDictUnknown by default. - */ - DictType _dictType; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCDICTIONARY_H__ */ diff --git a/cocos/base/etc1/etc1.cpp b/cocos/base/etc1.cpp similarity index 100% rename from cocos/base/etc1/etc1.cpp rename to cocos/base/etc1.cpp diff --git a/cocos/base/etc1/etc1.h b/cocos/base/etc1.h similarity index 100% rename from cocos/base/etc1/etc1.h rename to cocos/base/etc1.h diff --git a/cocos/base/s3tc/s3tc.cpp b/cocos/base/s3tc.cpp similarity index 100% rename from cocos/base/s3tc/s3tc.cpp rename to cocos/base/s3tc.cpp diff --git a/cocos/base/s3tc/s3tc.h b/cocos/base/s3tc.h similarity index 100% rename from cocos/base/s3tc/s3tc.h rename to cocos/base/s3tc.h diff --git a/cocos/editor-support/cocosbuilder/Android.mk b/cocos/editor-support/cocosbuilder/Android.mk new file mode 100644 index 0000000000..dd6b2b3b77 --- /dev/null +++ b/cocos/editor-support/cocosbuilder/Android.mk @@ -0,0 +1,48 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocosbuilder_static + +LOCAL_MODULE_FILENAME := libcocosbuilder + +LOCAL_SRC_FILES := CCBAnimationManager.cpp \ +CCBFileLoader.cpp \ +CCBKeyframe.cpp \ +CCBReader.cpp \ +CCBSequence.cpp \ +CCBSequenceProperty.cpp \ +CCBValue.cpp \ +CCControlButtonLoader.cpp \ +CCControlLoader.cpp \ +CCLabelBMFontLoader.cpp \ +CCLabelTTFLoader.cpp \ +CCLayerColorLoader.cpp \ +CCLayerGradientLoader.cpp \ +CCLayerLoader.cpp \ +CCMenuItemImageLoader.cpp \ +CCMenuItemLoader.cpp \ +CCNode+CCBRelativePositioning.cpp \ +CCNodeLoader.cpp \ +CCNodeLoaderLibrary.cpp \ +CCParticleSystemQuadLoader.cpp \ +CCScale9SpriteLoader.cpp \ +CCScrollViewLoader.cpp \ +CCSpriteLoader.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ \ +$(LOCAL_PATH)/../../.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH) \ +$(LOCAL_PATH)/../../.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,extensions) diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp index 819986e00a..13b039dcac 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp @@ -11,8 +11,9 @@ using namespace cocos2d; using namespace std; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { // Implementation of CCBAinmationManager @@ -1292,4 +1293,4 @@ void CCBEaseInstant::update(float dt) } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h index ca679ee1e9..e9755bbfb1 100644 --- a/cocos/editor-support/cocosbuilder/CCBAnimationManager.h +++ b/cocos/editor-support/cocosbuilder/CCBAnimationManager.h @@ -2,13 +2,13 @@ #define __CCB_CCBANIMATION_MANAGER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCBSequence.h" #include "CCBValue.h" #include "CCBSequenceProperty.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class CCBAnimationManagerDelegate { @@ -16,7 +16,7 @@ public: virtual void completedAnimationSequenceNamed(const char *name) = 0; }; -class CCBAnimationManager : public Object +class CCBAnimationManager : public cocos2d::Object { public: bool _jsControlled; @@ -31,54 +31,54 @@ public: ~CCBAnimationManager(); - Object *_owner; + cocos2d::Object *_owner; virtual bool init(); - Array* getSequences(); - void setSequences(Array* seq); + cocos2d::Array* getSequences(); + void setSequences(cocos2d::Array* seq); int getAutoPlaySequenceId(); void setAutoPlaySequenceId(int autoPlaySequenceId); - Node* getRootNode(); - void setRootNode(Node* pRootNode); // weak reference + cocos2d::Node* getRootNode(); + void setRootNode(cocos2d::Node* pRootNode); // weak reference - void addDocumentCallbackNode(Node *node); + void addDocumentCallbackNode(cocos2d::Node *node); void addDocumentCallbackName(std::string name); - void addDocumentCallbackControlEvents(Control::EventType eventType); + void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType); - void addDocumentOutletNode(Node *node); + void addDocumentOutletNode(cocos2d::Node *node); void addDocumentOutletName(std::string name); void setDocumentControllerName(const std::string &name); std::string getDocumentControllerName(); - Array* getDocumentCallbackNames(); - Array* getDocumentCallbackNodes(); - Array* getDocumentCallbackControlEvents(); + cocos2d::Array* getDocumentCallbackNames(); + cocos2d::Array* getDocumentCallbackNodes(); + cocos2d::Array* getDocumentCallbackControlEvents(); - Array* getDocumentOutletNames(); - Array* getDocumentOutletNodes(); + cocos2d::Array* getDocumentOutletNames(); + cocos2d::Array* getDocumentOutletNodes(); std::string getLastCompletedSequenceName(); - Array* getKeyframeCallbacks(); + cocos2d::Array* getKeyframeCallbacks(); - const Size& getRootContainerSize(); - void setRootContainerSize(const Size &rootContainerSize); + const cocos2d::Size& getRootContainerSize(); + void setRootContainerSize(const cocos2d::Size &rootContainerSize); CCBAnimationManagerDelegate* getDelegate(); void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain const char* getRunningSequenceName(); - const Size& getContainerSize(Node* pNode); + const cocos2d::Size& getContainerSize(cocos2d::Node* pNode); - void addNode(Node *pNode, Dictionary *pSeq); - void setBaseValue(Object *pValue, Node *pNode, const char *propName); - void moveAnimationsFromNode(Node* fromNode, Node* toNode); + void addNode(cocos2d::Node *pNode, cocos2d::Dictionary *pSeq); + void setBaseValue(cocos2d::Object *pValue, cocos2d::Node *pNode, const char *propName); + void moveAnimationsFromNode(cocos2d::Node* fromNode, cocos2d::Node* toNode); /** @deprecated This interface will be deprecated sooner or later.*/ CC_DEPRECATED_ATTRIBUTE void runAnimations(const char *pName, float fTweenDuration); @@ -94,16 +94,16 @@ public: * when this function bound to js ,the second param are callfunc_selector * @lua NA */ - void setAnimationCompletedCallback(Object *target, SEL_CallFunc callbackFunc); + void setAnimationCompletedCallback(cocos2d::Object *target, cocos2d::SEL_CallFunc callbackFunc); void debug(); /** * @js setCallFuncForJSCallbackNamed */ - void setCallFunc(CallFunc *callFunc, const std::string &callbackNamed); + void setCallFunc(cocos2d::CallFunc *callFunc, const std::string &callbackNamed); - Object* actionForCallbackChannel(CCBSequenceProperty* channel); - Object* actionForSoundChannel(CCBSequenceProperty* channel); + cocos2d::Object* actionForCallbackChannel(CCBSequenceProperty* channel); + cocos2d::Object* actionForSoundChannel(CCBSequenceProperty* channel); // return -1 if timeline not exsit int getSequenceId(const char* pSequenceName); @@ -112,55 +112,55 @@ public: float getSequenceDuration(const char* pSequenceName); private: - Object* getBaseValue(Node *pNode, const char* propName); + cocos2d::Object* getBaseValue(cocos2d::Node *pNode, const char* propName); CCBSequence* getSequence(int nSequenceId); - ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, Node *pNode); - void setAnimatedProperty(const char *propName, Node *pNode, Object *pValue, float fTweenDuraion); - void setFirstFrame(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); - ActionInterval* getEaseAction(ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt); - void runAction(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + cocos2d::ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *propName, cocos2d::Node *pNode); + void setAnimatedProperty(const char *propName,cocos2d::Node *pNode, Object *pValue, float fTweenDuraion); + void setFirstFrame(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); + cocos2d::ActionInterval* getEaseAction(cocos2d::ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt); + void runAction(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration); void sequenceCompleted(); private: - Array *_sequences; - Dictionary *_nodeSequences; - Dictionary *_baseValues; + cocos2d::Array *_sequences; + cocos2d::Dictionary *_nodeSequences; + cocos2d::Dictionary *_baseValues; int _autoPlaySequenceId; - Node *_rootNode; + cocos2d::Node *_rootNode; - Size _rootContainerSize; + cocos2d::Size _rootContainerSize; CCBAnimationManagerDelegate *_delegate; CCBSequence *_runningSequence; - Array *_documentOutletNames; - Array *_documentOutletNodes; - Array *_documentCallbackNames; - Array *_documentCallbackNodes; - Array *_documentCallbackControlEvents; - Array *_keyframeCallbacks; - Dictionary *_keyframeCallFuncs; + cocos2d::Array *_documentOutletNames; + cocos2d::Array *_documentOutletNodes; + cocos2d::Array *_documentCallbackNames; + cocos2d::Array *_documentCallbackNodes; + cocos2d::Array *_documentCallbackControlEvents; + cocos2d::Array *_keyframeCallbacks; + cocos2d::Dictionary *_keyframeCallFuncs; std::string _documentControllerName; std::string _lastCompletedSequenceName; - SEL_CallFunc _animationCompleteCallbackFunc; - Object *_target; + cocos2d::SEL_CallFunc _animationCompleteCallbackFunc; + cocos2d::Object *_target; }; -class CCBSetSpriteFrame : public ActionInstant +class CCBSetSpriteFrame : public cocos2d::ActionInstant { public: /** creates a Place action with a position */ - static CCBSetSpriteFrame* create(SpriteFrame *pSpriteFrame); + static CCBSetSpriteFrame* create(cocos2d::SpriteFrame *pSpriteFrame); /** * @js NA * @lua NA */ ~CCBSetSpriteFrame(); - bool initWithSpriteFrame(SpriteFrame *pSpriteFrame); + bool initWithSpriteFrame(cocos2d::SpriteFrame *pSpriteFrame); // Overrides virtual void update(float time) override; @@ -168,11 +168,11 @@ public: virtual CCBSetSpriteFrame* reverse() const override; private: - SpriteFrame *_spriteFrame; + cocos2d::SpriteFrame *_spriteFrame; }; -class CCBSoundEffect : public ActionInstant +class CCBSoundEffect : public cocos2d::ActionInstant { public: static CCBSoundEffect* actionWithSoundFile(const std::string &file, float pitch, float pan, float gain); @@ -194,7 +194,7 @@ private: }; -class CCBRotateTo : public ActionInterval +class CCBRotateTo : public cocos2d::ActionInterval { public: static CCBRotateTo* create(float fDuration, float fAngle); @@ -204,7 +204,7 @@ public: virtual void update(float time) override; virtual CCBRotateTo* clone() const override; virtual CCBRotateTo* reverse() const override; - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; private: float _startAngle; @@ -213,14 +213,14 @@ private: }; -class CCBRotateXTo: public ActionInterval +class CCBRotateXTo: public cocos2d::ActionInterval { public: static CCBRotateXTo* create(float fDuration, float fAngle); bool initWithDuration(float fDuration, float fAngle); // Overrides - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; virtual CCBRotateXTo* clone() const override; virtual CCBRotateXTo* reverse() const override; virtual void update(float time) override; @@ -232,14 +232,14 @@ private: }; -class CCBRotateYTo: public ActionInterval +class CCBRotateYTo: public cocos2d::ActionInterval { public: static CCBRotateYTo* create(float fDuration, float fAngle); bool initWithDuration(float fDuration, float fAngle); // Override - virtual void startWithTarget(Node *pNode) override; + virtual void startWithTarget(cocos2d::Node *pNode) override; virtual CCBRotateYTo* clone() const override; virtual CCBRotateYTo* reverse() const override; virtual void update(float time) override; @@ -251,10 +251,10 @@ private: }; -class CCBEaseInstant : public ActionEase +class CCBEaseInstant : public cocos2d::ActionEase { public: - static CCBEaseInstant* create(ActionInterval *pAction); + static CCBEaseInstant* create(cocos2d::ActionInterval *pAction); virtual CCBEaseInstant* clone() const override; virtual CCBEaseInstant* reverse() const override; @@ -262,6 +262,6 @@ public: }; -NS_CC_EXT_END +} #endif // __CCB_CCBANIMATION_MANAGER_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp b/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp index 12af936847..549b369f4e 100644 --- a/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp @@ -1,8 +1,9 @@ #include "CCBFileLoader.h" +using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_CCBFILE "ccbFile" @@ -14,4 +15,4 @@ void CCBFileLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBFileLoader.h b/cocos/editor-support/cocosbuilder/CCBFileLoader.h index aa2aeff982..51e675b00e 100644 --- a/cocos/editor-support/cocosbuilder/CCBFileLoader.h +++ b/cocos/editor-support/cocosbuilder/CCBFileLoader.h @@ -4,7 +4,7 @@ #include "CCNodeLoader.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -25,9 +25,9 @@ class CCBFileLoader : public NodeLoader { protected: CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp b/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp index d2f3c5dc87..e2f97806b0 100644 --- a/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp +++ b/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp @@ -2,7 +2,7 @@ using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBKeyframe::CCBKeyframe() : _value(NULL) @@ -58,4 +58,4 @@ void CCBKeyframe::setEasingOpt(float fEasingOpt) _easingOpt = fEasingOpt; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBKeyframe.h b/cocos/editor-support/cocosbuilder/CCBKeyframe.h index 925e8bd23d..706ab32efc 100644 --- a/cocos/editor-support/cocosbuilder/CCBKeyframe.h +++ b/cocos/editor-support/cocosbuilder/CCBKeyframe.h @@ -2,11 +2,10 @@ #define __CCB_KEYFRAME_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBKeyframe : public Object +class CCBKeyframe : public cocos2d::Object { public: enum class EasingType @@ -41,8 +40,8 @@ public: */ ~CCBKeyframe(); - Object* getValue(); - void setValue(Object *pValue); // retain + cocos2d::Object* getValue(); + void setValue(cocos2d::Object *pValue); // retain float getTime(); void setTime(float fTime); @@ -54,12 +53,12 @@ public: void setEasingOpt(float fEasingOpt); private: - Object *_value; + cocos2d::Object *_value; float _time; EasingType _easingType; float _easingOpt; }; -NS_CC_EXT_END +} #endif // __CCB_KEYFRAME_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h index 940d300c45..044f3e5059 100644 --- a/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h +++ b/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h @@ -4,7 +4,7 @@ #include "cocos2d.h" #include "CCBValue.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \ if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, (MEMBERVARIABLENAME))) { \ @@ -41,7 +41,7 @@ class CCBMemberVariableAssigner { * @param node The member variable. * @return Whether the assignment was successful. */ - virtual bool onAssignCCBMemberVariable(Object* target, const char* memberVariableName, Node* node) = 0; + virtual bool onAssignCCBMemberVariable(cocos2d::Object* target, const char* memberVariableName, cocos2d::Node* node) = 0; /** * The callback function of assigning custom properties. @@ -51,9 +51,9 @@ class CCBMemberVariableAssigner { * @param value The value of the property. * @return Whether the assignment was successful. */ - virtual bool onAssignCCBCustomProperty(Object* target, const char* memberVariableName, CCBValue* value) { return false; }; + virtual bool onAssignCCBCustomProperty(cocos2d::Object* target, const char* memberVariableName, CCBValue* value) { return false; }; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBReader.cpp b/cocos/editor-support/cocosbuilder/CCBReader.cpp index 7397489fc9..d2f57ecf88 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.cpp +++ b/cocos/editor-support/cocosbuilder/CCBReader.cpp @@ -15,8 +15,10 @@ #include using namespace std; +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN; +namespace cocosbuilder {; /************************************************************************* Implementation of CCBFile @@ -1108,4 +1110,4 @@ void CCBReader::setResolutionScale(float scale) __ccbResolutionScale = scale; } -NS_CC_EXT_END; +}; diff --git a/cocos/editor-support/cocosbuilder/CCBReader.h b/cocos/editor-support/cocosbuilder/CCBReader.h index e3423a0736..211ea18de4 100644 --- a/cocos/editor-support/cocosbuilder/CCBReader.h +++ b/cocos/editor-support/cocosbuilder/CCBReader.h @@ -2,11 +2,10 @@ #define _CCB_CCBREADER_H_ #include "cocos2d.h" -#include "ExtensionMacros.h" #include #include #include "CCBSequence.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" #define CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(T, METHOD) static T * METHOD() { \ T * ptr = new T(); \ @@ -30,24 +29,24 @@ #define CCB_VERSION 5 -NS_CC_EXT_BEGIN +namespace cocosbuilder { /** * @addtogroup cocosbuilder * @{ */ -class CCBFile : public Node +class CCBFile : public cocos2d::Node { private: - Node *_CCBFileNode; + cocos2d::Node *_CCBFileNode; public: CCBFile(); static CCBFile* create(); - Node* getCCBFileNode(); + cocos2d::Node* getCCBFileNode(); void setCCBFileNode(Node *pNode); // retain }; @@ -63,7 +62,7 @@ class CCBKeyframe; /** * @brief Parse CCBI file which is generated by CocosBuilder */ -class CCBReader : public Object +class CCBReader : public cocos2d::Object { public: enum class PropertyType { @@ -167,27 +166,27 @@ public: void setCCBRootPath(const char* ccbRootPath); const std::string& getCCBRootPath() const; - Node* readNodeGraphFromFile(const char *pCCBFileName); - Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner); - Node* readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner); + cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** * @js NA * @lua NA */ - Node* readNodeGraphFromData(Data *pData, Object *pOwner, const Size &parentSize); + cocos2d::Node* readNodeGraphFromData(cocos2d::Data *pData, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner); /** @lua NA */ - Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize); + cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize); /** * @js NA @@ -225,7 +224,7 @@ public: * @js NA * @lua NA */ - Object* getOwner(); + cocos2d::Object* getOwner(); /* Utility methods. * @js NA @@ -283,24 +282,24 @@ public: bool readCallbackKeyframesForSeq(CCBSequence* seq); bool readSoundKeyframesForSeq(CCBSequence* seq); - Array* getOwnerCallbackNames(); - Array* getOwnerCallbackNodes(); - Array* getOwnerCallbackControlEvents(); + cocos2d::Array* getOwnerCallbackNames(); + cocos2d::Array* getOwnerCallbackNodes(); + cocos2d::Array* getOwnerCallbackControlEvents(); - Array* getOwnerOutletNames(); - Array* getOwnerOutletNodes(); - Array* getNodesWithAnimationManagers(); - Array* getAnimationManagersForNodes(); + cocos2d::Array* getOwnerOutletNames(); + cocos2d::Array* getOwnerOutletNodes(); + cocos2d::Array* getNodesWithAnimationManagers(); + cocos2d::Array* getAnimationManagersForNodes(); /** * @js NA * @lua NA */ - Dictionary* getAnimationManagers(); + cocos2d::Dictionary* getAnimationManagers(); /** * @js NA * @lua NA */ - void setAnimationManagers(Dictionary* x); // weak reference + void setAnimationManagers(cocos2d::Dictionary* x); // weak reference /** * @js NA * @lua NA @@ -310,8 +309,8 @@ public: * @js NA * @lua NA */ - void addOwnerCallbackNode(Node *node); - void addOwnerCallbackControlEvents(Control::EventType type); + void addOwnerCallbackNode(cocos2d::Node *node); + void addOwnerCallbackControlEvents(cocos2d::extension::Control::EventType type); /** * @js NA * @lua NA @@ -321,8 +320,8 @@ public: * @js NA * @lua NA */ - void addDocumentCallbackNode(Node *node); - void addDocumentCallbackControlEvents(Control::EventType eventType); + void addDocumentCallbackNode(cocos2d::Node *node); + void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType); /** * @js NA * @lua NA @@ -333,21 +332,21 @@ public: * @js NA * @lua NA */ - Node* readFileWithCleanUp(bool bCleanUp, Dictionary* am); + cocos2d::Node* readFileWithCleanUp(bool bCleanUp, cocos2d::Dictionary* am); void addOwnerOutletName(std::string name); - void addOwnerOutletNode(Node *node); + void addOwnerOutletNode(cocos2d::Node *node); private: - void cleanUpNodeGraph(Node *pNode); + void cleanUpNodeGraph(cocos2d::Node *pNode); bool readSequences(); CCBKeyframe* readKeyframe(PropertyType type); bool readHeader(); bool readStringCache(); //void readStringCacheEntry(); - Node* readNodeGraph(); - Node* readNodeGraph(Node * pParent); + cocos2d::Node* readNodeGraph(); + cocos2d::Node* readNodeGraph(cocos2d::Node * pParent); bool getBit(); void alignBits(); @@ -357,7 +356,7 @@ private: friend class NodeLoader; private: - Data *_data; + cocos2d::Data *_data; unsigned char *_bytes; int _currentByte; int _currentBit; @@ -365,10 +364,10 @@ private: std::vector _stringCache; std::set _loadedSpriteSheets; - Object *_owner; + cocos2d::Object *_owner; CCBAnimationManager *_actionManager; //retain - Dictionary* _actionManagers; + cocos2d::Dictionary* _actionManagers; std::set *_animatedProps; @@ -378,13 +377,13 @@ private: CCBSelectorResolver *_CCBSelectorResolver; std::vector _ownerOutletNames; - Array* _ownerOutletNodes; - Array* _nodesWithAnimationManagers; - Array* _animationManagersForNodes; + cocos2d::Array* _ownerOutletNodes; + cocos2d::Array* _nodesWithAnimationManagers; + cocos2d::Array* _animationManagersForNodes; std::vector _ownerCallbackNames; - Array* _ownerCallbackNodes; - Array* _ownerOwnerCallbackControlEvents; + cocos2d::Array* _ownerCallbackNodes; + cocos2d::Array* _ownerOwnerCallbackControlEvents; std::string _CCBRootPath; bool _jsControlled; @@ -393,6 +392,6 @@ private: // end of effects group /// @} -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h index 94ea8d333b..f054c284c5 100644 --- a/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h +++ b/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h @@ -2,11 +2,10 @@ #define _CCB_CCBSELECTORRESOLVER_H_ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../GUI/CCControlExtension/CCInvocation.h" +#include "extensions//GUI/CCControlExtension/CCInvocation.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \ return menu_selector(METHOD); \ @@ -27,9 +26,9 @@ class CCBSelectorResolver { * @lua NA */ virtual ~CCBSelectorResolver() {}; - virtual SEL_MenuHandler onResolveCCBCCMenuItemSelector(Object * pTarget, const char* pSelectorName) = 0; - virtual SEL_CallFuncN onResolveCCBCCCallFuncSelector(Object * pTarget, const char* pSelectorName) { return NULL; }; - virtual Control::Handler onResolveCCBCCControlSelector(Object * pTarget, const char* pSelectorName) = 0; + virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0; + virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Object * pTarget, const char* pSelectorName) { return NULL; }; + virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0; }; @@ -43,6 +42,6 @@ public: virtual CCBSelectorResolver * createNew() = 0; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCBSequence.cpp b/cocos/editor-support/cocosbuilder/CCBSequence.cpp index 07e8d96189..20a7c49ab0 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequence.cpp +++ b/cocos/editor-support/cocosbuilder/CCBSequence.cpp @@ -4,7 +4,7 @@ using namespace cocos2d; using namespace std; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBSequence::CCBSequence() : _duration(0.0f) @@ -86,4 +86,4 @@ void CCBSequence::setChainedSequenceId(int nChainedSequenceId) mChainedSequenceId = nChainedSequenceId; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCBSequence.h b/cocos/editor-support/cocosbuilder/CCBSequence.h index 5fd8739f34..dd7c1a899f 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequence.h +++ b/cocos/editor-support/cocosbuilder/CCBSequence.h @@ -3,12 +3,11 @@ #include #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBSequenceProperty.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBSequence : public Object +class CCBSequence : public cocos2d::Object { public: CCBSequence(); @@ -45,7 +44,7 @@ private: }; -NS_CC_EXT_END +} #endif // __CCB_CCSEQUENCE_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp index bd308d64e5..a091adaad1 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp +++ b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp @@ -3,7 +3,7 @@ using namespace cocos2d; using namespace std; -NS_CC_EXT_BEGIN +namespace cocosbuilder { CCBSequenceProperty::CCBSequenceProperty() : _name("") @@ -50,4 +50,4 @@ Array* CCBSequenceProperty::getKeyframes() return _keyframes; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h index 4fd0767ab0..cd097c2356 100644 --- a/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h +++ b/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h @@ -2,12 +2,11 @@ #define __CCB_SEQUENCE_PROPERTY_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBKeyframe.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class CCBSequenceProperty : public Object +class CCBSequenceProperty : public cocos2d::Object { public: /** @@ -28,14 +27,14 @@ public: int getType(); void setType(int type); - Array* getKeyframes(); + cocos2d::Array* getKeyframes(); private: std::string _name; int _type; - Array *_keyframes; + cocos2d::Array *_keyframes; }; -NS_CC_EXT_END +} #endif // __CCB_SEQUENCE_PROPERTY_H__ diff --git a/cocos/editor-support/cocosbuilder/CCBValue.cpp b/cocos/editor-support/cocosbuilder/CCBValue.cpp index 051100383d..f9a7547102 100644 --- a/cocos/editor-support/cocosbuilder/CCBValue.cpp +++ b/cocos/editor-support/cocosbuilder/CCBValue.cpp @@ -1,6 +1,8 @@ #include "CCBValue.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { // Implementation of Color3BWapper @@ -154,4 +156,4 @@ CCBValue::Type CCBValue::getType() return _type; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCBValue.h b/cocos/editor-support/cocosbuilder/CCBValue.h index 267ed5809a..0d05cb6a69 100644 --- a/cocos/editor-support/cocosbuilder/CCBValue.h +++ b/cocos/editor-support/cocosbuilder/CCBValue.h @@ -2,28 +2,27 @@ #define __CCB_VALUE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" /* These classes are wrapper of basic types, such as Color3B */ -NS_CC_EXT_BEGIN +namespace cocosbuilder { -class Color3BWapper : public Object +class Color3BWapper : public cocos2d::Object { public: - static Color3BWapper* create(const Color3B& color); + static Color3BWapper* create(const cocos2d::Color3B& color); - const Color3B& getColor() const; + const cocos2d::Color3B& getColor() const; private: - Color3B color; + cocos2d::Color3B color; }; -class CCBValue : public Object +class CCBValue : public cocos2d::Object { public: @@ -42,7 +41,7 @@ public: static CCBValue* create(float fValue); static CCBValue* create(unsigned char byte); static CCBValue* create(const char* pStr); - static CCBValue* create(Array* pArr); + static CCBValue* create(cocos2d::Array* pArr); int getIntValue(); @@ -50,7 +49,7 @@ public: bool getBoolValue(); unsigned char getByteValue(); const char* getStringValue(); - Array *getArrayValue(); + cocos2d::Array *getArrayValue(); Type getType(); @@ -62,10 +61,10 @@ private: } _value; std::string _strValue; - Array* _arrValue; + cocos2d::Array* _arrValue; Type _type; }; -NS_CC_EXT_END +} #endif // __CCB_VALUE_H__ diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp index 6b76adf3ec..c72b9723a2 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp @@ -1,7 +1,9 @@ #include "CCControlButtonLoader.h" +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN; +namespace cocosbuilder {; #define PROPERTY_ZOOMONTOUCHDOWN "zoomOnTouchDown" #define PROPERTY_TITLE_NORMAL "title|1" @@ -112,4 +114,4 @@ void ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END; \ No newline at end of file +}; \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h index 601e61c4d6..c6d420a161 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCCONTROLBUTTONLOADER_H_ #include "CCControlLoader.h" -#include "../GUI/CCControlExtension/CCControlButton.h" +#include "extensions//GUI/CCControlExtension/CCControlButton.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -23,18 +23,18 @@ class ControlButtonLoader : public ControlLoader { CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ControlButtonLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ControlButton); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ControlButton); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCControlLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlLoader.cpp index aff1fd2f11..9125f8d193 100644 --- a/cocos/editor-support/cocosbuilder/CCControlLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlLoader.cpp @@ -1,7 +1,9 @@ #include "CCControlLoader.h" +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_ENABLED "enabled" #define PROPERTY_SELECTED "selected" @@ -25,4 +27,4 @@ void ControlLoader::onHandlePropTypeBlockControl(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCControlLoader.h b/cocos/editor-support/cocosbuilder/CCControlLoader.h index 07b1eaaa72..83e2306e39 100644 --- a/cocos/editor-support/cocosbuilder/CCControlLoader.h +++ b/cocos/editor-support/cocosbuilder/CCControlLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCCONTROLLOADER_H_ #include "CCNodeLoader.h" -#include "../GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,12 +18,12 @@ public: virtual ~ControlLoader() {}; protected: - CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Control); + CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Control); - virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp index 52230fb282..df96cccc77 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp @@ -1,8 +1,8 @@ #include "CCLabelBMFontLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -50,4 +50,4 @@ void LabelBMFontLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h index a6027cb4af..ae5cb20011 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,15 +18,15 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelBMFontLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelBMFont); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelBMFont); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp index 470698fd8a..2ed3010e1f 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp @@ -1,6 +1,6 @@ #include "CCLabelTTFLoader.h" - +using namespace cocos2d; #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -12,7 +12,7 @@ #define PROPERTY_STRING "string" #define PROPERTY_DIMENSIONS "dimensions" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { @@ -80,4 +80,4 @@ void LabelTTFLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const ch } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h index d5405d34f0..de0ca00d42 100644 --- a/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,18 +18,18 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTTFLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LabelTTF); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelTTF); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp index abac77efdf..02c7f610ae 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp @@ -1,8 +1,8 @@ #include "CCLayerColorLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" @@ -32,4 +32,4 @@ void LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h index e9618ed075..acea8b64da 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,13 +18,13 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerColorLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerColor); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerColor); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp index a14bfac0f7..95d93e554b 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp @@ -1,6 +1,6 @@ #include "CCLayerGradientLoader.h" - +using namespace cocos2d; #define PROPERTY_STARTCOLOR "startColor" #define PROPERTY_ENDCOLOR "endColor" @@ -9,7 +9,7 @@ #define PROPERTY_VECTOR "vector" #define PROPERTY_BLENDFUNC "blendFunc" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) { @@ -51,4 +51,4 @@ void LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, co } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h index 1361369600..5ec0c8fcc3 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,14 +18,14 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerGradientLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(LayerGradient); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerGradient); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp index d5f353d0f5..f13cf610f6 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp @@ -1,14 +1,16 @@ #include "CCLayerLoader.h" - +using namespace cocos2d; #define PROPERTY_TOUCH_ENABLED "isTouchEnabled" #define PROPERTY_ACCELEROMETER_ENABLED "isAccelerometerEnabled" #define PROPERTY_MOUSE_ENABLED "isMouseEnabled" #define PROPERTY_KEYBOARD_ENABLED "isKeyboardEnabled" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_TOUCH_ENABLED) == 0) { @@ -27,4 +29,4 @@ void LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCLayerLoader.h b/cocos/editor-support/cocosbuilder/CCLayerLoader.h index 835d77b4ba..9d7f41fa25 100644 --- a/cocos/editor-support/cocosbuilder/CCLayerLoader.h +++ b/cocos/editor-support/cocosbuilder/CCLayerLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -18,11 +18,11 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Layer); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Layer); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp index 169d2a469a..21bb3b0b6b 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp @@ -1,12 +1,12 @@ #include "CCMenuItemImageLoader.h" - +using namespace cocos2d; #define PROPERTY_NORMALDISPLAYFRAME "normalSpriteFrame" #define PROPERTY_SELECTEDDISPLAYFRAME "selectedSpriteFrame" #define PROPERTY_DISABLEDDISPLAYFRAME "disabledSpriteFrame" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) { @@ -26,4 +26,4 @@ void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pPare } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h index 5c56e3c178..d1c680227f 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h @@ -3,7 +3,7 @@ #include "CCMenuItemLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -26,14 +26,14 @@ protected: * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItemImage); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItemImage); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp index d6dd6f2ecd..2a85d0c4e1 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp @@ -1,11 +1,11 @@ #include "CCMenuItemLoader.h" - +using namespace cocos2d; #define PROPERTY_BLOCK "block" #define PROPERTY_ISENABLED "isEnabled" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) { @@ -27,4 +27,4 @@ void MenuItemLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const c } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h index ec334bc093..5db15eacba 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -21,19 +21,19 @@ protected: * @js NA * @lua NA */ - CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(MenuItem); + CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItem); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); + virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCMenuLoader.h b/cocos/editor-support/cocosbuilder/CCMenuLoader.h index 107fc2e27d..851913c74c 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuLoader.h +++ b/cocos/editor-support/cocosbuilder/CCMenuLoader.h @@ -3,7 +3,7 @@ #include "CCLayerLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -22,9 +22,9 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Menu); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Menu); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp index 4797b8ad2d..fd941dfbfa 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp @@ -1,7 +1,9 @@ #include "CCNode+CCBRelativePositioning.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocosbuilder { Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName) { @@ -57,4 +59,4 @@ void setRelativeScale(Node *pNode, float scaleX, float scaleY, CCBReader::ScaleT pNode->setScaleY(scaleY); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h index 7e8a8e7baa..0220eccafc 100644 --- a/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h +++ b/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h @@ -2,15 +2,14 @@ #define __CCB_CCNODE_RELATIVEPOSITIONING_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { -extern Point getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const char *propName); +extern cocos2d::Point getAbsolutePosition(const cocos2d::Point &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const char *propName); -extern void setRelativeScale(Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName); +extern void setRelativeScale(cocos2d::Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const char* propName); -NS_CC_EXT_END +} #endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__ diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index eef0acfb96..f1aedc7104 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -5,8 +5,10 @@ #include "CCNode+CCBRelativePositioning.h" using namespace std; +using namespace cocos2d; +using namespace cocos2d::extension; -NS_CC_EXT_BEGIN +namespace cocosbuilder { NodeLoader::NodeLoader() { @@ -1156,4 +1158,4 @@ void NodeLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const cha ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.h b/cocos/editor-support/cocosbuilder/CCNodeLoader.h index a3ec6ee7a8..bc798a1c89 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.h @@ -1,13 +1,13 @@ #ifndef _CCB_CCNODELOADER_H_ #define _CCB_CCNODELOADER_H_ -#include "../GUI/CCControlExtension/CCInvocation.h" +#include "extensions/GUI/CCControlExtension/CCInvocation.h" #include "cocos2d.h" #include "CCBReader.h" #include "CCBValue.h" -#include "../GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { #define PROPERTY_POSITION "position" #define PROPERTY_CONTENTSIZE "contentSize" @@ -24,27 +24,27 @@ NS_CC_EXT_BEGIN #define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) cocos2d::log("Unexpected property: '%s'!\n", PROPERTY); assert(false) #define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) cocos2d::log("Unexpected property type: '%d'!\n", PROPERTYTYPE); assert(false) -#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) { \ +#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { \ return T::create(); \ } -#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocos2d::extension::CCBReader * ccbReader) = 0 +#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) = 0 struct BlockData { - SEL_MenuHandler mSELMenuHandler; - Object * _target; + cocos2d::SEL_MenuHandler mSELMenuHandler; + cocos2d::Object * _target; }; struct BlockControlData { - Control::Handler mSELControlHandler; - Object * _target; - Control::EventType mControlEvents; + cocos2d::extension::Control::Handler mSELControlHandler; + cocos2d::Object * _target; + cocos2d::extension::Control::EventType mControlEvents; }; /* Forward declaration. */ class CCBReader; -class NodeLoader : public Object { +class NodeLoader : public cocos2d::Object { public: /** * @js NA @@ -65,85 +65,85 @@ class NodeLoader : public Object { * @js NA * @lua NA */ - virtual Node * loadNode(Node *, CCBReader * ccbReader); + virtual cocos2d::Node * loadNode(cocos2d::Node *, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void parseProperties(Node * pNode, Node * pParent, CCBReader * ccbReader); + virtual void parseProperties(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual Dictionary* getCustomProperties(); + virtual cocos2d::Dictionary* getCustomProperties(); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Node); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Node); - virtual Point parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Point parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Point parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Size parsePropTypeSize(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeScaleLock(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual float parsePropTypeFloat(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float parsePropTypeDegrees(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual float parsePropTypeFloatScale(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual int parsePropTypeInteger(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual int parsePropTypeIntegerLabeled(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeFloatVar(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual bool parsePropTypeCheck(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual SpriteFrame * parsePropTypeSpriteFrame(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Animation * parsePropTypeAnimation(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Texture2D * parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual unsigned char parsePropTypeByte(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Color3B parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName); - virtual Color4F * parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual bool * parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlendFunc parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeFntFile(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeString(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeText(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual std::string parsePropTypeFontTTF(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlockData * parsePropTypeBlock(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual BlockControlData * parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual Node * parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * ccbReader); - virtual float * parsePropTypeFloatXY(Node * pNode, Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Point parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Point parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Point parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Size parsePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual float parsePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float parsePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual float parsePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual int parsePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual int parsePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeFloatVar(cocos2d::Node * pNode,cocos2d::Node * pParent, CCBReader * ccbReader); + virtual bool parsePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::SpriteFrame * parsePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Animation * parsePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Texture2D * parsePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual unsigned char parsePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Color3B parsePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName); + virtual cocos2d::Color4F * parsePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual bool * parsePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::BlendFunc parsePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual std::string parsePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual BlockData * parsePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual BlockControlData * parsePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual cocos2d::Node * parsePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); + virtual float * parsePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader); - virtual void onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Point pPosition, CCBReader * ccbReader); - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Point pPoint, CCBReader * ccbReader); - virtual void onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Point pPointLock, CCBReader * ccbReader); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char* pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeScaleLock(Node * pNode, Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader); - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader); - virtual void onHandlePropTypeDegrees(Node * pNode, Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader); - virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); - virtual void onHandlePropTypeFloatXY(Node * pNode, Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); + virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Point pPosition, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPointLock, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader); + virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char* pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeAnimation(Node * pNode, Node * pParent, const char* pPropertyName, Animation * pAnimation, CCBReader * ccbReader); - virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char* pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader); - virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader); - virtual void onHandlePropTypeString(Node * pNode, Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader); - virtual void onHandlePropTypeText(Node * pNode, Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader); - virtual void onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader); - virtual void onHandlePropTypeBlock(Node * pNode, Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); - virtual void onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char* pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Animation * pAnimation, CCBReader * ccbReader); + virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader); + virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader); + virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader); + virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader); + virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader); + virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); protected: - Dictionary* _customProperties; + cocos2d::Dictionary* _customProperties; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp index c7d61b24ec..48979ee0bc 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp @@ -15,9 +15,9 @@ #include "CCParticleSystemQuadLoader.h" #include "CCScrollViewLoader.h" +using namespace cocos2d; - -NS_CC_EXT_BEGIN +namespace cocosbuilder { NodeLoaderLibrary::NodeLoaderLibrary() { @@ -102,4 +102,4 @@ NodeLoaderLibrary * NodeLoaderLibrary::newDefaultNodeLoaderLibrary() { return ccNodeLoaderLibrary; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h index dcb49dbaaf..c75276d22f 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h @@ -4,14 +4,14 @@ #include "cocos2d.h" #include "CCBReader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class NodeLoader; typedef std::map NodeLoaderMap; typedef std::pair NodeLoaderMapEntry; -class NodeLoaderLibrary : public Object +class NodeLoaderLibrary : public cocos2d::Object { public: /** @@ -114,6 +114,6 @@ private: NodeLoaderMap _nodeLoaders; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h index 0ff35b2bee..cf6c53e543 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h @@ -3,7 +3,7 @@ #include "cocos2d.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { class NodeLoaderListener { public: @@ -16,9 +16,9 @@ class NodeLoaderListener { * @js NA * @lua NA */ - virtual void onNodeLoaded(Node * pNode, NodeLoader * pNodeLoader) = 0; + virtual void onNodeLoaded(cocos2d::Node * pNode, NodeLoader * pNodeLoader) = 0; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp index 8f94db33ad..472d1e8d91 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp @@ -1,6 +1,6 @@ #include "CCParticleSystemQuadLoader.h" - +using namespace cocos2d; #define PROPERTY_EMITERMODE "emitterMode" #define PROPERTY_POSVAR "posVar" @@ -25,7 +25,7 @@ #define PROPERTY_ENDRADIUS "endRadius" #define PROPERTY_ROTATEPERSECOND "rotatePerSecond" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void ParticleSystemQuadLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_EMITERMODE) == 0) { @@ -133,4 +133,4 @@ void ParticleSystemQuadLoader::onHandlePropTypeTexture(Node * pNode, Node * pPar } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h index cf8324fbb3..feced7312e 100644 --- a/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h +++ b/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -19,56 +19,56 @@ public: * @js NA * @lua NA */ - CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ParticleSystemQuadLoader, loader); + CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(cocosbuilder::ParticleSystemQuadLoader, loader); protected: /** * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ParticleSystemQuad); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::ParticleSystemQuad); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader); + virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeInteger(Node * pNode, Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader); + virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader); + virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader); + virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader); + virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp index b2172bf855..ac9bfd7ca7 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp @@ -1,6 +1,7 @@ #include "CCScale9SpriteLoader.h" - +using namespace cocos2d; +using namespace cocos2d::extension; #define PROPERTY_CONTENTSIZE "contentSize" #define PROPERTY_SPRITEFRAME "spriteFrame" @@ -13,7 +14,7 @@ #define PROPERTY_INSETRIGHT "insetRight" #define PROPERTY_INSETBOTTOM "insetBottom" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) { @@ -72,4 +73,4 @@ void Scale9SpriteLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, con } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h index 18692fdef7..b4ec05c92f 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h @@ -3,9 +3,9 @@ #include "CCNodeLoader.h" #include "CCScale9SpriteLoader.h" -#include "../GUI/CCControlExtension/CCScale9Sprite.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -28,39 +28,39 @@ protected: * @js NA * @lua NA */ - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Scale9Sprite); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Scale9Sprite); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); /** * @js NA * @lua NA */ - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp index 5006a5fd89..32301942c8 100644 --- a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp @@ -1,6 +1,7 @@ #include "CCScrollViewLoader.h" - +using namespace cocos2d; +using namespace cocos2d::extension; #define PROPERTY_CONTAINER "container" #define PROPERTY_DIRECTION "direction" @@ -8,7 +9,7 @@ #define PROPERTY_BOUNCES "bounces" #define PROPERTY_SCALE "scale" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void ScrollViewLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) { @@ -53,4 +54,4 @@ void ScrollViewLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pPare } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h index c21b502bc8..30ede8a8d2 100644 --- a/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h @@ -2,9 +2,9 @@ #define _CCB_CCSCROLLVIEWLOADER_H_ #include "CCNodeLoader.h" -#include "../GUI/CCScrollView/CCScrollView.h" +#include "extensions/GUI/CCScrollView/CCScrollView.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -23,14 +23,14 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(ScrollView); - virtual void onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader); - virtual void onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader); - virtual void onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); - virtual void onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); - virtual void onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ScrollView); + virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader); + virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader); + virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader); + virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader); + virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp index 0432658189..34a2e7f549 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp @@ -1,12 +1,14 @@ #include "CCSpriteLoader.h" +using namespace cocos2d; + #define PROPERTY_FLIP "flip" #define PROPERTY_DISPLAYFRAME "displayFrame" #define PROPERTY_COLOR "color" #define PROPERTY_OPACITY "opacity" #define PROPERTY_BLENDFUNC "blendFunc" -NS_CC_EXT_BEGIN +namespace cocosbuilder { void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) { @@ -53,4 +55,4 @@ void SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const } } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.h b/cocos/editor-support/cocosbuilder/CCSpriteLoader.h index 308b6165c6..466ee836bc 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" -NS_CC_EXT_BEGIN +namespace cocosbuilder { /* Forward declaration. */ class CCBReader; @@ -22,15 +22,15 @@ public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteLoader, loader); protected: - CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(Sprite); + CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Sprite); - virtual void onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader); - virtual void onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); - virtual void onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pCCBBlendFunc, CCBReader * ccbReader); - virtual void onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader); - virtual void onHandlePropTypeFlip(Node * pNode, Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader); + virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader); + virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader); + virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pCCBBlendFunc, CCBReader * ccbReader); + virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader); + virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocosbuilder/CocosBuilder.h b/cocos/editor-support/cocosbuilder/CocosBuilder.h new file mode 100644 index 0000000000..6baa5d2ddc --- /dev/null +++ b/cocos/editor-support/cocosbuilder/CocosBuilder.h @@ -0,0 +1,32 @@ +#ifndef __EDITOR_SUPPORT_COCOSBUILDER_H__ +#define __EDITOR_SUPPORT_COCOSBUILDER_H__ + +#include "cocosbuilder/CCBAnimationManager.h" +#include "cocosbuilder/CCBFileLoader.h" +#include "cocosbuilder/CCBKeyframe.h" +#include "cocosbuilder/CCBMemberVariableAssigner.h" +#include "cocosbuilder/CCBReader.h" +#include "cocosbuilder/CCBSelectorResolver.h" +#include "cocosbuilder/CCBSequence.h" +#include "cocosbuilder/CCBSequenceProperty.h" +#include "cocosbuilder/CCBValue.h" +#include "cocosbuilder/CCControlButtonLoader.h" +#include "cocosbuilder/CCControlLoader.h" +#include "cocosbuilder/CCLabelBMFontLoader.h" +#include "cocosbuilder/CCLabelTTFLoader.h" +#include "cocosbuilder/CCLayerColorLoader.h" +#include "cocosbuilder/CCLayerGradientLoader.h" +#include "cocosbuilder/CCLayerLoader.h" +#include "cocosbuilder/CCMenuItemImageLoader.h" +#include "cocosbuilder/CCMenuItemLoader.h" +#include "cocosbuilder/CCMenuLoader.h" +#include "cocosbuilder/CCNode+CCBRelativePositioning.h" +#include "cocosbuilder/CCNodeLoader.h" +#include "cocosbuilder/CCNodeLoaderLibrary.h" +#include "cocosbuilder/CCNodeLoaderListener.h" +#include "cocosbuilder/CCParticleSystemQuadLoader.h" +#include "cocosbuilder/CCScale9SpriteLoader.h" +#include "cocosbuilder/CCScrollViewLoader.h" +#include "cocosbuilder/CCSpriteLoader.h" + +#endif // __EDITOR_SUPPORT_COCOSBUILDER_H__ diff --git a/cocos/editor-support/cocostudio/Android.mk b/cocos/editor-support/cocostudio/Android.mk new file mode 100644 index 0000000000..b7dfa3838c --- /dev/null +++ b/cocos/editor-support/cocostudio/Android.mk @@ -0,0 +1,64 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := cocostudio_static + +LOCAL_MODULE_FILENAME := libcocostudio + +LOCAL_SRC_FILES := CCActionFrame.cpp \ +CCActionFrameEasing.cpp \ +CCActionManagerEx.cpp \ +CCActionNode.cpp \ +CCActionObject.cpp \ +CCArmature.cpp \ +CCBone.cpp \ +CCArmatureAnimation.cpp \ +CCProcessBase.cpp \ +CCTween.cpp \ +CCDatas.cpp \ +CCBatchNode.cpp \ +CCDecorativeDisplay.cpp \ +CCDisplayFactory.cpp \ +CCDisplayManager.cpp \ +CCSkin.cpp \ +CCColliderDetector.cpp \ +CCArmatureDataManager.cpp \ +CCArmatureDefine.cpp \ +CCDataReaderHelper.cpp \ +CCSpriteFrameCacheHelper.cpp \ +CCTransformHelp.cpp \ +CCTweenFunction.cpp \ +CCUtilMath.cpp \ +CCComAttribute.cpp \ +CCComAudio.cpp \ +CCComController.cpp \ +CCComRender.cpp \ +CCInputDelegate.cpp \ +CSContentJsonDictionary.cpp \ +DictionaryHelper.cpp \ +CCSGUIReader.cpp \ +CCSSceneReader.cpp \ +../../../external/json/json_reader.cpp \ +../../../external/json/json_value.cpp \ +../../../external/json/json_writer.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ +$(LOCAL_PATH)/../../../external/json + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/../../../external/json \ +$(LOCAL_PATH)/.. \ +$(LOCAL_PATH)/../.. \ +$(LOCAL_PATH)/../../../external + +LOCAL_CFLAGS += -Wno-psabi -fexceptions +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,audio/android) + diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.cpp b/cocos/editor-support/cocostudio/CCActionFrame.cpp similarity index 98% rename from cocos/editor-support/cocostudio/action/CCActionFrame.cpp rename to cocos/editor-support/cocostudio/CCActionFrame.cpp index 5973f73196..724ed9a075 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrame.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrame.cpp @@ -24,7 +24,9 @@ #include "CCActionFrame.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { ActionFrame::ActionFrame() : _frameType(0) @@ -222,4 +224,4 @@ Action* ActionTintFrame::getAction(float fDuration) } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionFrame.h b/cocos/editor-support/cocostudio/CCActionFrame.h similarity index 91% rename from cocos/editor-support/cocostudio/action/CCActionFrame.h rename to cocos/editor-support/cocostudio/CCActionFrame.h index 30902a90bf..c928db23cd 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrame.h +++ b/cocos/editor-support/cocostudio/CCActionFrame.h @@ -26,9 +26,8 @@ #define __ActionFRAME_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { enum FrameType { @@ -40,7 +39,7 @@ enum FrameType kKeyframeMax }; -class ActionFrame:public Object +class ActionFrame:public cocos2d::Object { public: @@ -118,7 +117,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: int _frameType; int _easingType; @@ -145,14 +144,14 @@ public: * * @param the move action position. */ - void setPosition(Point pos); + void setPosition(cocos2d::Point pos); /** * Gets the move action position. * * @return the move action position. */ - Point getPosition(); + cocos2d::Point getPosition(); /** * Gets the CCAction of ActionFrame. @@ -161,9 +160,9 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: - Point _position; + cocos2d::Point _position; }; class ActionScaleFrame:public ActionFrame @@ -215,7 +214,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _scaleX; float _scaleY; @@ -256,7 +255,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _rotation; }; @@ -296,7 +295,7 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: float _opacity; }; @@ -321,14 +320,14 @@ public: * * @param ccolor the tint action color */ - void setColor(Color3B ccolor); + void setColor(cocos2d::Color3B ccolor); /** * Gets the tint action color. * * @return the tint action color. */ - Color3B getColor(); + cocos2d::Color3B getColor(); /** * Gets the CCAction of ActionFrame. @@ -337,11 +336,11 @@ public: * * @return CCAction */ - virtual Action* getAction(float fDuration); + virtual cocos2d::Action* getAction(float fDuration); protected: - Color3B _color; + cocos2d::Color3B _color; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp similarity index 97% rename from cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp rename to cocos/editor-support/cocostudio/CCActionFrameEasing.cpp index 8b235160d8..7694b6e53c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.cpp +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp @@ -23,9 +23,9 @@ ****************************************************************************/ #include -#include "CCActionFrameEasing.h" -#include "../Json/DictionaryHelper.h" -NS_CC_EXT_BEGIN +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/DictionaryHelper.h" +namespace cocostudio { #ifndef M_PI_X_2 #define M_PI_X_2 (float)M_PI * 2.0f @@ -186,4 +186,4 @@ float ActionFrameEasing::easeValue(float t) return 0; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h b/cocos/editor-support/cocostudio/CCActionFrameEasing.h similarity index 94% rename from cocos/editor-support/cocostudio/action/CCActionFrameEasing.h rename to cocos/editor-support/cocostudio/CCActionFrameEasing.h index 66c8aaea0f..8e3fa2c1f4 100644 --- a/cocos/editor-support/cocostudio/action/CCActionFrameEasing.h +++ b/cocos/editor-support/cocostudio/CCActionFrameEasing.h @@ -26,10 +26,9 @@ #define __ActionFrameEasing_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../Json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { enum FrameEasingType { @@ -68,6 +67,6 @@ public: float easeValue(float t); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp similarity index 90% rename from cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp rename to cocos/editor-support/cocostudio/CCActionManagerEx.cpp index 3f927c1b84..68c02fed95 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.cpp +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCActionManagerEx.h" -#include "../Json/DictionaryHelper.h" +#include "cocostudio/CCActionManagerEx.h" +#include "cocostudio/DictionaryHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { static ActionManagerEx* sharedActionManager = NULL; @@ -55,7 +57,7 @@ ActionManagerEx::~ActionManagerEx() _pActionDic->release(); } -void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary *dic,Object* root) +void ActionManagerEx::initWithDictionary(const char* jsonName,JsonDictionary *dic,Object* root) { std::string path = jsonName; int pos = path.find_last_of("/"); @@ -66,7 +68,7 @@ void ActionManagerEx::initWithDictionary(const char* jsonName,cs::JsonDictionary for (int i=0; iautorelease(); - cs::JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); + JsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i); action->initWithDictionary(actionDic,root); actionList->addObject(action); CC_SAFE_DELETE(actionDic); @@ -108,4 +110,4 @@ void ActionManagerEx::releaseActions() } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h b/cocos/editor-support/cocostudio/CCActionManagerEx.h similarity index 89% rename from cocos/editor-support/cocostudio/action/CCActionManagerEx.h rename to cocos/editor-support/cocostudio/CCActionManagerEx.h index 21ae504718..09d62b10b6 100644 --- a/cocos/editor-support/cocostudio/action/CCActionManagerEx.h +++ b/cocos/editor-support/cocostudio/CCActionManagerEx.h @@ -26,13 +26,12 @@ #define __ActionMANAGER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "CCActionObject.h" -#include "../Json/CSContentJsonDictionary.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionManagerEx:public Object +class ActionManagerEx:public cocos2d::Object { public: @@ -77,7 +76,7 @@ public: void playActionByName(const char* jsonName,const char* actionName); /*init properties with json dictionay*/ - void initWithDictionary(const char* jsonName,cs::JsonDictionary* dic,Object* root); + void initWithDictionary(const char* jsonName,JsonDictionary* dic,cocos2d::Object* root); /** * Release all actions. @@ -86,9 +85,9 @@ public: void releaseActions(); protected: - Dictionary* _pActionDic; + cocos2d::Dictionary* _pActionDic; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.cpp b/cocos/editor-support/cocostudio/CCActionNode.cpp similarity index 96% rename from cocos/editor-support/cocostudio/action/CCActionNode.cpp rename to cocos/editor-support/cocostudio/CCActionNode.cpp index 31d6e7fe6e..fceca8816c 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.cpp +++ b/cocos/editor-support/cocostudio/CCActionNode.cpp @@ -22,13 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCActionNode.h" -#include "CCActionFrameEasing.h" -#include "../GUI/BaseClasses/UIWidget.h" -#include "../GUI/System/UIHelper.h" -#include "../Json/DictionaryHelper.h" +#include "cocostudio/CCActionNode.h" +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/DictionaryHelper.h" +#include "gui/UIWidget.h" +#include "gui/UIHelper.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace gui; + +namespace cocostudio { ActionNode::ActionNode() : _currentFrameIndex(0) @@ -70,13 +73,13 @@ ActionNode::~ActionNode() } } -void ActionNode::initWithDictionary(cs::JsonDictionary *dic,Object* root) +void ActionNode::initWithDictionary(JsonDictionary *dic,Object* root) { setActionTag(DICTOOL->getIntValue_json(dic, "ActionTag")); int actionFrameCount = DICTOOL->getArrayCount_json(dic, "actionframelist"); for (int i=0; igetDictionaryFromArray_json(dic, "actionframelist", i); + JsonDictionary* actionFrameDic = DICTOOL->getDictionaryFromArray_json(dic, "actionframelist", i); int frameInex = DICTOOL->getIntValue_json(actionFrameDic,"frameid"); bool existPosition = DICTOOL->checkObjectExist_json(actionFrameDic,"positionx"); @@ -477,4 +480,4 @@ void ActionNode::easingToFrame(float duration,float delayTime,ActionFrame* destF cAction->update(delayTime); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionNode.h b/cocos/editor-support/cocostudio/CCActionNode.h similarity index 87% rename from cocos/editor-support/cocostudio/action/CCActionNode.h rename to cocos/editor-support/cocostudio/CCActionNode.h index 377ef603b3..6f38a1a647 100644 --- a/cocos/editor-support/cocostudio/action/CCActionNode.h +++ b/cocos/editor-support/cocostudio/CCActionNode.h @@ -26,13 +26,12 @@ #define __ActionNODE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "CCActionFrame.h" -#include "../Json/CSContentJsonDictionary.h" +#include "cocostudio/CCActionFrame.h" +#include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionNode:public Object +class ActionNode:public cocos2d::Object { public: @@ -77,14 +76,14 @@ public: * * @param node which will run a action */ - void setObject(Object* node); + void setObject(cocos2d::Object* node); /** * Gets node which will run a action. * * @return node which will run a action */ - Object* getObject(); + cocos2d::Object* getObject(); /** * Insets a ActionFrame to ActionNode. @@ -148,7 +147,7 @@ public: virtual void stopAction(); /*init properties with a json dictionary*/ - virtual void initWithDictionary(cs::JsonDictionary* dic,Object* root); + virtual void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root); protected: int _currentFrameIndex; int _destFrameIndex; @@ -156,21 +155,21 @@ protected: float _fUnitTime; int _actionTag; - Spawn * _actionSpawn; - Action* _action; - Object* _object; + cocos2d::Spawn * _actionSpawn; + cocos2d::Action* _action; + cocos2d::Object* _object; - Array* _frameArray; + cocos2d::Array* _frameArray; int _frameArrayNum; protected: - virtual Node* getActionNode(); - virtual Spawn * refreshActionProperty(); + virtual cocos2d::Node* getActionNode(); + virtual cocos2d::Spawn * refreshActionProperty(); virtual void runAction(); - virtual void initActionNodeFromRoot(Object* root); + virtual void initActionNodeFromRoot(cocos2d::Object* root); virtual void easingToFrame(float duration,float delayTime,ActionFrame* destFrame); }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.cpp b/cocos/editor-support/cocostudio/CCActionObject.cpp similarity index 92% rename from cocos/editor-support/cocostudio/action/CCActionObject.cpp rename to cocos/editor-support/cocostudio/CCActionObject.cpp index 3d8ba4f0ea..2dd60c66f2 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.cpp +++ b/cocos/editor-support/cocostudio/CCActionObject.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCActionObject.h" -#include "../Json/DictionaryHelper.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/DictionaryHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace cocostudio { ActionObject::ActionObject() : _actionNodeList(NULL) @@ -94,7 +96,7 @@ bool ActionObject::isPlaying() return _bPlaying; } -void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root) +void ActionObject::initWithDictionary(JsonDictionary *dic,Object* root) { setName(DICTOOL->getStringValue_json(dic, "name")); setLoop(DICTOOL->getBooleanValue_json(dic, "loop")); @@ -103,7 +105,7 @@ void ActionObject::initWithDictionary(cs::JsonDictionary *dic,Object* root) for (int i=0; iautorelease(); - cs::JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i); + JsonDictionary* actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, "actionnodelist", i); actionNode->initWithDictionary(actionNodeDic,root); actionNode->setUnitTime(getUnitTime()); _actionNodeList->addObject(actionNode); @@ -172,4 +174,4 @@ void ActionObject::updateToFrameByTime(float fTime) } } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/action/CCActionObject.h b/cocos/editor-support/cocostudio/CCActionObject.h similarity index 93% rename from cocos/editor-support/cocostudio/action/CCActionObject.h rename to cocos/editor-support/cocostudio/CCActionObject.h index d17f5658b4..cc748eaaa8 100644 --- a/cocos/editor-support/cocostudio/action/CCActionObject.h +++ b/cocos/editor-support/cocostudio/CCActionObject.h @@ -26,13 +26,12 @@ #define __ActionObject_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include "CCActionNode.h" -#include "../Json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { -class ActionObject:public Object +class ActionObject:public cocos2d::Object { public: @@ -142,10 +141,10 @@ public: void updateToFrameByTime(float fTime); /*init properties with a json dictionary*/ - void initWithDictionary(cs::JsonDictionary* dic,Object* root); + void initWithDictionary(JsonDictionary* dic,cocos2d::Object* root); protected: - Array* _actionNodeList;/*actionnode*/ + cocos2d::Array* _actionNodeList;/*actionnode*/ std::string _name; bool _loop; bool _bPause; @@ -154,6 +153,6 @@ protected: float _currentTime; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/CCArmature.cpp rename to cocos/editor-support/cocostudio/CCArmature.cpp index d7817b16b1..5885cbbd25 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -22,12 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmature.h" -#include "utils/CCArmatureDataManager.h" -#include "utils/CCArmatureDefine.h" -#include "utils/CCDataReaderHelper.h" -#include "datas/CCDatas.h" -#include "display/CCSkin.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCSkin.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" @@ -35,8 +35,10 @@ THE SOFTWARE. #include "chipmunk.h" #endif +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN + +namespace cocostudio { Armature *Armature::create() { @@ -788,4 +790,4 @@ cpShape *Armature::getShapeList() #endif -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/CCArmature.h b/cocos/editor-support/cocostudio/CCArmature.h similarity index 85% rename from cocos/editor-support/cocostudio/armature/CCArmature.h rename to cocos/editor-support/cocostudio/CCArmature.h index 204ab34d8a..3e8c521011 100644 --- a/cocos/editor-support/cocostudio/armature/CCArmature.h +++ b/cocos/editor-support/cocostudio/CCArmature.h @@ -25,17 +25,17 @@ THE SOFTWARE. #ifndef __CCARMATURE_H__ #define __CCARMATURE_H__ -#include "utils/CCArmatureDefine.h" -#include "CCBone.h" -#include "display/CCBatchNode.h" -#include "animation/CCArmatureAnimation.h" -#include "utils/CCSpriteFrameCacheHelper.h" -#include "utils/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" class b2Body; struct cpBody; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { CC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase; CC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData; @@ -66,7 +66,7 @@ CC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation; CC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature; CC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager; -class Armature : public NodeRGBA, public BlendProtocol +class Armature : public cocos2d::NodeRGBA, public cocos2d::BlendProtocol { public: @@ -139,12 +139,12 @@ public: * Get Armature's bone dictionary * @return Armature's bone dictionary */ - Dictionary *getBoneDic(); + cocos2d::Dictionary *getBoneDic(); /** * This boundingBox will calculate all bones' boundingBox every time */ - virtual Rect getBoundingBox() const; + virtual cocos2d::Rect getBoundingBox() const; Bone *getBoneAtPoint(float x, float y); @@ -157,10 +157,10 @@ public: virtual void update(float dt) override; virtual void draw() override; - virtual const AffineTransform& getNodeToParentTransform() const override; + virtual const cocos2d::AffineTransform& getNodeToParentTransform() const override; - inline void setBlendFunc(const BlendFunc &blendFunc) override { _blendFunc = blendFunc; } - inline const BlendFunc &getBlendFunc(void) const override{ return _blendFunc; } + inline void setBlendFunc(const cocos2d::BlendFunc &blendFunc) override { _blendFunc = blendFunc; } + inline const cocos2d::BlendFunc &getBlendFunc(void) const override{ return _blendFunc; } /** @@ -195,7 +195,7 @@ protected: CC_SYNTHESIZE(std::string, _name, Name); - CC_SYNTHESIZE(TextureAtlas *, _atlas, TextureAtlas); + CC_SYNTHESIZE(cocos2d::TextureAtlas *, _atlas, TextureAtlas); CC_SYNTHESIZE(Bone *, _parentBone, ParentBone); @@ -204,13 +204,13 @@ protected: protected: mutable bool _armatureTransformDirty; - Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren. + cocos2d::Dictionary *_boneDic; //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren. - Array *_topBoneList; + cocos2d::Array *_topBoneList; - BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance + cocos2d::BlendFunc _blendFunc; //! It's required for CCTextureProtocol inheritance - Point _offsetPoint; + cocos2d::Point _offsetPoint; ArmatureAnimation *_animation; @@ -221,6 +221,6 @@ protected: #endif }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATURE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp rename to cocos/editor-support/cocostudio/CCArmatureAnimation.cpp index 02c0e8d688..a026fc33c9 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp @@ -22,15 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureAnimation.h" -#include "../CCArmature.h" -#include "../CCBone.h" -#include "../utils/CCArmatureDefine.h" -#include "../utils/CCUtilMath.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCDatas.h" + +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { ArmatureAnimation *ArmatureAnimation::create(Armature *armature) { @@ -403,4 +405,4 @@ void ArmatureAnimation::frameEvent(Bone *bone, const char *frameEventName, int o (_frameEventTarget->*_frameEventCallFunc)(bone, frameEventName, originFrameIndex, currentFrameIndex); } } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h b/cocos/editor-support/cocostudio/CCArmatureAnimation.h similarity index 89% rename from cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h rename to cocos/editor-support/cocostudio/CCArmatureAnimation.h index 967878874a..9551f97ff9 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCArmatureAnimation.h +++ b/cocos/editor-support/cocostudio/CCArmatureAnimation.h @@ -26,9 +26,9 @@ THE SOFTWARE. #ifndef __CCANIMATION_H__ #define __CCANIMATION_H__ -#include "CCProcessBase.h" +#include "cocostudio/CCProcessBase.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum MovementEventType @@ -42,11 +42,11 @@ enum MovementEventType class Armature; class Bone; -typedef void (Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *); -typedef void (Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int); +typedef void (cocos2d::Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const char *); +typedef void (cocos2d::Object::*SEL_FrameEventCallFunc)(Bone *, const char *, int, int); -#define movementEvent_selector(_SELECTOR) (SEL_MovementEventCallFunc)(&_SELECTOR) -#define frameEvent_selector(_SELECTOR) (SEL_FrameEventCallFunc)(&_SELECTOR) +#define movementEvent_selector(_SELECTOR) (cocostudio::SEL_MovementEventCallFunc)(&_SELECTOR) +#define frameEvent_selector(_SELECTOR) (cocostudio::SEL_FrameEventCallFunc)(&_SELECTOR) class ArmatureAnimation : public ProcessBase @@ -158,13 +158,13 @@ public: * Set armature's movement event callback function * To disconnect this event, just setMovementEventCallFunc(NULL, NULL); */ - void setMovementEventCallFunc(Object *target, SEL_MovementEventCallFunc callFunc); + void setMovementEventCallFunc(cocos2d::Object *target, SEL_MovementEventCallFunc callFunc); /** * Set armature's frame event callback function * To disconnect this event, just setFrameEventCallFunc(NULL, NULL); */ - void setFrameEventCallFunc(Object *target, SEL_FrameEventCallFunc callFunc); + void setFrameEventCallFunc(cocos2d::Object *target, SEL_FrameEventCallFunc callFunc); protected: @@ -199,7 +199,7 @@ protected: int _toIndex; //! The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex. - Array *_tweenList; + cocos2d::Array *_tweenList; protected: /** @@ -220,10 +220,10 @@ protected: SEL_FrameEventCallFunc _frameEventCallFunc; - Object *_movementEventTarget; - Object *_frameEventTarget; + cocos2d::Object *_movementEventTarget; + cocos2d::Object *_frameEventTarget; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCANIMATION_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp rename to cocos/editor-support/cocostudio/CCArmatureDataManager.cpp index e67f9a72e4..113ff33202 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp @@ -23,13 +23,14 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureDataManager.h" -#include "CCTransformHelp.h" -#include "CCDataReaderHelper.h" -#include "CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { static ArmatureDataManager *s_sharedArmatureDataManager = NULL; @@ -245,4 +246,4 @@ Dictionary *ArmatureDataManager::getTextureDatas() const return _textureDatas; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h b/cocos/editor-support/cocostudio/CCArmatureDataManager.h similarity index 89% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h rename to cocos/editor-support/cocostudio/CCArmatureDataManager.h index 5b7d534d44..1bd426784d 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDataManager.h +++ b/cocos/editor-support/cocostudio/CCArmatureDataManager.h @@ -25,16 +25,16 @@ THE SOFTWARE. #ifndef __CCARMATUREDATAMANAGER_H__ #define __CCARMATUREDATAMANAGER_H__ -#include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /** * @brief format and manage armature configuration and armature animation */ -class ArmatureDataManager : public Object +class ArmatureDataManager : public cocos2d::Object { public: /** @deprecated Use getInstance() instead */ @@ -133,7 +133,7 @@ public: * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. * It will load data in a new thread */ - void addArmatureFileInfoAsync(const char *configFilePath, Object *target, SEL_SCHEDULE selector); + void addArmatureFileInfoAsync(const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); /** * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. @@ -144,7 +144,7 @@ public: * @brief Add ArmatureFileInfo, it is managed by ArmatureDataManager. * It will load data in a new thread */ - void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, Object *target, SEL_SCHEDULE selector); + void addArmatureFileInfoAsync(const char *imagePath, const char *plistPath, const char *configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); /** * @brief Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name @@ -163,35 +163,35 @@ public: bool isAutoLoadSpriteFile(); - Dictionary *getArmatureDatas() const; - Dictionary *getAnimationDatas() const; - Dictionary *getTextureDatas() const; + cocos2d::Dictionary *getArmatureDatas() const; + cocos2d::Dictionary *getAnimationDatas() const; + cocos2d::Dictionary *getTextureDatas() const; private: /** * @brief save amature datas * @key std::string * @value ArmatureData * */ - Dictionary *_armarureDatas; + cocos2d::Dictionary *_armarureDatas; /** * @brief save animation datas * @key std::string * @value AnimationData * */ - Dictionary *_animationDatas; + cocos2d::Dictionary *_animationDatas; /** * @brief save texture datas * @key std::string * @value TextureData * */ - Dictionary *_textureDatas; + cocos2d::Dictionary *_textureDatas; bool _autoLoadSpriteFile; }; -NS_CC_EXT_ARMATURE_END +} #endif/*__CCARMATUREDATAMANAGER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp similarity index 94% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp rename to cocos/editor-support/cocostudio/CCArmatureDefine.cpp index cbd53fe1e0..3672943778 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.cpp +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.cpp @@ -22,13 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { const char *armatureVersion() { return "0.4.0.0"; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h b/cocos/editor-support/cocostudio/CCArmatureDefine.h similarity index 86% rename from cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h rename to cocos/editor-support/cocostudio/CCArmatureDefine.h index fdf82a43c0..8b7cb42312 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCArmatureDefine.h +++ b/cocos/editor-support/cocostudio/CCArmatureDefine.h @@ -27,7 +27,6 @@ THE SOFTWARE. #include "cocos2d.h" -#include "ExtensionMacros.h" #define VERSION_COMBINED 0.30f #define VERSION_CHANGE_ROTATION_RANGE 1.0f @@ -48,14 +47,10 @@ THE SOFTWARE. #define CS_RETURN_IF(cond) if (cond) return #define CS_RETURN_NULL_IF(cond) if (cond) return NULL; -#define NS_CC_EXT_ARMATURE_BEGIN namespace cocos2d { namespace extension { namespace armature { -#define NS_CC_EXT_ARMATURE_END }}} -#define USING_NS_CC_EXT_ARMATURE using namespace cocos2d::extension::armature - -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { const char *armatureVersion(); -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATUREDEFINE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp b/cocos/editor-support/cocostudio/CCBatchNode.cpp similarity index 94% rename from cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp rename to cocos/editor-support/cocostudio/CCBatchNode.cpp index 16dd1b449b..0c6f7598ae 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.cpp +++ b/cocos/editor-support/cocostudio/CCBatchNode.cpp @@ -22,11 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCBatchNode.h" -#include "../utils/CCArmatureDefine.h" -#include "../CCArmature.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCArmature.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { BatchNode *BatchNode::create() { @@ -117,4 +119,4 @@ void BatchNode::draw() } } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h b/cocos/editor-support/cocostudio/CCBatchNode.h similarity index 87% rename from cocos/editor-support/cocostudio/armature/display/CCBatchNode.h rename to cocos/editor-support/cocostudio/CCBatchNode.h index b79fc97d5d..df33e44e0b 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCBatchNode.h +++ b/cocos/editor-support/cocostudio/CCBatchNode.h @@ -25,11 +25,11 @@ THE SOFTWARE. #ifndef __CCBATCHNODE_H__ #define __CCBATCHNODE_H__ -#include "../utils/CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class BatchNode : public Node +class BatchNode : public cocos2d::Node { public: static BatchNode *create(); @@ -40,14 +40,14 @@ public: BatchNode(); virtual bool init(); - virtual void addChild(Node *child, int zOrder, int tag); + virtual void addChild(cocos2d::Node *child, int zOrder, int tag); virtual void visit(); void draw(); protected: - TextureAtlas *_atlas; + cocos2d::TextureAtlas *_atlas; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCBATCHNODE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/CCBone.cpp rename to cocos/editor-support/cocostudio/CCBone.cpp index e6063e51c3..abd0cb85a5 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -22,14 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCBone.h" -#include "CCArmature.h" -#include "utils/CCUtilMath.h" -#include "utils/CCArmatureDataManager.h" -#include "utils/CCTransformHelp.h" -#include "display/CCDisplayManager.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCDisplayManager.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { Bone *Bone::create() { @@ -373,4 +375,4 @@ Array *Bone::getColliderBodyList() } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/CCBone.h b/cocos/editor-support/cocostudio/CCBone.h similarity index 90% rename from cocos/editor-support/cocostudio/armature/CCBone.h rename to cocos/editor-support/cocostudio/CCBone.h index 9f979e616a..1163738515 100644 --- a/cocos/editor-support/cocostudio/armature/CCBone.h +++ b/cocos/editor-support/cocostudio/CCBone.h @@ -25,18 +25,18 @@ THE SOFTWARE. #ifndef __CCBONE_H__ #define __CCBONE_H__ -#include "utils/CCArmatureDefine.h" -#include "datas/CCDatas.h" -#include "animation/CCTween.h" -#include "display/CCDecorativeDisplay.h" -#include "display/CCDisplayManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDisplayManager.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Armature; -class Bone : public NodeRGBA +class Bone : public cocos2d::NodeRGBA { public: /** @@ -84,7 +84,7 @@ public: */ void addDisplay(DisplayData *displayData, int index); - void addDisplay(Node *display, int index); + void addDisplay(cocos2d::Node *display, int index); void changeDisplayByIndex(int index, bool force); @@ -124,7 +124,7 @@ public: void update(float delta); - void updateDisplayedColor(const Color3B &parentColor); + void updateDisplayedColor(const cocos2d::Color3B &parentColor); void updateDisplayedOpacity(GLubyte parentOpacity); //! Update color to render display @@ -144,15 +144,15 @@ public: virtual bool isTransformDirty(); - virtual AffineTransform getNodeToArmatureTransform() const; - virtual AffineTransform getNodeToWorldTransform() const override; + virtual cocos2d::AffineTransform getNodeToArmatureTransform() const; + virtual cocos2d::AffineTransform getNodeToWorldTransform() const override; Node *getDisplayRenderNode(); /* * Get the ColliderBody list in this bone. The object in the Array is ColliderBody. */ - virtual Array *getColliderBodyList(); + virtual cocos2d::Array *getColliderBodyList(); public: /* @@ -188,9 +188,9 @@ protected: bool _boneTransformDirty; //! Whether or not transform dirty //! self Transform, use this to change display's state - AffineTransform _worldTransform; + cocos2d::AffineTransform _worldTransform; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCBONE_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp b/cocos/editor-support/cocostudio/CCColliderDetector.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp rename to cocos/editor-support/cocostudio/CCColliderDetector.cpp index 798a9b83b5..0839a30d7a 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.cpp +++ b/cocos/editor-support/cocostudio/CCColliderDetector.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCColliderDetector.h" -#include "../CCBone.h" -#include "../utils/CCTransformHelp.h" +#include "cocostudio/CCColliderDetector.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCTransformHelp.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" @@ -32,8 +32,9 @@ THE SOFTWARE. #include "chipmunk.h" #endif +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { #if ENABLE_PHYSICS_BOX2D_DETECT @@ -393,4 +394,4 @@ cpBody *ColliderDetector::getBody() #endif -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h b/cocos/editor-support/cocostudio/CCColliderDetector.h similarity index 87% rename from cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h rename to cocos/editor-support/cocostudio/CCColliderDetector.h index 63990d3bf9..4f6fbeebfe 100644 --- a/cocos/editor-support/cocostudio/armature/physics/CCColliderDetector.h +++ b/cocos/editor-support/cocostudio/CCColliderDetector.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCCOLLIDERDETECTOR_H__ #define __CCCOLLIDERDETECTOR_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" #ifndef PT_RATIO #define PT_RATIO 32 @@ -40,11 +40,11 @@ struct b2Filter; struct cpBody; struct cpShape; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; -class ColliderBody : public Object +class ColliderBody : public cocos2d::Object { public: #if ENABLE_PHYSICS_BOX2D_DETECT @@ -70,7 +70,7 @@ private: /* * @brief ContourSprite used to draw the contour of the display */ -class ColliderDetector : public Object +class ColliderDetector : public cocos2d::Object { public: static ColliderDetector *create(); @@ -90,20 +90,20 @@ public: virtual bool init(Bone *bone); void addContourData(ContourData *contourData); - void addContourDataList(Array *contourDataList); + void addContourDataList(cocos2d::Array *contourDataList); void removeContourData(ContourData *contourData); void removeAll(); - void updateTransform(AffineTransform &t); + void updateTransform(cocos2d::AffineTransform &t); void setActive(bool active); bool getActive(); - Array *getColliderBodyList(); + cocos2d::Array *getColliderBodyList(); protected: - Array *_colliderBodyList; + cocos2d::Array *_colliderBodyList; CC_SYNTHESIZE(Bone *, _bone, Bone); #if ENABLE_PHYSICS_BOX2D_DETECT @@ -116,6 +116,6 @@ protected: bool _active; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCCOLLIDERDETECTOR_H__*/ diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp b/cocos/editor-support/cocostudio/CCComAttribute.cpp similarity index 96% rename from cocos/editor-support/cocostudio/components/CCComAttribute.cpp rename to cocos/editor-support/cocostudio/CCComAttribute.cpp index 30505ab486..f3e57eddbc 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.cpp +++ b/cocos/editor-support/cocostudio/CCComAttribute.cpp @@ -22,9 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComAttribute.h" +#include "cocostudio/CCComAttribute.h" +using namespace cocos2d; -NS_CC_EXT_BEGIN +namespace cocostudio { ComAttribute::ComAttribute(void) : _attributes(NULL) @@ -44,7 +45,7 @@ bool ComAttribute::init() _attributes = Dictionary::create(); _attributes->retain(); - _jsonDict = new cs::JsonDictionary(); + _jsonDict = new JsonDictionary(); return true; } @@ -184,9 +185,9 @@ Object* ComAttribute::getObject(const char *key) const return _attributes->objectForKey(key); } -cs::JsonDictionary* ComAttribute::getDict() const +JsonDictionary* ComAttribute::getDict() const { return _jsonDict; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComAttribute.h b/cocos/editor-support/cocostudio/CCComAttribute.h similarity index 89% rename from cocos/editor-support/cocostudio/components/CCComAttribute.h rename to cocos/editor-support/cocostudio/CCComAttribute.h index 78d9828f85..53c7c2c885 100644 --- a/cocos/editor-support/cocostudio/components/CCComAttribute.h +++ b/cocos/editor-support/cocostudio/CCComAttribute.h @@ -26,11 +26,10 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" #include -#include "../Json/CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComAttribute : public cocos2d::Component { @@ -61,15 +60,15 @@ public: float getFloat(const char *key) const; bool getBool(const char *key) const; const char* getCString(const char *key) const; - Object* getObject(const char *key) const; + cocos2d::Object* getObject(const char *key) const; - cs::JsonDictionary* getDict() const; + JsonDictionary* getDict() const; private: - Dictionary *_attributes; - cs::JsonDictionary *_jsonDict; + cocos2d::Dictionary *_attributes; + JsonDictionary *_jsonDict; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.cpp b/cocos/editor-support/cocostudio/CCComAudio.cpp similarity index 98% rename from cocos/editor-support/cocostudio/components/CCComAudio.cpp rename to cocos/editor-support/cocostudio/CCComAudio.cpp index 87afa64348..76ac167ba7 100644 --- a/cocos/editor-support/cocostudio/components/CCComAudio.cpp +++ b/cocos/editor-support/cocostudio/CCComAudio.cpp @@ -22,10 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComAudio.h" +#include "cocostudio/CCComAudio.h" #include "SimpleAudioEngine.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComAudio::ComAudio(void) : _filePath("") @@ -223,4 +223,4 @@ bool ComAudio::isLoop() return _loop; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComAudio.h b/cocos/editor-support/cocostudio/CCComAudio.h similarity index 98% rename from cocos/editor-support/cocostudio/components/CCComAudio.h rename to cocos/editor-support/cocostudio/CCComAudio.h index 259227462f..0968a3d76b 100644 --- a/cocos/editor-support/cocostudio/components/CCComAudio.h +++ b/cocos/editor-support/cocostudio/CCComAudio.h @@ -26,9 +26,8 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMAUDIO_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComAudio : public cocos2d::Component { @@ -95,6 +94,6 @@ private: bool _loop; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComController.cpp b/cocos/editor-support/cocostudio/CCComController.cpp similarity index 96% rename from cocos/editor-support/cocostudio/components/CCComController.cpp rename to cocos/editor-support/cocostudio/CCComController.cpp index 5213927f4e..bf57a8724a 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.cpp +++ b/cocos/editor-support/cocostudio/CCComController.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComController.h" +#include "cocostudio/CCComController.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComController::ComController(void) { @@ -76,4 +76,4 @@ ComController* ComController::create(void) return pRet; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComController.h b/cocos/editor-support/cocostudio/CCComController.h similarity index 96% rename from cocos/editor-support/cocostudio/components/CCComController.h rename to cocos/editor-support/cocostudio/CCComController.h index 7122fb190c..00da3fa74f 100644 --- a/cocos/editor-support/cocostudio/components/CCComController.h +++ b/cocos/editor-support/cocostudio/CCComController.h @@ -26,9 +26,9 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMCONTROLLER_H__ #include "cocos2d.h" -#include "CCInputDelegate.h" +#include "cocostudio/CCInputDelegate.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComController : public cocos2d::Component, public InputDelegate { @@ -59,6 +59,6 @@ public: static ComController* create(void); }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/components/CCComRender.cpp b/cocos/editor-support/cocostudio/CCComRender.cpp similarity index 96% rename from cocos/editor-support/cocostudio/components/CCComRender.cpp rename to cocos/editor-support/cocostudio/CCComRender.cpp index 4dbc18c464..95465444ea 100644 --- a/cocos/editor-support/cocostudio/components/CCComRender.cpp +++ b/cocos/editor-support/cocostudio/CCComRender.cpp @@ -22,9 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCComRender.h" +#include "cocostudio/CCComRender.h" -NS_CC_EXT_BEGIN +namespace cocostudio { ComRender::ComRender(void) : _render(NULL) @@ -76,4 +76,4 @@ ComRender* ComRender::create(cocos2d::Node *pNode, const char *comName) return pRet; } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/components/CCComRender.h b/cocos/editor-support/cocostudio/CCComRender.h similarity index 95% rename from cocos/editor-support/cocostudio/components/CCComRender.h rename to cocos/editor-support/cocostudio/CCComRender.h index cf98c4c3f8..08c9eff8d9 100644 --- a/cocos/editor-support/cocostudio/components/CCComRender.h +++ b/cocos/editor-support/cocostudio/CCComRender.h @@ -26,10 +26,8 @@ THE SOFTWARE. #define __CC_EXTENTIONS_CCCOMNODE_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class ComRender : public cocos2d::Component { @@ -61,5 +59,5 @@ private: cocos2d::Node *_render; }; -NS_CC_EXT_END +} #endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp similarity index 95% rename from cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp rename to cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 563526570c..4749f5eaf9 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -22,13 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "support/tinyxml2/tinyxml2.h" -#include "CCDataReaderHelper.h" -#include "CCArmatureDataManager.h" -#include "CCTransformHelp.h" -#include "CCUtilMath.h" -#include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "tinyxml2.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" + +using namespace cocos2d; static const char *VERSION = "version"; @@ -133,7 +135,7 @@ static const char *COLOR_INFO = "color"; static const char *CONFIG_FILE_PATH = "config_file_path"; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { std::vector s_arrConfigFileList; @@ -1118,14 +1120,14 @@ ContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML) void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo) { - cs::JsonDictionary json; + JsonDictionary json; json.initWithDescription(fileContent); // Decode armatures int length = json.getArrayItemCount(ARMATURE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); + JsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i); ArmatureData *armatureData = decodeArmature(*armatureDic); if (dataInfo) @@ -1145,7 +1147,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d length = json.getArrayItemCount(ANIMATION_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); + JsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i); AnimationData *animationData = decodeAnimation(*animationDic); if (dataInfo) @@ -1165,7 +1167,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d length = json.getArrayItemCount(TEXTURE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); + JsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i); TextureData *textureData = decodeTexture(*textureDic); if (dataInfo) @@ -1213,7 +1215,7 @@ void DataReaderHelper::addDataFromJsonCache(const char *fileContent, DataInfo *d } } -ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) +ArmatureData *DataReaderHelper::decodeArmature(JsonDictionary &json) { ArmatureData *armatureData = new ArmatureData(); armatureData->init(); @@ -1229,7 +1231,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) int length = json.getArrayItemCount(BONE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(BONE_DATA, i); BoneData *boneData = decodeBone(*dic); armatureData->addBoneData(boneData); boneData->release(); @@ -1240,7 +1242,7 @@ ArmatureData *DataReaderHelper::decodeArmature(cs::JsonDictionary &json) return armatureData; } -BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) +BoneData *DataReaderHelper::decodeBone(JsonDictionary &json) { BoneData *boneData = new BoneData(); boneData->init(); @@ -1263,7 +1265,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(DISPLAY_DATA, i); DisplayData *displayData = decodeBoneDisplay(*dic); boneData->addDisplayData(displayData); displayData->release(); @@ -1274,7 +1276,7 @@ BoneData *DataReaderHelper::decodeBone(cs::JsonDictionary &json) return boneData; } -DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) +DisplayData *DataReaderHelper::decodeBoneDisplay(JsonDictionary &json) { DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE); @@ -1292,7 +1294,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) ((SpriteDisplayData *)displayData)->displayName = name; } - cs::JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0); + JsonDictionary *dic = json.getSubItemFromArray(SKIN_DATA, 0); if (dic != NULL) { SpriteDisplayData *sdd = (SpriteDisplayData *)displayData; @@ -1341,7 +1343,7 @@ DisplayData *DataReaderHelper::decodeBoneDisplay(cs::JsonDictionary &json) return displayData; } -AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) +AnimationData *DataReaderHelper::decodeAnimation(JsonDictionary &json) { AnimationData *aniData = new AnimationData(); @@ -1355,7 +1357,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_DATA, i); MovementData *movementData = decodeMovement(*dic); aniData->addMovement(movementData); movementData->release(); @@ -1366,7 +1368,7 @@ AnimationData *DataReaderHelper::decodeAnimation(cs::JsonDictionary &json) return aniData; } -MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) +MovementData *DataReaderHelper::decodeMovement(JsonDictionary &json) { MovementData *movementData = new MovementData(); @@ -1386,7 +1388,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) int length = json.getArrayItemCount(MOVEMENT_BONE_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(MOVEMENT_BONE_DATA, i); MovementBoneData *movementBoneData = decodeMovementBone(*dic); movementData->addMovementBoneData(movementBoneData); movementBoneData->release(); @@ -1397,7 +1399,7 @@ MovementData *DataReaderHelper::decodeMovement(cs::JsonDictionary &json) return movementData; } -MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) +MovementBoneData *DataReaderHelper::decodeMovementBone(JsonDictionary &json) { MovementBoneData *movementBoneData = new MovementBoneData(); movementBoneData->init(); @@ -1413,7 +1415,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) int length = json.getArrayItemCount(FRAME_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i); FrameData *frameData = decodeFrame(*dic); movementBoneData->addFrameData(frameData); @@ -1469,7 +1471,7 @@ MovementBoneData *DataReaderHelper::decodeMovementBone(cs::JsonDictionary &json) return movementBoneData; } -FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json) +FrameData *DataReaderHelper::decodeFrame(JsonDictionary &json) { FrameData *frameData = new FrameData(); @@ -1498,7 +1500,7 @@ FrameData *DataReaderHelper::decodeFrame(cs::JsonDictionary &json) return frameData; } -TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) +TextureData *DataReaderHelper::decodeTexture(JsonDictionary &json) { TextureData *textureData = new TextureData(); textureData->init(); @@ -1517,7 +1519,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) int length = json.getArrayItemCount(CONTOUR_DATA); for (int i = 0; i < length; i++) { - cs::JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); + JsonDictionary *dic = json.getSubItemFromArray(CONTOUR_DATA, i); ContourData *contourData = decodeContour(*dic); textureData->contourDataList.addObject(contourData); contourData->release(); @@ -1528,7 +1530,7 @@ TextureData *DataReaderHelper::decodeTexture(cs::JsonDictionary &json) return textureData; } -ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) +ContourData *DataReaderHelper::decodeContour(JsonDictionary &json) { ContourData *contourData = new ContourData(); contourData->init(); @@ -1536,7 +1538,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) int length = json.getArrayItemCount(VERTEX_POINT); for (int i = length - 1; i >= 0; i--) { - cs::JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); + JsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i); ContourVertex2 *vertex = new ContourVertex2(0, 0); @@ -1552,7 +1554,7 @@ ContourData *DataReaderHelper::decodeContour(cs::JsonDictionary &json) return contourData; } -void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) +void DataReaderHelper::decodeNode(BaseData *node, JsonDictionary &json) { node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale; node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale; @@ -1563,7 +1565,7 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) node->scaleX = json.getItemFloatValue(A_SCALE_X, 1); node->scaleY = json.getItemFloatValue(A_SCALE_Y, 1); - cs::JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); + JsonDictionary *colorDic = json.getSubItemFromArray(COLOR_INFO, 0); if (colorDic) { @@ -1579,4 +1581,4 @@ void DataReaderHelper::decodeNode(BaseData *node, cs::JsonDictionary &json) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h b/cocos/editor-support/cocostudio/CCDataReaderHelper.h similarity index 82% rename from cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h rename to cocos/editor-support/cocostudio/CCDataReaderHelper.h index 2389245c20..d5c8a0d6f5 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCDataReaderHelper.h +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCDATAREADERHELPER_H__ #define __CCDATAREADERHELPER_H__ -#include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" -#include "../CCArmature.h" -#include "../../Json/CSContentJsonDictionary.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CSContentJsonDictionary.h" #include #include @@ -41,10 +41,10 @@ namespace tinyxml2 class XMLElement; } -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class DataReaderHelper : Object +class DataReaderHelper : cocos2d::Object { protected: @@ -60,8 +60,8 @@ protected: std::string fileContent; ConfigType configType; std::string baseFilePath; - Object *target; - SEL_SCHEDULE selector; + cocos2d::Object *target; + cocos2d::SEL_SCHEDULE selector; bool autoLoadSpriteFile; } AsyncStruct; @@ -99,7 +99,7 @@ public: ~DataReaderHelper(); void addDataFromFile(const char *filePath); - void addDataFromFileAsync(const char *filePath, Object *target, SEL_SCHEDULE selector); + void addDataFromFileAsync(const char *filePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector); void addDataAsyncCallBack(float dt); @@ -145,20 +145,20 @@ public: public: static void addDataFromJsonCache(const char *fileContent, DataInfo *dataInfo = NULL); - static ArmatureData *decodeArmature(cs::JsonDictionary &json); - static BoneData *decodeBone(cs::JsonDictionary &json); - static DisplayData *decodeBoneDisplay(cs::JsonDictionary &json); + static ArmatureData *decodeArmature(JsonDictionary &json); + static BoneData *decodeBone(JsonDictionary &json); + static DisplayData *decodeBoneDisplay(JsonDictionary &json); - static AnimationData *decodeAnimation(cs::JsonDictionary &json); - static MovementData *decodeMovement(cs::JsonDictionary &json); - static MovementBoneData *decodeMovementBone(cs::JsonDictionary &json); - static FrameData *decodeFrame(cs::JsonDictionary &json); + static AnimationData *decodeAnimation(JsonDictionary &json); + static MovementData *decodeMovement(JsonDictionary &json); + static MovementBoneData *decodeMovementBone(JsonDictionary &json); + static FrameData *decodeFrame(JsonDictionary &json); - static TextureData *decodeTexture(cs::JsonDictionary &json); + static TextureData *decodeTexture(JsonDictionary &json); - static ContourData *decodeContour(cs::JsonDictionary &json); + static ContourData *decodeContour(JsonDictionary &json); - static void decodeNode(BaseData *node, cs::JsonDictionary &json); + static void decodeNode(BaseData *node, JsonDictionary &json); protected: void loadData(); @@ -190,6 +190,6 @@ protected: static DataReaderHelper *_dataReaderHelper; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDATAREADERHELPER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp b/cocos/editor-support/cocostudio/CCDatas.cpp similarity index 98% rename from cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp rename to cocos/editor-support/cocostudio/CCDatas.cpp index 38c31db4b7..35d6461efc 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.cpp +++ b/cocos/editor-support/cocostudio/CCDatas.cpp @@ -22,11 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDatas.h" -#include "../utils/CCUtilMath.h" -#include "../utils/CCTransformHelp.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { BaseData::BaseData() @@ -425,4 +427,4 @@ ContourData *TextureData::getContourData(int index) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h b/cocos/editor-support/cocostudio/CCDatas.h similarity index 91% rename from cocos/editor-support/cocostudio/armature/datas/CCDatas.h rename to cocos/editor-support/cocostudio/CCDatas.h index be2b67e45c..26128020cf 100644 --- a/cocos/editor-support/cocostudio/armature/datas/CCDatas.h +++ b/cocos/editor-support/cocostudio/CCDatas.h @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef __CCARMATURE_DATAS_H__ #define __CCARMATURE_DATAS_H__ -#include "../utils/CCArmatureDefine.h" -#include "../utils/CCTweenFunction.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCTweenFunction.h" #define CC_CREATE_NO_PARAM_NO_INIT(varType)\ @@ -55,12 +55,12 @@ public: \ return NULL;\ } -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /** * The base node include a lot of attributes. */ -class BaseData : public Object +class BaseData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(BaseData) @@ -89,8 +89,8 @@ public: */ virtual void subtract(BaseData *from, BaseData *to, bool limit); - virtual void setColor(const Color4B &color); - virtual Color4B getColor(); + virtual void setColor(const cocos2d::Color4B &color); + virtual cocos2d::Color4B getColor(); public: float x; //! position x attribute float y; //! position y attribute @@ -126,7 +126,7 @@ enum DisplayType CS_DISPLAY_MAX }; -class DisplayData : public Object +class DisplayData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(DisplayData) @@ -269,8 +269,8 @@ public: public: std::string name; //! the bone's name std::string parentName; //! the bone parent's name - Array displayDataList; //! save DisplayData informations for the Bone - AffineTransform boneDataTransform; + cocos2d::Array displayDataList; //! save DisplayData informations for the Bone + cocos2d::AffineTransform boneDataTransform; }; @@ -279,7 +279,7 @@ public: * When we create a Armature, we need to get each Bone's BoneData as it's init information. * So we can get a BoneData from the Dictionary saved in the ArmatureData. */ -class ArmatureData : public Object +class ArmatureData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(ArmatureData) @@ -299,7 +299,7 @@ public: BoneData *getBoneData(const char *boneName); public: std::string name; - Dictionary boneDataDic; + cocos2d::Dictionary boneDataDic; float dataVersion; }; @@ -362,7 +362,7 @@ public: }; -class MovementBoneData : public Object +class MovementBoneData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(MovementBoneData) @@ -387,11 +387,11 @@ public: float duration; //! this Bone in this movement will last m_iDuration frames std::string name; //! bone name - Array frameList; + cocos2d::Array frameList; }; -class MovementData : public Object +class MovementData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(MovementData) @@ -442,7 +442,7 @@ public: * @key const char * * @value MovementBoneData * */ - Dictionary movBoneDataDic; + cocos2d::Dictionary movBoneDataDic; }; @@ -451,7 +451,7 @@ public: * The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData * -> MovementFrameData */ -class AnimationData : public Object +class AnimationData : public cocos2d::Object { public: CC_CREATE_NO_PARAM_NO_INIT(AnimationData) @@ -471,12 +471,12 @@ public: int getMovementCount(); public: std::string name; - Dictionary movementDataDic; + cocos2d::Dictionary movementDataDic; std::vector movementNames; }; -struct ContourVertex2 : public Object +struct ContourVertex2 : public cocos2d::Object { ContourVertex2(float x, float y) { @@ -491,7 +491,7 @@ struct ContourVertex2 : public Object /* * ContourData include a contour vertex information */ -class ContourData : public Object +class ContourData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(ContourData) @@ -507,9 +507,9 @@ public: ~ContourData(void); virtual bool init(); - virtual void addVertex(Point *vertex); + virtual void addVertex(cocos2d::Point *vertex); public: - Array vertexList; //! Save contour vertex info, vertex saved in a Point + cocos2d::Array vertexList; //! Save contour vertex info, vertex saved in a Point }; @@ -518,7 +518,7 @@ public: /* * TextureData include a texture's information */ -class TextureData : public Object +class TextureData : public cocos2d::Object { public: CC_CREATE_NO_PARAM(TextureData) @@ -547,10 +547,10 @@ public: std::string name; //! The texture's name - Array contourDataList; + cocos2d::Array contourDataList; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCARMATURE_DATAS_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp similarity index 95% rename from cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp rename to cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp index d92fef659b..e595ecbe0c 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.cpp +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp @@ -22,9 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDecorativeDisplay.h" +#include "cocostudio/CCDecorativeDisplay.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { DecorativeDisplay *DecorativeDisplay::create() { @@ -64,4 +66,4 @@ bool DecorativeDisplay::init() return true; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h similarity index 86% rename from cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h rename to cocos/editor-support/cocostudio/CCDecorativeDisplay.h index 2b08dce2a8..7196d0e9ec 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDecorativeDisplay.h +++ b/cocos/editor-support/cocostudio/CCDecorativeDisplay.h @@ -25,18 +25,18 @@ THE SOFTWARE. #ifndef __CCDECORATIVEDISPLAY_H__ #define __CCDECORATIVEDISPLAY_H__ -#include "../utils/CCArmatureDefine.h" -#include "CCDisplayFactory.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCDatas.h" #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT -#include "../physics/CCColliderDetector.h" +#include "cocostudio/CCColliderDetector.h" #endif -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class DecorativeDisplay: public Object +class DecorativeDisplay: public cocos2d::Object { public: static DecorativeDisplay *create(); @@ -55,7 +55,7 @@ public: protected: - CC_SYNTHESIZE_RETAIN(Node *, _display, Display); + CC_SYNTHESIZE_RETAIN(cocos2d::Node *, _display, Display); CC_SYNTHESIZE_RETAIN(DisplayData *, _displayData, DisplayData); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT @@ -63,6 +63,6 @@ protected: #endif }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDECORATIVEDISPLAY_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp rename to cocos/editor-support/cocostudio/CCDisplayFactory.cpp index 4cef6fad53..034f115481 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.cpp @@ -22,15 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDisplayFactory.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../display/CCSkin.h" -#include "../utils/CCSpriteFrameCacheHelper.h" -#include "../utils/CCArmatureDataManager.h" -#include "../utils/CCTransformHelp.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { void DisplayFactory::addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData) { @@ -272,4 +274,4 @@ void DisplayFactory::updateParticleDisplay(Bone *bone, Node *display, float dt, } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h b/cocos/editor-support/cocostudio/CCDisplayFactory.h similarity index 86% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h rename to cocos/editor-support/cocostudio/CCDisplayFactory.h index 6df1fff7bb..3ef0725ff0 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayFactory.h +++ b/cocos/editor-support/cocostudio/CCDisplayFactory.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCDISPLAYFACTORY_H__ #define __CCDISPLAYFACTORY_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Skin; class Bone; @@ -45,19 +45,19 @@ public: static void addSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay); static void initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, const char *displayName, Skin *skin); - static void updateSpriteDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateSpriteDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); static void addArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay); - static void updateArmatureDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateArmatureDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); static void addParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData); static void createParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay); - static void updateParticleDisplay(Bone *bone, Node *display, float dt, bool dirty); + static void updateParticleDisplay(Bone *bone, cocos2d::Node *display, float dt, bool dirty); }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDISPLAYFACTORY_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp b/cocos/editor-support/cocostudio/CCDisplayManager.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp rename to cocos/editor-support/cocostudio/CCDisplayManager.cpp index a0c89f45cd..b7d337e3a9 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.cpp +++ b/cocos/editor-support/cocostudio/CCDisplayManager.cpp @@ -22,13 +22,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCDisplayManager.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../utils/CCUtilMath.h" -#include "../display/CCSkin.h" +#include "cocostudio/CCDisplayManager.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCSkin.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { DisplayManager *DisplayManager::create(Bone *bone) { @@ -392,4 +394,4 @@ Point DisplayManager::getAnchorPointInPoints() } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h b/cocos/editor-support/cocostudio/CCDisplayManager.h similarity index 87% rename from cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h rename to cocos/editor-support/cocostudio/CCDisplayManager.h index 94933f96b5..9953d77995 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCDisplayManager.h +++ b/cocos/editor-support/cocostudio/CCDisplayManager.h @@ -25,16 +25,16 @@ THE SOFTWARE. #ifndef __CCDISPLAYMANAGER_H__ #define __CCDISPLAYMANAGER_H__ -#include "../utils/CCArmatureDefine.h" -#include "../display/CCDecorativeDisplay.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; //! DisplayManager manages Bone's display -class DisplayManager : public Object +class DisplayManager : public cocos2d::Object { public: static DisplayManager *create(Bone *bone); @@ -72,11 +72,11 @@ public: */ void addDisplay(DisplayData *displayData, int index); - void addDisplay(Node *display, int index); + void addDisplay(cocos2d::Node *display, int index); void removeDisplay(int index); - Array *getDecorativeDisplayList(); + cocos2d::Array *getDecorativeDisplayList(); /** * Change display by index. You can just use this method to change display in the display list. @@ -90,7 +90,7 @@ public: void changeDisplayByIndex(int index, bool force); - Node *getDisplayRenderNode(); + cocos2d::Node *getDisplayRenderNode(); int getCurrentDisplayIndex(); @@ -113,16 +113,16 @@ public: */ virtual bool isVisible(); - Size getContentSize(); - Rect getBoundingBox(); + cocos2d::Size getContentSize(); + cocos2d::Rect getBoundingBox(); - Point getAnchorPoint(); - Point getAnchorPointInPoints(); + cocos2d::Point getAnchorPoint(); + cocos2d::Point getAnchorPointInPoints(); /** * Check if the position is inside the bone. */ - virtual bool containPoint(Point &_point); + virtual bool containPoint(cocos2d::Point &_point); /** * Check if the position is inside the bone. @@ -130,9 +130,9 @@ public: virtual bool containPoint(float x, float y); protected: - Array *_decoDisplayList; + cocos2d::Array *_decoDisplayList; //! Display render node. - Node *_displayRenderNode; + cocos2d::Node *_displayRenderNode; //! Include current display information, like contour sprite, etc. DecorativeDisplay *_currentDecoDisplay; //! Current display index @@ -146,6 +146,6 @@ protected: Bone *_bone; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCDISPLAYMANAGER_H__*/ diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp b/cocos/editor-support/cocostudio/CCInputDelegate.cpp similarity index 98% rename from cocos/editor-support/cocostudio/components/CCInputDelegate.cpp rename to cocos/editor-support/cocostudio/CCInputDelegate.cpp index 84694e0619..9f4fd46a8d 100644 --- a/cocos/editor-support/cocostudio/components/CCInputDelegate.cpp +++ b/cocos/editor-support/cocostudio/CCInputDelegate.cpp @@ -22,9 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCInputDelegate.h" +#include "cocostudio/CCInputDelegate.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace cocostudio { InputDelegate::InputDelegate(void) : _touchEnabled(false) @@ -228,4 +230,4 @@ void InputDelegate::setKeypadEnabled(bool enabled) } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/CCInputDelegate.h b/cocos/editor-support/cocostudio/CCInputDelegate.h new file mode 100644 index 0000000000..12d9f50041 --- /dev/null +++ b/cocos/editor-support/cocostudio/CCInputDelegate.h @@ -0,0 +1,138 @@ +/**************************************************************************** +Copyright (c) 2013 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ +#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ + +#include "cocos2d.h" + +namespace cocostudio { + +class InputDelegate +{ +protected: + /** + * @js NA + * @lua NA + */ + InputDelegate(void); + /** + * @js NA + * @lua NA + */ + virtual ~InputDelegate(void); + +public: + /** + * @js NA + * @lua NA + */ + virtual bool isTouchEnabled() const; + /** + * @js NA + * @lua NA + */ + virtual void setTouchEnabled(bool value); + /** + * @js NA + * @lua NA + */ + virtual bool isAccelerometerEnabled() const; + /** + * @js NA + * @lua NA + */ + virtual void setAccelerometerEnabled(bool value); + /** + * @js NA + * @lua NA + */ + virtual bool isKeypadEnabled() const; + /** + * @js NA + * @lua NA + */ + virtual void setKeypadEnabled(bool value); + /** + * @js NA + * @lua NA + */ + virtual void setTouchMode(cocos2d::Touch::DispatchMode mode); + /** + * @js NA + * @lua NA + */ + virtual cocos2d::Touch::DispatchMode getTouchMode() const; + /** + * @js NA + * @lua NA + */ + virtual void setTouchPriority(int priority); + /** + * @js NA + * @lua NA + */ + virtual int getTouchPriority() const; + /** @deprecated Please override onAcceleration */ + CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(cocos2d::Acceleration* accelerationValue) final { CC_UNUSED_PARAM(accelerationValue); }; + // Deprecated touch callbacks. + CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} + + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} + + virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event) {}; + + virtual void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {}; + virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {}; + + virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event); + virtual void onTouchesBegan(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesMoved(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesEnded(const std::vector& touches, cocos2d::Event *event); + virtual void onTouchesCancelled(const std::vector& touches, cocos2d::Event *event); + +protected: + bool _touchEnabled; + cocos2d::EventListener* _touchListener; + bool _accelerometerEnabled; + cocos2d::EventListener* _accelerometerListener; + bool _keypadEnabled; + cocos2d::EventListener* _keyboardListener; +private: + int _touchPriority; + cocos2d::Touch::DispatchMode _touchMode; +}; + +} + +#endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp b/cocos/editor-support/cocostudio/CCProcessBase.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp rename to cocos/editor-support/cocostudio/CCProcessBase.cpp index 00609f83b8..c3e1bfbc20 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.cpp +++ b/cocos/editor-support/cocostudio/CCProcessBase.cpp @@ -22,10 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCProcessBase.h" -#include "../utils/CCUtilMath.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { ProcessBase::ProcessBase(void) : _processScale(1) @@ -149,4 +151,4 @@ int ProcessBase::getCurrentFrameIndex() return _curFrameIndex; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h b/cocos/editor-support/cocostudio/CCProcessBase.h similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h rename to cocos/editor-support/cocostudio/CCProcessBase.h index 5ee5a1ca01..9f80fb2ea7 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCProcessBase.h +++ b/cocos/editor-support/cocostudio/CCProcessBase.h @@ -26,10 +26,10 @@ THE SOFTWARE. #ifndef __CCPROCESSBASE_H__ #define __CCPROCESSBASE_H__ -#include "../utils/CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum AnimationType { @@ -47,7 +47,7 @@ enum AnimationType }; -class ProcessBase : public Object +class ProcessBase : public cocos2d::Object { public: /** @@ -169,6 +169,6 @@ protected: bool _isLoopBack; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCPROCESSBASE_H__*/ diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp similarity index 94% rename from cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp rename to cocos/editor-support/cocostudio/CCSGUIReader.cpp index 57778d758a..77cb5d56de 100755 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -21,15 +21,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ - -#include "../GUI/System/CocosGUI.h" -#include "../Json/DictionaryHelper.h" -#include "../Action/CCActionManagerEx.h" +#include "cocostudio/CCSGUIReader.h" +#include "gui/CocosGUI.h" +#include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CCActionManagerEx.h" #include #include + using namespace gui; + using namespace cocos2d; -NS_CC_EXT_BEGIN + +namespace cocostudio { static CCSGUIReader* sharedReader = NULL; @@ -94,11 +97,11 @@ int CCSGUIReader::getVersionInteger(const char *str) /************************/ } -UIWidget* CCSGUIReader::widgetFromJsonDictionary(cs::JsonDictionary* data) +UIWidget* CCSGUIReader::widgetFromJsonDictionary(JsonDictionary* data) { UIWidget* widget = NULL; const char* classname = DICTOOL->getStringValue_json(data, "classname"); - cs::JsonDictionary* uiOptions = DICTOOL->getSubDictionary_json(data, "options"); + JsonDictionary* uiOptions = DICTOOL->getSubDictionary_json(data, "options"); if (classname && strcmp(classname, "Button") == 0) { widget = UIButton::create(); @@ -181,7 +184,7 @@ UIWidget* CCSGUIReader::widgetFromJsonDictionary(cs::JsonDictionary* data) int childrenCount = DICTOOL->getArrayCount_json(data, "children"); for (int i=0;igetDictionaryFromArray_json(data, "children", i); + JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(data, "children", i); UIWidget* child = widgetFromJsonDictionary(subData); if (child) { @@ -201,7 +204,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) m_bOlderVersion = false; const char *des = NULL; std::string jsonpath; - cs::JsonDictionary *jsonDict = NULL; + JsonDictionary *jsonDict = NULL; jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName); unsigned long size = 0; @@ -212,7 +215,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) return NULL; } std::string strDes(des); - jsonDict = new cs::JsonDictionary(); + jsonDict = new JsonDictionary(); jsonDict->initWithDescription(strDes.c_str()); const char* fileVersion = DICTOOL->getStringValue_json(jsonDict, "version"); @@ -244,7 +247,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) CCUIHELPER->setFileDesignWidth(fileDesignWidth); CCUIHELPER->setFileDesignHeight(fileDesignHeight); } - cs::JsonDictionary* widgetTree = DICTOOL->getSubDictionary_json(jsonDict, "widgetTree"); + JsonDictionary* widgetTree = DICTOOL->getSubDictionary_json(jsonDict, "widgetTree"); UIWidget* widget = widgetFromJsonDictionary(widgetTree); /* *********temp********* */ @@ -256,7 +259,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) /* ********************** */ // widget->setFileDesignSize(CCSizeMake(fileDesignWidth, fileDesignHeight)); - cs::JsonDictionary* actions = DICTOOL->getSubDictionary_json(jsonDict, "animation"); + JsonDictionary* actions = DICTOOL->getSubDictionary_json(jsonDict, "animation"); /* *********temp********* */ // ActionManager::shareManager()->releaseActions(); /* ********************** */ @@ -270,7 +273,7 @@ UIWidget* CCSGUIReader::widgetFromJsonFile(const char *fileName) return widget; } -void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary *options) +void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,JsonDictionary *options) { bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, "ignoreSize"); if (ignoreSizeExsit) @@ -316,7 +319,7 @@ void CCSGUIReader::setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonD widget->setZOrder(z); } -void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { bool op = DICTOOL->checkObjectExist_json(options, "opacity"); if (op) @@ -341,7 +344,7 @@ void CCSGUIReader::setColorPropsForWidgetFromJsonDictionary(UIWidget *widget, cs widget->setFlipY(flipY); } -void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -407,7 +410,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD bool scale9Enable = DICTOOL->getBooleanValue_json(options, "scale9Enable"); button->setScale9Enabled(scale9Enable); - cs::JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "normalData"); + JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "normalData"); int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType"); switch (normalType) { @@ -429,7 +432,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD break; } CC_SAFE_DELETE(normalDic); - cs::JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "pressedData"); + JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "pressedData"); int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType"); switch (pressedType) { @@ -451,7 +454,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD break; } CC_SAFE_DELETE(pressedDic); - cs::JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "disabledData"); + JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "disabledData"); int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType"); switch (disabledType) { @@ -494,7 +497,7 @@ void CCSGUIReader::setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonD } } -void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -536,7 +539,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso setPropsForWidgetFromJsonDictionary(widget, options); UICheckBox* checkBox = (UICheckBox*)widget; - cs::JsonDictionary* backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData"); + JsonDictionary* backGroundDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxData"); int backGroundType = DICTOOL->getIntValue_json(backGroundDic, "resourceType"); switch (backGroundType) { @@ -559,7 +562,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundDic); - cs::JsonDictionary* backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxSelectedData"); + JsonDictionary* backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxSelectedData"); int backGroundSelectedType = DICTOOL->getIntValue_json(backGroundSelectedDic, "resourceType"); switch (backGroundSelectedType) { @@ -582,7 +585,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundSelectedDic); - cs::JsonDictionary* frontCrossDic = DICTOOL->getSubDictionary_json(options, "frontCrossData"); + JsonDictionary* frontCrossDic = DICTOOL->getSubDictionary_json(options, "frontCrossData"); int frontCrossType = DICTOOL->getIntValue_json(frontCrossDic, "resourceType"); switch (frontCrossType) { @@ -605,7 +608,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(frontCrossDic); - cs::JsonDictionary* backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxDisabledData"); + JsonDictionary* backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, "backGroundBoxDisabledData"); int backGroundDisabledType = DICTOOL->getIntValue_json(backGroundDisabledDic, "resourceType"); switch (backGroundDisabledType) { @@ -628,7 +631,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } CC_SAFE_DELETE(backGroundDisabledDic); - cs::JsonDictionary* frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, "frontCrossDisabledData"); + JsonDictionary* frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, "frontCrossDisabledData"); int frontCrossDisabledType = DICTOOL->getIntValue_json(frontCrossDisabledDic, "resourceType"); switch (frontCrossDisabledType) { @@ -655,7 +658,7 @@ void CCSGUIReader::setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::Jso } } -void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -725,7 +728,7 @@ void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::Js UIImageView* imageView = (UIImageView*)widget; - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -784,7 +787,7 @@ void CCSGUIReader::setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::Js } } -void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UILabel* label = (UILabel*)widget; @@ -813,7 +816,7 @@ void CCSGUIReader::setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDi setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -847,7 +850,7 @@ void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::J if (sv && cmf && iw && ih && scm) { - cs::JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "charMapFileData"); + JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "charMapFileData"); int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType"); switch (cmfType) { @@ -871,7 +874,7 @@ void CCSGUIReader::setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::J } } -void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForWidgetFromJsonDictionary(widget, options); Layout* containerWidget = (Layout*)widget; @@ -884,7 +887,7 @@ void CCSGUIReader::setPropsForContainerWidgetFromJsonDictionary(UIWidget *widget setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -987,7 +990,7 @@ void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDi // panel->setSize(CCSizeMake(w, h)); - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "backGroundImageData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "backGroundImageData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -1022,7 +1025,7 @@ void CCSGUIReader::setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDi } } -void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForPanelFromJsonDictionary(widget, options); UIScrollView* scrollView = (UIScrollView*)widget; @@ -1036,7 +1039,7 @@ void CCSGUIReader::setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::J setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { if (m_bOlderVersion) { @@ -1128,7 +1131,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD if (barTextureScale9Enable) { - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileType) { @@ -1155,7 +1158,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } else { - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "barFileNameData"); int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileType) { @@ -1199,7 +1202,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD // slider->setSlidBallTextures(normalFileName_tp,pressedFileName_tp,disabledFileName_tp); // } - cs::JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "ballNormalData"); + JsonDictionary* normalDic = DICTOOL->getSubDictionary_json(options, "ballNormalData"); int normalType = DICTOOL->getIntValue_json(normalDic, "resourceType"); switch (normalType) { @@ -1222,7 +1225,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } CC_SAFE_DELETE(normalDic); - cs::JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "ballPressedData"); + JsonDictionary* pressedDic = DICTOOL->getSubDictionary_json(options, "ballPressedData"); int pressedType = DICTOOL->getIntValue_json(pressedDic, "resourceType"); switch (pressedType) { @@ -1245,7 +1248,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } CC_SAFE_DELETE(pressedDic); - cs::JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "ballDisabledData"); + JsonDictionary* disabledDic = DICTOOL->getSubDictionary_json(options, "ballDisabledData"); int disabledType = DICTOOL->getIntValue_json(disabledDic, "resourceType"); switch (disabledType) { @@ -1270,7 +1273,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD slider->setPercent(DICTOOL->getIntValue_json(options, "percent")); - cs::JsonDictionary* progressBarDic = DICTOOL->getSubDictionary_json(options, "progressBarData"); + JsonDictionary* progressBarDic = DICTOOL->getSubDictionary_json(options, "progressBarData"); int progressBarType = DICTOOL->getIntValue_json(progressBarDic, "resourceType"); switch (progressBarType) { @@ -1295,7 +1298,7 @@ void CCSGUIReader::setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonD } } -void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UILabel* textArea = (UILabel*)widget; @@ -1330,7 +1333,7 @@ void CCSGUIReader::setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::Jso setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForButtonFromJsonDictionary(widget, options); @@ -1357,7 +1360,7 @@ void CCSGUIReader::setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::J setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForWidgetFromJsonDictionary(widget, options); UITextField* textField = (UITextField*)widget; @@ -1407,7 +1410,7 @@ void CCSGUIReader::setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::Js setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { if (m_bOlderVersion) { @@ -1434,7 +1437,7 @@ void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs: setPropsForWidgetFromJsonDictionary(widget, options); UILoadingBar* loadingBar = (UILoadingBar*)widget; - cs::JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData"); + JsonDictionary* imageFileNameDic = DICTOOL->getSubDictionary_json(options, "textureData"); int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, "resourceType"); switch (imageFileNameType) { @@ -1486,18 +1489,18 @@ void CCSGUIReader::setPropsForLoadingBarFromJsonDictionary(UIWidget *widget, cs: } } -void CCSGUIReader::setPropsForListViewFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForListViewFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForScrollViewFromJsonDictionary(widget, options); } -void CCSGUIReader::setPropsForPageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options) +void CCSGUIReader::setPropsForPageViewFromJsonDictionary(UIWidget*widget,JsonDictionary* options) { setPropsForPanelFromJsonDictionary(widget, options); setColorPropsForWidgetFromJsonDictionary(widget,options); } -void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { if (m_bOlderVersion) { @@ -1523,7 +1526,7 @@ void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs UILabelBMFont* labelBMFont = (UILabelBMFont*)widget; - cs::JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); + JsonDictionary* cmftDic = DICTOOL->getSubDictionary_json(options, "fileNameData"); int cmfType = DICTOOL->getIntValue_json(cmftDic, "resourceType"); switch (cmfType) { @@ -1550,7 +1553,7 @@ void CCSGUIReader::setPropsForLabelBMFontFromJsonDictionary(UIWidget *widget, cs } } -void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, cs::JsonDictionary *options) +void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, JsonDictionary *options) { setPropsForPanelFromJsonDictionary(widget, options); @@ -1566,4 +1569,4 @@ void CCSGUIReader::setPropsForDragPanelFromJsonDictionary(UIWidget *widget, cs:: setColorPropsForWidgetFromJsonDictionary(widget, options); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h new file mode 100755 index 0000000000..d39c349ee0 --- /dev/null +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -0,0 +1,76 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __CCSGUIREADER_H__ +#define __CCSGUIREADER_H__ + +#include "gui/UIWidget.h" +#include "cocostudio/CSContentJsonDictionary.h" + +namespace cocostudio { + +#define kCCSVersion 1.0 +class CCSGUIReader : cocos2d::Object +{ +public: + CCSGUIReader(); + ~CCSGUIReader(); + static CCSGUIReader* shareReader(); + static void purgeCCSGUIReader(); + + gui::UIWidget* widgetFromJsonFile(const char* fileName); + gui::UIWidget* widgetFromJsonDictionary(JsonDictionary* data); + + int getVersionInteger(const char* str); + + void setPropsForWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setColorPropsForWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForButtonFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForCheckBoxFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForImageViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelAtlasFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForContainerWidgetFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForPanelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForScrollViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForSliderFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextAreaFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextButtonFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForTextFieldFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLoadingBarFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForImageButtonFromJsonDictionary(gui::UIWidget* widget, JsonDictionary* options); + void setPropsForListViewFromJsonDictionary(gui::UIWidget* widget, JsonDictionary* options); + void setPropsForPageViewFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForLabelBMFontFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + void setPropsForDragPanelFromJsonDictionary(gui::UIWidget*widget,JsonDictionary* options); + +protected: + std::string m_strFilePath; + bool m_bOlderVersion; +}; + +} + + +#endif /* defined(__CCSGUIReader__) */ diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp similarity index 90% rename from cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp rename to cocos/editor-support/cocostudio/CCSSceneReader.cpp index a83ef909ac..3d8bc7fd8c 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -22,10 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCSSceneReader.h" -#include "cocos-ext.h" +#include "cocostudio/CocoStudio.h" +#include "gui/CocosGUI.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace gui; + +namespace cocostudio { SceneReader* SceneReader::s_sharedReader = NULL; @@ -51,7 +54,7 @@ NS_CC_EXT_BEGIN CC_BREAK_IF(pszFileName == NULL); pData = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pszFileName, "r", &size)); CC_BREAK_IF(pData == NULL || strcmp(pData, "") == 0); - cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + JsonDictionary *jsonDict = new JsonDictionary(); jsonDict->initWithDescription(pData); pNode = createObject(jsonDict,NULL); CC_SAFE_DELETE(jsonDict); @@ -60,7 +63,7 @@ NS_CC_EXT_BEGIN return pNode; } - Node* SceneReader::createObject(cs::JsonDictionary * inputFiles, Node* parenet) + Node* SceneReader::createObject(JsonDictionary * inputFiles, Node* parenet) { const char *className = inputFiles->getItemStringValue("classname"); if(strcmp(className, "CCNode") == 0) @@ -81,7 +84,7 @@ NS_CC_EXT_BEGIN int count = inputFiles->getArrayItemCount("components"); for (int i = 0; i < count; i++) { - cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); + JsonDictionary * subDict = inputFiles->getSubItemFromArray("components", i); if (!subDict) { CC_SAFE_DELETE(subDict); @@ -90,7 +93,7 @@ NS_CC_EXT_BEGIN const char *comName = subDict->getItemStringValue("classname"); const char *pComName = subDict->getItemStringValue("name"); - cs::JsonDictionary *fileData = subDict->getSubDictionary("fileData"); + JsonDictionary *fileData = subDict->getSubDictionary("fileData"); std::string pPath; std::string pPlistFile; int nResType = 0; @@ -212,7 +215,7 @@ NS_CC_EXT_BEGIN } unsigned long size = 0; const char *des = (char*)(cocos2d::FileUtils::getInstance()->getFileData(pPath.c_str(),"r" , &size)); - cs::JsonDictionary *jsonDict = new cs::JsonDictionary(); + JsonDictionary *jsonDict = new JsonDictionary(); jsonDict->initWithDescription(des); if(NULL == des || strcmp(des, "") == 0) { @@ -220,7 +223,7 @@ NS_CC_EXT_BEGIN } int childrenCount = DICTOOL->getArrayCount_json(jsonDict, "armature_data"); - cs::JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); + JsonDictionary* subData = DICTOOL->getDictionaryFromArray_json(jsonDict, "armature_data", 0); const char *name = DICTOOL->getStringValue_json(subData, "name"); childrenCount = DICTOOL->getArrayCount_json(jsonDict, "config_file_path"); @@ -238,11 +241,11 @@ NS_CC_EXT_BEGIN textupath += file_path; textupath.append(textureFileName); - cocos2d::extension::armature::ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); + ArmatureDataManager::getInstance()->addArmatureFileInfo(textupath.c_str(), plistpath.c_str(), pPath.c_str()); } - cocos2d::extension::armature::Armature *pAr = cocos2d::extension::armature::Armature::create(name); + Armature *pAr = Armature::create(name); ComRender *pRender = ComRender::create(pAr, "CCArmature"); if (pComName != NULL) { @@ -315,9 +318,9 @@ NS_CC_EXT_BEGIN } else if(comName != NULL && strcmp(comName, "GUIComponent") == 0) { - cocos2d::extension::UILayer *pLayer = cocos2d::extension::UILayer::create(); + gui::UILayer *pLayer = gui::UILayer::create(); pLayer->scheduleUpdate(); - UIWidget* widget=cocos2d::extension::UIHelper::instance()->createWidgetFromJsonFile(pPath.c_str()); + UIWidget* widget= gui::UIHelper::instance()->createWidgetFromJsonFile(pPath.c_str()); pLayer->addWidget(widget); ComRender *pRender = ComRender::create(pLayer, "GUIComponent"); if (pComName != NULL) @@ -332,7 +335,7 @@ NS_CC_EXT_BEGIN for (int i = 0; i < inputFiles->getArrayItemCount("gameobjects"); i++) { - cs::JsonDictionary * subDict = inputFiles->getSubItemFromArray("gameobjects", i); + JsonDictionary * subDict = inputFiles->getSubItemFromArray("gameobjects", i); if (!subDict) { break; @@ -348,7 +351,7 @@ NS_CC_EXT_BEGIN } - void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict) + void SceneReader::setPropertyFromJsonDict(cocos2d::Node *node, JsonDictionary* dict) { int x = dict->getItemIntValue("x", 0); int y = dict->getItemIntValue("y", 0); @@ -384,7 +387,7 @@ NS_CC_EXT_BEGIN void SceneReader::purgeSceneReader() { CC_SAFE_DELETE(s_sharedReader); - cocos2d::extension::DictionaryHelper::shareHelper()->purgeDictionaryHelper(); + DictionaryHelper::shareHelper()->purgeDictionaryHelper(); } -NS_CC_EXT_END +} diff --git a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h b/cocos/editor-support/cocostudio/CCSSceneReader.h similarity index 87% rename from cocos/editor-support/cocostudio/reader/CCSSceneReader.h rename to cocos/editor-support/cocostudio/CCSSceneReader.h index c0c88ae660..f548a2573f 100644 --- a/cocos/editor-support/cocostudio/reader/CCSSceneReader.h +++ b/cocos/editor-support/cocostudio/CCSSceneReader.h @@ -26,10 +26,9 @@ #define __CCSSCENEREADER_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" + #include "cocostudio/CSContentJsonDictionary.h" -NS_CC_EXT_BEGIN +namespace cocostudio { class SceneReader { @@ -51,14 +50,14 @@ public: cocos2d::Node* createNodeWithSceneFile(const char *pszFileName); private: - cocos2d::Node* createObject(cs::JsonDictionary * inputFiles, cocos2d::Node* parent); - void setPropertyFromJsonDict(cocos2d::Node *node, cs::JsonDictionary* dict); + cocos2d::Node* createObject(JsonDictionary * inputFiles, cocos2d::Node* parent); + void setPropertyFromJsonDict(cocos2d::Node *node, JsonDictionary* dict); private: static SceneReader* s_sharedReader; }; -NS_CC_EXT_END +} #endif diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp b/cocos/editor-support/cocostudio/CCSkin.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/display/CCSkin.cpp rename to cocos/editor-support/cocostudio/CCSkin.cpp index 2fdf2b24af..afd6f5fc51 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.cpp +++ b/cocos/editor-support/cocostudio/CCSkin.cpp @@ -22,12 +22,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCSkin.h" -#include "../utils/CCTransformHelp.h" -#include "../utils/CCSpriteFrameCacheHelper.h" -#include "../CCArmature.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCArmature.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { #if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL #define RENDER_IN_SUBPIXEL @@ -201,4 +203,4 @@ AffineTransform Skin::getNodeToWorldTransformAR() const return AffineTransformConcat(displayTransform, _bone->getArmature()->getNodeToWorldTransform()); } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/display/CCSkin.h b/cocos/editor-support/cocostudio/CCSkin.h similarity index 85% rename from cocos/editor-support/cocostudio/armature/display/CCSkin.h rename to cocos/editor-support/cocostudio/CCSkin.h index 26453ece1a..3494c48436 100644 --- a/cocos/editor-support/cocostudio/armature/display/CCSkin.h +++ b/cocos/editor-support/cocostudio/CCSkin.h @@ -25,12 +25,12 @@ THE SOFTWARE. #ifndef __CCSKIN_H__ #define __CCSKIN_H__ -#include "../utils/CCArmatureDefine.h" -#include "../CCBone.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCBone.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { -class Skin : public Sprite +class Skin : public cocos2d::Sprite { public: static Skin *create(); @@ -45,17 +45,17 @@ public: void updateArmatureTransform(); void updateTransform(); - AffineTransform getNodeToWorldTransform() const; - AffineTransform getNodeToWorldTransformAR() const; + cocos2d::AffineTransform getNodeToWorldTransform() const; + cocos2d::AffineTransform getNodeToWorldTransformAR() const; CC_PROPERTY_PASS_BY_REF(BaseData, _skinData, SkinData); CC_SYNTHESIZE(Bone *, _bone, Bone); protected: - AffineTransform _skinTransform; + cocos2d::AffineTransform _skinTransform; CC_SYNTHESIZE_READONLY(std::string, _displayName, DisplayName) }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCSKIN_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp similarity index 95% rename from cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp rename to cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp index acbdf4c542..d783c4ba4e 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.cpp +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp @@ -22,10 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" + +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { SpriteFrameCacheHelper *SpriteFrameCacheHelper::_spriteFrameCacheHelper = NULL; @@ -72,4 +74,4 @@ SpriteFrameCacheHelper::~SpriteFrameCacheHelper() CC_SAFE_RELEASE_NULL(_textureAtlasDic); } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h similarity index 91% rename from cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h rename to cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h index 257cf49cd8..150fe96aaa 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCSpriteFrameCacheHelper.h +++ b/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h @@ -24,12 +24,12 @@ THE SOFTWARE. #ifndef __CCSPRITEFRAMECACHEHELPER_H__ #define __CCSPRITEFRAMECACHEHELPER_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include using namespace std; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class SpriteFrameCacheHelper { @@ -47,7 +47,7 @@ public: */ void addSpriteFrameFromFile(const char *plistPath, const char *imagePath); - TextureAtlas *getTexureAtlasWithTexture(Texture2D *texture); + cocos2d::TextureAtlas *getTexureAtlasWithTexture(cocos2d::Texture2D *texture); private: /** @@ -60,11 +60,11 @@ private: */ ~SpriteFrameCacheHelper(); - Dictionary *_textureAtlasDic; + cocos2d::Dictionary *_textureAtlasDic; static SpriteFrameCacheHelper *_spriteFrameCacheHelper; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCSPRITEFRAMECACHEHELPER_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp b/cocos/editor-support/cocostudio/CCTransformHelp.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp rename to cocos/editor-support/cocostudio/CCTransformHelp.cpp index 081b160b26..a836055c16 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.cpp +++ b/cocos/editor-support/cocostudio/CCTransformHelp.cpp @@ -22,10 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTransformHelp.h" -#include "CCUtilMath.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +using namespace cocos2d; + +namespace cocostudio { AffineTransform TransformHelp::helpMatrix1; AffineTransform TransformHelp::helpMatrix2; @@ -149,4 +151,4 @@ void TransformHelp::nodeSub(BaseData &target, BaseData &source) target.scaleY -= source.scaleY; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h b/cocos/editor-support/cocostudio/CCTransformHelp.h similarity index 81% rename from cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h rename to cocos/editor-support/cocostudio/CCTransformHelp.h index 5542691616..ae1bcbf813 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTransformHelp.h +++ b/cocos/editor-support/cocostudio/CCTransformHelp.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCTRANSFORMHELP_H__ #define __CCTRANSFORMHELP_H__ -#include "CCArmatureDefine.h" -#include "../datas/CCDatas.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDatas.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { /* * use to calculate the matrix of node from parent node @@ -44,19 +44,19 @@ public: static void transformFromParentWithoutScale(BaseData &node, const BaseData &parentNode); static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode); - static void nodeToMatrix(const BaseData &_node, AffineTransform &_matrix); - static void matrixToNode(const AffineTransform &_matrix, BaseData &_node); + static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix); + static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node); static void nodeConcat(BaseData &target, BaseData &source); static void nodeSub(BaseData &target, BaseData &source); public: - static AffineTransform helpMatrix1; - static AffineTransform helpMatrix2; + static cocos2d::AffineTransform helpMatrix1; + static cocos2d::AffineTransform helpMatrix2; - static Point helpPoint1; - static Point helpPoint2; + static cocos2d::Point helpPoint1; + static cocos2d::Point helpPoint2; }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTRANSFORMHELP_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp b/cocos/editor-support/cocostudio/CCTween.cpp similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCTween.cpp rename to cocos/editor-support/cocostudio/CCTween.cpp index b66e33465f..8fec95b2a0 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.cpp +++ b/cocos/editor-support/cocostudio/CCTween.cpp @@ -23,16 +23,16 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCTween.h" -#include "CCArmatureAnimation.h" -#include "../CCBone.h" -#include "../CCArmature.h" -#include "../utils/CCUtilMath.h" -#include "../utils/CCTweenFunction.h" -#include "../utils/CCTransformHelp.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCTransformHelp.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { Tween *Tween::create(Bone *bone) { @@ -462,4 +462,4 @@ float Tween::updateFrameData(float currentPercent) return currentPercent; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/animation/CCTween.h b/cocos/editor-support/cocostudio/CCTween.h similarity index 97% rename from cocos/editor-support/cocostudio/armature/animation/CCTween.h rename to cocos/editor-support/cocostudio/CCTween.h index b4a64bc3ef..80b6c6d7e9 100644 --- a/cocos/editor-support/cocostudio/armature/animation/CCTween.h +++ b/cocos/editor-support/cocostudio/CCTween.h @@ -26,10 +26,10 @@ THE SOFTWARE. #ifndef __CCTWEEN_H__ #define __CCTWEEN_H__ -#include "CCProcessBase.h" -#include "../utils/CCTweenFunction.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCTweenFunction.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { class Bone; class ArmatureAnimation; @@ -147,6 +147,6 @@ protected: }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTWEEN_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp b/cocos/editor-support/cocostudio/CCTweenFunction.cpp similarity index 99% rename from cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp rename to cocos/editor-support/cocostudio/CCTweenFunction.cpp index 8546a88d27..37b523fc79 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.cpp +++ b/cocos/editor-support/cocostudio/CCTweenFunction.cpp @@ -22,10 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCTweenFunction.h" -#include "CCUtilMath.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCUtilMath.h" -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { float TweenFunction::tweenTo(float from, float change, float time, float duration, CCTweenType tweenType) { @@ -411,4 +411,4 @@ float TweenFunction::bounceEaseInOut(float t, float b, float c, float d) } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h b/cocos/editor-support/cocostudio/CCTweenFunction.h similarity index 98% rename from cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h rename to cocos/editor-support/cocostudio/CCTweenFunction.h index d0c76e8cc1..255d19d58e 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCTweenFunction.h +++ b/cocos/editor-support/cocostudio/CCTweenFunction.h @@ -26,10 +26,10 @@ THE SOFTWARE. #define __CCTWEENFUNCTION_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { enum CCTweenType { @@ -131,6 +131,6 @@ public: }; -NS_CC_EXT_ARMATURE_END +} #endif /*__CCTWEENFUNCTION_H__*/ diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp b/cocos/editor-support/cocostudio/CCUtilMath.cpp similarity index 96% rename from cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp rename to cocos/editor-support/cocostudio/CCUtilMath.cpp index 7197aa1fd4..0714958857 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.cpp +++ b/cocos/editor-support/cocostudio/CCUtilMath.cpp @@ -22,10 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "CCUtilMath.h" +#include "cocostudio/CCUtilMath.h" + +using namespace cocos2d; -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { bool isSpriteContainPoint(Sprite *sprite, Point point, Point &outPoint) { @@ -75,4 +77,4 @@ Point circleTo(float t, Point ¢er, float radius, float fromRadian, float rad return p; } -NS_CC_EXT_ARMATURE_END +} diff --git a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h b/cocos/editor-support/cocostudio/CCUtilMath.h similarity index 74% rename from cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h rename to cocos/editor-support/cocostudio/CCUtilMath.h index 376e02b522..20541a8c80 100644 --- a/cocos/editor-support/cocostudio/armature/utils/CCUtilMath.h +++ b/cocos/editor-support/cocostudio/CCUtilMath.h @@ -25,10 +25,10 @@ THE SOFTWARE. #ifndef __CCUTILMATH_H__ #define __CCUTILMATH_H__ -#include "CCArmatureDefine.h" +#include "cocostudio/CCArmatureDefine.h" #include -NS_CC_EXT_ARMATURE_BEGIN +namespace cocostudio { #define CC_DOUBLE_PI (M_PI*2) @@ -36,20 +36,20 @@ NS_CC_EXT_ARMATURE_BEGIN //! hit test function -bool isSpriteContainPoint(Sprite *sprite, Point point); -bool isSpriteContainPoint(Sprite *sprite, Point point, Point &outPoint); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point); +bool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point, cocos2d::Point &outPoint); #define CC_SPRITE_CONTAIN_POINT(sprite, point) isSpriteContainPoint((sprite), (point)) #define CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint) isSpriteContainPoint((sprite), (point), outPoint) //! motion curve function -Point bezierTo(float t, Point &point1, Point &point2, Point &point3); -Point bezierTo(float t, Point &point1, Point &point2, Point &point3, Point &point4); +cocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3); +cocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3, cocos2d::Point &point4); -Point circleTo(float t, Point ¢er, float radius, float fromRadian, float radianDif); +cocos2d::Point circleTo(float t, cocos2d::Point ¢er, float radius, float fromRadian, float radianDif); -NS_CC_EXT_ARMATURE_END +} #endif /*__CCUTILMATH_H__*/ diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp b/cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp similarity index 87% rename from cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp rename to cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp index afb37dc624..2f88410582 100644 --- a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.cpp +++ b/cocos/editor-support/cocostudio/CSContentJsonDictionary.cpp @@ -25,9 +25,9 @@ */ #include -#include "CSContentJsonDictionary.h" +#include "cocostudio/CSContentJsonDictionary.h" -namespace cs { +namespace cocostudio { JsonDictionary::JsonDictionary() { @@ -43,7 +43,7 @@ namespace cs { void JsonDictionary::initWithDescription(const char *pszDescription) { - CSJson::Reader cReader; + Json::Reader cReader; m_cValue.clear(); if (pszDescription && *pszDescription) { @@ -53,7 +53,7 @@ namespace cs { } - void JsonDictionary::initWithValue(CSJson::Value& value) + void JsonDictionary::initWithValue(Json::Value& value) { m_cValue = value; } @@ -151,8 +151,8 @@ namespace cs { JsonDictionary * pNewDictionary; if (!isKeyValidate(pszKey, m_cValue) || (!m_cValue[pszKey].isArray() && !m_cValue[pszKey].isObject() && - !m_cValue[pszKey].isConvertibleTo(CSJson::arrayValue) && - !m_cValue[pszKey].isConvertibleTo(CSJson::objectValue))) + !m_cValue[pszKey].isConvertibleTo(Json::arrayValue) && + !m_cValue[pszKey].isConvertibleTo(Json::objectValue))) { pNewDictionary = NULL; } @@ -174,10 +174,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, int nValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -192,10 +192,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, double fValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -210,10 +210,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, const char * pszValue) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -228,10 +228,10 @@ namespace cs { bool JsonDictionary::insertItemToArray(const char *pszArrayKey, JsonDictionary * subDictionary) { - CSJson::Value array; + Json::Value array; if(m_cValue.isMember(pszArrayKey)) { - if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return false; array = m_cValue[pszArrayKey]; @@ -272,13 +272,13 @@ namespace cs { int nRet = 0; if (!isKeyValidate(pszArrayKey, m_cValue) || (!m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isObject() && - !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue) && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::objectValue))) + !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue) && !m_cValue[pszArrayKey].isConvertibleTo(Json::objectValue))) { nRet = 0; } else { - CSJson::Value arrayValue = m_cValue[pszArrayKey]; + Json::Value arrayValue = m_cValue[pszArrayKey]; nRet = arrayValue.size(); } @@ -289,7 +289,7 @@ namespace cs { int JsonDictionary::getIntValueFromArray(const char *pszArrayKey, int nIndex, int nDefaultValue) { int nRet = nDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -303,7 +303,7 @@ namespace cs { double JsonDictionary::getFloatValueFromArray(const char *pszArrayKey, int nIndex, double fDefaultValue) { double fRet = fDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -316,7 +316,7 @@ namespace cs { bool JsonDictionary::getBoolValueFromArray(const char *pszArrayKey, int nIndex, bool bDefaultValue) { bool bRet = bDefaultValue; - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isNumeric()) @@ -329,7 +329,7 @@ namespace cs { const char * JsonDictionary::getStringValueFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isString()) @@ -342,7 +342,7 @@ namespace cs { JsonDictionary * JsonDictionary::getSubItemFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) { if ((*arrayValue)[nIndex].isArray() || (*arrayValue)[nIndex].isObject()) @@ -359,15 +359,15 @@ namespace cs { DicItemType JsonDictionary::getItemTypeFromArray(const char *pszArrayKey, int nIndex) { - CSJson::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); + Json::Value * arrayValue = validateArrayItem(pszArrayKey, nIndex); if (arrayValue) return (DicItemType)((*arrayValue)[nIndex].type()); - return (DicItemType)CSJson::nullValue; + return (DicItemType)Json::nullValue; } - inline bool JsonDictionary::isKeyValidate(const char *pszKey, CSJson::Value& root) + inline bool JsonDictionary::isKeyValidate(const char *pszKey, Json::Value& root) { if (root.isNull() || !root.isMember(pszKey)) return false; @@ -376,9 +376,9 @@ namespace cs { } - inline CSJson::Value * JsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) + inline Json::Value * JsonDictionary::validateArrayItem(const char *pszArrayKey, int nIndex) { - if (!isKeyValidate(pszArrayKey, m_cValue) && !m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(CSJson::arrayValue)) + if (!isKeyValidate(pszArrayKey, m_cValue) && !m_cValue[pszArrayKey].isArray() && !m_cValue[pszArrayKey].isConvertibleTo(Json::arrayValue)) return NULL; if (!m_cValue[pszArrayKey].isValidIndex(nIndex)) return NULL; diff --git a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h b/cocos/editor-support/cocostudio/CSContentJsonDictionary.h similarity index 92% rename from cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h rename to cocos/editor-support/cocostudio/CSContentJsonDictionary.h index 3908e71545..f8f047b19a 100644 --- a/cocos/editor-support/cocostudio/json/CSContentJsonDictionary.h +++ b/cocos/editor-support/cocostudio/CSContentJsonDictionary.h @@ -28,11 +28,11 @@ #define COCOSTUDIO_CSCONTENTJSONDICTIONARY_H -#include "lib_json/json_lib.h" +#include "json/json.h" #include #include -namespace cs { +namespace cocostudio { typedef enum _DicItemType { @@ -90,12 +90,12 @@ namespace cs { std::vector getAllMemberNames(); protected: - CSJson::Value m_cValue; + Json::Value m_cValue; private: - void initWithValue(CSJson::Value& value); - inline bool isKeyValidate(const char *pszKey, CSJson::Value& root); - inline CSJson::Value * validateArrayItem(const char *pszArrayKey, int nIndex); + void initWithValue(Json::Value& value); + inline bool isKeyValidate(const char *pszKey, Json::Value& root); + inline Json::Value * validateArrayItem(const char *pszArrayKey, int nIndex); }; } diff --git a/cocos/editor-support/cocostudio/CocoStudio.h b/cocos/editor-support/cocostudio/CocoStudio.h new file mode 100644 index 0000000000..03c06775a6 --- /dev/null +++ b/cocos/editor-support/cocostudio/CocoStudio.h @@ -0,0 +1,62 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __EDITOR_SUPPORT_COCOSTUDIO_H__ +#define __EDITOR_SUPPORT_COCOSTUDIO_H__ + +#include "cocostudio/CCActionFrame.h" +#include "cocostudio/CCActionFrameEasing.h" +#include "cocostudio/CCActionManagerEx.h" +#include "cocostudio/CCActionNode.h" +#include "cocostudio/CCActionObject.h" +#include "cocostudio/CCArmature.h" +#include "cocostudio/CCBone.h" +#include "cocostudio/CCArmatureAnimation.h" +#include "cocostudio/CCProcessBase.h" +#include "cocostudio/CCTween.h" +#include "cocostudio/CCDatas.h" +#include "cocostudio/CCBatchNode.h" +#include "cocostudio/CCDecorativeDisplay.h" +#include "cocostudio/CCDisplayFactory.h" +#include "cocostudio/CCDisplayManager.h" +#include "cocostudio/CCSkin.h" +#include "cocostudio/CCColliderDetector.h" +#include "cocostudio/CCArmatureDataManager.h" +#include "cocostudio/CCArmatureDefine.h" +#include "cocostudio/CCDataReaderHelper.h" +#include "cocostudio/CCSpriteFrameCacheHelper.h" +#include "cocostudio/CCTransformHelp.h" +#include "cocostudio/CCTweenFunction.h" +#include "cocostudio/CCUtilMath.h" +#include "cocostudio/CCComAttribute.h" +#include "cocostudio/CCComAudio.h" +#include "cocostudio/CCComController.h" +#include "cocostudio/CCComRender.h" +#include "cocostudio/CCInputDelegate.h" +#include "cocostudio/CSContentJsonDictionary.h" +#include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CCSGUIReader.h" +#include "cocostudio/CCSSceneReader.h" + +#endif diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp b/cocos/editor-support/cocostudio/DictionaryHelper.cpp similarity index 82% rename from cocos/editor-support/cocostudio/json/DictionaryHelper.cpp rename to cocos/editor-support/cocostudio/DictionaryHelper.cpp index ca8dfd8594..48466eeb3e 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.cpp +++ b/cocos/editor-support/cocostudio/DictionaryHelper.cpp @@ -22,9 +22,9 @@ THE SOFTWARE. ****************************************************************************/ -#include "DictionaryHelper.h" +#include "cocostudio/DictionaryHelper.h" -NS_CC_EXT_BEGIN +namespace cocostudio { static DictionaryHelper* sharedHelper = NULL; @@ -178,7 +178,7 @@ cocos2d::Array* DictionaryHelper::objectToCCArray(cocos2d::Object *obj) return array; } -cs::JsonDictionary* DictionaryHelper::getSubDictionary_json(cs::JsonDictionary* root,const char* key) +JsonDictionary* DictionaryHelper::getSubDictionary_json(JsonDictionary* root,const char* key) { if (!root) { @@ -187,7 +187,7 @@ cs::JsonDictionary* DictionaryHelper::getSubDictionary_json(cs::JsonDictionary* return root->getSubDictionary(key); } -int DictionaryHelper::getIntValue_json(cs::JsonDictionary* root,const char* key) +int DictionaryHelper::getIntValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -196,7 +196,7 @@ int DictionaryHelper::getIntValue_json(cs::JsonDictionary* root,const char* key) return root->getItemIntValue(key, 0); } -float DictionaryHelper::getFloatValue_json(cs::JsonDictionary* root,const char* key) +float DictionaryHelper::getFloatValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -205,7 +205,7 @@ float DictionaryHelper::getFloatValue_json(cs::JsonDictionary* root,const char* return root->getItemFloatValue(key, 0.0); } -const char* DictionaryHelper::getStringValue_json(cs::JsonDictionary* root,const char* key) +const char* DictionaryHelper::getStringValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -214,7 +214,7 @@ const char* DictionaryHelper::getStringValue_json(cs::JsonDictionary* root,const return root->getItemStringValue(key); } -bool DictionaryHelper::getBooleanValue_json(cs::JsonDictionary* root,const char* key) +bool DictionaryHelper::getBooleanValue_json(JsonDictionary* root,const char* key) { if (!root) { @@ -223,7 +223,7 @@ bool DictionaryHelper::getBooleanValue_json(cs::JsonDictionary* root,const char* return root->getItemBoolvalue(key, false); } -int DictionaryHelper::getArrayCount_json(cs::JsonDictionary* root,const char* key) +int DictionaryHelper::getArrayCount_json(JsonDictionary* root,const char* key) { if (!root) { @@ -232,7 +232,7 @@ int DictionaryHelper::getArrayCount_json(cs::JsonDictionary* root,const char* ke return root->getArrayItemCount(key); } -int DictionaryHelper::getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +int DictionaryHelper::getIntValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -241,7 +241,7 @@ int DictionaryHelper::getIntValueFromArray_json(cs::JsonDictionary* root,const c return root->getIntValueFromArray(arrayKey, idx, 0); } -float DictionaryHelper::getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +float DictionaryHelper::getFloatValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -250,7 +250,7 @@ float DictionaryHelper::getFloatValueFromArray_json(cs::JsonDictionary* root,con return root->getFloatValueFromArray(arrayKey, idx, 0.0); } -bool DictionaryHelper::getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +bool DictionaryHelper::getBoolValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -259,7 +259,7 @@ bool DictionaryHelper::getBoolValueFromArray_json(cs::JsonDictionary* root,const return root->getBoolValueFromArray(arrayKey, idx, false); } -const char* DictionaryHelper::getStringValueFromArray_json(cs::JsonDictionary *root, const char *arrayKey, int idx) +const char* DictionaryHelper::getStringValueFromArray_json(JsonDictionary *root, const char *arrayKey, int idx) { if (!root) { @@ -268,7 +268,7 @@ const char* DictionaryHelper::getStringValueFromArray_json(cs::JsonDictionary *r return root->getStringValueFromArray(arrayKey, idx); } -cs::JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx) +JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(JsonDictionary* root,const char* arrayKey,int idx) { if (!root) { @@ -277,7 +277,7 @@ cs::JsonDictionary* DictionaryHelper::getDictionaryFromArray_json(cs::JsonDictio return root->getSubItemFromArray(arrayKey, idx); } -bool DictionaryHelper::checkObjectExist_json(cs::JsonDictionary *root, const char *key) +bool DictionaryHelper::checkObjectExist_json(JsonDictionary *root, const char *key) { if (!root) { @@ -286,4 +286,4 @@ bool DictionaryHelper::checkObjectExist_json(cs::JsonDictionary *root, const cha return root->isKeyValidate(key); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/editor-support/cocostudio/json/DictionaryHelper.h b/cocos/editor-support/cocostudio/DictionaryHelper.h similarity index 69% rename from cocos/editor-support/cocostudio/json/DictionaryHelper.h rename to cocos/editor-support/cocostudio/DictionaryHelper.h index a5570ef11a..33aa5802ed 100644 --- a/cocos/editor-support/cocostudio/json/DictionaryHelper.h +++ b/cocos/editor-support/cocostudio/DictionaryHelper.h @@ -26,12 +26,11 @@ #define __DICTIONARYHELPER_H__ #include "cocos2d.h" -#include "cocos-ext.h" -#include "ExtensionMacros.h" +#include "cocostudio/CSContentJsonDictionary.h" #define DICTOOL DictionaryHelper::shareHelper() -NS_CC_EXT_BEGIN +namespace cocostudio { class DictionaryHelper { @@ -53,20 +52,20 @@ public: bool objectToBooleanValue(cocos2d::Object* obj); cocos2d::Array* objectToCCArray(cocos2d::Object* obj); - cs::JsonDictionary* getSubDictionary_json(cs::JsonDictionary* root,const char* key); - int getIntValue_json(cs::JsonDictionary* root,const char* key); - float getFloatValue_json(cs::JsonDictionary* root,const char* key); - const char* getStringValue_json(cs::JsonDictionary* root,const char* key); - bool getBooleanValue_json(cs::JsonDictionary* root,const char* key); - int getArrayCount_json(cs::JsonDictionary* root,const char* key); - int getIntValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - float getFloatValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - bool getBoolValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - const char* getStringValueFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - cs::JsonDictionary* getDictionaryFromArray_json(cs::JsonDictionary* root,const char* arrayKey,int idx); - bool checkObjectExist_json(cs::JsonDictionary* root,const char* key); + JsonDictionary* getSubDictionary_json(JsonDictionary* root,const char* key); + int getIntValue_json(JsonDictionary* root,const char* key); + float getFloatValue_json(JsonDictionary* root,const char* key); + const char* getStringValue_json(JsonDictionary* root,const char* key); + bool getBooleanValue_json(JsonDictionary* root,const char* key); + int getArrayCount_json(JsonDictionary* root,const char* key); + int getIntValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + float getFloatValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + bool getBoolValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + const char* getStringValueFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + JsonDictionary* getDictionaryFromArray_json(JsonDictionary* root,const char* arrayKey,int idx); + bool checkObjectExist_json(JsonDictionary* root,const char* key); }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__DictionaryHelper__) */ diff --git a/cocos/editor-support/cocostudio/components/CCInputDelegate.h b/cocos/editor-support/cocostudio/components/CCInputDelegate.h deleted file mode 100644 index 94bff421ce..0000000000 --- a/cocos/editor-support/cocostudio/components/CCInputDelegate.h +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__ -#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__ - -#include "cocos2d.h" -#include "ExtensionMacros.h" - -NS_CC_EXT_BEGIN - -class InputDelegate -{ -protected: - /** - * @js NA - * @lua NA - */ - InputDelegate(void); - /** - * @js NA - * @lua NA - */ - virtual ~InputDelegate(void); - -public: - /** - * @js NA - * @lua NA - */ - virtual bool isTouchEnabled() const; - /** - * @js NA - * @lua NA - */ - virtual void setTouchEnabled(bool value); - /** - * @js NA - * @lua NA - */ - virtual bool isAccelerometerEnabled() const; - /** - * @js NA - * @lua NA - */ - virtual void setAccelerometerEnabled(bool value); - /** - * @js NA - * @lua NA - */ - virtual bool isKeypadEnabled() const; - /** - * @js NA - * @lua NA - */ - virtual void setKeypadEnabled(bool value); - /** - * @js NA - * @lua NA - */ - virtual void setTouchMode(Touch::DispatchMode mode); - /** - * @js NA - * @lua NA - */ - virtual Touch::DispatchMode getTouchMode() const; - /** - * @js NA - * @lua NA - */ - virtual void setTouchPriority(int priority); - /** - * @js NA - * @lua NA - */ - virtual int getTouchPriority() const; - /** @deprecated Please override onAcceleration */ - CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(Acceleration* accelerationValue) final { CC_UNUSED_PARAM(accelerationValue); }; - // Deprecated touch callbacks. - CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;}; - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);} - - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);} - - virtual void onAcceleration(Acceleration* acc, Event* event) {}; - - virtual void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event) {}; - virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event) {}; - - virtual bool onTouchBegan(Touch *touch, Event *event); - virtual void onTouchMoved(Touch *touch, Event *event); - virtual void onTouchEnded(Touch *touch, Event *event); - virtual void onTouchCancelled(Touch *touch, Event *event); - virtual void onTouchesBegan(const std::vector& touches, Event *event); - virtual void onTouchesMoved(const std::vector& touches, Event *event); - virtual void onTouchesEnded(const std::vector& touches, Event *event); - virtual void onTouchesCancelled(const std::vector& touches, Event *event); - -protected: - bool _touchEnabled; - EventListener* _touchListener; - bool _accelerometerEnabled; - EventListener* _accelerometerListener; - bool _keypadEnabled; - EventListener* _keyboardListener; -private: - int _touchPriority; - Touch::DispatchMode _touchMode; -}; - -NS_CC_EXT_END - -#endif // __FUNDATION__CCCOMPONENT_H__ diff --git a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h b/cocos/editor-support/cocostudio/reader/CCSGUIReader.h deleted file mode 100755 index 75aa04981e..0000000000 --- a/cocos/editor-support/cocostudio/reader/CCSGUIReader.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCSGUIREADER_H__ -#define __CCSGUIREADER_H__ - -#include "../GUI/BaseClasses/UIWidget.h" -#include "../Json/CSContentJsonDictionary.h" - -NS_CC_EXT_BEGIN - -#define kCCSVersion 1.0 -class CCSGUIReader : Object -{ -public: - CCSGUIReader(); - ~CCSGUIReader(); - static CCSGUIReader* shareReader(); - static void purgeCCSGUIReader(); - - UIWidget* widgetFromJsonFile(const char* fileName); - UIWidget* widgetFromJsonDictionary(cs::JsonDictionary* data); - - int getVersionInteger(const char* str); - - void setPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setColorPropsForWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForCheckBoxFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForImageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelAtlasFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForContainerWidgetFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForScrollViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForSliderFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextAreaFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextButtonFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForTextFieldFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLoadingBarFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForImageButtonFromJsonDictionary(UIWidget* widget, cs::JsonDictionary* options); - void setPropsForListViewFromJsonDictionary(UIWidget* widget, cs::JsonDictionary* options); - void setPropsForPageViewFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForLabelBMFontFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - void setPropsForDragPanelFromJsonDictionary(UIWidget*widget,cs::JsonDictionary* options); - -protected: - std::string m_strFilePath; - bool m_bOlderVersion; -}; - -NS_CC_EXT_END - - -#endif /* defined(__CCSGUIReader__) */ diff --git a/cocos/editor-support/spine/Android.mk b/cocos/editor-support/spine/Android.mk new file mode 100644 index 0000000000..35ad40845d --- /dev/null +++ b/cocos/editor-support/spine/Android.mk @@ -0,0 +1,42 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := spine_static + +LOCAL_MODULE_FILENAME := libspine + +LOCAL_SRC_FILES := Animation.cpp \ +AnimationState.cpp \ +AnimationStateData.cpp \ +Atlas.cpp \ +AtlasAttachmentLoader.cpp \ +Attachment.cpp \ +AttachmentLoader.cpp \ +Bone.cpp \ +BoneData.cpp \ +CCSkeleton.cpp \ +CCSkeletonAnimation.cpp \ +Json.cpp \ +RegionAttachment.cpp \ +Skeleton.cpp \ +SkeletonData.cpp \ +SkeletonJson.cpp \ +Skin.cpp \ +Slot.cpp \ +SlotData.cpp \ +extension.cpp \ +spine-cocos2dx.cpp + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) diff --git a/cocos/editor-support/spine/Animation.cpp b/cocos/editor-support/spine/Animation.cpp index f60aae6f2c..655e80be06 100644 --- a/cocos/editor-support/spine/Animation.cpp +++ b/cocos/editor-support/spine/Animation.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Animation* Animation_create (const char* name, int timelineCount) { Animation* self = NEW(Animation); @@ -496,4 +496,4 @@ void AttachmentTimeline_setFrame (AttachmentTimeline* self, int frameIndex, floa self->attachmentNames[frameIndex] = 0; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/Animation.h b/cocos/editor-support/spine/Animation.h index b7d922ca95..992e414da9 100644 --- a/cocos/editor-support/spine/Animation.h +++ b/cocos/editor-support/spine/Animation.h @@ -26,7 +26,7 @@ #ifndef SPINE_ANIMATION_H_ #define SPINE_ANIMATION_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef struct Timeline Timeline; struct Skeleton; @@ -127,6 +127,6 @@ AttachmentTimeline* AttachmentTimeline_create (int frameCount); /* @param attachmentName May be 0. */ void AttachmentTimeline_setFrame (AttachmentTimeline* self, int frameIndex, float time, const char* attachmentName); -}} // namespace cocos2d { namespace extension { +} #endif /* SPINE_ANIMATION_H_ */ diff --git a/cocos/editor-support/spine/AnimationState.cpp b/cocos/editor-support/spine/AnimationState.cpp index be2bde367d..f118528523 100644 --- a/cocos/editor-support/spine/AnimationState.cpp +++ b/cocos/editor-support/spine/AnimationState.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _Entry _Entry; struct _Entry { @@ -175,4 +175,4 @@ int/*bool*/AnimationState_isComplete (AnimationState* self) { return !self->animation || self->time >= self->animation->duration; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/AnimationState.h b/cocos/editor-support/spine/AnimationState.h index 5362281660..5d6047b7c7 100644 --- a/cocos/editor-support/spine/AnimationState.h +++ b/cocos/editor-support/spine/AnimationState.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { AnimationStateData* const data; @@ -61,6 +61,6 @@ void AnimationState_clearAnimation (AnimationState* self); int/*bool*/AnimationState_isComplete (AnimationState* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ANIMATIONSTATE_H_ */ diff --git a/cocos/editor-support/spine/AnimationStateData.cpp b/cocos/editor-support/spine/AnimationStateData.cpp index b467dbfb7f..5f282a1d75 100644 --- a/cocos/editor-support/spine/AnimationStateData.cpp +++ b/cocos/editor-support/spine/AnimationStateData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _ToEntry _ToEntry; struct _ToEntry { @@ -147,4 +147,4 @@ float AnimationStateData_getMix (AnimationStateData* self, Animation* from, Anim return 0; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/AnimationStateData.h b/cocos/editor-support/spine/AnimationStateData.h index ea45653ed7..8b4284c8dc 100644 --- a/cocos/editor-support/spine/AnimationStateData.h +++ b/cocos/editor-support/spine/AnimationStateData.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { SkeletonData* const skeletonData; @@ -44,6 +44,6 @@ void AnimationStateData_setMix (AnimationStateData* self, Animation* from, Anima /* Returns 0 if there is no mixing between the animations. */ float AnimationStateData_getMix (AnimationStateData* self, Animation* from, Animation* to); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ANIMATIONSTATEDATA_H_ */ diff --git a/cocos/editor-support/spine/Atlas.cpp b/cocos/editor-support/spine/Atlas.cpp index 8b9861463f..1a2293bacb 100644 --- a/cocos/editor-support/spine/Atlas.cpp +++ b/cocos/editor-support/spine/Atlas.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { AtlasPage* AtlasPage_create (const char* name) { AtlasPage* self = NEW(AtlasPage); @@ -336,4 +336,4 @@ AtlasRegion* Atlas_findRegion (const Atlas* self, const char* name) { return 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Atlas.h b/cocos/editor-support/spine/Atlas.h index ea5ca9b781..066bf7af8b 100644 --- a/cocos/editor-support/spine/Atlas.h +++ b/cocos/editor-support/spine/Atlas.h @@ -26,7 +26,7 @@ #ifndef SPINE_ATLAS_H_ #define SPINE_ATLAS_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef enum { ATLAS_ALPHA, ATLAS_INTENSITY, ATLAS_LUMINANCE_ALPHA, ATLAS_RGB565, ATLAS_RGBA4444, ATLAS_RGB888, ATLAS_RGBA8888 @@ -101,6 +101,6 @@ void Atlas_dispose (Atlas* atlas); /* Returns 0 if the region was not found. */ AtlasRegion* Atlas_findRegion (const Atlas* self, const char* name); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATLAS_H_ */ diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.cpp b/cocos/editor-support/spine/AtlasAttachmentLoader.cpp index ce064df6eb..4a70175912 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.cpp +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Attachment* _AtlasAttachmentLoader_newAttachment (AttachmentLoader* loader, Skin* skin, AttachmentType type, const char* name) { AtlasAttachmentLoader* self = SUB_CAST(AtlasAttachmentLoader, loader); @@ -62,4 +62,4 @@ AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas) { return self; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/AtlasAttachmentLoader.h b/cocos/editor-support/spine/AtlasAttachmentLoader.h index 20e90464e2..7dcd266400 100644 --- a/cocos/editor-support/spine/AtlasAttachmentLoader.h +++ b/cocos/editor-support/spine/AtlasAttachmentLoader.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { AttachmentLoader super; @@ -38,6 +38,6 @@ typedef struct { AtlasAttachmentLoader* AtlasAttachmentLoader_create (Atlas* atlas); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATLASATTACHMENTLOADER_H_ */ diff --git a/cocos/editor-support/spine/Attachment.cpp b/cocos/editor-support/spine/Attachment.cpp index 50e158b676..3844e4eefb 100644 --- a/cocos/editor-support/spine/Attachment.cpp +++ b/cocos/editor-support/spine/Attachment.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _AttachmentVtable { void (*dispose) (Attachment* self); @@ -53,4 +53,4 @@ void Attachment_dispose (Attachment* self) { FREE(self); } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/Attachment.h b/cocos/editor-support/spine/Attachment.h index 7be7cf0dc5..868de80cb1 100644 --- a/cocos/editor-support/spine/Attachment.h +++ b/cocos/editor-support/spine/Attachment.h @@ -26,7 +26,7 @@ #ifndef SPINE_ATTACHMENT_H_ #define SPINE_ATTACHMENT_H_ -namespace cocos2d { namespace extension { +namespace spine { struct Slot; @@ -44,6 +44,6 @@ struct Attachment { void Attachment_dispose (Attachment* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATTACHMENT_H_ */ diff --git a/cocos/editor-support/spine/AttachmentLoader.cpp b/cocos/editor-support/spine/AttachmentLoader.cpp index 8e712a9c5e..9ebac1eb8c 100644 --- a/cocos/editor-support/spine/AttachmentLoader.cpp +++ b/cocos/editor-support/spine/AttachmentLoader.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _AttachmentLoaderVtable { Attachment* (*newAttachment) (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); @@ -74,4 +74,4 @@ void _AttachmentLoader_setUnknownTypeError (AttachmentLoader* self, AttachmentTy _AttachmentLoader_setError(self, "Unknown attachment type: ", buffer); } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/AttachmentLoader.h b/cocos/editor-support/spine/AttachmentLoader.h index 5fd81f5eb8..09934f97d1 100644 --- a/cocos/editor-support/spine/AttachmentLoader.h +++ b/cocos/editor-support/spine/AttachmentLoader.h @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct AttachmentLoader AttachmentLoader; struct AttachmentLoader { @@ -47,6 +47,6 @@ void AttachmentLoader_dispose (AttachmentLoader* self); /* Returns 0 to not load an attachment. If 0 is returned and AttachmentLoader.error1 is set, an error occurred. */ Attachment* AttachmentLoader_newAttachment (AttachmentLoader* self, Skin* skin, AttachmentType type, const char* name); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_ATTACHMENTLOADER_H_ */ diff --git a/cocos/editor-support/spine/Bone.cpp b/cocos/editor-support/spine/Bone.cpp index 17030f6405..9fda530792 100644 --- a/cocos/editor-support/spine/Bone.cpp +++ b/cocos/editor-support/spine/Bone.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static int yDown; @@ -96,4 +96,4 @@ void Bone_updateWorldTransform (Bone* self, int flipX, int flipY) { } } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Bone.h b/cocos/editor-support/spine/Bone.h index 3f4688a728..b03b54d197 100644 --- a/cocos/editor-support/spine/Bone.h +++ b/cocos/editor-support/spine/Bone.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct Bone Bone; struct Bone { @@ -54,6 +54,6 @@ void Bone_setToSetupPose (Bone* self); void Bone_updateWorldTransform (Bone* self, int/*bool*/flipX, int/*bool*/flipY); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_BONE_H_ */ diff --git a/cocos/editor-support/spine/BoneData.cpp b/cocos/editor-support/spine/BoneData.cpp index 09c356bb3d..5197d7f114 100644 --- a/cocos/editor-support/spine/BoneData.cpp +++ b/cocos/editor-support/spine/BoneData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { BoneData* BoneData_create (const char* name, BoneData* parent) { BoneData* self = NEW(BoneData); @@ -42,4 +42,4 @@ void BoneData_dispose (BoneData* self) { FREE(self); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/BoneData.h b/cocos/editor-support/spine/BoneData.h index 54126a700d..f2d63430fb 100644 --- a/cocos/editor-support/spine/BoneData.h +++ b/cocos/editor-support/spine/BoneData.h @@ -26,7 +26,7 @@ #ifndef SPINE_BONEDATA_H_ #define SPINE_BONEDATA_H_ -namespace cocos2d { namespace extension { +namespace spine { typedef struct BoneData BoneData; struct BoneData { @@ -41,6 +41,6 @@ struct BoneData { BoneData* BoneData_create (const char* name, BoneData* parent); void BoneData_dispose (BoneData* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_BONEDATA_H_ */ diff --git a/cocos/editor-support/spine/CCSkeleton.cpp b/cocos/editor-support/spine/CCSkeleton.cpp index 9b961fb4f5..760dd6702c 100644 --- a/cocos/editor-support/spine/CCSkeleton.cpp +++ b/cocos/editor-support/spine/CCSkeleton.cpp @@ -30,7 +30,7 @@ USING_NS_CC; using std::min; using std::max; -namespace cocos2d { namespace extension { +namespace spine { CCSkeleton* CCSkeleton::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { CCSkeleton* node = new CCSkeleton(skeletonData, ownsSkeletonData); @@ -287,4 +287,4 @@ bool CCSkeleton::isOpacityModifyRGB () const { return premultipliedAlpha; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/CCSkeleton.h b/cocos/editor-support/spine/CCSkeleton.h index 70e76a8e02..ede5f9ae21 100644 --- a/cocos/editor-support/spine/CCSkeleton.h +++ b/cocos/editor-support/spine/CCSkeleton.h @@ -27,9 +27,10 @@ #define SPINE_CCSKELETON_H_ #include + #include "RegionAttachment.h" #include "cocos2d.h" -namespace cocos2d { namespace extension { +namespace spine { /** Draws a skeleton. @@ -107,6 +108,6 @@ private: void initialize (); }; -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_CCSKELETON_H_ */ diff --git a/cocos/editor-support/spine/CCSkeletonAnimation.cpp b/cocos/editor-support/spine/CCSkeletonAnimation.cpp index ad789fd5fc..8cf2a75e9a 100644 --- a/cocos/editor-support/spine/CCSkeletonAnimation.cpp +++ b/cocos/editor-support/spine/CCSkeletonAnimation.cpp @@ -32,7 +32,7 @@ using std::min; using std::max; using std::vector; -namespace cocos2d { namespace extension { +namespace spine { CCSkeletonAnimation* CCSkeletonAnimation::createWithData (SkeletonData* skeletonData) { CCSkeletonAnimation* node = new CCSkeletonAnimation(skeletonData); @@ -139,4 +139,4 @@ void CCSkeletonAnimation::clearAnimation (int stateIndex) { AnimationState_clearAnimation(states[stateIndex]); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/CCSkeletonAnimation.h b/cocos/editor-support/spine/CCSkeletonAnimation.h index 82b9feece2..4fdbd6f8a7 100644 --- a/cocos/editor-support/spine/CCSkeletonAnimation.h +++ b/cocos/editor-support/spine/CCSkeletonAnimation.h @@ -30,7 +30,7 @@ #include #include "cocos2d.h" -namespace cocos2d { namespace extension { +namespace spine { /** Draws an animated skeleton, providing a simple API for applying one or more animations and queuing animations to be played later. @@ -79,6 +79,6 @@ private: void initialize (); }; -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_CCSKELETONANIMATION_H_ */ diff --git a/cocos/editor-support/spine/Json.cpp b/cocos/editor-support/spine/Json.cpp index 656b8e52bb..d94c74ffe9 100644 --- a/cocos/editor-support/spine/Json.cpp +++ b/cocos/editor-support/spine/Json.cpp @@ -29,7 +29,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static const char* ep; @@ -372,4 +372,4 @@ int Json_getInt (Json* value, const char* name, int defaultValue) { return value ? (int)value->valuefloat : defaultValue; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Json.h b/cocos/editor-support/spine/Json.h index 35cccd6655..fef6afb552 100644 --- a/cocos/editor-support/spine/Json.h +++ b/cocos/editor-support/spine/Json.h @@ -25,7 +25,7 @@ #ifndef SPINE_JSON_H_ #define SPINE_JSON_H_ -namespace cocos2d { namespace extension { +namespace spine { /* Json Types: */ #define Json_False 0 @@ -72,6 +72,6 @@ int Json_getInt (Json* json, const char* name, int defaultValue); /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */ const char* Json_getError (void); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_JSON_H_ */ diff --git a/cocos/editor-support/spine/RegionAttachment.cpp b/cocos/editor-support/spine/RegionAttachment.cpp index 585df7af8f..c4c07d9832 100644 --- a/cocos/editor-support/spine/RegionAttachment.cpp +++ b/cocos/editor-support/spine/RegionAttachment.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { RegionAttachment* RegionAttachment_create (const char* name) { RegionAttachment* self = NEW(RegionAttachment); @@ -106,4 +106,4 @@ void RegionAttachment_computeVertices (RegionAttachment* self, float x, float y, vertices[VERTEX_Y4] = offset[VERTEX_X4] * bone->m10 + offset[VERTEX_Y4] * bone->m11 + y; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/RegionAttachment.h b/cocos/editor-support/spine/RegionAttachment.h index 8374c812b2..03dd5c7c7f 100644 --- a/cocos/editor-support/spine/RegionAttachment.h +++ b/cocos/editor-support/spine/RegionAttachment.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef enum { VERTEX_X1 = 0, VERTEX_Y1, VERTEX_X2, VERTEX_Y2, VERTEX_X3, VERTEX_Y3, VERTEX_X4, VERTEX_Y4 @@ -55,6 +55,6 @@ void RegionAttachment_setUVs (RegionAttachment* self, float u, float v, float u2 void RegionAttachment_updateOffset (RegionAttachment* self); void RegionAttachment_computeVertices (RegionAttachment* self, float x, float y, Bone* bone, float* vertices); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_REGIONATTACHMENT_H_ */ diff --git a/cocos/editor-support/spine/Skeleton.cpp b/cocos/editor-support/spine/Skeleton.cpp index 033e46bf02..145487f710 100644 --- a/cocos/editor-support/spine/Skeleton.cpp +++ b/cocos/editor-support/spine/Skeleton.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { Skeleton* Skeleton_create (SkeletonData* data) { int i, ii; @@ -199,4 +199,4 @@ void Skeleton_update (Skeleton* self, float deltaTime) { self->time += deltaTime; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Skeleton.h b/cocos/editor-support/spine/Skeleton.h index 54fa5aa0d4..61b1814c99 100644 --- a/cocos/editor-support/spine/Skeleton.h +++ b/cocos/editor-support/spine/Skeleton.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct Skeleton Skeleton; struct Skeleton { @@ -87,6 +87,6 @@ int Skeleton_setAttachment (Skeleton* self, const char* slotName, const char* at void Skeleton_update (Skeleton* self, float deltaTime); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETON_H_*/ diff --git a/cocos/editor-support/spine/SkeletonData.cpp b/cocos/editor-support/spine/SkeletonData.cpp index 9f781dc4f2..c891494c72 100644 --- a/cocos/editor-support/spine/SkeletonData.cpp +++ b/cocos/editor-support/spine/SkeletonData.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { SkeletonData* SkeletonData_create () { return NEW(SkeletonData); @@ -96,4 +96,4 @@ Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* ani return 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SkeletonData.h b/cocos/editor-support/spine/SkeletonData.h index b05bc4574a..1b97de972b 100644 --- a/cocos/editor-support/spine/SkeletonData.h +++ b/cocos/editor-support/spine/SkeletonData.h @@ -31,7 +31,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { int boneCount; @@ -61,6 +61,6 @@ Skin* SkeletonData_findSkin (const SkeletonData* self, const char* skinName); Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* animationName); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETONDATA_H_ */ diff --git a/cocos/editor-support/spine/SkeletonJson.cpp b/cocos/editor-support/spine/SkeletonJson.cpp index 35a0daa787..98e4be4334 100644 --- a/cocos/editor-support/spine/SkeletonJson.cpp +++ b/cocos/editor-support/spine/SkeletonJson.cpp @@ -32,7 +32,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { SkeletonJson super; @@ -414,4 +414,4 @@ SkeletonData* SkeletonJson_readSkeletonData (SkeletonJson* self, const char* jso return skeletonData; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SkeletonJson.h b/cocos/editor-support/spine/SkeletonJson.h index 1fd9b2875a..235a09b1af 100644 --- a/cocos/editor-support/spine/SkeletonJson.h +++ b/cocos/editor-support/spine/SkeletonJson.h @@ -32,7 +32,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { float scale; @@ -47,6 +47,6 @@ void SkeletonJson_dispose (SkeletonJson* self); SkeletonData* SkeletonJson_readSkeletonData (SkeletonJson* self, const char* json); SkeletonData* SkeletonJson_readSkeletonDataFile (SkeletonJson* self, const char* path); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKELETONJSON_H_ */ diff --git a/cocos/editor-support/spine/Skin.cpp b/cocos/editor-support/spine/Skin.cpp index d689c472ab..cd8b736d4f 100644 --- a/cocos/editor-support/spine/Skin.cpp +++ b/cocos/editor-support/spine/Skin.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct _Entry _Entry; struct _Entry { @@ -115,4 +115,4 @@ void Skin_attachAll (const Skin* self, Skeleton* skeleton, const Skin* oldSkin) } } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Skin.h b/cocos/editor-support/spine/Skin.h index f8d76a56f8..4dba09e524 100644 --- a/cocos/editor-support/spine/Skin.h +++ b/cocos/editor-support/spine/Skin.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { struct Skeleton; @@ -50,6 +50,6 @@ const char* Skin_getAttachmentName (const Skin* self, int slotIndex, int attachm /** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */ void Skin_attachAll (const Skin* self, struct Skeleton* skeleton, const Skin* oldSkin); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SKIN_H_ */ diff --git a/cocos/editor-support/spine/Slot.cpp b/cocos/editor-support/spine/Slot.cpp index a17fdc1d78..47ed9d3f61 100644 --- a/cocos/editor-support/spine/Slot.cpp +++ b/cocos/editor-support/spine/Slot.cpp @@ -27,7 +27,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { Slot super; @@ -80,4 +80,4 @@ void Slot_setToSetupPose (Slot* self) { Slot_setAttachment(self, attachment); } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/Slot.h b/cocos/editor-support/spine/Slot.h index 47b2a7f05d..44f2f48694 100644 --- a/cocos/editor-support/spine/Slot.h +++ b/cocos/editor-support/spine/Slot.h @@ -30,7 +30,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { struct Skeleton; @@ -53,6 +53,6 @@ float Slot_getAttachmentTime (const Slot* self); void Slot_setToSetupPose (Slot* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SLOT_H_ */ diff --git a/cocos/editor-support/spine/SlotData.cpp b/cocos/editor-support/spine/SlotData.cpp index 5f1478e6d2..fe0609edfe 100644 --- a/cocos/editor-support/spine/SlotData.cpp +++ b/cocos/editor-support/spine/SlotData.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { SlotData* SlotData_create (const char* name, BoneData* boneData) { SlotData* self = NEW(SlotData); @@ -53,4 +53,4 @@ void SlotData_setAttachmentName (SlotData* self, const char* attachmentName) { CONST_CAST(char*, self->attachmentName) = 0; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/SlotData.h b/cocos/editor-support/spine/SlotData.h index 660c30695c..b49efb86c9 100644 --- a/cocos/editor-support/spine/SlotData.h +++ b/cocos/editor-support/spine/SlotData.h @@ -28,7 +28,7 @@ #include -namespace cocos2d { namespace extension { +namespace spine { typedef struct { const char* const name; @@ -43,6 +43,6 @@ void SlotData_dispose (SlotData* self); /* @param attachmentName May be 0 for no setup pose attachment. */ void SlotData_setAttachmentName (SlotData* self, const char* attachmentName); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_SLOTDATA_H_ */ diff --git a/cocos/editor-support/spine/extension.cpp b/cocos/editor-support/spine/extension.cpp index dfdda7a96e..3fa34170b9 100644 --- a/cocos/editor-support/spine/extension.cpp +++ b/cocos/editor-support/spine/extension.cpp @@ -26,7 +26,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { static void* (*mallocFunc) (size_t size) = malloc; static void (*freeFunc) (void* ptr) = free; @@ -71,4 +71,4 @@ char* _readFile (const char* path, int* length) { return data; } -}} // namespace cocos2d { namespace extension { +} // namespace spine { diff --git a/cocos/editor-support/spine/extension.h b/cocos/editor-support/spine/extension.h index 37ae496e4b..019b7350d7 100644 --- a/cocos/editor-support/spine/extension.h +++ b/cocos/editor-support/spine/extension.h @@ -88,7 +88,7 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { /* * Functions that must be implemented: @@ -140,6 +140,6 @@ void _CurveTimeline_init (CurveTimeline* self, int frameCount, /**/ void (*apply) (const Timeline* self, Skeleton* skeleton, float time, float alpha)); void _CurveTimeline_deinit (CurveTimeline* self); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_EXTENSION_H_ */ diff --git a/cocos/editor-support/spine/spine-cocos2dx.cpp b/cocos/editor-support/spine/spine-cocos2dx.cpp index 74421b4390..cd9ea67e30 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.cpp +++ b/cocos/editor-support/spine/spine-cocos2dx.cpp @@ -28,7 +28,7 @@ USING_NS_CC; -namespace cocos2d { namespace extension { +namespace spine { void _AtlasPage_createTexture (AtlasPage* self, const char* path) { Texture2D* texture = TextureCache::getInstance()->addImage(path); @@ -106,4 +106,4 @@ void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, V3F_C4B_T2 quad->br.texCoords.v = self->uvs[VERTEX_Y4]; } -}} // namespace cocos2d { namespace extension { \ No newline at end of file +} // namespace spine { \ No newline at end of file diff --git a/cocos/editor-support/spine/spine-cocos2dx.h b/cocos/editor-support/spine/spine-cocos2dx.h index 234af2ecf1..d7d87b2bcc 100644 --- a/cocos/editor-support/spine/spine-cocos2dx.h +++ b/cocos/editor-support/spine/spine-cocos2dx.h @@ -31,10 +31,10 @@ #include #include -namespace cocos2d { namespace extension { +namespace spine { void RegionAttachment_updateQuad (RegionAttachment* self, Slot* slot, cocos2d::V3F_C4B_T2F_Quad* quad, bool premultiplied = false); -}} // namespace cocos2d { namespace extension { +} // namespace spine { #endif /* SPINE_COCOS2DX_H_ */ diff --git a/cocos/gui/Android.mk b/cocos/gui/Android.mk new file mode 100644 index 0000000000..197a65f3ad --- /dev/null +++ b/cocos/gui/Android.mk @@ -0,0 +1,49 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := gui_static + +LOCAL_MODULE_FILENAME := libgui + +LOCAL_SRC_FILES := UIRootWidget.cpp \ +UIWidget.cpp \ +Layout.cpp \ +LayoutParameter.cpp \ +UILayoutDefine.cpp \ +CocosGUI.cpp \ +UIHelper.cpp \ +UIInputManager.cpp \ +UILayer.cpp \ +UIDragPanel.cpp \ +UIListView.cpp \ +UIPageView.cpp \ +UIScrollView.cpp \ +UIButton.cpp \ +UICheckBox.cpp \ +UIImageView.cpp \ +UILabel.cpp \ +UILabelAtlas.cpp \ +UILabelBMFont.cpp \ +UILoadingBar.cpp \ +UISlider.cpp \ +UITextField.cpp + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static + +include $(BUILD_STATIC_LIBRARY) + + +$(call import-module,extensions) +$(call import-module,editor-support/cocostudio) +$(call import-module,2d) diff --git a/cocos/gui/system/CocosGUI.cpp b/cocos/gui/CocosGUI.cpp similarity index 96% rename from cocos/gui/system/CocosGUI.cpp rename to cocos/gui/CocosGUI.cpp index 2a0ebe9ebd..fcde79b273 100644 --- a/cocos/gui/system/CocosGUI.cpp +++ b/cocos/gui/CocosGUI.cpp @@ -22,13 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "CocosGUI.h" +#include "gui/CocosGUI.h" -NS_CC_EXT_BEGIN +namespace gui { const char* CocosGUIVersion() { return "CocosGUI v1.0.0.0"; } -NS_CC_EXT_END +} diff --git a/extensions/CCDeprecated-ext.cpp b/cocos/gui/CocosGUI.h similarity index 66% rename from extensions/CCDeprecated-ext.cpp rename to cocos/gui/CocosGUI.h index 383fe7bf00..497c4f89b6 100644 --- a/extensions/CCDeprecated-ext.cpp +++ b/cocos/gui/CocosGUI.h @@ -22,10 +22,32 @@ THE SOFTWARE. ****************************************************************************/ -#include "cocos-ext.h" - -NS_CC_EXT_BEGIN +#ifndef __COCOSGUI_H__ +#define __COCOSGUI_H__ +#include "gui/UIWidget.h" +#include "gui/Layout.h" +#include "gui/UIRootWidget.h" +#include "gui/UIButton.h" +#include "gui/UICheckBox.h" +#include "gui/UIImageView.h" +#include "gui/UILabel.h" +#include "gui/UILabelAtlas.h" +#include "gui/UILoadingBar.h" +#include "gui/UIScrollView.h" +#include "gui/UISlider.h" +#include "gui/UITextField.h" +#include "gui/UIListView.h" +#include "gui/UIDragPanel.h" +#include "gui/UILabelBMFont.h" +#include "gui/UIPageView.h" +#include "gui/UIHelper.h" +#include "gui/UILayer.h" +namespace gui { -NS_CC_EXT_END +const char* CocosGUIVersion(); + +} + +#endif /* defined(__CocosGUITest__Cocos__) */ diff --git a/cocos/gui/layouts/Layout.cpp b/cocos/gui/Layout.cpp similarity index 99% rename from cocos/gui/layouts/Layout.cpp rename to cocos/gui/Layout.cpp index 3492de9486..b7014ac1ed 100644 --- a/cocos/gui/layouts/Layout.cpp +++ b/cocos/gui/Layout.cpp @@ -22,12 +22,15 @@ THE SOFTWARE. ****************************************************************************/ -#include "Layout.h" -#include "../System/UILayer.h" -#include "../System/UIHelper.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "gui/layout.h" +#include "gui/UILayer.h" +#include "gui/UIHelper.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CLIPPINGLAYER dynamic_cast(_renderer) @@ -779,4 +782,4 @@ bool RectClippingNode::isEnabled() const return _enabled; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/Layout.h b/cocos/gui/Layout.h similarity index 83% rename from cocos/gui/layouts/Layout.h rename to cocos/gui/Layout.h index bf8719a06d..b58b0fbd2b 100644 --- a/cocos/gui/layouts/Layout.h +++ b/cocos/gui/Layout.h @@ -25,9 +25,9 @@ #ifndef __LAYOUT_H__ #define __LAYOUT_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -63,7 +63,7 @@ public: static Layout* create(); //override "hitTest" method of widget. - virtual bool hitTest(const Point &pt); + virtual bool hitTest(const cocos2d::Point &pt); //background /** @@ -81,7 +81,7 @@ public: * @param capinsets of background image. * */ - void setBackGroundImageCapInsets(const Rect& capInsets); + void setBackGroundImageCapInsets(const cocos2d::Rect& capInsets); /** * Sets Color Type for layout. @@ -102,7 +102,7 @@ public: * * @param color */ - void setBackGroundColor(const Color3B &color); + void setBackGroundColor(const cocos2d::Color3B &color); /** * Sets background color for layout, if color type is LAYOUT_COLOR_GRADIENT @@ -111,7 +111,7 @@ public: * * @param end color */ - void setBackGroundColor(const Color3B &startColor, const Color3B &endColor); + void setBackGroundColor(const cocos2d::Color3B &startColor, const cocos2d::Color3B &endColor); /** * Sets background opacity layout. @@ -125,10 +125,10 @@ public: * * @param vector */ - void setBackGroundColorVector(const Point &vector); + void setBackGroundColorVector(const cocos2d::Point &vector); //override "setColor" method of widget. - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); //override "setOpacity" method of widget. virtual void setOpacity(int opacity); @@ -143,7 +143,7 @@ public: * * @return background image texture size. */ - const Size& getBackGroundImageTextureSize() const; + const cocos2d::Size& getBackGroundImageTextureSize() const; /** * Changes if layout can clip it's content and child. @@ -166,7 +166,7 @@ public: * * Content size is widget's texture size. */ - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; /** * Sets LayoutType. @@ -209,43 +209,43 @@ protected: //background bool _backGroundScale9Enabled; - Node* _backGroundImage; + cocos2d::Node* _backGroundImage; std::string _backGroundImageFileName; - Rect _backGroundImageCapInsets; + cocos2d::Rect _backGroundImageCapInsets; LayoutBackGroundColorType _colorType; TextureResType _bgImageTexType; - LayerColor* _colorRender; - LayerGradient* _gradientRender; - Color3B _cColor; - Color3B _gStartColor; - Color3B _gEndColor; - Point _alongVector; + cocos2d::LayerColor* _colorRender; + cocos2d::LayerGradient* _gradientRender; + cocos2d::Color3B _cColor; + cocos2d::Color3B _gStartColor; + cocos2d::Color3B _gEndColor; + cocos2d::Point _alongVector; int _cOpacity; - Size _backGroundImageTextureSize; + cocos2d::Size _backGroundImageTextureSize; LayoutType _layoutType; }; -class RectClippingNode : public ClippingNode +class RectClippingNode : public cocos2d::ClippingNode { public: virtual ~RectClippingNode(); virtual bool init(); static RectClippingNode* create(); - void setClippingSize(const Size& size); + void setClippingSize(const cocos2d::Size& size); void setClippingEnabled(bool enabled); virtual void visit(); void setEnabled(bool enabled); bool isEnabled() const; protected: - DrawNode* m_pInnerStencil; + cocos2d::DrawNode* m_pInnerStencil; bool _enabled; private: RectClippingNode(); - Point rect[4]; - Size _clippingSize; + cocos2d::Point rect[4]; + cocos2d::Size _clippingSize; bool _clippingEnabled; }; -NS_CC_EXT_END +} #endif /* defined(__Layout__) */ diff --git a/cocos/gui/layouts/LayoutParameter.cpp b/cocos/gui/LayoutParameter.cpp similarity index 97% rename from cocos/gui/layouts/LayoutParameter.cpp rename to cocos/gui/LayoutParameter.cpp index 209979cdb9..01caa33158 100644 --- a/cocos/gui/layouts/LayoutParameter.cpp +++ b/cocos/gui/LayoutParameter.cpp @@ -22,10 +22,10 @@ THE SOFTWARE. ****************************************************************************/ -#include "LayoutParameter.h" -#include "Layout.h" +#include "gui/LayoutParameter.h" +#include "gui/Layout.h" -NS_CC_EXT_BEGIN +namespace gui { LayoutParameter* LayoutParameter::create() { @@ -118,4 +118,4 @@ const char* RelativeLayoutParameter::getRelativeName() const return _relativeLayoutName.c_str(); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/LayoutParameter.h b/cocos/gui/LayoutParameter.h similarity index 98% rename from cocos/gui/layouts/LayoutParameter.h rename to cocos/gui/LayoutParameter.h index 50d55c6586..3c457635d1 100644 --- a/cocos/gui/layouts/LayoutParameter.h +++ b/cocos/gui/LayoutParameter.h @@ -25,9 +25,9 @@ #ifndef __LAYOUTPARMETER_H__ #define __LAYOUTPARMETER_H__ -#include "UILayoutDefine.h" +#include "gui/UILayoutDefine.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -36,7 +36,7 @@ typedef enum LAYOUT_PARAMETER_RELATIVE }LayoutParameterType; -class LayoutParameter : public Object +class LayoutParameter : public cocos2d::Object { public: /** @@ -196,6 +196,6 @@ protected: std::string _relativeLayoutName; }; -NS_CC_EXT_END +} #endif /* defined(__LayoutParameter__) */ diff --git a/cocos/gui/widgets/UIButton.cpp b/cocos/gui/UIButton.cpp similarity index 99% rename from cocos/gui/widgets/UIButton.cpp rename to cocos/gui/UIButton.cpp index 7273378c0f..12cc3cc932 100644 --- a/cocos/gui/widgets/UIButton.cpp +++ b/cocos/gui/UIButton.cpp @@ -22,10 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIButton.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "gui/UIButton.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define NORMALRENDERERZ (0) #define PRESSEDRENDERERZ (0) @@ -614,4 +617,4 @@ const char* UIButton::getDescription() const return "Button"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UIButton.h b/cocos/gui/UIButton.h similarity index 83% rename from cocos/gui/widgets/UIButton.h rename to cocos/gui/UIButton.h index f44e897a90..94d40ec65f 100644 --- a/cocos/gui/widgets/UIButton.h +++ b/cocos/gui/UIButton.h @@ -25,9 +25,9 @@ #ifndef __UIBUTTON_H__ #define __UIBUTTON_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIButton : public UIWidget { @@ -92,31 +92,31 @@ public: * * @param capInsets capinsets for button */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsNormalRenderer(const Rect &capInsets); + void setCapInsetsNormalRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsPressedRenderer(const Rect &capInsets); + void setCapInsetsPressedRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for button, if button is using scale9 renderer. * * @param capInsets capinsets for button */ - void setCapInsetsDisabledRenderer(const Rect &capInsets); + void setCapInsetsDisabledRenderer(const cocos2d::Rect &capInsets); //override "setAnchorPoint" of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); /** * Sets if button is using scale9 renderer. @@ -148,10 +148,10 @@ public: virtual void ignoreContentAdaptWithSize(bool ignore); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Sets color to widget @@ -160,12 +160,12 @@ public: * * @param color */ - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); void setTitleText(const char* text); const char* getTitleText() const; - void setTitleColor(const Color3B& color); - const Color3B& getTitleColor() const; + void setTitleColor(const cocos2d::Color3B& color); + const cocos2d::Color3B& getTitleColor() const; void setTitleFontSize(float size); float getTitleFontSize() const; void setTitleFontName(const char* fontName); @@ -187,28 +187,28 @@ protected: void pressedTextureScaleChangedWithSize(); void disabledTextureScaleChangedWithSize(); protected: - Node* _buttonNormalRenderer; - Node* _buttonClickedRenderer; - Node* _buttonDisableRenderer; - LabelTTF* _titleRenderer; + cocos2d::Node* _buttonNormalRenderer; + cocos2d::Node* _buttonClickedRenderer; + cocos2d::Node* _buttonDisableRenderer; + cocos2d::LabelTTF* _titleRenderer; std::string _normalFileName; std::string _clickedFileName; std::string _disabledFileName; bool _prevIgnoreSize; bool _scale9Enabled; - Rect _capInsetsNormal; - Rect _capInsetsPressed; - Rect _capInsetsDisabled; + cocos2d::Rect _capInsetsNormal; + cocos2d::Rect _capInsetsPressed; + cocos2d::Rect _capInsetsDisabled; TextureResType _normalTexType; TextureResType _pressedTexType; TextureResType _disabledTexType; - Size _normalTextureSize; - Size _pressedTextureSize; - Size _disabledTextureSize; + cocos2d::Size _normalTextureSize; + cocos2d::Size _pressedTextureSize; + cocos2d::Size _disabledTextureSize; bool _pressedActionEnabled; - Color3B _titleColor; + cocos2d::Color3B _titleColor; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIButton__) */ diff --git a/cocos/gui/widgets/UICheckBox.cpp b/cocos/gui/UICheckBox.cpp similarity index 99% rename from cocos/gui/widgets/UICheckBox.cpp rename to cocos/gui/UICheckBox.cpp index 588ff138e1..f685d73b11 100644 --- a/cocos/gui/widgets/UICheckBox.cpp +++ b/cocos/gui/UICheckBox.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UICheckBox.h" +#include "gui/UICheckBox.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICheckBox::UICheckBox(): _backGroundBoxRenderer(NULL), @@ -461,4 +463,4 @@ const char* UICheckBox::getDescription() const return "CheckBox"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UICheckBox.h b/cocos/gui/UICheckBox.h similarity index 87% rename from cocos/gui/widgets/UICheckBox.h rename to cocos/gui/UICheckBox.h index 89f7473f05..46183f04db 100644 --- a/cocos/gui/widgets/UICheckBox.h +++ b/cocos/gui/UICheckBox.h @@ -25,9 +25,9 @@ #ifndef __UICHECKBOX_H__ #define __UICHECKBOX_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -35,8 +35,8 @@ typedef enum CHECKBOX_STATE_EVENT_UNSELECTED }CheckBoxEventType; -typedef void (CCObject::*SEL_SelectedStateEvent)(Object*,CheckBoxEventType); -#define checkboxselectedeventselector(_SELECTOR) (cocos2d::extension::SEL_SelectedStateEvent)(&_SELECTOR) +typedef void (cocos2d::CCObject::*SEL_SelectedStateEvent)(cocos2d::Object*,CheckBoxEventType); +#define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR) class UICheckBox : public UIWidget { @@ -131,10 +131,10 @@ public: bool getSelectedState(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //add a call back function would called when checkbox is selected or unselected. - void addEventListener(Object* target,SEL_SelectedStateEvent selector); + void addEventListener(cocos2d::Object* target,SEL_SelectedStateEvent selector); //override "setFlipX" method of widget. virtual void setFlipX(bool flipX); @@ -149,13 +149,13 @@ public: virtual bool isFlipY(); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -176,14 +176,14 @@ protected: void backGroundDisabledTextureScaleChangedWithSize(); void frontCrossDisabledTextureScaleChangedWithSize(); protected: - Sprite* _backGroundBoxRenderer; - Sprite* _backGroundSelectedBoxRenderer; - Sprite* _frontCrossRenderer; - Sprite* _backGroundBoxDisabledRenderer; - Sprite* _frontCrossDisabledRenderer; + cocos2d::Sprite* _backGroundBoxRenderer; + cocos2d::Sprite* _backGroundSelectedBoxRenderer; + cocos2d::Sprite* _frontCrossRenderer; + cocos2d::Sprite* _backGroundBoxDisabledRenderer; + cocos2d::Sprite* _frontCrossDisabledRenderer; bool _isSelected; - Object* _selectedStateEventListener; + cocos2d::Object* _selectedStateEventListener; SEL_SelectedStateEvent _selectedStateEventSelector; TextureResType _backGroundTexType; @@ -193,6 +193,6 @@ protected: TextureResType _frontCrossDisabledTexType; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UICheckBox__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp b/cocos/gui/UIDragPanel.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp rename to cocos/gui/UIDragPanel.cpp index e21d59e1b8..7c717c0636 100644 --- a/cocos/gui/widgets/ScrollWidget/UIDragPanel.cpp +++ b/cocos/gui/UIDragPanel.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIDragPanel.h" -#include "../../System/UILayer.h" +#include "gui/UIDragPanel.h" +#include "gui/UILayer.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIDragPanel::UIDragPanel() : _innerContainer(NULL) @@ -1264,4 +1266,4 @@ const char* UIDragPanel::getDescription() const return "DragPanel"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIDragPanel.h b/cocos/gui/UIDragPanel.h similarity index 80% rename from cocos/gui/widgets/ScrollWidget/UIDragPanel.h rename to cocos/gui/UIDragPanel.h index dc05b53d21..d6b4f0b62c 100644 --- a/cocos/gui/widgets/ScrollWidget/UIDragPanel.h +++ b/cocos/gui/UIDragPanel.h @@ -25,10 +25,10 @@ #ifndef __UIDRAGPANEL_H__ #define __UIDRAGPANEL_H__ -#include "../../Layouts/Layout.h" -#include "UIScrollInterface.h" +#include "gui/Layout.h" +#include "gui/UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { /** * drag panel move type @@ -95,7 +95,7 @@ typedef enum /** * dragpanel event */ -typedef void (Object::*SEL_DragPanelEvent)(Object*, DragPanelEventType); +typedef void (cocos2d::Object::*SEL_DragPanelEvent)(cocos2d::Object*, DragPanelEventType); #define dragpaneleventselector(_SELECTOR)(SEL_DragPanelEvent)(&_SELECTOR) class UIDragPanel : public Layout, public UIScrollInterface @@ -106,11 +106,11 @@ public: static UIDragPanel* create(); - virtual bool onTouchBegan(const Point &touchPoint); - virtual void onTouchMoved(const Point &touchPoint); - virtual void onTouchEnded(const Point &touchPoint); - virtual void onTouchCancelled(const Point &touchPoint); - virtual void onTouchLongClicked(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); virtual void update(float dt); @@ -129,22 +129,22 @@ public: /** * get widget children of inner container */ - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); /* gui mark */ /** * get and set inner container size */ - const Size& getInnerContainerSize() const; - void setInnerContainerSize(const Size &size); + const cocos2d::Size& getInnerContainerSize() const; + void setInnerContainerSize(const cocos2d::Size &size); /** * get and set inner container position */ - const Point& getInnerContainerPosition() const; - void setInnerContainerPosition(const Point& point, bool animated); + const cocos2d::Point& getInnerContainerPosition() const; + void setInnerContainerPosition(const cocos2d::Point& point, bool animated); /** * set inner container offset */ - void setInnerContainerOffset(const Point& offset, bool animated); + void setInnerContainerOffset(const cocos2d::Point& offset, bool animated); /**/ // auto move @@ -166,7 +166,7 @@ public: /** * event */ - void addEventListener(Object* target, SEL_DragPanelEvent selector); + void addEventListener(cocos2d::Object* target, SEL_DragPanelEvent selector); /** * get and set bounce enable @@ -221,26 +221,26 @@ protected: virtual void initRenderer(); virtual void releaseResoures(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender, const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender, const cocos2d::Point &touchPoint); /* gui mark */ // virtual bool isInScrollDegreeRange(UIWidget* widget); /**/ - virtual void checkChildInfo(int handleState, UIWidget *sender, const Point &touchPoint); + virtual void checkChildInfo(int handleState, UIWidget *sender, const cocos2d::Point &touchPoint); // void updateWidthAndHeight(); void recordSlidTime(float dt); /* gui mark */ - void setInnerContainerOffset(const Point& offset); + void setInnerContainerOffset(const cocos2d::Point& offset); /**/ // check if dragpanel rect contain inner rect bool checkContainInnerRect(); // move - void moveWithDelta(const Point& delta); + void moveWithDelta(const cocos2d::Point& delta); // auto move void autoMove(); @@ -250,10 +250,10 @@ protected: // berth // check if move to boundary with update - bool checkToBoundaryWithDeltaPosition(const Point& delta); + bool checkToBoundaryWithDeltaPosition(const cocos2d::Point& delta); // calculate to boundary delta - Point calculateToBoundaryDeltaPosition(const Point& paramDelta); + cocos2d::Point calculateToBoundaryDeltaPosition(const cocos2d::Point& paramDelta); // check berth bool checkBerth(); @@ -292,10 +292,10 @@ protected: void actionUpdate(float dt); void actionStop(); void actionDone(); - void moveByWithDuration(float duration, const Point& deltaPosition); + void moveByWithDuration(float duration, const cocos2d::Point& deltaPosition); void moveByInit(); void moveByUpdate(float t); - void moveToWithDuration(float duration, const Point& position); + void moveToWithDuration(float duration, const cocos2d::Point& position); void moveToInit(); void moveToUpdate(float t); virtual void onSizeChanged(); @@ -319,9 +319,9 @@ protected: bool _touchReleased; bool _touchCanceld; // check touch out of drag panel boundary - Point _touchStartNodeSpace; - Point _touchStartWorldSpace; - Point _touchEndWorldSpace; + cocos2d::Point _touchStartNodeSpace; + cocos2d::Point _touchStartWorldSpace; + cocos2d::Point _touchEndWorldSpace; float _slidTime; @@ -333,7 +333,7 @@ protected: float _autoMoveEaseRate; // event - Object* _eventLister; + cocos2d::Object* _eventLister; SEL_DragPanelEvent _eventSelector; // berth @@ -355,13 +355,13 @@ protected: float _elapsed; bool _firstTick; - Point _positionDelta; - Point _startPosition; - Point _previousPosition; + cocos2d::Point _positionDelta; + cocos2d::Point _startPosition; + cocos2d::Point _previousPosition; - Point _endPosition; + cocos2d::Point _endPosition; }; -NS_CC_EXT_END +} #endif /* defined(__TestCpp__UIDragPanel__) */ diff --git a/cocos/gui/system/UIHelper.cpp b/cocos/gui/UIHelper.cpp similarity index 96% rename from cocos/gui/system/UIHelper.cpp rename to cocos/gui/UIHelper.cpp index 188147e480..409d0f4461 100644 --- a/cocos/gui/system/UIHelper.cpp +++ b/cocos/gui/UIHelper.cpp @@ -22,13 +22,16 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIHelper.h" -#include "../../Json/DictionaryHelper.h" +#include "gui/UIHelper.h" #include "cocos2d.h" -#include "../../Reader/CCSGUIReader.h" +#include "cocostudio/DictionaryHelper.h" +#include "cocostudio/CCSGUIReader.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace cocostudio; + +namespace gui { static UIHelper* helperInstance = NULL; @@ -59,7 +62,7 @@ _fileDesignWidth(0.0f) UIHelper::~UIHelper() { - cocos2d::extension::CCSGUIReader::purgeCCSGUIReader(); + cocostudio::CCSGUIReader::purgeCCSGUIReader(); } void UIHelper::init() @@ -238,4 +241,4 @@ UIWidget* UIHelper::seekActionWidgetByActionTag(UIWidget* root, int tag) return NULL; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UIHelper.h b/cocos/gui/UIHelper.h similarity index 94% rename from cocos/gui/system/UIHelper.h rename to cocos/gui/UIHelper.h index 5446271b9b..cab106d26a 100644 --- a/cocos/gui/system/UIHelper.h +++ b/cocos/gui/UIHelper.h @@ -25,13 +25,13 @@ #ifndef __UIHELPER_H__ #define __UIHELPER_H__ -#include "UIInputManager.h" -#include "../../Json/CSContentJsonDictionary.h" +#include "gui/UIInputManager.h" +#include "cocostudio/CSContentJsonDictionary.h" -#define CCUIHELPER cocos2d::extension::UIHelper::instance() +#define CCUIHELPER gui::UIHelper::instance() -NS_CC_EXT_BEGIN +namespace gui { class UIHelper { @@ -116,9 +116,9 @@ protected: float _fileDesignWidth; float _fileDesignHeight; //texture - Array* _textureFiles; + cocos2d::Array* _textureFiles; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UISystem__) */ diff --git a/cocos/gui/widgets/UIImageView.cpp b/cocos/gui/UIImageView.cpp similarity index 98% rename from cocos/gui/widgets/UIImageView.cpp rename to cocos/gui/UIImageView.cpp index 23db5afef3..eef6ffe46b 100644 --- a/cocos/gui/widgets/UIImageView.cpp +++ b/cocos/gui/UIImageView.cpp @@ -22,10 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIImageView.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "gui/UIImageView.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CCSPRITE dynamic_cast(_imageRenderer) #define DYNAMIC_CAST_SCALE9SPRITE dynamic_cast(_imageRenderer) @@ -373,4 +376,4 @@ const char* UIImageView::getDescription() const return "ImageView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UIImageView.h b/cocos/gui/UIImageView.h similarity index 86% rename from cocos/gui/widgets/UIImageView.h rename to cocos/gui/UIImageView.h index 89e73d3fc4..91bd2573ec 100644 --- a/cocos/gui/widgets/UIImageView.h +++ b/cocos/gui/UIImageView.h @@ -25,9 +25,9 @@ #ifndef __UIIMAGEVIEW_H__ #define __UIIMAGEVIEW_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIImageView : public UIWidget { @@ -60,7 +60,7 @@ public: * Updates the texture rect of the UIImageView in points. * It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size. */ - void setTextureRect(const Rect& rect); + void setTextureRect(const cocos2d::Rect& rect); /** * Sets if imageview is using scale9 renderer. @@ -74,7 +74,7 @@ public: * * @param capInsets capinsets for imageview */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); //override "setFlipX" method of widget. virtual void setFlipX(bool flipX); @@ -89,13 +89,13 @@ public: virtual bool isFlipY(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); @@ -105,8 +105,8 @@ public: void setDoubleClickEnabled(bool able); void doubleClickEvent(); void checkDoubleClick(float dt); - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -124,13 +124,13 @@ protected: bool _doubleClickEnabled; bool _scale9Enabled; bool _prevIgnoreSize; - Rect _capInsets; - Node* _imageRenderer; + cocos2d::Rect _capInsets; + cocos2d::Node* _imageRenderer; std::string _textureFile; TextureResType _imageTexType; - Size _imageTextureSize; + cocos2d::Size _imageTextureSize; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIImageView__) */ diff --git a/cocos/gui/system/UIInputManager.cpp b/cocos/gui/UIInputManager.cpp similarity index 98% rename from cocos/gui/system/UIInputManager.cpp rename to cocos/gui/UIInputManager.cpp index 21371d481a..0fe2eb153e 100644 --- a/cocos/gui/system/UIInputManager.cpp +++ b/cocos/gui/UIInputManager.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIInputManager.h" -#include "UIHelper.h" +#include "gui/UIInputManager.h" +#include "gui/UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIInputManager::UIInputManager(): _manageredWidget(NULL), @@ -205,4 +207,4 @@ UIWidget* UIInputManager::getRootWidget() return _rootWidget; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UIInputManager.h b/cocos/gui/UIInputManager.h similarity index 79% rename from cocos/gui/system/UIInputManager.h rename to cocos/gui/UIInputManager.h index d0a178ae82..9547b091a1 100644 --- a/cocos/gui/system/UIInputManager.h +++ b/cocos/gui/UIInputManager.h @@ -26,9 +26,9 @@ #define __UIINPUTMANAGER_H__ #include "cocos2d.h" -#include "../Layouts/Layout.h" +#include "gui/Layout.h" -NS_CC_EXT_BEGIN +namespace gui { class UIInputManager { @@ -64,34 +64,34 @@ public: * * @return true that find a widget selected, false otherwise. */ - bool checkEventWidget(const Point &touchPoint); + bool checkEventWidget(const cocos2d::Point &touchPoint); void update(float dt); - bool onTouchBegan(Touch* touch); - void onTouchMoved(Touch* touch); - void onTouchEnd(Touch* touch); - void onTouchCancelled(Touch* touch); + bool onTouchBegan(cocos2d::Touch* touch); + void onTouchMoved(cocos2d::Touch* touch); + void onTouchEnd(cocos2d::Touch* touch); + void onTouchCancelled(cocos2d::Touch* touch); void setRootWidget(UIWidget* root); UIWidget* getRootWidget(); void addCheckedDoubleClickWidget(UIWidget* widget); protected: - bool checkTouchEvent(UIWidget* root, const Point& touchPoint); + bool checkTouchEvent(UIWidget* root, const cocos2d::Point& touchPoint); protected: - Array* _manageredWidget; - Array* _selectedWidgets; - Point _touchBeganedPoint; - Point _touchMovedPoint; - Point _touchEndedPoint; - Point _touchCanceledPoint; + cocos2d::Array* _manageredWidget; + cocos2d::Array* _selectedWidgets; + cocos2d::Point _touchBeganedPoint; + cocos2d::Point _touchMovedPoint; + cocos2d::Point _touchEndedPoint; + cocos2d::Point _touchCanceledPoint; bool _touchDown; float _longClickTime; float _longClickRecordTime; - Array* _checkedDoubleClickWidget; + cocos2d::Array* _checkedDoubleClickWidget; UIWidget* _rootWidget; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIInputManager__) */ diff --git a/cocos/gui/widgets/UILabel.cpp b/cocos/gui/UILabel.cpp similarity index 98% rename from cocos/gui/widgets/UILabel.cpp rename to cocos/gui/UILabel.cpp index 0bc0da834d..6ac5d68fdf 100644 --- a/cocos/gui/widgets/UILabel.cpp +++ b/cocos/gui/UILabel.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UILabel.h" +#include "gui/UILabel.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILabel::UILabel(): _touchScaleChangeEnabled(false), @@ -228,4 +230,4 @@ const char* UILabel::getDescription() const return "Label"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabel.h b/cocos/gui/UILabel.h similarity index 89% rename from cocos/gui/widgets/UILabel.h rename to cocos/gui/UILabel.h index 68b764595e..0d9150f17d 100644 --- a/cocos/gui/widgets/UILabel.h +++ b/cocos/gui/UILabel.h @@ -25,9 +25,9 @@ #ifndef __UILABEL_H__ #define __UILABEL_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UILabel : public UIWidget { @@ -109,22 +109,22 @@ public: virtual bool isFlipY(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. */ virtual const char* getDescription() const; - void setTextAreaSize(const Size &size); - void setTextHorizontalAlignment(TextHAlignment alignment); - void setTextVerticalAlignment(TextVAlignment alignment); + void setTextAreaSize(const cocos2d::Size &size); + void setTextHorizontalAlignment(cocos2d::TextHAlignment alignment); + void setTextVerticalAlignment(cocos2d::TextVAlignment alignment); void setTouchScaleChangeAble(bool able){setTouchScaleChangeEnabled(able);}; @@ -144,9 +144,9 @@ protected: std::string _fontName; int _fontSize; float _onSelectedScaleOffset; - LabelTTF* _labelRenderer; + cocos2d::LabelTTF* _labelRenderer; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__Label__) */ diff --git a/cocos/gui/widgets/UILabelAtlas.cpp b/cocos/gui/UILabelAtlas.cpp similarity index 98% rename from cocos/gui/widgets/UILabelAtlas.cpp rename to cocos/gui/UILabelAtlas.cpp index c4ba1922a7..72b816e4a6 100644 --- a/cocos/gui/widgets/UILabelAtlas.cpp +++ b/cocos/gui/UILabelAtlas.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UILabelAtlas.h" +#include "gui/UILabelAtlas.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICCLabelAtlas::UICCLabelAtlas() { @@ -172,4 +174,4 @@ const char* UILabelAtlas::getDescription() const return "LabelAtlase"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabelAtlas.h b/cocos/gui/UILabelAtlas.h similarity index 88% rename from cocos/gui/widgets/UILabelAtlas.h rename to cocos/gui/UILabelAtlas.h index 6ff0b65a1e..b74ea87644 100644 --- a/cocos/gui/widgets/UILabelAtlas.h +++ b/cocos/gui/UILabelAtlas.h @@ -25,11 +25,11 @@ #ifndef __UILABELATLAS_H__ #define __UILABELATLAS_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { -class UICCLabelAtlas : public LabelAtlas +class UICCLabelAtlas : public cocos2d::LabelAtlas { public: /** @@ -47,7 +47,7 @@ public: */ static UICCLabelAtlas* create(); void setProperty(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); - void setProperty(const char *string, Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); + void setProperty(const char *string, cocos2d::Texture2D *texture, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); virtual void updateDisplayedOpacity(GLubyte opacity); virtual void draw(void); }; @@ -80,13 +80,13 @@ public: const char* getStringValue(); //override "setAnchorPoint" method of widget. - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -100,6 +100,6 @@ protected: UICCLabelAtlas* _laberAtlasRenderer; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UILabelAtlas__) */ diff --git a/cocos/gui/widgets/UILabelBMFont.cpp b/cocos/gui/UILabelBMFont.cpp similarity index 96% rename from cocos/gui/widgets/UILabelBMFont.cpp rename to cocos/gui/UILabelBMFont.cpp index 23b0a2a1fc..b112c06bf4 100644 --- a/cocos/gui/widgets/UILabelBMFont.cpp +++ b/cocos/gui/UILabelBMFont.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UILabelBMFont.h" +#include "gui/UILabelBMFont.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILabelBMFont::UILabelBMFont(): _labelBMFontRenderer(NULL), @@ -58,7 +60,7 @@ void UILabelBMFont::initRenderer() void UILabelBMFont::setFntFile(const char *fileName) { - if (!fileName || std::strcmp(fileName, "") == 0) + if (!fileName || strcmp(fileName, "") == 0) { return; } @@ -132,4 +134,4 @@ const char* UILabelBMFont::getDescription() const } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILabelBMFont.h b/cocos/gui/UILabelBMFont.h similarity index 89% rename from cocos/gui/widgets/UILabelBMFont.h rename to cocos/gui/UILabelBMFont.h index a1eab88e2d..ddf4e31728 100644 --- a/cocos/gui/widgets/UILabelBMFont.h +++ b/cocos/gui/UILabelBMFont.h @@ -25,9 +25,9 @@ #ifndef __UILABELBMFONT_H__ #define __UILABELBMFONT_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UILabelBMFont : public UIWidget { @@ -55,9 +55,9 @@ public: /** get string value for labelbmfont*/ const char* getStringValue(); - virtual void setAnchorPoint(const Point &pt); - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual void setAnchorPoint(const cocos2d::Point &pt); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -68,10 +68,10 @@ protected: virtual void onSizeChanged(); void labelBMFontScaleChangedWithSize(); protected: - LabelBMFont* _labelBMFontRenderer; + cocos2d::LabelBMFont* _labelBMFontRenderer; bool _fntFileHasInit; }; -NS_CC_EXT_END +} #endif /* defined(__UILabelBMFont__) */ diff --git a/cocos/gui/system/UILayer.cpp b/cocos/gui/UILayer.cpp similarity index 97% rename from cocos/gui/system/UILayer.cpp rename to cocos/gui/UILayer.cpp index 917241f494..f92d73c9c7 100644 --- a/cocos/gui/system/UILayer.cpp +++ b/cocos/gui/UILayer.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "UILayer.h" -#include "UIHelper.h" +#include "gui/UILayer.h" +#include "gui/UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UILayer::UILayer(): _rootWidget(NULL), @@ -162,4 +164,4 @@ void UILayer::onTouchCancelled(Touch *pTouch, Event *pEvent) _inputManager->onTouchCancelled(pTouch); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/system/UILayer.h b/cocos/gui/UILayer.h similarity index 88% rename from cocos/gui/system/UILayer.h rename to cocos/gui/UILayer.h index 7108d6b757..6a041dda4a 100644 --- a/cocos/gui/system/UILayer.h +++ b/cocos/gui/UILayer.h @@ -27,14 +27,13 @@ #define __UILAYER_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../BaseClasses/UIRootWidget.h" -#include "../System/UIInputManager.h" +#include "gui/UIRootWidget.h" +#include "gui/UIInputManager.h" -NS_CC_EXT_BEGIN +namespace gui { -class UILayer : public Layer +class UILayer : public cocos2d::Layer { public: @@ -60,10 +59,10 @@ public: virtual void onExit(); virtual void onEnterTransitionDidFinish(); - virtual bool onTouchBegan(Touch *pTouch, Event *pEvent); - virtual void onTouchMoved(Touch *pTouch, Event *pEvent); - virtual void onTouchEnded(Touch *pTouch, Event *pEvent); - virtual void onTouchCancelled(Touch *pTouch, Event *pEvent); + virtual bool onTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchEnded(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); + virtual void onTouchCancelled(cocos2d::Touch *pTouch, cocos2d::Event *pEvent); /** * Add a widget to UILayer, for drawing. @@ -130,7 +129,7 @@ protected: UIInputManager* _inputManager; }; -NS_CC_EXT_END +} diff --git a/cocos/gui/layouts/UILayoutDefine.cpp b/cocos/gui/UILayoutDefine.cpp similarity index 97% rename from cocos/gui/layouts/UILayoutDefine.cpp rename to cocos/gui/UILayoutDefine.cpp index 54b8451c78..d79444fc75 100644 --- a/cocos/gui/layouts/UILayoutDefine.cpp +++ b/cocos/gui/UILayoutDefine.cpp @@ -21,9 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "UILayoutDefine.h" +#include "gui/UILayoutDefine.h" -NS_CC_EXT_BEGIN +namespace gui { UIMargin::UIMargin(void) : left(0), top(0), right(0), bottom(0) @@ -57,4 +57,4 @@ bool UIMargin::equals(const UIMargin &target) const return (left == target.left && top == target.top && right == target.right && bottom == target.bottom); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/layouts/UILayoutDefine.h b/cocos/gui/UILayoutDefine.h similarity index 97% rename from cocos/gui/layouts/UILayoutDefine.h rename to cocos/gui/UILayoutDefine.h index ac2df8ca65..1d0bd716bf 100644 --- a/cocos/gui/layouts/UILayoutDefine.h +++ b/cocos/gui/UILayoutDefine.h @@ -26,9 +26,8 @@ #define __UILAYOUTDEFINE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace gui { class UIMargin { @@ -83,6 +82,6 @@ typedef enum RELATIVE_LOCATION_BELOW_RIGHTALIGN }UIRelativeAlign; -NS_CC_EXT_END +} #endif /* defined(__UILayoutDefine__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIListView.cpp b/cocos/gui/UIListView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIListView.cpp rename to cocos/gui/UIListView.cpp index 27775474c5..5ec6e71540 100644 --- a/cocos/gui/widgets/ScrollWidget/UIListView.cpp +++ b/cocos/gui/UIListView.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIListView.h" +#include "gui/UIListView.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIListView::UIListView() : _direction(LISTVIEW_DIR_VERTICAL) @@ -1455,4 +1457,4 @@ const char* UIListView::getDescription() const } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIListView.h b/cocos/gui/UIListView.h similarity index 84% rename from cocos/gui/widgets/ScrollWidget/UIListView.h rename to cocos/gui/UIListView.h index 2bbbae212c..8830db6209 100644 --- a/cocos/gui/widgets/ScrollWidget/UIListView.h +++ b/cocos/gui/UIListView.h @@ -26,10 +26,10 @@ #define __UILISTVIEW_H__ /* gui mark */ -#include "../../Layouts/Layout.h" +#include "gui/Layout.h" /**/ -NS_CC_EXT_BEGIN +namespace gui { /** * list view direction @@ -62,7 +62,7 @@ typedef enum /** * list view event */ -typedef void (Object::*SEL_ListViewEvent)(Object*, ListViewEventType); +typedef void (cocos2d::Object::*SEL_ListViewEvent)(cocos2d::Object*, ListViewEventType); #define listvieweventselector(_SELECTOR)(SEL_ListViewEvent)(&_SELECTOR) class UIListView : public Layout @@ -85,11 +85,11 @@ public: */ virtual bool removeChild(UIWidget* child); - virtual bool onTouchBegan(const Point &touchPoint); - virtual void onTouchMoved(const Point &touchPoint); - virtual void onTouchEnded(const Point &touchPoint); - virtual void onTouchCancelled(const Point &touchPoint); - virtual void onTouchLongClicked(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); /** * set and get direction @@ -155,14 +155,14 @@ protected: virtual void resetProperty(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); /* gui mark */ // virtual bool isInScrollDegreeRange(UIWidget* widget); /**/ - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); void moveChildren(float offset); virtual bool scrollChildren(float touchOffset); @@ -212,14 +212,14 @@ protected: bool _bePressed; float _slidTime; - Point _moveChildPoint; + cocos2d::Point _moveChildPoint; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_ListViewEvent _eventSelector; - Array* _childPool; - Array* _updatePool; + cocos2d::Array* _childPool; + cocos2d::Array* _updatePool; int _dataLength; int _begin; @@ -228,10 +228,10 @@ protected: int _updateDataIndex; bool _updateSuccess; - Array* _overTopArray; - Array* _overBottomArray; - Array* _overLeftArray; - Array* _overRightArray; + cocos2d::Array* _overTopArray; + cocos2d::Array* _overBottomArray; + cocos2d::Array* _overLeftArray; + cocos2d::Array* _overRightArray; float _disBoundaryToChild_0; float _disBetweenChild; @@ -241,7 +241,7 @@ protected: /**/ }; -NS_CC_EXT_END +} #endif /* defined(__Test__UIListView__) */ diff --git a/cocos/gui/widgets/UILoadingBar.cpp b/cocos/gui/UILoadingBar.cpp similarity index 98% rename from cocos/gui/widgets/UILoadingBar.cpp rename to cocos/gui/UILoadingBar.cpp index ac53cf28ec..6d74be86c4 100644 --- a/cocos/gui/widgets/UILoadingBar.cpp +++ b/cocos/gui/UILoadingBar.cpp @@ -22,10 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "UILoadingBar.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "gui/UILoadingBar.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + using namespace cocos2d::extension; + +namespace gui { #define DYNAMIC_CAST_CCSPRITE dynamic_cast(_barRenderer) @@ -336,4 +339,4 @@ const char* UILoadingBar::getDescription() const return "LoadingBar"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UILoadingBar.h b/cocos/gui/UILoadingBar.h similarity index 92% rename from cocos/gui/widgets/UILoadingBar.h rename to cocos/gui/UILoadingBar.h index 5bf38a203a..b67e7314f5 100644 --- a/cocos/gui/widgets/UILoadingBar.h +++ b/cocos/gui/UILoadingBar.h @@ -25,9 +25,9 @@ #ifndef __UILOADINGBAR_H__ #define __UILOADINGBAR_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { @@ -106,16 +106,16 @@ public: * * @param capInsets capinsets for loadingbar */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Returns the "class name" of widget. @@ -130,15 +130,15 @@ protected: LoadingBarType _barType; int _percent; float _totalLength; - Node* _barRenderer; + cocos2d::Node* _barRenderer; TextureResType _renderBarTexType; - Size _barRendererTextureSize; + cocos2d::Size _barRendererTextureSize; bool _scale9Enabled; bool _prevIgnoreSize; - Rect _capInsets; + cocos2d::Rect _capInsets; std::string _textureFile; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UILoadingBar__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIPageView.cpp b/cocos/gui/UIPageView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIPageView.cpp rename to cocos/gui/UIPageView.cpp index 0313820ee7..0fc6558975 100644 --- a/cocos/gui/widgets/ScrollWidget/UIPageView.cpp +++ b/cocos/gui/UIPageView.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIPageView.h" +#include "gui/UIPageView.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIPageView::UIPageView(): _curPageIdx(0), @@ -570,4 +572,4 @@ const char* UIPageView::getDescription() const return "PageView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIPageView.h b/cocos/gui/UIPageView.h similarity index 84% rename from cocos/gui/widgets/ScrollWidget/UIPageView.h rename to cocos/gui/UIPageView.h index 6644ce5cd0..e8d3d5192d 100644 --- a/cocos/gui/widgets/ScrollWidget/UIPageView.h +++ b/cocos/gui/UIPageView.h @@ -25,17 +25,17 @@ #ifndef __UIPAGEVIEW_H__ #define __UIPAGEVIEW_H__ -#include "../../Layouts/Layout.h" -#include "UIScrollInterface.h" +#include "gui/Layout.h" +#include "gui/UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { PAGEVIEW_EVENT_TURNING, }PageViewEventType; -typedef void (Object::*SEL_PageViewEvent)(Object*, PageViewEventType); +typedef void (cocos2d::Object::*SEL_PageViewEvent)(cocos2d::Object*, PageViewEventType); #define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR) typedef enum { @@ -116,7 +116,7 @@ public: int getCurPageIndex() const; // event - void addEventListener(Object *target, SEL_PageViewEvent selector); + void addEventListener(cocos2d::Object *target, SEL_PageViewEvent selector); //override "removeChild" method of widget. virtual bool removeChild(UIWidget* widget); @@ -125,16 +125,16 @@ public: virtual void removeAllChildren(); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "update" method of widget. virtual void update(float dt); @@ -151,11 +151,11 @@ protected: Layout* createPage(); float getPositionXByIndex(int idx); void updateBoundaryPages(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState, UIWidget* sender, const Point &touchPoint); - virtual void checkChildInfo(int handleState, UIWidget* sender, const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint); + virtual void checkChildInfo(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint); virtual bool scrollPages(float touchOffset); void movePages(float offset); void pageTurningEvent(); @@ -166,12 +166,12 @@ protected: virtual void setClippingEnabled(bool able){Layout::setClippingEnabled(able);}; protected: int _curPageIdx; - Array* _pages; + cocos2d::Array* _pages; PVTouchDir _touchMoveDir; float _touchStartLocation; float _touchEndLocation; float _touchMoveStartLocation; - Point _movePagePoint; + cocos2d::Point _movePagePoint; UIWidget* _leftChild; UIWidget* _rightChild; float _leftBoundary; @@ -181,10 +181,10 @@ protected: float _autoScrollSpeed; int _autoScrollDir; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_PageViewEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__UIPageView__) */ diff --git a/cocos/gui/base-classes/UIRootWidget.cpp b/cocos/gui/UIRootWidget.cpp similarity index 96% rename from cocos/gui/base-classes/UIRootWidget.cpp rename to cocos/gui/UIRootWidget.cpp index bc34480328..f6bf7359f0 100644 --- a/cocos/gui/base-classes/UIRootWidget.cpp +++ b/cocos/gui/UIRootWidget.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIRootWidget.h" +#include "gui/UIRootWidget.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIRootWidget::UIRootWidget() { @@ -61,4 +63,4 @@ const char* UIRootWidget::getDescription() const return "RootWidget"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/base-classes/UIRootWidget.h b/cocos/gui/UIRootWidget.h similarity index 96% rename from cocos/gui/base-classes/UIRootWidget.h rename to cocos/gui/UIRootWidget.h index c08a75f457..f4bff4955f 100644 --- a/cocos/gui/base-classes/UIRootWidget.h +++ b/cocos/gui/UIRootWidget.h @@ -25,9 +25,9 @@ #ifndef __UIROOTWIDGET_H__ #define __UIROOTWIDGET_H__ -#include "../Layouts/Layout.h" +#include "gui/Layout.h" -NS_CC_EXT_BEGIN +namespace gui { class UIRootWidget : public Layout { @@ -56,6 +56,6 @@ protected: virtual bool init(); }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__RootWidget__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollInterface.h b/cocos/gui/UIScrollInterface.h similarity index 83% rename from cocos/gui/widgets/ScrollWidget/UIScrollInterface.h rename to cocos/gui/UIScrollInterface.h index df8566fc53..2e835982fd 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollInterface.h +++ b/cocos/gui/UIScrollInterface.h @@ -25,20 +25,20 @@ #ifndef __UISCROLLDELEGATE_H__ #define __UISCROLLDELEGATE_H__ -#include "../../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { class UIScrollInterface { protected: - virtual void handlePressLogic(const Point &touchPoint) = 0; - virtual void handleMoveLogic(const Point &touchPoint) = 0; - virtual void handleReleaseLogic(const Point &touchPoint) = 0; - virtual void interceptTouchEvent(int handleState, UIWidget* sender, const Point &touchPoint) = 0; + virtual void handlePressLogic(const cocos2d::Point &touchPoint) = 0; + virtual void handleMoveLogic(const cocos2d::Point &touchPoint) = 0; + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint) = 0; + virtual void interceptTouchEvent(int handleState, UIWidget* sender, const cocos2d::Point &touchPoint) = 0; // virtual bool isInScrollDegreeRange(UIWidget* widget) = 0; }; -NS_CC_EXT_END +} #endif /* defined(__UIScrollDelegate__) */ diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollView.cpp b/cocos/gui/UIScrollView.cpp similarity index 99% rename from cocos/gui/widgets/ScrollWidget/UIScrollView.cpp rename to cocos/gui/UIScrollView.cpp index 4575c6b832..bdb3d45a21 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollView.cpp +++ b/cocos/gui/UIScrollView.cpp @@ -22,10 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIScrollView.h" -#include "../../System/UILayer.h" +#include "gui/UIScrollView.h" +#include "gui/UILayer.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UIScrollView::UIScrollView(): _innerContainer(NULL), @@ -684,4 +686,4 @@ const char* UIScrollView::getDescription() const return "ScrollView"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/ScrollWidget/UIScrollView.h b/cocos/gui/UIScrollView.h similarity index 85% rename from cocos/gui/widgets/ScrollWidget/UIScrollView.h rename to cocos/gui/UIScrollView.h index ecf56cadd7..1a6cf31f99 100644 --- a/cocos/gui/widgets/ScrollWidget/UIScrollView.h +++ b/cocos/gui/UIScrollView.h @@ -25,10 +25,10 @@ #ifndef __UISCROLLVIEW_H__ #define __UISCROLLVIEW_H__ -#include "../../Layouts/Layout.h" -#include "UIScrollInterface.h" +#include "gui//Layout.h" +#include "gui/UIScrollInterface.h" -NS_CC_EXT_BEGIN +namespace gui { enum SCROLLVIEW_DIR { @@ -54,7 +54,7 @@ typedef enum SCROLLVIEW_EVENT_SCROLL_TO_RIGHT, }ScrollviewEventType; -typedef void (Object::*SEL_ScrollViewEvent)(Object*, ScrollviewEventType); +typedef void (cocos2d::Object::*SEL_ScrollViewEvent)(cocos2d::Object*, ScrollviewEventType); #define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR) @@ -120,7 +120,7 @@ public: * * @param inner container size. */ - void setInnerContainerSize(const Size &size); + void setInnerContainerSize(const cocos2d::Size &size); /** * Gets inner container size of scrollview. @@ -129,12 +129,12 @@ public: * * @return inner container size. */ - const Size& getInnerContainerSize() const; + const cocos2d::Size& getInnerContainerSize() const; /** * Add call back function called scrollview event triggered */ - void addEventListener(Object* target, SEL_ScrollViewEvent selector); + void addEventListener(cocos2d::Object* target, SEL_ScrollViewEvent selector); //override "addChild" method of widget. virtual bool addChild(UIWidget* widget); @@ -146,22 +146,22 @@ public: virtual bool removeChild(UIWidget* child); //override "getChildren" method of widget. - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "onTouchLongClicked" method of widget. - virtual void onTouchLongClicked(const Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); virtual void update(float dt); @@ -200,11 +200,11 @@ protected: virtual bool scrollChildren(float touchOffset); void startRecordSlidAction(); virtual void endRecordSlidAction(); - virtual void handlePressLogic(const Point &touchPoint); - virtual void handleMoveLogic(const Point &touchPoint); - virtual void handleReleaseLogic(const Point &touchPoint); - virtual void interceptTouchEvent(int handleState,UIWidget* sender,const Point &touchPoint); - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void handlePressLogic(const cocos2d::Point &touchPoint); + virtual void handleMoveLogic(const cocos2d::Point &touchPoint); + virtual void handleReleaseLogic(const cocos2d::Point &touchPoint); + virtual void interceptTouchEvent(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); void recordSlidTime(float dt); //override "releaseResoures" method of widget. virtual void releaseResoures(); @@ -242,14 +242,14 @@ protected: bool _bePressed; float _slidTime; - Point _moveChildPoint; + cocos2d::Point _moveChildPoint; float _childFocusCancelOffset; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_ScrollViewEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UIScrollView__) */ diff --git a/cocos/gui/widgets/UISlider.cpp b/cocos/gui/UISlider.cpp similarity index 98% rename from cocos/gui/widgets/UISlider.cpp rename to cocos/gui/UISlider.cpp index 022646033f..425fc581e0 100644 --- a/cocos/gui/widgets/UISlider.cpp +++ b/cocos/gui/UISlider.cpp @@ -22,10 +22,13 @@ THE SOFTWARE. ****************************************************************************/ -#include "UISlider.h" -#include "../../../GUI/CCControlExtension/CCScale9Sprite.h" +#include "gui/UISlider.h" +#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; +using namespace cocos2d::extension; + +namespace gui { UISlider::UISlider(): _barRenderer(NULL), @@ -541,4 +544,4 @@ const char* UISlider::getDescription() const return "Slider"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UISlider.h b/cocos/gui/UISlider.h similarity index 83% rename from cocos/gui/widgets/UISlider.h rename to cocos/gui/UISlider.h index 39b912fbe6..0654336600 100644 --- a/cocos/gui/widgets/UISlider.h +++ b/cocos/gui/UISlider.h @@ -25,16 +25,16 @@ #ifndef __UISLIDER_H__ #define __UISLIDER_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { typedef enum { SLIDER_PERCENTCHANGED }SliderEventType; -typedef void (CCObject::*SEL_SlidPercentChangedEvent)(Object*,SliderEventType); +typedef void (cocos2d::CCObject::*SEL_SlidPercentChangedEvent)(cocos2d::Object*,SliderEventType); #define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR) class UISlider : public UIWidget @@ -76,21 +76,21 @@ public: * * @param capInsets capinsets for slider */ - void setCapInsets(const Rect &capInsets); + void setCapInsets(const cocos2d::Rect &capInsets); /** * Sets capinsets for slider, if slider is using scale9 renderer. * * @param capInsets capinsets for slider */ - void setCapInsetsBarRenderer(const Rect &capInsets); + void setCapInsetsBarRenderer(const cocos2d::Rect &capInsets); /** * Sets capinsets for slider, if slider is using scale9 renderer. * * @param capInsets capinsets for slider */ - void setCapInsetProgressBarRebderer(const Rect &capInsets); + void setCapInsetProgressBarRebderer(const cocos2d::Rect &capInsets); /** * Load textures for slider ball. @@ -158,25 +158,25 @@ public: /** * Add call back function called when slider's percent has changed to slider. */ - void addEventListener(Object* target,SEL_SlidPercentChangedEvent selector); + void addEventListener(cocos2d::Object* target,SEL_SlidPercentChangedEvent selector); //override "onTouchBegan" method of widget. - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); //override "onTouchMoved" method of widget. - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); //override "onTouchEnded" method of widget. - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); //override "onTouchCancelled" method of widget. - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); //override "getContentSize" method of widget. - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; //override "getVirtualRenderer" method of widget. - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); //override "ignoreContentAdaptWithSize" method of widget. virtual void ignoreContentAdaptWithSize(bool ignore); @@ -196,14 +196,14 @@ protected: void barRendererScaleChangedWithSize(); void progressBarRendererScaleChangedWithSize(); protected: - Node* _barRenderer; - Node* _progressBarRenderer; - Size _progressBarTextureSize; + cocos2d::Node* _barRenderer; + cocos2d::Node* _progressBarRenderer; + cocos2d::Size _progressBarTextureSize; - Sprite* _slidBallNormalRenderer; - Sprite* _slidBallPressedRenderer; - Sprite* _slidBallDisabledRenderer; - Node* _slidBallRenderer; + cocos2d::Sprite* _slidBallNormalRenderer; + cocos2d::Sprite* _slidBallPressedRenderer; + cocos2d::Sprite* _slidBallDisabledRenderer; + cocos2d::Node* _slidBallRenderer; float _barLength; int _percent; @@ -216,10 +216,10 @@ protected: std::string _slidBallPressedTextureFile; std::string _slidBallDisabledTextureFile; - Rect _capInsetsBarRenderer; - Rect _capInsetsProgressBarRenderer; + cocos2d::Rect _capInsetsBarRenderer; + cocos2d::Rect _capInsetsProgressBarRenderer; - Object* _slidPercentListener; + cocos2d::Object* _slidPercentListener; SEL_SlidPercentChangedEvent _slidPercentSelector; TextureResType _barTexType; TextureResType _progressBarTexType; @@ -228,6 +228,6 @@ protected: TextureResType _ballDTexType; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UISlider__) */ diff --git a/cocos/gui/widgets/UITextField.cpp b/cocos/gui/UITextField.cpp similarity index 99% rename from cocos/gui/widgets/UITextField.cpp rename to cocos/gui/UITextField.cpp index a3fb9d07c7..4e1365592d 100644 --- a/cocos/gui/widgets/UITextField.cpp +++ b/cocos/gui/UITextField.cpp @@ -22,9 +22,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "UITextField.h" +#include "gui/UITextField.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { UICCTextField::UICCTextField() : m_bMaxLengthEnabled(false) @@ -565,4 +567,4 @@ const char* UITextField::getDescription() const return "TextField"; } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/gui/widgets/UITextField.h b/cocos/gui/UITextField.h similarity index 81% rename from cocos/gui/widgets/UITextField.h rename to cocos/gui/UITextField.h index 4a2db5c68a..31b7052443 100644 --- a/cocos/gui/widgets/UITextField.h +++ b/cocos/gui/UITextField.h @@ -25,12 +25,12 @@ #ifndef __UITEXTFIELD_H__ #define __UITEXTFIELD_H__ -#include "../BaseClasses/UIWidget.h" +#include "gui/UIWidget.h" -NS_CC_EXT_BEGIN +namespace gui { -class UICCTextField: public TextFieldTTF, public TextFieldDelegate +class UICCTextField: public cocos2d::TextFieldTTF, public cocos2d::TextFieldDelegate { public: UICCTextField(); @@ -42,10 +42,10 @@ public: static UICCTextField* create(const char *placeholder, const char *fontName, float fontSize); // CCTextFieldDelegate - virtual bool onTextFieldAttachWithIME(TextFieldTTF *pSender); - virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender); - virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen); - virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen); + virtual bool onTextFieldAttachWithIME(cocos2d::TextFieldTTF *pSender); + virtual bool onTextFieldDetachWithIME(cocos2d::TextFieldTTF * pSender); + virtual bool onTextFieldInsertText(cocos2d::TextFieldTTF * pSender, const char * text, int nLen); + virtual bool onTextFieldDeleteBackward(cocos2d::TextFieldTTF * pSender, const char * delText, int nLen); void insertText(const char* text, int len); void deleteBackward(); @@ -92,7 +92,7 @@ typedef enum TEXTFIELD_EVENT_DELETE_BACKWARD, }TextFiledEventType; -typedef void (Object::*SEL_TextFieldEvent)(Object*, TextFiledEventType); +typedef void (cocos2d::Object::*SEL_TextFieldEvent)(cocos2d::Object*, TextFiledEventType); #define textfieldeventselector(_SELECTOR) (SEL_TextFieldEvent)(&_SELECTOR) //class UITextField : public UIWidget @@ -104,14 +104,14 @@ public: static UITextField* create(); virtual bool init(); virtual void initRenderer(); - void setTouchSize(const Size &size); + void setTouchSize(const cocos2d::Size &size); void setText(const char* text); void setPlaceHolder(const char* value); void setFontSize(int size); void setFontName(const char* name); virtual void didNotSelectSelf(); const char* getStringValue(); - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); void setMaxLengthEnabled(bool enable); bool isMaxLengthEnabled(); void setMaxLength(int length); @@ -128,9 +128,9 @@ public: void setInsertText(bool insertText); bool getDeleteBackward(); void setDeleteBackward(bool deleteBackward); - void addEventListener(Object* target, SEL_TextFieldEvent selecor); - virtual void setAnchorPoint(const Point &pt); - virtual void setColor(const Color3B &color); + void addEventListener(cocos2d::Object* target, SEL_TextFieldEvent selecor); + virtual void setAnchorPoint(const cocos2d::Point &pt); + virtual void setColor(const cocos2d::Color3B &color); virtual void setOpacity(int opacity); /** * Returns the "class name" of widget. @@ -143,8 +143,8 @@ public: void setMaxLengthEnable(bool is){setMaxLengthEnabled(is);}; void setPasswordEnable(bool is){setPasswordEnabled(is);}; /************/ - virtual const Size& getContentSize() const; - virtual Node* getVirtualRenderer(); + virtual const cocos2d::Size& getContentSize() const; + virtual cocos2d::Node* getVirtualRenderer(); protected: // event void attachWithIMEEvent(); @@ -160,11 +160,11 @@ protected: float _touchHeight; bool _useTouchArea; - Object* _eventListener; + cocos2d::Object* _eventListener; SEL_TextFieldEvent _eventSelector; }; -NS_CC_EXT_END +} #endif /* defined(__CocoGUI__UITextField__) */ diff --git a/cocos/gui/base-classes/UIWidget.cpp b/cocos/gui/UIWidget.cpp similarity index 99% rename from cocos/gui/base-classes/UIWidget.cpp rename to cocos/gui/UIWidget.cpp index e120e12186..ea9651582b 100644 --- a/cocos/gui/base-classes/UIWidget.cpp +++ b/cocos/gui/UIWidget.cpp @@ -22,12 +22,14 @@ THE SOFTWARE. ****************************************************************************/ -#include "UIWidget.h" -#include "../System/UILayer.h" -#include "../Layouts/Layout.h" -#include "../System/UIHelper.h" +#include "gui/UIWidget.h" +#include "gui/UILayer.h" +#include "gui/Layout.h" +#include "gui/UIHelper.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace gui { #define DYNAMIC_CAST_CCBLENDPROTOCOL dynamic_cast(_renderer) @@ -1215,4 +1217,4 @@ void GUIRenderer::visit() NodeRGBA::visit(); } -NS_CC_EXT_END +} diff --git a/cocos/gui/base-classes/UIWidget.h b/cocos/gui/UIWidget.h similarity index 89% rename from cocos/gui/base-classes/UIWidget.h rename to cocos/gui/UIWidget.h index e0163645cd..ebc7e8a665 100644 --- a/cocos/gui/base-classes/UIWidget.h +++ b/cocos/gui/UIWidget.h @@ -26,10 +26,9 @@ #define __UIWIDGET_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "../Layouts/UILayoutDefine.h" -#include "../Layouts/LayoutParameter.h" -NS_CC_EXT_BEGIN +#include "gui/UILayoutDefine.h" +#include "gui/LayoutParameter.h" +namespace gui { typedef enum @@ -71,14 +70,14 @@ typedef enum POSITION_PERCENT }PositionType; -typedef void (Object::*SEL_TouchEvent)(Object*,TouchEventType); -#define toucheventselector(_SELECTOR) (cocos2d::extension::SEL_TouchEvent)(&_SELECTOR) +typedef void (cocos2d::Object::*SEL_TouchEvent)(cocos2d::Object*,TouchEventType); +#define toucheventselector(_SELECTOR) (SEL_TouchEvent)(&_SELECTOR) //class UILayer; /*temp action*/ class UIActionNode; -class UIWidget : public Object +class UIWidget : public cocos2d::Object { public: /** @@ -300,7 +299,7 @@ public: * * @return An array of children */ - virtual Array* getChildren(); + virtual cocos2d::Array* getChildren(); /** * Gets the renderer of widget @@ -309,7 +308,7 @@ public: * * @return a CCNode object */ - Node* getRenderer(); + cocos2d::Node* getRenderer(); /** * Add a CCNode for rendering. @@ -320,7 +319,7 @@ public: * * @param zOrder Z order for drawing priority. Please refer to CCNode::setZOrder(int) */ - void addRenderer(Node* renderer, int zOrder); + void addRenderer(cocos2d::Node* renderer, int zOrder); /** * Remove a CCNode from widget. @@ -331,7 +330,7 @@ public: * * @param cleanup true if all running actions and callbacks on the render node will be cleanup, false otherwise. */ - void removeRenderer(Node* renderer, bool cleanup); + void removeRenderer(cocos2d::Node* renderer, bool cleanup); /** * Sets the parent widget @@ -352,7 +351,7 @@ public: /** * Sets the touch event target/selector of the menu item */ - void addTouchEventListener(Object* target,SEL_TouchEvent selector); + void addTouchEventListener(cocos2d::Object* target,SEL_TouchEvent selector); //cocos2d property @@ -365,7 +364,7 @@ public: * * @param position The position (x,y) of the widget in OpenGL coordinates */ - void setPosition(const Point &pos); + void setPosition(const cocos2d::Point &pos); /** * Changes the position (x,y) of the widget in OpenGL coordinates @@ -375,7 +374,7 @@ public: * * @param percent The percent (x,y) of the widget in OpenGL coordinates */ - void setPositionPercent(const Point &percent); + void setPositionPercent(const cocos2d::Point &percent); /** * Gets the position (x,y) of the widget in OpenGL coordinates @@ -384,7 +383,7 @@ public: * * @return The position (x,y) of the widget in OpenGL coordinates */ - const Point& getPosition(); + const cocos2d::Point& getPosition(); /** * Gets the percent (x,y) of the widget in OpenGL coordinates @@ -393,7 +392,7 @@ public: * * @return The percent (x,y) of the widget in OpenGL coordinates */ - const Point& getPositionPercent(); + const cocos2d::Point& getPositionPercent(); /** * Changes the position type of the widget @@ -424,7 +423,7 @@ public: * * @param anchorPoint The anchor point of widget. */ - virtual void setAnchorPoint(const Point &pt); + virtual void setAnchorPoint(const cocos2d::Point &pt); /** * Returns the anchor point in percent. @@ -433,7 +432,7 @@ public: * * @return The anchor point of widget. */ - const Point& getAnchorPoint(); + const cocos2d::Point& getAnchorPoint(); /** * Changes both X and Y scale factor of the widget. @@ -592,14 +591,14 @@ public: * * @param color */ - virtual void setColor(const Color3B &color); + virtual void setColor(const cocos2d::Color3B &color); /** * Gets color of widget * * @return color */ - virtual const Color3B& getColor(); + virtual const cocos2d::Color3B& getColor(); /** * Sets opacity to widget @@ -620,16 +619,16 @@ public: virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled); virtual bool isCascadeColorEnabled(); virtual void setCascadeColorEnabled(bool cascadeColorEnabled); - void setBlendFunc(BlendFunc blendFunc); + void setBlendFunc(cocos2d::BlendFunc blendFunc); //cocos action - virtual void setActionManager(ActionManager* actionManager); - virtual ActionManager* getActionManager(); - Action* runAction(Action* action); + virtual void setActionManager(cocos2d::ActionManager* actionManager); + virtual cocos2d::ActionManager* getActionManager(); + cocos2d::Action* runAction(cocos2d::Action* action); void stopAllActions(void); - void stopAction(Action* action); + void stopAction(cocos2d::Action* action); void stopActionByTag(int tag); - Action* getActionByTag(int tag); + cocos2d::Action* getActionByTag(int tag); /** * A call back function when widget lost of focus. @@ -643,33 +642,33 @@ public: * * @return true if the point is in parent's area, flase otherwise. */ - bool clippingParentAreaContainPoint(const Point &pt); + bool clippingParentAreaContainPoint(const cocos2d::Point &pt); /* * Sends the touch event to widget's parent */ - virtual void checkChildInfo(int handleState,UIWidget* sender,const Point &touchPoint); + virtual void checkChildInfo(int handleState,UIWidget* sender,const cocos2d::Point &touchPoint); /* * Gets the touch began point of widget when widget is selected. * * @return the touch began point. */ - const Point& getTouchStartPos(); + const cocos2d::Point& getTouchStartPos(); /* * Gets the touch move point of widget when widget is selected. * * @return the touch move point. */ - const Point& getTouchMovePos(); + const cocos2d::Point& getTouchMovePos(); /* * Gets the touch end point of widget when widget is selected. * * @return the touch end point. */ - const Point& getTouchEndPos(); + const cocos2d::Point& getTouchEndPos(); /** * Changes the tag that is used to identify the widget easily. @@ -717,14 +716,14 @@ public: * * @param size that is widget's size */ - virtual void setSize(const Size &size); + virtual void setSize(const cocos2d::Size &size); /** * Changes the percent that is widget's percent size * * @param percent that is widget's percent size */ - virtual void setSizePercent(const Point &percent); + virtual void setSizePercent(const cocos2d::Point &percent); /** * Changes the size type of widget. @@ -749,14 +748,14 @@ public: * * @return size */ - const Size& getSize() const; + const cocos2d::Size& getSize() const; /** * Returns size percent of widget * * @return size percent */ - const Point& getSizePercent() const; + const cocos2d::Point& getSizePercent() const; /** * Checks a point if is in widget's space @@ -765,7 +764,7 @@ public: * * @return true if the point is in widget's space, flase otherwise. */ - virtual bool hitTest(const Point &pt); + virtual bool hitTest(const cocos2d::Point &pt); /** * A call back function called when widget is selected, and on touch began. @@ -774,35 +773,35 @@ public: * * @return true if the event should be pass to parent, flase otherwise. */ - virtual bool onTouchBegan(const Point &touchPoint); + virtual bool onTouchBegan(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch moved. * * @param touch point */ - virtual void onTouchMoved(const Point &touchPoint); + virtual void onTouchMoved(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch ended. * * @param touch point */ - virtual void onTouchEnded(const Point &touchPoint); + virtual void onTouchEnded(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch canceled. * * @param touch point */ - virtual void onTouchCancelled(const Point &touchPoint); + virtual void onTouchCancelled(const cocos2d::Point &touchPoint); /** * A call back function called when widget is selected, and on touch long clicked. * * @param touch point */ - virtual void onTouchLongClicked(const Point &touchPoint); + virtual void onTouchLongClicked(const cocos2d::Point &touchPoint); /** * Sets a LayoutParameter to widget. @@ -839,12 +838,12 @@ public: * * @return world position of widget. */ - Point getWorldPosition(); + cocos2d::Point getWorldPosition(); /** * Converts a Point to world space coordinates. The result is in Points. */ - Point convertToWorldSpace(const Point& pt); + cocos2d::Point convertToWorldSpace(const cocos2d::Point& pt); /** * Gets the Virtual Renderer of widget. @@ -853,7 +852,7 @@ public: * * @return CCNode pointer. */ - virtual Node* getVirtualRenderer(); + virtual cocos2d::Node* getVirtualRenderer(); /** * Schedules the "update" method. @@ -870,7 +869,7 @@ public: * * Content size is widget's texture size. */ - virtual const Size& getContentSize() const; + virtual const cocos2d::Size& getContentSize() const; virtual void onEnter(); virtual void onExit(); @@ -922,16 +921,16 @@ protected: bool _touchPassedEnabled; ///< is the touch event should be passed bool _focus; ///< is the widget on focus int _widgetZOrder; ///< z-order value that affects the draw order and touch order - Point _anchorPoint; ///< anchor point normalized + cocos2d::Point _anchorPoint; ///< anchor point normalized UIWidget* _widgetParent; ///< parent of widget BrightStyle _brightStyle; ///< bright style bool _updateEnabled; ///< is "update" method scheduled - Node* _renderer; ///< base renderer - Point _touchStartPos; ///< touch began point - Point _touchMovePos; ///< touch moved point - Point _touchEndPos; ///< touch ended point + cocos2d::Node* _renderer; ///< base renderer + cocos2d::Point _touchStartPos; ///< touch began point + cocos2d::Point _touchMovePos; ///< touch moved point + cocos2d::Point _touchEndPos; ///< touch ended point - Object* _touchEventListener; + cocos2d::Object* _touchEventListener; SEL_TouchEvent _touchEventSelector; @@ -940,23 +939,23 @@ protected: std::string _name; WidgetType _widgetType; int _actionTag; - Size _size; - Size _customSize; + cocos2d::Size _size; + cocos2d::Size _customSize; LayoutParameter* _layoutParameter; bool _ignoreSize; - Array* _children; + cocos2d::Array* _children; bool _affectByClipping; - Scheduler* _scheduler; + cocos2d::Scheduler* _scheduler; SizeType _sizeType; - Point _sizePercent; + cocos2d::Point _sizePercent; PositionType _positionType; - Point _positionPercent; + cocos2d::Point _positionPercent; bool _isRunning; }; -class GUIRenderer : public NodeRGBA +class GUIRenderer : public cocos2d::NodeRGBA { public: GUIRenderer(); @@ -969,6 +968,6 @@ protected: bool _enabled; }; -NS_CC_EXT_END +} #endif /* defined(__UIWidget__) */ diff --git a/cocos/gui/system/CocosGUI.h b/cocos/gui/system/CocosGUI.h deleted file mode 100644 index ca080ea059..0000000000 --- a/cocos/gui/system/CocosGUI.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __COCOSGUI_H__ -#define __COCOSGUI_H__ - - -#include "../BaseClasses/UIWidget.h" -#include "../Layouts/Layout.h" -#include "../BaseClasses/UIRootWidget.h" -#include "../UIWidgets/UIButton.h" -#include "../UIWidgets/UICheckBox.h" -#include "../UIWidgets/UIImageView.h" -#include "../UIWidgets/UILabel.h" -#include "../UIWidgets/UILabelAtlas.h" -#include "../UIWidgets/UILoadingBar.h" -#include "../UIWidgets/ScrollWidget/UIScrollView.h" -#include "../UIWidgets/UISlider.h" -#include "../UIWidgets/UITextField.h" -#include "../UIWidgets/ScrollWidget/UIListView.h" -#include "../UIWidgets/ScrollWidget/UIDragPanel.h" -#include "../UIWidgets/UILabelBMFont.h" -#include "../UIWidgets/ScrollWidget/UIPageView.h" -#include "UIHelper.h" -#include "../../Reader/CCSGUIReader.h" -#include "UILayer.h" -NS_CC_EXT_BEGIN - -const char* CocosGUIVersion(); - -NS_CC_EXT_END - -#endif /* defined(__CocosGUITest__Cocos__) */ diff --git a/cocos/math/kazmath/include/kazmath/GL/matrix.h b/cocos/math/kazmath/include/kazmath/GL/matrix.h index a1c95f8bf9..8b624a9868 100644 --- a/cocos/math/kazmath/include/kazmath/GL/matrix.h +++ b/cocos/math/kazmath/include/kazmath/GL/matrix.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef KM_GL_MATRIX_H_INCLUDED #define KM_GL_MATRIX_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #define KM_GL_MODELVIEW 0x1700 #define KM_GL_PROJECTION 0x1701 diff --git a/cocos/math/kazmath/include/kazmath/aabb.h b/cocos/math/kazmath/include/kazmath/aabb.h index 629889cef1..e26d9771da 100644 --- a/cocos/math/kazmath/include/kazmath/aabb.h +++ b/cocos/math/kazmath/include/kazmath/aabb.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef KAZMATH_AABB_H_INCLUDED #define KAZMATH_AABB_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "vec3.h" #include "utility.h" diff --git a/cocos/math/kazmath/include/kazmath/mat3.h b/cocos/math/kazmath/include/kazmath/mat3.h index 4d22dfb28a..fc0668b20d 100644 --- a/cocos/math/kazmath/include/kazmath/mat3.h +++ b/cocos/math/kazmath/include/kazmath/mat3.h @@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef MAT3_H_INCLUDED #define MAT3_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/mat4.h b/cocos/math/kazmath/include/kazmath/mat4.h index 241a0b9ec0..f8ad019d5f 100644 --- a/cocos/math/kazmath/include/kazmath/mat4.h +++ b/cocos/math/kazmath/include/kazmath/mat4.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef MAT4_H_INCLUDED #define MAT4_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/plane.h b/cocos/math/kazmath/include/kazmath/plane.h index c4e4fe5b7e..a01d5fd744 100644 --- a/cocos/math/kazmath/include/kazmath/plane.h +++ b/cocos/math/kazmath/include/kazmath/plane.h @@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define KM_PLANE_NEAR 4 #define KM_PLANE_FAR 5 -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmVec3; diff --git a/cocos/math/kazmath/include/kazmath/quaternion.h b/cocos/math/kazmath/include/kazmath/quaternion.h index a3632f0ff9..2e9bb582c4 100644 --- a/cocos/math/kazmath/include/kazmath/quaternion.h +++ b/cocos/math/kazmath/include/kazmath/quaternion.h @@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern "C" { #endif -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmMat4; diff --git a/cocos/math/kazmath/include/kazmath/ray2.h b/cocos/math/kazmath/include/kazmath/ray2.h index 6734a95611..c93c3b4a4e 100644 --- a/cocos/math/kazmath/include/kazmath/ray2.h +++ b/cocos/math/kazmath/include/kazmath/ray2.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef RAY_2_H #define RAY_2_H -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" #include "vec2.h" diff --git a/cocos/math/kazmath/include/kazmath/utility.h b/cocos/math/kazmath/include/kazmath/utility.h index ed6bff6854..62b196be1c 100644 --- a/cocos/math/kazmath/include/kazmath/utility.h +++ b/cocos/math/kazmath/include/kazmath/utility.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef UTILITY_H_INCLUDED #define UTILITY_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #ifndef kmScalar diff --git a/cocos/math/kazmath/include/kazmath/vec2.h b/cocos/math/kazmath/include/kazmath/vec2.h index 6c29d4005f..d8fdf82e41 100644 --- a/cocos/math/kazmath/include/kazmath/vec2.h +++ b/cocos/math/kazmath/include/kazmath/vec2.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC2_H_INCLUDED #define VEC2_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" struct kmMat3; diff --git a/cocos/math/kazmath/include/kazmath/vec3.h b/cocos/math/kazmath/include/kazmath/vec3.h index eb74d41b61..d8c8641cf4 100644 --- a/cocos/math/kazmath/include/kazmath/vec3.h +++ b/cocos/math/kazmath/include/kazmath/vec3.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC3_H_INCLUDED #define VEC3_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include #ifndef kmScalar diff --git a/cocos/math/kazmath/include/kazmath/vec4.h b/cocos/math/kazmath/include/kazmath/vec4.h index 7956d2a794..ffdb70423d 100644 --- a/cocos/math/kazmath/include/kazmath/vec4.h +++ b/cocos/math/kazmath/include/kazmath/vec4.h @@ -26,7 +26,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef VEC4_H_INCLUDED #define VEC4_H_INCLUDED -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" #include "utility.h" struct kmMat4; diff --git a/cocos/network/Android.mk b/cocos/network/Android.mk new file mode 100644 index 0000000000..1e739f3d69 --- /dev/null +++ b/cocos/network/Android.mk @@ -0,0 +1,29 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := network_static + +LOCAL_MODULE_FILENAME := libnetwork + +LOCAL_SRC_FILES := HttpClient.cpp \ +SocketIO.cpp \ +WebSocket.cpp + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \ +$(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static +LOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static + +include $(BUILD_STATIC_LIBRARY) + +$(call import-module,2d) +$(call import-module,curl/prebuilt/android) +$(call import-module, websockets/prebuilt/android) diff --git a/cocos/network/HttpClient.cpp b/cocos/network/HttpClient.cpp index 252102fcab..e2ecc1c80c 100644 --- a/cocos/network/HttpClient.cpp +++ b/cocos/network/HttpClient.cpp @@ -32,7 +32,9 @@ #include "platform/CCFileUtils.h" -NS_CC_EXT_BEGIN + using namespace cocos2d; + +namespace network { static std::mutex s_requestQueueMutex; static std::mutex s_responseQueueMutex; @@ -514,6 +516,6 @@ void HttpClient::dispatchResponseCallbacks(float delta) } -NS_CC_EXT_END +} diff --git a/cocos/network/HttpClient.h b/cocos/network/HttpClient.h index b41ba226be..0c58917547 100644 --- a/cocos/network/HttpClient.h +++ b/cocos/network/HttpClient.h @@ -27,12 +27,12 @@ #define __CCHTTPREQUEST_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "HttpRequest.h" -#include "HttpResponse.h" +#include "network/HttpRequest.h" +#include "network/HttpResponse.h" +#include "network/HttpClient.h" -NS_CC_EXT_BEGIN +namespace network { /** * @addtogroup Network @@ -43,7 +43,7 @@ NS_CC_EXT_BEGIN /** @brief Singleton that handles asynchrounous http requests * Once the request completed, a callback will issued in main thread when it provided during make request */ -class HttpClient : public Object +class HttpClient : public cocos2d::Object { public: /** Return the shared instance **/ @@ -112,6 +112,6 @@ private: // end of Network group /// @} -NS_CC_EXT_END +} #endif //__CCHTTPREQUEST_H__ diff --git a/cocos/network/HttpRequest.h b/cocos/network/HttpRequest.h index 0bf8d82eb5..81715d7991 100644 --- a/cocos/network/HttpRequest.h +++ b/cocos/network/HttpRequest.h @@ -26,14 +26,13 @@ #define __HTTP_REQUEST_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" -NS_CC_EXT_BEGIN +namespace network { class HttpClient; class HttpResponse; -typedef void (Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); -#define httpresponse_selector(_SELECTOR) (cocos2d::extension::SEL_HttpResponse)(&_SELECTOR) +typedef void (cocos2d::Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response); +#define httpresponse_selector(_SELECTOR) (network::SEL_HttpResponse)(&_SELECTOR) /** @brief defines the object which users must packed for HttpClient::send(HttpRequest*) method. @@ -41,7 +40,7 @@ typedef void (Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* respo @since v2.0.2 */ -class HttpRequest : public Object +class HttpRequest : public cocos2d::Object { public: /** Use this enum type as param in setReqeustType(param) */ @@ -81,7 +80,7 @@ public: }; /** Override autorelease method to avoid developers to call it */ - Object* autorelease(void) + cocos2d::Object* autorelease(void) { CCASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); @@ -163,12 +162,12 @@ public: /** Required field. You should set the callback selector function at ack the http request completed */ - CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(Object* pTarget, SEL_CallFuncND pSelector) + CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(cocos2d::Object* pTarget, cocos2d::SEL_CallFuncND pSelector) { setResponseCallback(pTarget, (SEL_HttpResponse) pSelector); } - inline void setResponseCallback(Object* pTarget, SEL_HttpResponse pSelector) + inline void setResponseCallback(cocos2d::Object* pTarget, SEL_HttpResponse pSelector) { _pTarget = pTarget; _pSelector = pSelector; @@ -179,7 +178,7 @@ public: } } /** Get the target of callback selector funtion, mainly used by HttpClient */ - inline Object* getTarget() + inline cocos2d::Object* getTarget() { return _pTarget; } @@ -192,7 +191,7 @@ public: _prxy( SEL_HttpResponse cb ) :_cb(cb) {} ~_prxy(){}; operator SEL_HttpResponse() const { return _cb; } - CC_DEPRECATED_ATTRIBUTE operator SEL_CallFuncND() const { return (SEL_CallFuncND) _cb; } + CC_DEPRECATED_ATTRIBUTE operator cocos2d::SEL_CallFuncND() const { return (cocos2d::SEL_CallFuncND) _cb; } protected: SEL_HttpResponse _cb; }; @@ -221,12 +220,12 @@ protected: std::string _url; /// target url that this request is sent to std::vector _requestData; /// used for POST std::string _tag; /// user defined tag, to identify different requests in response callback - Object* _pTarget; /// callback target of pSelector function + cocos2d::Object* _pTarget; /// callback target of pSelector function SEL_HttpResponse _pSelector; /// callback function, e.g. MyLayer::onHttpResponse(HttpClient *sender, HttpResponse * response) void* _pUserData; /// You can add your customed data here std::vector _headers; /// custom http headers }; -NS_CC_EXT_END +} #endif //__HTTP_REQUEST_H__ diff --git a/cocos/network/HttpResponse.h b/cocos/network/HttpResponse.h index 3d6a848a4e..ac5fb68b2e 100644 --- a/cocos/network/HttpResponse.h +++ b/cocos/network/HttpResponse.h @@ -26,17 +26,16 @@ #define __HTTP_RESPONSE__ #include "cocos2d.h" -#include "ExtensionMacros.h" -#include "HttpRequest.h" +#include "network/HttpRequest.h" -NS_CC_EXT_BEGIN +namespace network { /** @brief defines the object which users will receive at onHttpCompleted(sender, HttpResponse) callback Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample @since v2.0.2 */ -class HttpResponse : public Object +class HttpResponse : public cocos2d::Object { public: /** Constructor, it's used by HttpClient internal, users don't need to create HttpResponse manually @@ -67,7 +66,7 @@ public: } /** Override autorelease method to prevent developers from calling it */ - Object* autorelease(void) + cocos2d::Object* autorelease(void) { CCASSERT(false, "HttpResponse is used between network thread and ui thread \ therefore, autorelease is forbidden here"); @@ -178,6 +177,6 @@ protected: }; -NS_CC_EXT_END +} #endif //__HTTP_RESPONSE_H__ diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 7510ce8d74..bb9acff3e1 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -28,11 +28,13 @@ ****************************************************************************/ #include "SocketIO.h" -#include "cocos-ext.h" -#include "network/WebSocket.h" +#include "WebSocket.h" +#include "HttpClient.h" #include -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace network { //class declarations @@ -41,7 +43,7 @@ NS_CC_EXT_BEGIN * Clients/endpoints may share the same impl to accomplish multiplexing on the same websocket */ class SIOClientImpl : - public Object, + public cocos2d::Object, public WebSocket::Delegate { private: @@ -51,7 +53,7 @@ private: WebSocket *_ws; - Dictionary* _clients; + cocos2d::Dictionary* _clients; public: SIOClientImpl(const std::string& host, int port); @@ -59,10 +61,10 @@ public: static SIOClientImpl* create(const std::string& host, int port); - virtual void onOpen(cocos2d::extension::WebSocket* ws); - virtual void onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data); - virtual void onClose(cocos2d::extension::WebSocket* ws); - virtual void onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error); + virtual void onOpen(WebSocket* ws); + virtual void onMessage(WebSocket* ws, const WebSocket::Data& data); + virtual void onClose(WebSocket* ws); + virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error); void connect(); void disconnect(); @@ -350,7 +352,7 @@ void SIOClientImpl::emit(std::string endpoint, std::string eventname, std::strin _ws->send(msg); } -void SIOClientImpl::onOpen(cocos2d::extension::WebSocket* ws) +void SIOClientImpl::onOpen(WebSocket* ws) { _connected = true; @@ -370,7 +372,7 @@ void SIOClientImpl::onOpen(cocos2d::extension::WebSocket* ws) log("SIOClientImpl::onOpen socket connected!"); } -void SIOClientImpl::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data) +void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data) { log("SIOClientImpl::onMessage received: %s", data.bytes); @@ -467,7 +469,7 @@ void SIOClientImpl::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d:: return; } -void SIOClientImpl::onClose(cocos2d::extension::WebSocket* ws) +void SIOClientImpl::onClose(WebSocket* ws) { if(_clients->count() > 0) { @@ -484,7 +486,7 @@ void SIOClientImpl::onClose(cocos2d::extension::WebSocket* ws) this->release(); } -void SIOClientImpl::onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error) +void SIOClientImpl::onError(WebSocket* ws, const WebSocket::ErrorCode& error) { } @@ -698,4 +700,4 @@ void SocketIO::removeSocket(const std::string& uri) _sockets->removeObjectForKey(uri); } -NS_CC_EXT_END \ No newline at end of file +} \ No newline at end of file diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 23badd8907..5ec76bcb9b 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -59,10 +59,9 @@ in the onClose method the pointer should be set to NULL or used to connect to a #ifndef __CC_SOCKETIO_H__ #define __CC_SOCKETIO_H__ -#include "ExtensionMacros.h" #include "cocos2d.h" -NS_CC_EXT_BEGIN +namespace network { //forward declarations class SIOClientImpl; @@ -104,7 +103,7 @@ private: static SocketIO *_inst; - Dictionary* _sockets; + cocos2d::Dictionary* _sockets; SIOClientImpl* getSocket(const std::string& uri); void addSocket(const std::string& uri, SIOClientImpl* socket); @@ -123,7 +122,7 @@ typedef std::map EventRegistry; * @brief A single connection to a socket.io endpoint */ class SIOClient - : public Object + : public cocos2d::Object { private: int _port; @@ -182,6 +181,6 @@ public: }; -NS_CC_EXT_END +} #endif /* defined(__CC_JSB_SOCKETIO_H__) */ diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 46ef29641a..883c1d8554 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -37,7 +37,9 @@ #include "libwebsockets.h" -NS_CC_EXT_BEGIN +using namespace cocos2d; + +namespace network { class WsMessage { @@ -645,4 +647,4 @@ void WebSocket::onUIThreadReceiveMessage(WsMessage* msg) } } -NS_CC_EXT_END +} diff --git a/cocos/network/WebSocket.h b/cocos/network/WebSocket.h index 8256dc5ebd..da9a497b71 100644 --- a/cocos/network/WebSocket.h +++ b/cocos/network/WebSocket.h @@ -30,7 +30,6 @@ #ifndef __CC_WEBSOCKET_H__ #define __CC_WEBSOCKET_H__ -#include "ExtensionMacros.h" #include "cocos2d.h" #include @@ -38,7 +37,7 @@ struct libwebsocket; struct libwebsocket_context; struct libwebsocket_protocols; -NS_CC_EXT_BEGIN +namespace network { class WsThreadHelper; class WsMessage; @@ -162,6 +161,6 @@ private: struct libwebsocket_protocols* _wsProtocols; }; -NS_CC_EXT_END +} #endif /* defined(__CC_JSB_WEBSOCKET_H__) */ diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index e477c31a01..412ec6b963 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_BODY_H__ #define __CCPHYSICS_BODY_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #include "CCPhysicsShape.h" diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index 605a6dcf80..86c39a05eb 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_CONTACT_H__ #define __CCPHYSICS_CONTACT_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsJoint.h b/cocos/physics/CCPhysicsJoint.h index 73383c39b6..7b78e1a089 100644 --- a/cocos/physics/CCPhysicsJoint.h +++ b/cocos/physics/CCPhysicsJoint.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_JOINT_H__ #define __CCPHYSICS_JOINT_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsShape.h b/cocos/physics/CCPhysicsShape.h index 4915035521..6ff731f273 100644 --- a/cocos/physics/CCPhysicsShape.h +++ b/cocos/physics/CCPhysicsShape.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_SHAPE_H__ #define __CCPHYSICS_SHAPE_H__ -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index 7ede980f53..1777a395f0 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -48,9 +48,9 @@ #include "Box2D/CCPhysicsJointInfo.h" #include "chipmunk/CCPhysicsHelper.h" -#include "draw_nodes/CCDrawNode.h" -#include "cocoa/CCArray.h" -#include "layers_scenes_transitions_nodes/CCScene.h" +#include "CCDrawNode.h" +#include "CCArray.h" +#include "CCScene.h" #include "CCDirector.h" #include diff --git a/cocos/physics/CCPhysicsWorld.h b/cocos/physics/CCPhysicsWorld.h index d7a30f37cf..da6a7477c6 100644 --- a/cocos/physics/CCPhysicsWorld.h +++ b/cocos/physics/CCPhysicsWorld.h @@ -30,8 +30,8 @@ #include -#include "cocoa/CCObject.h" -#include "cocoa/CCGeometry.h" +#include "CCObject.h" +#include "CCGeometry.h" #if (CC_PHYSICS_ENGINE == CC_PHYSICS_CHIPMUNK) diff --git a/cocos/physics/box2d/CCPhysicsBodyInfo.h b/cocos/physics/box2d/CCPhysicsBodyInfo.h index 730837ed9d..5c89ac5f19 100644 --- a/cocos/physics/box2d/CCPhysicsBodyInfo.h +++ b/cocos/physics/box2d/CCPhysicsBodyInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_BODY_INFO_H__ #define __CCPHYSICS_BODY_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsBodyInfo diff --git a/cocos/physics/box2d/CCPhysicsContactInfo.h b/cocos/physics/box2d/CCPhysicsContactInfo.h index b592caa0af..f1e41ef572 100644 --- a/cocos/physics/box2d/CCPhysicsContactInfo.h +++ b/cocos/physics/box2d/CCPhysicsContactInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_CONTACT_INFO_H__ #define __CCPHYSICS_CONTACT_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsContactInfo diff --git a/cocos/physics/box2d/CCPhysicsHelper.h b/cocos/physics/box2d/CCPhysicsHelper.h index 86ef7d74ee..61dd2b6e4c 100644 --- a/cocos/physics/box2d/CCPhysicsHelper.h +++ b/cocos/physics/box2d/CCPhysicsHelper.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_HELPER_H__ #define __CCPHYSICS_HELPER_H__ -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformMacros.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/box2d/CCPhysicsJointInfo.h b/cocos/physics/box2d/CCPhysicsJointInfo.h index abcf089387..a60ecdb97e 100644 --- a/cocos/physics/box2d/CCPhysicsJointInfo.h +++ b/cocos/physics/box2d/CCPhysicsJointInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_JOINT_INFO_H__ #define __CCPHYSICS_JOINT_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsJointInfo diff --git a/cocos/physics/box2d/CCPhysicsShapeInfo.h b/cocos/physics/box2d/CCPhysicsShapeInfo.h index 9091001887..8608f0bad1 100644 --- a/cocos/physics/box2d/CCPhysicsShapeInfo.h +++ b/cocos/physics/box2d/CCPhysicsShapeInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_SHAPE_INFO_H__ #define __CCPHYSICS_SHAPE_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsShapeInfo diff --git a/cocos/physics/box2d/CCPhysicsWorldInfo.h b/cocos/physics/box2d/CCPhysicsWorldInfo.h index bcc09124db..662fa19843 100644 --- a/cocos/physics/box2d/CCPhysicsWorldInfo.h +++ b/cocos/physics/box2d/CCPhysicsWorldInfo.h @@ -27,7 +27,7 @@ #ifndef __CCPHYSICS_WORLD_INFO_H__ #define __CCPHYSICS_WORLD_INFO_H__ -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsWorldInfo diff --git a/cocos/physics/chipmunk/CCPhysicsBodyInfo.h b/cocos/physics/chipmunk/CCPhysicsBodyInfo.h index 0faef2eb49..03a8e0fee4 100644 --- a/cocos/physics/chipmunk/CCPhysicsBodyInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsBodyInfo.h @@ -28,8 +28,8 @@ #ifndef __CCPHYSICS_BODY_INFO_H__ #define __CCPHYSICS_BODY_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCObject.h" +#include "CCPlatformMacros.h" +#include "CCObject.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsContactInfo.h b/cocos/physics/chipmunk/CCPhysicsContactInfo.h index 5033a2181d..6c302947b7 100644 --- a/cocos/physics/chipmunk/CCPhysicsContactInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsContactInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_CONTACT_INFO_H__ #define __CCPHYSICS_CONTACT_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsContact; diff --git a/cocos/physics/chipmunk/CCPhysicsHelper.h b/cocos/physics/chipmunk/CCPhysicsHelper.h index a026d632b7..8c3bed53ef 100644 --- a/cocos/physics/chipmunk/CCPhysicsHelper.h +++ b/cocos/physics/chipmunk/CCPhysicsHelper.h @@ -29,8 +29,8 @@ #define __CCPHYSICS_HELPER_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" -#include "cocoa/CCGeometry.h" +#include "CCPlatformMacros.h" +#include "CCGeometry.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsJointInfo.h b/cocos/physics/chipmunk/CCPhysicsJointInfo.h index 47b1fc6141..9e09abf52b 100644 --- a/cocos/physics/chipmunk/CCPhysicsJointInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsJointInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_JOINT_INFO_H__ #define __CCPHYSICS_JOINT_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsJointInfo diff --git a/cocos/physics/chipmunk/CCPhysicsShapeInfo.h b/cocos/physics/chipmunk/CCPhysicsShapeInfo.h index 5e9f2a73e3..61da25d63b 100644 --- a/cocos/physics/chipmunk/CCPhysicsShapeInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsShapeInfo.h @@ -31,7 +31,7 @@ #include #include #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN diff --git a/cocos/physics/chipmunk/CCPhysicsWorldInfo.h b/cocos/physics/chipmunk/CCPhysicsWorldInfo.h index 3bc0cf2bc4..71d56f0a5b 100644 --- a/cocos/physics/chipmunk/CCPhysicsWorldInfo.h +++ b/cocos/physics/chipmunk/CCPhysicsWorldInfo.h @@ -28,7 +28,7 @@ #ifndef __CCPHYSICS_WORLD_INFO_H__ #define __CCPHYSICS_WORLD_INFO_H__ #include "chipmunk.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformMacros.h" NS_CC_BEGIN class PhysicsWorldInfo diff --git a/cocos/platform/CCPlatformConfig.h b/cocos/platform/CCPlatformConfig.h deleted file mode 100644 index 5ba0757dac..0000000000 --- a/cocos/platform/CCPlatformConfig.h +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_PLATFORM_CONFIG_H__ -#define __CC_PLATFORM_CONFIG_H__ - -/** -Config of cocos2d-x project, per target platform. -*/ - -////////////////////////////////////////////////////////////////////////// -// pre configure -////////////////////////////////////////////////////////////////////////// - -// define supported target platform macro which CC uses. -#define CC_PLATFORM_UNKNOWN 0 -#define CC_PLATFORM_IOS 1 -#define CC_PLATFORM_ANDROID 2 -#define CC_PLATFORM_WIN32 3 -#define CC_PLATFORM_MARMALADE 4 -#define CC_PLATFORM_LINUX 5 -#define CC_PLATFORM_BADA 6 -#define CC_PLATFORM_BLACKBERRY 7 -#define CC_PLATFORM_MAC 8 -#define CC_PLATFORM_NACL 9 -#define CC_PLATFORM_EMSCRIPTEN 10 -#define CC_PLATFORM_TIZEN 11 -#define CC_PLATFORM_QT5 12 - -// Determine target platform by compile environment macro. -#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN - -// mac -#if defined(CC_TARGET_OS_MAC) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_MAC -#endif - -// iphone -#if defined(CC_TARGET_OS_IPHONE) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_IOS -#endif - -// android -#if defined(ANDROID) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID -#endif - -// win32 -#if defined(WIN32) && defined(_WINDOWS) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_WIN32 -#endif - -// linux -#if defined(LINUX) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_LINUX -#endif - -// marmalade -#if defined(MARMALADE) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_MARMALADE -#endif - -// bada -#if defined(SHP) -#undef CC_TARGET_PLATFORM -#define CC_TARGET_PLATFORM CC_PLATFORM_BADA -#endif - -// qnx -#if defined(__QNX__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_BLACKBERRY -#endif - -// native client -#if defined(__native_client__) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_NACL -#endif - -// Emscripten -#if defined(EMSCRIPTEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN -#endif - -// tizen -#if defined(TIZEN) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_TIZEN -#endif - -// qt5 -#if defined(CC_TARGET_QT5) - #undef CC_TARGET_PLATFORM - #define CC_TARGET_PLATFORM CC_PLATFORM_QT5 -#endif - -////////////////////////////////////////////////////////////////////////// -// post configure -////////////////////////////////////////////////////////////////////////// - -// check user set platform -#if ! CC_TARGET_PLATFORM - #error "Cannot recognize the target platform; are you targeting an unsupported platform?" -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -#pragma warning (disable:4127) -#endif // CC_PLATFORM_WIN32 - -#endif // __CC_PLATFORM_CONFIG_H__ - diff --git a/cocos/platform/CCPlatformMacros.h b/cocos/platform/CCPlatformMacros.h deleted file mode 100644 index fca1255c0d..0000000000 --- a/cocos/platform/CCPlatformMacros.h +++ /dev/null @@ -1,301 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#ifndef __CC_PLATFORM_MACROS_H__ -#define __CC_PLATFORM_MACROS_H__ - -/** - * define some platform specific macros - */ -#include "ccConfig.h" -#include "CCPlatformConfig.h" -#include "CCPlatformDefine.h" - -/** - * define a create function for a specific type, such as Layer - * @param \__TYPE__ class type to add create(), such as Layer - */ -#define CREATE_FUNC(__TYPE__) \ -static __TYPE__* create() \ -{ \ - __TYPE__ *pRet = new __TYPE__(); \ - if (pRet && pRet->init()) \ - { \ - pRet->autorelease(); \ - return pRet; \ - } \ - else \ - { \ - delete pRet; \ - pRet = NULL; \ - return NULL; \ - } \ -} - -/** - * define a node function for a specific type, such as Layer - * @param \__TYPE__ class type to add node(), such as Layer - * @deprecated This interface will be deprecated sooner or later. - */ -#define NODE_FUNC(__TYPE__) \ -CC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \ -{ \ - __TYPE__ *pRet = new __TYPE__(); \ - if (pRet && pRet->init()) \ - { \ - pRet->autorelease(); \ - return pRet; \ - } \ - else \ - { \ - delete pRet; \ - pRet = NULL; \ - return NULL; \ - } \ -} - -/** @def CC_ENABLE_CACHE_TEXTURE_DATA -Enable it if you want to cache the texture data. -Not enabling for Emscripten any more -- doesn't seem necessary and don't want -to be different from other platforms unless there's a good reason. - -It's new in cocos2d-x since v0.99.5 -*/ -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - #define CC_ENABLE_CACHE_TEXTURE_DATA 1 -#else - #define CC_ENABLE_CACHE_TEXTURE_DATA 0 -#endif - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) - /* Application will crash in glDrawElements function on some win32 computers and some android devices. - Indices should be bound again while drawing to avoid this bug. - */ - #define CC_REBIND_INDICES_BUFFER 1 -#else - #define CC_REBIND_INDICES_BUFFER 0 -#endif - -// generic macros - -// namespace cocos2d {} -#ifdef __cplusplus - #define NS_CC_BEGIN namespace cocos2d { - #define NS_CC_END } - #define USING_NS_CC using namespace cocos2d -#else - #define NS_CC_BEGIN - #define NS_CC_END - #define USING_NS_CC -#endif - -/** CC_PROPERTY_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public virtual function, you should rewrite it first. - The variables and methods declared after CC_PROPERTY_READONLY are all public. - If you need protected or private, please declare. - */ -#define CC_PROPERTY_READONLY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const; - -#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const; - -/** CC_PROPERTY is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public virtual functions, you should rewrite them first. - The variables and methods declared after CC_PROPERTY are all public. - If you need protected or private, please declare. - */ -#define CC_PROPERTY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void);\ -public: virtual void set##funName(varType var); - -#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const;\ -public: virtual void set##funName(const varType& var); - -/** CC_SYNTHESIZE_READONLY is used to declare a protected variable. - We can use getter to read the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - @warning The getter is a public inline function. - The variables and methods declared after CC_SYNTHESIZE_READONLY are all public. - If you need protected or private, please declare. - */ -#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const { return varName; } - -#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const { return varName; } - -/** CC_SYNTHESIZE is used to declare a protected variable. - We can use getter to read the variable, and use the setter to change the variable. - @param varType the type of variable. - @param varName variable name. - @param funName "get + funName" will be the name of the getter. - "set + funName" will be the name of the setter. - @warning The getter and setter are public inline functions. - The variables and methods declared after CC_SYNTHESIZE are all public. - If you need protected or private, please declare. - */ -#define CC_SYNTHESIZE(varType, varName, funName)\ -protected: varType varName;\ -public: virtual varType get##funName(void) const { return varName; }\ -public: virtual void set##funName(varType var){ varName = var; } - -#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\ -protected: varType varName;\ -public: virtual const varType& get##funName(void) const { return varName; }\ -public: virtual void set##funName(const varType& var){ varName = var; } - -#define CC_SYNTHESIZE_RETAIN(varType, varName, funName) \ -private: varType varName; \ -public: virtual varType get##funName(void) const { return varName; } \ -public: virtual void set##funName(varType var) \ -{ \ - if (varName != var) \ - { \ - CC_SAFE_RETAIN(var); \ - CC_SAFE_RELEASE(varName); \ - varName = var; \ - } \ -} - -#define CC_SAFE_DELETE(p) do { delete (p); (p) = nullptr; } while(0) -#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = nullptr; } } while(0) -#define CC_SAFE_FREE(p) do { if(p) { free(p); (p) = nullptr; } } while(0) -#define CC_SAFE_RELEASE(p) do { if(p) { (p)->release(); } } while(0) -#define CC_SAFE_RELEASE_NULL(p) do { if(p) { (p)->release(); (p) = nullptr; } } while(0) -#define CC_SAFE_RETAIN(p) do { if(p) { (p)->retain(); } } while(0) -#define CC_BREAK_IF(cond) if(cond) break - -#define __CCLOGWITHFUNCTION(s, ...) \ - log("%s : %s",__FUNCTION__, String::createWithFormat(s, ##__VA_ARGS__)->getCString()) - -// cocos2d debug -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 -#define CCLOG(...) do {} while (0) -#define CCLOGINFO(...) do {} while (0) -#define CCLOGERROR(...) do {} while (0) -#define CCLOGWARN(...) do {} while (0) - -#elif COCOS2D_DEBUG == 1 -#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGINFO(format,...) do {} while (0) -#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) - -#elif COCOS2D_DEBUG > 1 -#define CCLOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGERROR(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGINFO(format,...) cocos2d::log(format, ##__VA_ARGS__) -#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) -#endif // COCOS2D_DEBUG - -// Lua engine debug -#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0 -#define LUALOG(...) -#else -#define LUALOG(format, ...) cocos2d::log(format, ##__VA_ARGS__) -#endif // Lua engine debug - -#if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \ - || (defined(__clang__) && (__clang_major__ >= 3)) -#define CC_DISABLE_COPY(Class) \ -private: \ - Class(const Class &) = delete; \ - Class &operator =(const Class &) = delete; -#else -#define CC_DISABLE_COPY(Class) \ -private: \ - Class(const Class &); \ - Class &operator =(const Class &); -#endif - -/* - * only certain compilers support __attribute__((deprecated)) - */ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) -#elif _MSC_VER >= 1400 //vs 2005 or higher - #define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) -#else - #define CC_DEPRECATED_ATTRIBUTE -#endif - -/* - * only certain compiler support __attribute__((format)) - * formatPos - 1-based position of format string argument - * argPos - 1-based position of first format-dependent argument - */ -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) -#elif defined(__has_attribute) - #if __has_attribute(format) - #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) - #endif // __has_attribute(format) -#else -#define CC_FORMAT_PRINTF(formatPos, argPos) -#endif - -#if defined(_MSC_VER) -#define CC_FORMAT_PRINTF_SIZE_T "%08lX" -#else -#define CC_FORMAT_PRINTF_SIZE_T "%08zX" -#endif - -#ifdef __GNUC__ -#define CC_UNUSED __attribute__ ((unused)) -#else -#define CC_UNUSED -#endif - -// -// CC_REQUIRES_NULL_TERMINATION -// -#if !defined(CC_REQUIRES_NULL_TERMINATION) - #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549) - #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1))) - #elif defined(__GNUC__) - #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel)) - #else - #define CC_REQUIRES_NULL_TERMINATION - #endif -#endif - -#endif // __CC_PLATFORM_MACROS_H__ diff --git a/cocos/platform/cocoa/CCAffineTransform.cpp b/cocos/platform/cocoa/CCAffineTransform.cpp deleted file mode 100644 index 2e39f344cc..0000000000 --- a/cocos/platform/cocoa/CCAffineTransform.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#include "CCAffineTransform.h" -#include -#include - -using namespace std; - - -NS_CC_BEGIN - -AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty) -{ - AffineTransform t; - t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty; - return t; -} - -Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t) -{ - Point p; - p.x = (float)((double)t.a * point.x + (double)t.c * point.y + t.tx); - p.y = (float)((double)t.b * point.x + (double)t.d * point.y + t.ty); - return p; -} - -Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t) -{ - Size s; - s.width = (float)((double)t.a * size.width + (double)t.c * size.height); - s.height = (float)((double)t.b * size.width + (double)t.d * size.height); - return s; -} - - -AffineTransform AffineTransformMakeIdentity() -{ - return __CCAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); -} - -extern const AffineTransform AffineTransformIdentity = AffineTransformMakeIdentity(); -const AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity(); - -Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform) -{ - float top = rect.getMinY(); - float left = rect.getMinX(); - float right = rect.getMaxX(); - float bottom = rect.getMaxY(); - - Point topLeft = PointApplyAffineTransform(Point(left, top), anAffineTransform); - Point topRight = PointApplyAffineTransform(Point(right, top), anAffineTransform); - Point bottomLeft = PointApplyAffineTransform(Point(left, bottom), anAffineTransform); - Point bottomRight = PointApplyAffineTransform(Point(right, bottom), anAffineTransform); - - float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x)); - float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x)); - float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y)); - float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y)); - - return Rect(minX, minY, (maxX - minX), (maxY - minY)); -} - -AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty) -{ - return __CCAffineTransformMake(t.a, t.b, t.c, t.d, t.tx + t.a * tx + t.c * ty, t.ty + t.b * tx + t.d * ty); -} - -AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy) -{ - return __CCAffineTransformMake(t.a * sx, t.b * sx, t.c * sy, t.d * sy, t.tx, t.ty); -} - -AffineTransform AffineTransformRotate(const AffineTransform& t, float anAngle) -{ - float sine = sinf(anAngle); - float cosine = cosf(anAngle); - - return __CCAffineTransformMake( t.a * cosine + t.c * sine, - t.b * cosine + t.d * sine, - t.c * cosine - t.a * sine, - t.d * cosine - t.b * sine, - t.tx, - t.ty); -} - -/* Concatenate `t2' to `t1' and return the result: - t' = t1 * t2 */ -AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2) -{ - return __CCAffineTransformMake( t1.a * t2.a + t1.b * t2.c, t1.a * t2.b + t1.b * t2.d, //a,b - t1.c * t2.a + t1.d * t2.c, t1.c * t2.b + t1.d * t2.d, //c,d - t1.tx * t2.a + t1.ty * t2.c + t2.tx, //tx - t1.tx * t2.b + t1.ty * t2.d + t2.ty); //ty -} - -/* Return true if `t1' and `t2' are equal, false otherwise. */ -bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2) -{ - return (t1.a == t2.a && t1.b == t2.b && t1.c == t2.c && t1.d == t2.d && t1.tx == t2.tx && t1.ty == t2.ty); -} - -AffineTransform AffineTransformInvert(const AffineTransform& t) -{ - float determinant = 1 / (t.a * t.d - t.b * t.c); - - return __CCAffineTransformMake(determinant * t.d, -determinant * t.b, -determinant * t.c, determinant * t.a, - determinant * (t.c * t.ty - t.d * t.tx), determinant * (t.b * t.tx - t.a * t.ty) ); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCAffineTransform.h b/cocos/platform/cocoa/CCAffineTransform.h deleted file mode 100644 index 667b5d9b46..0000000000 --- a/cocos/platform/cocoa/CCAffineTransform.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __COCOA_CGAFFINETRANSFORM_H__ -#define __COCOA_CGAFFINETRANSFORM_H__ - -#include "CCGeometry.h" -#include "platform/CCPlatformMacros.h" - -NS_CC_BEGIN - -struct AffineTransform { - float a, b, c, d; - float tx, ty; - - static const AffineTransform IDENTITY; -}; - -CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty); -#define AffineTransformMake __CCAffineTransformMake - -CC_DLL Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t); -#define PointApplyAffineTransform __CCPointApplyAffineTransform - -CC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t); -#define SizeApplyAffineTransform __CCSizeApplyAffineTransform - -CC_DLL AffineTransform AffineTransformMakeIdentity(); -CC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform); - -CC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty); -CC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle); -CC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy); -CC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2); -CC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2); -CC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t); - -extern CC_DLL const AffineTransform AffineTransformIdentity; - -NS_CC_END - -#endif // __COCOA_CGAFFINETRANSFORM_H__ diff --git a/cocos/platform/cocoa/CCArray.cpp b/cocos/platform/cocoa/CCArray.cpp deleted file mode 100644 index 3a55d6050d..0000000000 --- a/cocos/platform/cocoa/CCArray.cpp +++ /dev/null @@ -1,754 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCArray.h" -#include "CCString.h" -#include "platform/CCFileUtils.h" - -NS_CC_BEGIN - - -#if CC_USE_ARRAY_VECTOR - -// ---------------------------------------------------------------------------------- -// std::vector implementation -// ---------------------------------------------------------------------------------- - -Array::Array() -: data(NULL) -{ - init(); -} - -Array* Array::create() -{ - Array* array = new Array(); - - if (array && array->initWithCapacity(7)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithObject(Object* object) -{ - Array* array = new Array(); - - if (array && array->initWithObject(object)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::create(Object* object, ...) -{ - va_list args; - va_start(args,object); - - Array* array = create(); - if (array && object) - { - array->addObject(object); - Object *i = va_arg(args, Object*); - while (i) - { - array->addObject(i); - i = va_arg(args, Object*); - } - } - else - { - CC_SAFE_DELETE(array); - } - - va_end(args); - - return array; -} - -Array* Array::createWithArray(Array* otherArray) -{ - return otherArray->clone(); -} - -Array* Array::createWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - Array* array = new Array(); - - if (array && array->initWithCapacity(capacity)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithContentsOfFile(const char* fileName) -{ - Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) -{ - return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); -} - -bool Array::init() -{ - return initWithCapacity(7); -} - -bool Array::initWithObject(Object* object) -{ - bool ret = initWithCapacity(7); - if (ret) - { - addObject(object); - } - return ret; -} - -/** Initializes an array with some objects */ -bool Array::initWithObjects(Object* object, ...) -{ - bool ret = false; - do - { - CC_BREAK_IF(object == nullptr); - - va_list args; - va_start(args, object); - - if (object) - { - this->addObject(object); - Object* i = va_arg(args, Object*); - while (i) - { - this->addObject(i); - i = va_arg(args, Object*); - } - ret = true; - } - va_end(args); - - } while (false); - - return ret; -} - -bool Array::initWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - data.reserve(capacity); - return true; -} - -bool Array::initWithArray(Array* otherArray) -{ - data = otherArray->data; - return true; -} - -int Array::getIndexOfObject(Object* object) const -{ - auto it = data.begin(); - - for (int i = 0; it != data.end(); ++it, ++i) - { - if (it->get() == object) - { - return i; - } - } - - return -1; -} - -Object* Array::getRandomObject() -{ - if (data.size()==0) - { - return nullptr; - } - - float r = CCRANDOM_0_1(); - - if (r == 1) // to prevent from accessing data-arr[data->num], out of range. - { - r = 0; - } - - r *= data.size(); - - return data[r].get(); -} - -bool Array::containsObject(Object* object) const -{ - int i = this->getIndexOfObject(object); - return (i >=0); -} - -bool Array::isEqualToArray(Array* otherArray) -{ - for (int i = 0; i< this->count(); i++) - { - if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) - { - return false; - } - } - return true; -} - -void Array::addObject(Object* object) -{ - data.push_back( RCPtr(object) ); -} - -void Array::addObjectsFromArray(Array* otherArray) -{ - data.insert(data.end(), otherArray->data.begin(), otherArray->data.end()); -} - -void Array::insertObject(Object* object, int index) -{ - data.insert( std::begin(data) + index, RCPtr(object) ); -} - -void Array::setObject(Object* object, int index) -{ - data[index] = RCPtr(object); -} - -void Array::removeLastObject(bool releaseObj) -{ - CCASSERT(data.size(), "no objects added"); - data.pop_back(); -} - -void Array::removeObject(Object* object, bool releaseObj /* ignored */) -{ - data.erase( std::remove( data.begin(), data.end(), object ) ); -} - -void Array::removeObjectAtIndex(int index, bool releaseObj /* ignored */) -{ - auto obj = data[index]; - data.erase( data.begin() + index ); -} - -void Array::removeObjectsInArray(Array* otherArray) -{ - CCASSERT(false, "not implemented"); -} - -void Array::removeAllObjects() -{ - data.erase(std::begin(data), std::end(data)); -} - -void Array::fastRemoveObjectAtIndex(int index) -{ - removeObjectAtIndex(index); -} - -void Array::fastRemoveObject(Object* object) -{ - removeObject(object); -} - -void Array::exchangeObject(Object* object1, Object* object2) -{ - int idx1 = getIndexOfObject(object1); - int idx2 = getIndexOfObject(object2); - - CCASSERT(idx1>=0 && idx2>=2, "invalid object index"); - - std::swap( data[idx1], data[idx2] ); -} - -void Array::exchangeObjectAtIndex(int index1, int index2) -{ - std::swap( data[index1], data[index2] ); -} - -void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject /* ignored */) -{ - data[index] = object; -} - -void Array::reverseObjects() -{ - std::reverse( std::begin(data), std::end(data) ); -} - -void Array::reduceMemoryFootprint() -{ - // N/A -} - -Array::~Array() -{ - CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); -} - -Array* Array::clone() const -{ - Array* ret = new Array(); - ret->autorelease(); - ret->initWithCapacity(this->data.size() > 0 ? this->data.size() : 1); - - Object* obj = nullptr; - Object* tmpObj = nullptr; - Clonable* clonable = nullptr; - CCARRAY_FOREACH(this, obj) - { - clonable = dynamic_cast(obj); - if (clonable) - { - tmpObj = dynamic_cast(clonable->clone()); - if (tmpObj) - { - ret->addObject(tmpObj); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); - } - } - return ret; -} - -void Array::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -// ---------------------------------------------------------------------------------- -// ccArray implementation -// ---------------------------------------------------------------------------------- - -#else - -Array::Array() -: data(nullptr) -{ -// init(); -} - -Array* Array::create() -{ - Array* array = new Array(); - - if (array && array->initWithCapacity(7)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithObject(Object* object) -{ - Array* array = new Array(); - - if (array && array->initWithObject(object)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::create(Object* object, ...) -{ - va_list args; - va_start(args,object); - - Array* array = create(); - if (array && object) - { - array->addObject(object); - Object *i = va_arg(args, Object*); - while (i) - { - array->addObject(i); - i = va_arg(args, Object*); - } - } - else - { - CC_SAFE_DELETE(array); - } - - va_end(args); - - return array; -} - -Array* Array::createWithArray(Array* otherArray) -{ - return otherArray->clone(); -} - -Array* Array::createWithCapacity(int capacity) -{ - CCASSERT(capacity>=0, "Invalid capacity"); - - Array* array = new Array(); - - if (array && array->initWithCapacity(capacity)) - { - array->autorelease(); - } - else - { - CC_SAFE_DELETE(array); - } - - return array; -} - -Array* Array::createWithContentsOfFile(const char* fileName) -{ - Array* ret = Array::createWithContentsOfFileThreadSafe(fileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -Array* Array::createWithContentsOfFileThreadSafe(const char* fileName) -{ - return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName); -} - -bool Array::init() -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - return initWithCapacity(7); -} - -bool Array::initWithObject(Object* object) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = initWithCapacity(7); - if (ret) - { - addObject(object); - } - return ret; -} - -/** Initializes an array with some objects */ -bool Array::initWithObjects(Object* object, ...) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = false; - do - { - CC_BREAK_IF(object == nullptr); - - va_list args; - va_start(args, object); - - if (object) - { - this->addObject(object); - Object* i = va_arg(args, Object*); - while (i) - { - this->addObject(i); - i = va_arg(args, Object*); - } - ret = true; - } - va_end(args); - - } while (false); - - return ret; -} - -bool Array::initWithCapacity(int capacity) -{ - CCASSERT(capacity>=0 && !data, "Array cannot be re-initialized"); - - data = ccArrayNew(capacity); - return true; -} - -bool Array::initWithArray(Array* otherArray) -{ - CCASSERT(!data, "Array cannot be re-initialized"); - - bool ret = false; - do - { - CC_BREAK_IF(! initWithCapacity(otherArray->data->num)); - - addObjectsFromArray(otherArray); - ret = true; - } while (0); - - return ret; -} - -int Array::getIndexOfObject(Object* object) const -{ - return ccArrayGetIndexOfObject(data, object); -} - -Object* Array::getRandomObject() -{ - if (data->num == 0) - { - return nullptr; - } - - float r = CCRANDOM_0_1(); - - if (r == 1) // to prevent from accessing data-arr[data->num], out of range. - { - r = 0; - } - - return data->arr[(int)(data->num * r)]; -} - -bool Array::containsObject(Object* object) const -{ - return ccArrayContainsObject(data, object); -} - -bool Array::isEqualToArray(Array* otherArray) -{ - for (int i = 0; i< this->count(); i++) - { - if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i))) - { - return false; - } - } - return true; -} - -void Array::addObject(Object* object) -{ - CCASSERT(data, "Array not initialized"); - ccArrayAppendObjectWithResize(data, object); -} - -void Array::addObjectsFromArray(Array* otherArray) -{ - CCASSERT(data, "Array not initialized"); - ccArrayAppendArrayWithResize(data, otherArray->data); -} - -void Array::insertObject(Object* object, int index) -{ - CCASSERT(data, "Array not initialized"); - ccArrayInsertObjectAtIndex(data, object, index); -} - -void Array::setObject(Object* object, int index) -{ - CCASSERT(index>=0 && index < count(), "Invalid index"); - - if (object != data->arr[index]) - { - data->arr[index]->release(); - data->arr[index] = object; - object->retain(); - } -} - -void Array::removeLastObject(bool releaseObj) -{ - CCASSERT(data->num, "no objects added"); - ccArrayRemoveObjectAtIndex(data, data->num-1, releaseObj); -} - -void Array::removeObject(Object* object, bool releaseObj/* = true*/) -{ - ccArrayRemoveObject(data, object, releaseObj); -} - -void Array::removeObjectAtIndex(int index, bool releaseObj) -{ - ccArrayRemoveObjectAtIndex(data, index, releaseObj); -} - -void Array::removeObjectsInArray(Array* otherArray) -{ - ccArrayRemoveArray(data, otherArray->data); -} - -void Array::removeAllObjects() -{ - ccArrayRemoveAllObjects(data); -} - -void Array::fastRemoveObjectAtIndex(int index) -{ - ccArrayFastRemoveObjectAtIndex(data, index); -} - -void Array::fastRemoveObject(Object* object) -{ - ccArrayFastRemoveObject(data, object); -} - -void Array::exchangeObject(Object* object1, Object* object2) -{ - int index1 = ccArrayGetIndexOfObject(data, object1); - if (index1 == UINT_MAX) - { - return; - } - - int index2 = ccArrayGetIndexOfObject(data, object2); - if (index2 == UINT_MAX) - { - return; - } - - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -void Array::exchangeObjectAtIndex(int index1, int index2) -{ - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject/* = true*/) -{ - ccArrayInsertObjectAtIndex(data, object, index); - ccArrayRemoveObjectAtIndex(data, index+1); -} - -void Array::reverseObjects() -{ - if (data->num > 1) - { - // floorf(), since in the case of an even number, the number of swaps stays the same - int count = (int) floorf(data->num/2.f); - int maxIndex = data->num - 1; - - for (int i = 0; i < count ; i++) - { - ccArraySwapObjectsAtIndexes(data, i, maxIndex); - --maxIndex; - } - } -} - -void Array::reduceMemoryFootprint() -{ - ccArrayShrink(data); -} - -Array::~Array() -{ - CCLOGINFO("deallocing Array: %p - len: %d", this, count() ); - - ccArrayFree(data); -} - -Array* Array::clone() const -{ - Array* ret = new Array(); - ret->autorelease(); - ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1); - - Object* obj = nullptr; - Object* tmpObj = nullptr; - Clonable* clonable = nullptr; - CCARRAY_FOREACH(this, obj) - { - clonable = dynamic_cast(obj); - if (clonable) - { - tmpObj = dynamic_cast(clonable->clone()); - if (tmpObj) - { - ret->addObject(tmpObj); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*obj).name()); - } - } - return ret; -} - -void Array::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -#endif // uses ccArray - -NS_CC_END diff --git a/cocos/platform/cocoa/CCAutoreleasePool.cpp b/cocos/platform/cocoa/CCAutoreleasePool.cpp deleted file mode 100644 index 89a3528f73..0000000000 --- a/cocos/platform/cocoa/CCAutoreleasePool.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#include "CCAutoreleasePool.h" -#include "ccMacros.h" - -NS_CC_BEGIN - -static PoolManager* s_pPoolManager = NULL; - -AutoreleasePool::AutoreleasePool() -{ - _managedObjectArray = new Array(); - _managedObjectArray->initWithCapacity(150); -} - -AutoreleasePool::~AutoreleasePool() -{ - CCLOGINFO("deallocing AutoreleasePool: %p", this); - CC_SAFE_DELETE(_managedObjectArray); -} - -void AutoreleasePool::addObject(Object* object) -{ - _managedObjectArray->addObject(object); - - CCASSERT(object->_reference > 1, "reference count should be greater than 1"); - ++(object->_autoReleaseCount); - object->release(); // no ref count, in this case autorelease pool added. -} - -void AutoreleasePool::removeObject(Object* object) -{ - for (unsigned int i = 0; i < object->_autoReleaseCount; ++i) - { - _managedObjectArray->removeObject(object, false); - } -} - -void AutoreleasePool::clear() -{ - if(_managedObjectArray->count() > 0) - { - //CCAutoreleasePool* pReleasePool; -#ifdef _DEBUG - int nIndex = _managedObjectArray->count() - 1; -#endif - - Object* pObj = NULL; - CCARRAY_FOREACH_REVERSE(_managedObjectArray, pObj) - { - if(!pObj) - break; - - --(pObj->_autoReleaseCount); - //(*it)->release(); - //delete (*it); -#ifdef _DEBUG - nIndex--; -#endif - } - - _managedObjectArray->removeAllObjects(); - } -} - - -//-------------------------------------------------------------------- -// -// PoolManager -// -//-------------------------------------------------------------------- - -PoolManager* PoolManager::sharedPoolManager() -{ - if (s_pPoolManager == NULL) - { - s_pPoolManager = new PoolManager(); - } - return s_pPoolManager; -} - -void PoolManager::purgePoolManager() -{ - CC_SAFE_DELETE(s_pPoolManager); -} - -PoolManager::PoolManager() -{ - _releasePoolStack = new Array(); - _releasePoolStack->initWithCapacity(150); - _curReleasePool = 0; -} - -PoolManager::~PoolManager() -{ - CCLOGINFO("deallocing PoolManager: %p", this); - finalize(); - - // we only release the last autorelease pool here - _curReleasePool = 0; - _releasePoolStack->removeObjectAtIndex(0); - - CC_SAFE_DELETE(_releasePoolStack); -} - -void PoolManager::finalize() -{ - if(_releasePoolStack->count() > 0) - { - //CCAutoreleasePool* pReleasePool; - Object* pObj = NULL; - CCARRAY_FOREACH(_releasePoolStack, pObj) - { - if(!pObj) - break; - AutoreleasePool* pPool = static_cast(pObj); - pPool->clear(); - } - } -} - -void PoolManager::push() -{ - AutoreleasePool* pPool = new AutoreleasePool(); //ref = 1 - _curReleasePool = pPool; - - _releasePoolStack->addObject(pPool); //ref = 2 - - pPool->release(); //ref = 1 -} - -void PoolManager::pop() -{ - if (! _curReleasePool) - { - return; - } - - int nCount = _releasePoolStack->count(); - - _curReleasePool->clear(); - - if (nCount > 1) - { - _releasePoolStack->removeObjectAtIndex(nCount-1); - -// if(nCount > 1) -// { -// _curReleasePool = _releasePoolStack->getObjectAtIndex(nCount - 2); -// return; -// } - _curReleasePool = (AutoreleasePool*)_releasePoolStack->getObjectAtIndex(nCount - 2); - } - - /*_curReleasePool = NULL;*/ -} - -void PoolManager::removeObject(Object* object) -{ - CCASSERT(_curReleasePool, "current auto release pool should not be null"); - - _curReleasePool->removeObject(object); -} - -void PoolManager::addObject(Object* object) -{ - getCurReleasePool()->addObject(object); -} - - -AutoreleasePool* PoolManager::getCurReleasePool() -{ - if(!_curReleasePool) - { - push(); - } - - CCASSERT(_curReleasePool, "current auto release pool should not be null"); - - return _curReleasePool; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCAutoreleasePool.h b/cocos/platform/cocoa/CCAutoreleasePool.h deleted file mode 100644 index e446ceb402..0000000000 --- a/cocos/platform/cocoa/CCAutoreleasePool.h +++ /dev/null @@ -1,181 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#ifndef __AUTORELEASEPOOL_H__ -#define __AUTORELEASEPOOL_H__ - -#include "CCObject.h" -#include "CCArray.h" - -NS_CC_BEGIN - -/** - * @addtogroup base_nodes - * @{ - */ - -class CC_DLL AutoreleasePool : public Object -{ - /** - * The underlying array of object managed by the pool. - * - * Although Array retains the object once when an object is added, proper - * Object::release() is called outside the array to make sure that the pool - * does not affect the managed object's reference count. So an object can - * be destructed properly by calling Object::release() even if the object - * is in the pool. - */ - Array *_managedObjectArray; -public: - /** - * @js NA - * @lua NA - */ - AutoreleasePool(); - /** - * @js NA - * @lua NA - */ - ~AutoreleasePool(); - - /** - * Add a given object to this pool. - * - * The same object may be added several times to the same pool; When the - * pool is destructed, the object's Object::release() method will be called - * for each time it was added. - * - * @param object The object to add to the pool. - * @js NA - * @lua NA - */ - void addObject(Object *object); - - /** - * Remove a given object from this pool. - * - * @param object The object to be removed from the pool. - * @js NA - * @lua NA - */ - void removeObject(Object *object); - - /** - * Clear the autorelease pool. - * - * Object::release() will be called for each time the managed object is - * added to the pool. - * @js NA - * @lua NA - */ - void clear(); -}; - -class CC_DLL PoolManager -{ - Array *_releasePoolStack; - AutoreleasePool *_curReleasePool; - - AutoreleasePool *getCurReleasePool(); -public: - /** - * @js NA - * @lua NA - */ - static PoolManager* sharedPoolManager(); - /** - * @js NA - * @lua NA - */ - static void purgePoolManager(); - /** - * @js NA - * @lua NA - */ - PoolManager(); - /** - * @js NA - * @lua NA - */ - ~PoolManager(); - - /** - * Clear all the AutoreleasePool on the pool stack. - * @js NA - * @lua NA - */ - void finalize(); - - /** - * Push a new AutoreleasePool to the pool stack. - * @js NA - * @lua NA - */ - void push(); - - /** - * Pop one AutoreleasePool from the pool stack. - * - * This method will ensure that there is at least one AutoreleasePool on - * the stack. - * - * The AutoreleasePool being poped is destructed. - * @js NA - * @lua NA - */ - void pop(); - - /** - * Remove a given object from the current autorelease pool. - * - * @param object The object to be removed. - * - * @see AutoreleasePool::removeObject - * @js NA - * @lua NA - */ - void removeObject(Object *object); - - /** - * Add a given object to the current autorelease pool. - * - * @param object The object to add. - * - * @see AutoreleasePool::addObject - * @js NA - * @lua NA - */ - void addObject(Object *object); - /** - * @js NA - * @lua NA - */ - friend class AutoreleasePool; -}; - -// end of base_nodes group -/// @} - -NS_CC_END - -#endif //__AUTORELEASEPOOL_H__ diff --git a/cocos/platform/cocoa/CCBool.h b/cocos/platform/cocoa/CCBool.h deleted file mode 100644 index 32b7b276ee..0000000000 --- a/cocos/platform/cocoa/CCBool.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCBOOL_H__ -#define __CCBOOL_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Bool : public Object, public Clonable -{ -public: - Bool(bool v) - : _value(v) {} - bool getValue() const {return _value;} - - static Bool* create(bool v) - { - Bool* pRet = new Bool(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Bool* clone() const - { - return Bool::create(_value); - } -private: - bool _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCBOOL_H__ */ diff --git a/cocos/platform/cocoa/CCData.cpp b/cocos/platform/cocoa/CCData.cpp deleted file mode 100644 index 1c42a12ee5..0000000000 --- a/cocos/platform/cocoa/CCData.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include -#include "CCData.h" -#include "platform/CCCommon.h" - -NS_CC_BEGIN - -Data::Data(unsigned char *pBytes, const unsigned long nSize) -{ - _size = nSize; - _bytes = new unsigned char[_size]; - memcpy(_bytes, pBytes, _size); -} - -Data::Data(Data *pData) -{ - _size = pData->_size; - _bytes = new unsigned char[_size]; - memcpy(_bytes, pData->_bytes, _size); -} - -Data::~Data() -{ - CCLOGINFO("deallocing Data: %p", this); - CC_SAFE_DELETE_ARRAY(_bytes); -} - -unsigned char* Data::getBytes() const -{ - return _bytes; -} - -unsigned long Data::getSize() const -{ - return _size; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCDataVisitor.cpp b/cocos/platform/cocoa/CCDataVisitor.cpp deleted file mode 100644 index 2d2a1f8121..0000000000 --- a/cocos/platform/cocoa/CCDataVisitor.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCObject.h" -#include "CCBool.h" -#include "CCInteger.h" -#include "CCFloat.h" -#include "CCDouble.h" -#include "CCString.h" -#include "CCArray.h" -#include "CCDictionary.h" -#include "CCSet.h" -#include "CCData.h" - -NS_CC_BEGIN - -void DataVisitor::visit(const Bool *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Integer *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Float *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Double *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const String *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Array *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Dictionary *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Set *value) -{ - visitObject(value); -} - -void DataVisitor::visit(const Data *value) -{ - visitObject(value); -} - -// PrettyPrinter -PrettyPrinter::PrettyPrinter(int indentLevel/* = 0 */) -{ - setIndentLevel(indentLevel); -} - -void PrettyPrinter::clear() -{ - _result.clear(); -} - -std::string PrettyPrinter::getResult() -{ - return _result; -} - -void PrettyPrinter::visitObject(const Object *p) -{ - char buf[50] = {0}; - sprintf(buf, "%p", p); - _result += buf; -} - -void PrettyPrinter::visit(const Bool * p) -{ - char buf[50] = {0}; - sprintf(buf, "%s", p->getValue() ? "true" : "false"); - _result += buf; -} - -void PrettyPrinter::visit(const Integer *p) -{ - char buf[50] = {0}; - sprintf(buf, "%d", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const Float *p) -{ - char buf[50] = {0}; - sprintf(buf, "%f", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const Double *p) -{ - char buf[50] = {0}; - sprintf(buf, "%lf", p->getValue()); - _result += buf; -} - -void PrettyPrinter::visit(const String *p) -{ - _result += p->getCString(); -} - -void PrettyPrinter::visit(const Array *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - Object* obj; - int i = 0; - char buf[50] = {0}; - CCARRAY_FOREACH(p, obj) - { - if (i > 0) { - _result += "\n"; - } - sprintf(buf, "%s%02d: ", _indentStr.c_str(), i); - _result += buf; - PrettyPrinter v(_indentLevel); - obj->acceptVisitor(v); - _result += v.getResult(); - i++; - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += ""; -} - -void PrettyPrinter::visit(const Dictionary *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - DictElement* element; - bool bFirstElement = true; - char buf[1000] = {0}; - CCDICT_FOREACH(p, element) - { - if (!bFirstElement) { - _result += "\n"; - } - sprintf(buf, "%s%s: ", _indentStr.c_str(),element->getStrKey()); - _result += buf; - PrettyPrinter v(_indentLevel); - element->getObject()->acceptVisitor(v); - _result += v.getResult(); - bFirstElement = false; - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += ""; -} - -void PrettyPrinter::visit(const Set *p) -{ - _result += "\n"; - _result += _indentStr; - _result += "\n"; - - setIndentLevel(_indentLevel+1); - - int i = 0; - Set* tmp = const_cast(p); - SetIterator it = tmp->begin(); - - for (; it != tmp->end(); ++it, ++i) { - if (i > 0) { - _result += "\n"; - } - _result += _indentStr.c_str(); - PrettyPrinter v(_indentLevel); - (*it)->acceptVisitor(v); - _result += v.getResult(); - } - setIndentLevel(_indentLevel-1); - - _result += "\n"; - _result += _indentStr; - _result += "\n"; -} - -void PrettyPrinter::visit(const Data *p) -{ - //TODO Implement - DataVisitor::visit(p); -} - -void PrettyPrinter::setIndentLevel(int indentLevel) -{ - _indentLevel = indentLevel; - _indentStr.clear(); - for (int i = 0; i < _indentLevel; ++i) { - _indentStr += "\t"; - } -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCDictionary.cpp b/cocos/platform/cocoa/CCDictionary.cpp deleted file mode 100644 index 6b8df0febf..0000000000 --- a/cocos/platform/cocoa/CCDictionary.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/**************************************************************************** - Copyright (c) 2012 - 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCDictionary.h" -#include "CCString.h" -#include "CCInteger.h" -#include "platform/CCFileUtils.h" - -using namespace std; - -NS_CC_BEGIN - -// ----------------------------------------------------------------------- -// DictElement - -DictElement::DictElement(const char* pszKey, Object* pObject) -{ - CCASSERT(pszKey && strlen(pszKey) > 0, "Invalid key value."); - _intKey = 0; - const char* pStart = pszKey; - - size_t len = strlen(pszKey); - if (len > MAX_KEY_LEN ) - { - char* pEnd = (char*)&pszKey[len-1]; - pStart = pEnd - (MAX_KEY_LEN-1); - } - - strcpy(_strKey, pStart); - - _object = pObject; - memset(&hh, 0, sizeof(hh)); -} - -DictElement::DictElement(intptr_t iKey, Object* pObject) -{ - _strKey[0] = '\0'; - _intKey = iKey; - _object = pObject; - memset(&hh, 0, sizeof(hh)); -} - -DictElement::~DictElement() -{ - CCLOGINFO("deallocing DictElement: %p", this); -} - -// ----------------------------------------------------------------------- -// Dictionary - -Dictionary::Dictionary() -: _elements(NULL) -, _dictType(kDictUnknown) -{ - -} - -Dictionary::~Dictionary() -{ - CCLOGINFO("deallocing Dictionary: %p", this); - removeAllObjects(); -} - -unsigned int Dictionary::count() -{ - return HASH_COUNT(_elements); -} - -Array* Dictionary::allKeys() -{ - int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; - - Array* pArray = Array::createWithCapacity(iKeyCount); - - DictElement *pElement, *tmp; - if (_dictType == kDictStr) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - String* pOneKey = new String(pElement->_strKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - else if (_dictType == kDictInt) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - Integer* pOneKey = new Integer(pElement->_intKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - - return pArray; -} - -Array* Dictionary::allKeysForObject(Object* object) -{ - int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; - Array* pArray = Array::create(); - - DictElement *pElement, *tmp; - - if (_dictType == kDictStr) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - if (object == pElement->_object) - { - String* pOneKey = new String(pElement->_strKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - } - else if (_dictType == kDictInt) - { - HASH_ITER(hh, _elements, pElement, tmp) - { - if (object == pElement->_object) - { - Integer* pOneKey = new Integer(pElement->_intKey); - pArray->addObject(pOneKey); - CC_SAFE_RELEASE(pOneKey); - } - } - } - return pArray; -} - -Object* Dictionary::objectForKey(const std::string& key) -{ - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; - // Dictionary only supports one kind of key, string or integer. - // This method uses string as key, therefore we should make sure that the key type of this Dictionary is string. - CCASSERT(_dictType == kDictStr, "this dictionary does not use string as key."); - - Object* pRetObject = NULL; - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement != NULL) - { - pRetObject = pElement->_object; - } - return pRetObject; -} - -Object* Dictionary::objectForKey(intptr_t key) -{ - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; - // Dictionary only supports one kind of key, string or integer. - // This method uses integer as key, therefore we should make sure that the key type of this Dictionary is integer. - CCASSERT(_dictType == kDictInt, "this dictionary does not use integer as key."); - - Object* pRetObject = NULL; - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - if (pElement != NULL) - { - pRetObject = pElement->_object; - } - return pRetObject; -} - -const String* Dictionary::valueForKey(const std::string& key) -{ - String* pStr = dynamic_cast(objectForKey(key)); - if (pStr == NULL) - { - pStr = String::create(""); - } - return pStr; -} - -const String* Dictionary::valueForKey(intptr_t key) -{ - String* pStr = dynamic_cast(objectForKey(key)); - if (pStr == NULL) - { - pStr = String::create(""); - } - return pStr; -} - -void Dictionary::setObject(Object* pObject, const std::string& key) -{ - CCASSERT(key.length() > 0 && pObject != NULL, "Invalid Argument!"); - if (_dictType == kDictUnknown) - { - _dictType = kDictStr; - } - - CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as key."); - - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement == NULL) - { - setObjectUnSafe(pObject, key); - } - else if (pElement->_object != pObject) - { - Object* pTmpObj = pElement->_object; - pTmpObj->retain(); - removeObjectForElememt(pElement); - setObjectUnSafe(pObject, key); - pTmpObj->release(); - } -} - -void Dictionary::setObject(Object* pObject, intptr_t key) -{ - CCASSERT(pObject != NULL, "Invalid Argument!"); - if (_dictType == kDictUnknown) - { - _dictType = kDictInt; - } - - CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as key."); - - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - if (pElement == NULL) - { - setObjectUnSafe(pObject, key); - } - else if (pElement->_object != pObject) - { - Object* pTmpObj = pElement->_object; - pTmpObj->retain(); - removeObjectForElememt(pElement); - setObjectUnSafe(pObject, key); - pTmpObj->release(); - } - -} - -void Dictionary::removeObjectForKey(const std::string& key) -{ - if (_dictType == kDictUnknown) - { - return; - } - - CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as its key"); - CCASSERT(key.length() > 0, "Invalid Argument!"); - DictElement *pElement = NULL; - HASH_FIND_STR(_elements, key.c_str(), pElement); - removeObjectForElememt(pElement); -} - -void Dictionary::removeObjectForKey(intptr_t key) -{ - if (_dictType == kDictUnknown) - { - return; - } - - CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as its key"); - DictElement *pElement = NULL; - HASH_FIND_PTR(_elements, &key, pElement); - removeObjectForElememt(pElement); -} - -void Dictionary::setObjectUnSafe(Object* pObject, const std::string& key) -{ - pObject->retain(); - DictElement* pElement = new DictElement(key.c_str(), pObject); - HASH_ADD_STR(_elements, _strKey, pElement); -} - -void Dictionary::setObjectUnSafe(Object* pObject, const intptr_t key) -{ - pObject->retain(); - DictElement* pElement = new DictElement(key, pObject); - HASH_ADD_PTR(_elements, _intKey, pElement); -} - -void Dictionary::removeObjectsForKeys(Array* pKeyArray) -{ - Object* pObj = NULL; - CCARRAY_FOREACH(pKeyArray, pObj) - { - String* pStr = static_cast(pObj); - removeObjectForKey(pStr->getCString()); - } -} - -void Dictionary::removeObjectForElememt(DictElement* pElement) -{ - if (pElement != NULL) - { - HASH_DEL(_elements, pElement); - pElement->_object->release(); - CC_SAFE_DELETE(pElement); - } -} - -void Dictionary::removeAllObjects() -{ - DictElement *pElement, *tmp; - HASH_ITER(hh, _elements, pElement, tmp) - { - HASH_DEL(_elements, pElement); - pElement->_object->release(); - CC_SAFE_DELETE(pElement); - - } -} - -Object* Dictionary::randomObject() -{ - if (_dictType == kDictUnknown) - { - return NULL; - } - - Object* key = allKeys()->getRandomObject(); - - if (_dictType == kDictInt) - { - return objectForKey( static_cast(key)->getValue()); - } - else if (_dictType == kDictStr) - { - return objectForKey( static_cast(key)->getCString()); - } - else - { - return NULL; - } -} - -Dictionary* Dictionary::create() -{ - Dictionary* ret = new Dictionary(); - if (ret && ret->init() ) - { - ret->autorelease(); - } - return ret; -} - -bool Dictionary::init() -{ - return true; -} - -Dictionary* Dictionary::createWithDictionary(Dictionary* srcDict) -{ - return srcDict->clone(); -} - -Dictionary* Dictionary::createWithContentsOfFileThreadSafe(const char *pFileName) -{ - return FileUtils::getInstance()->createDictionaryWithContentsOfFile(pFileName); -} - -void Dictionary::acceptVisitor(DataVisitor &visitor) -{ - return visitor.visit(this); -} - -Dictionary* Dictionary::createWithContentsOfFile(const char *pFileName) -{ - auto ret = createWithContentsOfFileThreadSafe(pFileName); - if (ret != nullptr) - { - ret->autorelease(); - } - return ret; -} - -bool Dictionary::writeToFile(const char *fullPath) -{ - return FileUtils::getInstance()->writeToFile(this, fullPath); -} - -Dictionary* Dictionary::clone() const -{ - Dictionary* newDict = Dictionary::create(); - - DictElement* element = NULL; - Object* tmpObj = NULL; - Clonable* obj = NULL; - if (_dictType == kDictInt) - { - CCDICT_FOREACH(this, element) - { - obj = dynamic_cast(element->getObject()); - if (obj) - { - tmpObj = dynamic_cast(obj->clone()); - if (tmpObj) - { - newDict->setObject(tmpObj, element->getIntKey()); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); - } - } - } - else if (_dictType == kDictStr) - { - CCDICT_FOREACH(this, element) - { - obj = dynamic_cast(element->getObject()); - if (obj) - { - tmpObj = dynamic_cast(obj->clone()); - if (tmpObj) - { - newDict->setObject(tmpObj, element->getStrKey()); - } - } - else - { - CCLOGWARN("%s isn't clonable.", typeid(*element->getObject()).name()); - } - } - } - - return newDict; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCDouble.h b/cocos/platform/cocoa/CCDouble.h deleted file mode 100644 index 5b45b1d6cf..0000000000 --- a/cocos/platform/cocoa/CCDouble.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCDOUBLE_H__ -#define __CCDOUBLE_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Double : public Object, public Clonable -{ -public: - Double(double v) - : _value(v) {} - double getValue() const {return _value;} - - static Double* create(double v) - { - Double* pRet = new Double(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Double* clone() const - { - return Double::create(_value); - } -private: - double _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCDOUBLE_H__ */ diff --git a/cocos/platform/cocoa/CCFloat.h b/cocos/platform/cocoa/CCFloat.h deleted file mode 100644 index c85a2e1e70..0000000000 --- a/cocos/platform/cocoa/CCFloat.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCFLOAT_H__ -#define __CCFLOAT_H__ - -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Float : public Object, public Clonable -{ -public: - Float(float v) - : _value(v) {} - float getValue() const {return _value;} - - static Float* create(float v) - { - Float* pRet = new Float(v); - if (pRet) - { - pRet->autorelease(); - } - return pRet; - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - Float* clone() const - { - return Float::create(_value); - } - -private: - float _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCFLOAT_H__ */ diff --git a/cocos/platform/cocoa/CCGeometry.cpp b/cocos/platform/cocoa/CCGeometry.cpp deleted file mode 100644 index cfce9d3fa7..0000000000 --- a/cocos/platform/cocoa/CCGeometry.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCGeometry.h" -#include "ccMacros.h" -#include - -// implementation of Point -NS_CC_BEGIN - -Point::Point(void) : x(0), y(0) -{ -} - -Point::Point(float xx, float yy) : x(xx), y(yy) -{ -} - -Point::Point(const Point& other) : x(other.x), y(other.y) -{ -} - -Point::Point(const Size& size) : x(size.width), y(size.height) -{ -} - -Point& Point::operator= (const Point& other) -{ - setPoint(other.x, other.y); - return *this; -} - -Point& Point::operator= (const Size& size) -{ - setPoint(size.width, size.height); - return *this; -} - -Point Point::operator+(const Point& right) const -{ - return Point(this->x + right.x, this->y + right.y); -} - -Point Point::operator-(const Point& right) const -{ - return Point(this->x - right.x, this->y - right.y); -} - -Point Point::operator-() const -{ - return Point(-x, -y); -} - -Point Point::operator*(float a) const -{ - return Point(this->x * a, this->y * a); -} - -Point Point::operator/(float a) const -{ - CCASSERT(a!=0, "CCPoint division by 0."); - return Point(this->x / a, this->y / a); -} - -void Point::setPoint(float xx, float yy) -{ - this->x = xx; - this->y = yy; -} - -bool Point::equals(const Point& target) const -{ - return (fabs(this->x - target.x) < FLT_EPSILON) - && (fabs(this->y - target.y) < FLT_EPSILON); -} - -bool Point::fuzzyEquals(const Point& b, float var) const -{ - if(x - var <= b.x && b.x <= x + var) - if(y - var <= b.y && b.y <= y + var) - return true; - return false; -} - -float Point::getAngle(const Point& other) const -{ - Point a2 = normalize(); - Point b2 = other.normalize(); - float angle = atan2f(a2.cross(b2), a2.dot(b2)); - if( fabs(angle) < FLT_EPSILON ) return 0.f; - return angle; -} - -Point Point::rotateByAngle(const Point& pivot, float angle) const -{ - return pivot + (*this - pivot).rotate(Point::forAngle(angle)); -} - -bool Point::isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float *E) -{ - float ABmin = MIN(A, B); - float ABmax = MAX(A, B); - float CDmin = MIN(C, D); - float CDmax = MAX(C, D); - - if (ABmax < CDmin || CDmax < ABmin) - { - // ABmin->ABmax->CDmin->CDmax or CDmin->CDmax->ABmin->ABmax - return false; - } - else - { - if (ABmin >= CDmin && ABmin <= CDmax) - { - // CDmin->ABmin->CDmax->ABmax or CDmin->ABmin->ABmax->CDmax - if (S != nullptr) *S = ABmin; - if (E != nullptr) *E = CDmax < ABmax ? CDmax : ABmax; - } - else if (ABmax >= CDmin && ABmax <= CDmax) - { - // ABmin->CDmin->ABmax->CDmax - if (S != nullptr) *S = CDmin; - if (E != nullptr) *E = ABmax; - } - else - { - // ABmin->CDmin->CDmax->ABmax - if (S != nullptr) *S = CDmin; - if (E != nullptr) *E = CDmax; - } - return true; - } -} - -bool Point::isLineIntersect(const Point& A, const Point& B, - const Point& C, const Point& D, - float *S, float *T) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - const float denom = crossProduct2Vector(A, B, C, D); - - if (denom == 0) - { - // Lines parallel or overlap - return false; - } - - if (S != nullptr) *S = crossProduct2Vector(C, D, C, A) / denom; - if (T != nullptr) *T = crossProduct2Vector(A, B, C, A) / denom; - - return true; -} - -bool Point::isLineParallel(const Point& A, const Point& B, - const Point& C, const Point& D) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - if (crossProduct2Vector(A, B, C, D) == 0) - { - // line overlap - if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0) - { - return false; - } - - return true; - } - - return false; -} - -bool Point::isLineOverlap(const Point& A, const Point& B, - const Point& C, const Point& D) -{ - // FAIL: Line undefined - if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) ) - { - return false; - } - - if (crossProduct2Vector(A, B, C, D) == 0 && - (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)) - { - return true; - } - - return false; -} - -bool Point::isSegmentOverlap(const Point& A, const Point& B, const Point& C, const Point& D, Point* S, Point* E) -{ - - if (isLineOverlap(A, B, C, D)) - { - return isOneDemensionSegmentOverlap(A.x, B.x, C.x, D.x, &S->x, &E->x) && - isOneDemensionSegmentOverlap(A.y, B.y, C.y, D.y, &S->y, &E->y); - } - - return false; -} - -bool Point::isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D) -{ - float S, T; - - if (isLineIntersect(A, B, C, D, &S, &T )&& - (S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f)) - { - return true; - } - - return false; -} - -Point Point::getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D) -{ - float S, T; - - if (isLineIntersect(A, B, C, D, &S, &T)) - { - // Point of intersection - Point P; - P.x = A.x + S * (B.x - A.x); - P.y = A.y + S * (B.y - A.y); - return P; - } - - return Point::ZERO; -} - -const Point Point::ZERO = Point(0, 0); - -// implementation of Size - -Size::Size(void) : width(0), height(0) -{ -} - -Size::Size(float w, float h) : width(w), height(h) -{ -} - -Size::Size(const Size& other) : width(other.width), height(other.height) -{ -} - -Size::Size(const Point& point) : width(point.x), height(point.y) -{ -} - -Size& Size::operator= (const Size& other) -{ - setSize(other.width, other.height); - return *this; -} - -Size& Size::operator= (const Point& point) -{ - setSize(point.x, point.y); - return *this; -} - -Size Size::operator+(const Size& right) const -{ - return Size(this->width + right.width, this->height + right.height); -} - -Size Size::operator-(const Size& right) const -{ - return Size(this->width - right.width, this->height - right.height); -} - -Size Size::operator*(float a) const -{ - return Size(this->width * a, this->height * a); -} - -Size Size::operator/(float a) const -{ - CCASSERT(a!=0, "CCSize division by 0."); - return Size(this->width / a, this->height / a); -} - -void Size::setSize(float w, float h) -{ - this->width = w; - this->height = h; -} - -bool Size::equals(const Size& target) const -{ - return (fabs(this->width - target.width) < FLT_EPSILON) - && (fabs(this->height - target.height) < FLT_EPSILON); -} - -const Size Size::ZERO = Size(0, 0); - -// implementation of Rect - -Rect::Rect(void) -{ - setRect(0.0f, 0.0f, 0.0f, 0.0f); -} - -Rect::Rect(float x, float y, float width, float height) -{ - setRect(x, y, width, height); -} - -Rect::Rect(const Rect& other) -{ - setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); -} - -Rect& Rect::operator= (const Rect& other) -{ - setRect(other.origin.x, other.origin.y, other.size.width, other.size.height); - return *this; -} - -void Rect::setRect(float x, float y, float width, float height) -{ - // CGRect can support width<0 or height<0 - // CCASSERT(width >= 0.0f && height >= 0.0f, "width and height of Rect must not less than 0."); - - origin.x = x; - origin.y = y; - - size.width = width; - size.height = height; -} - -bool Rect::equals(const Rect& rect) const -{ - return (origin.equals(rect.origin) && - size.equals(rect.size)); -} - -float Rect::getMaxX() const -{ - return origin.x + size.width; -} - -float Rect::getMidX() const -{ - return origin.x + size.width / 2.0f; -} - -float Rect::getMinX() const -{ - return origin.x; -} - -float Rect::getMaxY() const -{ - return origin.y + size.height; -} - -float Rect::getMidY() const -{ - return origin.y + size.height / 2.0f; -} - -float Rect::getMinY() const -{ - return origin.y; -} - -bool Rect::containsPoint(const Point& point) const -{ - bool bRet = false; - - if (point.x >= getMinX() && point.x <= getMaxX() - && point.y >= getMinY() && point.y <= getMaxY()) - { - bRet = true; - } - - return bRet; -} - -bool Rect::intersectsRect(const Rect& rect) const -{ - return !( getMaxX() < rect.getMinX() || - rect.getMaxX() < getMinX() || - getMaxY() < rect.getMinY() || - rect.getMaxY() < getMinY()); -} - -Rect Rect::unionWithRect(const Rect & rect) const -{ - float thisLeftX = origin.x; - float thisRightX = origin.x + size.width; - float thisTopY = origin.y + size.height; - float thisBottomY = origin.y; - - if (thisRightX < thisLeftX) - { - std::swap(thisRightX, thisLeftX); // This rect has negative width - } - - if (thisTopY < thisBottomY) - { - std::swap(thisTopY, thisBottomY); // This rect has negative height - } - - float otherLeftX = rect.origin.x; - float otherRightX = rect.origin.x + rect.size.width; - float otherTopY = rect.origin.y + rect.size.height; - float otherBottomY = rect.origin.y; - - if (otherRightX < otherLeftX) - { - std::swap(otherRightX, otherLeftX); // Other rect has negative width - } - - if (otherTopY < otherBottomY) - { - std::swap(otherTopY, otherBottomY); // Other rect has negative height - } - - float combinedLeftX = std::min(thisLeftX, otherLeftX); - float combinedRightX = std::max(thisRightX, otherRightX); - float combinedTopY = std::max(thisTopY, otherTopY); - float combinedBottomY = std::min(thisBottomY, otherBottomY); - - return Rect(combinedLeftX, combinedBottomY, combinedRightX - combinedLeftX, combinedTopY - combinedBottomY); -} - -const Rect Rect::ZERO = Rect(0, 0, 0, 0); - -NS_CC_END diff --git a/cocos/platform/cocoa/CCGeometry.h b/cocos/platform/cocoa/CCGeometry.h deleted file mode 100644 index 47e2fdf9ac..0000000000 --- a/cocos/platform/cocoa/CCGeometry.h +++ /dev/null @@ -1,564 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCGEMETRY_H__ -#define __CCGEMETRY_H__ - -#include -#include - -#include "platform/CCPlatformMacros.h" -#include "CCObject.h" -#include "ccMacros.h" - -NS_CC_BEGIN - -/** Clamp a value between from and to. - @since v0.99.1 - */ -inline float clampf(float value, float min_inclusive, float max_inclusive) -{ - if (min_inclusive > max_inclusive) { - CC_SWAP(min_inclusive, max_inclusive, float); - } - return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive; -} - -/** - * @addtogroup data_structures - * @{ - */ - -// for Point assignement operator and copy constructor -class CC_DLL Size; - -class CC_DLL Point -{ -public: - float x; - float y; - -public: - /** - * @js NA - */ - Point(); - /** - * @js NA - */ - Point(float x, float y); - /** - * @js NA - * @lua NA - */ - Point(const Point& other); - /** - * @js NA - * @lua NA - */ - explicit Point(const Size& size); - /** - * @js NA - * @lua NA - */ - Point& operator= (const Point& other); - /** - * @js NA - * @lua NA - */ - Point& operator= (const Size& size); - /** - * @js NA - * @lua NA - */ - Point operator+(const Point& right) const; - /** - * @js NA - * @lua NA - */ - Point operator-(const Point& right) const; - /** - * @js NA - * @lua NA - */ - Point operator-() const; - /** - * @js NA - * @lua NA - */ - Point operator*(float a) const; - /** - * @js NA - * @lua NA - */ - Point operator/(float a) const; - /** - * @js NA - * @lua NA - */ - void setPoint(float x, float y); - /** - * @js NA - */ - bool equals(const Point& target) const; - - /** @returns if points have fuzzy equality which means equal with some degree of variance. - @since v2.1.4 - * @js NA - * @lua NA - */ - bool fuzzyEquals(const Point& target, float variance) const; - - /** Calculates distance between point an origin - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getLength() const { - return sqrtf(x*x + y*y); - }; - - /** Calculates the square length of a Point (not calling sqrt() ) - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getLengthSq() const { - return dot(*this); //x*x + y*y; - }; - - /** Calculates the square distance between two points (not calling sqrt() ) - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getDistanceSq(const Point& other) const { - return (*this - other).getLengthSq(); - }; - - /** Calculates the distance between two points - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getDistance(const Point& other) const { - return (*this - other).getLength(); - }; - - /** @returns the angle in radians between this vector and the x axis - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float getAngle() const { - return atan2f(y, x); - }; - - /** @returns the angle in radians between two vector directions - @since v2.1.4 - * @js NA - * @lua NA - */ - float getAngle(const Point& other) const; - - /** Calculates dot product of two points. - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float dot(const Point& other) const { - return x*other.x + y*other.y; - }; - - /** Calculates cross product of two points. - @return float - @since v2.1.4 - * @js NA - * @lua NA - */ - inline float cross(const Point& other) const { - return x*other.y - y*other.x; - }; - - /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point getPerp() const { - return Point(-y, x); - }; - - /** Calculates midpoint between two points. - @return Point - @since v3.0 - * @js NA - * @lua NA - */ - inline Point getMidpoint(const Point& other) const - { - return Point((x + other.x) / 2.0f, (y + other.y) / 2.0f); - } - - /** Clamp a point between from and to. - @since v3.0 - * @js NA - * @lua NA - */ - inline Point getClampPoint(const Point& min_inclusive, const Point& max_inclusive) const - { - return Point(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y)); - } - - /** Run a math operation function on each point component - * absf, fllorf, ceilf, roundf - * any function that has the signature: float func(float); - * For example: let's try to take the floor of x,y - * p.compOp(floorf); - @since v3.0 - * @js NA - * @lua NA - */ - inline Point compOp(std::function function) const - { - return Point(function(x), function(y)); - } - - /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point getRPerp() const { - return Point(y, -x); - }; - - /** Calculates the projection of this over other. - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point project(const Point& other) const { - return other * (dot(other)/other.dot(other)); - }; - - /** Complex multiplication of two points ("rotates" two points). - @return Point vector with an angle of this.getAngle() + other.getAngle(), - and a length of this.getLength() * other.getLength(). - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point rotate(const Point& other) const { - return Point(x*other.x - y*other.y, x*other.y + y*other.x); - }; - - /** Unrotates two points. - @return Point vector with an angle of this.getAngle() - other.getAngle(), - and a length of this.getLength() * other.getLength(). - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point unrotate(const Point& other) const { - return Point(x*other.x + y*other.y, y*other.x - x*other.y); - }; - - /** Returns point multiplied to a length of 1. - * If the point is 0, it returns (1, 0) - @return Point - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point normalize() const { - float length = getLength(); - if(length == 0.) return Point(1.f, 0); - return *this / getLength(); - }; - - /** Linear Interpolation between two points a and b - @returns - alpha == 0 ? a - alpha == 1 ? b - otherwise a value between a..b - @since v2.1.4 - * @js NA - * @lua NA - */ - inline Point lerp(const Point& other, float alpha) const { - return *this * (1.f - alpha) + other * alpha; - }; - - /** Rotates a point counter clockwise by the angle around a pivot - @param pivot is the pivot, naturally - @param angle is the angle of rotation ccw in radians - @returns the rotated point - @since v2.1.4 - * @js NA - * @lua NA - */ - Point rotateByAngle(const Point& pivot, float angle) const; - - /** - * @js NA - * @lua NA - */ - static inline Point forAngle(const float a) - { - return Point(cosf(a), sinf(a)); - } - - /** A general line-line intersection test - @param A the startpoint for the first line L1 = (A - B) - @param B the endpoint for the first line L1 = (A - B) - @param C the startpoint for the second line L2 = (C - D) - @param D the endpoint for the second line L2 = (C - D) - @param S the range for a hitpoint in L1 (p = A + S*(B - A)) - @param T the range for a hitpoint in L2 (p = C + T*(D - C)) - @returns whether these two lines interects. - - Note that to truly test intersection for segments we have to make - sure that S & T lie within [0..1] and for rays, make sure S & T > 0 - the hit point is C + T * (D - C); - the hit point also is A + S * (B - A); - @since 3.0 - * @js NA - * @lua NA - */ - static bool isLineIntersect(const Point& A, const Point& B, - const Point& C, const Point& D, - float *S = nullptr, float *T = nullptr); - - /** - returns true if Line A-B overlap with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isLineOverlap(const Point& A, const Point& B, - const Point& C, const Point& D); - - /** - returns true if Line A-B parallel with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isLineParallel(const Point& A, const Point& B, - const Point& C, const Point& D); - - /** - returns true if Segment A-B overlap with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isSegmentOverlap(const Point& A, const Point& B, - const Point& C, const Point& D, - Point* S = nullptr, Point* E = nullptr); - - /** - returns true if Segment A-B intersects with segment C-D - @since v3.0 - * @js NA - * @lua NA - */ - static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D); - - /** - returns the intersection point of line A-B, C-D - @since v3.0 - * @js NA - * @lua NA - */ - static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D); - - static const Point ZERO; - -private: - // returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part - static bool isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E); - - // cross procuct of 2 vector. A->B X C->D - static float crossProduct2Vector(const Point& A, const Point& B, const Point& C, const Point& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); } -}; - -class CC_DLL Size -{ -public: - float width; - float height; - -public: - /** - * @js NA - */ - Size(); - /** - * @js NA - */ - Size(float width, float height); - /** - * @js NA - * @lua NA - */ - Size(const Size& other); - /** - * @js NA - * @lua NA - */ - explicit Size(const Point& point); - /** - * @js NA - * @lua NA - */ - Size& operator= (const Size& other); - /** - * @js NA - * @lua NA - */ - Size& operator= (const Point& point); - /** - * @js NA - * @lua NA - */ - Size operator+(const Size& right) const; - /** - * @js NA - * @lua NA - */ - Size operator-(const Size& right) const; - /** - * @js NA - * @lua NA - */ - Size operator*(float a) const; - /** - * @js NA - * @lua NA - */ - Size operator/(float a) const; - /** - * @js NA - * @lua NA - */ - void setSize(float width, float height); - /** - * @js NA - */ - bool equals(const Size& target) const; - - static const Size ZERO; -}; - -class CC_DLL Rect -{ -public: - Point origin; - Size size; - -public: - /** - * @js NA - */ - Rect(); - /** - * @js NA - */ - Rect(float x, float y, float width, float height); - /** - * @js NA - * @lua NA - */ - Rect(const Rect& other); - /** - * @js NA - * @lua NA - */ - Rect& operator= (const Rect& other); - /** - * @js NA - * @lua NA - */ - void setRect(float x, float y, float width, float height); - /** - * @js NA - */ - float getMinX() const; /// return the leftmost x-value of current rect - /** - * @js NA - */ - float getMidX() const; /// return the midpoint x-value of current rect - /** - * @js NA - */ - float getMaxX() const; /// return the rightmost x-value of current rect - /** - * @js NA - */ - float getMinY() const; /// return the bottommost y-value of current rect - /** - * @js NA - */ - float getMidY() const; /// return the midpoint y-value of current rect - /** - * @js NA - */ - float getMaxY() const; /// return the topmost y-value of current rect - /** - * @js NA - */ - bool equals(const Rect& rect) const; - /** - * @js NA - */ - bool containsPoint(const Point& point) const; - /** - * @js NA - */ - bool intersectsRect(const Rect& rect) const; - /** - * @js NA - * @lua NA - */ - Rect unionWithRect(const Rect & rect) const; - - static const Rect ZERO; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CCGEMETRY_H__ diff --git a/cocos/platform/cocoa/CCInteger.h b/cocos/platform/cocoa/CCInteger.h deleted file mode 100644 index 23735627dd..0000000000 --- a/cocos/platform/cocoa/CCInteger.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCINTEGER_H__ -#define __CCINTEGER_H__ - -#include "CCObject.h" -#include "platform/CCCommon.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL Integer : public Object, public Clonable -{ -public: - static Integer* create(int v) - { - Integer* pRet = new Integer(v); - pRet->autorelease(); - return pRet; - } - /** - * @js NA - */ - Integer(int v) - : _value(v) {} - int getValue() const {return _value;} - /** - * @js NA - * @lua NA - */ - virtual ~Integer() { - CCLOGINFO("deallocing ~Integer: %p", this); - } - - /* override functions */ - virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); } - - // overrides - virtual Integer* clone() const override - { - return Integer::create(_value); - } - -private: - int _value; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif /* __CCINTEGER_H__ */ diff --git a/cocos/platform/cocoa/CCNS.cpp b/cocos/platform/cocoa/CCNS.cpp deleted file mode 100644 index 8cf496c0b1..0000000000 --- a/cocos/platform/cocoa/CCNS.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#include "CCNS.h" -#include -#include -#include -#include - -using namespace std; - -NS_CC_BEGIN - -typedef std::vector strArray; - -// string toolkit -static inline void split(std::string src, const char* token, strArray& vect) -{ - int nend=0; - int nbegin=0; - while(nend != -1) - { - nend = src.find(token, nbegin); - if(nend == -1) - vect.push_back(src.substr(nbegin, src.length()-nbegin)); - else - vect.push_back(src.substr(nbegin, nend-nbegin)); - nbegin = nend + strlen(token); - } -} - -// first, judge whether the form of the string like this: {x,y} -// if the form is right,the string will be split into the parameter strs; -// or the parameter strs will be empty. -// if the form is right return true,else return false. -static bool splitWithForm(const char* pStr, strArray& strs) -{ - bool bRet = false; - - do - { - CC_BREAK_IF(!pStr); - - // string is empty - std::string content = pStr; - CC_BREAK_IF(content.length() == 0); - - int nPosLeft = content.find('{'); - int nPosRight = content.find('}'); - - // don't have '{' and '}' - CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); - // '}' is before '{' - CC_BREAK_IF(nPosLeft > nPosRight); - - std::string pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); - // nothing between '{' and '}' - CC_BREAK_IF(pointStr.length() == 0); - - int nPos1 = pointStr.find('{'); - int nPos2 = pointStr.find('}'); - // contain '{' or '}' - CC_BREAK_IF(nPos1 != (int)std::string::npos || nPos2 != (int)std::string::npos); - - split(pointStr, ",", strs); - if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0) - { - strs.clear(); - break; - } - - bRet = true; - } while (0); - - return bRet; -} - -// implement the functions - -Rect RectFromString(const char* pszContent) -{ - Rect result = Rect::ZERO; - - do - { - CC_BREAK_IF(!pszContent); - std::string content = pszContent; - - // find the first '{' and the third '}' - int nPosLeft = content.find('{'); - int nPosRight = content.find('}'); - for (int i = 1; i < 3; ++i) - { - if (nPosRight == (int)std::string::npos) - { - break; - } - nPosRight = content.find('}', nPosRight + 1); - } - CC_BREAK_IF(nPosLeft == (int)std::string::npos || nPosRight == (int)std::string::npos); - - content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1); - int nPointEnd = content.find('}'); - CC_BREAK_IF(nPointEnd == (int)std::string::npos); - nPointEnd = content.find(',', nPointEnd); - CC_BREAK_IF(nPointEnd == (int)std::string::npos); - - // get the point string and size string - std::string pointStr = content.substr(0, nPointEnd); - std::string sizeStr = content.substr(nPointEnd + 1, content.length() - nPointEnd); - - // split the string with ',' - strArray pointInfo; - CC_BREAK_IF(!splitWithForm(pointStr.c_str(), pointInfo)); - strArray sizeInfo; - CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo)); - - float x = (float) atof(pointInfo[0].c_str()); - float y = (float) atof(pointInfo[1].c_str()); - float width = (float) atof(sizeInfo[0].c_str()); - float height = (float) atof(sizeInfo[1].c_str()); - - result = Rect(x, y, width, height); - } while (0); - - return result; -} - -Point PointFromString(const char* pszContent) -{ - Point ret = Point::ZERO; - - do - { - strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); - - float x = (float) atof(strs[0].c_str()); - float y = (float) atof(strs[1].c_str()); - - ret = Point(x, y); - } while (0); - - return ret; -} - -Size SizeFromString(const char* pszContent) -{ - Size ret = Size::ZERO; - - do - { - strArray strs; - CC_BREAK_IF(!splitWithForm(pszContent, strs)); - - float width = (float) atof(strs[0].c_str()); - float height = (float) atof(strs[1].c_str()); - - ret = Size(width, height); - } while (0); - - return ret; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCNS.h b/cocos/platform/cocoa/CCNS.h deleted file mode 100644 index 8ce8e1dde6..0000000000 --- a/cocos/platform/cocoa/CCNS.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __PLATFOMR_CCNS_H__ -#define __PLATFOMR_CCNS_H__ - -#include "CCGeometry.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -/** -@brief Returns a Core Graphics rectangle structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{{x,y},{w, h}}", - where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. - These components can represent integer or float values. - An example of a valid string is "{{3,2},{4,5}}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a rectangle. - If the string is not well-formed, the function returns Rect::ZERO. -*/ -Rect CC_DLL RectFromString(const char* pszContent); - -/** -@brief Returns a Core Graphics point structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{x,y}", - where x is the x coordinate and y is the y coordinate. - The x and y values can represent integer or float values. - An example of a valid string is "{3.0,2.5}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a point. - If the string is not well-formed, the function returns Point::ZERO. -*/ -Point CC_DLL PointFromString(const char* pszContent); - -/** -@brief Returns a Core Graphics size structure corresponding to the data in a given string. -@param pszContent A string object whose contents are of the form "{w, h}", - where w is the width and h is the height. - The w and h values can be integer or float values. - An example of a valid string is "{3.0,2.5}". - The string is not localized, so items are always separated with a comma. -@return A Core Graphics structure that represents a size. - If the string is not well-formed, the function returns Size::ZERO. -*/ -Size CC_DLL SizeFromString(const char* pszContent); - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __PLATFOMR_CCNS_H__ - - diff --git a/cocos/platform/cocoa/CCObject.cpp b/cocos/platform/cocoa/CCObject.cpp deleted file mode 100644 index 13fa0e3236..0000000000 --- a/cocos/platform/cocoa/CCObject.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - - -#include "CCObject.h" -#include "CCAutoreleasePool.h" -#include "ccMacros.h" -#include "script_support/CCScriptSupport.h" - -NS_CC_BEGIN - -Object::Object() -: _luaID(0) -, _reference(1) // when the object is created, the reference count of it is 1 -, _autoReleaseCount(0) -{ - static unsigned int uObjectCount = 0; - - _ID = ++uObjectCount; -} - -Object::~Object() -{ - // if the object is managed, we should remove it - // from pool manager - if (_autoReleaseCount > 0) - { - PoolManager::sharedPoolManager()->removeObject(this); - } - - // if the object is referenced by Lua engine, remove it - if (_luaID) - { - ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptObjectByObject(this); - } - else - { - ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); - if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript) - { - pEngine->removeScriptObjectByObject(this); - } - } -} - -Object* Object::autorelease() -{ - PoolManager::sharedPoolManager()->addObject(this); - return this; -} - -bool Object::isSingleReference() const -{ - return _reference == 1; -} - -unsigned int Object::retainCount() const -{ - return _reference; -} - -bool Object::isEqual(const Object *object) -{ - return this == object; -} - -void Object::acceptVisitor(DataVisitor &visitor) -{ - visitor.visitObject(this); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCObject.h b/cocos/platform/cocoa/CCObject.h deleted file mode 100644 index 8de1ff9d8b..0000000000 --- a/cocos/platform/cocoa/CCObject.h +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCOBJECT_H__ -#define __CCOBJECT_H__ - -#include "cocoa/CCDataVisitor.h" -#include "ccMacros.h" - -#ifdef EMSCRIPTEN -#include -#endif // EMSCRIPTEN - -NS_CC_BEGIN - -/** - * @addtogroup base_nodes - * @{ - */ - -class Object; -class Node; - -/** Interface that defines how to clone an object */ -class CC_DLL Clonable -{ -public: - /** returns a copy of the object */ - virtual Clonable* clone() const = 0; - /** - * @js NA - * @lua NA - */ - virtual ~Clonable() {}; - - /** returns a copy of the object. - @deprecated Use clone() instead - */ - CC_DEPRECATED_ATTRIBUTE Object* copy() const - { - // use "clone" instead - CC_ASSERT(false); - return nullptr; - } -}; - -class CC_DLL Object -{ -public: - /// object id, ScriptSupport need public _ID - unsigned int _ID; - /// Lua reference id - int _luaID; -protected: - /// count of references - unsigned int _reference; - /// count of autorelease - unsigned int _autoReleaseCount; -public: - /** - * Constructor - * - * The object's reference count is 1 after construction. - * @js NA - */ - Object(); - - /** - * @js NA - * @lua NA - */ - virtual ~Object(); - - /** - * Release the ownership immediately. - * - * This decrements the object's reference count. - * - * If the reference count reaches 0 after the descrement, this object is - * destructed. - * - * @see retain, autorelease - * @js NA - */ - inline void release() - { - CCASSERT(_reference > 0, "reference count should greater than 0"); - --_reference; - - if (_reference == 0) - delete this; - } - - /** - * Retains the ownership. - * - * This increases the object's reference count. - * - * @see release, autorelease - * @js NA - */ - inline void retain() - { - CCASSERT(_reference > 0, "reference count should greater than 0"); - ++_reference; - } - - /** - * Release the ownership sometime soon automatically. - * - * This descrements the object's reference count at the end of current - * autorelease pool block. - * - * If the reference count reaches 0 after the descrement, this object is - * destructed. - * - * @returns The object itself. - * - * @see AutoreleasePool, retain, release - * @js NA - * @lua NA - */ - Object* autorelease(); - - /** - * Returns a boolean value that indicates whether there is only one - * reference to the object. That is, whether the reference count is 1. - * - * @returns Whether the object's reference count is 1. - * @js NA - */ - bool isSingleReference() const; - - /** - * Returns the object's current reference count. - * - * @returns The object's reference count. - * @js NA - */ - unsigned int retainCount() const; - - /** - * Returns a boolean value that indicates whether this object and a given - * object are equal. - * - * @param object The object to be compared to this object. - * - * @returns True if this object and @p object are equal, otherwise false. - * @js NA - * @lua NA - */ - virtual bool isEqual(const Object* object); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual void update(float dt) {CC_UNUSED_PARAM(dt);}; - - friend class AutoreleasePool; -}; - - -typedef void (Object::*SEL_SCHEDULE)(float); -typedef void (Object::*SEL_CallFunc)(); -typedef void (Object::*SEL_CallFuncN)(Node*); -typedef void (Object::*SEL_CallFuncND)(Node*, void*); -typedef void (Object::*SEL_CallFuncO)(Object*); -typedef void (Object::*SEL_MenuHandler)(Object*); -typedef int (Object::*SEL_Compare)(Object*); - -#define schedule_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfunc_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncN_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncND_selector(_SELECTOR) static_cast(&_SELECTOR) -#define callfuncO_selector(_SELECTOR) static_cast(&_SELECTOR) -#define menu_selector(_SELECTOR) static_cast(&_SELECTOR) -#define event_selector(_SELECTOR) static_cast(&_SELECTOR) -#define compare_selector(_SELECTOR) static_cast(&_SELECTOR) - -// new callbacks based on C++11 -#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) -#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__) -#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__) - -// end of base_nodes group -/// @} - -NS_CC_END - -#endif // __CCOBJECT_H__ diff --git a/cocos/platform/cocoa/CCSet.cpp b/cocos/platform/cocoa/CCSet.cpp deleted file mode 100644 index c3c24e0e5e..0000000000 --- a/cocos/platform/cocoa/CCSet.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCSet.h" - -using namespace std; - -NS_CC_BEGIN - -Set::Set(void) -{ - _set = new set; -} - -Set::Set(const Set &rSetObject) -{ - _set = new set(*rSetObject._set); - - // call retain of members - SetIterator iter; - for (iter = _set->begin(); iter != _set->end(); ++iter) - { - if (! (*iter)) - { - break; - } - - (*iter)->retain(); - } -} - -Set::~Set(void) -{ - removeAllObjects(); - CC_SAFE_DELETE(_set); -} - -void Set::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -Set * Set::create() -{ - Set * pRet = new Set(); - - if (pRet != NULL) - { - pRet->autorelease(); - } - - return pRet; -} - -Set* Set::copy(void) -{ - Set *pSet = new Set(*this); - - return pSet; -} - -Set* Set::mutableCopy(void) -{ - return copy(); -} - -int Set::count(void) -{ - return (int)_set->size(); -} - -void Set::addObject(Object *pObject) -{ - if (_set->count(pObject) == 0) - { - CC_SAFE_RETAIN(pObject); - _set->insert(pObject); - } -} - -void Set::removeObject(Object *pObject) -{ - if (_set->erase(pObject) > 0) - { - CC_SAFE_RELEASE(pObject); - } -} - -void Set::removeAllObjects() -{ - SetIterator it = _set->begin(); - SetIterator tmp; - - while (it != _set->end()) - { - if (!(*it)) - { - break; - } - - tmp = it; - ++tmp; - Object * obj = *it; - _set->erase(it); - CC_SAFE_RELEASE(obj); - it = tmp; - } -} - -bool Set::containsObject(Object *pObject) -{ - return _set->find(pObject) != _set->end(); -} - -SetIterator Set::begin(void) -{ - return _set->begin(); -} - -SetIterator Set::end(void) -{ - return _set->end(); -} - -Object* Set::anyObject() -{ - if (!_set || _set->empty()) - { - return 0; - } - - SetIterator it; - - for( it = _set->begin(); it != _set->end(); ++it) - { - if (*it) - { - return (*it); - } - } - - return 0; -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCSet.h b/cocos/platform/cocoa/CCSet.h deleted file mode 100644 index c748f0ada5..0000000000 --- a/cocos/platform/cocoa/CCSet.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010-2012 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CC_SET_H__ -#define __CC_SET_H__ - -#include -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -typedef std::set::iterator SetIterator; - -class CC_DLL Set : public Object -{ -public: - /** - * @js ctor - */ - Set(void); - Set(const Set &rSetObject); - /** - * @js NA - * @lua NA - */ - virtual ~Set(void); - - /** - * @brief Create and return a new empty set. - */ - static Set * create(); - - /** - *@brief Return a copy of the Set, it will copy all the elements. - */ - Set* copy(); - /** - *@brief It is the same as copy(). - */ - Set* mutableCopy(); - /** - *@brief Return the number of elements the Set contains. - */ - int count(); - /** - *@brief Add a element into Set, it will retain the element. - */ - void addObject(Object *pObject); - /** - *@brief Remove the given element, nothing todo if no element equals pObject. - */ - void removeObject(Object *pObject); - /** - *@brief Remove all elements of the set - */ - void removeAllObjects(); - /** - *@brief Check if Set contains a element equals pObject. - */ - bool containsObject(Object *pObject); - /** - *@brief Return the iterator that points to the first element. - * @js NA - * @lua NA - */ - SetIterator begin(); - /** - *@brief Return the iterator that points to the position after the last element. - * @js NA - * @lua NA - */ - SetIterator end(); - /** - *@brief Return the first element if it contains elements, or null if it doesn't contain any element. - */ - Object* anyObject(); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - -private: - std::set *_set; -}; - -// end of data_structure group -/// @} - -NS_CC_END - -#endif // __CC_SET_H__ - diff --git a/cocos/platform/cocoa/CCString.cpp b/cocos/platform/cocoa/CCString.cpp deleted file mode 100644 index f9962b1ba4..0000000000 --- a/cocos/platform/cocoa/CCString.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCString.h" -#include "platform/CCFileUtils.h" -#include "ccMacros.h" -#include -#include -#include "CCArray.h" - -NS_CC_BEGIN - -#define kMaxStringLen (1024*100) - -String::String() - :_string("") -{} - -String::String(const char * str) - :_string(str) -{} - -String::String(const std::string& str) - :_string(str) -{} - -String::String(const String& str) - :_string(str.getCString()) -{} - -String::~String() -{ - CCLOGINFO("deallocing String: %p", this); - - _string.clear(); -} - -String& String::operator= (const String& other) -{ - _string = other._string; - return *this; -} - -bool String::initWithFormatAndValist(const char* format, va_list ap) -{ - bool bRet = false; - char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) - { - vsnprintf(pBuf, kMaxStringLen, format, ap); - _string = pBuf; - free(pBuf); - bRet = true; - } - return bRet; -} - -bool String::initWithFormat(const char* format, ...) -{ - bool bRet = false; - _string.clear(); - - va_list ap; - va_start(ap, format); - - bRet = initWithFormatAndValist(format, ap); - - va_end(ap); - - return bRet; -} - -int String::intValue() const -{ - if (length() == 0) - { - return 0; - } - return atoi(_string.c_str()); -} - -unsigned int String::uintValue() const -{ - if (length() == 0) - { - return 0; - } - return (unsigned int)atoi(_string.c_str()); -} - -float String::floatValue() const -{ - if (length() == 0) - { - return 0.0f; - } - return (float)atof(_string.c_str()); -} - -double String::doubleValue() const -{ - if (length() == 0) - { - return 0.0; - } - return atof(_string.c_str()); -} - -bool String::boolValue() const -{ - if (length() == 0) - { - return false; - } - - if (0 == strcmp(_string.c_str(), "0") || 0 == strcmp(_string.c_str(), "false")) - { - return false; - } - return true; -} - -const char* String::getCString() const -{ - return _string.c_str(); -} - -unsigned int String::length() const -{ - return _string.length(); -} - -int String::compare(const char * pStr) const -{ - return strcmp(getCString(), pStr); -} - -void String::append(const std::string& str) -{ - _string.append(str); -} - -void String::appendWithFormat(const char* format, ...) -{ - va_list ap; - va_start(ap, format); - - char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) - { - vsnprintf(pBuf, kMaxStringLen, format, ap); - _string.append(pBuf); - free(pBuf); - } - - va_end(ap); - -} - -Array* String::componentsSeparatedByString(const char *delimiter) -{ - Array* result = Array::create(); - - int cutAt; - while( (cutAt = _string.find_first_of(delimiter)) != _string.npos ) - { - if(cutAt > 0) - { - result->addObject(String::create(_string.substr(0, cutAt))); - } - _string = _string.substr(cutAt + 1); - } - - if(_string.length() > 0) - { - result->addObject(String::create(_string)); - } - - return result; -} - -bool String::isEqual(const Object* pObject) -{ - bool bRet = false; - const String* pStr = dynamic_cast(pObject); - if (pStr != NULL) - { - if (0 == _string.compare(pStr->_string)) - { - bRet = true; - } - } - return bRet; -} - -String* String::create(const std::string& str) -{ - String* pRet = new String(str); - pRet->autorelease(); - return pRet; -} - -String* String::createWithData(const unsigned char* pData, unsigned long nLen) -{ - String* pRet = NULL; - if (pData != NULL) - { - char* pStr = (char*)malloc(nLen+1); - if (pStr != NULL) - { - pStr[nLen] = '\0'; - if (nLen > 0) - { - memcpy(pStr, pData, nLen); - } - - pRet = String::create(pStr); - free(pStr); - } - } - return pRet; -} - -String* String::createWithFormat(const char* format, ...) -{ - String* pRet = String::create(""); - va_list ap; - va_start(ap, format); - pRet->initWithFormatAndValist(format, ap); - va_end(ap); - - return pRet; -} - -String* String::createWithContentsOfFile(const char* filename) -{ - unsigned long size = 0; - unsigned char* pData = 0; - String* pRet = NULL; - pData = FileUtils::getInstance()->getFileData(filename, "rb", &size); - pRet = String::createWithData(pData, size); - CC_SAFE_DELETE_ARRAY(pData); - return pRet; -} - -void String::acceptVisitor(DataVisitor &visitor) -{ - visitor.visit(this); -} - -String* String::clone() const -{ - return String::create(_string); -} - -NS_CC_END diff --git a/cocos/platform/cocoa/CCString.h b/cocos/platform/cocoa/CCString.h deleted file mode 100644 index a6f237a476..0000000000 --- a/cocos/platform/cocoa/CCString.h +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************************** -Copyright (c) 2010 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#ifndef __CCSTRING_H__ -#define __CCSTRING_H__ - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) -#include -#endif - -#include -#include -#include -#include "CCObject.h" - -NS_CC_BEGIN - -/** - * @addtogroup data_structures - * @{ - */ - -class CC_DLL String : public Object, public Clonable -{ -public: - /** - * @js NA - * @lua NA - */ - String(); - /** - * @js NA - * @lua NA - */ - String(const char* str); - /** - * @js NA - * @lua NA - */ - String(const std::string& str); - /** - * @js NA - * @lua NA - */ - String(const String& str); - /** - * @js NA - * @lua NA - */ - virtual ~String(); - - /* override assignment operator - * @js NA - * @lua NA - */ - String& operator= (const String& other); - - /** init a string with format, it's similar with the c function 'sprintf' - * @js NA - * @lua NA - */ - bool initWithFormat(const char* format, ...) CC_FORMAT_PRINTF(2, 3); - - /** convert to int value - * @js NA - */ - int intValue() const; - - /** convert to unsigned int value - * @js NA - */ - unsigned int uintValue() const; - - /** convert to float value - * @js NA - */ - float floatValue() const; - - /** convert to double value - * @js NA - */ - double doubleValue() const; - - /** convert to bool value - * @js NA - */ - bool boolValue() const; - - /** get the C string - * @js NA - */ - const char* getCString() const; - - /** get the length of string - * @js NA - */ - unsigned int length() const; - - /** compare to a c string - * @js NA - */ - int compare(const char *) const; - - /** append additional characters at the end of its current value - * @js NA - * @lua NA - */ - void append(const std::string& str); - - /** append(w/ format) additional characters at the end of its current value - * @js NA - * @lua NA - */ - void appendWithFormat(const char* format, ...); - - /** split a string - * @js NA - * @lua NA - */ - Array* componentsSeparatedByString(const char *delimiter); - - /* override functions - * @js NA - */ - virtual bool isEqual(const Object* pObject); - - /** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* create(const std::string& str); - - /** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, - * if you want to change it, you should modify the kMaxStringLen macro in String.cpp file. - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithFormat(const char* format, ...) CC_FORMAT_PRINTF(1, 2); - - /** create a string with binary data - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithData(const unsigned char* pData, unsigned long nLen); - - /** create a string with a file, - * @return A String pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - * @js NA - */ - static String* createWithContentsOfFile(const char* filename); - /** - * @js NA - * @lua NA - */ - virtual void acceptVisitor(DataVisitor &visitor); - /** - * @js NA - * @lua NA - */ - virtual String* clone() const; - -private: - - /** only for internal use */ - bool initWithFormatAndValist(const char* format, va_list ap); - -public: - std::string _string; -}; - -struct StringCompare : public std::binary_function { - public: - bool operator() (String * a, String * b) const { - return strcmp(a->getCString(), b->getCString()) < 0; - } -}; - -#define StringMake(str) String::create(str) -#define ccs StringMake - -// end of data_structure group -/// @} - -NS_CC_END - -#endif //__CCSTRING_H__ diff --git a/cocos/scripting/auto-generated b/cocos/scripting/auto-generated index ba1165bab0..73aebd082a 160000 --- a/cocos/scripting/auto-generated +++ b/cocos/scripting/auto-generated @@ -1 +1 @@ -Subproject commit ba1165bab00a7ba34de057b28f272f31f50a303a +Subproject commit 73aebd082ae63561cc1ca769f28e302820da7e39 diff --git a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp index b799f6aacf..2230a4a94d 100644 --- a/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp +++ b/cocos/scripting/javascript/bindings/XMLHTTPRequest.cpp @@ -167,7 +167,7 @@ void MinXmlHttpRequest::_setHttpRequestHeader() * @param sender Object which initialized callback * @param respone Response object */ -void MinXmlHttpRequest::handle_requestResponse(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response) +void MinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response) { if (0 != strlen(response->getHttpRequest()->getTag())) { @@ -247,7 +247,7 @@ void MinXmlHttpRequest::handle_requestResponse(cocos2d::extension::HttpClient *s void MinXmlHttpRequest::_sendRequest(JSContext *cx) { _httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse)); - cocos2d::extension::HttpClient::getInstance()->send(_httpRequest); + network::HttpClient::getInstance()->send(_httpRequest); _httpRequest->release(); } @@ -261,7 +261,7 @@ MinXmlHttpRequest::MinXmlHttpRequest() : _onreadystateCallback(NULL), _isNetwork _requestHeader.clear(); _withCredentialsValue = true; _cx = ScriptingCore::getInstance()->getGlobalContext(); - _httpRequest = new cocos2d::extension::HttpRequest(); + _httpRequest = new network::HttpRequest(); } /** @@ -622,11 +622,11 @@ JS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open) if (_meth.compare("post") == 0 || _meth.compare("POST") == 0) { - _httpRequest->setRequestType(cocos2d::extension::HttpRequest::Type::POST); + _httpRequest->setRequestType(network::HttpRequest::Type::POST); } else { - _httpRequest->setRequestType(cocos2d::extension::HttpRequest::Type::GET); + _httpRequest->setRequestType(network::HttpRequest::Type::GET); } _httpRequest->setUrl(_url.c_str()); diff --git a/cocos/scripting/javascript/bindings/XMLHTTPRequest.h b/cocos/scripting/javascript/bindings/XMLHTTPRequest.h index b94e05e5fe..861e0a2536 100644 --- a/cocos/scripting/javascript/bindings/XMLHTTPRequest.h +++ b/cocos/scripting/javascript/bindings/XMLHTTPRequest.h @@ -80,7 +80,7 @@ public: JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader); JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType); - void handle_requestResponse(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response); + void handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response); private: @@ -102,7 +102,7 @@ private: ResponseType _responseType; unsigned _timeout; bool _isAsync; - cocos2d::extension::HttpRequest* _httpRequest; + network::HttpRequest* _httpRequest; bool _isNetwork; bool _withCredentialsValue; std::map _httpHeader; diff --git a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp index 523cdcda10..733ac47b45 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp +++ b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; static void removeSelector(std::string &str) { size_t found; @@ -79,7 +80,7 @@ JSBool js_cocos2dx_CCBAnimationManager_animationCompleteCallback(JSContext *cx, JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::CCBAnimationManager *node = (cocos2d::extension::CCBAnimationManager *)(proxy ? proxy->ptr : NULL); + cocosbuilder::CCBAnimationManager *node = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL); JSCCBAnimationWrapper *tmpCobj = new JSCCBAnimationWrapper(); tmpCobj->autorelease(); @@ -103,10 +104,10 @@ JSBool js_cocos2dx_CCBReader_readNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *argv = JS_ARGV(cx, vp); JSBool ok = JS_TRUE; JSObject *obj; - cocos2d::extension::CCBReader* cobj; + cocosbuilder::CCBReader* cobj; obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::extension::CCBReader *)(proxy ? proxy->ptr : NULL); + cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, cobj) if (argc == 2) { @@ -188,10 +189,10 @@ JSBool js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile(JSContext *cx, uin jsval *argv = JS_ARGV(cx, vp); JSBool ok = JS_TRUE; JSObject *obj; - cocos2d::extension::CCBReader* cobj; + cocosbuilder::CCBReader* cobj; obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cobj = (cocos2d::extension::CCBReader *)(proxy ? proxy->ptr : NULL); + cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, cobj) if (argc == 2) { @@ -277,7 +278,7 @@ JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp) ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader()); - cocos2d::extension::CCBReader * ret = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + CCBReader * ret = new CCBReader(ccNodeLoaderLibrary); ret->autorelease(); jsval jsret; @@ -287,7 +288,7 @@ JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp) jsret = OBJECT_TO_JSVAL(proxy->obj); } else { // create a new js obj of that class - proxy = js_get_or_create_proxy(cx, ret); + proxy = js_get_or_create_proxy(cx, ret); jsret = OBJECT_TO_JSVAL(proxy->obj); } } else { diff --git a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h index e81b9d3be2..8bcdabd044 100644 --- a/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h +++ b/cocos/scripting/javascript/bindings/js_bindings_ccbreader.h @@ -9,13 +9,12 @@ #define __JS_BINDINGS_CCBREADER_H__ #include "jsapi.h" -#include "cocos-ext.h" #include "cocos2d_specifics.hpp" - +#include "cocosbuilder/CocosBuilder.h" class CCBScriptCallbackProxy: public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner { +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner { std::string callBackProp; jsval owner; @@ -35,7 +34,7 @@ public: virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * pNode); virtual void onNodeLoaded(cocos2d::Node * pNode, - cocos2d::extension::NodeLoader * pNodeLoader); + cocosbuilder::NodeLoader * pNodeLoader); virtual CCBSelectorResolver * createNew(); void menuItemCallback(Object *pSender); @@ -46,7 +45,7 @@ public: }; -class JSLayerLoader : public cocos2d::extension::LayerLoader { +class JSLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(JSLayerLoader, loader); diff --git a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp index 3ec02a7d86..7a6d8bfc46 100644 --- a/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/javascript/bindings/jsb_cocos2dx_extension_manual.cpp @@ -9,10 +9,11 @@ #include "cocos-ext.h" #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" +#include "cocostudio/CocoStudio.h" USING_NS_CC; USING_NS_CC_EXT; -using namespace extension::armature; + class JSB_ScrollViewDelegate : public Object @@ -787,8 +788,8 @@ public: virtual void setJSCallbackThis(jsval thisObj); - void movementCallbackFunc(cocos2d::extension::armature::Armature * pArmature, cocos2d::extension::armature::MovementEventType pMovementEventType, const char *pMovementId); - void frameCallbackFunc(cocos2d::extension::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex); + void movementCallbackFunc(cocostudio::Armature * pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId); + void frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex); void addArmatureFileInfoAsyncCallbackFunc(float percent); private: @@ -825,7 +826,7 @@ void JSArmatureWrapper::setJSCallbackThis(jsval _jsThisObj) } } -void JSArmatureWrapper::movementCallbackFunc(cocos2d::extension::armature::Armature *pArmature, cocos2d::extension::armature::MovementEventType pMovementEventType, const char *pMovementId) +void JSArmatureWrapper::movementCallbackFunc(cocostudio::Armature *pArmature, cocostudio::MovementEventType pMovementEventType, const char *pMovementId) { JSContext *cx = ScriptingCore::getInstance()->getGlobalContext(); JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj); @@ -865,7 +866,7 @@ void JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc(float percent) } -void JSArmatureWrapper::frameCallbackFunc(cocos2d::extension::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex) +void JSArmatureWrapper::frameCallbackFunc(cocostudio::Bone *pBone, const char *frameEventName, int originFrameIndex, int currentFrameIndex) { JSContext *cx = ScriptingCore::getInstance()->getGlobalContext(); JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj); @@ -893,7 +894,7 @@ static JSBool js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(JSContext * { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureAnimation* cobj = (cocos2d::extension::armature::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 2) { @@ -917,7 +918,7 @@ static JSBool js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(JSContext *cx, { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureAnimation* cobj = (cocos2d::extension::armature::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 2) { @@ -941,7 +942,7 @@ static JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint { JSObject *obj = JS_THIS_OBJECT(cx, vp); js_proxy_t *proxy = jsb_get_js_proxy(obj); - cocos2d::extension::armature::ArmatureDataManager* cobj = (cocos2d::extension::armature::ArmatureDataManager *)(proxy ? proxy->ptr : NULL); + cocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL); JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object"); if (argc == 3) { diff --git a/cocos/scripting/javascript/bindings/jsb_websocket.cpp b/cocos/scripting/javascript/bindings/jsb_websocket.cpp index 28a01fbc5b..49ecf7e57e 100644 --- a/cocos/scripting/javascript/bindings/jsb_websocket.cpp +++ b/cocos/scripting/javascript/bindings/jsb_websocket.cpp @@ -30,7 +30,7 @@ THE SOFTWARE. #include "ScriptingCore.h" #include "cocos2d_specifics.hpp" -USING_NS_CC_EXT; +using namespace network; /* [Constructor(in DOMString url, in optional DOMString protocols)] @@ -242,7 +242,7 @@ JSBool js_cocos2dx_extension_WebSocket_constructor(JSContext *cx, uint32_t argc, JSObject *obj = JS_NewObject(cx, js_cocos2dx_websocket_class, js_cocos2dx_websocket_prototype, NULL); - cocos2d::extension::WebSocket* cobj = new cocos2d::extension::WebSocket(); + WebSocket* cobj = new WebSocket(); JSB_WebSocketDelegate* delegate = new JSB_WebSocketDelegate(); delegate->setJSDelegate(obj); diff --git a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js deleted file mode 100644 index c2913daba5..0000000000 --- a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_chipmunk.js +++ /dev/null @@ -1,602 +0,0 @@ -/** - * @fileoverview Java Script Builtins for windows properties. - * - * @externs - */ - -/** - * @see https://cocos2d-x.org - */ - -/** - * for chipmunk api - * @type {string} - */ -var cp = function(){}; - -CSSProperties.prototype.cp; -CSSProperties.prototype.momentForCircle; -CSSProperties.prototype.areaForCircle; -CSSProperties.prototype.momentForSegment; -CSSProperties.prototype.areaForSegment; -CSSProperties.prototype.momentForPoly; -CSSProperties.prototype.areaForPoly; -CSSProperties.prototype.centroidForPoly; -CSSProperties.prototype.recenterPoly; -CSSProperties.prototype.momentForBox; -CSSProperties.prototype.momentForBox2; -CSSProperties.prototype.clamp01; -CSSProperties.prototype.fclamp01; -CSSProperties.prototype.Vect; -CSSProperties.prototype.add; -CSSProperties.prototype.sub; -CSSProperties.prototype.neg; -CSSProperties.prototype.mult; -CSSProperties.prototype.project; -CSSProperties.prototype.rotate; -CSSProperties.prototype.v; -CSSProperties.prototype.dot; -CSSProperties.prototype.len; -CSSProperties.prototype.eql; -CSSProperties.prototype.cross; -CSSProperties.prototype.perp; -CSSProperties.prototype.pvrperp; -CSSProperties.prototype.unrotate; -CSSProperties.prototype.lengthsq; -CSSProperties.prototype.lerp; -CSSProperties.prototype.normalize; -CSSProperties.prototype.normalize_safe; -CSSProperties.prototype.clamp; -CSSProperties.prototype.lerpconst; -CSSProperties.prototype.dist; -CSSProperties.prototype.distsq; -CSSProperties.prototype.near; -CSSProperties.prototype.slerp; -CSSProperties.prototype.slerpconst; -CSSProperties.prototype.forangle; -CSSProperties.prototype.toangle; -CSSProperties.prototype.str; -CSSProperties.prototype.vzero; -CSSProperties.prototype.x; -CSSProperties.prototype.y; -CSSProperties.prototype.BB; -CSSProperties.prototype.bb; -CSSProperties.prototype.NO_GROUP; -CSSProperties.prototype.ALL_LAYERS; -CSSProperties.prototype.resetShapeIdCounter; -CSSProperties.prototype.Shape; -CSSProperties.prototype.setElasticity; -CSSProperties.prototype.setFriction; -CSSProperties.prototype.setLayers; -CSSProperties.prototype.setSensor; -CSSProperties.prototype.setCollisionType; -CSSProperties.prototype.getBody; -CSSProperties.prototype.active; -CSSProperties.prototype.setBody; -CSSProperties.prototype.cacheBB; -CSSProperties.prototype.update; -CSSProperties.prototype.getBB; -CSSProperties.prototype.CircleShape; -CSSProperties.prototype.cacheData; -CSSProperties.prototype.pointQuery; -CSSProperties.prototype.segmentQuery; -CSSProperties.prototype.collisionCode; -CSSProperties.prototype.collisionTable; -CSSProperties.prototype.SegmentShape; -CSSProperties.prototype.setNeighbors; -CSSProperties.prototype.setEndpoints; -CSSProperties.prototype.PolyShape; -CSSProperties.prototype.setVerts; -CSSProperties.prototype.transformVerts; -CSSProperties.prototype.transformAxes; -CSSProperties.prototype.getNumVerts; -CSSProperties.prototype.getVert; -CSSProperties.prototype.valueOnAxis; -CSSProperties.prototype.containsVert; -CSSProperties.prototype.containsVertPartial; -CSSProperties.prototype.BoxShape; -CSSProperties.prototype.BoxShape2; -CSSProperties.prototype.Body; -CSSProperties.prototype.sanityCheck; -CSSProperties.prototype.getPos; -CSSProperties.prototype.getVel; -CSSProperties.prototype.getAngVel; -CSSProperties.prototype.isSleeping; -CSSProperties.prototype.isStatic; -CSSProperties.prototype.isRogue; -CSSProperties.prototype.setMass; -CSSProperties.prototype.setMoment; -CSSProperties.prototype.addShape; -CSSProperties.prototype.removeShape; -CSSProperties.prototype.removeConstraint; -CSSProperties.prototype.setPos; -CSSProperties.prototype.setVel; -CSSProperties.prototype.setAngVel; -CSSProperties.prototype.setAngleInternal; -CSSProperties.prototype.setAngle; -CSSProperties.prototype.velocity_func; -CSSProperties.prototype.position_func; -CSSProperties.prototype.resetForces; -CSSProperties.prototype.applyForce; -CSSProperties.prototype.applyImpulse; -CSSProperties.prototype.getVelAtPoint; -CSSProperties.prototype.getVelAtWorldPoint; -CSSProperties.prototype.getVelAtLocalPoint; -CSSProperties.prototype.eachShape; -CSSProperties.prototype.eachConstraint; -CSSProperties.prototype.eachArbiter; -CSSProperties.prototype.local2World; -CSSProperties.prototype.world2Local; -CSSProperties.prototype.kineticEnergy; -CSSProperties.prototype.activate; -CSSProperties.prototype.activateStatic; -CSSProperties.prototype.pushArbiter; -CSSProperties.prototype.sleep; -CSSProperties.prototype.sleepWithGroup; -CSSProperties.prototype.StaticBody; -CSSProperties.prototype.SpatialIndex; -CSSProperties.prototype.collideStatic; -CSSProperties.prototype.BBTree; -CSSProperties.prototype.getStamp; -CSSProperties.prototype.incrementStamp; -CSSProperties.prototype.insert; -CSSProperties.prototype.remove; -CSSProperties.prototype.contains; -CSSProperties.prototype.reindexQuery; -CSSProperties.prototype.reindex; -CSSProperties.prototype.reindexObject; -CSSProperties.prototype.query; -CSSProperties.prototype.count; -CSSProperties.prototype.each; -CSSProperties.prototype.optimize; -CSSProperties.prototype.log; -CSSProperties.prototype.CollisionHandler; -CSSProperties.prototype.begin; -CSSProperties.prototype.preSolve; -CSSProperties.prototype.postSolve; -CSSProperties.prototype.separate; -CSSProperties.prototype.collideShapes; -CSSProperties.prototype.Space; -CSSProperties.prototype.getCurrentTimeStep; -CSSProperties.prototype.isLocked; -CSSProperties.prototype.addCollisionHandler; -CSSProperties.prototype.removeCollisionHandler; -CSSProperties.prototype.setDefaultCollisionHandler; -CSSProperties.prototype.lookupHandler; -CSSProperties.prototype.addStaticShape; -CSSProperties.prototype.addBody; -CSSProperties.prototype.addConstraint; -CSSProperties.prototype.filterArbiters; -CSSProperties.prototype.removeStaticShape; -CSSProperties.prototype.removeBody; -CSSProperties.prototype.containsShape; -CSSProperties.prototype.containsBody; -CSSProperties.prototype.containsConstraint; -CSSProperties.prototype.uncacheArbiter; -CSSProperties.prototype.eachBody; -CSSProperties.prototype.reindexStatic; -CSSProperties.prototype.reindexShape; -CSSProperties.prototype.reindexShapesForBody; -CSSProperties.prototype.useSpatialHash; -CSSProperties.prototype.activateBody; -CSSProperties.prototype.deactivateBody; -CSSProperties.prototype.processComponents; -CSSProperties.prototype.activateShapesTouchingShape; -CSSProperties.prototype.pointQueryFirst; -CSSProperties.prototype.segmentQueryFirst; -CSSProperties.prototype.bbQuery; -CSSProperties.prototype.shapeQuery; -CSSProperties.prototype.addPostStepCallback; -CSSProperties.prototype.runPostStepCallbacks; -CSSProperties.prototype.lock; -CSSProperties.prototype.unlock; -CSSProperties.prototype.makeCollideShapes; -CSSProperties.prototype.arbiterSetFilter; -CSSProperties.prototype.step; -CSSProperties.prototype.Constraint; -CSSProperties.prototype.activateBodies; -CSSProperties.prototype.preStep; -CSSProperties.prototype.applyCachedImpulse; -CSSProperties.prototype.getImpulse; -CSSProperties.prototype.next; -CSSProperties.prototype.PinJoint; -CSSProperties.prototype.SlideJoint; -CSSProperties.prototype.PivotJoint; -CSSProperties.prototype.GrooveJoint; -CSSProperties.prototype.grooveConstrain; -CSSProperties.prototype.setGrooveA; -CSSProperties.prototype.setGrooveB; -CSSProperties.prototype.DampedSpring; -CSSProperties.prototype.DampedRotarySpring; -CSSProperties.prototype.RotaryLimitJoint; -CSSProperties.prototype.RatchetJoint; -CSSProperties.prototype.GearJoint; -CSSProperties.prototype.setRatio; -CSSProperties.prototype.SimpleMotor; -CSSProperties.prototype.Base; -CSSProperties.prototype._v; -CSSProperties.prototype.vadd; -CSSProperties.prototype.getHandle; -CSSProperties.prototype.getGravity; -CSSProperties.prototype.getIterations; -CSSProperties.prototype.getDamping; -CSSProperties.prototype.getStaticBody; -CSSProperties.prototype.getIdleSpeedThreshold; -CSSProperties.prototype.getSleepTimeThreshold; -CSSProperties.prototype.getCollisionSlop; -CSSProperties.prototype.getCollisionBias; -CSSProperties.prototype.getCollisionPersistence; -CSSProperties.prototype.getEnableContactGraph; -CSSProperties.prototype.getAngle; -CSSProperties.prototype.getAngVel; -CSSProperties.prototype.getPos; -CSSProperties.prototype.getVel; -CSSProperties.prototype.getMoment; -CSSProperties.prototype.getBody; -CSSProperties.prototype.getGroup; -CSSProperties.prototype.getCollisionType; -CSSProperties.prototype.getMaxForce; -CSSProperties.prototype.getAnchr1; -CSSProperties.prototype.getAnchr2; -CSSProperties.prototype.setHandle; -CSSProperties.prototype._setSpace; -CSSProperties.prototype._setCPBody; -CSSProperties.prototype.setGravity; -CSSProperties.prototype.setIterations; -CSSProperties.prototype.setDamping; -CSSProperties.prototype.setStaticBody; -CSSProperties.prototype.setIdleSpeedThreshold; -CSSProperties.prototype.setSleepTimeThreshold; -CSSProperties.prototype.setCollisionSlop; -CSSProperties.prototype.setCollisionBias; -CSSProperties.prototype.setCollisionPersistence; -CSSProperties.prototype.setEnableContactGraph; -CSSProperties.prototype.setAngle; -CSSProperties.prototype.setAngVel; -CSSProperties.prototype.setPos; -CSSProperties.prototype.setVel; -CSSProperties.prototype.setMoment; -CSSProperties.prototype.setBody; -CSSProperties.prototype.setGroup; -CSSProperties.prototype.setCollisionType; -CSSProperties.prototype.setMaxForce; -CSSProperties.prototype.setAnchr1; -CSSProperties.prototype.setAnchr2; -CSSProperties.prototype.vclamp; -CSSProperties.prototype.vcross; -CSSProperties.prototype.vdist; -CSSProperties.prototype.vdistsq; -CSSProperties.prototype.vdot; -CSSProperties.prototype.veql; -CSSProperties.prototype.vforangle; -CSSProperties.prototype.vlength; -CSSProperties.prototype.vlengthsq; -CSSProperties.prototype.vlerp; -CSSProperties.prototype.vlerpconst; -CSSProperties.prototype.vmult; -CSSProperties.prototype.vnear; -CSSProperties.prototype.vneg; -CSSProperties.prototype.vnormalize; -CSSProperties.prototype.vnormalize_safe; -CSSProperties.prototype.vperp; -CSSProperties.prototype.vproject; -CSSProperties.prototype.vrotate; -CSSProperties.prototype.vrperp; -CSSProperties.prototype.vslerp; -CSSProperties.prototype.vslerpconst; -CSSProperties.prototype.vsub; -CSSProperties.prototype.vtoangle; -CSSProperties.prototype.vunrotate; -CSSProperties.prototype.l; -CSSProperties.prototype.b; -CSSProperties.prototype.t; -CSSProperties.prototype.r; -CSSProperties.prototype.a; -CSSProperties.prototype.w; -CSSProperties.prototype.p; -CSSProperties.prototype.i; -CSSProperties.prototype.handle; -CSSProperties.prototype.gravity; -CSSProperties.prototype.iterations; -CSSProperties.prototype.damping; -CSSProperties.prototype.staticBody; -CSSProperties.prototype.idleSpeedThreshold; -CSSProperties.prototype.sleepTimeThreshold; -CSSProperties.prototype.collisionSlop; -CSSProperties.prototype.collisionBias; -CSSProperties.prototype.collisionPersistence; -CSSProperties.prototype.enableContactGraph; -CSSProperties.prototype.group; -CSSProperties.prototype.collision_type; -CSSProperties.prototype.maxForce; -CSSProperties.prototype.anchr1; -CSSProperties.prototype.anchr2; -CSSProperties.prototype.collisionBegin; -CSSProperties.prototype.collisionPre; -CSSProperties.prototype.collisionPost; -CSSProperties.prototype.collisionSeparate; -CSSProperties.prototype.createPhysicsSprite; -CSSProperties.prototype.Arbiter; -CSSProperties.prototype.spaceAddCollisionHandler; -CSSProperties.prototype.spaceRemoveCollisionHandler; -CSSProperties.prototype.arbiterGetBodies; -CSSProperties.prototype.arbiterGetShapes; -CSSProperties.prototype.bodyGetUserData; -CSSProperties.prototype.bodySetUserData; -CSSProperties.prototype.getBodies; -CSSProperties.prototype.getShapes; -CSSProperties.prototype.getUserData; -CSSProperties.prototype.setUserData; -CSSProperties.prototype.arbiterGetCount; -CSSProperties.prototype.arbiterGetDepth; -CSSProperties.prototype.arbiterGetElasticity; -CSSProperties.prototype.arbiterGetFriction; -CSSProperties.prototype.arbiterGetNormal; -CSSProperties.prototype.arbiterGetPoint; -CSSProperties.prototype.arbiterGetSurfaceVelocity; -CSSProperties.prototype.arbiterIgnore; -CSSProperties.prototype.arbiterIsFirstContact; -CSSProperties.prototype.arbiterSetElasticity; -CSSProperties.prototype.arbiterSetFriction; -CSSProperties.prototype.arbiterSetSurfaceVelocity; -CSSProperties.prototype.arbiterTotalImpulse; -CSSProperties.prototype.arbiterTotalImpulseWithFriction; -CSSProperties.prototype.arbiterTotalKE; -CSSProperties.prototype.areaForCircle; -CSSProperties.prototype.areaForSegment; -CSSProperties.prototype.bBArea; -CSSProperties.prototype.bBClampVect; -CSSProperties.prototype.bBContainsBB; -CSSProperties.prototype.bBContainsVect; -CSSProperties.prototype.bBExpand; -CSSProperties.prototype.bBIntersects; -CSSProperties.prototype.bBIntersectsSegment; -CSSProperties.prototype.bBMerge; -CSSProperties.prototype.bBMergedArea; -CSSProperties.prototype.bBNew; -CSSProperties.prototype.bBNewForCircle; -CSSProperties.prototype.bBSegmentQuery; -CSSProperties.prototype.bBWrapVect; -CSSProperties.prototype.bodyActivate; -CSSProperties.prototype.bodyActivateStatic; -CSSProperties.prototype.bodyApplyForce; -CSSProperties.prototype.bodyApplyImpulse; -CSSProperties.prototype.bodyDestroy; -CSSProperties.prototype.bodyFree; -CSSProperties.prototype.bodyGetAngVel; -CSSProperties.prototype.bodyGetAngVelLimit; -CSSProperties.prototype.bodyGetAngle; -CSSProperties.prototype.bodyGetForce; -CSSProperties.prototype.bodyGetMass; -CSSProperties.prototype.bodyGetMoment; -CSSProperties.prototype.bodyGetPos; -CSSProperties.prototype.bodyGetRot; -CSSProperties.prototype.bodyGetSpace; -CSSProperties.prototype.bodyGetTorque; -CSSProperties.prototype.bodyGetVel; -CSSProperties.prototype.bodyGetVelAtLocalPoint; -CSSProperties.prototype.bodyGetVelAtWorldPoint; -CSSProperties.prototype.bodyGetVelLimit; -CSSProperties.prototype.bodyInit; -CSSProperties.prototype.bodyInitStatic; -CSSProperties.prototype.bodyIsRogue; -CSSProperties.prototype.bodyIsSleeping; -CSSProperties.prototype.bodyIsStatic; -CSSProperties.prototype.bodyKineticEnergy; -CSSProperties.prototype.bodyLocal2World; -CSSProperties.prototype.bodyNew; -CSSProperties.prototype.bodyNewStatic; -CSSProperties.prototype.bodyResetForces; -CSSProperties.prototype.bodySetAngVel; -CSSProperties.prototype.bodySetAngVelLimit; -CSSProperties.prototype.bodySetAngle; -CSSProperties.prototype.bodySetForce; -CSSProperties.prototype.bodySetMass; -CSSProperties.prototype.bodySetMoment; -CSSProperties.prototype.bodySetPos; -CSSProperties.prototype.bodySetTorque; -CSSProperties.prototype.bodySetVel; -CSSProperties.prototype.bodySetVelLimit; -CSSProperties.prototype.bodySleep; -CSSProperties.prototype.bodySleepWithGroup; -CSSProperties.prototype.bodyUpdatePosition; -CSSProperties.prototype.bodyUpdateVelocity; -CSSProperties.prototype.bodyWorld2Local; -CSSProperties.prototype.boxShapeNew; -CSSProperties.prototype.boxShapeNew2; -CSSProperties.prototype.circleShapeGetOffset; -CSSProperties.prototype.circleShapeGetRadius; -CSSProperties.prototype.circleShapeNew; -CSSProperties.prototype.constraintActivateBodies; -CSSProperties.prototype.constraintDestroy; -CSSProperties.prototype.constraintFree; -CSSProperties.prototype.constraintGetA; -CSSProperties.prototype.constraintGetB; -CSSProperties.prototype.constraintGetErrorBias; -CSSProperties.prototype.constraintGetImpulse; -CSSProperties.prototype.constraintGetMaxBias; -CSSProperties.prototype.constraintGetMaxForce; -CSSProperties.prototype.constraintGetSpace; -CSSProperties.prototype.constraintSetErrorBias; -CSSProperties.prototype.constraintSetMaxBias; -CSSProperties.prototype.constraintSetMaxForce; -CSSProperties.prototype.dampedRotarySpringGetDamping; -CSSProperties.prototype.dampedRotarySpringGetRestAngle; -CSSProperties.prototype.dampedRotarySpringGetStiffness; -CSSProperties.prototype.dampedRotarySpringNew; -CSSProperties.prototype.dampedRotarySpringSetDamping; -CSSProperties.prototype.dampedRotarySpringSetRestAngle; -CSSProperties.prototype.dampedRotarySpringSetStiffness; -CSSProperties.prototype.dampedSpringGetAnchr1; -CSSProperties.prototype.dampedSpringGetAnchr2; -CSSProperties.prototype.dampedSpringGetDamping; -CSSProperties.prototype.dampedSpringGetRestLength; -CSSProperties.prototype.dampedSpringGetStiffness; -CSSProperties.prototype.dampedSpringNew; -CSSProperties.prototype.dampedSpringSetAnchr1; -CSSProperties.prototype.dampedSpringSetAnchr2; -CSSProperties.prototype.dampedSpringSetDamping; -CSSProperties.prototype.dampedSpringSetRestLength; -CSSProperties.prototype.dampedSpringSetStiffness; -CSSProperties.prototype.gearJointGetPhase; -CSSProperties.prototype.gearJointGetRatio; -CSSProperties.prototype.gearJointNew; -CSSProperties.prototype.gearJointSetPhase; -CSSProperties.prototype.gearJointSetRatio; -CSSProperties.prototype.grooveJointGetAnchr2; -CSSProperties.prototype.grooveJointGetGrooveA; -CSSProperties.prototype.grooveJointGetGrooveB; -CSSProperties.prototype.grooveJointNew; -CSSProperties.prototype.grooveJointSetAnchr2; -CSSProperties.prototype.grooveJointSetGrooveA; -CSSProperties.prototype.grooveJointSetGrooveB; -CSSProperties.prototype.initChipmunk; -CSSProperties.prototype.momentForBox; -CSSProperties.prototype.momentForBox2; -CSSProperties.prototype.momentForCircle; -CSSProperties.prototype.momentForSegment; -CSSProperties.prototype.pinJointGetAnchr1; -CSSProperties.prototype.pinJointGetAnchr2; -CSSProperties.prototype.pinJointGetDist; -CSSProperties.prototype.pinJointNew; -CSSProperties.prototype.pinJointSetAnchr1; -CSSProperties.prototype.pinJointSetAnchr2; -CSSProperties.prototype.pinJointSetDist; -CSSProperties.prototype.pivotJointGetAnchr1; -CSSProperties.prototype.pivotJointGetAnchr2; -CSSProperties.prototype.pivotJointNew; -CSSProperties.prototype.pivotJointNew2; -CSSProperties.prototype.pivotJointSetAnchr1; -CSSProperties.prototype.pivotJointSetAnchr2; -CSSProperties.prototype.polyShapeGetNumVerts; -CSSProperties.prototype.polyShapeGetVert; -CSSProperties.prototype.ratchetJointGetAngle; -CSSProperties.prototype.ratchetJointGetPhase; -CSSProperties.prototype.ratchetJointGetRatchet; -CSSProperties.prototype.ratchetJointNew; -CSSProperties.prototype.ratchetJointSetAngle; -CSSProperties.prototype.ratchetJointSetPhase; -CSSProperties.prototype.ratchetJointSetRatchet; -CSSProperties.prototype.resetShapeIdCounter; -CSSProperties.prototype.rotaryLimitJointGetMax; -CSSProperties.prototype.rotaryLimitJointGetMin; -CSSProperties.prototype.rotaryLimitJointNew; -CSSProperties.prototype.rotaryLimitJointSetMax; -CSSProperties.prototype.rotaryLimitJointSetMin; -CSSProperties.prototype.segmentShapeGetA; -CSSProperties.prototype.segmentShapeGetB; -CSSProperties.prototype.segmentShapeGetNormal; -CSSProperties.prototype.segmentShapeGetRadius; -CSSProperties.prototype.segmentShapeNew; -CSSProperties.prototype.segmentShapeSetNeighbors; -CSSProperties.prototype.shapeCacheBB; -CSSProperties.prototype.shapeDestroy; -CSSProperties.prototype.shapeFree; -CSSProperties.prototype.shapeGetBB; -CSSProperties.prototype.shapeGetBody; -CSSProperties.prototype.shapeGetCollisionType; -CSSProperties.prototype.shapeGetElasticity; -CSSProperties.prototype.shapeGetFriction; -CSSProperties.prototype.shapeGetGroup; -CSSProperties.prototype.shapeGetLayers; -CSSProperties.prototype.shapeGetSensor; -CSSProperties.prototype.shapeGetSurfaceVelocity; -CSSProperties.prototype.shapePointQuery; -CSSProperties.prototype.shapeSetBody; -CSSProperties.prototype.shapeSetCollisionType; -CSSProperties.prototype.shapeSetElasticity; -CSSProperties.prototype.shapeSetFriction; -CSSProperties.prototype.shapeSetGroup; -CSSProperties.prototype.shapeSetLayers; -CSSProperties.prototype.shapeSetSensor; -CSSProperties.prototype.shapeSetSurfaceVelocity; -CSSProperties.prototype.shapeUpdate; -CSSProperties.prototype.simpleMotorGetRate; -CSSProperties.prototype.simpleMotorNew; -CSSProperties.prototype.simpleMotorSetRate; -CSSProperties.prototype.slideJointGetAnchr1; -CSSProperties.prototype.slideJointGetAnchr2; -CSSProperties.prototype.slideJointGetMax; -CSSProperties.prototype.slideJointGetMin; -CSSProperties.prototype.slideJointNew; -CSSProperties.prototype.slideJointSetAnchr1; -CSSProperties.prototype.slideJointSetAnchr2; -CSSProperties.prototype.slideJointSetMax; -CSSProperties.prototype.slideJointSetMin; -CSSProperties.prototype.spaceActivateShapesTouchingShape; -CSSProperties.prototype.spaceAddBody; -CSSProperties.prototype.spaceAddConstraint; -CSSProperties.prototype.spaceAddShape; -CSSProperties.prototype.spaceAddStaticShape; -CSSProperties.prototype.spaceContainsBody; -CSSProperties.prototype.spaceContainsConstraint; -CSSProperties.prototype.spaceContainsShape; -CSSProperties.prototype.spaceDestroy; -CSSProperties.prototype.spaceFree; -CSSProperties.prototype.spaceGetCollisionBias; -CSSProperties.prototype.spaceGetCollisionPersistence; -CSSProperties.prototype.spaceGetCollisionSlop; -CSSProperties.prototype.spaceGetCurrentTimeStep; -CSSProperties.prototype.spaceGetDamping; -CSSProperties.prototype.spaceGetEnableContactGraph; -CSSProperties.prototype.spaceGetGravity; -CSSProperties.prototype.spaceGetIdleSpeedThreshold; -CSSProperties.prototype.spaceGetIterations; -CSSProperties.prototype.spaceGetSleepTimeThreshold; -CSSProperties.prototype.spaceGetStaticBody; -CSSProperties.prototype.spaceInit; -CSSProperties.prototype.spaceIsLocked; -CSSProperties.prototype.spaceNew; -CSSProperties.prototype.spacePointQueryFirst; -CSSProperties.prototype.spaceReindexShape; -CSSProperties.prototype.spaceReindexShapesForBody; -CSSProperties.prototype.spaceReindexStatic; -CSSProperties.prototype.spaceRemoveBody; -CSSProperties.prototype.spaceRemoveConstraint; -CSSProperties.prototype.spaceRemoveShape; -CSSProperties.prototype.spaceRemoveStaticShape; -CSSProperties.prototype.spaceSetCollisionBias; -CSSProperties.prototype.spaceSetCollisionPersistence; -CSSProperties.prototype.spaceSetCollisionSlop; -CSSProperties.prototype.spaceSetDamping; -CSSProperties.prototype.spaceSetEnableContactGraph; -CSSProperties.prototype.spaceSetGravity; -CSSProperties.prototype.spaceSetIdleSpeedThreshold; -CSSProperties.prototype.spaceSetIterations; -CSSProperties.prototype.spaceSetSleepTimeThreshold; -CSSProperties.prototype.spaceStep; -CSSProperties.prototype.spaceUseSpatialHash; -CSSProperties.prototype.fabs; -CSSProperties.prototype.fclamp; -CSSProperties.prototype.fclamp01; -CSSProperties.prototype.flerp; -CSSProperties.prototype.shapeGetSpace; -CSSProperties.prototype.flerpconst; -CSSProperties.prototype.fmax; -CSSProperties.prototype.fmin; -CSSProperties.prototype.vadd; -CSSProperties.prototype.vclamp; -CSSProperties.prototype.vcross; -CSSProperties.prototype.vdist; -CSSProperties.prototype.vdistsq; -CSSProperties.prototype.vdot; -CSSProperties.prototype.veql; -CSSProperties.prototype.vforangle; -CSSProperties.prototype.vlength; -CSSProperties.prototype.vlengthsq; -CSSProperties.prototype.vlerp; -CSSProperties.prototype.vlerpconst; -CSSProperties.prototype.vmult; -CSSProperties.prototype.vnear; -CSSProperties.prototype.vneg; -CSSProperties.prototype.vnormalize; -CSSProperties.prototype.vnormalize_safe; -CSSProperties.prototype.vperp; -CSSProperties.prototype.vproject; -CSSProperties.prototype.vrotate; -CSSProperties.prototype.vrperp; -CSSProperties.prototype.vslerp; -CSSProperties.prototype.vslerpconst; -CSSProperties.prototype.vsub; -CSSProperties.prototype.vtoangle; -CSSProperties.prototype.vunrotate; \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id b/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id deleted file mode 100644 index deca174a3f..0000000000 --- a/cocos/scripting/javascript/bindings/obfuscate/obfuscate_exclude_cocos2d.js.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d62414960a7cab961eb6e4aebefe7d21828bd8e5 \ No newline at end of file diff --git a/cocos/scripting/javascript/bindings/spidermonkey_specifics.h b/cocos/scripting/javascript/bindings/spidermonkey_specifics.h index 6cb006b358..be9c709c49 100644 --- a/cocos/scripting/javascript/bindings/spidermonkey_specifics.h +++ b/cocos/scripting/javascript/bindings/spidermonkey_specifics.h @@ -2,7 +2,7 @@ #define __SPIDERMONKEY_SPECIFICS_H__ #include "jsapi.h" -#include "support/data_support/uthash.h" +#include "uthash.h" typedef struct js_proxy { void *ptr; diff --git a/cocos/scripting/lua/proj.linux/.cproject b/cocos/scripting/lua/bindings/.cproject similarity index 100% rename from cocos/scripting/lua/proj.linux/.cproject rename to cocos/scripting/lua/bindings/.cproject diff --git a/cocos/scripting/lua/proj.linux/.project b/cocos/scripting/lua/bindings/.project similarity index 100% rename from cocos/scripting/lua/proj.linux/.project rename to cocos/scripting/lua/bindings/.project diff --git a/cocos/scripting/lua/proj.android/Android.mk b/cocos/scripting/lua/bindings/Android.mk similarity index 100% rename from cocos/scripting/lua/proj.android/Android.mk rename to cocos/scripting/lua/bindings/Android.mk diff --git a/cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp b/cocos/scripting/lua/bindings/CCBProxy.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCBProxy.cpp rename to cocos/scripting/lua/bindings/CCBProxy.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCBProxy.h b/cocos/scripting/lua/bindings/CCBProxy.h similarity index 91% rename from cocos/scripting/lua/cocos2dx_support/CCBProxy.h rename to cocos/scripting/lua/bindings/CCBProxy.h index 9759e87f1f..082bf09db1 100644 --- a/cocos/scripting/lua/cocos2dx_support/CCBProxy.h +++ b/cocos/scripting/lua/bindings/CCBProxy.h @@ -5,9 +5,12 @@ #include "CCLuaEngine.h" #include "SimpleAudioEngine.h" #include "cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; + class CCBProxy : public Layer{ public: diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp b/cocos/scripting/lua/bindings/CCLuaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaBridge.cpp rename to cocos/scripting/lua/bindings/CCLuaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h b/cocos/scripting/lua/bindings/CCLuaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaBridge.h rename to cocos/scripting/lua/bindings/CCLuaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/cocos/scripting/lua/bindings/CCLuaEngine.cpp similarity index 99% rename from cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp rename to cocos/scripting/lua/bindings/CCLuaEngine.cpp index 21ded3f9b9..558b68acb1 100644 --- a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/cocos/scripting/lua/bindings/CCLuaEngine.cpp @@ -24,10 +24,10 @@ #include "CCLuaEngine.h" #include "cocos2d.h" -#include "cocoa/CCArray.h" +#include "CCArray.h" #include "CCScheduler.h" #include "LuaScriptHandlerMgr.h" -#include "GUI/CCControlExtension/CCControl.h" +#include "extensions/GUI/CCControlExtension/CCControl.h" #include "LuaOpengl.h" #include "lua_cocos2dx_extension_manual.h" diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h b/cocos/scripting/lua/bindings/CCLuaEngine.h similarity index 97% rename from cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h rename to cocos/scripting/lua/bindings/CCLuaEngine.h index 7df7f1fe02..0a1442aaaa 100644 --- a/cocos/scripting/lua/cocos2dx_support/CCLuaEngine.h +++ b/cocos/scripting/lua/bindings/CCLuaEngine.h @@ -30,11 +30,11 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" -#include "event_dispatcher/CCTouch.h" -#include "cocoa/CCSet.h" -#include "base_nodes/CCNode.h" -#include "script_support/CCScriptSupport.h" +#include "CCObject.h" +#include "CCTouch.h" +#include "CCSet.h" +#include "CCNode.h" +#include "CCScriptSupport.h" #include "CCLuaStack.h" #include "CCLuaValue.h" diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp b/cocos/scripting/lua/bindings/CCLuaStack.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaStack.cpp rename to cocos/scripting/lua/bindings/CCLuaStack.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaStack.h b/cocos/scripting/lua/bindings/CCLuaStack.h similarity index 99% rename from cocos/scripting/lua/cocos2dx_support/CCLuaStack.h rename to cocos/scripting/lua/bindings/CCLuaStack.h index e6bb7077c9..dc066ac745 100644 --- a/cocos/scripting/lua/cocos2dx_support/CCLuaStack.h +++ b/cocos/scripting/lua/bindings/CCLuaStack.h @@ -30,7 +30,7 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "CCLuaValue.h" NS_CC_BEGIN diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp b/cocos/scripting/lua/bindings/CCLuaValue.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/CCLuaValue.cpp rename to cocos/scripting/lua/bindings/CCLuaValue.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/CCLuaValue.h b/cocos/scripting/lua/bindings/CCLuaValue.h similarity index 99% rename from cocos/scripting/lua/cocos2dx_support/CCLuaValue.h rename to cocos/scripting/lua/bindings/CCLuaValue.h index b25a498519..08cdc2544f 100644 --- a/cocos/scripting/lua/cocos2dx_support/CCLuaValue.h +++ b/cocos/scripting/lua/bindings/CCLuaValue.h @@ -34,7 +34,7 @@ extern "C" { } #include "ccTypes.h" -#include "cocoa/CCObject.h" +#include "CCObject.h" #if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY using std::memset; diff --git a/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp rename to cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h b/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.h rename to cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h diff --git a/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp b/cocos/scripting/lua/bindings/LuaBasicConversions.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.cpp rename to cocos/scripting/lua/bindings/LuaBasicConversions.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h b/cocos/scripting/lua/bindings/LuaBasicConversions.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaBasicConversions.h rename to cocos/scripting/lua/bindings/LuaBasicConversions.h diff --git a/cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaOpengl.cpp.REMOVED.git-id rename to cocos/scripting/lua/bindings/LuaOpengl.cpp.REMOVED.git-id diff --git a/cocos/scripting/lua/cocos2dx_support/LuaOpengl.h b/cocos/scripting/lua/bindings/LuaOpengl.h similarity index 92% rename from cocos/scripting/lua/cocos2dx_support/LuaOpengl.h rename to cocos/scripting/lua/bindings/LuaOpengl.h index c72e000e83..d0e755a3a8 100644 --- a/cocos/scripting/lua/cocos2dx_support/LuaOpengl.h +++ b/cocos/scripting/lua/bindings/LuaOpengl.h @@ -9,7 +9,8 @@ extern "C" { } #endif -#include "base_nodes/CCNode.h" +#include "CCNode.h" + class GLNode:public cocos2d::Node { virtual void draw(); diff --git a/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp rename to cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h similarity index 98% rename from cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h rename to cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h index efc1110c45..44ea6fa103 100644 --- a/cocos/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.h +++ b/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h @@ -7,9 +7,9 @@ extern "C" { } -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "ccMacros.h" -#include "actions/CCActionInstant.h" +#include "CCActionInstant.h" #include #include diff --git a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp b/cocos/scripting/lua/bindings/Lua_web_socket.cpp similarity index 99% rename from cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp rename to cocos/scripting/lua/bindings/Lua_web_socket.cpp index 27cb3ede7b..736c081344 100644 --- a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.cpp +++ b/cocos/scripting/lua/bindings/Lua_web_socket.cpp @@ -19,7 +19,6 @@ extern "C" { #include "LuaScriptHandlerMgr.h" using namespace cocos2d; -using namespace cocos2d::extension; static int SendBinaryMessageToLua(int nHandler,const unsigned char* pTable,int nLength) diff --git a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h b/cocos/scripting/lua/bindings/Lua_web_socket.h similarity index 89% rename from cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h rename to cocos/scripting/lua/bindings/Lua_web_socket.h index b51b84b1da..3754262deb 100644 --- a/cocos/scripting/lua/cocos2dx_support/Lua_web_socket.h +++ b/cocos/scripting/lua/bindings/Lua_web_socket.h @@ -12,7 +12,7 @@ extern "C" { #endif #include "network/WebSocket.h" -class LuaWebSocket: public cocos2d::extension::WebSocket,public cocos2d::extension::WebSocket::Delegate +class LuaWebSocket: public network::WebSocket,public network::WebSocket::Delegate { public: virtual ~LuaWebSocket(); diff --git a/cocos/scripting/lua/proj.linux/Makefile b/cocos/scripting/lua/bindings/Makefile similarity index 100% rename from cocos/scripting/lua/proj.linux/Makefile rename to cocos/scripting/lua/bindings/Makefile diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj b/cocos/scripting/lua/bindings/liblua.vcxproj similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj rename to cocos/scripting/lua/bindings/liblua.vcxproj diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj.filters b/cocos/scripting/lua/bindings/liblua.vcxproj.filters similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj.filters rename to cocos/scripting/lua/bindings/liblua.vcxproj.filters diff --git a/cocos/scripting/lua/proj.win32/liblua.vcxproj.user b/cocos/scripting/lua/bindings/liblua.vcxproj.user similarity index 100% rename from cocos/scripting/lua/proj.win32/liblua.vcxproj.user rename to cocos/scripting/lua/bindings/liblua.vcxproj.user diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.cpp.REMOVED.git-id rename to cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_deprecated.h rename to cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp similarity index 99% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp index 0df1b74a13..0e4582b126 100644 --- a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp @@ -13,9 +13,11 @@ extern "C" { #include "CCLuaValue.h" #include "cocos-ext.h" #include "CCBProxy.h" +#include "cocostudio/CocoStudio.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace cocostudio; class LuaScrollViewDelegate:public Object, public ScrollViewDelegate { @@ -1334,14 +1336,14 @@ static int lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData(lua_State* L) return 0; int argc = 0; - armature::Bone* self = nullptr; + cocostudio::Bone* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(L,1,0)); + self = static_cast(tolua_tousertype(L,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { @@ -1379,14 +1381,14 @@ static int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L) return 0; int argc = 0; - armature::Bone* self = nullptr; + cocostudio::Bone* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"Bone",0,&tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(L,1,0)); + self = static_cast(tolua_tousertype(L,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_extension_manual.h rename to cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.cpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp b/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/lua_cocos2dx_manual.hpp rename to cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.cpp rename to cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h b/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/CCLuaJavaBridge.h rename to cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp b/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp rename to cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp diff --git a/cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h b/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h rename to cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h b/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.h rename to cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h diff --git a/cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm b/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/platform/ios/CCLuaObjcBridge.mm rename to cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm diff --git a/cocos/scripting/lua/cocos2dx_support/tolua_fix.c b/cocos/scripting/lua/bindings/tolua_fix.c similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/tolua_fix.c rename to cocos/scripting/lua/bindings/tolua_fix.c diff --git a/cocos/scripting/lua/cocos2dx_support/tolua_fix.h b/cocos/scripting/lua/bindings/tolua_fix.h similarity index 100% rename from cocos/scripting/lua/cocos2dx_support/tolua_fix.h rename to cocos/scripting/lua/bindings/tolua_fix.h diff --git a/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch b/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch deleted file mode 100644 index 175f3ccb23..0000000000 --- a/cocos/scripting/lua/proj.ios/luabindings-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'luabindings' target in the 'luabindings' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/cocos/storage/local-storage/Android.mk b/cocos/storage/local-storage/Android.mk new file mode 100644 index 0000000000..67db9c191b --- /dev/null +++ b/cocos/storage/local-storage/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := localstorage_static + +LOCAL_MODULE_FILENAME := liblocalstorage + +LOCAL_SRC_FILES := LocalStorage.cpp +LocalStorageAndroid.cpp \ + + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d + +LOCAL_CFLAGS += -Wno-psabi +LOCAL_EXPORT_CFLAGS += -Wno-psabi + +include $(BUILD_STATIC_LIBRARY) diff --git a/extensions/Android.mk b/extensions/Android.mk index 8c0b1e2591..8f9bbe4f66 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -6,138 +6,30 @@ LOCAL_MODULE := cocos_extension_static LOCAL_MODULE_FILENAME := libextension LOCAL_SRC_FILES := \ -CCDeprecated-ext.cpp \ -AssetsManager/AssetsManager.cpp \ -CCBReader/CCBAnimationManager.cpp \ -CCBReader/CCBFileLoader.cpp \ -CCBReader/CCBKeyframe.cpp \ -CCBReader/CCBReader.cpp \ -CCBReader/CCBSequence.cpp \ -CCBReader/CCBSequenceProperty.cpp \ -CCBReader/CCBValue.cpp \ -CCBReader/CCControlButtonLoader.cpp \ -CCBReader/CCControlLoader.cpp \ -CCBReader/CCLabelBMFontLoader.cpp \ -CCBReader/CCLabelTTFLoader.cpp \ -CCBReader/CCLayerColorLoader.cpp \ -CCBReader/CCLayerGradientLoader.cpp \ -CCBReader/CCLayerLoader.cpp \ -CCBReader/CCMenuItemImageLoader.cpp \ -CCBReader/CCMenuItemLoader.cpp \ -CCBReader/CCNode+CCBRelativePositioning.cpp \ -CCBReader/CCNodeLoader.cpp \ -CCBReader/CCNodeLoaderLibrary.cpp \ -CCBReader/CCParticleSystemQuadLoader.cpp \ -CCBReader/CCScale9SpriteLoader.cpp \ -CCBReader/CCScrollViewLoader.cpp \ -CCBReader/CCSpriteLoader.cpp \ -CocoStudio/Action/CCActionFrame.cpp \ -CocoStudio/Action/CCActionFrameEasing.cpp \ -CocoStudio/Action/CCActionManagerEx.cpp \ -CocoStudio/Action/CCActionNode.cpp \ -CocoStudio/Action/CCActionObject.cpp \ -CocoStudio/Armature/CCArmature.cpp \ -CocoStudio/Armature/CCBone.cpp \ -CocoStudio/Armature/animation/CCArmatureAnimation.cpp \ -CocoStudio/Armature/animation/CCProcessBase.cpp \ -CocoStudio/Armature/animation/CCTween.cpp \ -CocoStudio/Armature/datas/CCDatas.cpp \ -CocoStudio/Armature/display/CCBatchNode.cpp \ -CocoStudio/Armature/display/CCDecorativeDisplay.cpp \ -CocoStudio/Armature/display/CCDisplayFactory.cpp \ -CocoStudio/Armature/display/CCDisplayManager.cpp \ -CocoStudio/Armature/display/CCSkin.cpp \ -CocoStudio/Armature/physics/CCColliderDetector.cpp \ -CocoStudio/Armature/utils/CCArmatureDataManager.cpp \ -CocoStudio/Armature/utils/CCArmatureDefine.cpp \ -CocoStudio/Armature/utils/CCDataReaderHelper.cpp \ -CocoStudio/Armature/utils/CCSpriteFrameCacheHelper.cpp \ -CocoStudio/Armature/utils/CCTransformHelp.cpp \ -CocoStudio/Armature/utils/CCTweenFunction.cpp \ -CocoStudio/Armature/utils/CCUtilMath.cpp \ -CocoStudio/Components/CCComAttribute.cpp \ -CocoStudio/Components/CCComAudio.cpp \ -CocoStudio/Components/CCComController.cpp \ -CocoStudio/Components/CCComRender.cpp \ -CocoStudio/Components/CCInputDelegate.cpp \ -CocoStudio/GUI/BaseClasses/UIRootWidget.cpp \ -CocoStudio/GUI/BaseClasses/UIWidget.cpp \ -CocoStudio/GUI/Layouts/Layout.cpp \ -CocoStudio/GUI/Layouts/LayoutParameter.cpp \ -CocoStudio/GUI/Layouts/UILayoutDefine.cpp \ -CocoStudio/GUI/System/CocosGUI.cpp \ -CocoStudio/GUI/System/UIHelper.cpp \ -CocoStudio/GUI/System/UIInputManager.cpp \ -CocoStudio/GUI/System/UILayer.cpp \ -CocoStudio/GUI/UIWidgets/UIButton.cpp \ -CocoStudio/GUI/UIWidgets/UICheckBox.cpp \ -CocoStudio/GUI/UIWidgets/UIImageView.cpp \ -CocoStudio/GUI/UIWidgets/UILabel.cpp \ -CocoStudio/GUI/UIWidgets/UILabelAtlas.cpp \ -CocoStudio/GUI/UIWidgets/UILabelBMFont.cpp \ -CocoStudio/GUI/UIWidgets/UILoadingBar.cpp \ -CocoStudio/GUI/UIWidgets/UISlider.cpp \ -CocoStudio/GUI/UIWidgets/UITextField.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIDragPanel.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIListView.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIPageView.cpp \ -CocoStudio/GUI/UIWidgets/ScrollWidget/UIScrollView.cpp \ -CocoStudio/Json/CSContentJsonDictionary.cpp \ -CocoStudio/Json/DictionaryHelper.cpp \ -CocoStudio/Json/lib_json/json_reader.cpp \ -CocoStudio/Json/lib_json/json_value.cpp \ -CocoStudio/Json/lib_json/json_writer.cpp \ -CocoStudio/Reader/CCSGUIReader.cpp \ -CocoStudio/Reader/CCSSceneReader.cpp \ -GUI/CCControlExtension/CCControl.cpp \ -GUI/CCControlExtension/CCControlButton.cpp \ -GUI/CCControlExtension/CCControlColourPicker.cpp \ -GUI/CCControlExtension/CCControlHuePicker.cpp \ -GUI/CCControlExtension/CCControlPotentiometer.cpp \ -GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ -GUI/CCControlExtension/CCControlSlider.cpp \ -GUI/CCControlExtension/CCControlStepper.cpp \ -GUI/CCControlExtension/CCControlSwitch.cpp \ -GUI/CCControlExtension/CCControlUtils.cpp \ -GUI/CCControlExtension/CCInvocation.cpp \ -GUI/CCControlExtension/CCScale9Sprite.cpp \ -GUI/CCEditBox/CCEditBox.cpp \ -GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ -GUI/CCEditBox/CCEditBoxImplNone.cpp \ -GUI/CCEditBox/CCEditBoxImplTizen.cpp \ -GUI/CCEditBox/CCEditBoxImplWin.cpp \ -GUI/CCScrollView/CCScrollView.cpp \ -GUI/CCScrollView/CCSorting.cpp \ -GUI/CCScrollView/CCTableView.cpp \ -GUI/CCScrollView/CCTableViewCell.cpp \ -LocalStorage/LocalStorage.cpp \ -LocalStorage/LocalStorageAndroid.cpp \ -network/HttpClient.cpp \ -network/SocketIO.cpp \ -network/WebSocket.cpp \ -physics_nodes/CCPhysicsDebugNode.cpp \ -physics_nodes/CCPhysicsSprite.cpp \ -spine/Animation.cpp \ -spine/AnimationState.cpp \ -spine/AnimationStateData.cpp \ -spine/Atlas.cpp \ -spine/AtlasAttachmentLoader.cpp \ -spine/Attachment.cpp \ -spine/AttachmentLoader.cpp \ -spine/Bone.cpp \ -spine/BoneData.cpp \ -spine/CCSkeleton.cpp \ -spine/CCSkeletonAnimation.cpp \ -spine/extension.cpp \ -spine/Json.cpp \ -spine/RegionAttachment.cpp \ -spine/Skeleton.cpp \ -spine/SkeletonData.cpp \ -spine/SkeletonJson.cpp \ -spine/Skin.cpp \ -spine/Slot.cpp \ -spine/SlotData.cpp \ -spine/spine-cocos2dx.cpp +$(LOCAL_PATH)/assets-manager/AssetsManager.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControl.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlButton.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlColourPicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlHuePicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlPotentiometer.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSlider.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlStepper.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlSwitch.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCControlUtils.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCInvocation.cpp \ +$(LOCAL_PATH)/GUI/CCControlExtension/CCScale9Sprite.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBox.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplNone.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplTizen.cpp \ +$(LOCAL_PATH)/GUI/CCEditBox/CCEditBoxImplWin.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCScrollView.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCSorting.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCTableView.cpp \ +$(LOCAL_PATH)/GUI/CCScrollView/CCTableViewCell.cpp \ +$(LOCAL_PATH)/physics-nodes/CCPhysicsDebugNode.cpp \ +$(LOCAL_PATH)/physics-nodes/CCPhysicsSprite.cpp LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static @@ -151,18 +43,16 @@ LOCAL_CXXFLAGS += -fexceptions LOCAL_CFLAGS += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 LOCAL_EXPORT_CFLAGS += -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/CCBReader \ +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/GUI/CCControlExtension \ - $(LOCAL_PATH)/GUI/CCScrollView \ - $(LOCAL_PATH)/network \ - $(LOCAL_PATH)/LocalStorage + $(LOCAL_PATH)/GUI/CCScrollView include $(BUILD_STATIC_LIBRARY) -$(call import-module,cocos2dx) +$(call import-module,2d) $(call import-module,audio/android) -$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) -$(call import-module,external/Box2D) -$(call import-module,external/chipmunk) -$(call import-module,external/libwebsockets/android) +$(call import-module,Box2D) +$(call import-module,chipmunk) +$(call import-module,websockets/prebuilt/android) diff --git a/extensions/CCDeprecated-ext.h b/extensions/CCDeprecated-ext.h deleted file mode 100644 index 5aded2b4f4..0000000000 --- a/extensions/CCDeprecated-ext.h +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013 cocos2d-x.org - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -/** Add deprecated global functions and variables here - */ - -#ifndef COCOS2D_CCDEPRECATED_EXT_H__ -#define COCOS2D_CCDEPRECATED_EXT_H__ - -NS_CC_EXT_BEGIN - -CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; -CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; -CC_DEPRECATED_ATTRIBUTE typedef TableViewDelegate CCTableViewDelegate; -CC_DEPRECATED_ATTRIBUTE typedef TableViewDataSource CCTableViewDataSource; -CC_DEPRECATED_ATTRIBUTE typedef TableView CCTableView; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; -CC_DEPRECATED_ATTRIBUTE typedef ScrollViewDelegate CCScrollViewDelegate; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView CCScrollView; -CC_DEPRECATED_ATTRIBUTE typedef SortableObject CCSortableObject; -CC_DEPRECATED_ATTRIBUTE typedef ArrayForObjectSorting CCArrayForObjectSorting; -CC_DEPRECATED_ATTRIBUTE typedef TableViewCell CCTableViewCell; -CC_DEPRECATED_ATTRIBUTE typedef EditBox CCEditBox; -CC_DEPRECATED_ATTRIBUTE typedef EditBoxDelegate CCEditBoxDelegate; - -CC_DEPRECATED_ATTRIBUTE typedef Color3bObject CCColor3bObject; -CC_DEPRECATED_ATTRIBUTE typedef ControlUtils CCControlUtils; -CC_DEPRECATED_ATTRIBUTE typedef Scale9Sprite CCScale9Sprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlHuePicker CCControlHuePicker; -CC_DEPRECATED_ATTRIBUTE typedef Invocation CCInvocation; -CC_DEPRECATED_ATTRIBUTE typedef ControlSaturationBrightnessPicker CCControlSaturationBrightnessPicker; -CC_DEPRECATED_ATTRIBUTE typedef ControlStepper CCControlStepper; -CC_DEPRECATED_ATTRIBUTE typedef ControlPotentiometer CCControlPotentiometer; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitchSprite CCControlSwitchSprite; -CC_DEPRECATED_ATTRIBUTE typedef ControlSwitch CCControlSwitch; -CC_DEPRECATED_ATTRIBUTE typedef ControlButton CCControlButton; -CC_DEPRECATED_ATTRIBUTE typedef ControlSlider CCControlSlider; -CC_DEPRECATED_ATTRIBUTE typedef Control CCControl; -CC_DEPRECATED_ATTRIBUTE typedef ControlLoader CCControlLoader; -CC_DEPRECATED_ATTRIBUTE typedef ControlColourPicker CCControlColourPicker; - -CC_DEPRECATED_ATTRIBUTE typedef LabelBMFontLoader CCLabelBMFontLoader; -CC_DEPRECATED_ATTRIBUTE typedef ScrollViewLoader CCScrollViewLoader; -CC_DEPRECATED_ATTRIBUTE typedef SpriteLoader CCSpriteLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoader CCNodeLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderListener CCNodeLoaderListener; -CC_DEPRECATED_ATTRIBUTE typedef LayerLoader CCLayerLoader; -CC_DEPRECATED_ATTRIBUTE typedef MenuLoader CCMenuLoader; -CC_DEPRECATED_ATTRIBUTE typedef Color3BWapper CCColor3BWapper; -CC_DEPRECATED_ATTRIBUTE typedef ParticleSystemQuadLoader CCParticleSystemQuadLoader; -CC_DEPRECATED_ATTRIBUTE typedef MenuItemImageLoader CCMenuItemImageLoader; -CC_DEPRECATED_ATTRIBUTE typedef ControlButtonLoader CCControlButtonLoader; -CC_DEPRECATED_ATTRIBUTE typedef LayerGradientLoader CCLayerGradientLoader; -CC_DEPRECATED_ATTRIBUTE typedef Scale9SpriteLoader CCScale9SpriteLoader; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderLibrary CCNodeLoaderLibrary; -CC_DEPRECATED_ATTRIBUTE typedef MenuItemLoader CCMenuItemLoader; -CC_DEPRECATED_ATTRIBUTE typedef LayerColorLoader CCLayerColorLoader; -CC_DEPRECATED_ATTRIBUTE typedef LabelTTFLoader CCLabelTTFLoader; - - -#if CC_ENABLE_BOX2D_INTEGRATION || CC_ENABLE_CHIPMUNK_INTEGRATION -CC_DEPRECATED_ATTRIBUTE typedef PhysicsSprite CCPhysicsSprite; -#endif - -#if CC_ENABLE_CHIPMUNK_INTEGRATION -CC_DEPRECATED_ATTRIBUTE typedef PhysicsDebugNode CCPhysicsDebugNode; -#endif - -CC_DEPRECATED_ATTRIBUTE typedef ComController CCComController; -CC_DEPRECATED_ATTRIBUTE typedef ComAttribute CCComAttribute; -CC_DEPRECATED_ATTRIBUTE typedef InputDelegate CCInputDelegate; -CC_DEPRECATED_ATTRIBUTE typedef ComAudio CCComAudio; - -CC_DEPRECATED_ATTRIBUTE typedef HttpClient CCHttpClient; -CC_DEPRECATED_ATTRIBUTE typedef HttpResponse CCHttpResponse; -CC_DEPRECATED_ATTRIBUTE typedef HttpRequest CCHttpRequest; -CC_DEPRECATED_ATTRIBUTE typedef Skin CCSkin; - -CC_DEPRECATED_ATTRIBUTE typedef AtlasFormat CCAtlasFormat; -CC_DEPRECATED_ATTRIBUTE typedef AtlasFilter CCAtlasFilter; -CC_DEPRECATED_ATTRIBUTE typedef AtlasWrap CCAtlasWrap; -CC_DEPRECATED_ATTRIBUTE typedef AtlasPage CCAtlasPage; -CC_DEPRECATED_ATTRIBUTE typedef AtlasRegion CCAtlasRegion; -CC_DEPRECATED_ATTRIBUTE typedef Atlas CCAtlas; -CC_DEPRECATED_ATTRIBUTE typedef AnimationStateData CCAnimationStateData; -CC_DEPRECATED_ATTRIBUTE typedef SlotData CCSlotData; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentLoader CCAttachmentLoader; -CC_DEPRECATED_ATTRIBUTE typedef AnimationState CCAnimationState; -CC_DEPRECATED_ATTRIBUTE typedef SkeletonJson CCSkeletonJson; -CC_DEPRECATED_ATTRIBUTE typedef Timeline CCTimeline; -CC_DEPRECATED_ATTRIBUTE typedef CurveTimeline CCCurveTimeline; -CC_DEPRECATED_ATTRIBUTE typedef RotateTimeline CCRotateTimeline; -CC_DEPRECATED_ATTRIBUTE typedef TranslateTimeline CCTranslateTimeline; -CC_DEPRECATED_ATTRIBUTE typedef ScaleTimeline CCScaleTimeline; -CC_DEPRECATED_ATTRIBUTE typedef ColorTimeline CCColorTimeline; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentTimeline CCAttachmentTimeline; -CC_DEPRECATED_ATTRIBUTE typedef AtlasAttachmentLoader CCAtlasAttachmentLoader; -CC_DEPRECATED_ATTRIBUTE typedef VertexIndex CCVertexIndex; -CC_DEPRECATED_ATTRIBUTE typedef RegionAttachment CCRegionAttachment; - -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMap CCNodeLoaderMap; -CC_DEPRECATED_ATTRIBUTE typedef NodeLoaderMapEntry CCNodeLoaderMapEntry; -CC_DEPRECATED_ATTRIBUTE typedef EventRegistry CCEventRegistry; -CC_DEPRECATED_ATTRIBUTE typedef AttachmentType CCAttachmentType; - - -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionNone = ScrollView::Direction::NONE; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionHorizontal = ScrollView::Direction::HORIZONTAL; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionVertical = ScrollView::Direction::VERTICAL; -CC_DEPRECATED_ATTRIBUTE const ScrollView::Direction kCCScrollViewDirectionBoth = ScrollView::Direction::BOTH; -CC_DEPRECATED_ATTRIBUTE typedef ScrollView::Direction CCScrollViewDirection; - -CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillTopDown = TableView::VerticalFillOrder::TOP_DOWN; -CC_DEPRECATED_ATTRIBUTE const TableView::VerticalFillOrder kCCTableViewFillBottomUp = TableView::VerticalFillOrder::BOTTOM_UP; -CC_DEPRECATED_ATTRIBUTE typedef TableView::VerticalFillOrder CCTableViewVerticalFillOrder; - -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDefault = EditBox::KeyboardReturnType::DEFAULT; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeDone = EditBox::KeyboardReturnType::DONE; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSend = EditBox::KeyboardReturnType::SEND; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeSearch = EditBox::KeyboardReturnType::SEARCH; -CC_DEPRECATED_ATTRIBUTE const EditBox::KeyboardReturnType kKeyboardReturnTypeGo = EditBox::KeyboardReturnType::GO; - -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeAny = EditBox::InputMode::ANY; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeEmailAddr = EditBox::InputMode::EMAIL_ADDRESS; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeNumeric = EditBox::InputMode::NUMERIC; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModePhoneNumber = EditBox::InputMode::PHONE_NUMBER; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeUrl = EditBox::InputMode::URL; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeDecimal = EditBox::InputMode::DECIMAL; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputMode kEditBoxInputModeSingleLine = EditBox::InputMode::SINGLE_LINE; - -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagPassword = EditBox::InputFlag::PASSWORD; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagSensitive = EditBox::InputFlag::SENSITIVE; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsWord = EditBox::InputFlag::INITIAL_CAPS_WORD; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsSentence = EditBox::InputFlag::INITIAL_CAPS_SENTENCE; -CC_DEPRECATED_ATTRIBUTE const EditBox::InputFlag kEditBoxInputFlagInitialCapsAllCharacters = EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS; - -CC_DEPRECATED_ATTRIBUTE typedef EditBox::KeyboardReturnType KeyboardReturnType; -CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputMode EditBoxInputMode; -CC_DEPRECATED_ATTRIBUTE typedef EditBox::InputFlag EditBoxInputFlag; - -CC_DEPRECATED_ATTRIBUTE typedef ControlStepper::Part ControlStepperPart; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartMinus = ControlStepper::Part::MINUS; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartPlus = ControlStepper::Part::PLUS; -CC_DEPRECATED_ATTRIBUTE const ControlStepper::Part kCCControlStepperPartNone = ControlStepper::Part::NONE; - -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDown = Control::EventType::TOUCH_DOWN; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragInside = Control::EventType::DRAG_INSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragOutside = Control::EventType::DRAG_OUTSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragEnter = Control::EventType::DRAG_ENTER; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchDragExit = Control::EventType::DRAG_EXIT; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpInside = Control::EventType::TOUCH_UP_INSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchUpOutside = Control::EventType::TOUCH_UP_OUTSIDE; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventTouchCancel = Control::EventType::TOUCH_CANCEL; -CC_DEPRECATED_ATTRIBUTE const Control::EventType CCControlEventValueChanged = Control::EventType::VALUE_CHANGED; - -CC_DEPRECATED_ATTRIBUTE typedef Control::EventType CCControlEvent; - -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateNormal = Control::State::NORMAL; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateHighlighted = Control::State::HIGH_LIGHTED; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateDisabled = Control::State::DISABLED; -CC_DEPRECATED_ATTRIBUTE const Control::State CCControlStateSelected = Control::State::SELECTED; -CC_DEPRECATED_ATTRIBUTE typedef Control::State CCControlState; - -CC_DEPRECATED_ATTRIBUTE typedef Control::Handler SEL_CCControlHandler; - -// For CCBReader - -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kIntValue = CCBValue::Type::INT; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kFloatValue = CCBValue::Type::FLOAT; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kBoolValue = CCBValue::Type::BOOL; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kUnsignedCharValue = CCBValue::Type::UNSIGNED_CHAR; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kStringValue = CCBValue::Type::STRING; -CC_DEPRECATED_ATTRIBUTE const CCBValue::Type kArrayValue = CCBValue::Type::ARRAY; - - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePosition = CCBReader::PropertyType::POSITION; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeSize = CCBReader::PropertyType::SIZE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePoint = CCBReader::PropertyType::POINT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypePointLock = CCBReader::PropertyType::POINT_LOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeScaleLock = CCBReader::PropertyType::SCALE_LOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeDegrees = CCBReader::PropertyType::DEGREES; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeInteger = CCBReader::PropertyType::INTEGER; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloat = CCBReader::PropertyType::FLOAT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatVar = CCBReader::PropertyType::FLOAT_VAR; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeCheck = CCBReader::PropertyType::CHECK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeSpriteFrame = CCBReader::PropertyType::SPRITEFRAME; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeTexture = CCBReader::PropertyType::TEXTURE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeByte = CCBReader::PropertyType::BYTE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeColor3 = CCBReader::PropertyType::COLOR3; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeColor4FVar = CCBReader::PropertyType::COLOR4F_VAR; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFlip = CCBReader::PropertyType::FLIP; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlendmode = CCBReader::PropertyType::BLEND_MODE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFntFile = CCBReader::PropertyType::FNT_FILE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeText = CCBReader::PropertyType::TEXT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFontTTF = CCBReader::PropertyType::FONT_TTF; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeIntegerLabeled = CCBReader::PropertyType::INTEGER_LABELED; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlock = CCBReader::PropertyType::BLOCK; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeAnimation = CCBReader::PropertyType::ANIMATION; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeCCBFile = CCBReader::PropertyType::CCB_FILE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeString = CCBReader::PropertyType::STRING; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeBlockCCControl = CCBReader::PropertyType::BLOCK_CONTROL; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatScale = CCBReader::PropertyType::FLOAT_SCALE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PropertyType kCCBPropTypeFloatXY = CCBReader::PropertyType::FLOAT_XY; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat0 = CCBReader::FloatType::_0; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat1 = CCBReader::FloatType::_1; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatMinus1 = CCBReader::FloatType::MINUS1; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloat05 = CCBReader::FloatType::_05; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatInteger = CCBReader::FloatType::INTEGER; -CC_DEPRECATED_ATTRIBUTE const CCBReader::FloatType kCCBFloatFull = CCBReader::FloatType::FULL; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformAll = CCBReader::PlatformType::ALL; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformIOS = CCBReader::PlatformType::IOS; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PlatformType kCCBPlatformMac = CCBReader::PlatformType::MAC; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeNone = CCBReader::TargetType::NONE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeDocumentRoot = CCBReader::TargetType::DOCUMENT_ROOT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::TargetType kCCBTargetTypeOwner = CCBReader::TargetType::OWNER; - -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingInstant = CCBKeyframe::EasingType::INSTANT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingLinear = CCBKeyframe::EasingType::LINEAR ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicIn = CCBKeyframe::EasingType::CUBIC_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicOut = CCBKeyframe::EasingType::CUBIC_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingCubicInOut = CCBKeyframe::EasingType::CUBIC_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticIn = CCBKeyframe::EasingType::ELASTIC_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticOut = CCBKeyframe::EasingType::ELASTIC_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingElasticInOut = CCBKeyframe::EasingType::ELASTIC_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceIn = CCBKeyframe::EasingType::BOUNCE_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceOut = CCBKeyframe::EasingType::BOUNCE_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBounceInOut = CCBKeyframe::EasingType::BOUNCE_INOUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackIn = CCBKeyframe::EasingType::BACK_IN ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackOut = CCBKeyframe::EasingType::BACK_OUT ; -CC_DEPRECATED_ATTRIBUTE const CCBKeyframe::EasingType kCCBKeyframeEasingBackInOut = CCBKeyframe::EasingType::BACK_INOUT ; - -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeBottomLeft = CCBReader::PositionType::RELATIVE_BOTTOM_LEFT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeTopLeft = CCBReader::PositionType::RELATIVE_TOP_LEFT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeTopRight = CCBReader::PositionType::RELATIVE_TOP_RIGHT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeRelativeBottomRight = CCBReader::PositionType::RELATIVE_BOTTOM_RIGHT; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypePercent = CCBReader::PositionType::PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::PositionType kCCBPositionTypeMultiplyResolution = CCBReader::PositionType::MULTIPLY_RESOLUTION ; -; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeAbsolute = CCBReader::SizeType::ABSOLUTE ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypePercent = CCBReader::SizeType::PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeRelativeContainer = CCBReader::SizeType::RELATIVE_CONTAINER ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeHorizontalPercent = CCBReader::SizeType::HORIZONTAL_PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeVerticalPercent = CCBReader::SizeType::VERTICAL_PERCENT ; -CC_DEPRECATED_ATTRIBUTE const CCBReader::SizeType kCCBSizeTypeMultiplyResolution = CCBReader::SizeType::MULTIPLY_RESOLUTION; - - -CC_DEPRECATED_ATTRIBUTE const CCBReader::ScaleType kCCBScaleTypeAbsolute = CCBReader::ScaleType::ABSOLUTE; -CC_DEPRECATED_ATTRIBUTE const CCBReader::ScaleType kCCBScaleTypeMultiplyResolution = CCBReader::ScaleType::MULTIPLY_RESOLUTION; - -NS_CC_EXT_END - -#endif // COCOS2D_CCDEPRECATED_EXT_H__ diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index 6ead6baf9d..d12859b703 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -29,11 +29,11 @@ #include "CCControl.h" #include "CCDirector.h" -#include "menu_nodes/CCMenu.h" -#include "event_dispatcher/CCTouch.h" +#include "CCMenu.h" +#include "CCTouch.h" #include "CCInvocation.h" -#include "event_dispatcher/CCEventDispatcher.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCEventDispatcher.h" +#include "CCEventListenerTouch.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 247634a72c..4f889f7066 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -27,10 +27,10 @@ #include "CCControlButton.h" #include "CCScale9Sprite.h" -#include "label_nodes/CCLabelTTF.h" -#include "label_nodes/CCLabelBMFont.h" -#include "actions/CCAction.h" -#include "actions/CCActionInterval.h" +#include "CCLabelTTF.h" +#include "CCLabelBMFont.h" +#include "CCAction.h" +#include "CCActionInterval.h" using namespace std; diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 26d7bbf694..18da7f0abf 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -30,8 +30,8 @@ */ #include "CCControlColourPicker.h" -#include "sprite_nodes/CCSpriteFrameCache.h" -#include "sprite_nodes/CCSpriteBatchNode.h" +#include "CCSpriteFrameCache.h" +#include "CCSpriteBatchNode.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 80840c4482..1ba96962b6 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -28,7 +28,7 @@ */ #include "CCControlSlider.h" -#include "event_dispatcher/CCTouch.h" +#include "CCTouch.h" #include "CCDirector.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.h b/extensions/GUI/CCControlExtension/CCControlUtils.h index 6520cf9a4a..8739883f0c 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.h +++ b/extensions/GUI/CCControlExtension/CCControlUtils.h @@ -34,7 +34,7 @@ #ifndef __CCCONTROL_UTILS_H__ #define __CCCONTROL_UTILS_H__ -#include "sprite_nodes/CCSprite.h" +#include "CCSprite.h" #include "../../ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCInvocation.h b/extensions/GUI/CCControlExtension/CCInvocation.h index 36b64850e2..215f2b1ebd 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.h +++ b/extensions/GUI/CCControlExtension/CCInvocation.h @@ -30,7 +30,7 @@ #ifndef __CCINVOCATION_H__ #define __CCINVOCATION_H__ -#include "cocoa/CCObject.h" +#include "CCObject.h" #include "../../ExtensionMacros.h" #include "CCControl.h" diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h index 8909bf3719..23f375fc53 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ b/extensions/GUI/CCEditBox/CCEditBox.h @@ -27,7 +27,7 @@ #define __CCEDITTEXT_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "../CCControlExtension/CCControlExtensions.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h index f8d000d0da..b01362eff0 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImpl.h @@ -27,7 +27,7 @@ #define __CCEditBoxIMPL_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBox.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h index acb674df2f..5e4c7ebf51 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h @@ -30,7 +30,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h index c8e9376e1c..213a933c78 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h @@ -30,7 +30,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" #import diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h index 069aa13273..481472dba3 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h @@ -33,7 +33,7 @@ #import #import -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" @interface CCCustomNSTextField : NSTextField diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h index 84e1ae11f1..8395ecce71 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h @@ -31,7 +31,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h index 75d29c342e..2b379efe83 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h @@ -30,7 +30,7 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #include "CCEditBoxImpl.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index cb03d57c08..5b002887ee 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -27,7 +27,7 @@ #define __CCSCROLLVIEW_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCSorting.cpp b/extensions/GUI/CCScrollView/CCSorting.cpp index a9c6e522a8..fd9d80f32c 100644 --- a/extensions/GUI/CCScrollView/CCSorting.cpp +++ b/extensions/GUI/CCScrollView/CCSorting.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCSorting.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCSorting.h b/extensions/GUI/CCScrollView/CCSorting.h index 4e41f6e238..7c182b193c 100644 --- a/extensions/GUI/CCScrollView/CCSorting.h +++ b/extensions/GUI/CCScrollView/CCSorting.h @@ -26,8 +26,8 @@ #ifndef __CCSORTING_H__ #define __CCSORTING_H__ -#include "cocoa/CCArray.h" -#include "ExtensionMacros.h" +#include "CCArray.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 55c803ffd9..b7ce17b1c3 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -26,9 +26,9 @@ #include "cocos2d.h" #include "CCTableView.h" #include "CCTableViewCell.h" -#include "menu_nodes/CCMenu.h" +#include "CCMenu.h" #include "CCSorting.h" -#include "layers_scenes_transitions_nodes/CCLayer.h" +#include "CCLayer.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.cpp b/extensions/GUI/CCScrollView/CCTableViewCell.cpp index 3bab98917e..936dccb450 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.cpp +++ b/extensions/GUI/CCScrollView/CCTableViewCell.cpp @@ -24,7 +24,7 @@ ****************************************************************************/ #include "CCTableViewCell.h" -#include "support/data_support/ccCArray.h" +#include "ccCArray.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCScrollView/CCTableViewCell.h b/extensions/GUI/CCScrollView/CCTableViewCell.h index 3d5d6f2139..bef117d3b9 100644 --- a/extensions/GUI/CCScrollView/CCTableViewCell.h +++ b/extensions/GUI/CCScrollView/CCTableViewCell.h @@ -26,7 +26,7 @@ #ifndef __CCTABLEVIEWCELL_H__ #define __CCTABLEVIEWCELL_H__ -#include "base_nodes/CCNode.h" +#include "CCNode.h" #include "CCSorting.h" NS_CC_EXT_BEGIN diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 3dbbc80fdc..31795c4f39 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -38,7 +38,7 @@ #endif -#include "support/zip_support/unzip.h" +#include "unzip.h" using namespace cocos2d; using namespace std; diff --git a/extensions/assets-manager/AssetsManager.h b/extensions/assets-manager/AssetsManager.h index 7c1781b9b9..23e1a27774 100644 --- a/extensions/assets-manager/AssetsManager.h +++ b/extensions/assets-manager/AssetsManager.h @@ -30,7 +30,7 @@ #include #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" NS_CC_EXT_BEGIN diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index de56b38f0e..8c3f242643 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -3,84 +3,18 @@ #include "ExtensionMacros.h" -#include "CCBReader/CCBFileLoader.h" -#include "CCBReader/CCBMemberVariableAssigner.h" -#include "CCBReader/CCBReader.h" -#include "CCBReader/CCBSelectorResolver.h" -#include "CCBReader/CCControlButtonLoader.h" -#include "CCBReader/CCControlLoader.h" -#include "CCBReader/CCLabelBMFontLoader.h" -#include "CCBReader/CCLabelTTFLoader.h" -#include "CCBReader/CCLayerColorLoader.h" -#include "CCBReader/CCLayerGradientLoader.h" -#include "CCBReader/CCLayerLoader.h" -#include "CCBReader/CCMenuItemImageLoader.h" -#include "CCBReader/CCMenuItemLoader.h" -#include "CCBReader/CCMenuLoader.h" -#include "CCBReader/CCNodeLoader.h" -#include "CCBReader/CCNodeLoaderLibrary.h" -#include "CCBReader/CCNodeLoaderListener.h" -#include "CCBReader/CCParticleSystemQuadLoader.h" -#include "CCBReader/CCScale9SpriteLoader.h" -#include "CCBReader/CCScrollViewLoader.h" -#include "CCBReader/CCSpriteLoader.h" -#include "CCBReader/CCBAnimationManager.h" -#include "CCBReader/CCBKeyframe.h" -#include "CCBReader/CCBSequence.h" -#include "CCBReader/CCBSequenceProperty.h" -#include "CCBReader/CCBValue.h" -#include "CCBReader/CCNode+CCBRelativePositioning.h" #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" #include "GUI/CCEditBox/CCEditBox.h" -#include "network/HttpRequest.h" -#include "network/HttpResponse.h" -#include "network/HttpClient.h" -#include "network/WebSocket.h" -#include "network/SocketIO.h" - // Physics integration #if CC_ENABLE_CHIPMUNK_INTEGRATION || CC_ENABLE_BOX2D_INTEGRATION -#include "physics_nodes/CCPhysicsDebugNode.h" -#include "physics_nodes/CCPhysicsSprite.h" +#include "physics-nodes/CCPhysicsDebugNode.h" +#include "physics-nodes/CCPhysicsSprite.h" #endif -#include "spine/spine-cocos2dx.h" - -#include "CocoStudio/Armature/CCArmature.h" -#include "CocoStudio/Armature/CCBone.h" -#include "CocoStudio/Armature/animation/CCArmatureAnimation.h" -#include "CocoStudio/Armature/datas/CCDatas.h" -#include "CocoStudio/Armature/display/CCBatchNode.h" -#include "CocoStudio/Armature/display/CCDecorativeDisplay.h" -#include "CocoStudio/Armature/display/CCDisplayManager.h" -#include "CocoStudio/Armature/display/CCSkin.h" -#include "CocoStudio/Armature/physics/CCColliderDetector.h" -#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" -#include "CocoStudio/Armature/utils/CCDataReaderHelper.h" -#include "CocoStudio/Armature/utils/CCTweenFunction.h" -#include "CocoStudio/Armature/utils/CCArmatureDataManager.h" - -#include "CocoStudio/Components/CCComAttribute.h" -#include "CocoStudio/Components/CCComAudio.h" -#include "CocoStudio/Components/CCComController.h" -#include "CocoStudio/Components/CCComRender.h" - -#include "CocoStudio/GUI/System/CocosGUI.h" - -#include "CocoStudio/Json/CSContentJsonDictionary.h" -#include "CocoStudio/Json/DictionaryHelper.h" - -#include "CocoStudio/Reader/CCSSceneReader.h" -#include "CocoStudio/Reader/CCSGUIReader.h" - -#include "CocoStudio/Action/CCActionManagerEx.h" - -#include "CCDeprecated-ext.h" - -#include "AssetsManager/AssetsManager.h" +#include "assets-manager/AssetsManager.h" #endif /* __COCOS2D_EXT_H__ */ diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index 40c2c7d4ea..357092b62f 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -24,7 +24,7 @@ #if CC_ENABLE_CHIPMUNK_INTEGRATION #include "ccTypes.h" -#include "cocoa/CCGeometry.h" +#include "CCGeometry.h" #include #include diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.h b/extensions/physics-nodes/CCPhysicsDebugNode.h index 9f793c0a4f..fe4d167bff 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.h +++ b/extensions/physics-nodes/CCPhysicsDebugNode.h @@ -24,7 +24,7 @@ #define __PHYSICSNODES_DEBUGNODE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" #if CC_ENABLE_CHIPMUNK_INTEGRATION diff --git a/extensions/physics-nodes/CCPhysicsSprite.h b/extensions/physics-nodes/CCPhysicsSprite.h index c21dd185da..1252af5919 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.h +++ b/extensions/physics-nodes/CCPhysicsSprite.h @@ -23,7 +23,7 @@ #define __PHYSICSNODES_CCPHYSICSSPRITE_H__ #include "cocos2d.h" -#include "ExtensionMacros.h" +#include "extensions/ExtensionMacros.h" struct cpBody; class b2Body; diff --git a/external/Box2D/Android.mk b/external/Box2D/Android.mk index c366750c01..5172a998e7 100644 --- a/external/Box2D/Android.mk +++ b/external/Box2D/Android.mk @@ -7,51 +7,51 @@ LOCAL_MODULE := box2d_static LOCAL_MODULE_FILENAME := libbox2d LOCAL_SRC_FILES := \ -Collision/b2BroadPhase.cpp \ -Collision/b2CollideCircle.cpp \ -Collision/b2CollideEdge.cpp \ -Collision/b2CollidePolygon.cpp \ -Collision/b2Collision.cpp \ -Collision/b2Distance.cpp \ -Collision/b2DynamicTree.cpp \ -Collision/b2TimeOfImpact.cpp \ -Collision/Shapes/b2ChainShape.cpp \ -Collision/Shapes/b2CircleShape.cpp \ -Collision/Shapes/b2EdgeShape.cpp \ -Collision/Shapes/b2PolygonShape.cpp \ -Common/b2BlockAllocator.cpp \ -Common/b2Draw.cpp \ -Common/b2Math.cpp \ -Common/b2Settings.cpp \ -Common/b2StackAllocator.cpp \ -Common/b2Timer.cpp \ -Dynamics/b2Body.cpp \ -Dynamics/b2ContactManager.cpp \ -Dynamics/b2Fixture.cpp \ -Dynamics/b2Island.cpp \ -Dynamics/b2World.cpp \ -Dynamics/b2WorldCallbacks.cpp \ -Dynamics/Contacts/b2ChainAndCircleContact.cpp \ -Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ -Dynamics/Contacts/b2CircleContact.cpp \ -Dynamics/Contacts/b2Contact.cpp \ -Dynamics/Contacts/b2ContactSolver.cpp \ -Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ -Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ -Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ -Dynamics/Contacts/b2PolygonContact.cpp \ -Dynamics/Joints/b2DistanceJoint.cpp \ -Dynamics/Joints/b2FrictionJoint.cpp \ -Dynamics/Joints/b2GearJoint.cpp \ -Dynamics/Joints/b2Joint.cpp \ -Dynamics/Joints/b2MouseJoint.cpp \ -Dynamics/Joints/b2PrismaticJoint.cpp \ -Dynamics/Joints/b2PulleyJoint.cpp \ -Dynamics/Joints/b2RevoluteJoint.cpp \ -Dynamics/Joints/b2RopeJoint.cpp \ -Dynamics/Joints/b2WeldJoint.cpp \ -Dynamics/Joints/b2WheelJoint.cpp \ -Rope/b2Rope.cpp +$(LOCAL_PATH)/Collision/b2BroadPhase.cpp \ +$(LOCAL_PATH)/Collision/b2CollideCircle.cpp \ +$(LOCAL_PATH)/Collision/b2CollideEdge.cpp \ +$(LOCAL_PATH)/Collision/b2CollidePolygon.cpp \ +$(LOCAL_PATH)/Collision/b2Collision.cpp \ +$(LOCAL_PATH)/Collision/b2Distance.cpp \ +$(LOCAL_PATH)/Collision/b2DynamicTree.cpp \ +$(LOCAL_PATH)/Collision/b2TimeOfImpact.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2ChainShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2CircleShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2EdgeShape.cpp \ +$(LOCAL_PATH)/Collision/Shapes/b2PolygonShape.cpp \ +$(LOCAL_PATH)/Common/b2BlockAllocator.cpp \ +$(LOCAL_PATH)/Common/b2Draw.cpp \ +$(LOCAL_PATH)/Common/b2Math.cpp \ +$(LOCAL_PATH)/Common/b2Settings.cpp \ +$(LOCAL_PATH)/Common/b2StackAllocator.cpp \ +$(LOCAL_PATH)/Common/b2Timer.cpp \ +$(LOCAL_PATH)/Dynamics/b2Body.cpp \ +$(LOCAL_PATH)/Dynamics/b2ContactManager.cpp \ +$(LOCAL_PATH)/Dynamics/b2Fixture.cpp \ +$(LOCAL_PATH)/Dynamics/b2Island.cpp \ +$(LOCAL_PATH)/Dynamics/b2World.cpp \ +$(LOCAL_PATH)/Dynamics/b2WorldCallbacks.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ChainAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ChainAndPolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2CircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2Contact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2ContactSolver.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2EdgeAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2PolygonAndCircleContact.cpp \ +$(LOCAL_PATH)/Dynamics/Contacts/b2PolygonContact.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2DistanceJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2FrictionJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2GearJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2Joint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2MouseJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2PrismaticJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2PulleyJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2RevoluteJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2RopeJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2WeldJoint.cpp \ +$(LOCAL_PATH)/Dynamics/Joints/b2WheelJoint.cpp \ +$(LOCAL_PATH)/Rope/b2Rope.cpp LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. diff --git a/external/chipmunk/Android.mk b/external/chipmunk/Android.mk index e8441cd0d7..e8013df8c3 100644 --- a/external/chipmunk/Android.mk +++ b/external/chipmunk/Android.mk @@ -7,35 +7,35 @@ LOCAL_MODULE := chipmunk_static LOCAL_MODULE_FILENAME := libchipmunk LOCAL_SRC_FILES := \ -src/chipmunk.c \ -src/cpArbiter.c \ -src/cpArray.c \ -src/cpBB.c \ -src/cpBBTree.c \ -src/cpBody.c \ -src/cpCollision.c \ -src/cpHashSet.c \ -src/cpPolyShape.c \ -src/cpShape.c \ -src/cpSpace.c \ -src/cpSpaceComponent.c \ -src/cpSpaceHash.c \ -src/cpSpaceQuery.c \ -src/cpSpaceStep.c \ -src/cpSpatialIndex.c \ -src/cpSweep1D.c \ -src/cpVect.c \ -src/constraints/cpConstraint.c \ -src/constraints/cpDampedRotarySpring.c \ -src/constraints/cpDampedSpring.c \ -src/constraints/cpGearJoint.c \ -src/constraints/cpGrooveJoint.c \ -src/constraints/cpPinJoint.c \ -src/constraints/cpPivotJoint.c \ -src/constraints/cpRatchetJoint.c \ -src/constraints/cpRotaryLimitJoint.c \ -src/constraints/cpSimpleMotor.c \ -src/constraints/cpSlideJoint.c +$(LOCAL_PATH)/src/chipmunk.c \ +$(LOCAL_PATH)/src/cpArbiter.c \ +$(LOCAL_PATH)/src/cpArray.c \ +$(LOCAL_PATH)/src/cpBB.c \ +$(LOCAL_PATH)/src/cpBBTree.c \ +$(LOCAL_PATH)/src/cpBody.c \ +$(LOCAL_PATH)/src/cpCollision.c \ +$(LOCAL_PATH)/src/cpHashSet.c \ +$(LOCAL_PATH)/src/cpPolyShape.c \ +$(LOCAL_PATH)/src/cpShape.c \ +$(LOCAL_PATH)/src/cpSpace.c \ +$(LOCAL_PATH)/src/cpSpaceComponent.c \ +$(LOCAL_PATH)/src/cpSpaceHash.c \ +$(LOCAL_PATH)/src/cpSpaceQuery.c \ +$(LOCAL_PATH)/src/cpSpaceStep.c \ +$(LOCAL_PATH)/src/cpSpatialIndex.c \ +$(LOCAL_PATH)/src/cpSweep1D.c \ +$(LOCAL_PATH)/src/cpVect.c \ +$(LOCAL_PATH)/src/constraints/cpConstraint.c \ +$(LOCAL_PATH)/src/constraints/cpDampedRotarySpring.c \ +$(LOCAL_PATH)/src/constraints/cpDampedSpring.c \ +$(LOCAL_PATH)/src/constraints/cpGearJoint.c \ +$(LOCAL_PATH)/src/constraints/cpGrooveJoint.c \ +$(LOCAL_PATH)/src/constraints/cpPinJoint.c \ +$(LOCAL_PATH)/src/constraints/cpPivotJoint.c \ +$(LOCAL_PATH)/src/constraints/cpRatchetJoint.c \ +$(LOCAL_PATH)/src/constraints/cpRotaryLimitJoint.c \ +$(LOCAL_PATH)/src/constraints/cpSimpleMotor.c \ +$(LOCAL_PATH)/src/constraints/cpSlideJoint.c LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk diff --git a/external/curl/include/andorid/curl.h b/external/curl/include/android/curl/curl.h similarity index 100% rename from external/curl/include/andorid/curl.h rename to external/curl/include/android/curl/curl.h diff --git a/external/curl/include/andorid/curlbuild.h b/external/curl/include/android/curl/curlbuild.h similarity index 100% rename from external/curl/include/andorid/curlbuild.h rename to external/curl/include/android/curl/curlbuild.h diff --git a/external/curl/include/andorid/curlrules.h b/external/curl/include/android/curl/curlrules.h similarity index 100% rename from external/curl/include/andorid/curlrules.h rename to external/curl/include/android/curl/curlrules.h diff --git a/external/curl/include/andorid/curlver.h b/external/curl/include/android/curl/curlver.h similarity index 100% rename from external/curl/include/andorid/curlver.h rename to external/curl/include/android/curl/curlver.h diff --git a/external/curl/include/andorid/easy.h b/external/curl/include/android/curl/easy.h similarity index 100% rename from external/curl/include/andorid/easy.h rename to external/curl/include/android/curl/easy.h diff --git a/external/curl/include/andorid/mprintf.h b/external/curl/include/android/curl/mprintf.h similarity index 100% rename from external/curl/include/andorid/mprintf.h rename to external/curl/include/android/curl/mprintf.h diff --git a/external/curl/include/andorid/multi.h b/external/curl/include/android/curl/multi.h similarity index 100% rename from external/curl/include/andorid/multi.h rename to external/curl/include/android/curl/multi.h diff --git a/external/curl/include/andorid/stdcheaders.h b/external/curl/include/android/curl/stdcheaders.h similarity index 100% rename from external/curl/include/andorid/stdcheaders.h rename to external/curl/include/android/curl/stdcheaders.h diff --git a/external/curl/include/andorid/typecheck-gcc.h b/external/curl/include/android/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/andorid/typecheck-gcc.h rename to external/curl/include/android/curl/typecheck-gcc.h diff --git a/external/curl/include/andorid/types.h b/external/curl/include/android/curl/types.h similarity index 100% rename from external/curl/include/andorid/types.h rename to external/curl/include/android/curl/types.h diff --git a/external/curl/include/ios/curl.h b/external/curl/include/ios/curl/curl.h similarity index 100% rename from external/curl/include/ios/curl.h rename to external/curl/include/ios/curl/curl.h diff --git a/external/curl/include/ios/curlbuild.h b/external/curl/include/ios/curl/curlbuild.h similarity index 100% rename from external/curl/include/ios/curlbuild.h rename to external/curl/include/ios/curl/curlbuild.h diff --git a/external/curl/include/ios/curlrules.h b/external/curl/include/ios/curl/curlrules.h similarity index 100% rename from external/curl/include/ios/curlrules.h rename to external/curl/include/ios/curl/curlrules.h diff --git a/external/curl/include/ios/curlver.h b/external/curl/include/ios/curl/curlver.h similarity index 100% rename from external/curl/include/ios/curlver.h rename to external/curl/include/ios/curl/curlver.h diff --git a/external/curl/include/ios/easy.h b/external/curl/include/ios/curl/easy.h similarity index 100% rename from external/curl/include/ios/easy.h rename to external/curl/include/ios/curl/easy.h diff --git a/external/curl/include/ios/mprintf.h b/external/curl/include/ios/curl/mprintf.h similarity index 100% rename from external/curl/include/ios/mprintf.h rename to external/curl/include/ios/curl/mprintf.h diff --git a/external/curl/include/ios/multi.h b/external/curl/include/ios/curl/multi.h similarity index 100% rename from external/curl/include/ios/multi.h rename to external/curl/include/ios/curl/multi.h diff --git a/external/curl/include/ios/stdcheaders.h b/external/curl/include/ios/curl/stdcheaders.h similarity index 100% rename from external/curl/include/ios/stdcheaders.h rename to external/curl/include/ios/curl/stdcheaders.h diff --git a/external/curl/include/ios/typecheck-gcc.h b/external/curl/include/ios/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/ios/typecheck-gcc.h rename to external/curl/include/ios/curl/typecheck-gcc.h diff --git a/external/curl/include/linux/32-bit/curl.h b/external/curl/include/linux/32-bit/curl/curl.h similarity index 100% rename from external/curl/include/linux/32-bit/curl.h rename to external/curl/include/linux/32-bit/curl/curl.h diff --git a/external/curl/include/linux/32-bit/curlbuild.h b/external/curl/include/linux/32-bit/curl/curlbuild.h similarity index 100% rename from external/curl/include/linux/32-bit/curlbuild.h rename to external/curl/include/linux/32-bit/curl/curlbuild.h diff --git a/external/curl/include/linux/32-bit/curlrules.h b/external/curl/include/linux/32-bit/curl/curlrules.h similarity index 100% rename from external/curl/include/linux/32-bit/curlrules.h rename to external/curl/include/linux/32-bit/curl/curlrules.h diff --git a/external/curl/include/linux/32-bit/curlver.h b/external/curl/include/linux/32-bit/curl/curlver.h similarity index 100% rename from external/curl/include/linux/32-bit/curlver.h rename to external/curl/include/linux/32-bit/curl/curlver.h diff --git a/external/curl/include/linux/32-bit/easy.h b/external/curl/include/linux/32-bit/curl/easy.h similarity index 100% rename from external/curl/include/linux/32-bit/easy.h rename to external/curl/include/linux/32-bit/curl/easy.h diff --git a/external/curl/include/linux/32-bit/mprintf.h b/external/curl/include/linux/32-bit/curl/mprintf.h similarity index 100% rename from external/curl/include/linux/32-bit/mprintf.h rename to external/curl/include/linux/32-bit/curl/mprintf.h diff --git a/external/curl/include/linux/32-bit/multi.h b/external/curl/include/linux/32-bit/curl/multi.h similarity index 100% rename from external/curl/include/linux/32-bit/multi.h rename to external/curl/include/linux/32-bit/curl/multi.h diff --git a/external/curl/include/linux/32-bit/stdcheaders.h b/external/curl/include/linux/32-bit/curl/stdcheaders.h similarity index 100% rename from external/curl/include/linux/32-bit/stdcheaders.h rename to external/curl/include/linux/32-bit/curl/stdcheaders.h diff --git a/external/curl/include/linux/32-bit/typecheck-gcc.h b/external/curl/include/linux/32-bit/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/linux/32-bit/typecheck-gcc.h rename to external/curl/include/linux/32-bit/curl/typecheck-gcc.h diff --git a/external/curl/include/linux/64-bit/curl.h b/external/curl/include/linux/64-bit/curl/curl.h similarity index 100% rename from external/curl/include/linux/64-bit/curl.h rename to external/curl/include/linux/64-bit/curl/curl.h diff --git a/external/curl/include/linux/64-bit/curlbuild.h b/external/curl/include/linux/64-bit/curl/curlbuild.h similarity index 100% rename from external/curl/include/linux/64-bit/curlbuild.h rename to external/curl/include/linux/64-bit/curl/curlbuild.h diff --git a/external/curl/include/linux/64-bit/curlrules.h b/external/curl/include/linux/64-bit/curl/curlrules.h similarity index 100% rename from external/curl/include/linux/64-bit/curlrules.h rename to external/curl/include/linux/64-bit/curl/curlrules.h diff --git a/external/curl/include/linux/64-bit/curlver.h b/external/curl/include/linux/64-bit/curl/curlver.h similarity index 100% rename from external/curl/include/linux/64-bit/curlver.h rename to external/curl/include/linux/64-bit/curl/curlver.h diff --git a/external/curl/include/linux/64-bit/easy.h b/external/curl/include/linux/64-bit/curl/easy.h similarity index 100% rename from external/curl/include/linux/64-bit/easy.h rename to external/curl/include/linux/64-bit/curl/easy.h diff --git a/external/curl/include/linux/64-bit/mprintf.h b/external/curl/include/linux/64-bit/curl/mprintf.h similarity index 100% rename from external/curl/include/linux/64-bit/mprintf.h rename to external/curl/include/linux/64-bit/curl/mprintf.h diff --git a/external/curl/include/linux/64-bit/multi.h b/external/curl/include/linux/64-bit/curl/multi.h similarity index 100% rename from external/curl/include/linux/64-bit/multi.h rename to external/curl/include/linux/64-bit/curl/multi.h diff --git a/external/curl/include/linux/64-bit/stdcheaders.h b/external/curl/include/linux/64-bit/curl/stdcheaders.h similarity index 100% rename from external/curl/include/linux/64-bit/stdcheaders.h rename to external/curl/include/linux/64-bit/curl/stdcheaders.h diff --git a/external/curl/include/win32/curl.h b/external/curl/include/win32/curl/curl.h similarity index 100% rename from external/curl/include/win32/curl.h rename to external/curl/include/win32/curl/curl.h diff --git a/external/curl/include/win32/curlbuild.h b/external/curl/include/win32/curl/curlbuild.h similarity index 100% rename from external/curl/include/win32/curlbuild.h rename to external/curl/include/win32/curl/curlbuild.h diff --git a/external/curl/include/win32/curlrules.h b/external/curl/include/win32/curl/curlrules.h similarity index 100% rename from external/curl/include/win32/curlrules.h rename to external/curl/include/win32/curl/curlrules.h diff --git a/external/curl/include/win32/curlver.h b/external/curl/include/win32/curl/curlver.h similarity index 100% rename from external/curl/include/win32/curlver.h rename to external/curl/include/win32/curl/curlver.h diff --git a/external/curl/include/win32/easy.h b/external/curl/include/win32/curl/easy.h similarity index 100% rename from external/curl/include/win32/easy.h rename to external/curl/include/win32/curl/easy.h diff --git a/external/curl/include/win32/mprintf.h b/external/curl/include/win32/curl/mprintf.h similarity index 100% rename from external/curl/include/win32/mprintf.h rename to external/curl/include/win32/curl/mprintf.h diff --git a/external/curl/include/win32/multi.h b/external/curl/include/win32/curl/multi.h similarity index 100% rename from external/curl/include/win32/multi.h rename to external/curl/include/win32/curl/multi.h diff --git a/external/curl/include/win32/stdcheaders.h b/external/curl/include/win32/curl/stdcheaders.h similarity index 100% rename from external/curl/include/win32/stdcheaders.h rename to external/curl/include/win32/curl/stdcheaders.h diff --git a/external/curl/include/win32/typecheck-gcc.h b/external/curl/include/win32/curl/typecheck-gcc.h similarity index 100% rename from external/curl/include/win32/typecheck-gcc.h rename to external/curl/include/win32/curl/typecheck-gcc.h diff --git a/external/curl/prebuilt/andorid/Android.mk b/external/curl/prebuilt/android/Android.mk similarity index 57% rename from external/curl/prebuilt/andorid/Android.mk rename to external/curl/prebuilt/android/Android.mk index 8d0c18d79f..daa087ec8e 100644 --- a/external/curl/prebuilt/andorid/Android.mk +++ b/external/curl/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_curl_static LOCAL_MODULE_FILENAME := curl -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libcurl.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcurl.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/armeabi-v7a/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/armeabi-v7a/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/armeabi-v7a/libcurl.a.REMOVED.git-id diff --git a/external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/armeabi/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/armeabi/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/armeabi/libcurl.a.REMOVED.git-id diff --git a/external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id b/external/curl/prebuilt/android/x86/libcurl.a.REMOVED.git-id similarity index 100% rename from external/curl/prebuilt/andorid/x86/libcurl.a.REMOVED.git-id rename to external/curl/prebuilt/android/x86/libcurl.a.REMOVED.git-id diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h b/external/freetype2/include/android/freetype2/freetype/config/ftconfig.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftconfig.h rename to external/freetype2/include/android/freetype2/freetype/config/ftconfig.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h b/external/freetype2/include/android/freetype2/freetype/config/ftheader.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftheader.h rename to external/freetype2/include/android/freetype2/freetype/config/ftheader.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h b/external/freetype2/include/android/freetype2/freetype/config/ftmodule.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftmodule.h rename to external/freetype2/include/android/freetype2/freetype/config/ftmodule.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h b/external/freetype2/include/android/freetype2/freetype/config/ftoption.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftoption.h rename to external/freetype2/include/android/freetype2/freetype/config/ftoption.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h b/external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/config/ftstdlib.h rename to external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id b/external/freetype2/include/android/freetype2/freetype/freetype.h.REMOVED.git-id similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/freetype.h.REMOVED.git-id rename to external/freetype2/include/android/freetype2/freetype/freetype.h.REMOVED.git-id diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h b/external/freetype2/include/android/freetype2/freetype/ftadvanc.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftadvanc.h rename to external/freetype2/include/android/freetype2/freetype/ftadvanc.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftautoh.h b/external/freetype2/include/android/freetype2/freetype/ftautoh.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftautoh.h rename to external/freetype2/include/android/freetype2/freetype/ftautoh.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbbox.h b/external/freetype2/include/android/freetype2/freetype/ftbbox.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbbox.h rename to external/freetype2/include/android/freetype2/freetype/ftbbox.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbdf.h b/external/freetype2/include/android/freetype2/freetype/ftbdf.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbdf.h rename to external/freetype2/include/android/freetype2/freetype/ftbdf.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h b/external/freetype2/include/android/freetype2/freetype/ftbitmap.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbitmap.h rename to external/freetype2/include/android/freetype2/freetype/ftbitmap.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h b/external/freetype2/include/android/freetype2/freetype/ftbzip2.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftbzip2.h rename to external/freetype2/include/android/freetype2/freetype/ftbzip2.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcache.h b/external/freetype2/include/android/freetype2/freetype/ftcache.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcache.h rename to external/freetype2/include/android/freetype2/freetype/ftcache.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h b/external/freetype2/include/android/freetype2/freetype/ftcffdrv.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcffdrv.h rename to external/freetype2/include/android/freetype2/freetype/ftcffdrv.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftchapters.h b/external/freetype2/include/android/freetype2/freetype/ftchapters.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftchapters.h rename to external/freetype2/include/android/freetype2/freetype/ftchapters.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftcid.h b/external/freetype2/include/android/freetype2/freetype/ftcid.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftcid.h rename to external/freetype2/include/android/freetype2/freetype/ftcid.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fterrdef.h b/external/freetype2/include/android/freetype2/freetype/fterrdef.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fterrdef.h rename to external/freetype2/include/android/freetype2/freetype/fterrdef.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fterrors.h b/external/freetype2/include/android/freetype2/freetype/fterrors.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fterrors.h rename to external/freetype2/include/android/freetype2/freetype/fterrors.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgasp.h b/external/freetype2/include/android/freetype2/freetype/ftgasp.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgasp.h rename to external/freetype2/include/android/freetype2/freetype/ftgasp.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftglyph.h b/external/freetype2/include/android/freetype2/freetype/ftglyph.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftglyph.h rename to external/freetype2/include/android/freetype2/freetype/ftglyph.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgxval.h b/external/freetype2/include/android/freetype2/freetype/ftgxval.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgxval.h rename to external/freetype2/include/android/freetype2/freetype/ftgxval.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftgzip.h b/external/freetype2/include/android/freetype2/freetype/ftgzip.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftgzip.h rename to external/freetype2/include/android/freetype2/freetype/ftgzip.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftimage.h b/external/freetype2/include/android/freetype2/freetype/ftimage.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftimage.h rename to external/freetype2/include/android/freetype2/freetype/ftimage.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftincrem.h b/external/freetype2/include/android/freetype2/freetype/ftincrem.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftincrem.h rename to external/freetype2/include/android/freetype2/freetype/ftincrem.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h b/external/freetype2/include/android/freetype2/freetype/ftlcdfil.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlcdfil.h rename to external/freetype2/include/android/freetype2/freetype/ftlcdfil.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlist.h b/external/freetype2/include/android/freetype2/freetype/ftlist.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlist.h rename to external/freetype2/include/android/freetype2/freetype/ftlist.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftlzw.h b/external/freetype2/include/android/freetype2/freetype/ftlzw.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftlzw.h rename to external/freetype2/include/android/freetype2/freetype/ftlzw.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmac.h b/external/freetype2/include/android/freetype2/freetype/ftmac.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmac.h rename to external/freetype2/include/android/freetype2/freetype/ftmac.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmm.h b/external/freetype2/include/android/freetype2/freetype/ftmm.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmm.h rename to external/freetype2/include/android/freetype2/freetype/ftmm.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h b/external/freetype2/include/android/freetype2/freetype/ftmodapi.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmodapi.h rename to external/freetype2/include/android/freetype2/freetype/ftmodapi.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h b/external/freetype2/include/android/freetype2/freetype/ftmoderr.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftmoderr.h rename to external/freetype2/include/android/freetype2/freetype/ftmoderr.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftotval.h b/external/freetype2/include/android/freetype2/freetype/ftotval.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftotval.h rename to external/freetype2/include/android/freetype2/freetype/ftotval.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftoutln.h b/external/freetype2/include/android/freetype2/freetype/ftoutln.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftoutln.h rename to external/freetype2/include/android/freetype2/freetype/ftoutln.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftpfr.h b/external/freetype2/include/android/freetype2/freetype/ftpfr.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftpfr.h rename to external/freetype2/include/android/freetype2/freetype/ftpfr.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftrender.h b/external/freetype2/include/android/freetype2/freetype/ftrender.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftrender.h rename to external/freetype2/include/android/freetype2/freetype/ftrender.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsizes.h b/external/freetype2/include/android/freetype2/freetype/ftsizes.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsizes.h rename to external/freetype2/include/android/freetype2/freetype/ftsizes.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsnames.h b/external/freetype2/include/android/freetype2/freetype/ftsnames.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsnames.h rename to external/freetype2/include/android/freetype2/freetype/ftsnames.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftstroke.h b/external/freetype2/include/android/freetype2/freetype/ftstroke.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftstroke.h rename to external/freetype2/include/android/freetype2/freetype/ftstroke.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsynth.h b/external/freetype2/include/android/freetype2/freetype/ftsynth.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsynth.h rename to external/freetype2/include/android/freetype2/freetype/ftsynth.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftsystem.h b/external/freetype2/include/android/freetype2/freetype/ftsystem.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftsystem.h rename to external/freetype2/include/android/freetype2/freetype/ftsystem.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fttrigon.h b/external/freetype2/include/android/freetype2/freetype/fttrigon.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fttrigon.h rename to external/freetype2/include/android/freetype2/freetype/fttrigon.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h b/external/freetype2/include/android/freetype2/freetype/ftttdrv.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftttdrv.h rename to external/freetype2/include/android/freetype2/freetype/ftttdrv.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/fttypes.h b/external/freetype2/include/android/freetype2/freetype/fttypes.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/fttypes.h rename to external/freetype2/include/android/freetype2/freetype/fttypes.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h b/external/freetype2/include/android/freetype2/freetype/ftwinfnt.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftwinfnt.h rename to external/freetype2/include/android/freetype2/freetype/ftwinfnt.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ftxf86.h b/external/freetype2/include/android/freetype2/freetype/ftxf86.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ftxf86.h rename to external/freetype2/include/android/freetype2/freetype/ftxf86.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/t1tables.h b/external/freetype2/include/android/freetype2/freetype/t1tables.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/t1tables.h rename to external/freetype2/include/android/freetype2/freetype/t1tables.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ttnameid.h b/external/freetype2/include/android/freetype2/freetype/ttnameid.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ttnameid.h rename to external/freetype2/include/android/freetype2/freetype/ttnameid.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/tttables.h b/external/freetype2/include/android/freetype2/freetype/tttables.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/tttables.h rename to external/freetype2/include/android/freetype2/freetype/tttables.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/tttags.h b/external/freetype2/include/android/freetype2/freetype/tttags.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/tttags.h rename to external/freetype2/include/android/freetype2/freetype/tttags.h diff --git a/external/freetype2/include/andorid/freetype2/freetype/ttunpat.h b/external/freetype2/include/android/freetype2/freetype/ttunpat.h similarity index 100% rename from external/freetype2/include/andorid/freetype2/freetype/ttunpat.h rename to external/freetype2/include/android/freetype2/freetype/ttunpat.h diff --git a/external/freetype2/include/andorid/ft2build.h b/external/freetype2/include/android/ft2build.h similarity index 100% rename from external/freetype2/include/andorid/ft2build.h rename to external/freetype2/include/android/ft2build.h diff --git a/external/freetype2/prebuilt/andorid/Android.mk b/external/freetype2/prebuilt/android/Android.mk similarity index 50% rename from external/freetype2/prebuilt/andorid/Android.mk rename to external/freetype2/prebuilt/android/Android.mk index 3a4dee0520..958d27f3a0 100644 --- a/external/freetype2/prebuilt/andorid/Android.mk +++ b/external/freetype2/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_freetype2_static LOCAL_MODULE_FILENAME := freetype2 -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libfreetype.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/include/freetype2 +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libfreetype.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android $(LOCAL_PATH)/../../include/android/freetype2 include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/armeabi-v7a/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/armeabi-v7a/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/armeabi-v7a/libfreetype.a.REMOVED.git-id diff --git a/external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/armeabi/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/armeabi/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/armeabi/libfreetype.a.REMOVED.git-id diff --git a/external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id b/external/freetype2/prebuilt/android/x86/libfreetype.a.REMOVED.git-id similarity index 100% rename from external/freetype2/prebuilt/andorid/x86/libfreetype.a.REMOVED.git-id rename to external/freetype2/prebuilt/android/x86/libfreetype.a.REMOVED.git-id diff --git a/external/jpeg/include/andorid/jconfig.h b/external/jpeg/include/android/jconfig.h similarity index 100% rename from external/jpeg/include/andorid/jconfig.h rename to external/jpeg/include/android/jconfig.h diff --git a/external/jpeg/include/andorid/jerror.h b/external/jpeg/include/android/jerror.h similarity index 100% rename from external/jpeg/include/andorid/jerror.h rename to external/jpeg/include/android/jerror.h diff --git a/external/jpeg/include/andorid/jmorecfg.h b/external/jpeg/include/android/jmorecfg.h similarity index 100% rename from external/jpeg/include/andorid/jmorecfg.h rename to external/jpeg/include/android/jmorecfg.h diff --git a/external/jpeg/include/andorid/jpeglib.h b/external/jpeg/include/android/jpeglib.h similarity index 100% rename from external/jpeg/include/andorid/jpeglib.h rename to external/jpeg/include/android/jpeglib.h diff --git a/external/jpeg/prebuilt/andorid/Android.mk b/external/jpeg/prebuilt/android/Android.mk similarity index 57% rename from external/jpeg/prebuilt/andorid/Android.mk rename to external/jpeg/prebuilt/android/Android.mk index b8786d07df..74af61ea2a 100644 --- a/external/jpeg/prebuilt/andorid/Android.mk +++ b/external/jpeg/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_jpeg_static LOCAL_MODULE_FILENAME := jpeg -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libjpeg.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjpeg.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/armeabi-v7a/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/armeabi-v7a/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/armeabi-v7a/libjpeg.a.REMOVED.git-id diff --git a/external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/armeabi/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/armeabi/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/armeabi/libjpeg.a.REMOVED.git-id diff --git a/external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id b/external/jpeg/prebuilt/android/x86/libjpeg.a.REMOVED.git-id similarity index 100% rename from external/jpeg/prebuilt/andorid/x86/libjpeg.a.REMOVED.git-id rename to external/jpeg/prebuilt/android/x86/libjpeg.a.REMOVED.git-id diff --git a/external/jsoncpp/autolink.h b/external/json/autolink.h similarity index 65% rename from external/jsoncpp/autolink.h rename to external/json/autolink.h index 02328d1f1a..37c9258ed5 100644 --- a/external/jsoncpp/autolink.h +++ b/external/json/autolink.h @@ -1,8 +1,3 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_AUTOLINK_H_INCLUDED # define JSON_AUTOLINK_H_INCLUDED diff --git a/external/json/config.h b/external/json/config.h new file mode 100644 index 0000000000..5d334cbc5e --- /dev/null +++ b/external/json/config.h @@ -0,0 +1,43 @@ +#ifndef JSON_CONFIG_H_INCLUDED +# define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. +/// The memory pools allocator used optimization (initializing Value and ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +/// If defined, indicates that Json use exception to report invalid type manipulation +/// instead of C assert macro. +# define JSON_USE_EXCEPTION 1 + +# ifdef JSON_IN_CPPTL +# include +# ifndef JSON_USE_CPPTL +# define JSON_USE_CPPTL 1 +# endif +# endif + +# ifdef JSON_IN_CPPTL +# define JSON_API CPPTL_API +# elif defined(JSON_DLL_BUILD) +# define JSON_API __declspec(dllexport) +# elif defined(JSON_DLL) +# define JSON_API __declspec(dllimport) +# else +# define JSON_API +# endif + +#endif // JSON_CONFIG_H_INCLUDED diff --git a/external/jsoncpp/features.h b/external/json/features.h similarity index 78% rename from external/jsoncpp/features.h rename to external/json/features.h index 03be3313bf..5a9adec118 100644 --- a/external/jsoncpp/features.h +++ b/external/json/features.h @@ -1,16 +1,9 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_FEATURES_H_INCLUDED # define CPPTL_JSON_FEATURES_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { +namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer @@ -44,6 +37,6 @@ namespace CSJson { bool strictRoot_; }; -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/external/jsoncpp/forwards.h b/external/json/forwards.h similarity index 61% rename from external/jsoncpp/forwards.h rename to external/json/forwards.h index 4af4eebdb5..d0ce8300ce 100644 --- a/external/jsoncpp/forwards.h +++ b/external/json/forwards.h @@ -1,16 +1,9 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_FORWARDS_H_INCLUDED # define JSON_FORWARDS_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { +namespace Json { // writer.h class FastWriter; @@ -23,7 +16,8 @@ namespace CSJson { class Features; // value.h - typedef unsigned int ArrayIndex; + typedef int Int; + typedef unsigned int UInt; class StaticString; class Path; class PathArgument; @@ -32,13 +26,14 @@ namespace CSJson { class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP + class ValueAllocator; class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP -} // namespace CSJson +} // namespace Json #endif // JSON_FORWARDS_H_INCLUDED diff --git a/external/json/json.h b/external/json/json.h new file mode 100644 index 0000000000..c71ed65abf --- /dev/null +++ b/external/json/json.h @@ -0,0 +1,10 @@ +#ifndef JSON_JSON_H_INCLUDED +# define JSON_JSON_H_INCLUDED + +# include "autolink.h" +# include "value.h" +# include "reader.h" +# include "writer.h" +# include "features.h" + +#endif // JSON_JSON_H_INCLUDED diff --git a/external/jsoncpp/json_batchallocator.h b/external/json/json_batchallocator.h similarity index 93% rename from external/jsoncpp/json_batchallocator.h rename to external/json/json_batchallocator.h index 14b4d36839..87ea5ed807 100644 --- a/external/jsoncpp/json_batchallocator.h +++ b/external/json/json_batchallocator.h @@ -1,8 +1,3 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED # define JSONCPP_BATCHALLOCATOR_H_INCLUDED @@ -11,7 +6,7 @@ # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -namespace CSJson { +namespace Json { /* Fast memory allocator. * @@ -122,7 +117,7 @@ private: }; -} // namespace CSJson +} // namespace Json # endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION diff --git a/external/jsoncpp/json_internalarray.inl b/external/json/json_internalarray.inl similarity index 97% rename from external/jsoncpp/json_internalarray.inl rename to external/json/json_internalarray.inl index 5bce163b9c..9b985d2585 100644 --- a/external/jsoncpp/json_internalarray.inl +++ b/external/json/json_internalarray.inl @@ -1,11 +1,5 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp - -namespace CSJson { +// everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -452,5 +446,3 @@ ValueInternalArray::compare( const ValueInternalArray &other ) const } return 0; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_internalmap.inl b/external/json/json_internalmap.inl similarity index 98% rename from external/jsoncpp/json_internalmap.inl rename to external/json/json_internalmap.inl index 755eeb941a..19771488d6 100644 --- a/external/jsoncpp/json_internalmap.inl +++ b/external/json/json_internalmap.inl @@ -1,11 +1,5 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp - -namespace CSJson { +// everything is within Json namespace // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -421,7 +415,7 @@ ValueInternalMap::setNewItem( const char *key, ValueInternalLink *link, BucketIndex index ) { - char *duplicatedKey = makeMemberName( key ); + char *duplicatedKey = valueAllocator()->makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); @@ -611,5 +605,3 @@ ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) increment( it ); return offset; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_reader.cpp b/external/json/json_reader.cpp similarity index 89% rename from external/jsoncpp/json_reader.cpp rename to external/json/json_reader.cpp index 5d336cf2a7..4eb2d11fd3 100644 --- a/external/jsoncpp/json_reader.cpp +++ b/external/json/json_reader.cpp @@ -1,27 +1,17 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "reader.h" -# include "value.h" -# include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include #include #include #include #include #include #include -#include -#include #if _MSC_VER >= 1400 // VC++ 8.0 #pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. #endif -namespace CSJson { +namespace Json { // Implementation of class Features // //////////////////////////////// @@ -76,6 +66,42 @@ containsNewLine( Reader::Location begin, return false; } +static std::string codePointToUTF8(unsigned int cp) +{ + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) + { + result.resize(1); + result[0] = static_cast(cp); + } + else if (cp <= 0x7FF) + { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } + else if (cp <= 0xFFFF) + { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } + else if (cp <= 0x10FFFF) + { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + // Class Reader // ////////////////////////////////////////////////////////////////// @@ -451,7 +477,7 @@ Reader::readString() bool -Reader::readObject( Token &/*tokenStart*/ ) +Reader::readObject( Token &tokenStart ) { Token tokenName; std::string name; @@ -490,7 +516,7 @@ Reader::readObject( Token &/*tokenStart*/ ) if ( !readToken( comma ) || ( comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && - comma.type_ != tokenComment ) ) + comma.type_ != tokenComment ) ) { return addErrorAndRecover( "Missing ',' or '}' in object declaration", comma, @@ -510,7 +536,7 @@ Reader::readObject( Token &/*tokenStart*/ ) bool -Reader::readArray( Token &/*tokenStart*/ ) +Reader::readArray( Token &tokenStart ) { currentValue() = Value( arrayValue ); skipSpaces(); @@ -521,7 +547,7 @@ Reader::readArray( Token &/*tokenStart*/ ) return true; } int index = 0; - for (;;) + while ( true ) { Value &value = currentValue()[ index++ ]; nodes_.push( &value ); @@ -537,8 +563,8 @@ Reader::readArray( Token &/*tokenStart*/ ) { ok = readToken( token ); } - bool badTokenType = ( token.type_ != tokenArraySeparator && - token.type_ != tokenArrayEnd ); + bool badTokenType = ( token.type_ == tokenArraySeparator && + token.type_ == tokenArrayEnd ); if ( !ok || badTokenType ) { return addErrorAndRecover( "Missing ',' or ']' in array declaration", @@ -564,41 +590,26 @@ Reader::decodeNumber( Token &token ) } if ( isDouble ) return decodeDouble( token ); - // Attempts to parse the number as an integer. If the number is - // larger than the maximum supported value of an integer then - // we decode the number as a double. Location current = token.start_; bool isNegative = *current == '-'; if ( isNegative ) ++current; - Value::LargestUInt maxIntegerValue = isNegative ? Value::LargestUInt(-Value::minLargestInt) - : Value::maxLargestUInt; - Value::LargestUInt threshold = maxIntegerValue / 10; - Value::UInt lastDigitThreshold = Value::UInt( maxIntegerValue % 10 ); - assert( lastDigitThreshold >=0 && lastDigitThreshold <= 9 ); - Value::LargestUInt value = 0; + Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt) + : Value::maxUInt) / 10; + Value::UInt value = 0; while ( current < token.end_ ) { Char c = *current++; if ( c < '0' || c > '9' ) return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token ); - Value::UInt digit(c - '0'); if ( value >= threshold ) - { - // If the current digit is not the last one, or if it is - // greater than the last digit of the maximum integer value, - // the parse the number as a double. - if ( current != token.end_ || digit > lastDigitThreshold ) - { - return decodeDouble( token ); - } - } - value = value * 10 + digit; + return decodeDouble( token ); + value = value * 10 + Value::UInt(c - '0'); } if ( isNegative ) - currentValue() = -Value::LargestInt( value ); - else if ( value <= Value::LargestUInt(Value::maxInt) ) - currentValue() = Value::LargestInt( value ); + currentValue() = -Value::Int( value ); + else if ( value <= Value::UInt(Value::maxInt) ) + currentValue() = Value::Int( value ); else currentValue() = value; return true; @@ -614,7 +625,7 @@ Reader::decodeDouble( Token &token ) int length = int(token.end_ - token.start_); if ( length <= bufferSize ) { - Char buffer[bufferSize+1]; + Char buffer[bufferSize]; memcpy( buffer, token.start_, length ); buffer[length] = 0; count = sscanf( buffer, "%lf", &value ); @@ -764,7 +775,7 @@ Reader::recoverFromError( TokenType skipUntilToken ) { int errorCount = int(errors_.size()); Token skip; - for (;;) + while ( true ) { if ( !readToken(skip) ) errors_.resize( errorCount ); // discard errors caused by recovery @@ -843,16 +854,8 @@ Reader::getLocationLineAndColumn( Location location ) const } -// Deprecated. Preserved for backward compatibility std::string Reader::getFormatedErrorMessages() const -{ - return getFormattedErrorMessages(); -} - - -std::string -Reader::getFormattedErrorMessages() const { std::string formattedMessage; for ( Errors::const_iterator itError = errors_.begin(); @@ -871,12 +874,12 @@ Reader::getFormattedErrorMessages() const std::istream& operator>>( std::istream &sin, Value &root ) { - CSJson::Reader reader; + Json::Reader reader; bool ok = reader.parse(sin, root, true); //JSON_ASSERT( ok ); - if (!ok) throw std::runtime_error(reader.getFormattedErrorMessages()); + if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages()); return sin; } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/json_value.cpp b/external/json/json_value.cpp similarity index 79% rename from external/jsoncpp/json_value.cpp rename to external/json/json_value.cpp index e62b9c36a1..573205f13e 100644 --- a/external/jsoncpp/json_value.cpp +++ b/external/json/json_value.cpp @@ -1,16 +1,6 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "value.h" -# include "writer.h" -# ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -# include "json_batchallocator.h" -# endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -#endif // if !defined(JSON_IS_AMALGAMATION) #include +#include +#include #include #include #include @@ -19,63 +9,106 @@ # include #endif #include // size_t - -#include +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +# include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR #define JSON_ASSERT_UNREACHABLE assert( false ) #define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw -#define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message ); -#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) JSON_FAIL_MESSAGE( message ) +#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); -namespace CSJson { +namespace Json { -const Value Value::jsonNull; +const Value Value::null; const Int Value::minInt = Int( ~(UInt(-1)/2) ); const Int Value::maxInt = Int( UInt(-1)/2 ); const UInt Value::maxUInt = UInt(-1); -const Int64 Value::minInt64 = Int64( ~(UInt64(-1)/2) ); -const Int64 Value::maxInt64 = Int64( UInt64(-1)/2 ); -const UInt64 Value::maxUInt64 = UInt64(-1); -const LargestInt Value::minLargestInt = LargestInt( ~(LargestUInt(-1)/2) ); -const LargestInt Value::maxLargestInt = LargestInt( LargestUInt(-1)/2 ); -const LargestUInt Value::maxLargestUInt = LargestUInt(-1); +// A "safe" implementation of strdup. Allow null pointer to be passed. +// Also avoid warning on msvc80. +// +//inline char *safeStringDup( const char *czstring ) +//{ +// if ( czstring ) +// { +// const size_t length = (unsigned int)( strlen(czstring) + 1 ); +// char *newString = static_cast( malloc( length ) ); +// memcpy( newString, czstring, length ); +// return newString; +// } +// return 0; +//} +// +//inline char *safeStringDup( const std::string &str ) +//{ +// if ( !str.empty() ) +// { +// const size_t length = str.length(); +// char *newString = static_cast( malloc( length + 1 ) ); +// memcpy( newString, str.c_str(), length ); +// newString[length] = 0; +// return newString; +// } +// return 0; +//} -/// Unknown size marker -static const unsigned int unknown = (unsigned)-1; - - -/** Duplicates the specified string value. - * @param value Pointer to the string to duplicate. Must be zero-terminated if - * length is "unknown". - * @param length Length of the value. if equals to unknown, then it will be - * computed using strlen(value). - * @return Pointer on the duplicate instance of string. - */ -static inline char * -duplicateStringValue( const char *value, - unsigned int length = unknown ) +ValueAllocator::~ValueAllocator() { - if ( length == unknown ) - length = (unsigned int)strlen(value); - char *newString = static_cast( malloc( length + 1 ) ); - JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" ); - memcpy( newString, value, length ); - newString[length] = 0; - return newString; } - -/** Free the string duplicated by duplicateStringValue(). - */ -static inline void -releaseStringValue( char *value ) +class DefaultValueAllocator : public ValueAllocator { - if ( value ) - free( value ); +public: + virtual ~DefaultValueAllocator() + { + } + + virtual char *makeMemberName( const char *memberName ) + { + return duplicateStringValue( memberName ); + } + + virtual void releaseMemberName( char *memberName ) + { + releaseStringValue( memberName ); + } + + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) + { + //@todo invesgate this old optimization + //if ( !value || value[0] == 0 ) + // return 0; + + if ( length == unknown ) + length = (unsigned int)strlen(value); + char *newString = static_cast( malloc( length + 1 ) ); + memcpy( newString, value, length ); + newString[length] = 0; + return newString; + } + + virtual void releaseStringValue( char *value ) + { + if ( value ) + free( value ); + } +}; + +static ValueAllocator *&valueAllocator() +{ + static DefaultValueAllocator defaultAllocator; + static ValueAllocator *valueAllocator = &defaultAllocator; + return valueAllocator; } -} // namespace CSJson +static struct DummyValueAllocatorInitializer { + DummyValueAllocatorInitializer() + { + valueAllocator(); // ensure valueAllocator() statics are initialized before main(). + } +} dummyValueAllocatorInitializer; + // ////////////////////////////////////////////////////////////////// @@ -85,16 +118,13 @@ releaseStringValue( char *value ) // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// -#if !defined(JSON_IS_AMALGAMATION) -# ifdef JSON_VALUE_USE_INTERNAL_MAP -# include "json_internalarray.inl" -# include "json_internalmap.inl" -# endif // JSON_VALUE_USE_INTERNAL_MAP +#ifdef JSON_VALUE_USE_INTERNAL_MAP +# include "json_internalarray.inl" +# include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP # include "json_valueiterator.inl" -#endif // if !defined(JSON_IS_AMALGAMATION) -namespace CSJson { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -113,7 +143,7 @@ Value::CommentInfo::CommentInfo() Value::CommentInfo::~CommentInfo() { if ( comment_ ) - releaseStringValue( comment_ ); + valueAllocator()->releaseStringValue( comment_ ); } @@ -121,11 +151,11 @@ void Value::CommentInfo::setComment( const char *text ) { if ( comment_ ) - releaseStringValue( comment_ ); - JSON_ASSERT( text != 0 ); + valueAllocator()->releaseStringValue( comment_ ); + JSON_ASSERT( text ); JSON_ASSERT_MESSAGE( text[0]=='\0' || text[0]=='/', "Comments must start with /"); // It seems that /**/ style comments are acceptable as well. - comment_ = duplicateStringValue( text ); + comment_ = valueAllocator()->duplicateStringValue( text ); } @@ -141,14 +171,14 @@ Value::CommentInfo::setComment( const char *text ) // Notes: index_ indicates if the string was allocated when // a string is stored. -Value::CZString::CZString( ArrayIndex index ) +Value::CZString::CZString( int index ) : cstr_( 0 ) , index_( index ) { } Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) - : cstr_( allocate == duplicate ? duplicateStringValue(cstr) + : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) : cstr ) , index_( allocate ) { @@ -156,7 +186,7 @@ Value::CZString::CZString( const char *cstr, DuplicationPolicy allocate ) Value::CZString::CZString( const CZString &other ) : cstr_( other.index_ != noDuplication && other.cstr_ != 0 - ? duplicateStringValue( other.cstr_ ) + ? valueAllocator()->makeMemberName( other.cstr_ ) : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) @@ -166,7 +196,7 @@ Value::CZString::CZString( const CZString &other ) Value::CZString::~CZString() { if ( cstr_ && index_ == duplicate ) - releaseStringValue( const_cast( cstr_ ) ); + valueAllocator()->releaseMemberName( const_cast( cstr_ ) ); } void @@ -201,7 +231,7 @@ Value::CZString::operator==( const CZString &other ) const } -ArrayIndex +int Value::CZString::index() const { return index_; @@ -279,17 +309,6 @@ Value::Value( ValueType type ) } -#if defined(JSON_HAS_INT64) -Value::Value( UInt value ) - : type_( uintValue ) - , comments_( 0 ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) -#endif -{ - value_.uint_ = value; -} - Value::Value( Int value ) : type_( intValue ) , comments_( 0 ) @@ -300,21 +319,8 @@ Value::Value( Int value ) value_.int_ = value; } -#endif // if defined(JSON_HAS_INT64) - -Value::Value( Int64 value ) - : type_( intValue ) - , comments_( 0 ) -# ifdef JSON_VALUE_USE_INTERNAL_MAP - , itemIsUsed_( 0 ) -#endif -{ - value_.int_ = value; -} - - -Value::Value( UInt64 value ) +Value::Value( UInt value ) : type_( uintValue ) , comments_( 0 ) # ifdef JSON_VALUE_USE_INTERNAL_MAP @@ -342,7 +348,7 @@ Value::Value( const char *value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value ); + value_.string_ = valueAllocator()->duplicateStringValue( value ); } @@ -355,8 +361,8 @@ Value::Value( const char *beginValue, , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( beginValue, - (unsigned int)(endValue - beginValue) ); + value_.string_ = valueAllocator()->duplicateStringValue( beginValue, + UInt(endValue - beginValue) ); } @@ -368,8 +374,8 @@ Value::Value( const std::string &value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value.c_str(), - (unsigned int)value.length() ); + value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(), + (unsigned int)value.length() ); } @@ -394,7 +400,7 @@ Value::Value( const CppTL::ConstString &value ) , itemIsUsed_( 0 ) #endif { - value_.string_ = duplicateStringValue( value, value.length() ); + value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() ); } # endif @@ -428,7 +434,7 @@ Value::Value( const Value &other ) case stringValue: if ( other.value_.string_ ) { - value_.string_ = duplicateStringValue( other.value_.string_ ); + value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ ); allocated_ = true; } else @@ -475,17 +481,12 @@ Value::~Value() break; case stringValue: if ( allocated_ ) - releaseStringValue( value_.string_ ); + valueAllocator()->releaseStringValue( value_.string_ ); break; #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: - if (value_.map_ != NULL) - { - value_.map_->clear(); - delete value_.map_; - value_.map_ = NULL; - } + delete value_.map_; break; #else case arrayValue: @@ -531,15 +532,34 @@ Value::type() const int -Value::compare( const Value &other ) const +Value::compare( const Value &other ) { - if ( *this < other ) - return -1; - if ( *this > other ) - return 1; - return 0; -} + /* + int typeDelta = other.type_ - type_; + switch ( type_ ) + { + case nullValue: + return other.type_ == type_; + case intValue: + if ( other.type_.isNumeric() + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue, + break; + case arrayValue: + delete value_.array_; + break; + case objectValue: + delete value_.map_; + default: + JSON_ASSERT_UNREACHABLE; + } + */ + return 0; // unreachable +} bool Value::operator <( const Value &other ) const @@ -582,13 +602,13 @@ Value::operator <( const Value &other ) const default: JSON_ASSERT_UNREACHABLE; } - return false; // unreachable + return 0; // unreachable } bool Value::operator <=( const Value &other ) const { - return !(other < *this); + return !(other > *this); } bool @@ -644,7 +664,7 @@ Value::operator ==( const Value &other ) const default: JSON_ASSERT_UNREACHABLE; } - return false; // unreachable + return 0; // unreachable } bool @@ -677,7 +697,7 @@ Value::asString() const case realValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to string" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to string" ); default: JSON_ASSERT_UNREACHABLE; } @@ -692,7 +712,6 @@ Value::asConstString() const } # endif - Value::Int Value::asInt() const { @@ -701,11 +720,10 @@ Value::asInt() const case nullValue: return 0; case intValue: - JSON_ASSERT_MESSAGE( value_.int_ >= minInt && value_.int_ <= maxInt, "unsigned integer out of signed int range" ); - return Int(value_.int_); + return value_.int_; case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= UInt(maxInt), "unsigned integer out of signed int range" ); - return Int(value_.uint_); + JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, "integer out of signed integer range" ); + return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= minInt && value_.real_ <= maxInt, "Real out of signed integer range" ); return Int( value_.real_ ); @@ -714,14 +732,13 @@ Value::asInt() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to int" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to int" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } - Value::UInt Value::asUInt() const { @@ -731,11 +748,9 @@ Value::asUInt() const return 0; case intValue: JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to unsigned integer" ); - JSON_ASSERT_MESSAGE( value_.int_ <= maxUInt, "signed integer out of UInt range" ); - return UInt(value_.int_); + return value_.int_; case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= maxUInt, "unsigned integer out of UInt range" ); - return UInt(value_.uint_); + return value_.uint_; case realValue: JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt, "Real out of unsigned integer range" ); return UInt( value_.real_ ); @@ -744,95 +759,13 @@ Value::asUInt() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to uint" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to uint" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } - -# if defined(JSON_HAS_INT64) - -Value::Int64 -Value::asInt64() const -{ - switch ( type_ ) - { - case nullValue: - return 0; - case intValue: - return value_.int_; - case uintValue: - JSON_ASSERT_MESSAGE( value_.uint_ <= UInt64(maxInt64), "unsigned integer out of Int64 range" ); - return value_.uint_; - case realValue: - JSON_ASSERT_MESSAGE( value_.real_ >= minInt64 && value_.real_ <= maxInt64, "Real out of Int64 range" ); - return Int( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1 : 0; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to Int64" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0; // unreachable; -} - - -Value::UInt64 -Value::asUInt64() const -{ - switch ( type_ ) - { - case nullValue: - return 0; - case intValue: - JSON_ASSERT_MESSAGE( value_.int_ >= 0, "Negative integer can not be converted to UInt64" ); - return value_.int_; - case uintValue: - return value_.uint_; - case realValue: - JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt64, "Real out of UInt64 range" ); - return UInt( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1 : 0; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to UInt64" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0; // unreachable; -} -# endif // if defined(JSON_HAS_INT64) - - -LargestInt -Value::asLargestInt() const -{ -#if defined(JSON_NO_INT64) - return asInt(); -#else - return asInt64(); -#endif -} - - -LargestUInt -Value::asLargestUInt() const -{ -#if defined(JSON_NO_INT64) - return asUInt(); -#else - return asUInt64(); -#endif -} - - double Value::asDouble() const { @@ -841,13 +774,9 @@ Value::asDouble() const case nullValue: return 0.0; case intValue: - return static_cast( value_.int_ ); + return value_.int_; case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return value_.uint_; case realValue: return value_.real_; case booleanValue: @@ -855,42 +784,13 @@ Value::asDouble() const case stringValue: case arrayValue: case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to double" ); + JSON_ASSERT_MESSAGE( false, "Type is not convertible to double" ); default: JSON_ASSERT_UNREACHABLE; } return 0; // unreachable; } -float -Value::asFloat() const -{ - switch ( type_ ) - { - case nullValue: - return 0.0f; - case intValue: - return static_cast( value_.int_ ); - case uintValue: -#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( value_.uint_ ); -#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - return static_cast( Int(value_.uint_/2) ) * 2 + Int(value_.uint_ & 1); -#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) - case realValue: - return static_cast( value_.real_ ); - case booleanValue: - return value_.bool_ ? 1.0f : 0.0f; - case stringValue: - case arrayValue: - case objectValue: - JSON_FAIL_MESSAGE( "Type is not convertible to float" ); - default: - JSON_ASSERT_UNREACHABLE; - } - return 0.0f; // unreachable; -} - bool Value::asBool() const { @@ -969,7 +869,7 @@ Value::isConvertibleTo( ValueType other ) const /// Number of values in array or object -ArrayIndex +Value::UInt Value::size() const { switch ( type_ ) @@ -991,7 +891,7 @@ Value::size() const } return 0; case objectValue: - return ArrayIndex( value_.map_->size() ); + return Int( value_.map_->size() ); #else case arrayValue: return Int( value_.array_->size() ); @@ -1032,18 +932,7 @@ Value::clear() #ifndef JSON_VALUE_USE_INTERNAL_MAP case arrayValue: case objectValue: - // value_.map_->clear(); - if (value_.map_ != NULL) - { - value_.map_->clear(); - delete value_.map_; - value_.map_ = NULL; - } - if (value_.string_ != NULL) - { - delete value_.string_; - value_.string_ = NULL; - } + value_.map_->clear(); break; #else case arrayValue: @@ -1059,23 +948,21 @@ Value::clear() } void -Value::resize( ArrayIndex newSize ) +Value::resize( UInt newSize ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) *this = Value( arrayValue ); #ifndef JSON_VALUE_USE_INTERNAL_MAP - ArrayIndex oldSize = size(); + UInt oldSize = size(); if ( newSize == 0 ) clear(); else if ( newSize > oldSize ) (*this)[ newSize - 1 ]; else { - for ( ArrayIndex index = newSize; index < oldSize; ++index ) - { + for ( UInt index = newSize; index < oldSize; ++index ) value_.map_->erase( index ); - } assert( size() == newSize ); } #else @@ -1085,7 +972,7 @@ Value::resize( ArrayIndex newSize ) Value & -Value::operator[]( ArrayIndex index ) +Value::operator[]( UInt index ) { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) @@ -1096,7 +983,7 @@ Value::operator[]( ArrayIndex index ) if ( it != value_.map_->end() && (*it).first == key ) return (*it).second; - ObjectValues::value_type defaultValue( key, jsonNull ); + ObjectValues::value_type defaultValue( key, null ); it = value_.map_->insert( it, defaultValue ); return (*it).second; #else @@ -1105,25 +992,17 @@ Value::operator[]( ArrayIndex index ) } -Value & -Value::operator[]( int index ) -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; -} - - const Value & -Value::operator[]( ArrayIndex index ) const +Value::operator[]( UInt index ) const { JSON_ASSERT( type_ == nullValue || type_ == arrayValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString key( index ); ObjectValues::const_iterator it = value_.map_->find( key ); if ( it == value_.map_->end() ) - return jsonNull; + return null; return (*it).second; #else Value *value = value_.array_->find( index ); @@ -1132,14 +1011,6 @@ Value::operator[]( ArrayIndex index ) const } -const Value & -Value::operator[]( int index ) const -{ - JSON_ASSERT( index >= 0 ); - return (*this)[ ArrayIndex(index) ]; -} - - Value & Value::operator[]( const char *key ) { @@ -1161,7 +1032,7 @@ Value::resolveReference( const char *key, if ( it != value_.map_->end() && (*it).first == actualKey ) return (*it).second; - ObjectValues::value_type defaultValue( actualKey, jsonNull ); + ObjectValues::value_type defaultValue( actualKey, null ); it = value_.map_->insert( it, defaultValue ); Value &value = (*it).second; return value; @@ -1172,16 +1043,16 @@ Value::resolveReference( const char *key, Value -Value::get( ArrayIndex index, +Value::get( UInt index, const Value &defaultValue ) const { const Value *value = &((*this)[index]); - return value == &jsonNull ? defaultValue : *value; + return value == &null ? defaultValue : *value; } bool -Value::isValidIndex( ArrayIndex index ) const +Value::isValidIndex( UInt index ) const { return index < size(); } @@ -1193,12 +1064,12 @@ Value::operator[]( const char *key ) const { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::const_iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) - return jsonNull; + return null; return (*it).second; #else const Value *value = value_.map_->find( key ); @@ -1255,7 +1126,7 @@ Value::get( const char *key, const Value &defaultValue ) const { const Value *value = &((*this)[key]); - return value == &jsonNull ? defaultValue : *value; + return value == &null ? defaultValue : *value; } @@ -1271,12 +1142,12 @@ Value::removeMember( const char* key ) { JSON_ASSERT( type_ == nullValue || type_ == objectValue ); if ( type_ == nullValue ) - return jsonNull; + return null; #ifndef JSON_VALUE_USE_INTERNAL_MAP CZString actualKey( key, CZString::noDuplication ); ObjectValues::iterator it = value_.map_->find( actualKey ); if ( it == value_.map_->end() ) - return jsonNull; + return null; Value old(it->second); value_.map_->erase(it); return old; @@ -1311,7 +1182,7 @@ bool Value::isMember( const char *key ) const { const Value *value = &((*this)[key]); - return value != &jsonNull; + return value != &null; } @@ -1394,7 +1265,7 @@ Value::isBool() const } -bool +bool Value::isInt() const { return type_ == intValue; @@ -1644,7 +1515,7 @@ PathArgument::PathArgument() } -PathArgument::PathArgument( ArrayIndex index ) +PathArgument::PathArgument( Value::UInt index ) : index_( index ) , kind_( kindIndex ) { @@ -1700,9 +1571,9 @@ Path::makePath( const std::string &path, addPathInArg( path, in, itInArg, PathArgument::kindIndex ); else { - ArrayIndex index = 0; + Value::UInt index = 0; for ( ; current != end && *current >= '0' && *current <= '9'; ++current ) - index = index * 10 + ArrayIndex(*current - '0'); + index = index * 10 + Value::UInt(*current - '0'); args_.push_back( index ); } if ( current == end || *current++ != ']' ) @@ -1779,7 +1650,7 @@ Path::resolve( const Value &root ) const // Error: unable to resolve path (object value expected at position...) } node = &((*node)[arg.key_]); - if ( node == &Value::jsonNull ) + if ( node == &Value::null ) { // Error: unable to resolve path (object has no member named '' at position...) } @@ -1808,7 +1679,7 @@ Path::resolve( const Value &root, if ( !node->isObject() ) return defaultValue; node = &((*node)[arg.key_]); - if ( node == &Value::jsonNull ) + if ( node == &Value::null ) return defaultValue; } } @@ -1844,4 +1715,4 @@ Path::make( Value &root ) const } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/json_valueiterator.inl b/external/json/json_valueiterator.inl similarity index 96% rename from external/jsoncpp/json_valueiterator.inl rename to external/json/json_valueiterator.inl index 6cfdc0a812..736e260ea0 100644 --- a/external/jsoncpp/json_valueiterator.inl +++ b/external/json/json_valueiterator.inl @@ -1,11 +1,6 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - // included by json_value.cpp +// everything is within Json namespace -namespace CSJson { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// @@ -295,5 +290,3 @@ ValueIterator::operator =( const SelfType &other ) copy( other ); return *this; } - -} // namespace CSJson diff --git a/external/jsoncpp/json_writer.cpp b/external/json/json_writer.cpp similarity index 93% rename from external/jsoncpp/json_writer.cpp rename to external/json/json_writer.cpp index a6345ee6ff..cdf4188f2e 100644 --- a/external/jsoncpp/json_writer.cpp +++ b/external/json/json_writer.cpp @@ -1,12 +1,4 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#if !defined(JSON_IS_AMALGAMATION) -# include "writer.h" -# include "json_tool.h" -#endif // if !defined(JSON_IS_AMALGAMATION) +#include #include #include #include @@ -19,7 +11,12 @@ #pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. #endif -namespace CSJson { +namespace Json { + +static bool isControlCharacter(char ch) +{ + return ch > 0 && ch <= 0x1F; +} static bool containsControlCharacter( const char* str ) { @@ -30,16 +27,26 @@ static bool containsControlCharacter( const char* str ) } return false; } - - -std::string valueToString( LargestInt value ) +static void uintToString( unsigned int value, + char *¤t ) { - UIntToStringBuffer buffer; + *--current = 0; + do + { + *--current = (value % 10) + '0'; + value /= 10; + } + while ( value != 0 ); +} + +std::string valueToString( Int value ) +{ + char buffer[32]; char *current = buffer + sizeof(buffer); bool isNegative = value < 0; if ( isNegative ) value = -value; - uintToString( LargestUInt(value), current ); + uintToString( UInt(value), current ); if ( isNegative ) *--current = '-'; assert( current >= buffer ); @@ -47,31 +54,15 @@ std::string valueToString( LargestInt value ) } -std::string valueToString( LargestUInt value ) +std::string valueToString( UInt value ) { - UIntToStringBuffer buffer; + char buffer[32]; char *current = buffer + sizeof(buffer); uintToString( value, current ); assert( current >= buffer ); return current; } -#if defined(JSON_HAS_INT64) - -std::string valueToString( Int value ) -{ - return valueToString( LargestInt(value) ); -} - - -std::string valueToString( UInt value ) -{ - return valueToString( LargestUInt(value) ); -} - -#endif // # if defined(JSON_HAS_INT64) - - std::string valueToString( double value ) { char buffer[32]; @@ -125,7 +116,7 @@ std::string valueToQuotedString( const char *value ) // We have to walk value and escape any special characters. // Appending to std::string is not efficient, but this should be rare. // (Note: forward slashes are *not* rare, but I am not escaping them.) - std::string::size_type maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL + unsigned maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL std::string result; result.reserve(maxsize); // to avoid lots of mallocs result += "\""; @@ -222,10 +213,10 @@ FastWriter::writeValue( const Value &value ) document_ += "null"; break; case intValue: - document_ += valueToString( value.asLargestInt() ); + document_ += valueToString( value.asInt() ); break; case uintValue: - document_ += valueToString( value.asLargestUInt() ); + document_ += valueToString( value.asUInt() ); break; case realValue: document_ += valueToString( value.asDouble() ); @@ -305,10 +296,10 @@ StyledWriter::writeValue( const Value &value ) pushValue( "null" ); break; case intValue: - pushValue( valueToString( value.asLargestInt() ) ); + pushValue( valueToString( value.asInt() ) ); break; case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); + pushValue( valueToString( value.asUInt() ) ); break; case realValue: pushValue( valueToString( value.asDouble() ) ); @@ -332,7 +323,7 @@ StyledWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - for (;;) + while ( true ) { const std::string &name = *it; const Value &childValue = value[name]; @@ -372,7 +363,7 @@ StyledWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - for (;;) + while ( true ) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); @@ -581,10 +572,10 @@ StyledStreamWriter::writeValue( const Value &value ) pushValue( "null" ); break; case intValue: - pushValue( valueToString( value.asLargestInt() ) ); + pushValue( valueToString( value.asInt() ) ); break; case uintValue: - pushValue( valueToString( value.asLargestUInt() ) ); + pushValue( valueToString( value.asUInt() ) ); break; case realValue: pushValue( valueToString( value.asDouble() ) ); @@ -608,7 +599,7 @@ StyledStreamWriter::writeValue( const Value &value ) writeWithIndent( "{" ); indent(); Value::Members::iterator it = members.begin(); - for (;;) + while ( true ) { const std::string &name = *it; const Value &childValue = value[name]; @@ -648,7 +639,7 @@ StyledStreamWriter::writeArrayValue( const Value &value ) indent(); bool hasChildValue = !childValues_.empty(); unsigned index =0; - for (;;) + while ( true ) { const Value &childValue = value[index]; writeCommentBeforeValue( childValue ); @@ -656,7 +647,7 @@ StyledStreamWriter::writeArrayValue( const Value &value ) writeWithIndent( childValues_[index] ); else { - writeIndent(); + writeIndent(); writeValue( childValue ); } if ( ++index == size ) @@ -829,10 +820,10 @@ StyledStreamWriter::normalizeEOL( const std::string &text ) std::ostream& operator<<( std::ostream &sout, const Value &root ) { - CSJson::StyledStreamWriter writer; + Json::StyledStreamWriter writer; writer.write(sout, root); return sout; } -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/reader.h b/external/json/reader.h similarity index 82% rename from external/jsoncpp/reader.h rename to external/json/reader.h index cb58e864a0..ee1d6a2444 100644 --- a/external/jsoncpp/reader.h +++ b/external/json/reader.h @@ -1,21 +1,14 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_READER_H_INCLUDED # define CPPTL_JSON_READER_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "features.h" # include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include # include # include -namespace CSJson { +namespace Json { /** \brief Unserialize a JSON document into a Value. * @@ -51,9 +44,7 @@ namespace CSJson { bool collectComments = true ); /** \brief Read a Value from a JSON document. - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. - \ Must be >= beginDoc. + * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during @@ -67,7 +58,7 @@ namespace CSJson { bool collectComments = true ); /// \brief Parse from input stream. - /// \see CSJson::operator>>(std::istream&, CSJson::Value&). + /// \see Json::operator>>(std::istream&, Json::Value&). bool parse( std::istream &is, Value &root, bool collectComments = true ); @@ -76,18 +67,9 @@ namespace CSJson { * \return Formatted error message with the list of errors with their location in * the parsed document. An empty string is returned if no error occurred * during parsing. - * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ - JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - */ - std::string getFormattedErrorMessages() const; - private: enum TokenType { @@ -190,25 +172,25 @@ namespace CSJson { This can be used to read a file into a particular sub-object. For example: \code - CSJson::Value root; + Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } } \endverbatim \throw std::exception on parse error. - \see CSJson::operator<<() + \see Json::operator<<() */ std::istream& operator>>( std::istream&, Value& ); -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/external/jsoncpp/sconscript b/external/json/sconscript similarity index 100% rename from external/jsoncpp/sconscript rename to external/json/sconscript diff --git a/external/jsoncpp/value.h b/external/json/value.h similarity index 90% rename from external/jsoncpp/value.h rename to external/json/value.h index 73c612c94e..58bfd88e7a 100644 --- a/external/jsoncpp/value.h +++ b/external/json/value.h @@ -1,14 +1,7 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef CPPTL_JSON_H_INCLUDED # define CPPTL_JSON_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include @@ -23,7 +16,7 @@ /** \brief JSON (JavaScript Object Notation). */ -namespace CSJson { +namespace Json { /** \brief Type of the value held by a Value object. */ @@ -60,8 +53,8 @@ namespace CSJson { * * Example of usage: * \code - * CSJson::Value aValue( StaticString("some text") ); - * CSJson::Value object; + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode @@ -126,38 +119,15 @@ namespace CSJson { typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; - typedef CSJson::UInt UInt; - typedef CSJson::Int Int; -# if defined(JSON_HAS_INT64) - typedef CSJson::UInt64 UInt64; - typedef CSJson::Int64 Int64; -#endif // defined(JSON_HAS_INT64) - typedef CSJson::LargestInt LargestInt; - typedef CSJson::LargestUInt LargestUInt; - typedef CSJson::ArrayIndex ArrayIndex; + typedef Json::UInt UInt; + typedef Json::Int Int; + typedef UInt ArrayIndex; - static const Value jsonNull; - /// Minimum signed integer value that can be stored in a CSJson::Value. - static const LargestInt minLargestInt; - /// Maximum signed integer value that can be stored in a CSJson::Value. - static const LargestInt maxLargestInt; - /// Maximum unsigned integer value that can be stored in a CSJson::Value. - static const LargestUInt maxLargestUInt; - - /// Minimum signed int value that can be stored in a CSJson::Value. + static const Value null; static const Int minInt; - /// Maximum signed int value that can be stored in a CSJson::Value. static const Int maxInt; - /// Maximum unsigned int value that can be stored in a CSJson::Value. static const UInt maxUInt; - /// Minimum signed 64 bits int value that can be stored in a CSJson::Value. - static const Int64 minInt64; - /// Maximum signed 64 bits int value that can be stored in a CSJson::Value. - static const Int64 maxInt64; - /// Maximum unsigned 64 bits int value that can be stored in a CSJson::Value. - static const UInt64 maxUInt64; - private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION # ifndef JSON_VALUE_USE_INTERNAL_MAP @@ -170,20 +140,20 @@ namespace CSJson { duplicate, duplicateOnCopy }; - CZString( ArrayIndex index ); + CZString( int index ); CZString( const char *cstr, DuplicationPolicy allocate ); CZString( const CZString &other ); ~CZString(); CZString &operator =( const CZString &other ); bool operator<( const CZString &other ) const; bool operator==( const CZString &other ) const; - ArrayIndex index() const; + int index() const; const char *c_str() const; bool isStaticString() const; private: void swap( CZString &other ); const char *cstr_; - ArrayIndex index_; + int index_; }; public: @@ -202,22 +172,18 @@ namespace CSJson { To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. - This is useful since clear() and resize() will not alter types. + This is useful since clear() and resize() will not alter types. Examples: - \code - CSJson::Value null_value; // null - CSJson::Value arr_value(Json::arrayValue); // [] - CSJson::Value obj_value(Json::objectValue); // {} - \endcode + \code + Json::Value null_value; // null + Json::Value arr_value(Json::arrayValue); // [] + Json::Value obj_value(Json::objectValue); // {} + \endcode */ Value( ValueType type = nullValue ); Value( Int value ); Value( UInt value ); -#if defined(JSON_HAS_INT64) - Value( Int64 value ); - Value( UInt64 value ); -#endif // if defined(JSON_HAS_INT64) Value( double value ); Value( const char *value ); Value( const char *beginValue, const char *endValue ); @@ -228,7 +194,7 @@ namespace CSJson { * constructor. * Example of usage: * \code - * CSJson::Value aValue( StaticString("some text") ); + * Json::Value aValue( StaticString("some text") ); * \endcode */ Value( const StaticString &value ); @@ -256,7 +222,7 @@ namespace CSJson { bool operator ==( const Value &other ) const; bool operator !=( const Value &other ) const; - int compare( const Value &other ) const; + int compare( const Value &other ); const char *asCString() const; std::string asString() const; @@ -265,11 +231,6 @@ namespace CSJson { # endif Int asInt() const; UInt asUInt() const; - Int64 asInt64() const; - UInt64 asUInt64() const; - LargestInt asLargestInt() const; - LargestUInt asLargestUInt() const; - float asFloat() const; double asDouble() const; bool asBool() const; @@ -287,7 +248,7 @@ namespace CSJson { bool isConvertibleTo( ValueType other ) const; /// Number of values in array or object - ArrayIndex size() const; + UInt size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. @@ -306,38 +267,24 @@ namespace CSJson { /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue - void resize( ArrayIndex size ); + void resize( UInt size ); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) - Value &operator[]( ArrayIndex index ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( int index ); - + Value &operator[]( UInt index ); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) - const Value &operator[]( ArrayIndex index ) const; - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( int index ) const; - + const Value &operator[]( UInt index ) const; /// If the array contains at least index+1 elements, returns the element value, /// otherwise returns defaultValue. - Value get( ArrayIndex index, + Value get( UInt index, const Value &defaultValue ) const; /// Return true if index < size(). - bool isValidIndex( ArrayIndex index ) const; + bool isValidIndex( UInt index ) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; @@ -357,7 +304,7 @@ namespace CSJson { * the new entry is not duplicated. * Example of use: * \code - * CSJson::Value object; + * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode @@ -477,8 +424,8 @@ namespace CSJson { union ValueHolder { - LargestInt int_; - LargestUInt uint_; + Int int_; + UInt uint_; double real_; bool bool_; char *string_; @@ -507,7 +454,7 @@ namespace CSJson { friend class Path; PathArgument(); - PathArgument( ArrayIndex index ); + PathArgument( UInt index ); PathArgument( const char *key ); PathArgument( const std::string &key ); @@ -519,7 +466,7 @@ namespace CSJson { kindKey }; std::string key_; - ArrayIndex index_; + UInt index_; Kind kind_; }; @@ -566,7 +513,26 @@ namespace CSJson { Args args_; }; + /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value. + * + * - makeMemberName() and releaseMemberName() are called to respectively duplicate and + * free an Json::objectValue member name. + * - duplicateStringValue() and releaseStringValue() are called similarly to + * duplicate and free a Json::stringValue value. + */ + class ValueAllocator + { + public: + enum { unknown = (unsigned)-1 }; + virtual ~ValueAllocator(); + + virtual char *makeMemberName( const char *memberName ) = 0; + virtual void releaseMemberName( char *memberName ) = 0; + virtual char *duplicateStringValue( const char *value, + unsigned int length = unknown ) = 0; + virtual void releaseStringValue( char *value ) = 0; + }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. @@ -1097,7 +1063,7 @@ public: // overridden from ValueArrayAllocator }; -} // namespace CSJson +} // namespace Json #endif // CPPTL_JSON_H_INCLUDED diff --git a/external/jsoncpp/writer.h b/external/json/writer.h similarity index 91% rename from external/jsoncpp/writer.h rename to external/json/writer.h index d8f057a211..5f4b83be41 100644 --- a/external/jsoncpp/writer.h +++ b/external/json/writer.h @@ -1,19 +1,12 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - #ifndef JSON_WRITER_H_INCLUDED # define JSON_WRITER_H_INCLUDED -#if !defined(JSON_IS_AMALGAMATION) # include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) # include # include # include -namespace CSJson { +namespace Json { class Value; @@ -164,21 +157,17 @@ namespace CSJson { bool addChildValues_; }; -# if defined(JSON_HAS_INT64) std::string JSON_API valueToString( Int value ); std::string JSON_API valueToString( UInt value ); -# endif // if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( LargestInt value ); - std::string JSON_API valueToString( LargestUInt value ); std::string JSON_API valueToString( double value ); std::string JSON_API valueToString( bool value ); std::string JSON_API valueToQuotedString( const char *value ); /// \brief Output using the StyledStreamWriter. - /// \see CSJson::operator>>() + /// \see Json::operator>>() std::ostream& operator<<( std::ostream&, const Value &root ); -} // namespace CSJson +} // namespace Json diff --git a/external/jsoncpp/config.h b/external/jsoncpp/config.h deleted file mode 100644 index 16a7e0d2c4..0000000000 --- a/external/jsoncpp/config.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -/// If defined, indicates that Json use exception to report invalid type manipulation -/// instead of C assert macro. -# define JSON_USE_EXCEPTION 1 - -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -/// Remarks: it is automatically defined in the generated amalgated header. -// #define JSON_IS_AMALGAMATION - - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 - -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 -// Microsoft Visual Studio 6 only support conversion from __int64 to double -// (no conversion from unsigned __int64). -#define JSON_USE_INT64_DOUBLE_CONVERSION 1 -#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 - -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 -/// Indicates that the following function is deprecated. -# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) -#endif - -#if !defined(JSONCPP_DEPRECATED) -# define JSONCPP_DEPRECATED(message) -#endif // if !defined(JSONCPP_DEPRECATED) - -namespace CSJson { - typedef int Int; - typedef unsigned int UInt; -# if defined(JSON_NO_INT64) - typedef int LargestInt; - typedef unsigned int LargestUInt; -# undef JSON_HAS_INT64 -# else // if defined(JSON_NO_INT64) - // For Microsoft Visual use specific types as long long is not supported -# if defined(_MSC_VER) // Microsoft Visual Studio - typedef __int64 Int64; - typedef unsigned __int64 UInt64; -# else // if defined(_MSC_VER) // Other platforms, use long long - typedef long long int Int64; - typedef unsigned long long int UInt64; -# endif // if defined(_MSC_VER) - typedef Int64 LargestInt; - typedef UInt64 LargestUInt; -# define JSON_HAS_INT64 -# endif // if defined(JSON_NO_INT64) -} // end namespace CSJson - - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/external/jsoncpp/json_lib.h b/external/jsoncpp/json_lib.h deleted file mode 100644 index da5fc967eb..0000000000 --- a/external/jsoncpp/json_lib.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_JSON_H_INCLUDED -# define JSON_JSON_H_INCLUDED - -# include "autolink.h" -# include "value.h" -# include "reader.h" -# include "writer.h" -# include "features.h" - -#endif // JSON_JSON_H_INCLUDED diff --git a/external/jsoncpp/json_tool.h b/external/jsoncpp/json_tool.h deleted file mode 100644 index 4641ad5953..0000000000 --- a/external/jsoncpp/json_tool.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED -# define LIB_JSONCPP_JSON_TOOL_H_INCLUDED - -/* This header provides common string manipulation support, such as UTF-8, - * portable conversion from/to string... - * - * It is an internal header that must not be exposed. - */ - -namespace CSJson { - -/// Converts a unicode code-point to UTF-8. -static inline std::string -codePointToUTF8(unsigned int cp) -{ - std::string result; - - // based on description from http://en.wikipedia.org/wiki/UTF-8 - - if (cp <= 0x7f) - { - result.resize(1); - result[0] = static_cast(cp); - } - else if (cp <= 0x7FF) - { - result.resize(2); - result[1] = static_cast(0x80 | (0x3f & cp)); - result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); - } - else if (cp <= 0xFFFF) - { - result.resize(3); - result[2] = static_cast(0x80 | (0x3f & cp)); - result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); - result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); - } - else if (cp <= 0x10FFFF) - { - result.resize(4); - result[3] = static_cast(0x80 | (0x3f & cp)); - result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); - result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); - result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); - } - - return result; -} - - -/// Returns true if ch is a control character (in range [0,32[). -static inline bool -isControlCharacter(char ch) -{ - return ch > 0 && ch <= 0x1F; -} - - -enum { - /// Constant that specify the size of the buffer that must be passed to uintToString. - uintToStringBufferSize = 3*sizeof(LargestUInt)+1 -}; - -// Defines a char buffer for use with uintToString(). -typedef char UIntToStringBuffer[uintToStringBufferSize]; - - -/** Converts an unsigned integer to string. - * @param value Unsigned interger to convert to string - * @param current Input/Output string buffer. - * Must have at least uintToStringBufferSize chars free. - */ -static inline void -uintToString( LargestUInt value, - char *¤t ) -{ - *--current = 0; - do - { - *--current = char(value % 10) + '0'; - value /= 10; - } - while ( value != 0 ); -} - -} // namespace CSJson { - -#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED diff --git a/cocos/scripting/lua/lua/lapi.c b/external/lua/lua/lapi.c similarity index 100% rename from cocos/scripting/lua/lua/lapi.c rename to external/lua/lua/lapi.c diff --git a/cocos/scripting/lua/lua/lapi.h b/external/lua/lua/lapi.h similarity index 100% rename from cocos/scripting/lua/lua/lapi.h rename to external/lua/lua/lapi.h diff --git a/cocos/scripting/lua/lua/lauxlib.c b/external/lua/lua/lauxlib.c similarity index 100% rename from cocos/scripting/lua/lua/lauxlib.c rename to external/lua/lua/lauxlib.c diff --git a/cocos/scripting/lua/lua/lauxlib.h b/external/lua/lua/lauxlib.h similarity index 100% rename from cocos/scripting/lua/lua/lauxlib.h rename to external/lua/lua/lauxlib.h diff --git a/cocos/scripting/lua/lua/lbaselib.c b/external/lua/lua/lbaselib.c similarity index 100% rename from cocos/scripting/lua/lua/lbaselib.c rename to external/lua/lua/lbaselib.c diff --git a/cocos/scripting/lua/lua/lcode.c b/external/lua/lua/lcode.c similarity index 100% rename from cocos/scripting/lua/lua/lcode.c rename to external/lua/lua/lcode.c diff --git a/cocos/scripting/lua/lua/lcode.h b/external/lua/lua/lcode.h similarity index 100% rename from cocos/scripting/lua/lua/lcode.h rename to external/lua/lua/lcode.h diff --git a/cocos/scripting/lua/lua/ldblib.c b/external/lua/lua/ldblib.c similarity index 100% rename from cocos/scripting/lua/lua/ldblib.c rename to external/lua/lua/ldblib.c diff --git a/cocos/scripting/lua/lua/ldebug.c b/external/lua/lua/ldebug.c similarity index 100% rename from cocos/scripting/lua/lua/ldebug.c rename to external/lua/lua/ldebug.c diff --git a/cocos/scripting/lua/lua/ldebug.h b/external/lua/lua/ldebug.h similarity index 100% rename from cocos/scripting/lua/lua/ldebug.h rename to external/lua/lua/ldebug.h diff --git a/cocos/scripting/lua/lua/ldo.c b/external/lua/lua/ldo.c similarity index 100% rename from cocos/scripting/lua/lua/ldo.c rename to external/lua/lua/ldo.c diff --git a/cocos/scripting/lua/lua/ldo.h b/external/lua/lua/ldo.h similarity index 100% rename from cocos/scripting/lua/lua/ldo.h rename to external/lua/lua/ldo.h diff --git a/cocos/scripting/lua/lua/ldump.c b/external/lua/lua/ldump.c similarity index 100% rename from cocos/scripting/lua/lua/ldump.c rename to external/lua/lua/ldump.c diff --git a/cocos/scripting/lua/lua/lfunc.c b/external/lua/lua/lfunc.c similarity index 100% rename from cocos/scripting/lua/lua/lfunc.c rename to external/lua/lua/lfunc.c diff --git a/cocos/scripting/lua/lua/lfunc.h b/external/lua/lua/lfunc.h similarity index 100% rename from cocos/scripting/lua/lua/lfunc.h rename to external/lua/lua/lfunc.h diff --git a/cocos/scripting/lua/lua/lgc.c b/external/lua/lua/lgc.c similarity index 100% rename from cocos/scripting/lua/lua/lgc.c rename to external/lua/lua/lgc.c diff --git a/cocos/scripting/lua/lua/lgc.h b/external/lua/lua/lgc.h similarity index 100% rename from cocos/scripting/lua/lua/lgc.h rename to external/lua/lua/lgc.h diff --git a/cocos/scripting/lua/lua/linit.c b/external/lua/lua/linit.c similarity index 100% rename from cocos/scripting/lua/lua/linit.c rename to external/lua/lua/linit.c diff --git a/cocos/scripting/lua/lua/liolib.c b/external/lua/lua/liolib.c similarity index 100% rename from cocos/scripting/lua/lua/liolib.c rename to external/lua/lua/liolib.c diff --git a/cocos/scripting/lua/lua/llex.c b/external/lua/lua/llex.c similarity index 100% rename from cocos/scripting/lua/lua/llex.c rename to external/lua/lua/llex.c diff --git a/cocos/scripting/lua/lua/llex.h b/external/lua/lua/llex.h similarity index 100% rename from cocos/scripting/lua/lua/llex.h rename to external/lua/lua/llex.h diff --git a/cocos/scripting/lua/lua/llimits.h b/external/lua/lua/llimits.h similarity index 100% rename from cocos/scripting/lua/lua/llimits.h rename to external/lua/lua/llimits.h diff --git a/cocos/scripting/lua/lua/lmathlib.c b/external/lua/lua/lmathlib.c similarity index 100% rename from cocos/scripting/lua/lua/lmathlib.c rename to external/lua/lua/lmathlib.c diff --git a/cocos/scripting/lua/lua/lmem.c b/external/lua/lua/lmem.c similarity index 100% rename from cocos/scripting/lua/lua/lmem.c rename to external/lua/lua/lmem.c diff --git a/cocos/scripting/lua/lua/lmem.h b/external/lua/lua/lmem.h similarity index 100% rename from cocos/scripting/lua/lua/lmem.h rename to external/lua/lua/lmem.h diff --git a/cocos/scripting/lua/lua/loadlib.c b/external/lua/lua/loadlib.c similarity index 100% rename from cocos/scripting/lua/lua/loadlib.c rename to external/lua/lua/loadlib.c diff --git a/cocos/scripting/lua/lua/lobject.c b/external/lua/lua/lobject.c similarity index 100% rename from cocos/scripting/lua/lua/lobject.c rename to external/lua/lua/lobject.c diff --git a/cocos/scripting/lua/lua/lobject.h b/external/lua/lua/lobject.h similarity index 100% rename from cocos/scripting/lua/lua/lobject.h rename to external/lua/lua/lobject.h diff --git a/cocos/scripting/lua/lua/lopcodes.c b/external/lua/lua/lopcodes.c similarity index 100% rename from cocos/scripting/lua/lua/lopcodes.c rename to external/lua/lua/lopcodes.c diff --git a/cocos/scripting/lua/lua/lopcodes.h b/external/lua/lua/lopcodes.h similarity index 100% rename from cocos/scripting/lua/lua/lopcodes.h rename to external/lua/lua/lopcodes.h diff --git a/cocos/scripting/lua/lua/loslib.c b/external/lua/lua/loslib.c similarity index 100% rename from cocos/scripting/lua/lua/loslib.c rename to external/lua/lua/loslib.c diff --git a/cocos/scripting/lua/lua/lparser.c b/external/lua/lua/lparser.c similarity index 100% rename from cocos/scripting/lua/lua/lparser.c rename to external/lua/lua/lparser.c diff --git a/cocos/scripting/lua/lua/lparser.h b/external/lua/lua/lparser.h similarity index 100% rename from cocos/scripting/lua/lua/lparser.h rename to external/lua/lua/lparser.h diff --git a/cocos/scripting/lua/lua/lstate.c b/external/lua/lua/lstate.c similarity index 100% rename from cocos/scripting/lua/lua/lstate.c rename to external/lua/lua/lstate.c diff --git a/cocos/scripting/lua/lua/lstate.h b/external/lua/lua/lstate.h similarity index 100% rename from cocos/scripting/lua/lua/lstate.h rename to external/lua/lua/lstate.h diff --git a/cocos/scripting/lua/lua/lstring.c b/external/lua/lua/lstring.c similarity index 100% rename from cocos/scripting/lua/lua/lstring.c rename to external/lua/lua/lstring.c diff --git a/cocos/scripting/lua/lua/lstring.h b/external/lua/lua/lstring.h similarity index 100% rename from cocos/scripting/lua/lua/lstring.h rename to external/lua/lua/lstring.h diff --git a/cocos/scripting/lua/lua/lstrlib.c b/external/lua/lua/lstrlib.c similarity index 100% rename from cocos/scripting/lua/lua/lstrlib.c rename to external/lua/lua/lstrlib.c diff --git a/cocos/scripting/lua/lua/ltable.c b/external/lua/lua/ltable.c similarity index 100% rename from cocos/scripting/lua/lua/ltable.c rename to external/lua/lua/ltable.c diff --git a/cocos/scripting/lua/lua/ltable.h b/external/lua/lua/ltable.h similarity index 100% rename from cocos/scripting/lua/lua/ltable.h rename to external/lua/lua/ltable.h diff --git a/cocos/scripting/lua/lua/ltablib.c b/external/lua/lua/ltablib.c similarity index 100% rename from cocos/scripting/lua/lua/ltablib.c rename to external/lua/lua/ltablib.c diff --git a/cocos/scripting/lua/lua/ltm.c b/external/lua/lua/ltm.c similarity index 100% rename from cocos/scripting/lua/lua/ltm.c rename to external/lua/lua/ltm.c diff --git a/cocos/scripting/lua/lua/ltm.h b/external/lua/lua/ltm.h similarity index 100% rename from cocos/scripting/lua/lua/ltm.h rename to external/lua/lua/ltm.h diff --git a/cocos/scripting/lua/lua/lua.c b/external/lua/lua/lua.c similarity index 100% rename from cocos/scripting/lua/lua/lua.c rename to external/lua/lua/lua.c diff --git a/cocos/scripting/lua/lua/lua.h b/external/lua/lua/lua.h similarity index 100% rename from cocos/scripting/lua/lua/lua.h rename to external/lua/lua/lua.h diff --git a/cocos/scripting/lua/lua/luaconf.h b/external/lua/lua/luaconf.h similarity index 100% rename from cocos/scripting/lua/lua/luaconf.h rename to external/lua/lua/luaconf.h diff --git a/cocos/scripting/lua/lua/lualib.h b/external/lua/lua/lualib.h similarity index 100% rename from cocos/scripting/lua/lua/lualib.h rename to external/lua/lua/lualib.h diff --git a/cocos/scripting/lua/lua/lundump.c b/external/lua/lua/lundump.c similarity index 100% rename from cocos/scripting/lua/lua/lundump.c rename to external/lua/lua/lundump.c diff --git a/cocos/scripting/lua/lua/lundump.h b/external/lua/lua/lundump.h similarity index 100% rename from cocos/scripting/lua/lua/lundump.h rename to external/lua/lua/lundump.h diff --git a/cocos/scripting/lua/lua/lvm.c b/external/lua/lua/lvm.c similarity index 100% rename from cocos/scripting/lua/lua/lvm.c rename to external/lua/lua/lvm.c diff --git a/cocos/scripting/lua/lua/lvm.h b/external/lua/lua/lvm.h similarity index 100% rename from cocos/scripting/lua/lua/lvm.h rename to external/lua/lua/lvm.h diff --git a/cocos/scripting/lua/lua/lzio.c b/external/lua/lua/lzio.c similarity index 100% rename from cocos/scripting/lua/lua/lzio.c rename to external/lua/lua/lzio.c diff --git a/cocos/scripting/lua/lua/lzio.h b/external/lua/lua/lzio.h similarity index 100% rename from cocos/scripting/lua/lua/lzio.h rename to external/lua/lua/lzio.h diff --git a/cocos/scripting/lua/lua/print.c b/external/lua/lua/print.c similarity index 100% rename from cocos/scripting/lua/lua/print.c rename to external/lua/lua/print.c diff --git a/cocos/scripting/lua/luajit/Android.mk b/external/lua/luajit/Android.mk similarity index 100% rename from cocos/scripting/lua/luajit/Android.mk rename to external/lua/luajit/Android.mk diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT b/external/lua/luajit/LuaJIT-2.0.1/COPYRIGHT similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/COPYRIGHT rename to external/lua/luajit/LuaJIT-2.0.1/COPYRIGHT diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile b/external/lua/luajit/LuaJIT-2.0.1/Makefile similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/Makefile rename to external/lua/luajit/LuaJIT-2.0.1/Makefile diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/README b/external/lua/luajit/LuaJIT-2.0.1/README similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/README rename to external/lua/luajit/LuaJIT-2.0.1/README diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css b/external/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css rename to external/lua/luajit/LuaJIT-2.0.1/doc/bluequad-print.css diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css b/external/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css rename to external/lua/luajit/LuaJIT-2.0.1/doc/bluequad.css diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html b/external/lua/luajit/LuaJIT-2.0.1/doc/changes.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/changes.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/changes.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html b/external/lua/luajit/LuaJIT-2.0.1/doc/contact.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/contact.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/contact.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_c_api.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_api.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_semantics.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_ffi_tutorial.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html b/external/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/ext_jit.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html b/external/lua/luajit/LuaJIT-2.0.1/doc/extensions.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/extensions.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/extensions.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html b/external/lua/luajit/LuaJIT-2.0.1/doc/faq.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/faq.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/faq.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html b/external/lua/luajit/LuaJIT-2.0.1/doc/install.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/install.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/install.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html b/external/lua/luajit/LuaJIT-2.0.1/doc/luajit.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/luajit.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/luajit.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html b/external/lua/luajit/LuaJIT-2.0.1/doc/running.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/running.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/running.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html b/external/lua/luajit/LuaJIT-2.0.1/doc/status.html similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/doc/status.html rename to external/lua/luajit/LuaJIT-2.0.1/doc/status.html diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_arm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_mips.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_ppc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_proto.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x64.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dasm_x86.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua b/external/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua rename to external/lua/luajit/LuaJIT-2.0.1/dynasm/dynasm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 b/external/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 rename to external/lua/luajit/LuaJIT-2.0.1/etc/luajit.1 diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc b/external/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc rename to external/lua/luajit/LuaJIT-2.0.1/etc/luajit.pc diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile b/external/lua/luajit/LuaJIT-2.0.1/src/Makefile similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile rename to external/lua/luajit/LuaJIT-2.0.1/src/Makefile diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep b/external/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep rename to external/lua/luajit/LuaJIT-2.0.1/src/Makefile.dep diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README b/external/lua/luajit/LuaJIT-2.0.1/src/host/README similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/README rename to external/lua/luajit/LuaJIT-2.0.1/src/host/README diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_asm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_fold.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_lib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c b/external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c rename to external/lua/luajit/LuaJIT-2.0.1/src/host/buildvm_peobj.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua b/external/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/host/genminilua.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/host/minilua.c.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/bc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/bcsave.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_arm.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mips.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_mipsel.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_ppc.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x64.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dis_x86.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/dump.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua b/external/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua rename to external/lua/luajit/LuaJIT-2.0.1/src/jit/v.lua diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lauxlib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_aux.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_base.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_base.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_base.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_bit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_debug.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_ffi.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_init.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_init.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_init.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_io.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_io.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_io.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_jit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_math.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_math.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_math.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_os.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_os.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_os.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_package.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_package.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_package.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_string.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_string.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_string.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c b/external/lua/luajit/LuaJIT-2.0.1/src/lib_table.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lib_table.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lib_table.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp b/external/lua/luajit/LuaJIT-2.0.1/src/lj.supp similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj.supp rename to external/lua/luajit/LuaJIT-2.0.1/src/lj.supp diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_alloc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_api.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_api.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_api.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_arch.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_asm_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcdump.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcread.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_bcwrite.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_carith.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccall.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ccallback.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cconv.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cdata.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_char.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_char.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_char.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_char.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_char.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_clib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_cparse.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_crecord.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ctype.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_debug.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_def.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_def.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_def.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_dispatch.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_emit_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_err.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_err.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_err.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_err.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_err.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_errmsg.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ff.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ffrecord.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_frame.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_func.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_func.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_func.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_func.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_func.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_gdbjit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ir.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_ircall.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_iropt.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_jit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lex.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_lib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_load.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_load.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_load.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_mcode.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_meta.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_obj.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_dce.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_fold.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_loop.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_mem.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_narrow.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_sink.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_opt_split.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_parse.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_record.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_record.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_record.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_record.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_record.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_snap.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_state.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_state.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_state.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_state.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_state.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_str.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_str.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_str.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_str.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_str.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_strscan.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_tab.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_arm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_mips.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_ppc.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_target_x86.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_trace.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_traceerr.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_udata.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vm.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmevent.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c b/external/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c rename to external/lua/luajit/LuaJIT-2.0.1/src/lj_vmmath.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c b/external/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c rename to external/lua/luajit/LuaJIT-2.0.1/src/ljamalg.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h b/external/lua/luajit/LuaJIT-2.0.1/src/lua.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lua.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp b/external/lua/luajit/LuaJIT-2.0.1/src/lua.hpp similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lua.hpp rename to external/lua/luajit/LuaJIT-2.0.1/src/lua.hpp diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h b/external/lua/luajit/LuaJIT-2.0.1/src/luaconf.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luaconf.h rename to external/lua/luajit/LuaJIT-2.0.1/src/luaconf.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c b/external/lua/luajit/LuaJIT-2.0.1/src/luajit.c similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.c rename to external/lua/luajit/LuaJIT-2.0.1/src/luajit.c diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h b/external/lua/luajit/LuaJIT-2.0.1/src/luajit.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/luajit.h rename to external/lua/luajit/LuaJIT-2.0.1/src/luajit.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h b/external/lua/luajit/LuaJIT-2.0.1/src/lualib.h similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/lualib.h rename to external/lua/luajit/LuaJIT-2.0.1/src/lualib.h diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat b/external/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat rename to external/lua/luajit/LuaJIT-2.0.1/src/msvcbuild.bat diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_arm.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_mips.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_ppc.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_ppcspe.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id b/external/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id rename to external/lua/luajit/LuaJIT-2.0.1/src/vm_x86.dasc.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat b/external/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat rename to external/lua/luajit/LuaJIT-2.0.1/src/xedkbuild.bat diff --git a/cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch b/external/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch similarity index 100% rename from cocos/scripting/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch rename to external/lua/luajit/LuaJIT-2.0.1/v2.0.1_hotfix1.patch diff --git a/cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/armeabi-v7a/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/armeabi/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id b/external/lua/luajit/android/x86/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/android/x86/libluajit.a.REMOVED.git-id rename to external/lua/luajit/android/x86/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/build_android.sh b/external/lua/luajit/build_android.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_android.sh rename to external/lua/luajit/build_android.sh diff --git a/cocos/scripting/lua/luajit/build_ios.sh b/external/lua/luajit/build_ios.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_ios.sh rename to external/lua/luajit/build_ios.sh diff --git a/cocos/scripting/lua/luajit/build_mac.sh b/external/lua/luajit/build_mac.sh similarity index 100% rename from cocos/scripting/lua/luajit/build_mac.sh rename to external/lua/luajit/build_mac.sh diff --git a/cocos/scripting/lua/luajit/include/lauxlib.h b/external/lua/luajit/include/lauxlib.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lauxlib.h rename to external/lua/luajit/include/lauxlib.h diff --git a/cocos/scripting/lua/luajit/include/lua.h b/external/lua/luajit/include/lua.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lua.h rename to external/lua/luajit/include/lua.h diff --git a/cocos/scripting/lua/luajit/include/luaconf.h b/external/lua/luajit/include/luaconf.h similarity index 100% rename from cocos/scripting/lua/luajit/include/luaconf.h rename to external/lua/luajit/include/luaconf.h diff --git a/cocos/scripting/lua/luajit/include/lualib.h b/external/lua/luajit/include/lualib.h similarity index 100% rename from cocos/scripting/lua/luajit/include/lualib.h rename to external/lua/luajit/include/lualib.h diff --git a/cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id b/external/lua/luajit/ios/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/ios/libluajit.a.REMOVED.git-id rename to external/lua/luajit/ios/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id b/external/lua/luajit/mac/libluajit.a.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/mac/libluajit.a.REMOVED.git-id rename to external/lua/luajit/mac/libluajit.a.REMOVED.git-id diff --git a/cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id b/external/lua/luajit/win32/lua51.dll.REMOVED.git-id similarity index 100% rename from cocos/scripting/lua/luajit/win32/lua51.dll.REMOVED.git-id rename to external/lua/luajit/win32/lua51.dll.REMOVED.git-id diff --git a/cocos/scripting/lua/tolua/tolua++.h b/external/lua/tolua/tolua++.h similarity index 100% rename from cocos/scripting/lua/tolua/tolua++.h rename to external/lua/tolua/tolua++.h diff --git a/cocos/scripting/lua/tolua/tolua_event.c b/external/lua/tolua/tolua_event.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_event.c rename to external/lua/tolua/tolua_event.c diff --git a/cocos/scripting/lua/tolua/tolua_event.h b/external/lua/tolua/tolua_event.h similarity index 100% rename from cocos/scripting/lua/tolua/tolua_event.h rename to external/lua/tolua/tolua_event.h diff --git a/cocos/scripting/lua/tolua/tolua_is.c b/external/lua/tolua/tolua_is.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_is.c rename to external/lua/tolua/tolua_is.c diff --git a/cocos/scripting/lua/tolua/tolua_map.c b/external/lua/tolua/tolua_map.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_map.c rename to external/lua/tolua/tolua_map.c diff --git a/cocos/scripting/lua/tolua/tolua_push.c b/external/lua/tolua/tolua_push.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_push.c rename to external/lua/tolua/tolua_push.c diff --git a/cocos/scripting/lua/tolua/tolua_to.c b/external/lua/tolua/tolua_to.c similarity index 100% rename from cocos/scripting/lua/tolua/tolua_to.c rename to external/lua/tolua/tolua_to.c diff --git a/external/png/include/andorid/png.h.REMOVED.git-id b/external/png/include/android/png.h.REMOVED.git-id similarity index 100% rename from external/png/include/andorid/png.h.REMOVED.git-id rename to external/png/include/android/png.h.REMOVED.git-id diff --git a/external/png/include/andorid/pngconf.h b/external/png/include/android/pngconf.h similarity index 100% rename from external/png/include/andorid/pngconf.h rename to external/png/include/android/pngconf.h diff --git a/external/png/include/andorid/pnglibconf.h b/external/png/include/android/pnglibconf.h similarity index 100% rename from external/png/include/andorid/pnglibconf.h rename to external/png/include/android/pnglibconf.h diff --git a/external/png/prebuilt/andorid/Android.mk b/external/png/prebuilt/android/Android.mk similarity index 58% rename from external/png/prebuilt/andorid/Android.mk rename to external/png/prebuilt/android/Android.mk index b15dc34b96..41a0f91322 100644 --- a/external/png/prebuilt/andorid/Android.mk +++ b/external/png/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libpng_static LOCAL_MODULE_FILENAME := png -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libpng.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libpng.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/armeabi-v7a/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/armeabi-v7a/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/armeabi-v7a/libpng.a.REMOVED.git-id diff --git a/external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/armeabi/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/armeabi/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/armeabi/libpng.a.REMOVED.git-id diff --git a/external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id b/external/png/prebuilt/android/x86/libpng.a.REMOVED.git-id similarity index 100% rename from external/png/prebuilt/andorid/x86/libpng.a.REMOVED.git-id rename to external/png/prebuilt/android/x86/libpng.a.REMOVED.git-id diff --git a/external/spidermonkey/include/andorid/js-config.h b/external/spidermonkey/include/android/js-config.h similarity index 100% rename from external/spidermonkey/include/andorid/js-config.h rename to external/spidermonkey/include/android/js-config.h diff --git a/external/spidermonkey/include/andorid/js.msg b/external/spidermonkey/include/android/js.msg similarity index 100% rename from external/spidermonkey/include/andorid/js.msg rename to external/spidermonkey/include/android/js.msg diff --git a/external/spidermonkey/include/andorid/js/Anchor.h b/external/spidermonkey/include/android/js/Anchor.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Anchor.h rename to external/spidermonkey/include/android/js/Anchor.h diff --git a/external/spidermonkey/include/andorid/js/CallArgs.h b/external/spidermonkey/include/android/js/CallArgs.h similarity index 100% rename from external/spidermonkey/include/andorid/js/CallArgs.h rename to external/spidermonkey/include/android/js/CallArgs.h diff --git a/external/spidermonkey/include/andorid/js/CharacterEncoding.h b/external/spidermonkey/include/android/js/CharacterEncoding.h similarity index 100% rename from external/spidermonkey/include/andorid/js/CharacterEncoding.h rename to external/spidermonkey/include/android/js/CharacterEncoding.h diff --git a/external/spidermonkey/include/andorid/js/Date.h b/external/spidermonkey/include/android/js/Date.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Date.h rename to external/spidermonkey/include/android/js/Date.h diff --git a/external/spidermonkey/include/andorid/js/GCAPI.h b/external/spidermonkey/include/android/js/GCAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/GCAPI.h rename to external/spidermonkey/include/android/js/GCAPI.h diff --git a/external/spidermonkey/include/andorid/js/HashTable.h b/external/spidermonkey/include/android/js/HashTable.h similarity index 100% rename from external/spidermonkey/include/andorid/js/HashTable.h rename to external/spidermonkey/include/android/js/HashTable.h diff --git a/external/spidermonkey/include/andorid/js/HeapAPI.h b/external/spidermonkey/include/android/js/HeapAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/HeapAPI.h rename to external/spidermonkey/include/android/js/HeapAPI.h diff --git a/external/spidermonkey/include/andorid/js/LegacyIntTypes.h b/external/spidermonkey/include/android/js/LegacyIntTypes.h similarity index 100% rename from external/spidermonkey/include/andorid/js/LegacyIntTypes.h rename to external/spidermonkey/include/android/js/LegacyIntTypes.h diff --git a/external/spidermonkey/include/andorid/js/MemoryMetrics.h b/external/spidermonkey/include/android/js/MemoryMetrics.h similarity index 100% rename from external/spidermonkey/include/andorid/js/MemoryMetrics.h rename to external/spidermonkey/include/android/js/MemoryMetrics.h diff --git a/external/spidermonkey/include/andorid/js/PropertyKey.h b/external/spidermonkey/include/android/js/PropertyKey.h similarity index 100% rename from external/spidermonkey/include/andorid/js/PropertyKey.h rename to external/spidermonkey/include/android/js/PropertyKey.h diff --git a/external/spidermonkey/include/andorid/js/RequiredDefines.h b/external/spidermonkey/include/android/js/RequiredDefines.h similarity index 100% rename from external/spidermonkey/include/andorid/js/RequiredDefines.h rename to external/spidermonkey/include/android/js/RequiredDefines.h diff --git a/external/spidermonkey/include/andorid/js/RootingAPI.h b/external/spidermonkey/include/android/js/RootingAPI.h similarity index 100% rename from external/spidermonkey/include/andorid/js/RootingAPI.h rename to external/spidermonkey/include/android/js/RootingAPI.h diff --git a/external/spidermonkey/include/andorid/js/TemplateLib.h b/external/spidermonkey/include/android/js/TemplateLib.h similarity index 100% rename from external/spidermonkey/include/andorid/js/TemplateLib.h rename to external/spidermonkey/include/android/js/TemplateLib.h diff --git a/external/spidermonkey/include/andorid/js/Utility.h b/external/spidermonkey/include/android/js/Utility.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Utility.h rename to external/spidermonkey/include/android/js/Utility.h diff --git a/external/spidermonkey/include/andorid/js/Value.h b/external/spidermonkey/include/android/js/Value.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Value.h rename to external/spidermonkey/include/android/js/Value.h diff --git a/external/spidermonkey/include/andorid/js/Vector.h b/external/spidermonkey/include/android/js/Vector.h similarity index 100% rename from external/spidermonkey/include/andorid/js/Vector.h rename to external/spidermonkey/include/android/js/Vector.h diff --git a/external/spidermonkey/include/andorid/jsalloc.h b/external/spidermonkey/include/android/jsalloc.h similarity index 100% rename from external/spidermonkey/include/andorid/jsalloc.h rename to external/spidermonkey/include/android/jsalloc.h diff --git a/external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id b/external/spidermonkey/include/android/jsapi.h.REMOVED.git-id similarity index 100% rename from external/spidermonkey/include/andorid/jsapi.h.REMOVED.git-id rename to external/spidermonkey/include/android/jsapi.h.REMOVED.git-id diff --git a/external/spidermonkey/include/andorid/jsclass.h b/external/spidermonkey/include/android/jsclass.h similarity index 100% rename from external/spidermonkey/include/andorid/jsclass.h rename to external/spidermonkey/include/android/jsclass.h diff --git a/external/spidermonkey/include/andorid/jsclist.h b/external/spidermonkey/include/android/jsclist.h similarity index 100% rename from external/spidermonkey/include/andorid/jsclist.h rename to external/spidermonkey/include/android/jsclist.h diff --git a/external/spidermonkey/include/andorid/jscpucfg.h b/external/spidermonkey/include/android/jscpucfg.h similarity index 100% rename from external/spidermonkey/include/andorid/jscpucfg.h rename to external/spidermonkey/include/android/jscpucfg.h diff --git a/external/spidermonkey/include/andorid/jsdbgapi.h b/external/spidermonkey/include/android/jsdbgapi.h similarity index 100% rename from external/spidermonkey/include/andorid/jsdbgapi.h rename to external/spidermonkey/include/android/jsdbgapi.h diff --git a/external/spidermonkey/include/andorid/jsdhash.h b/external/spidermonkey/include/android/jsdhash.h similarity index 100% rename from external/spidermonkey/include/andorid/jsdhash.h rename to external/spidermonkey/include/android/jsdhash.h diff --git a/external/spidermonkey/include/andorid/jsfriendapi.h b/external/spidermonkey/include/android/jsfriendapi.h similarity index 100% rename from external/spidermonkey/include/andorid/jsfriendapi.h rename to external/spidermonkey/include/android/jsfriendapi.h diff --git a/external/spidermonkey/include/andorid/jslock.h b/external/spidermonkey/include/android/jslock.h similarity index 100% rename from external/spidermonkey/include/andorid/jslock.h rename to external/spidermonkey/include/android/jslock.h diff --git a/external/spidermonkey/include/andorid/json.h b/external/spidermonkey/include/android/json.h similarity index 100% rename from external/spidermonkey/include/andorid/json.h rename to external/spidermonkey/include/android/json.h diff --git a/external/spidermonkey/include/andorid/jsperf.h b/external/spidermonkey/include/android/jsperf.h similarity index 100% rename from external/spidermonkey/include/andorid/jsperf.h rename to external/spidermonkey/include/android/jsperf.h diff --git a/external/spidermonkey/include/andorid/jsprf.h b/external/spidermonkey/include/android/jsprf.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprf.h rename to external/spidermonkey/include/android/jsprf.h diff --git a/external/spidermonkey/include/andorid/jsprototypes.h b/external/spidermonkey/include/android/jsprototypes.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprototypes.h rename to external/spidermonkey/include/android/jsprototypes.h diff --git a/external/spidermonkey/include/andorid/jsproxy.h b/external/spidermonkey/include/android/jsproxy.h similarity index 100% rename from external/spidermonkey/include/andorid/jsproxy.h rename to external/spidermonkey/include/android/jsproxy.h diff --git a/external/spidermonkey/include/andorid/jsprvtd.h b/external/spidermonkey/include/android/jsprvtd.h similarity index 100% rename from external/spidermonkey/include/andorid/jsprvtd.h rename to external/spidermonkey/include/android/jsprvtd.h diff --git a/external/spidermonkey/include/andorid/jspubtd.h b/external/spidermonkey/include/android/jspubtd.h similarity index 100% rename from external/spidermonkey/include/andorid/jspubtd.h rename to external/spidermonkey/include/android/jspubtd.h diff --git a/external/spidermonkey/include/andorid/jstypes.h b/external/spidermonkey/include/android/jstypes.h similarity index 100% rename from external/spidermonkey/include/andorid/jstypes.h rename to external/spidermonkey/include/android/jstypes.h diff --git a/external/spidermonkey/include/andorid/jsutil.h b/external/spidermonkey/include/android/jsutil.h similarity index 100% rename from external/spidermonkey/include/andorid/jsutil.h rename to external/spidermonkey/include/android/jsutil.h diff --git a/external/spidermonkey/include/andorid/jsversion.h b/external/spidermonkey/include/android/jsversion.h similarity index 100% rename from external/spidermonkey/include/andorid/jsversion.h rename to external/spidermonkey/include/android/jsversion.h diff --git a/external/spidermonkey/include/andorid/jswrapper.h b/external/spidermonkey/include/android/jswrapper.h similarity index 100% rename from external/spidermonkey/include/andorid/jswrapper.h rename to external/spidermonkey/include/android/jswrapper.h diff --git a/external/spidermonkey/include/andorid/mozilla/Assertions.h b/external/spidermonkey/include/android/mozilla/Assertions.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Assertions.h rename to external/spidermonkey/include/android/mozilla/Assertions.h diff --git a/external/spidermonkey/include/andorid/mozilla/Attributes.h b/external/spidermonkey/include/android/mozilla/Attributes.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Attributes.h rename to external/spidermonkey/include/android/mozilla/Attributes.h diff --git a/external/spidermonkey/include/andorid/mozilla/BloomFilter.h b/external/spidermonkey/include/android/mozilla/BloomFilter.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/BloomFilter.h rename to external/spidermonkey/include/android/mozilla/BloomFilter.h diff --git a/external/spidermonkey/include/andorid/mozilla/Casting.h b/external/spidermonkey/include/android/mozilla/Casting.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Casting.h rename to external/spidermonkey/include/android/mozilla/Casting.h diff --git a/external/spidermonkey/include/andorid/mozilla/Char16.h b/external/spidermonkey/include/android/mozilla/Char16.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Char16.h rename to external/spidermonkey/include/android/mozilla/Char16.h diff --git a/external/spidermonkey/include/andorid/mozilla/CheckedInt.h b/external/spidermonkey/include/android/mozilla/CheckedInt.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/CheckedInt.h rename to external/spidermonkey/include/android/mozilla/CheckedInt.h diff --git a/external/spidermonkey/include/andorid/mozilla/Compiler.h b/external/spidermonkey/include/android/mozilla/Compiler.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Compiler.h rename to external/spidermonkey/include/android/mozilla/Compiler.h diff --git a/external/spidermonkey/include/andorid/mozilla/Constants.h b/external/spidermonkey/include/android/mozilla/Constants.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Constants.h rename to external/spidermonkey/include/android/mozilla/Constants.h diff --git a/external/spidermonkey/include/andorid/mozilla/DebugOnly.h b/external/spidermonkey/include/android/mozilla/DebugOnly.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/DebugOnly.h rename to external/spidermonkey/include/android/mozilla/DebugOnly.h diff --git a/external/spidermonkey/include/andorid/mozilla/Decimal.h b/external/spidermonkey/include/android/mozilla/Decimal.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Decimal.h rename to external/spidermonkey/include/android/mozilla/Decimal.h diff --git a/external/spidermonkey/include/andorid/mozilla/Endian.h b/external/spidermonkey/include/android/mozilla/Endian.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Endian.h rename to external/spidermonkey/include/android/mozilla/Endian.h diff --git a/external/spidermonkey/include/andorid/mozilla/EnumSet.h b/external/spidermonkey/include/android/mozilla/EnumSet.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/EnumSet.h rename to external/spidermonkey/include/android/mozilla/EnumSet.h diff --git a/external/spidermonkey/include/andorid/mozilla/FloatingPoint.h b/external/spidermonkey/include/android/mozilla/FloatingPoint.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/FloatingPoint.h rename to external/spidermonkey/include/android/mozilla/FloatingPoint.h diff --git a/external/spidermonkey/include/andorid/mozilla/GuardObjects.h b/external/spidermonkey/include/android/mozilla/GuardObjects.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/GuardObjects.h rename to external/spidermonkey/include/android/mozilla/GuardObjects.h diff --git a/external/spidermonkey/include/andorid/mozilla/HashFunctions.h b/external/spidermonkey/include/android/mozilla/HashFunctions.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/HashFunctions.h rename to external/spidermonkey/include/android/mozilla/HashFunctions.h diff --git a/external/spidermonkey/include/andorid/mozilla/Likely.h b/external/spidermonkey/include/android/mozilla/Likely.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Likely.h rename to external/spidermonkey/include/android/mozilla/Likely.h diff --git a/external/spidermonkey/include/andorid/mozilla/LinkedList.h b/external/spidermonkey/include/android/mozilla/LinkedList.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/LinkedList.h rename to external/spidermonkey/include/android/mozilla/LinkedList.h diff --git a/external/spidermonkey/include/andorid/mozilla/MSStdInt.h b/external/spidermonkey/include/android/mozilla/MSStdInt.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MSStdInt.h rename to external/spidermonkey/include/android/mozilla/MSStdInt.h diff --git a/external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h b/external/spidermonkey/include/android/mozilla/MathAlgorithms.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MathAlgorithms.h rename to external/spidermonkey/include/android/mozilla/MathAlgorithms.h diff --git a/external/spidermonkey/include/andorid/mozilla/MemoryChecking.h b/external/spidermonkey/include/android/mozilla/MemoryChecking.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/MemoryChecking.h rename to external/spidermonkey/include/android/mozilla/MemoryChecking.h diff --git a/external/spidermonkey/include/andorid/mozilla/NullPtr.h b/external/spidermonkey/include/android/mozilla/NullPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/NullPtr.h rename to external/spidermonkey/include/android/mozilla/NullPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/PodOperations.h b/external/spidermonkey/include/android/mozilla/PodOperations.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/PodOperations.h rename to external/spidermonkey/include/android/mozilla/PodOperations.h diff --git a/external/spidermonkey/include/andorid/mozilla/Poison.h b/external/spidermonkey/include/android/mozilla/Poison.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Poison.h rename to external/spidermonkey/include/android/mozilla/Poison.h diff --git a/external/spidermonkey/include/andorid/mozilla/Range.h b/external/spidermonkey/include/android/mozilla/Range.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Range.h rename to external/spidermonkey/include/android/mozilla/Range.h diff --git a/external/spidermonkey/include/andorid/mozilla/RangedPtr.h b/external/spidermonkey/include/android/mozilla/RangedPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/RangedPtr.h rename to external/spidermonkey/include/android/mozilla/RangedPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/RefPtr.h b/external/spidermonkey/include/android/mozilla/RefPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/RefPtr.h rename to external/spidermonkey/include/android/mozilla/RefPtr.h diff --git a/external/spidermonkey/include/andorid/mozilla/SHA1.h b/external/spidermonkey/include/android/mozilla/SHA1.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/SHA1.h rename to external/spidermonkey/include/android/mozilla/SHA1.h diff --git a/external/spidermonkey/include/andorid/mozilla/Scoped.h b/external/spidermonkey/include/android/mozilla/Scoped.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Scoped.h rename to external/spidermonkey/include/android/mozilla/Scoped.h diff --git a/external/spidermonkey/include/andorid/mozilla/SplayTree.h b/external/spidermonkey/include/android/mozilla/SplayTree.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/SplayTree.h rename to external/spidermonkey/include/android/mozilla/SplayTree.h diff --git a/external/spidermonkey/include/andorid/mozilla/StandardInteger.h b/external/spidermonkey/include/android/mozilla/StandardInteger.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/StandardInteger.h rename to external/spidermonkey/include/android/mozilla/StandardInteger.h diff --git a/external/spidermonkey/include/andorid/mozilla/ThreadLocal.h b/external/spidermonkey/include/android/mozilla/ThreadLocal.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/ThreadLocal.h rename to external/spidermonkey/include/android/mozilla/ThreadLocal.h diff --git a/external/spidermonkey/include/andorid/mozilla/TypeTraits.h b/external/spidermonkey/include/android/mozilla/TypeTraits.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/TypeTraits.h rename to external/spidermonkey/include/android/mozilla/TypeTraits.h diff --git a/external/spidermonkey/include/andorid/mozilla/TypedEnum.h b/external/spidermonkey/include/android/mozilla/TypedEnum.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/TypedEnum.h rename to external/spidermonkey/include/android/mozilla/TypedEnum.h diff --git a/external/spidermonkey/include/andorid/mozilla/Types.h b/external/spidermonkey/include/android/mozilla/Types.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Types.h rename to external/spidermonkey/include/android/mozilla/Types.h diff --git a/external/spidermonkey/include/andorid/mozilla/Util.h b/external/spidermonkey/include/android/mozilla/Util.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/Util.h rename to external/spidermonkey/include/android/mozilla/Util.h diff --git a/external/spidermonkey/include/andorid/mozilla/WeakPtr.h b/external/spidermonkey/include/android/mozilla/WeakPtr.h similarity index 100% rename from external/spidermonkey/include/andorid/mozilla/WeakPtr.h rename to external/spidermonkey/include/android/mozilla/WeakPtr.h diff --git a/external/spidermonkey/prebuilt/andorid/Android.mk b/external/spidermonkey/prebuilt/android/Android.mk similarity index 100% rename from external/spidermonkey/prebuilt/andorid/Android.mk rename to external/spidermonkey/prebuilt/android/Android.mk diff --git a/external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/armeabi-v7a/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a.REMOVED.git-id diff --git a/external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/armeabi/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/armeabi/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/armeabi/libjs_static.a.REMOVED.git-id diff --git a/external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id b/external/spidermonkey/prebuilt/android/x86/libjs_static.a.REMOVED.git-id similarity index 100% rename from external/spidermonkey/prebuilt/andorid/x86/libjs_static.a.REMOVED.git-id rename to external/spidermonkey/prebuilt/android/x86/libjs_static.a.REMOVED.git-id diff --git a/external/tiff/include/andorid/tiff.h b/external/tiff/include/android/tiff.h similarity index 100% rename from external/tiff/include/andorid/tiff.h rename to external/tiff/include/android/tiff.h diff --git a/external/tiff/include/andorid/tiffconf.h b/external/tiff/include/android/tiffconf.h similarity index 100% rename from external/tiff/include/andorid/tiffconf.h rename to external/tiff/include/android/tiffconf.h diff --git a/external/tiff/include/andorid/tiffio.h b/external/tiff/include/android/tiffio.h similarity index 100% rename from external/tiff/include/andorid/tiffio.h rename to external/tiff/include/android/tiffio.h diff --git a/external/tiff/include/andorid/tiffvers.h b/external/tiff/include/android/tiffvers.h similarity index 100% rename from external/tiff/include/andorid/tiffvers.h rename to external/tiff/include/android/tiffvers.h diff --git a/external/tiff/prebuilt/andorid/Android.mk b/external/tiff/prebuilt/android/Android.mk similarity index 58% rename from external/tiff/prebuilt/andorid/Android.mk rename to external/tiff/prebuilt/android/Android.mk index 9d8e36d5fa..40af980160 100644 --- a/external/tiff/prebuilt/andorid/Android.mk +++ b/external/tiff/prebuilt/android/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libtiff_static LOCAL_MODULE_FILENAME := tiff -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libtiff.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libtiff.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/armeabi-v7a/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/armeabi-v7a/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/armeabi-v7a/libtiff.a.REMOVED.git-id diff --git a/external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/armeabi/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/armeabi/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/armeabi/libtiff.a.REMOVED.git-id diff --git a/external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id b/external/tiff/prebuilt/android/x86/libtiff.a.REMOVED.git-id similarity index 100% rename from external/tiff/prebuilt/andorid/x86/libtiff.a.REMOVED.git-id rename to external/tiff/prebuilt/android/x86/libtiff.a.REMOVED.git-id diff --git a/external/tinyxml2/tinyxml2.h b/external/tinyxml2/tinyxml2.h index eeffa1096f..b188feb1f5 100644 --- a/external/tinyxml2/tinyxml2.h +++ b/external/tinyxml2/tinyxml2.h @@ -24,8 +24,8 @@ distribution. #ifndef TINYXML2_INCLUDED #define TINYXML2_INCLUDED -#include "platform/CCPlatformConfig.h" -#include "platform/CCPlatformMacros.h" +#include "CCPlatformConfig.h" +#include "CCPlatformMacros.h" #if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY) # include diff --git a/external/unzip/ioapi.h b/external/unzip/ioapi.h index 575f44ece4..47cafee504 100644 --- a/external/unzip/ioapi.h +++ b/external/unzip/ioapi.h @@ -21,7 +21,7 @@ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H -#include "platform/CCPlatformConfig.h" +#include "CCPlatformConfig.h" #if (!defined(_WIN32)) && (!defined(WIN32)) diff --git a/external/webp/include/andorid/decode.h b/external/webp/include/android/decode.h similarity index 100% rename from external/webp/include/andorid/decode.h rename to external/webp/include/android/decode.h diff --git a/external/webp/include/andorid/encode.h b/external/webp/include/android/encode.h similarity index 100% rename from external/webp/include/andorid/encode.h rename to external/webp/include/android/encode.h diff --git a/external/webp/include/andorid/types.h b/external/webp/include/android/types.h similarity index 100% rename from external/webp/include/andorid/types.h rename to external/webp/include/android/types.h diff --git a/external/webp/prebuilt/andorid/Android.mk b/external/webp/prebuilt/android/Android.mk similarity index 74% rename from external/webp/prebuilt/andorid/Android.mk rename to external/webp/prebuilt/android/Android.mk index ff7dea31f0..e102ac2511 100644 --- a/external/webp/prebuilt/andorid/Android.mk +++ b/external/webp/prebuilt/android/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos_libwebp_static LOCAL_MODULE_FILENAME := webp -LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libwebp.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebp.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android LOCAL_WHOLE_STATIC_LIBRARIES := cpufeatures diff --git a/external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/armeabi-v7a/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/armeabi-v7a/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/armeabi-v7a/libwebp.a.REMOVED.git-id diff --git a/external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/armeabi/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/armeabi/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/armeabi/libwebp.a.REMOVED.git-id diff --git a/external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id b/external/webp/prebuilt/android/x86/libwebp.a.REMOVED.git-id similarity index 100% rename from external/webp/prebuilt/andorid/x86/libwebp.a.REMOVED.git-id rename to external/webp/prebuilt/android/x86/libwebp.a.REMOVED.git-id diff --git a/external/websockets/android/include/libwebsockets.h b/external/websockets/include/android/libwebsockets.h similarity index 100% rename from external/websockets/android/include/libwebsockets.h rename to external/websockets/include/android/libwebsockets.h diff --git a/external/websockets/ios/include/libwebsockets.h b/external/websockets/include/ios/libwebsockets.h similarity index 100% rename from external/websockets/ios/include/libwebsockets.h rename to external/websockets/include/ios/libwebsockets.h diff --git a/external/websockets/mac/include/libwebsockets.h b/external/websockets/include/mac/libwebsockets.h similarity index 100% rename from external/websockets/mac/include/libwebsockets.h rename to external/websockets/include/mac/libwebsockets.h diff --git a/external/websockets/win32/include/libwebsockets.h b/external/websockets/include/win32/libwebsockets.h similarity index 100% rename from external/websockets/win32/include/libwebsockets.h rename to external/websockets/include/win32/libwebsockets.h diff --git a/external/websockets/win32/include/win32helpers/gettimeofday.h b/external/websockets/include/win32/win32helpers/gettimeofday.h similarity index 100% rename from external/websockets/win32/include/win32helpers/gettimeofday.h rename to external/websockets/include/win32/win32helpers/gettimeofday.h diff --git a/external/websockets/win32/include/win32helpers/websock-w32.h b/external/websockets/include/win32/win32helpers/websock-w32.h similarity index 100% rename from external/websockets/win32/include/win32helpers/websock-w32.h rename to external/websockets/include/win32/win32helpers/websock-w32.h diff --git a/external/websockets/android/Android.mk b/external/websockets/prebuilt/android/Android.mk similarity index 69% rename from external/websockets/android/Android.mk rename to external/websockets/prebuilt/android/Android.mk index 158211b64c..a5f14e0456 100644 --- a/external/websockets/android/Android.mk +++ b/external/websockets/prebuilt/android/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libwebsockets_static LOCAL_MODULE_FILENAME := libwebsockets_static -LOCAL_SRC_FILES := ./lib/$(TARGET_ARCH_ABI)/libwebsockets.a -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include +LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android LOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 include $(PREBUILT_STATIC_LIBRARY) diff --git a/external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/prebuilt/ios/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/websockets/ios/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/prebuilt/ios/libwebsockets.a.REMOVED.git-id diff --git a/external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id b/external/websockets/prebuilt/mac/libwebsockets.a.REMOVED.git-id similarity index 100% rename from external/websockets/mac/lib/libwebsockets.a.REMOVED.git-id rename to external/websockets/prebuilt/mac/libwebsockets.a.REMOVED.git-id diff --git a/external/websockets/tizen/include/libwebsockets.h b/external/websockets/tizen/include/libwebsockets.h deleted file mode 100644 index 28e649c67e..0000000000 --- a/external/websockets/tizen/include/libwebsockets.h +++ /dev/null @@ -1,977 +0,0 @@ -/* - * libwebsockets - small server side websockets and web server implementation - * - * Copyright (C) 2010-2013 Andy Green - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation: - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - */ - -#ifndef __LIBWEBSOCKET_H__ -#define __LIBWEBSOCKET_H__ - -#ifdef __cplusplus -extern "C" { -#include -#endif - -#ifdef WIN32 - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#include -#include -#include "../win32port/win32helpers/websock-w32.h" - -#include "../win32port/win32helpers/gettimeofday.h" - -#define strcasecmp stricmp -#define getdtablesize() 30000 - -typedef int ssize_t; - -#ifdef LWS_DLL -#ifdef LWS_INTERNAL -#define LWS_EXTERN extern __declspec(dllexport) -#else -#define LWS_EXTERN extern __declspec(dllimport) -#endif -#endif - -#else // NOT WIN32 -#include -#include -#endif - -#include - -#ifndef LWS_EXTERN -#define LWS_EXTERN extern -#endif - -#define CONTEXT_PORT_NO_LISTEN 0 -#define MAX_MUX_RECURSION 2 - -enum lws_log_levels { - LLL_ERR = 1 << 0, - LLL_WARN = 1 << 1, - LLL_NOTICE = 1 << 2, - LLL_INFO = 1 << 3, - LLL_DEBUG = 1 << 4, - LLL_PARSER = 1 << 5, - LLL_HEADER = 1 << 6, - LLL_EXT = 1 << 7, - LLL_CLIENT = 1 << 8, - LLL_LATENCY = 1 << 9, - - LLL_COUNT = 10 /* set to count of valid flags */ -}; - -LWS_EXTERN void _lws_log(int filter, const char *format, ...); - -/* notice, warn and log are always compiled in */ -#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__) -#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__) -#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__) -/* - * weaker logging can be deselected at configure time using --disable-debug - * that gets rid of the overhead of checking while keeping _warn and _err - * active - */ -#ifdef _DEBUG - -#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__) -#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__) -#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__) -#define lwsl_header(...) _lws_log(LLL_HEADER, __VA_ARGS__) -#define lwsl_ext(...) _lws_log(LLL_EXT, __VA_ARGS__) -#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__) -#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__) -LWS_EXTERN void lwsl_hexdump(void *buf, size_t len); - -#else /* no debug */ - -#define lwsl_info(...) -#define lwsl_debug(...) -#define lwsl_parser(...) -#define lwsl_header(...) -#define lwsl_ext(...) -#define lwsl_client(...) -#define lwsl_latency(...) -#define lwsl_hexdump(a, b) - -#endif - -enum libwebsocket_context_options { - LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2, - LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4, -}; - -enum libwebsocket_callback_reasons { - LWS_CALLBACK_ESTABLISHED, - LWS_CALLBACK_CLIENT_CONNECTION_ERROR, - LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH, - LWS_CALLBACK_CLIENT_ESTABLISHED, - LWS_CALLBACK_CLOSED, - LWS_CALLBACK_RECEIVE, - LWS_CALLBACK_CLIENT_RECEIVE, - LWS_CALLBACK_CLIENT_RECEIVE_PONG, - LWS_CALLBACK_CLIENT_WRITEABLE, - LWS_CALLBACK_SERVER_WRITEABLE, - LWS_CALLBACK_HTTP, - LWS_CALLBACK_HTTP_FILE_COMPLETION, - LWS_CALLBACK_HTTP_WRITEABLE, - LWS_CALLBACK_FILTER_NETWORK_CONNECTION, - LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION, - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS, - LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS, - LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION, - LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, - LWS_CALLBACK_CONFIRM_EXTENSION_OKAY, - LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED, - LWS_CALLBACK_PROTOCOL_INIT, - LWS_CALLBACK_PROTOCOL_DESTROY, - /* external poll() management support */ - LWS_CALLBACK_ADD_POLL_FD, - LWS_CALLBACK_DEL_POLL_FD, - LWS_CALLBACK_SET_MODE_POLL_FD, - LWS_CALLBACK_CLEAR_MODE_POLL_FD, -}; - -#ifndef LWS_NO_EXTENSIONS -enum libwebsocket_extension_callback_reasons { - LWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT, - LWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT, - LWS_EXT_CALLBACK_CONSTRUCT, - LWS_EXT_CALLBACK_CLIENT_CONSTRUCT, - LWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE, - LWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION, - LWS_EXT_CALLBACK_DESTROY, - LWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING, - LWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED, - LWS_EXT_CALLBACK_PACKET_RX_PREPARSE, - LWS_EXT_CALLBACK_PACKET_TX_PRESEND, - LWS_EXT_CALLBACK_PACKET_TX_DO_SEND, - LWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX, - LWS_EXT_CALLBACK_FLUSH_PENDING_TX, - LWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX, - LWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION, - LWS_EXT_CALLBACK_1HZ, - LWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE, - LWS_EXT_CALLBACK_IS_WRITEABLE, - LWS_EXT_CALLBACK_PAYLOAD_TX, - LWS_EXT_CALLBACK_PAYLOAD_RX, -}; -#endif - -enum libwebsocket_write_protocol { - LWS_WRITE_TEXT, - LWS_WRITE_BINARY, - LWS_WRITE_CONTINUATION, - LWS_WRITE_HTTP, - - /* special 04+ opcodes */ - - LWS_WRITE_CLOSE, - LWS_WRITE_PING, - LWS_WRITE_PONG, - - /* flags */ - - LWS_WRITE_NO_FIN = 0x40, - /* - * client packet payload goes out on wire unmunged - * only useful for security tests since normal servers cannot - * decode the content if used - */ - LWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80 -}; - -/* - * you need these to look at headers that have been parsed if using the - * LWS_CALLBACK_FILTER_CONNECTION callback. If a header from the enum - * list below is absent, .token = NULL and token_len = 0. Otherwise .token - * points to .token_len chars containing that header content. - */ - -struct lws_tokens { - char *token; - int token_len; -}; - -enum lws_token_indexes { - WSI_TOKEN_GET_URI, - WSI_TOKEN_HOST, - WSI_TOKEN_CONNECTION, - WSI_TOKEN_KEY1, - WSI_TOKEN_KEY2, - WSI_TOKEN_PROTOCOL, - WSI_TOKEN_UPGRADE, - WSI_TOKEN_ORIGIN, - WSI_TOKEN_DRAFT, - WSI_TOKEN_CHALLENGE, - - /* new for 04 */ - WSI_TOKEN_KEY, - WSI_TOKEN_VERSION, - WSI_TOKEN_SWORIGIN, - - /* new for 05 */ - WSI_TOKEN_EXTENSIONS, - - /* client receives these */ - WSI_TOKEN_ACCEPT, - WSI_TOKEN_NONCE, - WSI_TOKEN_HTTP, - WSI_TOKEN_MUXURL, - - /* use token storage to stash these */ - - _WSI_TOKEN_CLIENT_SENT_PROTOCOLS, - _WSI_TOKEN_CLIENT_PEER_ADDRESS, - _WSI_TOKEN_CLIENT_URI, - _WSI_TOKEN_CLIENT_HOST, - _WSI_TOKEN_CLIENT_ORIGIN, - - /* always last real token index*/ - WSI_TOKEN_COUNT, - /* parser state additions */ - WSI_TOKEN_NAME_PART, - WSI_TOKEN_SKIPPING, - WSI_TOKEN_SKIPPING_SAW_CR, - WSI_PARSING_COMPLETE, - WSI_INIT_TOKEN_MUXURL, -}; - -/* - * From RFC 6455 - 1000 - - 1000 indicates a normal closure, meaning that the purpose for - which the connection was established has been fulfilled. - - 1001 - - 1001 indicates that an endpoint is "going away", such as a server - going down or a browser having navigated away from a page. - - 1002 - - 1002 indicates that an endpoint is terminating the connection due - to a protocol error. - - 1003 - - 1003 indicates that an endpoint is terminating the connection - because it has received a type of data it cannot accept (e.g., an - endpoint that understands only text data MAY send this if it - receives a binary message). - - 1004 - - Reserved. The specific meaning might be defined in the future. - - 1005 - - 1005 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that no status - code was actually present. - - 1006 - - 1006 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed abnormally, e.g., without sending or - receiving a Close control frame. - - 1007 - - 1007 indicates that an endpoint is terminating the connection - because it has received data within a message that was not - consistent with the type of the message (e.g., non-UTF-8 [RFC3629] - data within a text message). - - 1008 - - 1008 indicates that an endpoint is terminating the connection - because it has received a message that violates its policy. This - is a generic status code that can be returned when there is no - other more suitable status code (e.g., 1003 or 1009) or if there - is a need to hide specific details about the policy. - - 1009 - - 1009 indicates that an endpoint is terminating the connection - because it has received a message that is too big for it to - process. - - 1010 - - 1010 indicates that an endpoint (client) is terminating the - connection because it has expected the server to negotiate one or - more extension, but the server didn't return them in the response - message of the WebSocket handshake. The list of extensions that - are needed SHOULD appear in the /reason/ part of the Close frame. - Note that this status code is not used by the server, because it - can fail the WebSocket handshake instead. - - 1011 - - 1011 indicates that a server is terminating the connection because - it encountered an unexpected condition that prevented it from - fulfilling the request. - - 1015 - - 1015 is a reserved value and MUST NOT be set as a status code in a - Close control frame by an endpoint. It is designated for use in - applications expecting a status code to indicate that the - connection was closed due to a failure to perform a TLS handshake - (e.g., the server certificate can't be verified). -*/ - -enum lws_close_status { - LWS_CLOSE_STATUS_NOSTATUS = 0, - LWS_CLOSE_STATUS_NORMAL = 1000, - LWS_CLOSE_STATUS_GOINGAWAY = 1001, - LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002, - LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003, - LWS_CLOSE_STATUS_RESERVED = 1004, - LWS_CLOSE_STATUS_NO_STATUS = 1005, - LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006, - LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007, - LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008, - LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009, - LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010, - LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011, - LWS_CLOSE_STATUS_TLS_FAILURE = 1015, -}; - -struct libwebsocket; -struct libwebsocket_context; -/* needed even with extensions disabled for create context */ -struct libwebsocket_extension; - -/** - * callback_function() - User server actions - * @context: Websockets context - * @wsi: Opaque websocket instance pointer - * @reason: The reason for the call - * @user: Pointer to per-session user data allocated by library - * @in: Pointer used for some callback reasons - * @len: Length set for some callback reasons - * - * This callback is the way the user controls what is served. All the - * protocol detail is hidden and handled by the library. - * - * For each connection / session there is user data allocated that is - * pointed to by "user". You set the size of this user data area when - * the library is initialized with libwebsocket_create_server. - * - * You get an opportunity to initialize user data when called back with - * LWS_CALLBACK_ESTABLISHED reason. - * - * LWS_CALLBACK_ESTABLISHED: after the server completes a handshake with - * an incoming client - * - * LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has - * been unable to complete a handshake with the remote server - * - * LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the - * client user code to examine the http headers - * and decide to reject the connection. If the - * content in the headers is interesting to the - * client (url, etc) it needs to copy it out at - * this point since it will be destroyed before - * the CLIENT_ESTABLISHED call - * - * LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed - * a handshake with the remote server - * - * LWS_CALLBACK_CLOSED: when the websocket session ends - * - * LWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a - * remote client, it can be found at *in and is - * len bytes long - * - * LWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets, - * they appear with this callback reason. PONG - * packets only exist in 04+ protocol - * - * LWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the - * client connection, it can be found at *in and - * is len bytes long - * - * LWS_CALLBACK_HTTP: an http request has come from a client that is not - * asking to upgrade the connection to a websocket - * one. This is a chance to serve http content, - * for example, to send a script to the client - * which will then open the websockets connection. - * @in points to the URI path requested and - * libwebsockets_serve_http_file() makes it very - * simple to send back a file to the client. - * Normally after sending the file you are done - * with the http connection, since the rest of the - * activity will come by websockets from the script - * that was delivered by http, so you will want to - * return 1; to close and free up the connection. - * That's important because it uses a slot in the - * total number of client connections allowed set - * by MAX_CLIENTS. - * - * LWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol - * link now. - * - * LWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down - * http link has completed. - * - * LWS_CALLBACK_CLIENT_WRITEABLE: - * LWS_CALLBACK_SERVER_WRITEABLE: If you call - * libwebsocket_callback_on_writable() on a connection, you will - * get one of these callbacks coming when the connection socket - * is able to accept another write packet without blocking. - * If it already was able to take another packet without blocking, - * you'll get this callback at the next call to the service loop - * function. Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE - * and servers get LWS_CALLBACK_SERVER_WRITEABLE. - * - * LWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to - * the server at network level; the connection is accepted but then - * passed to this callback to decide whether to hang up immediately - * or not, based on the client IP. @in contains the connection - * socket's descriptor. Return non-zero to terminate - * the connection before sending or receiving anything. - * Because this happens immediately after the network connection - * from the client, there's no websocket protocol selected yet so - * this callback is issued only to protocol 0. - * - * LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has - * been received and parsed from the client, but the response is - * not sent yet. Return non-zero to disallow the connection. - * @user is a pointer to an array of struct lws_tokens, you can - * use the header enums lws_token_indexes from libwebsockets.h - * to check for and read the supported header presence and - * content before deciding to allow the handshake to proceed or - * to kill the connection. - * - * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for - * including OpenSSL support, this callback allows your user code - * to perform extra SSL_CTX_load_verify_locations() or similar - * calls to direct OpenSSL where to find certificates the client - * can use to confirm the remote server identity. @user is the - * OpenSSL SSL_CTX* - * - * LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for - * including OpenSSL support, this callback allows your user code - * to load extra certifcates into the server which allow it to - * verify the validity of certificates returned by clients. @user - * is the server's OpenSSL SSL_CTX* - * - * LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the - * libwebsockets context was created with the option - * LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this - * callback is generated during OpenSSL verification of the cert - * sent from the client. It is sent to protocol[0] callback as - * no protocol has been negotiated on the connection yet. - * Notice that the libwebsockets context and wsi are both NULL - * during this callback. See - * http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html - * to understand more detail about the OpenSSL callback that - * generates this libwebsockets callback and the meanings of the - * arguments passed. In this callback, @user is the x509_ctx, - * @in is the ssl pointer and @len is preverify_ok - * Notice that this callback maintains libwebsocket return - * conventions, return 0 to mean the cert is OK or 1 to fail it. - * This also means that if you don't handle this callback then - * the default callback action of returning 0 allows the client - * certificates. - * - * LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens - * when a client handshake is being compiled. @user is NULL, - * @in is a char **, it's pointing to a char * which holds the - * next location in the header buffer where you can add - * headers, and @len is the remaining space in the header buffer, - * which is typically some hundreds of bytes. So, to add a canned - * cookie, your handler code might look similar to: - * - * char **p = (char **)in; - * - * if (len < 100) - * return 1; - * - * *p += sprintf(*p, "Cookie: a=b\x0d\x0a"); - * - * return 0; - * - * Notice if you add anything, you just have to take care about - * the CRLF on the line you added. Obviously this callback is - * optional, if you don't handle it everything is fine. - * - * Notice the callback is coming to protocols[0] all the time, - * because there is no specific protocol handshook yet. - * - * LWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code - * sees that it does support a requested extension, before - * accepting the extension by additing to the list sent back to - * the client it gives this callback just to check that it's okay - * to use that extension. It calls back to the requested protocol - * and with @in being the extension name, @len is 0 and @user is - * valid. Note though at this time the ESTABLISHED callback hasn't - * happened yet so if you initialize @user content there, @user - * content during this callback might not be useful for anything. - * Notice this callback comes to protocols[0]. - * - * LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED: When a client - * connection is being prepared to start a handshake to a server, - * each supported extension is checked with protocols[0] callback - * with this reason, giving the user code a chance to suppress the - * claim to support that extension by returning non-zero. If - * unhandled, by default 0 will be returned and the extension - * support included in the header to the server. Notice this - * callback comes to protocols[0]. - * - * LWS_CALLBACK_PROTOCOL_INIT: One-time call per protocol so it can - * do initial setup / allocations etc - * - * LWS_CALLBACK_PROTOCOL_DESTROY: One-time call per protocol indicating - * this protocol won't get used at all after this callback, the - * context is getting destroyed. Take the opportunity to - * deallocate everything that was allocated by the protocol. - * - * The next four reasons are optional and only need taking care of if you - * will be integrating libwebsockets sockets into an external polling - * array. - * - * LWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop - * internally, but in the case you are integrating with another - * server you will need to have libwebsocket sockets share a - * polling array with the other server. This and the other - * POLL_FD related callbacks let you put your specialized - * poll array interface code in the callback for protocol 0, the - * first protocol you support, usually the HTTP protocol in the - * serving case. This callback happens when a socket needs to be - * added to the polling loop: @in contains the fd, and - * @len is the events bitmap (like, POLLIN). If you are using the - * internal polling loop (the "service" callback), you can just - * ignore these callbacks. - * - * LWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor - * needs to be removed from an external polling array. @in is - * the socket desricptor. If you are using the internal polling - * loop, you can just ignore it. - * - * LWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets - * wants to modify the events for the socket descriptor in @in. - * The handler should OR @len on to the events member of the pollfd - * struct for this socket descriptor. If you are using the - * internal polling loop, you can just ignore it. - * - * LWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets - * wants to modify the events for the socket descriptor in @in. - * The handler should AND ~@len on to the events member of the - * pollfd struct for this socket descriptor. If you are using the - * internal polling loop, you can just ignore it. - */ -LWS_EXTERN int callback(struct libwebsocket_context *context, - struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, - void *in, size_t len); - -typedef int (callback_function)(struct libwebsocket_context *context, - struct libwebsocket *wsi, - enum libwebsocket_callback_reasons reason, void *user, - void *in, size_t len); - -#ifndef LWS_NO_EXTENSIONS -/** - * extension_callback_function() - Hooks to allow extensions to operate - * @context: Websockets context - * @ext: This extension - * @wsi: Opaque websocket instance pointer - * @reason: The reason for the call - * @user: Pointer to per-session user data allocated by library - * @in: Pointer used for some callback reasons - * @len: Length set for some callback reasons - * - * Each extension that is active on a particular connection receives - * callbacks during the connection lifetime to allow the extension to - * operate on websocket data and manage itself. - * - * Libwebsockets takes care of allocating and freeing "user" memory for - * each active extension on each connection. That is what is pointed to - * by the @user parameter. - * - * LWS_EXT_CALLBACK_CONSTRUCT: called when the server has decided to - * select this extension from the list provided by the client, - * just before the server will send back the handshake accepting - * the connection with this extension active. This gives the - * extension a chance to initialize its connection context found - * in @user. - * - * LWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT - * but called when client is instantiating this extension. Some - * extensions will work the same on client and server side and then - * you can just merge handlers for both CONSTRUCTS. - * - * LWS_EXT_CALLBACK_DESTROY: called when the connection the extension was - * being used on is about to be closed and deallocated. It's the - * last chance for the extension to deallocate anything it has - * allocated in the user data (pointed to by @user) before the - * user data is deleted. This same callback is used whether you - * are in client or server instantiation context. - * - * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on - * a connection, and a packet of data arrived at the connection, - * it is passed to this callback to give the extension a chance to - * change the data, eg, decompress it. @user is pointing to the - * extension's private connection context data, @in is pointing - * to an lws_tokens struct, it consists of a char * pointer called - * token, and an int called token_len. At entry, these are - * set to point to the received buffer and set to the content - * length. If the extension will grow the content, it should use - * a new buffer allocated in its private user context data and - * set the pointed-to lws_tokens members to point to its buffer. - * - * LWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as - * LWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the - * extension a chance to change websocket data just before it will - * be sent out. Using the same lws_token pointer scheme in @in, - * the extension can change the buffer and the length to be - * transmitted how it likes. Again if it wants to grow the - * buffer safely, it should copy the data into its own buffer and - * set the lws_tokens token pointer to it. - */ -LWS_EXTERN int extension_callback(struct libwebsocket_context *context, - struct libwebsocket_extension *ext, - struct libwebsocket *wsi, - enum libwebsocket_extension_callback_reasons reason, - void *user, void *in, size_t len); - -typedef int (extension_callback_function)(struct libwebsocket_context *context, - struct libwebsocket_extension *ext, - struct libwebsocket *wsi, - enum libwebsocket_extension_callback_reasons reason, - void *user, void *in, size_t len); -#endif - -/** - * struct libwebsocket_protocols - List of protocols and handlers server - * supports. - * @name: Protocol name that must match the one given in the client - * Javascript new WebSocket(url, 'protocol') name - * @callback: The service callback used for this protocol. It allows the - * service action for an entire protocol to be encapsulated in - * the protocol-specific callback - * @per_session_data_size: Each new connection using this protocol gets - * this much memory allocated on connection establishment and - * freed on connection takedown. A pointer to this per-connection - * allocation is passed into the callback in the 'user' parameter - * @rx_buffer_size: if you want atomic frames delivered to the callback, you - * should set this to the size of the biggest legal frame that - * you support. If the frame size is exceeded, there is no - * error, but the buffer will spill to the user callback when - * full, which you can detect by using - * libwebsockets_remaining_packet_payload(). Notice that you - * just talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING - * and post-padding are automatically also allocated on top. - * @owning_server: the server init call fills in this opaque pointer when - * registering this protocol with the server. - * @protocol_index: which protocol we are starting from zero - * - * This structure represents one protocol supported by the server. An - * array of these structures is passed to libwebsocket_create_server() - * allows as many protocols as you like to be handled by one server. - */ - -struct libwebsocket_protocols { - const char *name; - callback_function *callback; - size_t per_session_data_size; - size_t rx_buffer_size; - - /* - * below are filled in on server init and can be left uninitialized, - * no need for user to use them directly either - */ - - struct libwebsocket_context *owning_server; - int protocol_index; -}; - -#ifndef LWS_NO_EXTENSIONS -/** - * struct libwebsocket_extension - An extension we know how to cope with - * - * @name: Formal extension name, eg, "deflate-stream" - * @callback: Service callback - * @per_session_data_size: Libwebsockets will auto-malloc this much - * memory for the use of the extension, a pointer - * to it comes in the @user callback parameter - * @per_context_private_data: Optional storage for this extension that - * is per-context, so it can track stuff across - * all sessions, etc, if it wants - */ - -struct libwebsocket_extension { - const char *name; - extension_callback_function *callback; - size_t per_session_data_size; - void *per_context_private_data; -}; -#endif - -/** - * struct lws_context_creation_info: parameters to create context with - * - * @port: Port to listen on... you can use 0 to suppress listening on - * any port, that's what you want if you are not running a - * websocket server at all but just using it as a client - * @iface: NULL to bind the listen socket to all interfaces, or the - * interface name, eg, "eth2" - * @protocols: Array of structures listing supported protocols and a protocol- - * specific callback for each one. The list is ended with an - * entry that has a NULL callback pointer. - * It's not const because we write the owning_server member - * @extensions: NULL or array of libwebsocket_extension structs listing the - * extensions this context supports. If you configured with - * --without-extensions, you should give NULL here. - * @ssl_cert_filepath: If libwebsockets was compiled to use ssl, and you want - * to listen using SSL, set to the filepath to fetch the - * server cert from, otherwise NULL for unencrypted - * @ssl_private_key_filepath: filepath to private key if wanting SSL mode, - * else ignored - * @ssl_ca_filepath: CA certificate filepath or NULL - * @ssl_cipher_list: List of valid ciphers to use (eg, - * "RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL" - * or you can leave it as NULL to get "DEFAULT" - * @gid: group id to change to after setting listen socket, or -1. - * @uid: user id to change to after setting listen socket, or -1. - * @options: 0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK - * @user: optional user pointer that can be recovered via the context - * pointer using libwebsocket_context_user - * @ka_time: 0 for no keepalive, otherwise apply this keepalive timeout to - * all libwebsocket sockets, client or server - * @ka_probes: if ka_time was nonzero, after the timeout expires how many - * times to try to get a response from the peer before giving up - * and killing the connection - * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes - * attempt - */ - -struct lws_context_creation_info { - int port; - const char *iface; - struct libwebsocket_protocols *protocols; - struct libwebsocket_extension *extensions; - const char *ssl_cert_filepath; - const char *ssl_private_key_filepath; - const char *ssl_ca_filepath; - const char *ssl_cipher_list; - int gid; - int uid; - unsigned int options; - void *user; - int ka_time; - int ka_probes; - int ka_interval; - -}; - -LWS_EXTERN -void lws_set_log_level(int level, - void (*log_emit_function)(int level, const char *line)); - -LWS_EXTERN void -lwsl_emit_syslog(int level, const char *line); - -LWS_EXTERN struct libwebsocket_context * -libwebsocket_create_context(struct lws_context_creation_info *info); - -LWS_EXTERN void -libwebsocket_context_destroy(struct libwebsocket_context *context); - -LWS_EXTERN int -libwebsocket_service(struct libwebsocket_context *context, int timeout_ms); - -LWS_EXTERN int -libwebsocket_service_fd(struct libwebsocket_context *context, - struct pollfd *pollfd); - -LWS_EXTERN void * -libwebsocket_context_user(struct libwebsocket_context *context); - -/* - * IMPORTANT NOTICE! - * - * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY) - * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE - * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len). - * - * This allows us to add protocol info before and after the data, and send as - * one packet on the network without payload copying, for maximum efficiency. - * - * So for example you need this kind of code to use libwebsocket_write with a - * 128-byte payload - * - * char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING]; - * - * // fill your part of the buffer... for example here it's all zeros - * memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128); - * - * libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128); - * - * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just - * use the whole buffer without taking care of the above. - */ - -/* - * this is the frame nonce plus two header plus 8 length - * there's an additional two for mux extension per mux nesting level - * 2 byte prepend on close will already fit because control frames cannot use - * the big length style - */ - -#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION)) -#define LWS_SEND_BUFFER_POST_PADDING 4 - -LWS_EXTERN int -libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len, - enum libwebsocket_write_protocol protocol); - -LWS_EXTERN int -libwebsockets_serve_http_file(struct libwebsocket_context *context, - struct libwebsocket *wsi, const char *file, - const char *content_type); -LWS_EXTERN int -libwebsockets_serve_http_file_fragment(struct libwebsocket_context *context, - struct libwebsocket *wsi); - -LWS_EXTERN const struct libwebsocket_protocols * -libwebsockets_get_protocol(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_callback_on_writable(struct libwebsocket_context *context, - struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_callback_on_writable_all_protocol( - const struct libwebsocket_protocols *protocol); - -LWS_EXTERN int -libwebsocket_get_socket_fd(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_is_final_fragment(struct libwebsocket *wsi); - -LWS_EXTERN unsigned char -libwebsocket_get_reserved_bits(struct libwebsocket *wsi); - -LWS_EXTERN int -libwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable); - -LWS_EXTERN size_t -libwebsockets_remaining_packet_payload(struct libwebsocket *wsi); - -LWS_EXTERN struct libwebsocket * -libwebsocket_client_connect(struct libwebsocket_context *clients, - const char *address, - int port, - int ssl_connection, - const char *path, - const char *host, - const char *origin, - const char *protocol, - int ietf_version_or_minus_one); - -LWS_EXTERN struct libwebsocket * -libwebsocket_client_connect_extended(struct libwebsocket_context *clients, - const char *address, - int port, - int ssl_connection, - const char *path, - const char *host, - const char *origin, - const char *protocol, - int ietf_version_or_minus_one, - void *userdata); - -LWS_EXTERN const char * -libwebsocket_canonical_hostname(struct libwebsocket_context *context); - - -LWS_EXTERN void -libwebsockets_get_peer_addresses(struct libwebsocket_context *context, - struct libwebsocket *wsi, int fd, char *name, int name_len, - char *rip, int rip_len); - -LWS_EXTERN int -libwebsockets_get_random(struct libwebsocket_context *context, - void *buf, int len); - -LWS_EXTERN int -lws_daemonize(const char *_lock_path); - -LWS_EXTERN int -lws_send_pipe_choked(struct libwebsocket *wsi); - -LWS_EXTERN int -lws_frame_is_binary(struct libwebsocket *wsi); - -LWS_EXTERN unsigned char * -libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md); - -LWS_EXTERN int -lws_b64_encode_string(const char *in, int in_len, char *out, int out_size); - -LWS_EXTERN int -lws_b64_decode_string(const char *in, char *out, int out_size); - -LWS_EXTERN const char * -lws_get_library_version(void); - -/* access to headers... only valid while headers valid */ - -LWS_EXTERN int -lws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h); - -LWS_EXTERN int -lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, - enum lws_token_indexes h); - -/* - * Note: this is not normally needed as a user api. It's provided in case it is - * useful when integrating with other app poll loop service code. - */ - -LWS_EXTERN int -libwebsocket_read(struct libwebsocket_context *context, - struct libwebsocket *wsi, - unsigned char *buf, size_t len); - -#ifndef LWS_NO_EXTENSIONS -LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions(); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id deleted file mode 100644 index faa0b3f208..0000000000 --- a/external/websockets/tizen/lib/armv7l/libwebsockets.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -aa3206fa03c6719d4daac6f92885d581177ef093 \ No newline at end of file diff --git a/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id b/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id deleted file mode 100644 index 7e29b6b4fa..0000000000 --- a/external/websockets/tizen/lib/x86/libwebsockets.a.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -2e9ff412352827591ef1389f336b01d179260293 \ No newline at end of file diff --git a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp index 58aee740a3..077a92aa11 100644 --- a/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp +++ b/samples/Cpp/HelloCpp/Classes/HelloWorldScene.cpp @@ -1,7 +1,7 @@ #include "HelloWorldScene.h" #include "AppMacros.h" -#include "event_dispatcher/CCEventListenerTouch.h" +#include "CCEventListenerTouch.h" USING_NS_CC; diff --git a/samples/Cpp/HelloCpp/proj.android/build_native.sh b/samples/Cpp/HelloCpp/proj.android/build_native.sh index 684f0d9886..cfd49f5d79 100755 --- a/samples/Cpp/HelloCpp/proj.android/build_native.sh +++ b/samples/Cpp/HelloCpp/proj.android/build_native.sh @@ -97,10 +97,11 @@ if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" set -x "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" else echo "Using prebuilt externals" set -x "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" + fi diff --git a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk index 6ffd7d62ef..cfd4cb14b5 100644 --- a/samples/Cpp/HelloCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/HelloCpp/proj.android/jni/Android.mk @@ -12,10 +12,9 @@ LOCAL_SRC_FILES := hellocpp/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocos2dxandroid_static cocosdenshion_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) +$(call import-module,2d) $(call import-module,audio/android) -$(call import-module,cocos2dx/platform/android) diff --git a/samples/Cpp/HelloCpp/proj.mac/Icon.icns b/samples/Cpp/HelloCpp/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Cpp/HelloCpp/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Cpp/HelloCpp/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Cpp/SimpleGame/proj.mac/Icon.icns b/samples/Cpp/SimpleGame/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Cpp/SimpleGame/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Cpp/SimpleGame/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Android.mk b/samples/Cpp/TestCpp/Android.mk index ff687de48a..bd0a8e37e6 100644 --- a/samples/Cpp/TestCpp/Android.mk +++ b/samples/Cpp/TestCpp/Android.mk @@ -146,13 +146,25 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static +LOCAL_WHOLE_STATIC_LIBRARIES += spine_static +LOCAL_WHOLE_STATIC_LIBRARIES += gui_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static +LOCAL_WHOLE_STATIC_LIBRARIES += network_static +LOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/Classes include $(BUILD_STATIC_LIBRARY) $(call import-module,audio/android) -$(call import-module,external/Box2D) -$(call import-module,external/chipmunk) -$(call import-module,cocos2dx) +$(call import-module,Box2D) +$(call import-module,chipmunk) +$(call import-module,2d) $(call import-module,extensions) +$(call import-module,editor-support/cocosbuilder) +$(call import-module,editor-support/spine) +$(call import-module,gui) +$(call import-module,editor-support/cocostudio) +$(call import-module,network) +$(call import-module,curl/prebuilt/android) diff --git a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp index 2dcd3d1558..ddd7936152 100644 --- a/samples/Cpp/TestCpp/Classes/AppDelegate.cpp +++ b/samples/Cpp/TestCpp/Classes/AppDelegate.cpp @@ -3,7 +3,8 @@ #include "cocos2d.h" #include "controller.h" #include "SimpleAudioEngine.h" -#include "cocos-ext.h" +#include "cocostudio/CocoStudio.h" +#include "extensions/cocos-ext.h" USING_NS_CC; using namespace CocosDenshion; @@ -15,7 +16,7 @@ AppDelegate::AppDelegate() AppDelegate::~AppDelegate() { // SimpleAudioEngine::end(); - cocos2d::extension::armature::ArmatureDataManager::destoryInstance(); + cocostudio::ArmatureDataManager::destoryInstance(); } bool AppDelegate::applicationDidFinishLaunching() @@ -50,6 +51,7 @@ bool AppDelegate::applicationDidFinishLaunching() { searchPaths.push_back("scenetest"); } + pFileUtils->setSearchPaths(searchPaths); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::NO_BORDER); diff --git a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp index 8061e522f9..ca75a9efe3 100644 --- a/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp +++ b/samples/Cpp/TestCpp/Classes/Box2DTest/Box2dTest.cpp @@ -1,6 +1,6 @@ #include "Box2dTest.h" #include "../testResource.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; #define PTM_RATIO 32 diff --git a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h index 06fa3eb55a..33ae31cee7 100644 --- a/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h +++ b/samples/Cpp/TestCpp/Classes/ChipmunkTest/ChipmunkTest.h @@ -7,7 +7,7 @@ #include "cocos2d.h" #include "chipmunk.h" #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp index f4ff8718a3..207a26a2ab 100644 --- a/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -1,7 +1,7 @@ #include "CocosDenshionTest.h" #include "cocos2d.h" #include "SimpleAudioEngine.h" -#include "GUI/CCControlExtension/CCControlSlider.h" +#include "extensions/GUI/CCControlExtension/CCControlSlider.h" // android effect only support ogg #if (CC_TARGET_PLATFORM == CC_PLATFOR_ANDROID) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 63d44fbea0..66eb20472b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -1,9 +1,10 @@ #include "ArmatureScene.h" #include "../../testResource.h" +#include "cocostudio/CocoStudio.h" using namespace cocos2d; -using namespace cocos2d::extension::armature; +using namespace cocostudio; Layer *NextTest(); Layer *BackTest(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h index 587938b052..625fdddf88 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.h @@ -2,9 +2,10 @@ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../../VisibleRect.h" #include "../../testBasic.h" +#include "cocostudio/CocoStudio.h" #if ENABLE_PHYSICS_BOX2D_DETECT #include "../../Box2DTestBed/GLES-Render.h" @@ -96,7 +97,7 @@ public: virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); - virtual void addArmature(cocos2d::extension::armature::Armature *armature); + virtual void addArmature(cocostudio::Armature *armature); void update(float delta); int armatureCount; @@ -124,11 +125,11 @@ public: virtual void onEnter(); virtual std::string title(); - void animationEvent(cocos2d::extension::armature::Armature *armature, cocos2d::extension::armature::MovementEventType movementType, const char *movementID); + void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const char *movementID); void callback1(); void callback2(); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; class TestUseMutiplePicture : public ArmatureTestLayer @@ -140,7 +141,7 @@ class TestUseMutiplePicture : public ArmatureTestLayer virtual void onTouchesEnded(const std::vector& touches, Event* event) override; int displayIndex; - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; class TestParticleDisplay : public ArmatureTestLayer @@ -152,7 +153,7 @@ class TestParticleDisplay : public ArmatureTestLayer virtual void onTouchesEnded(const std::vector& touches, Event* event); int animationID; - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; }; @@ -173,13 +174,13 @@ public: virtual void draw(); virtual void update(float delta); - void onFrameEvent(cocos2d::extension::armature::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); + void onFrameEvent(cocostudio::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); void initWorld(); - cocos2d::extension::armature::Armature *armature; - cocos2d::extension::armature::Armature *armature2; + cocostudio::Armature *armature; + cocostudio::Armature *armature2; cocos2d::extension::PhysicsSprite *bullet; @@ -202,13 +203,13 @@ public: virtual std::string title(); virtual void update(float delta); - void onFrameEvent(cocos2d::extension::armature::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); + void onFrameEvent(cocostudio::Bone *bone, const char *evt, int originFrameIndex, int currentFrameIndex); void initWorld(); - cocos2d::extension::armature::Armature *armature; - cocos2d::extension::armature::Armature *armature2; + cocostudio::Armature *armature; + cocostudio::Armature *armature2; cocos2d::extension::PhysicsSprite *bullet; @@ -233,7 +234,7 @@ public: virtual std::string title(); virtual void draw(); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; Rect rect; }; @@ -252,7 +253,7 @@ public: virtual std::string title(); virtual void onTouchesEnded(const std::vector& touches, Event* event); - cocos2d::extension::armature::Armature *armature; + cocostudio::Armature *armature; int weaponIndex; }; #endif // __HELLOWORLD_SCENE_H__ \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp index cac0af8b1c..a7325e0663 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.cpp @@ -7,6 +7,7 @@ using namespace cocos2d; using namespace cocos2d::extension; +using namespace cocostudio; ComponentsTestLayer::~ComponentsTestLayer() { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h index edb704b8b1..152764c4bc 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ComponentsTestScene.h @@ -2,7 +2,7 @@ #define __COMPONENTSTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runComponentsTestLayerTest(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp index 690de6c8ff..9376434f29 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.cpp @@ -2,6 +2,7 @@ #include "SceneController.h" using namespace cocos2d; +using namespace cocostudio; EnemyController::EnemyController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h index 94c655e31d..0025fd6309 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/EnemyController.h @@ -2,10 +2,11 @@ #define __CC_ENEMYCONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" -class EnemyController : public cocos2d::extension::ComController +class EnemyController : public cocostudio::ComController { protected: EnemyController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp index 45ae61cead..83cb56d7df 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.cpp @@ -4,7 +4,7 @@ #include "ProjectileController.h" using namespace cocos2d; -using namespace cocos2d::extension; +using namespace cocostudio; PlayerController::PlayerController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h index 167454777a..671bdf7833 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/PlayerController.h @@ -2,10 +2,11 @@ #define __CC_PLAYERCONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" -class PlayerController : public cocos2d::extension::ComController +class PlayerController : public cocostudio::ComController { protected: PlayerController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp index 3061326118..101565d4fc 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp @@ -3,6 +3,7 @@ #include "EnemyController.h" using namespace cocos2d; +using namespace cocostudio; ProjectileController::ProjectileController(void) { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h index 25bb4c30ec..7ae6b71ab1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.h @@ -2,10 +2,10 @@ #define __CC_PROJECTILECONTROLLER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" - -class ProjectileController : public cocos2d::extension::ComController +class ProjectileController : public cocostudio::ComController { protected: ProjectileController(void); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp index 811423517d..92ee81267f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp @@ -6,6 +6,7 @@ using namespace cocos2d; using namespace cocos2d::extension; +using namespace cocostudio; SceneController::SceneController(void) : _fAddTargetTime(0.0f) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h index 0fcc2f2bf2..4d6efe0c89 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.h @@ -2,10 +2,10 @@ #define __CC_SceneController_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" - -class SceneController : public cocos2d::extension::ComController +class SceneController : public cocostudio::ComController { protected: SceneController(void); @@ -32,7 +32,7 @@ public: protected: cocos2d::Array *_targets; - cocos2d::Array *_projectiles; + cocos2d::Array *_projectiles; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp index 381a093ff9..1ba28914df 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp @@ -1,7 +1,7 @@ #include "CocosGUIScene.h" #include "UISceneManager.h" -//#include "CocosGUIExamplesRegisterScene.h" #include "../ExtensionsTest.h" +#include "cocostudio/CocoStudio.h" const char* gui_scene_names[2] = { @@ -17,9 +17,9 @@ CocosGUITestScene::CocosGUITestScene(bool bPortrait) CocosGUITestScene::~CocosGUITestScene() { - cocos2d::extension::SceneReader::getInstance()->purgeSceneReader(); - cocos2d::extension::ActionManagerEx::purgeActionManager(); - cocos2d::extension::UIHelper::purgeUIHelper(); + cocostudio::SceneReader::getInstance()->purgeSceneReader(); + cocostudio::ActionManagerEx::purgeActionManager(); + gui::UIHelper::purgeUIHelper(); } void CocosGUITestScene::runThisTest() diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h index e1f589eac8..5bf2c93be1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.h @@ -26,11 +26,13 @@ #define __TestCpp__CocosGUIScene__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../../testBasic.h" +#include "gui/CocosGUI.h" using namespace cocos2d; using namespace cocos2d::extension; +using namespace gui; class CocosGUITestScene : public TestScene { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 27ca365d68..b1a288c212 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -61,19 +61,19 @@ void UIButtonTest::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -139,19 +139,19 @@ void UIButtonTest_Scale9::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -213,19 +213,19 @@ void UIButtonTest_PressedAction::touchEvent(Object *pSender, TouchEventType type { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index 3855d5afe3..66b0c64a96 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -67,10 +67,10 @@ bool UICheckBoxTest::init() void UICheckBoxTest::selectedEvent(Object* pSender,CheckBoxEventType type) { switch (type) { - case cocos2d::extension::CHECKBOX_STATE_EVENT_SELECTED: + case gui::CHECKBOX_STATE_EVENT_SELECTED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Selected")->getCString()); break; - case cocos2d::extension::CHECKBOX_STATE_EVENT_UNSELECTED: + case gui::CHECKBOX_STATE_EVENT_UNSELECTED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Unselected")->getCString()); break; default: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp index e4bd80560f..4ac36f958d 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UINodeContainerTest/UINodeContainerTest.cpp @@ -1,7 +1,7 @@ #include "UINodeContainerTest.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" const char* font_UINodeContainerTest = #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp index f1ed704289..a57787dfb1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.cpp @@ -1,9 +1,11 @@ -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "UIScene.h" #include "UISceneManager.h" #include "../ExtensionsTest.h" +using namespace gui; + UIScene::UIScene() : m_pSceneTitle(NULL) , m_pUiLayer(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h index 5e4e724e6c..bf10ffa76b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UIScene.h @@ -26,10 +26,12 @@ #define __TestCpp__UIScene__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "gui/CocosGUI.h" USING_NS_CC; USING_NS_CC_EXT; +using namespace gui; #define UI_SCENE_CREATE_FUNC(UIScene) \ public: \ diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp index 64f7abbd3e..440210eee6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioGUITest/UITextButtonTest/UITextButtonTest.cpp @@ -62,19 +62,19 @@ void UITextButtonTest::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; @@ -139,19 +139,19 @@ void UITextButtonTest_Scale9::touchEvent(Object *pSender, TouchEventType type) { switch (type) { - case cocos2d::extension::TOUCH_EVENT_BEGAN: + case gui::TOUCH_EVENT_BEGAN: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Down")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_MOVED: + case gui::TOUCH_EVENT_MOVED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Move")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_ENDED: + case gui::TOUCH_EVENT_ENDED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Up")->getCString()); break; - case cocos2d::extension::TOUCH_EVENT_CANCELED: + case gui::TOUCH_EVENT_CANCELED: m_pDisplayValueLabel->setText(CCString::createWithFormat("Touch Cancelled")->getCString()); break; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index bd85fa7de6..0ce946c5a6 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -1,17 +1,20 @@ -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../ExtensionsTest.h" #include "SceneEditorTest.h" +#include "cocostudio/CocoStudio.h" +#include "gui/CocosGUI.h" using namespace cocos2d; -using namespace cocos2d::extension; +using namespace cocostudio; +using namespace gui; SceneEditorTestLayer::~SceneEditorTestLayer() { - armature::ArmatureDataManager::getInstance()->destoryInstance(); + ArmatureDataManager::getInstance()->destoryInstance(); SceneReader::getInstance()->purgeSceneReader(); - cocos2d::extension::ActionManagerEx::shareManager()->purgeActionManager(); - cocos2d::extension::UIHelper::instance()->purgeUIHelper(); + ActionManagerEx::shareManager()->purgeActionManager(); + UIHelper::instance()->purgeUIHelper(); } SceneEditorTestLayer::SceneEditorTestLayer() @@ -77,7 +80,7 @@ cocos2d::Node* SceneEditorTestLayer::createGameScene() pNode->addChild(menuBack); //ui action - cocos2d::extension::ActionManagerEx::shareManager()->playActionByName("startMenu_1.json","Animation1"); + ActionManagerEx::shareManager()->playActionByName("startMenu_1.json","Animation1"); return pNode; } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index 186ce364f3..58494ee696 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -2,7 +2,7 @@ #define __SCENEEDITORTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runSceneEditorTestLayer(); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h index 63c482e972..a477774b8e 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class AnimationsTestLayerLoader : public cocos2d::extension::LayerLoader { +class AnimationsTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(AnimationsTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp index 7224f6dc69..934552aed5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; AnimationsTestLayer::AnimationsTestLayer() : mAnimationManager(NULL) @@ -33,7 +34,7 @@ bool AnimationsTestLayer::onAssignCCBMemberVariable(Object * pTarget, const char return false; } -void AnimationsTestLayer::setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager) +void AnimationsTestLayer::setAnimationManager(cocosbuilder::CCBAnimationManager *pAnimationManager) { CC_SAFE_RELEASE_NULL(mAnimationManager); mAnimationManager = pAnimationManager; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h index 207af01c91..2ad6658306 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.h @@ -2,12 +2,13 @@ #define _ANIMATIONSTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" class AnimationsTestLayer : public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(AnimationsTestLayer, create); @@ -24,10 +25,10 @@ public: void onControlButtonJumpClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); void onControlButtonFunkyClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); - void setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager); + void setAnimationManager(cocosbuilder::CCBAnimationManager *pAnimationManager); private: - cocos2d::extension::CCBAnimationManager *mAnimationManager; + cocosbuilder::CCBAnimationManager *mAnimationManager; }; #endif \ No newline at end of file diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp index 17a7ba9d1c..238918e170 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; ButtonTestLayer::ButtonTestLayer() : mControlEventLabel(NULL) @@ -28,7 +29,7 @@ bool ButtonTestLayer::onAssignCCBMemberVariable(Object * pTarget, const char * p return false; } -void ButtonTestLayer::onControlButtonClicked(cocos2d::Object *pSender, cocos2d::extension::Control::EventType pControlEvent) { +void ButtonTestLayer::onControlButtonClicked(cocos2d::Object *pSender, Control::EventType pControlEvent) { switch(pControlEvent) { case Control::EventType::TOUCH_DOWN: this->mControlEventLabel->setString("Touch Down."); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h index fb56110015..1fa38a7e0c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.h @@ -2,12 +2,13 @@ #define _BUTTONTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" class ButtonTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBMemberVariableAssigner - , public cocos2d::extension::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(ButtonTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h index 76b2798739..2729b0d260 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ButtonTestLayerLoader : public cocos2d::extension::LayerLoader { +class ButtonTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ButtonTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp index 7efbe7c920..f63af2aca5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp @@ -28,6 +28,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; void CocosBuilderTestScene::runThisTest() { /* Create an autorelease NodeLoaderLibrary. */ @@ -36,7 +37,7 @@ void CocosBuilderTestScene::runThisTest() { ccNodeLoaderLibrary->registerNodeLoader("HelloCocosBuilderLayer", HelloCocosBuilderLayerLoader::loader()); /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); /* Read a ccbi file. */ auto node = ccbReader->readNodeGraphFromFile("ccb/HelloCocosBuilder.ccbi", this); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 90deb8a29e..5837fdd368 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; HelloCocosBuilderLayer::HelloCocosBuilderLayer() : mBurstSprite(NULL) @@ -34,7 +35,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no } /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); ccbReader->autorelease(); /* Read a ccbi file. */ @@ -61,7 +62,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no } -void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader) { +void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader) { auto ccRotateBy = RotateBy::create(20.0f, 360); auto ccRepeatForever = RepeatForever::create(ccRotateBy); this->mBurstSprite->runAction(ccRepeatForever); @@ -91,7 +92,7 @@ bool HelloCocosBuilderLayer::onAssignCCBMemberVariable(Object * pTarget, const c return false; } -bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue) +bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocosbuilder::CCBValue* pCCBValue) { bool bRet = false; if (pTarget == this) @@ -126,19 +127,19 @@ bool HelloCocosBuilderLayer::onAssignCCBCustomProperty(Object* pTarget, const ch return bRet; } -void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onMenuTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", MenuTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onSpriteTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", SpriteTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onButtonTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", ButtonTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, Control::EventType pControlEvent) { /* Create an autorelease NodeLoaderLibrary. */ NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); @@ -148,7 +149,7 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::e /* Create an autorelease CCBReader. */ - cocos2d::extension::CCBReader * ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary); + cocosbuilder::CCBReader * ccbReader = new cocosbuilder::CCBReader(ccNodeLoaderLibrary); ccbReader->autorelease(); /* Read a ccbi file. */ @@ -179,16 +180,16 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Object * sender, cocos2d::e //this->openTest("TestAnimations.ccbi", "TestAnimationsLayer", AnimationsTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) { +void HelloCocosBuilderLayer::onParticleSystemTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", ParticleSystemTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) +void HelloCocosBuilderLayer::onScrollViewTestClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", ScrollViewTestLayerLoader::loader()); } -void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, cocos2d::extension::Control::EventType pControlEvent) +void HelloCocosBuilderLayer::onTimelineCallbackSoundClicked(Object * sender, Control::EventType pControlEvent) { this->openTest("ccb/ccb/TestTimelineCallback.ccbi", "TimelineCallbackTestLayer", TimelineCallbackTestLayerLoader::loader()); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h index 7a1bdd577f..15a19b5519 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.h @@ -2,7 +2,8 @@ #define _HELLOCOCOSBUILDERLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" /* * Note: for some pretty hard fucked up reason, the order of inheritance is important! @@ -16,9 +17,9 @@ */ class HelloCocosBuilderLayer : public cocos2d::Layer -, public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::CCBMemberVariableAssigner -, public cocos2d::extension::NodeLoaderListener +, public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::CCBMemberVariableAssigner +, public cocosbuilder::NodeLoaderListener { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(HelloCocosBuilderLayer, create); @@ -26,13 +27,13 @@ class HelloCocosBuilderLayer HelloCocosBuilderLayer(); virtual ~HelloCocosBuilderLayer(); - void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocos2d::extension::NodeLoader * nodeLoader = NULL); + void openTest(const char * pCCBFileName, const char * nodeName = NULL, cocosbuilder::NodeLoader * nodeLoader = NULL); virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName, cocos2d::Node * node); - virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocos2d::extension::CCBValue* pCCBValue); - virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); + virtual bool onAssignCCBCustomProperty(Object* pTarget, const char* pMemberVariableName, cocosbuilder::CCBValue* pCCBValue); + virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader); void onMenuTestClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); void onSpriteTestClicked(cocos2d::Object * sender, cocos2d::extension::Control::EventType pControlEvent); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h index 8c1174d575..60067f2dfa 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class HelloCocosBuilderLayerLoader : public cocos2d::extension::LayerLoader { +class HelloCocosBuilderLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(HelloCocosBuilderLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h index e92245029f..3cee0e0d46 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayer.h @@ -2,7 +2,7 @@ #define _LABELTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class LabelTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h index 5ad7f89ac9..acde02a4a2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/LabelTest/LabelTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class LabelTestLayerLoader : public cocos2d::extension::LayerLoader { +class LabelTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp index 5f53a6d61d..f29fd86cad 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; MenuTestLayer::MenuTestLayer() : mMenuItemStatusLabelBMFont(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h index 0f0a22d85d..36c256cf94 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayer.h @@ -2,12 +2,13 @@ #define _MENUTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" class MenuTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver - , public cocos2d::extension::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(MenuTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h index d51a2f3ed5..40b40cb7b2 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/MenuTest/MenuTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class MenuTestLayerLoader : public cocos2d::extension::LayerLoader { +class MenuTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h index 1f41f6e3fd..cf06eb3e87 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayer.h @@ -2,7 +2,7 @@ #define _PARTICLESYSTEMTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class ParticleSystemTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h index c2410c7d8e..e3d8457818 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ParticleSystemTest/ParticleSystemTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ParticleSystemTestLayerLoader : public cocos2d::extension::LayerLoader { +class ParticleSystemTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ParticleSystemTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h index d2d5433fd4..e16039b3ca 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayer.h @@ -2,7 +2,7 @@ #define _SCROLLVIEWTESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class ScrollViewTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h index 17c736a28c..5a2c604ac4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/ScrollViewTest/ScrollViewTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class ScrollViewTestLayerLoader : public cocos2d::extension::LayerLoader { +class ScrollViewTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h index ef053be4d9..488a5c4da9 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayer.h @@ -2,7 +2,7 @@ #define _SPRITETESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class SpriteTestLayer : public cocos2d::Layer { public: diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h index 47aca5a5de..4fbd717017 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/SpriteTest/SpriteTestLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class SpriteTestLayerLoader : public cocos2d::extension::LayerLoader { +class SpriteTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp index 825c08c27f..e54a947bec 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp @@ -2,6 +2,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; SEL_MenuHandler TestHeaderLayer::onResolveCCBCCMenuItemSelector(Object * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onBackClicked", TestHeaderLayer::onBackClicked); @@ -14,7 +15,7 @@ Control::Handler TestHeaderLayer::onResolveCCBCCControlSelector(Object * pTarget return NULL; } -void TestHeaderLayer::onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader) +void TestHeaderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader) { CCLOG("TestHeaderLayer::onNodeLoaded"); } diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h index 936d89d1d6..6adde2aeda 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.h @@ -2,19 +2,20 @@ #define _TESTHEADERLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" class TestHeaderLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver -, public cocos2d::extension::NodeLoaderListener + , public cocosbuilder::CCBSelectorResolver +, public cocosbuilder::NodeLoaderListener { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TestHeaderLayer, create); virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char * pSelectorName); virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char * pSelectorName); - virtual void onNodeLoaded(cocos2d::Node * node, cocos2d::extension::NodeLoader * nodeLoader); + virtual void onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader); void onBackClicked(cocos2d::Object * sender); }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h index a834494c7e..7217c582c5 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayerLoader.h @@ -6,7 +6,7 @@ /* Forward declaration. */ class CCBReader; -class TestHeaderLayerLoader : public cocos2d::extension::LayerLoader { +class TestHeaderLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(TestHeaderLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h index 4e60a97c38..1b08d786ab 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackLayerLoader.h @@ -3,7 +3,7 @@ #include "TimelineCallbackTestLayer.h" -class TimelineCallbackTestLayerLoader : public cocos2d::extension::LayerLoader { +class TimelineCallbackTestLayerLoader : public cocosbuilder::LayerLoader { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(TimelineCallbackTestLayerLoader, loader); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp index 72c85fe9d8..ba9dcbafe0 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp @@ -3,6 +3,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace cocosbuilder; TimelineCallbackTestLayer::TimelineCallbackTestLayer() : _helloLabel(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h index 213c70c1e9..f3d47ca84c 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.h @@ -2,12 +2,13 @@ #define _TIMELINE_TESTLAYER_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocosbuilder/CocosBuilder.h" class TimelineCallbackTestLayer : public cocos2d::Layer - , public cocos2d::extension::CCBSelectorResolver - , public cocos2d::extension::CCBMemberVariableAssigner + , public cocosbuilder::CCBSelectorResolver + , public cocosbuilder::CCBMemberVariableAssigner { public: CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(TimelineCallbackTestLayer, create); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h index 1419606d23..7c5c6839a4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h @@ -24,7 +24,7 @@ */ #include "../CCControlScene.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h index 0d90639cfa..3ca532d095 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h @@ -27,7 +27,7 @@ #define __CCCONTROLSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h index b144555e3f..3eb912624a 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.h @@ -26,7 +26,7 @@ #define __CCCONTROLSCENEMANAGER_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h index 7d9e383bd7..640e359775 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h @@ -10,7 +10,7 @@ #define __TestCpp__CCEditBoxTest__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class EditBoxTest : public cocos2d::Layer, public cocos2d::extension::EditBoxDelegate { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 2242198904..0704192e5f 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -4,6 +4,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; HttpClientTest::HttpClientTest() : _labelStatusCode(NULL) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index c838b7c224..9f7d1d3fa3 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -2,7 +2,8 @@ #define __HTTP_CLIENT_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "network/HttpClient.h" class HttpClientTest : public cocos2d::Layer { @@ -19,7 +20,7 @@ public: void onMenuDeleteTestClicked(cocos2d::Object *sender); //Http Response Callback - void onHttpRequestCompleted(cocos2d::extension::HttpClient *sender, cocos2d::extension::HttpResponse *response); + void onHttpRequestCompleted(network::HttpClient *sender, network::HttpResponse *response); private: cocos2d::LabelTTF* _labelStatusCode; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 0fea620718..58e9650a12 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -12,6 +12,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; SocketIOTestLayer::SocketIOTestLayer(void) : _sioClient(NULL) @@ -206,7 +207,7 @@ void SocketIOTestLayer::onMenuTestEndpointDisconnectClicked(cocos2d::Object *sen // Delegate methods -void SocketIOTestLayer::onConnect(cocos2d::extension::SIOClient* client) +void SocketIOTestLayer::onConnect(network::SIOClient* client) { log("SocketIOTestLayer::onConnect called"); @@ -216,7 +217,7 @@ void SocketIOTestLayer::onConnect(cocos2d::extension::SIOClient* client) } -void SocketIOTestLayer::onMessage(cocos2d::extension::SIOClient* client, const std::string& data) +void SocketIOTestLayer::onMessage(network::SIOClient* client, const std::string& data) { log("SocketIOTestLayer::onMessage received: %s", data.c_str()); @@ -226,7 +227,7 @@ void SocketIOTestLayer::onMessage(cocos2d::extension::SIOClient* client, const s } -void SocketIOTestLayer::onClose(cocos2d::extension::SIOClient* client) +void SocketIOTestLayer::onClose(network::SIOClient* client) { log("SocketIOTestLayer::onClose called"); @@ -246,7 +247,7 @@ void SocketIOTestLayer::onClose(cocos2d::extension::SIOClient* client) } -void SocketIOTestLayer::onError(cocos2d::extension::SIOClient* client, const std::string& data) +void SocketIOTestLayer::onError(network::SIOClient* client, const std::string& data) { log("SocketIOTestLayer::onError received: %s", data.c_str()); diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h index fc1ebd8b2e..56695bb6a4 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h @@ -9,21 +9,21 @@ #define __TestCpp__SocketIOTest__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "network/SocketIO.h" class SocketIOTestLayer : public cocos2d::Layer - , public cocos2d::extension::SocketIO::SIODelegate + , public network::SocketIO::SIODelegate { public: SocketIOTestLayer(void); virtual ~SocketIOTestLayer(void); - virtual void onConnect(cocos2d::extension::SIOClient* client); - virtual void onMessage(cocos2d::extension::SIOClient* client, const std::string& data); - virtual void onClose(cocos2d::extension::SIOClient* client); - virtual void onError(cocos2d::extension::SIOClient* client, const std::string& data); + virtual void onConnect(network::SIOClient* client); + virtual void onMessage(network::SIOClient* client, const std::string& data); + virtual void onClose(network::SIOClient* client); + virtual void onError(network::SIOClient* client, const std::string& data); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -38,10 +38,10 @@ public: void onMenuTestEndpointDisconnectClicked(cocos2d::Object *sender); - void testevent(cocos2d::extension::SIOClient *client, const std::string& data); - void echotest(cocos2d::extension::SIOClient *client, const std::string& data); + void testevent(network::SIOClient *client, const std::string& data); + void echotest(network::SIOClient *client, const std::string& data); - cocos2d::extension::SIOClient *_sioClient, *_sioEndpoint; + network::SIOClient *_sioClient, *_sioEndpoint; cocos2d::LabelTTF *_sioClientStatus; }; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index be60e5405d..39a3ec5cc1 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -11,6 +11,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace network; WebSocketTestLayer::WebSocketTestLayer() : _wsiSendText(NULL) @@ -107,7 +108,7 @@ WebSocketTestLayer::~WebSocketTestLayer() } // Delegate methods -void WebSocketTestLayer::onOpen(cocos2d::extension::WebSocket* ws) +void WebSocketTestLayer::onOpen(network::WebSocket* ws) { log("Websocket (%p) opened", ws); if (ws == _wsiSendText) @@ -124,7 +125,7 @@ void WebSocketTestLayer::onOpen(cocos2d::extension::WebSocket* ws) } } -void WebSocketTestLayer::onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data) +void WebSocketTestLayer::onMessage(network::WebSocket* ws, const network::WebSocket::Data& data) { if (!data.isBinary) { @@ -161,7 +162,7 @@ void WebSocketTestLayer::onMessage(cocos2d::extension::WebSocket* ws, const coco } } -void WebSocketTestLayer::onClose(cocos2d::extension::WebSocket* ws) +void WebSocketTestLayer::onClose(network::WebSocket* ws) { log("websocket instance (%p) closed.", ws); if (ws == _wsiSendText) @@ -180,7 +181,7 @@ void WebSocketTestLayer::onClose(cocos2d::extension::WebSocket* ws) CC_SAFE_DELETE(ws); } -void WebSocketTestLayer::onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error) +void WebSocketTestLayer::onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error) { log("Error was fired, error code: %d", error); if (ws == _wsiError) diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h index 58a781ecf5..fcec4ec724 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h @@ -10,21 +10,21 @@ #define __TestCpp__WebSocketTest__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "network/WebSocket.h" class WebSocketTestLayer : public cocos2d::Layer -, public cocos2d::extension::WebSocket::Delegate +, public network::WebSocket::Delegate { public: WebSocketTestLayer(); virtual ~WebSocketTestLayer(); - virtual void onOpen(cocos2d::extension::WebSocket* ws); - virtual void onMessage(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::Data& data); - virtual void onClose(cocos2d::extension::WebSocket* ws); - virtual void onError(cocos2d::extension::WebSocket* ws, const cocos2d::extension::WebSocket::ErrorCode& error); + virtual void onOpen(network::WebSocket* ws); + virtual void onMessage(network::WebSocket* ws, const network::WebSocket::Data& data); + virtual void onClose(network::WebSocket* ws); + virtual void onError(network::WebSocket* ws, const network::WebSocket::ErrorCode& error); void toExtensionsMainLayer(cocos2d::Object *sender); @@ -33,9 +33,9 @@ public: void onMenuSendBinaryClicked(cocos2d::Object *sender); private: - cocos2d::extension::WebSocket* _wsiSendText; - cocos2d::extension::WebSocket* _wsiSendBinary; - cocos2d::extension::WebSocket* _wsiError; + network::WebSocket* _wsiSendText; + network::WebSocket* _wsiSendBinary; + network::WebSocket* _wsiError; cocos2d::LabelTTF* _sendTextStatus; cocos2d::LabelTTF* _sendBinaryStatus; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index 784b548fa9..f847090b47 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -1,6 +1,6 @@ #include "NotificationCenterTest.h" #include "../ExtensionsTest.h" -#include "support/CCNotificationCenter.h" +#include "CCNotificationCenter.h" #define kTagLight 100 #define kTagConnect 200 diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp index c5674a1443..ee0bfe043b 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp @@ -28,7 +28,7 @@ #include "Scale9SpriteTest.h" #include "testResource.h" #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h index 16a8c74f25..2ee951ca73 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.h @@ -2,7 +2,7 @@ #define __CUSTOMTABELVIEWCELL_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" class CustomTableViewCell : public cocos2d::extension::TableViewCell { diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h index 7becc72781..a505195359 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.h @@ -2,7 +2,7 @@ #define __TABLEVIEWTESTSCENE_H__ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" void runTableViewTest(); diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h index 5c822fc95a..fcfdba36ec 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceAllocTest.h @@ -5,7 +5,7 @@ #define __PERFORMANCE_ALLOC_TEST_H__ #include "PerformanceTest.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" class AllocBasicLayer : public PerformBasicLayer { diff --git a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h index 7c6a1efea4..95ce5914b5 100644 --- a/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h +++ b/samples/Cpp/TestCpp/Classes/PerformanceTest/PerformanceNodeChildrenTest.h @@ -2,7 +2,7 @@ #define __PERFORMANCE_NODE_CHILDREN_TEST_H__ #include "PerformanceTest.h" -#include "support/CCProfiling.h" +#include "CCProfiling.h" class NodeChildrenMenuLayer : public PerformBasicLayer { diff --git a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h index 383c3ee1ac..3e5ba3c9ac 100644 --- a/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h +++ b/samples/Cpp/TestCpp/Classes/SchedulerTest/SchedulerTest.h @@ -2,7 +2,7 @@ #define _SCHEDULER_TEST_H_ #include "cocos2d.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../testBasic.h" #include "../BaseTest.h" diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h index 707793a1c5..33876c724a 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest.h @@ -2,7 +2,7 @@ #define _SHADER_TEST_H_ #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../BaseTest.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h index 797b7a13ca..95ddbc592d 100644 --- a/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h +++ b/samples/Cpp/TestCpp/Classes/ShaderTest/ShaderTest2.h @@ -1,7 +1,7 @@ #ifndef _SHADER_TEST2_H_ #define _SHADER_TEST2_H_ #include "../testBasic.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" #include "../BaseTest.h" USING_NS_CC_EXT; diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp index 0912cb419e..385be5b1c1 100644 --- a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp +++ b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.cpp @@ -27,10 +27,11 @@ #include #include #include + #include "spine/spine.h" using namespace cocos2d; -using namespace cocos2d::extension; using namespace std; +using namespace spine; //------------------------------------------------------------------ // diff --git a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h index 95f4c9b249..58c4b13d0f 100644 --- a/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h +++ b/samples/Cpp/TestCpp/Classes/SpineTest/SpineTest.h @@ -38,7 +38,7 @@ public: class SpineTestLayer: public cocos2d::Layer { private: - cocos2d::extension::CCSkeletonAnimation* skeletonNode; + spine::CCSkeletonAnimation* skeletonNode; public: diff --git a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp index 0cf00124d1..5aea719250 100644 --- a/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp +++ b/samples/Cpp/TestCpp/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp @@ -1,6 +1,6 @@ #include "TextureAtlasEncryptionTest.h" #include "../testResource.h" -#include "support/zip_support/ZipUtils.h" +#include "ZipUtils.h" std::string TextureAtlasEncryptionDemo::title() { diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/samples/Cpp/TestCpp/Classes/testBasic.cpp index 77f3476e51..4f7614f701 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.cpp +++ b/samples/Cpp/TestCpp/Classes/testBasic.cpp @@ -1,6 +1,7 @@ #include "testBasic.h" #include "controller.h" -#include "cocos-ext.h" +#include "extensions/cocos-ext.h" +#include "cocostudio/CocoStudio.h" TestScene::TestScene(bool bPortrait) { @@ -50,7 +51,7 @@ void TestScene::onEnter() scene->release(); } - cocos2d::extension::armature::ArmatureDataManager::destoryInstance(); + cocostudio::ArmatureDataManager::destoryInstance(); }); auto menu =Menu::create(menuItem, NULL); diff --git a/samples/Cpp/TestCpp/proj.android/build_native.sh b/samples/Cpp/TestCpp/proj.android/build_native.sh index ab5cdc78f8..69464cc437 100755 --- a/samples/Cpp/TestCpp/proj.android/build_native.sh +++ b/samples/Cpp/TestCpp/proj.android/build_native.sh @@ -95,4 +95,4 @@ rm -f "$APP_ANDROID_ROOT"/assets/Images/test_1021x1024_a8.pvr.gz echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos" diff --git a/samples/Cpp/TestCpp/proj.android/jni/Android.mk b/samples/Cpp/TestCpp/proj.android/jni/Android.mk index d72618a488..7867f3f1fb 100644 --- a/samples/Cpp/TestCpp/proj.android/jni/Android.mk +++ b/samples/Cpp/TestCpp/proj.android/jni/Android.mk @@ -8,21 +8,10 @@ LOCAL_MODULE_FILENAME := libtestcpp LOCAL_SRC_FILES := testcpp/main.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes +LOCAL_C_INCLUDES := ../../Classes LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static include $(BUILD_SHARED_LIBRARY) $(call import-module,samples/Cpp/TestCpp) -$(call import-module,cocos2dx) -$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) -$(call import-module,audio/android) -$(call import-module,extensions) -$(call import-module,external/Box2D) -$(call import-module,cocos2dx/platform/android) diff --git a/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id b/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id index 0c90afdb6d..9874ec6979 100644 --- a/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id +++ b/samples/Cpp/TestCpp/proj.mac/Icon.icns.REMOVED.git-id @@ -1 +1 @@ -2040fc6fe624353ae1d3db50cd3d450f4fda5afc \ No newline at end of file +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp index 3530e7e4fe..3276d5deda 100644 --- a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp +++ b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp @@ -36,6 +36,8 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setProjection(Director::Projection::_2D); + FileUtils::getInstance()->addSearchPath("script"); + auto screenSize = EGLView::getInstance()->getFrameSize(); auto designSize = Size(320, 480); diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/CocosDragonJS/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp index 5b607d407c..27520db220 100644 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp +++ b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp @@ -31,13 +31,14 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setOpenGLView(EGLView::getInstance()); pDirector->setProjection(Director::Projection::_2D); + FileUtils::getInstance()->addSearchPath("script"); auto screenSize = EGLView::getInstance()->getFrameSize(); auto designSize = Size(320, 480); auto resourceSize = Size(320, 480); - std::vector searchPaths; + std::vector searchPaths = FileUtils::getInstance()->getSearchPaths(); std::vector resDirOrders; Application::Platform platform = Application::getInstance()->getTargetPlatform(); diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/CrystalCraze/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp index 0f69f2cff7..7e7a33a156 100644 --- a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp +++ b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp @@ -40,7 +40,7 @@ bool AppDelegate::applicationDidFinishLaunching() // set FPS. the default value is 1.0/60 if you don't call this pDirector->setAnimationInterval(1.0 / 60); - FileUtils::getInstance()->addSearchPath("js"); + FileUtils::getInstance()->addSearchPath("script"); ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/MoonWarriors/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index 5d81a72e32..51ebd8d85f 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -42,7 +42,7 @@ bool AppDelegate::applicationDidFinishLaunching() pDirector->setAnimationInterval(1.0 / 60); FileUtils::getInstance()->addSearchPath("res"); - FileUtils::getInstance()->addSearchPath("js"); + FileUtils::getInstance()->addSearchPath("script"); ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); diff --git a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id b/samples/Javascript/TestJavascript/game.js.REMOVED.git-id deleted file mode 100644 index fffc005595..0000000000 --- a/samples/Javascript/TestJavascript/game.js.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -d6662088eb795b38f78febad2e46bd92ef24fb56 \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/obfuscate.xml b/samples/Javascript/TestJavascript/obfuscate.xml deleted file mode 100644 index 8c16f77347..0000000000 --- a/samples/Javascript/TestJavascript/obfuscate.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns b/samples/Javascript/TestJavascript/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Javascript/TestJavascript/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/TestJavascript/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp index dcfdb8e970..3e9c616b35 100644 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp +++ b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp @@ -38,6 +38,8 @@ bool AppDelegate::applicationDidFinishLaunching() EGLView::getInstance()->setDesignResolutionSize(480, 320, ResolutionPolicy::FIXED_HEIGHT); + FileUtils::getInstance()->addSearchPath("script"); + ScriptingCore* sc = ScriptingCore::getInstance(); sc->addRegisterCallback(register_all_cocos2dx); sc->addRegisterCallback(register_all_cocos2dx_extension); diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Javascript/WatermelonWithMe/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/HelloLua/Classes/AppDelegate.cpp b/samples/Lua/HelloLua/Classes/AppDelegate.cpp index 1e2cef387a..d693936216 100644 --- a/samples/Lua/HelloLua/Classes/AppDelegate.cpp +++ b/samples/Lua/HelloLua/Classes/AppDelegate.cpp @@ -1,7 +1,7 @@ #include "cocos2d.h" #include "AppDelegate.h" #include "SimpleAudioEngine.h" -#include "script_support/CCScriptSupport.h" +#include "CCScriptSupport.h" #include "CCLuaEngine.h" USING_NS_CC; diff --git a/samples/Lua/HelloLua/proj.android/build_native.sh b/samples/Lua/HelloLua/proj.android/build_native.sh index 7a7144497f..47bf4396ad 100755 --- a/samples/Lua/HelloLua/proj.android/build_native.sh +++ b/samples/Lua/HelloLua/proj.android/build_native.sh @@ -108,9 +108,9 @@ done if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}" else echo "Using prebuilt externals" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ - "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" + "NDK_MODULE_PATH=${COCOS2DX_ROOT}/external:${COCOS2DX_ROOT}/cocos:${COCOS2DX_ROOT}" fi diff --git a/samples/Lua/HelloLua/proj.android/jni/Android.mk b/samples/Lua/HelloLua/proj.android/jni/Android.mk index e4aa117413..09d83731fb 100644 --- a/samples/Lua/HelloLua/proj.android/jni/Android.mk +++ b/samples/Lua/HelloLua/proj.android/jni/Android.mk @@ -11,16 +11,9 @@ LOCAL_SRC_FILES := hellolua/main.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes -LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_lua_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static + include $(BUILD_SHARED_LIBRARY) -$(call import-module,cocos2dx) -$(call import-module,audio/android) $(call import-module,scripting/lua/proj.android) -$(call import-module,extensions) -$(call import-module,cocos2dx/platform/android) diff --git a/samples/Lua/HelloLua/proj.mac/Icon.icns b/samples/Lua/HelloLua/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Lua/HelloLua/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Lua/HelloLua/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/samples/Lua/TestLua/proj.mac/Icon.icns b/samples/Lua/TestLua/proj.mac/Icon.icns deleted file mode 100644 index 285dee82b3..0000000000 Binary files a/samples/Lua/TestLua/proj.mac/Icon.icns and /dev/null differ diff --git a/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id b/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id new file mode 100644 index 0000000000..9874ec6979 --- /dev/null +++ b/samples/Lua/TestLua/proj.mac/Icon.icns.REMOVED.git-id @@ -0,0 +1 @@ +3d09e8fb4f4ca1c1ae7ab0a6948db592c7c3d9a0 \ No newline at end of file diff --git a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj index 3f7b3750a3..fdf23b3796 100644 --- a/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj +++ b/template/multi-platform-cpp/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj @@ -7,12 +7,16 @@ objects = { /* Begin PBXBuildFile section */ - 1ACB3244164770DE00914215 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACB3243164770DE00914215 /* libcurl.a */; }; - 1AF4C2F417865DCB00122817 /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E317865D9500122817 /* libbox2d iOS.a */; }; - 1AF4C2F517865DCB00122817 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */; }; - 1AF4C2F617865DCB00122817 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */; }; - 1AF4C2F717865DCB00122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */; }; - 1AF4C2F817865DCB00122817 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */; }; + 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */; }; + 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */; }; + 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */; }; + 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */; }; + 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */; }; + 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */; }; + 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */; }; + 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */; }; + 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */; }; + 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */; }; 1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; }; 1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; }; 1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; @@ -27,11 +31,6 @@ 503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503AE0FF17EB989F00D1A890 /* RootViewController.mm */; }; 503AE10517EB98FF00D1A890 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503AE10317EB98FF00D1A890 /* main.cpp */; }; 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11117EB99EE00D1A890 /* libcurl.dylib */; }; - 503AE11317EB9C0700D1A890 /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D517865D9500122817 /* libbox2d Mac.a */; }; - 503AE11417EB9C0700D1A890 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */; }; - 503AE11517EB9C0700D1A890 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */; }; - 503AE11617EB9C0700D1A890 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */; }; - 503AE11717EB9C0700D1A890 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */; }; 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 503AE11A17EB9C5A00D1A890 /* IOKit.framework */; }; 5087E75317EB910900C73F5D /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; }; 5087E75417EB910900C73F5D /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; }; @@ -73,179 +72,179 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1AF4C2CE17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1551A33F158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 1AF4C2D017865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFA180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2FD617814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 1AF4C2D217865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFC180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2CB81780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 1AF4C2D417865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FAFE180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2D9B1780BDF7006731B9; remoteInfo = "box2d Mac"; }; - 1AF4C2D617865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB00180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AF4C2D817865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F31FD1781479B006731B9; remoteInfo = "jsbindings Mac"; }; - 1AF4C2DA17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A6FB53017854BC300CDF010; remoteInfo = "luabindings Mac"; }; - 1AF4C2DC17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4D641783777C0073F6A7; remoteInfo = "cocos2dx iOS"; }; - 1AF4C2DE17865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB08180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4EFC1783867C0073F6A7; remoteInfo = "cocos2dx-extensions iOS"; }; - 1AF4C2E017865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0A180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F3B178387670073F6A7; remoteInfo = "chipmunk iOS"; }; - 1AF4C2E217865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0C180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F9E1783876B0073F6A7; remoteInfo = "box2d iOS"; }; - 1AF4C2E417865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB0E180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AF4C2E617865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A5030178387750073F6A7; remoteInfo = "jsbindings iOS"; }; - 1AF4C2E817865D9500122817 /* PBXContainerItemProxy */ = { + 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A119791178526AA00D62A44; remoteInfo = "luabindings iOS"; }; - 1AF4C2EA17865DB400122817 /* PBXContainerItemProxy */ = { + 1AC6FB15180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4C241783777C0073F6A7; - remoteInfo = "cocos2dx iOS"; - }; - 1AF4C2EC17865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4E111783867C0073F6A7; - remoteInfo = "cocos2dx-extensions iOS"; - }; - 1AF4C2EE17865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4EFD178387670073F6A7; - remoteInfo = "chipmunk iOS"; - }; - 1AF4C2F017865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4F3C1783876B0073F6A7; - remoteInfo = "box2d iOS"; - }; - 1AF4C2F217865DB400122817 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4F9F178387730073F6A7; - remoteInfo = "CocosDenshion iOS"; - }; - 503AE10717EB99BC00D1A890 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = 1551A33E158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 503AE10917EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB17180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2FC117814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 503AE10B17EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB19180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2B781780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 503AE10D17EB99BC00D1A890 /* PBXContainerItemProxy */ = { + 1AC6FB1B180E9959004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A03F2D5D1780BDF7006731B9; - remoteInfo = "box2d Mac"; - }; - 503AE10F17EB99BC00D1A890 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; proxyType = 1; remoteGlobalIDString = A03F2E9817814268006731B9; remoteInfo = "CocosDenshion Mac"; }; + 1AC6FB1D180E9963004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2D5D1780BDF7006731B9; + remoteInfo = "box2d Mac"; + }; + 1AC6FB24180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1AC6FB26180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1AC6FB28180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1AC6FB2A180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F3C1783876B0073F6A7; + remoteInfo = "box2d iOS"; + }; + 1AC6FB2C180E99E1004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1ACB3243164770DE00914215 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; - 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; 1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; @@ -303,13 +302,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1AC6FB2E180E99EB004C840B /* libbox2d iOS.a in Frameworks */, + 1AC6FB2F180E99EB004C840B /* libchipmunk iOS.a in Frameworks */, + 1AC6FB30180E99EB004C840B /* libcocos2dx iOS.a in Frameworks */, + 1AC6FB31180E99EB004C840B /* libcocos2dx-extensions iOS.a in Frameworks */, + 1AC6FB32180E99EB004C840B /* libCocosDenshion iOS.a in Frameworks */, D6B0611B1803AB670077942B /* CoreMotion.framework in Frameworks */, - 1AF4C2F417865DCB00122817 /* libbox2d iOS.a in Frameworks */, - 1AF4C2F517865DCB00122817 /* libchipmunk iOS.a in Frameworks */, - 1AF4C2F617865DCB00122817 /* libcocos2dx iOS.a in Frameworks */, - 1AF4C2F717865DCB00122817 /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AF4C2F817865DCB00122817 /* libCocosDenshion iOS.a in Frameworks */, - 1ACB3244164770DE00914215 /* libcurl.a in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, @@ -326,11 +324,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 503AE11317EB9C0700D1A890 /* libbox2d Mac.a in Frameworks */, - 503AE11417EB9C0700D1A890 /* libchipmunk Mac.a in Frameworks */, - 503AE11517EB9C0700D1A890 /* libcocos2dx Mac.a in Frameworks */, - 503AE11617EB9C0700D1A890 /* libcocos2dx-extensions Mac.a in Frameworks */, - 503AE11717EB9C0700D1A890 /* libCocosDenshion Mac.a in Frameworks */, + 1AC6FB1F180E996B004C840B /* libbox2d Mac.a in Frameworks */, + 1AC6FB20180E996B004C840B /* libchipmunk Mac.a in Frameworks */, + 1AC6FB21180E996B004C840B /* libcocos2dx Mac.a in Frameworks */, + 1AC6FB22180E996B004C840B /* libcocos2dx-extensions Mac.a in Frameworks */, + 1AC6FB23180E996B004C840B /* libCocosDenshion Mac.a in Frameworks */, 503AE11217EB99EE00D1A890 /* libcurl.dylib in Frameworks */, 5087E76717EB910900C73F5D /* libz.dylib in Frameworks */, 503AE11B17EB9C5A00D1A890 /* IOKit.framework in Frameworks */, @@ -384,23 +382,23 @@ name = Products; sourceTree = ""; }; - 1AF4C2BC17865D9500122817 /* Products */ = { + 1AC6FAE6180E9839004C840B /* Products */ = { isa = PBXGroup; children = ( - 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */, - 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */, - 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */, - 1AF4C2D517865D9500122817 /* libbox2d Mac.a */, - 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */, - 1AF4C2D917865D9500122817 /* libjsbindings Mac.a */, - 1AF4C2DB17865D9500122817 /* libluabindings Mac.a */, - 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */, - 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */, - 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */, - 1AF4C2E317865D9500122817 /* libbox2d iOS.a */, - 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */, - 1AF4C2E717865D9500122817 /* libjsbindings iOS.a */, - 1AF4C2E917865D9500122817 /* libluabindings iOS.a */, + 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */, + 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */, + 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */, + 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */, + 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */, + 1AC6FB05180E9839004C840B /* libluabindings Mac.a */, + 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */, + 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */, + 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */, + 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */, + 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */, + 1AC6FB13180E9839004C840B /* libluabindings iOS.a */, ); name = Products; sourceTree = ""; @@ -408,7 +406,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */, + 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */, 15AA9C4015B7EC450033D6C2 /* Classes */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 080E96DDFE201D6D7F000001 /* ios */, @@ -511,11 +509,11 @@ buildRules = ( ); dependencies = ( - 1AF4C2EB17865DB400122817 /* PBXTargetDependency */, - 1AF4C2ED17865DB400122817 /* PBXTargetDependency */, - 1AF4C2EF17865DB400122817 /* PBXTargetDependency */, - 1AF4C2F117865DB400122817 /* PBXTargetDependency */, - 1AF4C2F317865DB400122817 /* PBXTargetDependency */, + 1AC6FB25180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB27180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB29180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB2B180E99E1004C840B /* PBXTargetDependency */, + 1AC6FB2D180E99E1004C840B /* PBXTargetDependency */, ); name = "HelloCpp iOS"; productName = iphone; @@ -533,11 +531,11 @@ buildRules = ( ); dependencies = ( - 503AE10817EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10A17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10C17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE10E17EB99BC00D1A890 /* PBXTargetDependency */, - 503AE11017EB99BC00D1A890 /* PBXTargetDependency */, + 1AC6FB1E180E9963004C840B /* PBXTargetDependency */, + 1AC6FB16180E9959004C840B /* PBXTargetDependency */, + 1AC6FB18180E9959004C840B /* PBXTargetDependency */, + 1AC6FB1A180E9959004C840B /* PBXTargetDependency */, + 1AC6FB1C180E9959004C840B /* PBXTargetDependency */, ); name = "HelloCpp Mac"; productName = iphone; @@ -571,8 +569,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 1AF4C2BC17865D9500122817 /* Products */; - ProjectRef = 1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */; + ProductGroup = 1AC6FAE6180E9839004C840B /* Products */; + ProjectRef = 1AC6FAE5180E9839004C840B /* cocos2d_libs.xcodeproj */; }, ); projectRoot = ""; @@ -584,102 +582,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AF4C2CF17865D9500122817 /* libcocos2dx Mac.a */ = { + 1AC6FAF9180E9839004C840B /* libcocos2dx Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx Mac.a"; - remoteRef = 1AF4C2CE17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAF8180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D117865D9500122817 /* libcocos2dx-extensions Mac.a */ = { + 1AC6FAFB180E9839004C840B /* libcocos2dx-extensions Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions Mac.a"; - remoteRef = 1AF4C2D017865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFA180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D317865D9500122817 /* libchipmunk Mac.a */ = { + 1AC6FAFD180E9839004C840B /* libchipmunk Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk Mac.a"; - remoteRef = 1AF4C2D217865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFC180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D517865D9500122817 /* libbox2d Mac.a */ = { + 1AC6FAFF180E9839004C840B /* libbox2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d Mac.a"; - remoteRef = 1AF4C2D417865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FAFE180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D717865D9500122817 /* libCocosDenshion Mac.a */ = { + 1AC6FB01180E9839004C840B /* libCocosDenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion Mac.a"; - remoteRef = 1AF4C2D617865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB00180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2D917865D9500122817 /* libjsbindings Mac.a */ = { + 1AC6FB03180E9839004C840B /* libjsbindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings Mac.a"; - remoteRef = 1AF4C2D817865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB02180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DB17865D9500122817 /* libluabindings Mac.a */ = { + 1AC6FB05180E9839004C840B /* libluabindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings Mac.a"; - remoteRef = 1AF4C2DA17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB04180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DD17865D9500122817 /* libcocos2dx iOS.a */ = { + 1AC6FB07180E9839004C840B /* libcocos2dx iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx iOS.a"; - remoteRef = 1AF4C2DC17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB06180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */ = { + 1AC6FB09180E9839004C840B /* libcocos2dx-extensions iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions iOS.a"; - remoteRef = 1AF4C2DE17865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB08180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E117865D9500122817 /* libchipmunk iOS.a */ = { + 1AC6FB0B180E9839004C840B /* libchipmunk iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk iOS.a"; - remoteRef = 1AF4C2E017865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0A180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E317865D9500122817 /* libbox2d iOS.a */ = { + 1AC6FB0D180E9839004C840B /* libbox2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d iOS.a"; - remoteRef = 1AF4C2E217865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0C180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */ = { + 1AC6FB0F180E9839004C840B /* libCocosDenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion iOS.a"; - remoteRef = 1AF4C2E417865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB0E180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E717865D9500122817 /* libjsbindings iOS.a */ = { + 1AC6FB11180E9839004C840B /* libjsbindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings iOS.a"; - remoteRef = 1AF4C2E617865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB10180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C2E917865D9500122817 /* libluabindings iOS.a */ = { + 1AC6FB13180E9839004C840B /* libluabindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings iOS.a"; - remoteRef = 1AF4C2E817865D9500122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB12180E9839004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -750,55 +748,55 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1AF4C2EB17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "cocos2dx iOS"; - targetProxy = 1AF4C2EA17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2ED17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "cocos2dx-extensions iOS"; - targetProxy = 1AF4C2EC17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2EF17865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "chipmunk iOS"; - targetProxy = 1AF4C2EE17865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2F117865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "box2d iOS"; - targetProxy = 1AF4C2F017865DB400122817 /* PBXContainerItemProxy */; - }; - 1AF4C2F317865DB400122817 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CocosDenshion iOS"; - targetProxy = 1AF4C2F217865DB400122817 /* PBXContainerItemProxy */; - }; - 503AE10817EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB16180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx Mac"; - targetProxy = 503AE10717EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB15180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10A17EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB18180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx-extensions Mac"; - targetProxy = 503AE10917EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB17180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10C17EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB1A180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "chipmunk Mac"; - targetProxy = 503AE10B17EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB19180E9959004C840B /* PBXContainerItemProxy */; }; - 503AE10E17EB99BC00D1A890 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "box2d Mac"; - targetProxy = 503AE10D17EB99BC00D1A890 /* PBXContainerItemProxy */; - }; - 503AE11017EB99BC00D1A890 /* PBXTargetDependency */ = { + 1AC6FB1C180E9959004C840B /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "CocosDenshion Mac"; - targetProxy = 503AE10F17EB99BC00D1A890 /* PBXContainerItemProxy */; + targetProxy = 1AC6FB1B180E9959004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB1E180E9963004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "box2d Mac"; + targetProxy = 1AC6FB1D180E9963004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB25180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1AC6FB24180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB27180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1AC6FB26180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB29180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1AC6FB28180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB2B180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "box2d iOS"; + targetProxy = 1AC6FB2A180E99E1004C840B /* PBXContainerItemProxy */; + }; + 1AC6FB2D180E99E1004C840B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1AC6FB2C180E99E1004C840B /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -806,7 +804,7 @@ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -821,24 +819,13 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../audio/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; @@ -848,7 +835,7 @@ 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = NO; @@ -861,24 +848,13 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../audio/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/ios/Simulation\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; USER_HEADER_SEARCH_PATHS = ""; @@ -888,7 +864,7 @@ 5087E76D17EB910900C73F5D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -904,22 +880,12 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; @@ -927,7 +893,7 @@ 5087E76E17EB910900C73F5D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -941,22 +907,12 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../../CocosDenshion/include", - "\"$(SRCROOT)/../../../external/chipmunk/include/constraints\"", - "\"$(SRCROOT)/../../../external/chipmunk/include/chipmunk\"", - "\"$(SRCROOT)/../../../extensions\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "\"$(SRCROOT)/../../../external\"", - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/include\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); + LIBRARY_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = ""; }; name = Release; @@ -970,6 +926,21 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + ); ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; @@ -983,6 +954,21 @@ CLANG_CXX_LIBRARY = "libc++"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", + ); OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; diff --git a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj index dbc340d66f..82228bc55f 100644 --- a/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj +++ b/template/multi-platform-js/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj @@ -7,35 +7,47 @@ objects = { /* Begin PBXBuildFile section */ + 1A6767FA180E9B160076BC67 /* debugger in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767ED180E9B160076BC67 /* debugger */; }; + 1A6767FB180E9B160076BC67 /* debugger in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767ED180E9B160076BC67 /* debugger */; }; + 1A676829180E9C060076BC67 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */; }; + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */; }; + 1A67682B180E9C060076BC67 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */; }; + 1A67682C180E9C060076BC67 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */; }; + 1A67682D180E9C060076BC67 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */; }; + 1A676838180E9C1E0076BC67 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */; }; + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */; }; + 1A67683A180E9C1E0076BC67 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */; }; + 1A67683B180E9C1E0076BC67 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */; }; + 1A67683C180E9C1E0076BC67 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */; }; + 1A67683E180E9CE90076BC67 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */; }; + 1A67683F180E9CE90076BC67 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */; }; + 1A676840180E9CE90076BC67 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */; }; + 1A676841180E9CE90076BC67 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */; }; + 1A676842180E9CE90076BC67 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */; }; + 1A676843180E9CE90076BC67 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */; }; + 1A676844180E9CE90076BC67 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F4180E9B160076BC67 /* jsb_debugger.js */; }; + 1A676845180E9CE90076BC67 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */; }; + 1A676846180E9CE90076BC67 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */; }; + 1A676847180E9CE90076BC67 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F7180E9B160076BC67 /* jsb_opengl.js */; }; + 1A676848180E9CE90076BC67 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F8180E9B160076BC67 /* jsb_sys.js */; }; + 1A676849180E9CE90076BC67 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F9180E9B160076BC67 /* jsb.js */; }; + 1A67684A180E9CF10076BC67 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */; }; + 1A67684B180E9CF10076BC67 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */; }; + 1A67684C180E9CF10076BC67 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */; }; + 1A67684D180E9CF10076BC67 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */; }; + 1A67684E180E9CF10076BC67 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */; }; + 1A67684F180E9CF10076BC67 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */; }; + 1A676850180E9CF10076BC67 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F4180E9B160076BC67 /* jsb_debugger.js */; }; + 1A676851180E9CF10076BC67 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */; }; + 1A676852180E9CF10076BC67 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */; }; + 1A676853180E9CF10076BC67 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F7180E9B160076BC67 /* jsb_opengl.js */; }; + 1A676854180E9CF10076BC67 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F8180E9B160076BC67 /* jsb_sys.js */; }; + 1A676855180E9CF10076BC67 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A6767F9180E9B160076BC67 /* jsb.js */; }; 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */; }; - 1A96A4F3174A3432008653A9 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A96A4F2174A3432008653A9 /* libcurl.a */; }; 1AE4B40416D1FECD003C6D1C /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40116D1FECD003C6D1C /* res */; }; 1AE4B40516D1FECD003C6D1C /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40216D1FECD003C6D1C /* src */; }; 1AE4B40616D1FF4C003C6D1C /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40016D1FECD003C6D1C /* main.js */; }; - 1AF4C33317865EC500122817 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */; }; - 1AF4C33417865EC500122817 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */; }; - 1AF4C33517865EC500122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */; }; - 1AF4C33617865EC500122817 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */; }; - 1AF4C33717865EC500122817 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */; }; - 1AF4C35117865F7400122817 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */; }; - 1AF4C35217865F7400122817 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */; }; - 1AF4C35317865F7400122817 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */; }; - 1AF4C35417865F7400122817 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */; }; - 1AF4C35517865F7400122817 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */; }; - 1AF4C35617865F7400122817 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */; }; - 1AF4C35717865F7400122817 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33F17865F1600122817 /* jsb_debugger.js */; }; - 1AF4C35817865F7400122817 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */; }; - 1AF4C35917865F7400122817 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34117865F1600122817 /* jsb_opengl.js */; }; - 1AF4C35A17865F7400122817 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34217865F1600122817 /* jsb_sys.js */; }; - 1AF4C35B17865F7400122817 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34317865F1600122817 /* jsb.js */; }; - 1AF4C35C17865F7400122817 /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34417865F1600122817 /* main.debug.js */; }; - 466AF679179FC7EE002EE9BB /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */; }; 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 502380DB17EBB88200990C9B /* libcurl.dylib */; }; - 502380DD17EBB89A00990C9B /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */; }; - 502380DE17EBB89A00990C9B /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */; }; - 502380DF17EBB89A00990C9B /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */; }; - 502380E017EBB89A00990C9B /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */; }; - 502380E117EBB89A00990C9B /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */; }; 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731417ECDF7A00D62437 /* Icon-29.png */; }; 5091731B17ECDF7A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731517ECDF7A00D62437 /* Icon-40.png */; }; 5091731C17ECDF7A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091731617ECDF7A00D62437 /* Icon-50.png */; }; @@ -51,19 +63,6 @@ 509D4A8E17EBB24E00697056 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A92275491517C094001B78AA /* AVFoundation.framework */; }; 509D4A9017EBB24E00697056 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; }; 509D4A9117EBB24E00697056 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; }; - 509D4A9417EBB24E00697056 /* jsb_deprecated.js in Resources */ = {isa = PBXBuildFile; fileRef = 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */; }; - 509D4A9517EBB24E00697056 /* jsb_chipmunk_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */; }; - 509D4A9617EBB24E00697056 /* jsb_chipmunk.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */; }; - 509D4A9717EBB24E00697056 /* jsb_cocos2d_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */; }; - 509D4A9817EBB24E00697056 /* jsb_cocos2d_extension.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */; }; - 509D4A9917EBB24E00697056 /* jsb_cocos2d.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */; }; - 509D4A9A17EBB24E00697056 /* jsb_cocosbuilder.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */; }; - 509D4A9B17EBB24E00697056 /* jsb_debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C33F17865F1600122817 /* jsb_debugger.js */; }; - 509D4A9C17EBB24E00697056 /* jsb_opengl_constants.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */; }; - 509D4A9D17EBB24E00697056 /* jsb_opengl.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34117865F1600122817 /* jsb_opengl.js */; }; - 509D4A9E17EBB24E00697056 /* jsb_sys.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34217865F1600122817 /* jsb_sys.js */; }; - 509D4A9F17EBB24E00697056 /* jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34317865F1600122817 /* jsb.js */; }; - 509D4AA017EBB24E00697056 /* main.debug.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AF4C34417865F1600122817 /* main.debug.js */; }; 509D4AA117EBB24E00697056 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40016D1FECD003C6D1C /* main.js */; }; 509D4AA517EBB24E00697056 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40116D1FECD003C6D1C /* res */; }; 509D4AA617EBB24E00697056 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1AE4B40216D1FECD003C6D1C /* src */; }; @@ -99,140 +98,196 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1AF4C30D17865E8F00122817 /* PBXContainerItemProxy */ = { + 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = "cocos2dx Mac"; + }; + 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2FC117814595006731B9; + remoteInfo = "cocos2dx-extensions Mac"; + }; + 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2B781780BD04006731B9; + remoteInfo = "chipmunk Mac"; + }; + 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F2E9817814268006731B9; + remoteInfo = "CocosDenshion Mac"; + }; + 1A676827180E9BF70076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A03F31E81781479B006731B9; + remoteInfo = "jsbindings Mac"; + }; + 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 1A676830180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 1A676832180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 1A676834180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + 1A676836180E9C110076BC67 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4FB5178387750073F6A7; + remoteInfo = "jsbindings iOS"; + }; + 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1551A33F158F2AB200E66CFE; remoteInfo = "cocos2dx Mac"; }; - 1AF4C30F17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2FD617814595006731B9; remoteInfo = "cocos2dx-extensions Mac"; }; - 1AF4C31117865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2CB81780BD04006731B9; remoteInfo = "chipmunk Mac"; }; - 1AF4C31317865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2D9B1780BDF7006731B9; remoteInfo = "box2d Mac"; }; - 1AF4C31517865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F2ED617814268006731B9; remoteInfo = "CocosDenshion Mac"; }; - 1AF4C31717865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB51180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A03F31FD1781479B006731B9; remoteInfo = "jsbindings Mac"; }; - 1AF4C31917865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB53180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A6FB53017854BC300CDF010; remoteInfo = "luabindings Mac"; }; - 1AF4C31B17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4D641783777C0073F6A7; remoteInfo = "cocos2dx iOS"; }; - 1AF4C31D17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4EFC1783867C0073F6A7; remoteInfo = "cocos2dx-extensions iOS"; }; - 1AF4C31F17865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F3B178387670073F6A7; remoteInfo = "chipmunk iOS"; }; - 1AF4C32117865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4F9E1783876B0073F6A7; remoteInfo = "box2d iOS"; }; - 1AF4C32317865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A4FB4178387730073F6A7; remoteInfo = "CocosDenshion iOS"; }; - 1AF4C32517865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB5F180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = A07A5030178387750073F6A7; remoteInfo = "jsbindings iOS"; }; - 1AF4C32717865E8F00122817 /* PBXContainerItemProxy */ = { + 1AC6FB61180E9ACB004C840B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + containerPortal = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; proxyType = 2; remoteGlobalIDString = 1A119791178526AA00D62A44; remoteInfo = "luabindings iOS"; }; - 502380EE17EBB8C500990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A03F2E8E178141C1006731B9; - remoteInfo = "build-all-libs Mac"; - }; - 502380F017EBB8FD00990C9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = A07A4E0B178386390073F6A7; - remoteInfo = "build-all-libs iOS"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1A6767ED180E9B160076BC67 /* debugger */ = {isa = PBXFileReference; lastKnownFileType = folder; name = debugger; path = ../../../cocos/scripting/javascript/script/debugger; sourceTree = ""; }; + 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk_constants.js; sourceTree = ""; }; + 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../../../cocos/scripting/javascript/script/jsb_chipmunk.js; sourceTree = ""; }; + 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_constants.js; sourceTree = ""; }; + 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d_extension.js; sourceTree = ""; }; + 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../../../cocos/scripting/javascript/script/jsb_cocos2d.js; sourceTree = ""; }; + 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../../../cocos/scripting/javascript/script/jsb_cocosbuilder.js; sourceTree = ""; }; + 1A6767F4180E9B160076BC67 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../../../cocos/scripting/javascript/script/jsb_debugger.js; sourceTree = ""; }; + 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../../../cocos/scripting/javascript/script/jsb_deprecated.js; sourceTree = ""; }; + 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl_constants.js; sourceTree = ""; }; + 1A6767F7180E9B160076BC67 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../../../cocos/scripting/javascript/script/jsb_opengl.js; sourceTree = ""; }; + 1A6767F8180E9B160076BC67 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../../../cocos/scripting/javascript/script/jsb_sys.js; sourceTree = ""; }; + 1A6767F9180E9B160076BC67 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../../../cocos/scripting/javascript/script/jsb.js; sourceTree = ""; }; 1A82F5FA169AC92500C4B13A /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; 1A96A4F2174A3432008653A9 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../../../cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = ""; }; + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../build/cocos2d_libs.xcodeproj; sourceTree = ""; }; 1AE4B40016D1FECD003C6D1C /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../Resources/main.js; sourceTree = ""; }; 1AE4B40116D1FECD003C6D1C /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../Resources/res; sourceTree = ""; }; 1AE4B40216D1FECD003C6D1C /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../Resources/src; sourceTree = ""; }; - 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = ""; }; - 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_chipmunk_constants.js; sourceTree = ""; }; - 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_chipmunk.js; path = ../../../scripting/javascript/bindings/js/jsb_chipmunk.js; sourceTree = ""; }; - 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d_constants.js; sourceTree = ""; }; - 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d_extension.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d_extension.js; sourceTree = ""; }; - 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocos2d.js; path = ../../../scripting/javascript/bindings/js/jsb_cocos2d.js; sourceTree = ""; }; - 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_cocosbuilder.js; path = ../../../scripting/javascript/bindings/js/jsb_cocosbuilder.js; sourceTree = ""; }; - 1AF4C33F17865F1600122817 /* jsb_debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_debugger.js; path = ../../../scripting/javascript/bindings/js/jsb_debugger.js; sourceTree = ""; }; - 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl_constants.js; path = ../../../scripting/javascript/bindings/js/jsb_opengl_constants.js; sourceTree = ""; }; - 1AF4C34117865F1600122817 /* jsb_opengl.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_opengl.js; path = ../../../scripting/javascript/bindings/js/jsb_opengl.js; sourceTree = ""; }; - 1AF4C34217865F1600122817 /* jsb_sys.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_sys.js; path = ../../../scripting/javascript/bindings/js/jsb_sys.js; sourceTree = ""; }; - 1AF4C34317865F1600122817 /* jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb.js; path = ../../../scripting/javascript/bindings/js/jsb.js; sourceTree = ""; }; - 1AF4C34417865F1600122817 /* main.debug.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.debug.js; path = ../../../scripting/javascript/bindings/js/main.debug.js; sourceTree = ""; }; - 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_deprecated.js; path = ../../../scripting/javascript/bindings/js/jsb_deprecated.js; sourceTree = ""; }; 502380DB17EBB88200990C9B /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; 5091731417ECDF7A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-29.png"; path = "ios/Icon-29.png"; sourceTree = ""; }; 5091731517ECDF7A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-40.png"; path = "ios/Icon-40.png"; sourceTree = ""; }; @@ -285,11 +340,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 502380DD17EBB89A00990C9B /* libchipmunk Mac.a in Frameworks */, - 502380DE17EBB89A00990C9B /* libcocos2dx Mac.a in Frameworks */, - 502380DF17EBB89A00990C9B /* libcocos2dx-extensions Mac.a in Frameworks */, - 502380E017EBB89A00990C9B /* libCocosDenshion Mac.a in Frameworks */, - 502380E117EBB89A00990C9B /* libjsbindings Mac.a in Frameworks */, + 1A676829180E9C060076BC67 /* libchipmunk Mac.a in Frameworks */, + 1A67682A180E9C060076BC67 /* libcocos2dx Mac.a in Frameworks */, + 1A67682B180E9C060076BC67 /* libcocos2dx-extensions Mac.a in Frameworks */, + 1A67682C180E9C060076BC67 /* libCocosDenshion Mac.a in Frameworks */, + 1A67682D180E9C060076BC67 /* libjsbindings Mac.a in Frameworks */, 502380DC17EBB88200990C9B /* libcurl.dylib in Frameworks */, 509D4A8817EBB24E00697056 /* libsqlite3.dylib in Frameworks */, 509D4A8917EBB24E00697056 /* libz.dylib in Frameworks */, @@ -309,12 +364,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1A676838180E9C1E0076BC67 /* libchipmunk iOS.a in Frameworks */, + 1A676839180E9C1E0076BC67 /* libcocos2dx iOS.a in Frameworks */, + 1A67683A180E9C1E0076BC67 /* libcocos2dx-extensions iOS.a in Frameworks */, + 1A67683B180E9C1E0076BC67 /* libCocosDenshion iOS.a in Frameworks */, + 1A67683C180E9C1E0076BC67 /* libjsbindings iOS.a in Frameworks */, D6B061241803AB9F0077942B /* CoreMotion.framework in Frameworks */, - 1AF4C33317865EC500122817 /* libchipmunk iOS.a in Frameworks */, - 1AF4C33417865EC500122817 /* libcocos2dx iOS.a in Frameworks */, - 1AF4C33517865EC500122817 /* libcocos2dx-extensions iOS.a in Frameworks */, - 1AF4C33617865EC500122817 /* libCocosDenshion iOS.a in Frameworks */, - 1AF4C33717865EC500122817 /* libjsbindings iOS.a in Frameworks */, 1A82F5FB169AC92500C4B13A /* libsqlite3.dylib in Frameworks */, D454520C156E22BD00887EB5 /* libz.dylib in Frameworks */, A92275421517C094001B78AA /* QuartzCore.framework in Frameworks */, @@ -325,7 +380,6 @@ A922754C1517C094001B78AA /* UIKit.framework in Frameworks */, A922754E1517C094001B78AA /* Foundation.framework in Frameworks */, A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */, - 1A96A4F3174A3432008653A9 /* libcurl.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -342,47 +396,47 @@ name = Resources; sourceTree = ""; }; - 1AF4C2FB17865E8F00122817 /* Products */ = { + 1A6767EC180E9AF00076BC67 /* JS Common */ = { isa = PBXGroup; children = ( - 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */, - 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */, - 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */, - 1AF4C31417865E8F00122817 /* libbox2d Mac.a */, - 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */, - 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */, - 1AF4C31A17865E8F00122817 /* libluabindings Mac.a */, - 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */, - 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */, - 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */, - 1AF4C32217865E8F00122817 /* libbox2d iOS.a */, - 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */, - 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */, - 1AF4C32817865E8F00122817 /* libluabindings iOS.a */, - ); - name = Products; - sourceTree = ""; - }; - 1AF4C33817865EF900122817 /* JS Common */ = { - isa = PBXGroup; - children = ( - 466AF66C179FC7BE002EE9BB /* jsb_deprecated.js */, - 1AF4C33917865F1600122817 /* jsb_chipmunk_constants.js */, - 1AF4C33A17865F1600122817 /* jsb_chipmunk.js */, - 1AF4C33B17865F1600122817 /* jsb_cocos2d_constants.js */, - 1AF4C33C17865F1600122817 /* jsb_cocos2d_extension.js */, - 1AF4C33D17865F1600122817 /* jsb_cocos2d.js */, - 1AF4C33E17865F1600122817 /* jsb_cocosbuilder.js */, - 1AF4C33F17865F1600122817 /* jsb_debugger.js */, - 1AF4C34017865F1600122817 /* jsb_opengl_constants.js */, - 1AF4C34117865F1600122817 /* jsb_opengl.js */, - 1AF4C34217865F1600122817 /* jsb_sys.js */, - 1AF4C34317865F1600122817 /* jsb.js */, - 1AF4C34417865F1600122817 /* main.debug.js */, + 1A6767ED180E9B160076BC67 /* debugger */, + 1A6767EE180E9B160076BC67 /* jsb_chipmunk_constants.js */, + 1A6767EF180E9B160076BC67 /* jsb_chipmunk.js */, + 1A6767F0180E9B160076BC67 /* jsb_cocos2d_constants.js */, + 1A6767F1180E9B160076BC67 /* jsb_cocos2d_extension.js */, + 1A6767F2180E9B160076BC67 /* jsb_cocos2d.js */, + 1A6767F3180E9B160076BC67 /* jsb_cocosbuilder.js */, + 1A6767F4180E9B160076BC67 /* jsb_debugger.js */, + 1A6767F5180E9B160076BC67 /* jsb_deprecated.js */, + 1A6767F6180E9B160076BC67 /* jsb_opengl_constants.js */, + 1A6767F7180E9B160076BC67 /* jsb_opengl.js */, + 1A6767F8180E9B160076BC67 /* jsb_sys.js */, + 1A6767F9180E9B160076BC67 /* jsb.js */, ); name = "JS Common"; sourceTree = ""; }; + 1AC6FB35180E9ACB004C840B /* Products */ = { + isa = PBXGroup; + children = ( + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */, + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */, + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */, + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */, + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */, + 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */, + 1AC6FB54180E9ACB004C840B /* libluabindings Mac.a */, + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */, + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */, + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */, + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */, + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */, + 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */, + 1AC6FB62180E9ACB004C840B /* libluabindings iOS.a */, + ); + name = Products; + sourceTree = ""; + }; 5091732E17ECDF8A00D62437 /* Icons */ = { isa = PBXGroup; children = ( @@ -417,11 +471,11 @@ A92275321517C094001B78AA = { isa = PBXGroup; children = ( - 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */, - 1AF4C33817865EF900122817 /* JS Common */, + 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */, D4545214156E28EF00887EB5 /* Classes */, A92275401517C094001B78AA /* Frameworks */, D45446CC156DE73F00887EB5 /* ios */, + 1A6767EC180E9AF00076BC67 /* JS Common */, 509D4ACA17EBB2BE00697056 /* mac */, A922753E1517C094001B78AA /* Products */, 15628F5B15F0F5C2000CF24B /* Resources */, @@ -502,7 +556,11 @@ buildRules = ( ); dependencies = ( - 502380EF17EBB8C500990C9B /* PBXTargetDependency */, + 1A676820180E9BF70076BC67 /* PBXTargetDependency */, + 1A676822180E9BF70076BC67 /* PBXTargetDependency */, + 1A676824180E9BF70076BC67 /* PBXTargetDependency */, + 1A676826180E9BF70076BC67 /* PBXTargetDependency */, + 1A676828180E9BF70076BC67 /* PBXTargetDependency */, ); name = "Hello JavaScript Mac"; productName = HelloJavascript; @@ -520,7 +578,11 @@ buildRules = ( ); dependencies = ( - 502380F117EBB8FD00990C9B /* PBXTargetDependency */, + 1A67682F180E9C110076BC67 /* PBXTargetDependency */, + 1A676831180E9C110076BC67 /* PBXTargetDependency */, + 1A676833180E9C110076BC67 /* PBXTargetDependency */, + 1A676835180E9C110076BC67 /* PBXTargetDependency */, + 1A676837180E9C110076BC67 /* PBXTargetDependency */, ); name = "Hello JavaScript iOS"; productName = HelloJavascript; @@ -552,8 +614,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 1AF4C2FB17865E8F00122817 /* Products */; - ProjectRef = 1AF4C2FA17865E8F00122817 /* cocos2d_libs.xcodeproj */; + ProductGroup = 1AC6FB35180E9ACB004C840B /* Products */; + ProjectRef = 1AC6FB34180E9ACB004C840B /* cocos2d_libs.xcodeproj */; }, ); projectRoot = ""; @@ -565,102 +627,102 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1AF4C30E17865E8F00122817 /* libcocos2dx Mac.a */ = { + 1AC6FB48180E9ACB004C840B /* libcocos2dx Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx Mac.a"; - remoteRef = 1AF4C30D17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB47180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31017865E8F00122817 /* libcocos2dx-extensions Mac.a */ = { + 1AC6FB4A180E9ACB004C840B /* libcocos2dx-extensions Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions Mac.a"; - remoteRef = 1AF4C30F17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB49180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31217865E8F00122817 /* libchipmunk Mac.a */ = { + 1AC6FB4C180E9ACB004C840B /* libchipmunk Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk Mac.a"; - remoteRef = 1AF4C31117865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4B180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31417865E8F00122817 /* libbox2d Mac.a */ = { + 1AC6FB4E180E9ACB004C840B /* libbox2d Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d Mac.a"; - remoteRef = 1AF4C31317865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4D180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31617865E8F00122817 /* libCocosDenshion Mac.a */ = { + 1AC6FB50180E9ACB004C840B /* libCocosDenshion Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion Mac.a"; - remoteRef = 1AF4C31517865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB4F180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31817865E8F00122817 /* libjsbindings Mac.a */ = { + 1AC6FB52180E9ACB004C840B /* libjsbindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings Mac.a"; - remoteRef = 1AF4C31717865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB51180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31A17865E8F00122817 /* libluabindings Mac.a */ = { + 1AC6FB54180E9ACB004C840B /* libluabindings Mac.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings Mac.a"; - remoteRef = 1AF4C31917865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB53180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31C17865E8F00122817 /* libcocos2dx iOS.a */ = { + 1AC6FB56180E9ACB004C840B /* libcocos2dx iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx iOS.a"; - remoteRef = 1AF4C31B17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB55180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C31E17865E8F00122817 /* libcocos2dx-extensions iOS.a */ = { + 1AC6FB58180E9ACB004C840B /* libcocos2dx-extensions iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libcocos2dx-extensions iOS.a"; - remoteRef = 1AF4C31D17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB57180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32017865E8F00122817 /* libchipmunk iOS.a */ = { + 1AC6FB5A180E9ACB004C840B /* libchipmunk iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libchipmunk iOS.a"; - remoteRef = 1AF4C31F17865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB59180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32217865E8F00122817 /* libbox2d iOS.a */ = { + 1AC6FB5C180E9ACB004C840B /* libbox2d iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libbox2d iOS.a"; - remoteRef = 1AF4C32117865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5B180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32417865E8F00122817 /* libCocosDenshion iOS.a */ = { + 1AC6FB5E180E9ACB004C840B /* libCocosDenshion iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCocosDenshion iOS.a"; - remoteRef = 1AF4C32317865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5D180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32617865E8F00122817 /* libjsbindings iOS.a */ = { + 1AC6FB60180E9ACB004C840B /* libjsbindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libjsbindings iOS.a"; - remoteRef = 1AF4C32517865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB5F180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1AF4C32817865E8F00122817 /* libluabindings iOS.a */ = { + 1AC6FB62180E9ACB004C840B /* libluabindings iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libluabindings iOS.a"; - remoteRef = 1AF4C32717865E8F00122817 /* PBXContainerItemProxy */; + remoteRef = 1AC6FB61180E9ACB004C840B /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -670,23 +732,23 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 509D4A9417EBB24E00697056 /* jsb_deprecated.js in Resources */, - 509D4A9517EBB24E00697056 /* jsb_chipmunk_constants.js in Resources */, - 509D4A9617EBB24E00697056 /* jsb_chipmunk.js in Resources */, - 509D4A9717EBB24E00697056 /* jsb_cocos2d_constants.js in Resources */, - 509D4A9817EBB24E00697056 /* jsb_cocos2d_extension.js in Resources */, - 509D4A9917EBB24E00697056 /* jsb_cocos2d.js in Resources */, - 509D4A9A17EBB24E00697056 /* jsb_cocosbuilder.js in Resources */, - 509D4A9B17EBB24E00697056 /* jsb_debugger.js in Resources */, - 509D4A9C17EBB24E00697056 /* jsb_opengl_constants.js in Resources */, - 509D4A9D17EBB24E00697056 /* jsb_opengl.js in Resources */, - 509D4A9E17EBB24E00697056 /* jsb_sys.js in Resources */, - 509D4A9F17EBB24E00697056 /* jsb.js in Resources */, - 509D4AA017EBB24E00697056 /* main.debug.js in Resources */, + 1A67683E180E9CE90076BC67 /* jsb_chipmunk_constants.js in Resources */, + 1A67683F180E9CE90076BC67 /* jsb_chipmunk.js in Resources */, + 1A676840180E9CE90076BC67 /* jsb_cocos2d_constants.js in Resources */, + 1A676841180E9CE90076BC67 /* jsb_cocos2d_extension.js in Resources */, + 1A676842180E9CE90076BC67 /* jsb_cocos2d.js in Resources */, + 1A676843180E9CE90076BC67 /* jsb_cocosbuilder.js in Resources */, + 1A676844180E9CE90076BC67 /* jsb_debugger.js in Resources */, + 1A676845180E9CE90076BC67 /* jsb_deprecated.js in Resources */, + 1A676846180E9CE90076BC67 /* jsb_opengl_constants.js in Resources */, + 1A676847180E9CE90076BC67 /* jsb_opengl.js in Resources */, + 1A676848180E9CE90076BC67 /* jsb_sys.js in Resources */, + 1A676849180E9CE90076BC67 /* jsb.js in Resources */, 509D4AA117EBB24E00697056 /* main.js in Resources */, 509D4ACF17EBB2BE00697056 /* Icon.icns in Resources */, 509D4AA517EBB24E00697056 /* res in Resources */, 509D4AA617EBB24E00697056 /* src in Resources */, + 1A6767FB180E9B160076BC67 /* debugger in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -694,28 +756,27 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 466AF679179FC7EE002EE9BB /* jsb_deprecated.js in Resources */, - 1AF4C35117865F7400122817 /* jsb_chipmunk_constants.js in Resources */, - 1AF4C35217865F7400122817 /* jsb_chipmunk.js in Resources */, - 1AF4C35317865F7400122817 /* jsb_cocos2d_constants.js in Resources */, + 1A67684A180E9CF10076BC67 /* jsb_chipmunk_constants.js in Resources */, + 1A67684B180E9CF10076BC67 /* jsb_chipmunk.js in Resources */, + 1A67684C180E9CF10076BC67 /* jsb_cocos2d_constants.js in Resources */, + 1A67684D180E9CF10076BC67 /* jsb_cocos2d_extension.js in Resources */, + 1A67684E180E9CF10076BC67 /* jsb_cocos2d.js in Resources */, + 1A67684F180E9CF10076BC67 /* jsb_cocosbuilder.js in Resources */, + 1A676850180E9CF10076BC67 /* jsb_debugger.js in Resources */, + 1A676851180E9CF10076BC67 /* jsb_deprecated.js in Resources */, + 1A676852180E9CF10076BC67 /* jsb_opengl_constants.js in Resources */, + 1A676853180E9CF10076BC67 /* jsb_opengl.js in Resources */, + 1A676854180E9CF10076BC67 /* jsb_sys.js in Resources */, + 1A676855180E9CF10076BC67 /* jsb.js in Resources */, 509D4ABE17EBB2AB00697056 /* Default.png in Resources */, 5091731E17ECDF7A00D62437 /* Icon-80.png in Resources */, 5091731F17ECDF7A00D62437 /* Icon-100.png in Resources */, 509D4AC117EBB2AB00697056 /* Icon-72.png in Resources */, - 1AF4C35417865F7400122817 /* jsb_cocos2d_extension.js in Resources */, - 1AF4C35517865F7400122817 /* jsb_cocos2d.js in Resources */, - 1AF4C35617865F7400122817 /* jsb_cocosbuilder.js in Resources */, 509D4AC017EBB2AB00697056 /* Icon-57.png in Resources */, - 1AF4C35717865F7400122817 /* jsb_debugger.js in Resources */, 5091731A17ECDF7A00D62437 /* Icon-29.png in Resources */, - 1AF4C35817865F7400122817 /* jsb_opengl_constants.js in Resources */, - 1AF4C35917865F7400122817 /* jsb_opengl.js in Resources */, - 1AF4C35A17865F7400122817 /* jsb_sys.js in Resources */, 509D4AC617EBB2AB00697056 /* Icon-152.png in Resources */, 509D4AC517EBB2AB00697056 /* Icon-144.png in Resources */, - 1AF4C35B17865F7400122817 /* jsb.js in Resources */, 509D4AC317EBB2AB00697056 /* Icon-114.png in Resources */, - 1AF4C35C17865F7400122817 /* main.debug.js in Resources */, 509D4ABD17EBB2AB00697056 /* Default-568h@2x.png in Resources */, 1AE4B40616D1FF4C003C6D1C /* main.js in Resources */, 509D4ABF17EBB2AB00697056 /* Default@2x.png in Resources */, @@ -726,6 +787,7 @@ 509D4AC417EBB2AB00697056 /* Icon-120.png in Resources */, 1AE4B40516D1FECD003C6D1C /* src in Resources */, 5091731D17ECDF7A00D62437 /* Icon-58.png in Resources */, + 1A6767FA180E9B160076BC67 /* debugger in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -755,15 +817,55 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 502380EF17EBB8C500990C9B /* PBXTargetDependency */ = { + 1A676820180E9BF70076BC67 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "build-all-libs Mac"; - targetProxy = 502380EE17EBB8C500990C9B /* PBXContainerItemProxy */; + name = "cocos2dx Mac"; + targetProxy = 1A67681F180E9BF70076BC67 /* PBXContainerItemProxy */; }; - 502380F117EBB8FD00990C9B /* PBXTargetDependency */ = { + 1A676822180E9BF70076BC67 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "build-all-libs iOS"; - targetProxy = 502380F017EBB8FD00990C9B /* PBXContainerItemProxy */; + name = "cocos2dx-extensions Mac"; + targetProxy = 1A676821180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676824180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk Mac"; + targetProxy = 1A676823180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676826180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion Mac"; + targetProxy = 1A676825180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A676828180E9BF70076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings Mac"; + targetProxy = 1A676827180E9BF70076BC67 /* PBXContainerItemProxy */; + }; + 1A67682F180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 1A67682E180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676831180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 1A676830180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676833180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 1A676832180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676835180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 1A676834180E9C110076BC67 /* PBXContainerItemProxy */; + }; + 1A676837180E9C110076BC67 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "jsbindings iOS"; + targetProxy = 1A676836180E9C110076BC67 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -771,7 +873,7 @@ 509D4AA817EBB24E00697056 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -782,29 +884,14 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/spidermonkey/include/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Debug; @@ -812,7 +899,7 @@ 509D4AA917EBB24E00697056 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -822,29 +909,14 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../CocosDenshion/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/mac", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/mac", + "$(SRCROOT)/../../../external/spidermonkey/include/mac", + "$(SRCROOT)/../../../external/glfw3/include/mac", ); INFOPLIST_FILE = mac/Info.plist; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-mac/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/mac/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/mac/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Release; @@ -868,10 +940,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../cocos2dx", - "$(SRCROOT)/../../cocos2dx/include", - "$(SRCROOT)/../../cocos2dx/platform/ios", - "$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/include1", + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", + "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; ONLY_ACTIVE_ARCH = YES; @@ -894,10 +977,21 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( - "$(SRCROOT)/../../cocos2dx", - "$(SRCROOT)/../../cocos2dx/include", - "$(SRCROOT)/../../cocos2dx/platform/ios", - "$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/include1", + "$(SRCROOT)/../../..", + "$(SRCROOT)/../../../cocos", + "$(SRCROOT)/../../../cocos/base", + "$(SRCROOT)/../../../cocos/physics", + "$(SRCROOT)/../../../cocos/math/kazmath/include", + "$(SRCROOT)/../../../cocos/2d", + "$(SRCROOT)/../../../cocos/gui", + "$(SRCROOT)/../../../cocos/network", + "$(SRCROOT)/../../../cocos/audio/include", + "$(SRCROOT)/../../../cocos/editor-support", + "$(SRCROOT)/../../../cocos/scripting/javascript/bindings", + "$(SRCROOT)/../../../cocos/scripting/auto-generated/js-bindings", + "$(SRCROOT)/../../../extensions", + "$(SRCROOT)/../../../external", + "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", ); IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -909,7 +1003,7 @@ A92277011517C097001B78AA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -920,30 +1014,15 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../audio/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../../../external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -952,7 +1031,7 @@ A92277021517C097001B78AA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; + ALWAYS_SEARCH_USER_PATHS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPRESS_PNG_FILES = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -962,30 +1041,15 @@ "$(inherited)", ); HEADER_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../cocos2dx\"", - "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", - "$(SRCROOT)/../../../cocos2dx/platform/third_party/ios", - "\"$(SRCROOT)/../../../audio/include\"", - "$(SRCROOT)/../../../cocos2dx/include", - "$(SRCROOT)/../../../cocos2dx/platform/ios", - "$(SRCROOT)/../../../external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include", - "$(SRCROOT)/../../../scripting/auto-generated/js-bindings", - "$(SRCROOT)/../../../scripting/javascript/bindings", - "$(SRCROOT)/../../../extensions", + "$(inherited)", + "$(SRCROOT)/../../../cocos/2d/platform/ios", + "$(SRCROOT)/../../../cocos/2d/platform/ios/Simulation", + "$(SRCROOT)/../../../external/spidermonkey/include/ios", ); INFOPLIST_FILE = ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 5.0; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/lib\"", - "\"$(SRCROOT)/../../../cocos2dx/platform/third_party/ios/libraries\"", - "\"$(SRCROOT)/../../../external/libwebsockets/ios/lib\"", - ); - OTHER_LDFLAGS = ( - "-lxml2", - "-lz", - "-ljs_static", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/tools/android-mk-generator/android_mk_generator.py b/tools/android-mk-generator/android_mk_generator.py index 3aabfae992..3e42d908d5 100755 --- a/tools/android-mk-generator/android_mk_generator.py +++ b/tools/android-mk-generator/android_mk_generator.py @@ -24,7 +24,7 @@ def gen_android_mk(mkfile, pathes, suffix = ("c", "cpp",), exclude = ()): filestrio = cStringIO.StringIO() for filename in filelst: filestrio.write(' \\\n') - filestrio.write(os.path.relpath(filename, os.path.dirname(os.path.join(COCOS_ROOT, mkfile)))) + filestrio.write("$(LOCAL_PATH)/"+os.path.relpath(filename, os.path.dirname(os.path.join(COCOS_ROOT, mkfile)))) filestrio.write('\n') # read mk file diff --git a/tools/android-mk-generator/config.py b/tools/android-mk-generator/config.py index fdce1bf352..f7cdc3f389 100644 --- a/tools/android-mk-generator/config.py +++ b/tools/android-mk-generator/config.py @@ -1,8 +1,8 @@ [ { - 'mkfile' : 'cocos2dx/Android.mk', - 'pathes' : ("cocos2dx/",), - 'exclude' : ("cocos2dx/platform/android", "cocos2dx/platform/emscripten", "cocos2dx/platform/ios", "cocos2dx/platform/apple", "cocos2dx/platform/linux", "cocos2dx/platform/mac", "cocos2dx/platform/nacl", "cocos2dx/platform/qt5", "cocos2dx/platform/tizen", "cocos2dx/platform/win32", "cocos2dx/label_nodes/CCFontCache.cpp", "cocos2dx/base_nodes/CCGLBufferedNode.cpp","cocos2dx/support/user_default/CCUserDefault.cpp") + 'mkfile' : 'cocos/2d/Android.mk', + 'pathes' : ("cocos/2d/","cocos/base","cocos/math","cocos/physics","external/tinyxml2","external/unzip"), + 'exclude' : ("cocos/2d/platform/android", "cocos/2d/platform/emscripten", "cocos/2d/platform/ios", "cocos/2d/platform/apple", "cocos/2d/platform/linux", "cocos/2d/platform/mac", "cocos/2d/platform/win32") }, { 'mkfile' : 'samples/Cpp/TestCpp/Android.mk', diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index f1075ca4a0..510440e508 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/audio/include/SimpleAudioEngine.h +headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tojs/cocos2dx_extension.ini b/tools/tojs/cocos2dx_extension.ini index a5170a5d86..1519b2eb92 100644 --- a/tools/tojs/cocos2dx_extension.ini +++ b/tools/tojs/cocos2dx_extension.ini @@ -13,16 +13,17 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include -I%(cocosdir)s/extensions +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s + cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/extensions/cocos-ext.h +headers = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tojs/genbindings.sh b/tools/tojs/genbindings.sh index 8801c65d1f..56b1b4500f 100755 --- a/tools/tojs/genbindings.sh +++ b/tools/tojs/genbindings.sh @@ -80,7 +80,7 @@ echo --- # Generate bindings for cocos2dx echo "Generating bindings for cocos2dx..." set -x -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/js-bindings -n jsb_cocos2dx_auto echo "Generating bindings for cocos2dx_extension..." -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_extension_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/js-bindings -n jsb_cocos2dx_extension_auto diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index cc59df0bdb..8721cdba4f 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/audio/include/SimpleAudioEngine.h +headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tolua/cocos2dx_extension.ini b/tools/tolua/cocos2dx_extension.ini index ce914cf508..67d87c51d6 100644 --- a/tools/tolua/cocos2dx_extension.ini +++ b/tools/tolua/cocos2dx_extension.ini @@ -13,16 +13,16 @@ android_flags = -D_SIZE_T_DEFINED_ clang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include clang_flags = -nostdinc -x c++ -std=c++11 -cocos_headers = -I%(cocosdir)s/cocos2dx/include -I%(cocosdir)s/cocos2dx/platform -I%(cocosdir)s/cocos2dx/platform/android -I%(cocosdir)s/cocos2dx -I%(cocosdir)s/cocos2dx/kazmath/include -I%(cocosdir)s/extensions +cocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s cocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common +cxxgenerator_headers = # extra arguments for clang extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/extensions/cocos-ext.h +headers = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tolua/genbindings.sh b/tools/tolua/genbindings.sh index ba6033c7fc..b236c43ae8 100755 --- a/tools/tolua/genbindings.sh +++ b/tools/tolua/genbindings.sh @@ -80,7 +80,7 @@ echo --- # Generate bindings for cocos2dx echo "Generating bindings for cocos2dx..." set -x -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_auto echo "Generating bindings for cocos2dx_extension..." -LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto +LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto