diff --git a/AUTHORS b/AUTHORS index 5ca95070e5..aa9402cb1c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -886,6 +886,7 @@ Developers: zhouxiaoxiaoxujian Added TextField::getStringLength() Add shadow, outline, glow filter support for UIText + Fix UITextField IME can't auto detach QiuleiWang Fix the bug that calculated height of multi-line string was incorrect on iOS @@ -906,6 +907,9 @@ Developers: Teivaz Custom uniform search optimization + + chareice + Make `setup.py` work on zsh Retired Core Developers: WenSheng Yang diff --git a/CHANGELOG b/CHANGELOG index f811f77d6e..ad5c3e1d42 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,22 @@ -cocos2d-x-3.2rc0 ?? +cocos2d-x-3.2 ?? + [FIX] Animation3D: getOrCreate is deprecated and replaced with Animation3D::create + [FIX] Animate3D: setSpeed() accept negtive value, which means play reverse, getPlayback and setPlayBack are deprecated + [FIX] GLView: cursor position is not correct if design resolution is different from device resolution + [FIX] Label: color can not be set correctly if using system font + [FIX] Lua-binding: support UIVideoPlayer + [FIX] Node: setRotation3D not work based on anchor point + [FIX] Node: modify regular of enumerateChildren, now it just searchs its children + [FIX] Setup.py: not work if using zsh + [FIX] SpriteBatchNode: opacity can not work + [FIX] Sprite3D: may crash on Android if playing animation and replace Scene after come from background + [FIX] UIdget: opacity is wrong when replace texture + [FIX] UITextField: keyboard can not hide if touching space outside of keyboard + + [FIX] Others: don't release singleton objects correctly that are needed in the whole game, which will be treated + as memory leak when using VLD. + + +cocos2d-x-3.2rc0 Jul.7 2014 [NEW] FastTMXTiledMap: added fast tmx, which is much more faster for static tiled map [NEW] GLProgramState: can use uniform location to get/set uniform values [NEW] HttpClient: added sendImmediate() diff --git a/build/android-build.py b/build/android-build.py index 781a0a9779..675ff3ae56 100755 --- a/build/android-build.py +++ b/build/android-build.py @@ -8,7 +8,7 @@ import shutil from optparse import OptionParser CPP_SAMPLES = ['cpp-empty-test', 'cpp-tests', 'game-controller-test'] -LUA_SAMPLES = ['lua-empty-test', 'lua-tests'] +LUA_SAMPLES = ['lua-empty-test', 'lua-tests', 'lua-game-controller-test'] ALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES def get_num_of_cpu(): @@ -172,6 +172,10 @@ def copy_resources(target, app_android_root): resources_dir = os.path.join(app_android_root, "../../../cpp-tests/Resources") copy_files(resources_dir, assets_res_dir) + if target == "lua-game-controller-test": + print("coming generator game controller") + resources_dir = os.path.join(app_android_root, "../../../game-controller-test/Resources") + copy_files(resources_dir, assets_res_dir) def build_samples(target,ndk_build_param,android_platform,build_mode): @@ -203,7 +207,8 @@ def build_samples(target,ndk_build_param,android_platform,build_mode): "game-controller-test": "tests/game-controller-test/proj.android", "cpp-tests": "tests/cpp-tests/proj.android", "lua-empty-test": "tests/lua-empty-test/project/proj.android", - "lua-tests": "tests/lua-tests/project/proj.android" + "lua-tests": "tests/lua-tests/project/proj.android", + "lua-game-controller-test": "tests/lua-game-controller-test/project/proj.android" } for target in build_targets: diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index ecf07d8ded..afffa6f339 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1025,23 +1025,12 @@ 373B912A187891FB00198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; }; 3E6176681960F89B00DE83F5 /* CCController-iOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176551960F89B00DE83F5 /* CCController-iOS.mm */; }; 3E6176691960F89B00DE83F5 /* CCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176561960F89B00DE83F5 /* CCController.h */; }; - 3E61766A1960F89B00DE83F5 /* CCControllerAxisInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176571960F89B00DE83F5 /* CCControllerAxisInput.cpp */; }; - 3E61766B1960F89B00DE83F5 /* CCControllerAxisInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176581960F89B00DE83F5 /* CCControllerAxisInput.h */; }; - 3E61766C1960F89B00DE83F5 /* CCControllerButtonInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176591960F89B00DE83F5 /* CCControllerButtonInput.cpp */; }; - 3E61766D1960F89B00DE83F5 /* CCControllerButtonInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E61765A1960F89B00DE83F5 /* CCControllerButtonInput.h */; }; - 3E61766E1960F89B00DE83F5 /* CCControllerDirectionPad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61765B1960F89B00DE83F5 /* CCControllerDirectionPad.cpp */; }; - 3E61766F1960F89B00DE83F5 /* CCControllerDirectionPad.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E61765C1960F89B00DE83F5 /* CCControllerDirectionPad.h */; }; - 3E6176701960F89B00DE83F5 /* CCControllerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61765D1960F89B00DE83F5 /* CCControllerElement.cpp */; }; - 3E6176711960F89B00DE83F5 /* CCControllerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E61765E1960F89B00DE83F5 /* CCControllerElement.h */; }; - 3E6176721960F89B00DE83F5 /* CCControllerThumbstick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61765F1960F89B00DE83F5 /* CCControllerThumbstick.cpp */; }; - 3E6176731960F89B00DE83F5 /* CCControllerThumbstick.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176601960F89B00DE83F5 /* CCControllerThumbstick.h */; }; 3E6176741960F89B00DE83F5 /* CCEventController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176611960F89B00DE83F5 /* CCEventController.cpp */; }; 3E6176751960F89B00DE83F5 /* CCEventController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176621960F89B00DE83F5 /* CCEventController.h */; }; 3E6176761960F89B00DE83F5 /* CCEventListenerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176631960F89B00DE83F5 /* CCEventListenerController.cpp */; }; 3E6176771960F89B00DE83F5 /* CCEventListenerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */; }; 3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176651960F89B00DE83F5 /* CCGameController.h */; }; - 3E6176791960F89B00DE83F5 /* CCGamepad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176661960F89B00DE83F5 /* CCGamepad.cpp */; }; - 3E61767A1960F89B00DE83F5 /* CCGamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = 3E6176671960F89B00DE83F5 /* CCGamepad.h */; }; + 3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3E61781C1966A5A300DE83F5 /* CCController.cpp */; }; 3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */; }; 3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */; }; 3EA47870195478E00068D9D1 /* CCBundleReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */; }; @@ -2370,23 +2359,12 @@ 37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = ""; }; 3E6176551960F89B00DE83F5 /* CCController-iOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "CCController-iOS.mm"; path = "../base/CCController-iOS.mm"; sourceTree = ""; }; 3E6176561960F89B00DE83F5 /* CCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCController.h; path = ../base/CCController.h; sourceTree = ""; }; - 3E6176571960F89B00DE83F5 /* CCControllerAxisInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCControllerAxisInput.cpp; path = ../base/CCControllerAxisInput.cpp; sourceTree = ""; }; - 3E6176581960F89B00DE83F5 /* CCControllerAxisInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCControllerAxisInput.h; path = ../base/CCControllerAxisInput.h; sourceTree = ""; }; - 3E6176591960F89B00DE83F5 /* CCControllerButtonInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCControllerButtonInput.cpp; path = ../base/CCControllerButtonInput.cpp; sourceTree = ""; }; - 3E61765A1960F89B00DE83F5 /* CCControllerButtonInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCControllerButtonInput.h; path = ../base/CCControllerButtonInput.h; sourceTree = ""; }; - 3E61765B1960F89B00DE83F5 /* CCControllerDirectionPad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCControllerDirectionPad.cpp; path = ../base/CCControllerDirectionPad.cpp; sourceTree = ""; }; - 3E61765C1960F89B00DE83F5 /* CCControllerDirectionPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCControllerDirectionPad.h; path = ../base/CCControllerDirectionPad.h; sourceTree = ""; }; - 3E61765D1960F89B00DE83F5 /* CCControllerElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCControllerElement.cpp; path = ../base/CCControllerElement.cpp; sourceTree = ""; }; - 3E61765E1960F89B00DE83F5 /* CCControllerElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCControllerElement.h; path = ../base/CCControllerElement.h; sourceTree = ""; }; - 3E61765F1960F89B00DE83F5 /* CCControllerThumbstick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCControllerThumbstick.cpp; path = ../base/CCControllerThumbstick.cpp; sourceTree = ""; }; - 3E6176601960F89B00DE83F5 /* CCControllerThumbstick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCControllerThumbstick.h; path = ../base/CCControllerThumbstick.h; sourceTree = ""; }; 3E6176611960F89B00DE83F5 /* CCEventController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventController.cpp; path = ../base/CCEventController.cpp; sourceTree = ""; }; 3E6176621960F89B00DE83F5 /* CCEventController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventController.h; path = ../base/CCEventController.h; sourceTree = ""; }; 3E6176631960F89B00DE83F5 /* CCEventListenerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCEventListenerController.cpp; path = ../base/CCEventListenerController.cpp; sourceTree = ""; }; 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCEventListenerController.h; path = ../base/CCEventListenerController.h; sourceTree = ""; }; 3E6176651960F89B00DE83F5 /* CCGameController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGameController.h; path = ../base/CCGameController.h; sourceTree = ""; }; - 3E6176661960F89B00DE83F5 /* CCGamepad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCGamepad.cpp; path = ../base/CCGamepad.cpp; sourceTree = ""; }; - 3E6176671960F89B00DE83F5 /* CCGamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGamepad.h; path = ../base/CCGamepad.h; sourceTree = ""; }; + 3E61781C1966A5A300DE83F5 /* CCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCController.cpp; path = ../base/CCController.cpp; sourceTree = ""; }; 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayer.h; sourceTree = ""; }; 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = ""; }; 3EA4786E195478E00068D9D1 /* CCBundleReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBundleReader.cpp; sourceTree = ""; }; @@ -3187,25 +3165,14 @@ 1A5700A2180BC5E60088DEC7 /* base */ = { isa = PBXGroup; children = ( + 3E61781C1966A5A300DE83F5 /* CCController.cpp */, 3E6176551960F89B00DE83F5 /* CCController-iOS.mm */, 3E6176561960F89B00DE83F5 /* CCController.h */, - 3E6176571960F89B00DE83F5 /* CCControllerAxisInput.cpp */, - 3E6176581960F89B00DE83F5 /* CCControllerAxisInput.h */, - 3E6176591960F89B00DE83F5 /* CCControllerButtonInput.cpp */, - 3E61765A1960F89B00DE83F5 /* CCControllerButtonInput.h */, - 3E61765B1960F89B00DE83F5 /* CCControllerDirectionPad.cpp */, - 3E61765C1960F89B00DE83F5 /* CCControllerDirectionPad.h */, - 3E61765D1960F89B00DE83F5 /* CCControllerElement.cpp */, - 3E61765E1960F89B00DE83F5 /* CCControllerElement.h */, - 3E61765F1960F89B00DE83F5 /* CCControllerThumbstick.cpp */, - 3E6176601960F89B00DE83F5 /* CCControllerThumbstick.h */, 3E6176611960F89B00DE83F5 /* CCEventController.cpp */, 3E6176621960F89B00DE83F5 /* CCEventController.h */, 3E6176631960F89B00DE83F5 /* CCEventListenerController.cpp */, 3E6176641960F89B00DE83F5 /* CCEventListenerController.h */, 3E6176651960F89B00DE83F5 /* CCGameController.h */, - 3E6176661960F89B00DE83F5 /* CCGamepad.cpp */, - 3E6176671960F89B00DE83F5 /* CCGamepad.h */, 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */, 299754F3193EC95400A54AC3 /* ObjectFactory.h */, 50ABBDC11925AB6E00A911A9 /* atitc.cpp */, @@ -5571,7 +5538,6 @@ 1A570068180BC5A10088DEC7 /* CCActionCamera.h in Headers */, 1A57006C180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */, 5034CA3A191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */, - 3E61766B1960F89B00DE83F5 /* CCControllerAxisInput.h in Headers */, 50ABBEC41925AB6F00A911A9 /* CCVector.h in Headers */, 50ABBE501925AB6F00A911A9 /* CCEventCustom.h in Headers */, 1A570070180BC5A10088DEC7 /* CCActionEase.h in Headers */, @@ -5608,7 +5574,6 @@ 50ABC0101926664800A911A9 /* CCFileUtils.h in Headers */, 2905FA4318CF08D100240AA3 /* CocosGUI.h in Headers */, 5034CA30191D591100CE6051 /* ccShader_PositionTexture.vert in Headers */, - 3E6176711960F89B00DE83F5 /* CCControllerElement.h in Headers */, 50E6D33718E174130051CA34 /* UIHBox.h in Headers */, 1A570111180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */, 50E6D33F18E174130051CA34 /* UIVBox.h in Headers */, @@ -5676,7 +5641,6 @@ 5034CA2C191D591100CE6051 /* ccShader_PositionTextureA8Color.vert in Headers */, 50ABBE981925AB6F00A911A9 /* CCProtocols.h in Headers */, 2905FA8B18CF08D100240AA3 /* UITextField.h in Headers */, - 3E6176731960F89B00DE83F5 /* CCControllerThumbstick.h in Headers */, 50FCEBA618C72017004AD434 /* ListViewReader.h in Headers */, 50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */, 50ABBE441925AB6F00A911A9 /* CCDirector.h in Headers */, @@ -5695,7 +5659,6 @@ 50ABBE741925AB6F00A911A9 /* CCEventListenerMouse.h in Headers */, 2905FA8F18CF08D100240AA3 /* UIWidget.h in Headers */, 50FCEB9A18C72017004AD434 /* CheckBoxReader.h in Headers */, - 3E61766D1960F89B00DE83F5 /* CCControllerButtonInput.h in Headers */, 1A5702CB180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */, 2905FA7F18CF08D100240AA3 /* UIText.h in Headers */, 1A5702ED180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */, @@ -5708,7 +5671,6 @@ 1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */, 50ABBE2A1925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */, 1A57030F180BCF190088DEC7 /* CCComponent.h in Headers */, - 3E61766F1960F89B00DE83F5 /* CCControllerDirectionPad.h in Headers */, 1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */, 0634A4DF194B19E400E608AF /* CCNodeReader.h in Headers */, 1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */, @@ -5815,7 +5777,6 @@ 1AD71ED0180E26E600808F54 /* Skeleton.h in Headers */, 50ABBE541925AB6F00A911A9 /* CCEventDispatcher.h in Headers */, 1AD71ED4180E26E600808F54 /* SkeletonData.h in Headers */, - 3E61767A1960F89B00DE83F5 /* CCGamepad.h in Headers */, 1AD71ED8180E26E600808F54 /* SkeletonJson.h in Headers */, 1A12775A18DFCC4F0005F345 /* CCTweenFunction.h in Headers */, 1AD71EDC180E26E600808F54 /* Skin.h in Headers */, @@ -6752,7 +6713,6 @@ 3E6176681960F89B00DE83F5 /* CCController-iOS.mm in Sources */, 2905FA8D18CF08D100240AA3 /* UIWidget.cpp in Sources */, 29E99D1F1957BA7000046604 /* CocoLoader.cpp in Sources */, - 3E61766C1960F89B00DE83F5 /* CCControllerButtonInput.cpp in Sources */, B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */, 0634A4D5194B19E400E608AF /* CCActionTimelineCache.cpp in Sources */, 50ABBE7E1925AB6F00A911A9 /* CCEventTouch.cpp in Sources */, @@ -6792,6 +6752,7 @@ 1A57019E180BCB590088DEC7 /* CCFont.cpp in Sources */, 503DD8E21926736A00CD74DD /* CCCommon.mm in Sources */, 1A5701A2180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */, + 3E61781D1966A5A300DE83F5 /* CCController.cpp in Sources */, 50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */, 50ABBE241925AB6F00A911A9 /* base64.cpp in Sources */, 1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */, @@ -6831,13 +6792,11 @@ 1A570215180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, 1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */, 1A570226180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */, - 3E6176791960F89B00DE83F5 /* CCGamepad.cpp in Sources */, 1A57022A180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */, B24AA98A195A675C007B4522 /* CCFastTMXTiledMap.cpp in Sources */, B24AA986195A675C007B4522 /* CCFastTMXLayer.cpp in Sources */, 1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */, 50ABBD901925AB4100A911A9 /* CCGLProgramCache.cpp in Sources */, - 3E6176701960F89B00DE83F5 /* CCControllerElement.cpp in Sources */, 2905FA5718CF08D100240AA3 /* UILayout.cpp in Sources */, 2905FA7D18CF08D100240AA3 /* UIText.cpp in Sources */, 50E6D33D18E174130051CA34 /* UIVBox.cpp in Sources */, @@ -6853,7 +6812,6 @@ 1A5702C9180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */, 1A5702EB180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */, 1A5702EF180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */, - 3E61766A1960F89B00DE83F5 /* CCControllerAxisInput.cpp in Sources */, 1A5702F3180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */, 50ABBD3D1925AB0000A911A9 /* CCGeometry.cpp in Sources */, 50ABBECC1925AB6F00A911A9 /* s3tc.cpp in Sources */, @@ -6966,7 +6924,6 @@ 50ABBE9A1925AB6F00A911A9 /* CCRef.cpp in Sources */, 3E6176741960F89B00DE83F5 /* CCEventController.cpp in Sources */, 50ABBE361925AB6F00A911A9 /* CCConsole.cpp in Sources */, - 3E61766E1960F89B00DE83F5 /* CCControllerDirectionPad.cpp in Sources */, 503DD8E51926736A00CD74DD /* CCDirectorCaller.mm in Sources */, 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */, 50ABC0121926664800A911A9 /* CCGLViewProtocol.cpp in Sources */, @@ -7005,7 +6962,6 @@ 1A8C59D4180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */, 1A8C59D8180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */, 46C02E0818E91123004B7456 /* xxhash.c in Sources */, - 3E6176721960F89B00DE83F5 /* CCControllerThumbstick.cpp in Sources */, 50ABBED01925AB6F00A911A9 /* TGAlib.cpp in Sources */, 2905FA4118CF08D100240AA3 /* CocosGUI.cpp in Sources */, 1A01C68518F57BE800EFE3A6 /* CCArray.cpp in Sources */, diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index 2c889dbc87..a76759dc2b 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -58,6 +58,13 @@ 1503FAC418DA8B6C00F6518C /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 1503FAC518DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 1503FAC618DA8B6C00F6518C /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; + 15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; + 15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 3EA0FB5D191B92F100B170C8 /* cocosvideo.mp4 */; }; + 15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; }; + 15AECE22195D122400907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; }; + 15AECE23195D122600907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; }; + 15AECE24195D122700907DB0 /* experimentalConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */; }; + 15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; 15B0870D195AD52000D6F62B /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; 15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; }; 15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; }; @@ -86,6 +93,42 @@ 15C90B4A18E66C2B00D69802 /* tp.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB118DA8B6C00F6518C /* tp.lua */; }; 15C90B4B18E66C2F00D69802 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; 15C90B4C18E66C3100D69802 /* url.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1503FAB218DA8B6C00F6518C /* url.lua */; }; + 15CBA9A9196EE7FA005877BB /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36818CD9E180087CE3A /* Cocos2d.lua */; }; + 15CBA9AA196EE7FA005877BB /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36918CD9E180087CE3A /* Cocos2dConstants.lua */; }; + 15CBA9AB196EE7FA005877BB /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36A18CD9E180087CE3A /* CocoStudio.lua */; }; + 15CBA9AC196EE7FA005877BB /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36B18CD9E180087CE3A /* Deprecated.lua */; }; + 15CBA9AD196EE7FA005877BB /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36C18CD9E180087CE3A /* DeprecatedClass.lua */; }; + 15CBA9AE196EE7FA005877BB /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA36D18CD9E180087CE3A /* DeprecatedEnum.lua */; }; + 15CBA9AF196EE80B005877BB /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F01960FEFE00DE83F5 /* fonts */; }; + 15CBA9B0196EE80B005877BB /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F11960FEFE00DE83F5 /* ipad */; }; + 15CBA9B1196EE80B005877BB /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F21960FEFE00DE83F5 /* ipadhd */; }; + 15CBA9B2196EE80B005877BB /* iphone in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F31960FEFE00DE83F5 /* iphone */; }; + 15CBA9B3196EE824005877BB /* src in Resources */ = {isa = PBXBuildFile; fileRef = 15CBA9A4196EE6B1005877BB /* src */; }; + 15CBA9B4196EE8A0005877BB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA08B196EE66D005877BB /* AppDelegate.cpp */; }; + 15CBA9B7196EE8D9005877BB /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA53F196EE671005877BB /* AppController.mm */; }; + 15CBA9B8196EE8D9005877BB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA54C196EE671005877BB /* main.m */; }; + 15CBA9B9196EE8D9005877BB /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA54E196EE671005877BB /* RootViewController.mm */; }; + 15CBA9BB196EE910005877BB /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; }; + 15CBA9BD196EE910005877BB /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; }; + 15CBA9BE196EE910005877BB /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; }; + 15CBA9BF196EE910005877BB /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABCA28018CD90A50087CE3A /* libluabindings iOS.a */; }; + 15CBA9CF196EE9FB005877BB /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C2196EE951005877BB /* AVFoundation.framework */; }; + 15CBA9D0196EEA05005877BB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C4196EE962005877BB /* UIKit.framework */; }; + 15CBA9D1196EEA1D005877BB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C0196EE943005877BB /* Foundation.framework */; }; + 15CBA9D2196EEA33005877BB /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C6196EE971005877BB /* OpenGLES.framework */; }; + 15CBA9D4196EEA33005877BB /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9D3196EEA33005877BB /* OpenAL.framework */; }; + 15CBA9D5196EEA43005877BB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9C8196EE97F005877BB /* CoreGraphics.framework */; }; + 15CBA9D7196EEA63005877BB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9D6196EEA63005877BB /* AudioToolbox.framework */; }; + 15CBA9D9196EEA7D005877BB /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9D8196EEA7D005877BB /* QuartzCore.framework */; }; + 15CBA9DB196EEA90005877BB /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9DA196EEA90005877BB /* CoreMotion.framework */; }; + 15CBA9DD196EEAA6005877BB /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15CBA9DC196EEAA6005877BB /* libz.dylib */; }; + 15CBA9DE196EEAF8005877BB /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E61773C1960FBD100DE83F5 /* GameController.framework */; }; + 15CBA9DF196EEBB3005877BB /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; }; + 15CBA9E0196EEBD4005877BB /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EA0FB65191B933000B170C8 /* MediaPlayer.framework */; }; + 15CBA9ED196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */; }; + 15CBA9F0196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CBA9EE196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp */; }; + 15CBA9F1196F865C005877BB /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA37218CD9E180087CE3A /* json.lua */; }; + 15CBA9F2196F8718005877BB /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ABCA37018CD9E180087CE3A /* extern.lua */; }; 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 15E66FD6192DC8C700C20A52 /* Sprite3DTest in Resources */ = {isa = PBXBuildFile; fileRef = 3E92EA841921A7720094CD21 /* Sprite3DTest */; }; 1A0EE2A118CDF6DA004CD58F /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; }; @@ -805,6 +848,10 @@ 29080DE4191B595E0066F8DF /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D89191B595E0066F8DF /* UIWidgetAddNodeTest.cpp */; }; 29080DE5191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; + 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; + 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; + 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; + 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; 38FA2E73194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; 38FA2E74194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */; }; 38FA2E76194AECF800FF2BE4 /* ActionTimeline in Resources */ = {isa = PBXBuildFile; fileRef = 38FA2E75194AECF800FF2BE4 /* ActionTimeline */; }; @@ -827,8 +874,6 @@ 3E6177351960FB4000DE83F5 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176DE1960FA6300DE83F5 /* AppController.mm */; }; 3E6177361960FB5A00DE83F5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176EE1960FA6300DE83F5 /* main.m */; }; 3E6177371960FB5E00DE83F5 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3E6176F01960FA6300DE83F5 /* RootViewController.mm */; }; - 3E6177391960FBB800DE83F5 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E6177381960FBB800DE83F5 /* SystemConfiguration.framework */; }; - 3E61773B1960FBC300DE83F5 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E61773A1960FBC300DE83F5 /* CFNetwork.framework */; }; 3E61773D1960FBD200DE83F5 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E61773C1960FBD100DE83F5 /* GameController.framework */; }; 3E6177F41960FEFE00DE83F5 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F01960FEFE00DE83F5 /* fonts */; }; 3E6177F51960FEFE00DE83F5 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 3E6177F11960FEFE00DE83F5 /* ipad */; }; @@ -880,6 +925,41 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 15CBA017196EE56C005877BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4C241783777C0073F6A7; + remoteInfo = "cocos2dx iOS"; + }; + 15CBA019196EE56C005877BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4E111783867C0073F6A7; + remoteInfo = "cocos2dx-extensions iOS"; + }; + 15CBA01B196EE56C005877BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4EFD178387670073F6A7; + remoteInfo = "chipmunk iOS"; + }; + 15CBA01D196EE56C005877BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = A07A4F9F178387730073F6A7; + remoteInfo = "CocosDenshion iOS"; + }; + 15CBA01F196EE56C005877BB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1ABCA27618CD90A40087CE3A /* cocos2d_lua_bindings.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1A119716178526AA00D62A44; + remoteInfo = "luabindings iOS"; + }; 1A0EE1C818CDF6DA004CD58F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */; @@ -1313,6 +1393,7 @@ 1503FAB018DA8B6C00F6518C /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = socket.lua; path = ../external/lua/luasocket/socket.lua; sourceTree = ""; }; 1503FAB118DA8B6C00F6518C /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tp.lua; path = ../external/lua/luasocket/tp.lua; sourceTree = ""; }; 1503FAB218DA8B6C00F6518C /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = url.lua; path = ../external/lua/luasocket/url.lua; sourceTree = ""; }; + 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = experimentalConstants.lua; path = "../cocos/scripting/lua-bindings/script/experimentalConstants.lua"; sourceTree = ""; }; 15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 15C64824165F3934007D4F18 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; }; 15C64826165F394E007D4F18 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; @@ -1321,6 +1402,1123 @@ 15C6482C165F3988007D4F18 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; }; 15C6482E165F399D007D4F18 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; }; 15C64832165F3AFD007D4F18 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA063196EE56C005877BB /* lua-game-controller-test iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-game-controller-test iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 15CBA08B196EE66D005877BB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; + 15CBA08C196EE66D005877BB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 15CBA08F196EE66D005877BB /* .classpath */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .classpath; sourceTree = ""; }; + 15CBA090196EE66D005877BB /* .project */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = .project; sourceTree = ""; }; + 15CBA091196EE66D005877BB /* AndroidManifest.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = AndroidManifest.xml; sourceTree = ""; }; + 15CBA092196EE66D005877BB /* ant.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ant.properties; sourceTree = ""; }; + 15CBA094196EE66D005877BB /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AudioEngine.lua; sourceTree = ""; }; + 15CBA095196EE66D005877BB /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CCBReaderLoad.lua; sourceTree = ""; }; + 15CBA096196EE66D005877BB /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cocos2d.lua; sourceTree = ""; }; + 15CBA097196EE66D005877BB /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cocos2dConstants.lua; sourceTree = ""; }; + 15CBA098196EE66D005877BB /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CocoStudio.lua; sourceTree = ""; }; + 15CBA099196EE66D005877BB /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Deprecated.lua; sourceTree = ""; }; + 15CBA09A196EE66D005877BB /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeprecatedClass.lua; sourceTree = ""; }; + 15CBA09B196EE66D005877BB /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeprecatedEnum.lua; sourceTree = ""; }; + 15CBA09C196EE66D005877BB /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeprecatedOpenglEnum.lua; sourceTree = ""; }; + 15CBA09D196EE66D005877BB /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DrawPrimitives.lua; sourceTree = ""; }; + 15CBA09E196EE66D005877BB /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extern.lua; sourceTree = ""; }; + 15CBA09F196EE66D005877BB /* ftp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ftp.lua; sourceTree = ""; }; + 15CBA0A0196EE66D005877BB /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GuiConstants.lua; sourceTree = ""; }; + 15CBA0A1196EE66D005877BB /* headers.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = headers.lua; sourceTree = ""; }; + 15CBA0A2196EE66D005877BB /* http.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = http.lua; sourceTree = ""; }; + 15CBA0A3196EE66D005877BB /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = json.lua; sourceTree = ""; }; + 15CBA0A4196EE66D005877BB /* ltn12.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ltn12.lua; sourceTree = ""; }; + 15CBA0A5196EE66D005877BB /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = luaj.lua; sourceTree = ""; }; + 15CBA0A6196EE66D005877BB /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = luaoc.lua; sourceTree = ""; }; + 15CBA0A7196EE66D005877BB /* mbox.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mbox.lua; sourceTree = ""; }; + 15CBA0A8196EE66D005877BB /* mime.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mime.lua; sourceTree = ""; }; + 15CBA0A9196EE66D005877BB /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Opengl.lua; sourceTree = ""; }; + 15CBA0AA196EE66D005877BB /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OpenglConstants.lua; sourceTree = ""; }; + 15CBA0AD196EE66D005877BB /* Marker Felt.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Marker Felt.ttf"; sourceTree = ""; }; + 15CBA0AF196EE66D005877BB /* A.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = A.png; sourceTree = ""; }; + 15CBA0B0196EE66D005877BB /* B.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = B.png; sourceTree = ""; }; + 15CBA0B1196EE66D005877BB /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; + 15CBA0B2196EE66D005877BB /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; + 15CBA0B3196EE66D005877BB /* controller-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "controller-1.png"; sourceTree = ""; }; + 15CBA0B4196EE66D005877BB /* controller-2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "controller-2.png"; sourceTree = ""; }; + 15CBA0B5196EE66D005877BB /* dpad-key.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dpad-key.png"; sourceTree = ""; }; + 15CBA0B6196EE66D005877BB /* dPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dPad.png; sourceTree = ""; }; + 15CBA0B7196EE66D005877BB /* joystick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = joystick.png; sourceTree = ""; }; + 15CBA0B8196EE66D005877BB /* L1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = L1.png; sourceTree = ""; }; + 15CBA0B9196EE66D005877BB /* L2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = L2.png; sourceTree = ""; }; + 15CBA0BA196EE66D005877BB /* R1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = R1.png; sourceTree = ""; }; + 15CBA0BB196EE66D005877BB /* R2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = R2.png; sourceTree = ""; }; + 15CBA0BC196EE66D005877BB /* X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = X.png; sourceTree = ""; }; + 15CBA0BD196EE66D005877BB /* Y.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Y.png; sourceTree = ""; }; + 15CBA0BF196EE66D005877BB /* A.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = A.png; sourceTree = ""; }; + 15CBA0C0196EE66D005877BB /* B.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = B.png; sourceTree = ""; }; + 15CBA0C1196EE66D005877BB /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; + 15CBA0C2196EE66D005877BB /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; + 15CBA0C3196EE66D005877BB /* controller-1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "controller-1.png"; sourceTree = ""; }; + 15CBA0C4196EE66D005877BB /* controller-2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "controller-2.png"; sourceTree = ""; }; + 15CBA0C5196EE66D005877BB /* dPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dPad.png; sourceTree = ""; }; + 15CBA0C6196EE66D005877BB /* joystick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = joystick.png; sourceTree = ""; }; + 15CBA0C7196EE66D005877BB /* L1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = L1.png; sourceTree = ""; }; + 15CBA0C8196EE66D005877BB /* L2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = L2.png; sourceTree = ""; }; + 15CBA0C9196EE66D005877BB /* R1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = R1.png; sourceTree = ""; }; + 15CBA0CA196EE66D005877BB /* R2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = R2.png; sourceTree = ""; }; + 15CBA0CB196EE66D005877BB /* X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = X.png; sourceTree = ""; }; + 15CBA0CC196EE66D005877BB /* Y.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Y.png; sourceTree = ""; }; + 15CBA0CE196EE66D005877BB /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = ""; }; + 15CBA0CF196EE66D005877BB /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = ""; }; + 15CBA0D0196EE66D005877BB /* smtp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = smtp.lua; sourceTree = ""; }; + 15CBA0D1196EE66D005877BB /* socket.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = socket.lua; sourceTree = ""; }; + 15CBA0D3196EE66D005877BB /* GameControllerTest.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GameControllerTest.lua; sourceTree = ""; }; + 15CBA0D4196EE66D005877BB /* main.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.lua; sourceTree = ""; }; + 15CBA0D5196EE66D005877BB /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = StudioConstants.lua; sourceTree = ""; }; + 15CBA0D6196EE66D005877BB /* tp.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tp.lua; sourceTree = ""; }; + 15CBA0D7196EE66D005877BB /* url.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = url.lua; sourceTree = ""; }; + 15CBA0D9196EE66D005877BB /* AndroidManifest.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = AndroidManifest.xml; sourceTree = ""; }; + 15CBA0DA196EE66D005877BB /* AndroidManifest.xml.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AndroidManifest.xml.d; sourceTree = ""; }; + 15CBA0DB196EE66D005877BB /* build.prop */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = build.prop; sourceTree = ""; }; + 15CBA0E0196EE66D005877BB /* R$drawable.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R$drawable.class; sourceTree = ""; }; + 15CBA0E1196EE66D005877BB /* R$string.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R$string.class; sourceTree = ""; }; + 15CBA0E2196EE66D005877BB /* R.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R.class; sourceTree = ""; }; + 15CBA0E4196EE66D005877BB /* AppActivity.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = AppActivity.class; sourceTree = ""; }; + 15CBA0E5196EE66D005877BB /* BuildConfig.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = BuildConfig.class; sourceTree = ""; }; + 15CBA0E6196EE66D005877BB /* R$attr.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R$attr.class; sourceTree = ""; }; + 15CBA0E7196EE66D005877BB /* R$drawable.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R$drawable.class; sourceTree = ""; }; + 15CBA0E8196EE66D005877BB /* R$string.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R$string.class; sourceTree = ""; }; + 15CBA0E9196EE66D005877BB /* R.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = R.class; sourceTree = ""; }; + 15CBA0EA196EE66D005877BB /* R.java.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = R.java.d; sourceTree = ""; }; + 15CBA0EB196EE66D005877BB /* classes.dex */ = {isa = PBXFileReference; lastKnownFileType = file; path = classes.dex; sourceTree = ""; }; + 15CBA0EC196EE66D005877BB /* classes.dex.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = classes.dex.d; sourceTree = ""; }; + 15CBA0EE196EE66D005877BB /* com.bda.controller-2a2221a1ab7454168b1de77b0fcb60b5.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "com.bda.controller-2a2221a1ab7454168b1de77b0fcb60b5.jar"; sourceTree = ""; }; + 15CBA0EF196EE66D005877BB /* libcocos2dx-6607f245d91af6aef71b17fa98444a4b.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "libcocos2dx-6607f245d91af6aef71b17fa98444a4b.jar"; sourceTree = ""; }; + 15CBA0F0196EE66E005877BB /* libcontrollermanualadapter-e17761caab08972308a4bbfa589d7d02.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "libcontrollermanualadapter-e17761caab08972308a4bbfa589d7d02.jar"; sourceTree = ""; }; + 15CBA0F1196EE66E005877BB /* nibiru_lib_2_1_7-67e12061a63fd16ecf47bdef1767938c.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "nibiru_lib_2_1_7-67e12061a63fd16ecf47bdef1767938c.jar"; sourceTree = ""; }; + 15CBA0F2196EE66E005877BB /* ouya-sdk-f5c122a155623a2270a639db2ebe8685.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "ouya-sdk-f5c122a155623a2270a639db2ebe8685.jar"; sourceTree = ""; }; + 15CBA0F3196EE66E005877BB /* jarlist.cache */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = jarlist.cache; sourceTree = ""; }; + 15CBA0F4196EE66E005877BB /* LuaGameControllerTest-debug-unaligned.apk */ = {isa = PBXFileReference; lastKnownFileType = file; path = "LuaGameControllerTest-debug-unaligned.apk"; sourceTree = ""; }; + 15CBA0F5196EE66E005877BB /* LuaGameControllerTest-debug-unaligned.apk.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = "LuaGameControllerTest-debug-unaligned.apk.d"; sourceTree = ""; }; + 15CBA0F6196EE66E005877BB /* LuaGameControllerTest-debug.apk */ = {isa = PBXFileReference; lastKnownFileType = file; path = "LuaGameControllerTest-debug.apk"; sourceTree = ""; }; + 15CBA0F7196EE66E005877BB /* LuaGameControllerTest.ap_ */ = {isa = PBXFileReference; lastKnownFileType = file; path = LuaGameControllerTest.ap_; sourceTree = ""; }; + 15CBA0F8196EE66E005877BB /* LuaGameControllerTest.ap_.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LuaGameControllerTest.ap_.d; sourceTree = ""; }; + 15CBA0F9196EE66E005877BB /* LuaGameControllerTest.apk */ = {isa = PBXFileReference; lastKnownFileType = file; path = LuaGameControllerTest.apk; sourceTree = ""; }; + 15CBA0FA196EE66E005877BB /* proguard.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = proguard.txt; sourceTree = ""; }; + 15CBA0FB196EE66E005877BB /* R.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = R.txt; sourceTree = ""; }; + 15CBA0FE196EE66E005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA100196EE66E005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA102196EE66E005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA103196EE66E005877BB /* resources.ap_ */ = {isa = PBXFileReference; lastKnownFileType = file; path = resources.ap_; sourceTree = ""; }; + 15CBA104196EE66E005877BB /* build-cfg.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "build-cfg.json"; sourceTree = ""; }; + 15CBA105196EE66E005877BB /* build.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = build.xml; sourceTree = ""; }; + 15CBA10A196EE66E005877BB /* R.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = R.java; sourceTree = ""; }; + 15CBA10C196EE66E005877BB /* BuildConfig.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = BuildConfig.java; sourceTree = ""; }; + 15CBA10D196EE66E005877BB /* R.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = R.java; sourceTree = ""; }; + 15CBA10E196EE66E005877BB /* R.java.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = R.java.d; sourceTree = ""; }; + 15CBA110196EE66E005877BB /* Android.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Android.mk; sourceTree = ""; }; + 15CBA111196EE66E005877BB /* Application.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Application.mk; sourceTree = ""; }; + 15CBA112196EE66E005877BB /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + 15CBA115196EE66E005877BB /* liblua_game_controller.so */ = {isa = PBXFileReference; lastKnownFileType = file; path = liblua_game_controller.so; sourceTree = ""; }; + 15CBA116196EE66E005877BB /* local.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = local.properties; sourceTree = ""; }; + 15CBA11A196EE66E005877BB /* libbox2d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libbox2d.a; sourceTree = ""; }; + 15CBA11B196EE66E005877BB /* libchipmunk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libchipmunk.a; sourceTree = ""; }; + 15CBA11C196EE66E005877BB /* libcocos2d.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcocos2d.a; sourceTree = ""; }; + 15CBA11D196EE66E005877BB /* libcocos2dandroid.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcocos2dandroid.a; sourceTree = ""; }; + 15CBA11E196EE66E005877BB /* libcocosbuilder.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcocosbuilder.a; sourceTree = ""; }; + 15CBA11F196EE66E005877BB /* libcocosdenshion.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcocosdenshion.a; sourceTree = ""; }; + 15CBA120196EE66E005877BB /* libcocostudio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcocostudio.a; sourceTree = ""; }; + 15CBA121196EE66E005877BB /* libcpufeatures.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcpufeatures.a; sourceTree = ""; }; + 15CBA122196EE66E005877BB /* libextension.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libextension.a; sourceTree = ""; }; + 15CBA123196EE66E005877BB /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = liblua.a; sourceTree = ""; }; + 15CBA124196EE66E005877BB /* liblua_game_controller.so */ = {isa = PBXFileReference; lastKnownFileType = file; path = liblua_game_controller.so; sourceTree = ""; }; + 15CBA125196EE66E005877BB /* libnetwork.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libnetwork.a; sourceTree = ""; }; + 15CBA126196EE66E005877BB /* libspine.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libspine.a; sourceTree = ""; }; + 15CBA127196EE66E005877BB /* libui.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libui.a; sourceTree = ""; }; + 15CBA12B196EE66E005877BB /* b2BroadPhase.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2BroadPhase.o; sourceTree = ""; }; + 15CBA12C196EE66E005877BB /* b2BroadPhase.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2BroadPhase.o.d; sourceTree = ""; }; + 15CBA12D196EE66E005877BB /* b2CollideCircle.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2CollideCircle.o; sourceTree = ""; }; + 15CBA12E196EE66E005877BB /* b2CollideCircle.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2CollideCircle.o.d; sourceTree = ""; }; + 15CBA12F196EE66E005877BB /* b2CollideEdge.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2CollideEdge.o; sourceTree = ""; }; + 15CBA130196EE66E005877BB /* b2CollideEdge.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2CollideEdge.o.d; sourceTree = ""; }; + 15CBA131196EE66E005877BB /* b2CollidePolygon.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2CollidePolygon.o; sourceTree = ""; }; + 15CBA132196EE66E005877BB /* b2CollidePolygon.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2CollidePolygon.o.d; sourceTree = ""; }; + 15CBA133196EE66E005877BB /* b2Collision.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Collision.o; sourceTree = ""; }; + 15CBA134196EE66E005877BB /* b2Collision.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Collision.o.d; sourceTree = ""; }; + 15CBA135196EE66E005877BB /* b2Distance.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Distance.o; sourceTree = ""; }; + 15CBA136196EE66E005877BB /* b2Distance.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Distance.o.d; sourceTree = ""; }; + 15CBA137196EE66E005877BB /* b2DynamicTree.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2DynamicTree.o; sourceTree = ""; }; + 15CBA138196EE66E005877BB /* b2DynamicTree.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2DynamicTree.o.d; sourceTree = ""; }; + 15CBA139196EE66E005877BB /* b2TimeOfImpact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2TimeOfImpact.o; sourceTree = ""; }; + 15CBA13A196EE66E005877BB /* b2TimeOfImpact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2TimeOfImpact.o.d; sourceTree = ""; }; + 15CBA13C196EE66E005877BB /* b2ChainShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2ChainShape.o; sourceTree = ""; }; + 15CBA13D196EE66E005877BB /* b2ChainShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2ChainShape.o.d; sourceTree = ""; }; + 15CBA13E196EE66E005877BB /* b2CircleShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2CircleShape.o; sourceTree = ""; }; + 15CBA13F196EE66E005877BB /* b2CircleShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2CircleShape.o.d; sourceTree = ""; }; + 15CBA140196EE66E005877BB /* b2EdgeShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2EdgeShape.o; sourceTree = ""; }; + 15CBA141196EE66E005877BB /* b2EdgeShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2EdgeShape.o.d; sourceTree = ""; }; + 15CBA142196EE66E005877BB /* b2PolygonShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2PolygonShape.o; sourceTree = ""; }; + 15CBA143196EE66E005877BB /* b2PolygonShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2PolygonShape.o.d; sourceTree = ""; }; + 15CBA145196EE66E005877BB /* b2BlockAllocator.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2BlockAllocator.o; sourceTree = ""; }; + 15CBA146196EE66E005877BB /* b2BlockAllocator.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2BlockAllocator.o.d; sourceTree = ""; }; + 15CBA147196EE66E005877BB /* b2Draw.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Draw.o; sourceTree = ""; }; + 15CBA148196EE66E005877BB /* b2Draw.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Draw.o.d; sourceTree = ""; }; + 15CBA149196EE66E005877BB /* b2Math.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Math.o; sourceTree = ""; }; + 15CBA14A196EE66E005877BB /* b2Math.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Math.o.d; sourceTree = ""; }; + 15CBA14B196EE66E005877BB /* b2Settings.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Settings.o; sourceTree = ""; }; + 15CBA14C196EE66E005877BB /* b2Settings.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Settings.o.d; sourceTree = ""; }; + 15CBA14D196EE66E005877BB /* b2StackAllocator.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2StackAllocator.o; sourceTree = ""; }; + 15CBA14E196EE66E005877BB /* b2StackAllocator.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2StackAllocator.o.d; sourceTree = ""; }; + 15CBA14F196EE66E005877BB /* b2Timer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Timer.o; sourceTree = ""; }; + 15CBA150196EE66E005877BB /* b2Timer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Timer.o.d; sourceTree = ""; }; + 15CBA152196EE66E005877BB /* b2Body.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Body.o; sourceTree = ""; }; + 15CBA153196EE66E005877BB /* b2Body.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Body.o.d; sourceTree = ""; }; + 15CBA154196EE66E005877BB /* b2ContactManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2ContactManager.o; sourceTree = ""; }; + 15CBA155196EE66E005877BB /* b2ContactManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2ContactManager.o.d; sourceTree = ""; }; + 15CBA156196EE66E005877BB /* b2Fixture.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Fixture.o; sourceTree = ""; }; + 15CBA157196EE66E005877BB /* b2Fixture.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Fixture.o.d; sourceTree = ""; }; + 15CBA158196EE66E005877BB /* b2Island.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Island.o; sourceTree = ""; }; + 15CBA159196EE66E005877BB /* b2Island.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Island.o.d; sourceTree = ""; }; + 15CBA15A196EE66E005877BB /* b2World.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2World.o; sourceTree = ""; }; + 15CBA15B196EE66E005877BB /* b2World.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2World.o.d; sourceTree = ""; }; + 15CBA15C196EE66E005877BB /* b2WorldCallbacks.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2WorldCallbacks.o; sourceTree = ""; }; + 15CBA15D196EE66E005877BB /* b2WorldCallbacks.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2WorldCallbacks.o.d; sourceTree = ""; }; + 15CBA15F196EE66E005877BB /* b2ChainAndCircleContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2ChainAndCircleContact.o; sourceTree = ""; }; + 15CBA160196EE66E005877BB /* b2ChainAndCircleContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2ChainAndCircleContact.o.d; sourceTree = ""; }; + 15CBA161196EE66E005877BB /* b2ChainAndPolygonContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2ChainAndPolygonContact.o; sourceTree = ""; }; + 15CBA162196EE66E005877BB /* b2ChainAndPolygonContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2ChainAndPolygonContact.o.d; sourceTree = ""; }; + 15CBA163196EE66E005877BB /* b2CircleContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2CircleContact.o; sourceTree = ""; }; + 15CBA164196EE66E005877BB /* b2CircleContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2CircleContact.o.d; sourceTree = ""; }; + 15CBA165196EE66E005877BB /* b2Contact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Contact.o; sourceTree = ""; }; + 15CBA166196EE66E005877BB /* b2Contact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Contact.o.d; sourceTree = ""; }; + 15CBA167196EE66E005877BB /* b2ContactSolver.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2ContactSolver.o; sourceTree = ""; }; + 15CBA168196EE66E005877BB /* b2ContactSolver.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2ContactSolver.o.d; sourceTree = ""; }; + 15CBA169196EE66E005877BB /* b2EdgeAndCircleContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2EdgeAndCircleContact.o; sourceTree = ""; }; + 15CBA16A196EE66E005877BB /* b2EdgeAndCircleContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2EdgeAndCircleContact.o.d; sourceTree = ""; }; + 15CBA16B196EE66E005877BB /* b2EdgeAndPolygonContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2EdgeAndPolygonContact.o; sourceTree = ""; }; + 15CBA16C196EE66E005877BB /* b2EdgeAndPolygonContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2EdgeAndPolygonContact.o.d; sourceTree = ""; }; + 15CBA16D196EE66E005877BB /* b2PolygonAndCircleContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2PolygonAndCircleContact.o; sourceTree = ""; }; + 15CBA16E196EE66E005877BB /* b2PolygonAndCircleContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2PolygonAndCircleContact.o.d; sourceTree = ""; }; + 15CBA16F196EE66E005877BB /* b2PolygonContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2PolygonContact.o; sourceTree = ""; }; + 15CBA170196EE66E005877BB /* b2PolygonContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2PolygonContact.o.d; sourceTree = ""; }; + 15CBA172196EE66E005877BB /* b2DistanceJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2DistanceJoint.o; sourceTree = ""; }; + 15CBA173196EE66E005877BB /* b2DistanceJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2DistanceJoint.o.d; sourceTree = ""; }; + 15CBA174196EE66E005877BB /* b2FrictionJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2FrictionJoint.o; sourceTree = ""; }; + 15CBA175196EE66E005877BB /* b2FrictionJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2FrictionJoint.o.d; sourceTree = ""; }; + 15CBA176196EE66E005877BB /* b2GearJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2GearJoint.o; sourceTree = ""; }; + 15CBA177196EE66E005877BB /* b2GearJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2GearJoint.o.d; sourceTree = ""; }; + 15CBA178196EE66E005877BB /* b2Joint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Joint.o; sourceTree = ""; }; + 15CBA179196EE66E005877BB /* b2Joint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Joint.o.d; sourceTree = ""; }; + 15CBA17A196EE66E005877BB /* b2MotorJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2MotorJoint.o; sourceTree = ""; }; + 15CBA17B196EE66E005877BB /* b2MotorJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2MotorJoint.o.d; sourceTree = ""; }; + 15CBA17C196EE66E005877BB /* b2MouseJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2MouseJoint.o; sourceTree = ""; }; + 15CBA17D196EE66E005877BB /* b2MouseJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2MouseJoint.o.d; sourceTree = ""; }; + 15CBA17E196EE66E005877BB /* b2PrismaticJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2PrismaticJoint.o; sourceTree = ""; }; + 15CBA17F196EE66E005877BB /* b2PrismaticJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2PrismaticJoint.o.d; sourceTree = ""; }; + 15CBA180196EE66E005877BB /* b2PulleyJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2PulleyJoint.o; sourceTree = ""; }; + 15CBA181196EE66E005877BB /* b2PulleyJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2PulleyJoint.o.d; sourceTree = ""; }; + 15CBA182196EE66E005877BB /* b2RevoluteJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2RevoluteJoint.o; sourceTree = ""; }; + 15CBA183196EE66E005877BB /* b2RevoluteJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2RevoluteJoint.o.d; sourceTree = ""; }; + 15CBA184196EE66E005877BB /* b2RopeJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2RopeJoint.o; sourceTree = ""; }; + 15CBA185196EE66E005877BB /* b2RopeJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2RopeJoint.o.d; sourceTree = ""; }; + 15CBA186196EE66E005877BB /* b2WeldJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2WeldJoint.o; sourceTree = ""; }; + 15CBA187196EE66E005877BB /* b2WeldJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2WeldJoint.o.d; sourceTree = ""; }; + 15CBA188196EE66E005877BB /* b2WheelJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2WheelJoint.o; sourceTree = ""; }; + 15CBA189196EE66E005877BB /* b2WheelJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2WheelJoint.o.d; sourceTree = ""; }; + 15CBA18B196EE66E005877BB /* b2Rope.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = b2Rope.o; sourceTree = ""; }; + 15CBA18C196EE66E005877BB /* b2Rope.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = b2Rope.o.d; sourceTree = ""; }; + 15CBA18F196EE66E005877BB /* chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = chipmunk.o; sourceTree = ""; }; + 15CBA190196EE66E005877BB /* chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = chipmunk.o.d; sourceTree = ""; }; + 15CBA192196EE66E005877BB /* cpConstraint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpConstraint.o; sourceTree = ""; }; + 15CBA193196EE66E005877BB /* cpConstraint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpConstraint.o.d; sourceTree = ""; }; + 15CBA194196EE66E005877BB /* cpDampedRotarySpring.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpDampedRotarySpring.o; sourceTree = ""; }; + 15CBA195196EE66E005877BB /* cpDampedRotarySpring.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpDampedRotarySpring.o.d; sourceTree = ""; }; + 15CBA196196EE66E005877BB /* cpDampedSpring.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpDampedSpring.o; sourceTree = ""; }; + 15CBA197196EE66E005877BB /* cpDampedSpring.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpDampedSpring.o.d; sourceTree = ""; }; + 15CBA198196EE66E005877BB /* cpGearJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpGearJoint.o; sourceTree = ""; }; + 15CBA199196EE66E005877BB /* cpGearJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpGearJoint.o.d; sourceTree = ""; }; + 15CBA19A196EE66E005877BB /* cpGrooveJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpGrooveJoint.o; sourceTree = ""; }; + 15CBA19B196EE66E005877BB /* cpGrooveJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpGrooveJoint.o.d; sourceTree = ""; }; + 15CBA19C196EE66E005877BB /* cpPinJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpPinJoint.o; sourceTree = ""; }; + 15CBA19D196EE66E005877BB /* cpPinJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpPinJoint.o.d; sourceTree = ""; }; + 15CBA19E196EE66E005877BB /* cpPivotJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpPivotJoint.o; sourceTree = ""; }; + 15CBA19F196EE66E005877BB /* cpPivotJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpPivotJoint.o.d; sourceTree = ""; }; + 15CBA1A0196EE66E005877BB /* cpRatchetJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpRatchetJoint.o; sourceTree = ""; }; + 15CBA1A1196EE66E005877BB /* cpRatchetJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpRatchetJoint.o.d; sourceTree = ""; }; + 15CBA1A2196EE66E005877BB /* cpRotaryLimitJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpRotaryLimitJoint.o; sourceTree = ""; }; + 15CBA1A3196EE66E005877BB /* cpRotaryLimitJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpRotaryLimitJoint.o.d; sourceTree = ""; }; + 15CBA1A4196EE66E005877BB /* cpSimpleMotor.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSimpleMotor.o; sourceTree = ""; }; + 15CBA1A5196EE66E005877BB /* cpSimpleMotor.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSimpleMotor.o.d; sourceTree = ""; }; + 15CBA1A6196EE66E005877BB /* cpSlideJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSlideJoint.o; sourceTree = ""; }; + 15CBA1A7196EE66E005877BB /* cpSlideJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSlideJoint.o.d; sourceTree = ""; }; + 15CBA1A8196EE66E005877BB /* cpArbiter.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpArbiter.o; sourceTree = ""; }; + 15CBA1A9196EE66E005877BB /* cpArbiter.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpArbiter.o.d; sourceTree = ""; }; + 15CBA1AA196EE66E005877BB /* cpArray.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpArray.o; sourceTree = ""; }; + 15CBA1AB196EE66E005877BB /* cpArray.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpArray.o.d; sourceTree = ""; }; + 15CBA1AC196EE66E005877BB /* cpBB.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpBB.o; sourceTree = ""; }; + 15CBA1AD196EE66E005877BB /* cpBB.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpBB.o.d; sourceTree = ""; }; + 15CBA1AE196EE66E005877BB /* cpBBTree.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpBBTree.o; sourceTree = ""; }; + 15CBA1AF196EE66E005877BB /* cpBBTree.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpBBTree.o.d; sourceTree = ""; }; + 15CBA1B0196EE66E005877BB /* cpBody.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpBody.o; sourceTree = ""; }; + 15CBA1B1196EE66E005877BB /* cpBody.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpBody.o.d; sourceTree = ""; }; + 15CBA1B2196EE66E005877BB /* cpCollision.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpCollision.o; sourceTree = ""; }; + 15CBA1B3196EE66E005877BB /* cpCollision.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpCollision.o.d; sourceTree = ""; }; + 15CBA1B4196EE66E005877BB /* cpHashSet.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpHashSet.o; sourceTree = ""; }; + 15CBA1B5196EE66E005877BB /* cpHashSet.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpHashSet.o.d; sourceTree = ""; }; + 15CBA1B6196EE66E005877BB /* cpPolyShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpPolyShape.o; sourceTree = ""; }; + 15CBA1B7196EE66E005877BB /* cpPolyShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpPolyShape.o.d; sourceTree = ""; }; + 15CBA1B8196EE66E005877BB /* cpShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpShape.o; sourceTree = ""; }; + 15CBA1B9196EE66E005877BB /* cpShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpShape.o.d; sourceTree = ""; }; + 15CBA1BA196EE66E005877BB /* cpSpace.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpace.o; sourceTree = ""; }; + 15CBA1BB196EE66E005877BB /* cpSpace.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpace.o.d; sourceTree = ""; }; + 15CBA1BC196EE66E005877BB /* cpSpaceComponent.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpaceComponent.o; sourceTree = ""; }; + 15CBA1BD196EE66E005877BB /* cpSpaceComponent.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpaceComponent.o.d; sourceTree = ""; }; + 15CBA1BE196EE66E005877BB /* cpSpaceHash.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpaceHash.o; sourceTree = ""; }; + 15CBA1BF196EE66E005877BB /* cpSpaceHash.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpaceHash.o.d; sourceTree = ""; }; + 15CBA1C0196EE66E005877BB /* cpSpaceQuery.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpaceQuery.o; sourceTree = ""; }; + 15CBA1C1196EE66E005877BB /* cpSpaceQuery.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpaceQuery.o.d; sourceTree = ""; }; + 15CBA1C2196EE66E005877BB /* cpSpaceStep.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpaceStep.o; sourceTree = ""; }; + 15CBA1C3196EE66E005877BB /* cpSpaceStep.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpaceStep.o.d; sourceTree = ""; }; + 15CBA1C4196EE66E005877BB /* cpSpatialIndex.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSpatialIndex.o; sourceTree = ""; }; + 15CBA1C5196EE66E005877BB /* cpSpatialIndex.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSpatialIndex.o.d; sourceTree = ""; }; + 15CBA1C6196EE66E005877BB /* cpSweep1D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpSweep1D.o; sourceTree = ""; }; + 15CBA1C7196EE66E005877BB /* cpSweep1D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpSweep1D.o.d; sourceTree = ""; }; + 15CBA1C8196EE66E005877BB /* cpVect.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cpVect.o; sourceTree = ""; }; + 15CBA1C9196EE66E005877BB /* cpVect.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cpVect.o.d; sourceTree = ""; }; + 15CBA1CC196EE66E005877BB /* CCAction.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAction.o; sourceTree = ""; }; + 15CBA1CD196EE66E005877BB /* CCAction.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAction.o.d; sourceTree = ""; }; + 15CBA1CE196EE66E005877BB /* CCActionCamera.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionCamera.o; sourceTree = ""; }; + 15CBA1CF196EE66E005877BB /* CCActionCamera.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionCamera.o.d; sourceTree = ""; }; + 15CBA1D0196EE66E005877BB /* CCActionCatmullRom.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionCatmullRom.o; sourceTree = ""; }; + 15CBA1D1196EE66E005877BB /* CCActionCatmullRom.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionCatmullRom.o.d; sourceTree = ""; }; + 15CBA1D2196EE66E005877BB /* CCActionEase.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionEase.o; sourceTree = ""; }; + 15CBA1D3196EE66E005877BB /* CCActionEase.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionEase.o.d; sourceTree = ""; }; + 15CBA1D4196EE66E005877BB /* CCActionGrid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionGrid.o; sourceTree = ""; }; + 15CBA1D5196EE66E005877BB /* CCActionGrid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionGrid.o.d; sourceTree = ""; }; + 15CBA1D6196EE66E005877BB /* CCActionGrid3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionGrid3D.o; sourceTree = ""; }; + 15CBA1D7196EE66E005877BB /* CCActionGrid3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionGrid3D.o.d; sourceTree = ""; }; + 15CBA1D8196EE66E005877BB /* CCActionInstant.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionInstant.o; sourceTree = ""; }; + 15CBA1D9196EE66E005877BB /* CCActionInstant.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionInstant.o.d; sourceTree = ""; }; + 15CBA1DA196EE66E005877BB /* CCActionInterval.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionInterval.o; sourceTree = ""; }; + 15CBA1DB196EE66E005877BB /* CCActionInterval.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionInterval.o.d; sourceTree = ""; }; + 15CBA1DC196EE66E005877BB /* CCActionManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionManager.o; sourceTree = ""; }; + 15CBA1DD196EE66E005877BB /* CCActionManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionManager.o.d; sourceTree = ""; }; + 15CBA1DE196EE66E005877BB /* CCActionPageTurn3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionPageTurn3D.o; sourceTree = ""; }; + 15CBA1DF196EE66E005877BB /* CCActionPageTurn3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionPageTurn3D.o.d; sourceTree = ""; }; + 15CBA1E0196EE66E005877BB /* CCActionProgressTimer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionProgressTimer.o; sourceTree = ""; }; + 15CBA1E1196EE66E005877BB /* CCActionProgressTimer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionProgressTimer.o.d; sourceTree = ""; }; + 15CBA1E2196EE66E005877BB /* CCActionTiledGrid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionTiledGrid.o; sourceTree = ""; }; + 15CBA1E3196EE66E005877BB /* CCActionTiledGrid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionTiledGrid.o.d; sourceTree = ""; }; + 15CBA1E4196EE66E005877BB /* CCActionTween.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionTween.o; sourceTree = ""; }; + 15CBA1E5196EE66E005877BB /* CCActionTween.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionTween.o.d; sourceTree = ""; }; + 15CBA1E6196EE66E005877BB /* CCAnimation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAnimation.o; sourceTree = ""; }; + 15CBA1E7196EE66E005877BB /* CCAnimation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAnimation.o.d; sourceTree = ""; }; + 15CBA1E8196EE66E005877BB /* CCAnimationCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAnimationCache.o; sourceTree = ""; }; + 15CBA1E9196EE66E005877BB /* CCAnimationCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAnimationCache.o.d; sourceTree = ""; }; + 15CBA1EA196EE66E005877BB /* CCAtlasNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAtlasNode.o; sourceTree = ""; }; + 15CBA1EB196EE66E005877BB /* CCAtlasNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAtlasNode.o.d; sourceTree = ""; }; + 15CBA1EC196EE66E005877BB /* CCClippingNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCClippingNode.o; sourceTree = ""; }; + 15CBA1ED196EE66E005877BB /* CCClippingNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCClippingNode.o.d; sourceTree = ""; }; + 15CBA1EE196EE66E005877BB /* CCComponent.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComponent.o; sourceTree = ""; }; + 15CBA1EF196EE66E005877BB /* CCComponent.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComponent.o.d; sourceTree = ""; }; + 15CBA1F0196EE66E005877BB /* CCComponentContainer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComponentContainer.o; sourceTree = ""; }; + 15CBA1F1196EE66E005877BB /* CCComponentContainer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComponentContainer.o.d; sourceTree = ""; }; + 15CBA1F2196EE66E005877BB /* CCDrawingPrimitives.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDrawingPrimitives.o; sourceTree = ""; }; + 15CBA1F3196EE66E005877BB /* CCDrawingPrimitives.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDrawingPrimitives.o.d; sourceTree = ""; }; + 15CBA1F4196EE66E005877BB /* CCDrawNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDrawNode.o; sourceTree = ""; }; + 15CBA1F5196EE66E005877BB /* CCDrawNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDrawNode.o.d; sourceTree = ""; }; + 15CBA1F6196EE66E005877BB /* CCFastTMXLayer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFastTMXLayer.o; sourceTree = ""; }; + 15CBA1F7196EE66E005877BB /* CCFastTMXLayer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFastTMXLayer.o.d; sourceTree = ""; }; + 15CBA1F8196EE66E005877BB /* CCFastTMXTiledMap.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFastTMXTiledMap.o; sourceTree = ""; }; + 15CBA1F9196EE66E005877BB /* CCFastTMXTiledMap.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFastTMXTiledMap.o.d; sourceTree = ""; }; + 15CBA1FA196EE66E005877BB /* CCFont.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFont.o; sourceTree = ""; }; + 15CBA1FB196EE66E005877BB /* CCFont.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFont.o.d; sourceTree = ""; }; + 15CBA1FC196EE66E005877BB /* CCFontAtlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFontAtlas.o; sourceTree = ""; }; + 15CBA1FD196EE66E005877BB /* CCFontAtlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFontAtlas.o.d; sourceTree = ""; }; + 15CBA1FE196EE66E005877BB /* CCFontAtlasCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFontAtlasCache.o; sourceTree = ""; }; + 15CBA1FF196EE66E005877BB /* CCFontAtlasCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFontAtlasCache.o.d; sourceTree = ""; }; + 15CBA200196EE66E005877BB /* CCFontCharMap.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFontCharMap.o; sourceTree = ""; }; + 15CBA201196EE66E005877BB /* CCFontCharMap.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFontCharMap.o.d; sourceTree = ""; }; + 15CBA202196EE66E005877BB /* CCFontFNT.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFontFNT.o; sourceTree = ""; }; + 15CBA203196EE66E005877BB /* CCFontFNT.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFontFNT.o.d; sourceTree = ""; }; + 15CBA204196EE66E005877BB /* CCFontFreeType.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFontFreeType.o; sourceTree = ""; }; + 15CBA205196EE66E005877BB /* CCFontFreeType.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFontFreeType.o.d; sourceTree = ""; }; + 15CBA206196EE66E005877BB /* CCGLBufferedNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLBufferedNode.o; sourceTree = ""; }; + 15CBA207196EE66E005877BB /* CCGLBufferedNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLBufferedNode.o.d; sourceTree = ""; }; + 15CBA208196EE66E005877BB /* CCGrabber.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGrabber.o; sourceTree = ""; }; + 15CBA209196EE66E005877BB /* CCGrabber.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGrabber.o.d; sourceTree = ""; }; + 15CBA20A196EE66E005877BB /* CCGrid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGrid.o; sourceTree = ""; }; + 15CBA20B196EE66E005877BB /* CCGrid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGrid.o.d; sourceTree = ""; }; + 15CBA20C196EE66E005877BB /* CCLabel.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabel.o; sourceTree = ""; }; + 15CBA20D196EE66E005877BB /* CCLabel.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabel.o.d; sourceTree = ""; }; + 15CBA20E196EE66E005877BB /* CCLabelAtlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelAtlas.o; sourceTree = ""; }; + 15CBA20F196EE66E005877BB /* CCLabelAtlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelAtlas.o.d; sourceTree = ""; }; + 15CBA210196EE66E005877BB /* CCLabelBMFont.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelBMFont.o; sourceTree = ""; }; + 15CBA211196EE66E005877BB /* CCLabelBMFont.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelBMFont.o.d; sourceTree = ""; }; + 15CBA212196EE66E005877BB /* CCLabelTextFormatter.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelTextFormatter.o; sourceTree = ""; }; + 15CBA213196EE66E005877BB /* CCLabelTextFormatter.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelTextFormatter.o.d; sourceTree = ""; }; + 15CBA214196EE66E005877BB /* CCLabelTTF.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelTTF.o; sourceTree = ""; }; + 15CBA215196EE66E005877BB /* CCLabelTTF.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelTTF.o.d; sourceTree = ""; }; + 15CBA216196EE66E005877BB /* CCLayer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLayer.o; sourceTree = ""; }; + 15CBA217196EE66E005877BB /* CCLayer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLayer.o.d; sourceTree = ""; }; + 15CBA218196EE66E005877BB /* CCMenu.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMenu.o; sourceTree = ""; }; + 15CBA219196EE66E005877BB /* CCMenu.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMenu.o.d; sourceTree = ""; }; + 15CBA21A196EE66E005877BB /* CCMenuItem.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMenuItem.o; sourceTree = ""; }; + 15CBA21B196EE66E005877BB /* CCMenuItem.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMenuItem.o.d; sourceTree = ""; }; + 15CBA21C196EE66E005877BB /* CCMotionStreak.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMotionStreak.o; sourceTree = ""; }; + 15CBA21D196EE66E005877BB /* CCMotionStreak.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMotionStreak.o.d; sourceTree = ""; }; + 15CBA21E196EE66E005877BB /* CCNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNode.o; sourceTree = ""; }; + 15CBA21F196EE66E005877BB /* CCNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNode.o.d; sourceTree = ""; }; + 15CBA220196EE66E005877BB /* CCNodeGrid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNodeGrid.o; sourceTree = ""; }; + 15CBA221196EE66E005877BB /* CCNodeGrid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNodeGrid.o.d; sourceTree = ""; }; + 15CBA222196EE66E005877BB /* CCParallaxNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParallaxNode.o; sourceTree = ""; }; + 15CBA223196EE66E005877BB /* CCParallaxNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParallaxNode.o.d; sourceTree = ""; }; + 15CBA224196EE66E005877BB /* CCParticleBatchNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParticleBatchNode.o; sourceTree = ""; }; + 15CBA225196EE66E005877BB /* CCParticleBatchNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParticleBatchNode.o.d; sourceTree = ""; }; + 15CBA226196EE66E005877BB /* CCParticleExamples.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParticleExamples.o; sourceTree = ""; }; + 15CBA227196EE66E005877BB /* CCParticleExamples.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParticleExamples.o.d; sourceTree = ""; }; + 15CBA228196EE66E005877BB /* CCParticleSystem.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParticleSystem.o; sourceTree = ""; }; + 15CBA229196EE66E005877BB /* CCParticleSystem.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParticleSystem.o.d; sourceTree = ""; }; + 15CBA22A196EE66E005877BB /* CCParticleSystemQuad.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParticleSystemQuad.o; sourceTree = ""; }; + 15CBA22B196EE66E005877BB /* CCParticleSystemQuad.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParticleSystemQuad.o.d; sourceTree = ""; }; + 15CBA22C196EE66E005877BB /* CCProgressTimer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCProgressTimer.o; sourceTree = ""; }; + 15CBA22D196EE66E005877BB /* CCProgressTimer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCProgressTimer.o.d; sourceTree = ""; }; + 15CBA22E196EE66E005877BB /* CCRenderTexture.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCRenderTexture.o; sourceTree = ""; }; + 15CBA22F196EE66E005877BB /* CCRenderTexture.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCRenderTexture.o.d; sourceTree = ""; }; + 15CBA230196EE66E005877BB /* CCScene.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScene.o; sourceTree = ""; }; + 15CBA231196EE66E005877BB /* CCScene.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScene.o.d; sourceTree = ""; }; + 15CBA232196EE66E005877BB /* CCSprite.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSprite.o; sourceTree = ""; }; + 15CBA233196EE66E005877BB /* CCSprite.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSprite.o.d; sourceTree = ""; }; + 15CBA234196EE66E005877BB /* CCSpriteBatchNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSpriteBatchNode.o; sourceTree = ""; }; + 15CBA235196EE66E005877BB /* CCSpriteBatchNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSpriteBatchNode.o.d; sourceTree = ""; }; + 15CBA236196EE66E005877BB /* CCSpriteFrame.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSpriteFrame.o; sourceTree = ""; }; + 15CBA237196EE66E005877BB /* CCSpriteFrame.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSpriteFrame.o.d; sourceTree = ""; }; + 15CBA238196EE66E005877BB /* CCSpriteFrameCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSpriteFrameCache.o; sourceTree = ""; }; + 15CBA239196EE66E005877BB /* CCSpriteFrameCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSpriteFrameCache.o.d; sourceTree = ""; }; + 15CBA23A196EE66E005877BB /* CCTextFieldTTF.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTextFieldTTF.o; sourceTree = ""; }; + 15CBA23B196EE66E005877BB /* CCTextFieldTTF.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTextFieldTTF.o.d; sourceTree = ""; }; + 15CBA23C196EE66E005877BB /* CCTileMapAtlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTileMapAtlas.o; sourceTree = ""; }; + 15CBA23D196EE66E005877BB /* CCTileMapAtlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTileMapAtlas.o.d; sourceTree = ""; }; + 15CBA23E196EE66E005877BB /* CCTMXLayer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTMXLayer.o; sourceTree = ""; }; + 15CBA23F196EE66E005877BB /* CCTMXLayer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTMXLayer.o.d; sourceTree = ""; }; + 15CBA240196EE66E005877BB /* CCTMXObjectGroup.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTMXObjectGroup.o; sourceTree = ""; }; + 15CBA241196EE66E005877BB /* CCTMXObjectGroup.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTMXObjectGroup.o.d; sourceTree = ""; }; + 15CBA242196EE66E005877BB /* CCTMXTiledMap.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTMXTiledMap.o; sourceTree = ""; }; + 15CBA243196EE66E005877BB /* CCTMXTiledMap.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTMXTiledMap.o.d; sourceTree = ""; }; + 15CBA244196EE66E005877BB /* CCTMXXMLParser.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTMXXMLParser.o; sourceTree = ""; }; + 15CBA245196EE66E005877BB /* CCTMXXMLParser.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTMXXMLParser.o.d; sourceTree = ""; }; + 15CBA246196EE66E005877BB /* CCTransition.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTransition.o; sourceTree = ""; }; + 15CBA247196EE66E005877BB /* CCTransition.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTransition.o.d; sourceTree = ""; }; + 15CBA248196EE66E005877BB /* CCTransitionPageTurn.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTransitionPageTurn.o; sourceTree = ""; }; + 15CBA249196EE66E005877BB /* CCTransitionPageTurn.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTransitionPageTurn.o.d; sourceTree = ""; }; + 15CBA24A196EE66E005877BB /* CCTransitionProgress.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTransitionProgress.o; sourceTree = ""; }; + 15CBA24B196EE66E005877BB /* CCTransitionProgress.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTransitionProgress.o.d; sourceTree = ""; }; + 15CBA24C196EE66F005877BB /* CCTweenFunction.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTweenFunction.o; sourceTree = ""; }; + 15CBA24D196EE66F005877BB /* CCTweenFunction.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTweenFunction.o.d; sourceTree = ""; }; + 15CBA24F196EE66F005877BB /* CCAnimate3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAnimate3D.o; sourceTree = ""; }; + 15CBA250196EE66F005877BB /* CCAnimate3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAnimate3D.o.d; sourceTree = ""; }; + 15CBA251196EE66F005877BB /* CCAnimation3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAnimation3D.o; sourceTree = ""; }; + 15CBA252196EE66F005877BB /* CCAnimation3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAnimation3D.o.d; sourceTree = ""; }; + 15CBA253196EE66F005877BB /* CCBundle3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBundle3D.o; sourceTree = ""; }; + 15CBA254196EE66F005877BB /* CCBundle3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBundle3D.o.d; sourceTree = ""; }; + 15CBA255196EE66F005877BB /* CCBundleReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBundleReader.o; sourceTree = ""; }; + 15CBA256196EE66F005877BB /* CCBundleReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBundleReader.o.d; sourceTree = ""; }; + 15CBA257196EE66F005877BB /* CCMesh.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMesh.o; sourceTree = ""; }; + 15CBA258196EE66F005877BB /* CCMesh.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMesh.o.d; sourceTree = ""; }; + 15CBA259196EE66F005877BB /* CCMeshSkin.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMeshSkin.o; sourceTree = ""; }; + 15CBA25A196EE66F005877BB /* CCMeshSkin.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMeshSkin.o.d; sourceTree = ""; }; + 15CBA25B196EE66F005877BB /* CCObjLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCObjLoader.o; sourceTree = ""; }; + 15CBA25C196EE66F005877BB /* CCObjLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCObjLoader.o.d; sourceTree = ""; }; + 15CBA25D196EE66F005877BB /* CCSprite3D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSprite3D.o; sourceTree = ""; }; + 15CBA25E196EE66F005877BB /* CCSprite3D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSprite3D.o.d; sourceTree = ""; }; + 15CBA25F196EE66F005877BB /* CCSprite3DMaterial.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSprite3DMaterial.o; sourceTree = ""; }; + 15CBA260196EE66F005877BB /* CCSprite3DMaterial.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSprite3DMaterial.o.d; sourceTree = ""; }; + 15CBA264196EE66F005877BB /* ConvertUTF.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ConvertUTF.o; sourceTree = ""; }; + 15CBA265196EE66F005877BB /* ConvertUTF.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ConvertUTF.o.d; sourceTree = ""; }; + 15CBA266196EE66F005877BB /* ConvertUTFWrapper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ConvertUTFWrapper.o; sourceTree = ""; }; + 15CBA267196EE66F005877BB /* ConvertUTFWrapper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ConvertUTFWrapper.o.d; sourceTree = ""; }; + 15CBA269196EE66F005877BB /* edtaa3func.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = edtaa3func.o; sourceTree = ""; }; + 15CBA26A196EE66F005877BB /* edtaa3func.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = edtaa3func.o.d; sourceTree = ""; }; + 15CBA26C196EE66F005877BB /* tinyxml2.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tinyxml2.o; sourceTree = ""; }; + 15CBA26D196EE66F005877BB /* tinyxml2.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tinyxml2.o.d; sourceTree = ""; }; + 15CBA26F196EE66F005877BB /* ioapi.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ioapi.o; sourceTree = ""; }; + 15CBA270196EE66F005877BB /* ioapi.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ioapi.o.d; sourceTree = ""; }; + 15CBA271196EE66F005877BB /* unzip.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = unzip.o; sourceTree = ""; }; + 15CBA272196EE66F005877BB /* unzip.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = unzip.o.d; sourceTree = ""; }; + 15CBA274196EE66F005877BB /* xxhash.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = xxhash.o; sourceTree = ""; }; + 15CBA275196EE66F005877BB /* xxhash.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = xxhash.o.d; sourceTree = ""; }; + 15CBA277196EE66F005877BB /* atitc.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = atitc.o; sourceTree = ""; }; + 15CBA278196EE66F005877BB /* atitc.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = atitc.o.d; sourceTree = ""; }; + 15CBA279196EE66F005877BB /* base64.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = base64.o; sourceTree = ""; }; + 15CBA27A196EE66F005877BB /* base64.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = base64.o.d; sourceTree = ""; }; + 15CBA27B196EE66F005877BB /* CCAutoreleasePool.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAutoreleasePool.o; sourceTree = ""; }; + 15CBA27C196EE66F005877BB /* CCAutoreleasePool.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAutoreleasePool.o.d; sourceTree = ""; }; + 15CBA27D196EE66F005877BB /* ccCArray.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccCArray.o; sourceTree = ""; }; + 15CBA27E196EE66F005877BB /* ccCArray.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccCArray.o.d; sourceTree = ""; }; + 15CBA27F196EE66F005877BB /* CCConfiguration.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCConfiguration.o; sourceTree = ""; }; + 15CBA280196EE66F005877BB /* CCConfiguration.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCConfiguration.o.d; sourceTree = ""; }; + 15CBA281196EE66F005877BB /* CCConsole.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCConsole.o; sourceTree = ""; }; + 15CBA282196EE66F005877BB /* CCConsole.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCConsole.o.d; sourceTree = ""; }; + 15CBA283196EE66F005877BB /* CCController-android.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "CCController-android.o"; sourceTree = ""; }; + 15CBA284196EE66F005877BB /* CCController-android.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = "CCController-android.o.d"; sourceTree = ""; }; + 15CBA285196EE66F005877BB /* CCController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCController.o; sourceTree = ""; }; + 15CBA286196EE66F005877BB /* CCController.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCController.o.d; sourceTree = ""; }; + 15CBA287196EE66F005877BB /* CCData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCData.o; sourceTree = ""; }; + 15CBA288196EE66F005877BB /* CCData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCData.o.d; sourceTree = ""; }; + 15CBA289196EE66F005877BB /* CCDataVisitor.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDataVisitor.o; sourceTree = ""; }; + 15CBA28A196EE66F005877BB /* CCDataVisitor.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDataVisitor.o.d; sourceTree = ""; }; + 15CBA28B196EE66F005877BB /* CCDirector.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDirector.o; sourceTree = ""; }; + 15CBA28C196EE66F005877BB /* CCDirector.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDirector.o.d; sourceTree = ""; }; + 15CBA28D196EE66F005877BB /* CCEvent.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEvent.o; sourceTree = ""; }; + 15CBA28E196EE66F005877BB /* CCEvent.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEvent.o.d; sourceTree = ""; }; + 15CBA28F196EE66F005877BB /* CCEventAcceleration.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventAcceleration.o; sourceTree = ""; }; + 15CBA290196EE66F005877BB /* CCEventAcceleration.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventAcceleration.o.d; sourceTree = ""; }; + 15CBA291196EE66F005877BB /* CCEventController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventController.o; sourceTree = ""; }; + 15CBA292196EE66F005877BB /* CCEventController.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventController.o.d; sourceTree = ""; }; + 15CBA293196EE66F005877BB /* CCEventCustom.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventCustom.o; sourceTree = ""; }; + 15CBA294196EE66F005877BB /* CCEventCustom.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventCustom.o.d; sourceTree = ""; }; + 15CBA295196EE66F005877BB /* CCEventDispatcher.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventDispatcher.o; sourceTree = ""; }; + 15CBA296196EE66F005877BB /* CCEventDispatcher.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventDispatcher.o.d; sourceTree = ""; }; + 15CBA297196EE66F005877BB /* CCEventFocus.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventFocus.o; sourceTree = ""; }; + 15CBA298196EE66F005877BB /* CCEventFocus.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventFocus.o.d; sourceTree = ""; }; + 15CBA299196EE66F005877BB /* CCEventKeyboard.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventKeyboard.o; sourceTree = ""; }; + 15CBA29A196EE66F005877BB /* CCEventKeyboard.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventKeyboard.o.d; sourceTree = ""; }; + 15CBA29B196EE66F005877BB /* CCEventListener.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListener.o; sourceTree = ""; }; + 15CBA29C196EE66F005877BB /* CCEventListener.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListener.o.d; sourceTree = ""; }; + 15CBA29D196EE66F005877BB /* CCEventListenerAcceleration.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerAcceleration.o; sourceTree = ""; }; + 15CBA29E196EE66F005877BB /* CCEventListenerAcceleration.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerAcceleration.o.d; sourceTree = ""; }; + 15CBA29F196EE66F005877BB /* CCEventListenerController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerController.o; sourceTree = ""; }; + 15CBA2A0196EE66F005877BB /* CCEventListenerController.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerController.o.d; sourceTree = ""; }; + 15CBA2A1196EE66F005877BB /* CCEventListenerCustom.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerCustom.o; sourceTree = ""; }; + 15CBA2A2196EE66F005877BB /* CCEventListenerCustom.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerCustom.o.d; sourceTree = ""; }; + 15CBA2A3196EE66F005877BB /* CCEventListenerFocus.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerFocus.o; sourceTree = ""; }; + 15CBA2A4196EE66F005877BB /* CCEventListenerFocus.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerFocus.o.d; sourceTree = ""; }; + 15CBA2A5196EE66F005877BB /* CCEventListenerKeyboard.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerKeyboard.o; sourceTree = ""; }; + 15CBA2A6196EE66F005877BB /* CCEventListenerKeyboard.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerKeyboard.o.d; sourceTree = ""; }; + 15CBA2A7196EE66F005877BB /* CCEventListenerMouse.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerMouse.o; sourceTree = ""; }; + 15CBA2A8196EE66F005877BB /* CCEventListenerMouse.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerMouse.o.d; sourceTree = ""; }; + 15CBA2A9196EE66F005877BB /* CCEventListenerTouch.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventListenerTouch.o; sourceTree = ""; }; + 15CBA2AA196EE66F005877BB /* CCEventListenerTouch.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventListenerTouch.o.d; sourceTree = ""; }; + 15CBA2AB196EE66F005877BB /* CCEventMouse.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventMouse.o; sourceTree = ""; }; + 15CBA2AC196EE66F005877BB /* CCEventMouse.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventMouse.o.d; sourceTree = ""; }; + 15CBA2AD196EE66F005877BB /* CCEventTouch.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEventTouch.o; sourceTree = ""; }; + 15CBA2AE196EE66F005877BB /* CCEventTouch.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEventTouch.o.d; sourceTree = ""; }; + 15CBA2AF196EE66F005877BB /* ccFPSImages.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccFPSImages.o; sourceTree = ""; }; + 15CBA2B0196EE66F005877BB /* ccFPSImages.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccFPSImages.o.d; sourceTree = ""; }; + 15CBA2B1196EE66F005877BB /* CCIMEDispatcher.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCIMEDispatcher.o; sourceTree = ""; }; + 15CBA2B2196EE66F005877BB /* CCIMEDispatcher.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCIMEDispatcher.o.d; sourceTree = ""; }; + 15CBA2B3196EE66F005877BB /* CCNS.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNS.o; sourceTree = ""; }; + 15CBA2B4196EE66F005877BB /* CCNS.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNS.o.d; sourceTree = ""; }; + 15CBA2B5196EE66F005877BB /* CCProfiling.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCProfiling.o; sourceTree = ""; }; + 15CBA2B6196EE66F005877BB /* CCProfiling.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCProfiling.o.d; sourceTree = ""; }; + 15CBA2B7196EE66F005877BB /* CCRef.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCRef.o; sourceTree = ""; }; + 15CBA2B8196EE66F005877BB /* CCRef.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCRef.o.d; sourceTree = ""; }; + 15CBA2B9196EE66F005877BB /* CCScheduler.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScheduler.o; sourceTree = ""; }; + 15CBA2BA196EE66F005877BB /* CCScheduler.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScheduler.o.d; sourceTree = ""; }; + 15CBA2BB196EE66F005877BB /* CCScriptSupport.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScriptSupport.o; sourceTree = ""; }; + 15CBA2BC196EE66F005877BB /* CCScriptSupport.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScriptSupport.o.d; sourceTree = ""; }; + 15CBA2BD196EE66F005877BB /* CCTouch.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTouch.o; sourceTree = ""; }; + 15CBA2BE196EE66F005877BB /* CCTouch.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTouch.o.d; sourceTree = ""; }; + 15CBA2BF196EE66F005877BB /* ccTypes.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccTypes.o; sourceTree = ""; }; + 15CBA2C0196EE66F005877BB /* ccTypes.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccTypes.o.d; sourceTree = ""; }; + 15CBA2C1196EE66F005877BB /* CCUserDefault.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCUserDefault.o; sourceTree = ""; }; + 15CBA2C2196EE66F005877BB /* CCUserDefault.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCUserDefault.o.d; sourceTree = ""; }; + 15CBA2C3196EE66F005877BB /* CCUserDefaultAndroid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCUserDefaultAndroid.o; sourceTree = ""; }; + 15CBA2C4196EE66F005877BB /* CCUserDefaultAndroid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCUserDefaultAndroid.o.d; sourceTree = ""; }; + 15CBA2C5196EE66F005877BB /* ccUTF8.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccUTF8.o; sourceTree = ""; }; + 15CBA2C6196EE66F005877BB /* ccUTF8.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccUTF8.o.d; sourceTree = ""; }; + 15CBA2C7196EE66F005877BB /* ccUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccUtils.o; sourceTree = ""; }; + 15CBA2C8196EE66F005877BB /* ccUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccUtils.o.d; sourceTree = ""; }; + 15CBA2C9196EE66F005877BB /* CCValue.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCValue.o; sourceTree = ""; }; + 15CBA2CA196EE66F005877BB /* CCValue.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCValue.o.d; sourceTree = ""; }; + 15CBA2CB196EE66F005877BB /* etc1.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = etc1.o; sourceTree = ""; }; + 15CBA2CC196EE66F005877BB /* etc1.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = etc1.o.d; sourceTree = ""; }; + 15CBA2CD196EE66F005877BB /* ObjectFactory.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ObjectFactory.o; sourceTree = ""; }; + 15CBA2CE196EE66F005877BB /* ObjectFactory.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ObjectFactory.o.d; sourceTree = ""; }; + 15CBA2CF196EE66F005877BB /* s3tc.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = s3tc.o; sourceTree = ""; }; + 15CBA2D0196EE66F005877BB /* s3tc.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = s3tc.o.d; sourceTree = ""; }; + 15CBA2D1196EE66F005877BB /* TGAlib.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TGAlib.o; sourceTree = ""; }; + 15CBA2D2196EE66F005877BB /* TGAlib.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TGAlib.o.d; sourceTree = ""; }; + 15CBA2D3196EE66F005877BB /* ZipUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ZipUtils.o; sourceTree = ""; }; + 15CBA2D4196EE66F005877BB /* ZipUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ZipUtils.o.d; sourceTree = ""; }; + 15CBA2D5196EE66F005877BB /* cocos2d.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cocos2d.o; sourceTree = ""; }; + 15CBA2D6196EE66F005877BB /* cocos2d.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cocos2d.o.d; sourceTree = ""; }; + 15CBA2D8196EE66F005877BB /* CCArray.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCArray.o; sourceTree = ""; }; + 15CBA2D9196EE66F005877BB /* CCArray.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCArray.o.d; sourceTree = ""; }; + 15CBA2DA196EE66F005877BB /* CCDeprecated.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDeprecated.o; sourceTree = ""; }; + 15CBA2DB196EE66F005877BB /* CCDeprecated.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDeprecated.o.d; sourceTree = ""; }; + 15CBA2DC196EE66F005877BB /* CCDictionary.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDictionary.o; sourceTree = ""; }; + 15CBA2DD196EE66F005877BB /* CCDictionary.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDictionary.o.d; sourceTree = ""; }; + 15CBA2DE196EE66F005877BB /* CCNotificationCenter.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNotificationCenter.o; sourceTree = ""; }; + 15CBA2DF196EE66F005877BB /* CCNotificationCenter.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNotificationCenter.o.d; sourceTree = ""; }; + 15CBA2E0196EE66F005877BB /* CCSet.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSet.o; sourceTree = ""; }; + 15CBA2E1196EE66F005877BB /* CCSet.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSet.o.d; sourceTree = ""; }; + 15CBA2E2196EE66F005877BB /* CCString.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCString.o; sourceTree = ""; }; + 15CBA2E3196EE66F005877BB /* CCString.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCString.o.d; sourceTree = ""; }; + 15CBA2E5196EE66F005877BB /* CCAffineTransform.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCAffineTransform.o; sourceTree = ""; }; + 15CBA2E6196EE66F005877BB /* CCAffineTransform.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCAffineTransform.o.d; sourceTree = ""; }; + 15CBA2E7196EE66F005877BB /* CCGeometry.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGeometry.o; sourceTree = ""; }; + 15CBA2E8196EE66F005877BB /* CCGeometry.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGeometry.o.d; sourceTree = ""; }; + 15CBA2E9196EE66F005877BB /* CCVertex.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCVertex.o; sourceTree = ""; }; + 15CBA2EA196EE66F005877BB /* CCVertex.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCVertex.o.d; sourceTree = ""; }; + 15CBA2EB196EE66F005877BB /* Mat4.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Mat4.o; sourceTree = ""; }; + 15CBA2EC196EE66F005877BB /* Mat4.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Mat4.o.d; sourceTree = ""; }; + 15CBA2ED196EE66F005877BB /* MathUtil.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = MathUtil.o; sourceTree = ""; }; + 15CBA2EE196EE66F005877BB /* MathUtil.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = MathUtil.o.d; sourceTree = ""; }; + 15CBA2EF196EE66F005877BB /* Quaternion.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Quaternion.o; sourceTree = ""; }; + 15CBA2F0196EE66F005877BB /* Quaternion.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Quaternion.o.d; sourceTree = ""; }; + 15CBA2F1196EE66F005877BB /* TransformUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TransformUtils.o; sourceTree = ""; }; + 15CBA2F2196EE66F005877BB /* TransformUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TransformUtils.o.d; sourceTree = ""; }; + 15CBA2F3196EE66F005877BB /* Vec2.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Vec2.o; sourceTree = ""; }; + 15CBA2F4196EE66F005877BB /* Vec2.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Vec2.o.d; sourceTree = ""; }; + 15CBA2F5196EE66F005877BB /* Vec3.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Vec3.o; sourceTree = ""; }; + 15CBA2F6196EE66F005877BB /* Vec3.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Vec3.o.d; sourceTree = ""; }; + 15CBA2F7196EE66F005877BB /* Vec4.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Vec4.o; sourceTree = ""; }; + 15CBA2F8196EE66F005877BB /* Vec4.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Vec4.o.d; sourceTree = ""; }; + 15CBA2FA196EE66F005877BB /* CCPhysicsBody.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsBody.o; sourceTree = ""; }; + 15CBA2FB196EE66F005877BB /* CCPhysicsBody.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsBody.o.d; sourceTree = ""; }; + 15CBA2FC196EE66F005877BB /* CCPhysicsContact.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsContact.o; sourceTree = ""; }; + 15CBA2FD196EE66F005877BB /* CCPhysicsContact.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsContact.o.d; sourceTree = ""; }; + 15CBA2FE196EE66F005877BB /* CCPhysicsJoint.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsJoint.o; sourceTree = ""; }; + 15CBA2FF196EE66F005877BB /* CCPhysicsJoint.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsJoint.o.d; sourceTree = ""; }; + 15CBA300196EE66F005877BB /* CCPhysicsShape.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsShape.o; sourceTree = ""; }; + 15CBA301196EE66F005877BB /* CCPhysicsShape.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsShape.o.d; sourceTree = ""; }; + 15CBA302196EE66F005877BB /* CCPhysicsWorld.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsWorld.o; sourceTree = ""; }; + 15CBA303196EE66F005877BB /* CCPhysicsWorld.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsWorld.o.d; sourceTree = ""; }; + 15CBA305196EE66F005877BB /* CCPhysicsBodyInfo_chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsBodyInfo_chipmunk.o; sourceTree = ""; }; + 15CBA306196EE66F005877BB /* CCPhysicsBodyInfo_chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsBodyInfo_chipmunk.o.d; sourceTree = ""; }; + 15CBA307196EE66F005877BB /* CCPhysicsContactInfo_chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsContactInfo_chipmunk.o; sourceTree = ""; }; + 15CBA308196EE66F005877BB /* CCPhysicsContactInfo_chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsContactInfo_chipmunk.o.d; sourceTree = ""; }; + 15CBA309196EE66F005877BB /* CCPhysicsJointInfo_chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsJointInfo_chipmunk.o; sourceTree = ""; }; + 15CBA30A196EE66F005877BB /* CCPhysicsJointInfo_chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsJointInfo_chipmunk.o.d; sourceTree = ""; }; + 15CBA30B196EE66F005877BB /* CCPhysicsShapeInfo_chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsShapeInfo_chipmunk.o; sourceTree = ""; }; + 15CBA30C196EE66F005877BB /* CCPhysicsShapeInfo_chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsShapeInfo_chipmunk.o.d; sourceTree = ""; }; + 15CBA30D196EE66F005877BB /* CCPhysicsWorldInfo_chipmunk.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsWorldInfo_chipmunk.o; sourceTree = ""; }; + 15CBA30E196EE66F005877BB /* CCPhysicsWorldInfo_chipmunk.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsWorldInfo_chipmunk.o.d; sourceTree = ""; }; + 15CBA310196EE66F005877BB /* CCFileUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFileUtils.o; sourceTree = ""; }; + 15CBA311196EE66F005877BB /* CCFileUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFileUtils.o.d; sourceTree = ""; }; + 15CBA312196EE66F005877BB /* CCGLViewProtocol.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLViewProtocol.o; sourceTree = ""; }; + 15CBA313196EE66F005877BB /* CCGLViewProtocol.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLViewProtocol.o.d; sourceTree = ""; }; + 15CBA314196EE66F005877BB /* CCImage.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCImage.o; sourceTree = ""; }; + 15CBA315196EE66F005877BB /* CCImage.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCImage.o.d; sourceTree = ""; }; + 15CBA316196EE66F005877BB /* CCSAXParser.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSAXParser.o; sourceTree = ""; }; + 15CBA317196EE66F005877BB /* CCSAXParser.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSAXParser.o.d; sourceTree = ""; }; + 15CBA318196EE66F005877BB /* CCThread.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCThread.o; sourceTree = ""; }; + 15CBA319196EE66F005877BB /* CCThread.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCThread.o.d; sourceTree = ""; }; + 15CBA31B196EE66F005877BB /* CCBatchCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBatchCommand.o; sourceTree = ""; }; + 15CBA31C196EE66F005877BB /* CCBatchCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBatchCommand.o.d; sourceTree = ""; }; + 15CBA31D196EE66F005877BB /* CCCustomCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCCustomCommand.o; sourceTree = ""; }; + 15CBA31E196EE66F005877BB /* CCCustomCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCCustomCommand.o.d; sourceTree = ""; }; + 15CBA31F196EE66F005877BB /* CCGLProgram.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLProgram.o; sourceTree = ""; }; + 15CBA320196EE66F005877BB /* CCGLProgram.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLProgram.o.d; sourceTree = ""; }; + 15CBA321196EE66F005877BB /* CCGLProgramCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLProgramCache.o; sourceTree = ""; }; + 15CBA322196EE66F005877BB /* CCGLProgramCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLProgramCache.o.d; sourceTree = ""; }; + 15CBA323196EE66F005877BB /* CCGLProgramState.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLProgramState.o; sourceTree = ""; }; + 15CBA324196EE66F005877BB /* CCGLProgramState.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLProgramState.o.d; sourceTree = ""; }; + 15CBA325196EE66F005877BB /* CCGLProgramStateCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLProgramStateCache.o; sourceTree = ""; }; + 15CBA326196EE66F005877BB /* CCGLProgramStateCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLProgramStateCache.o.d; sourceTree = ""; }; + 15CBA327196EE66F005877BB /* ccGLStateCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccGLStateCache.o; sourceTree = ""; }; + 15CBA328196EE66F005877BB /* ccGLStateCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccGLStateCache.o.d; sourceTree = ""; }; + 15CBA329196EE66F005877BB /* CCGroupCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGroupCommand.o; sourceTree = ""; }; + 15CBA32A196EE66F005877BB /* CCGroupCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGroupCommand.o.d; sourceTree = ""; }; + 15CBA32B196EE66F005877BB /* CCMeshCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMeshCommand.o; sourceTree = ""; }; + 15CBA32C196EE66F005877BB /* CCMeshCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMeshCommand.o.d; sourceTree = ""; }; + 15CBA32D196EE66F005877BB /* CCQuadCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCQuadCommand.o; sourceTree = ""; }; + 15CBA32E196EE66F005877BB /* CCQuadCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCQuadCommand.o.d; sourceTree = ""; }; + 15CBA32F196EE66F005877BB /* CCRenderCommand.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCRenderCommand.o; sourceTree = ""; }; + 15CBA330196EE66F005877BB /* CCRenderCommand.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCRenderCommand.o.d; sourceTree = ""; }; + 15CBA331196EE66F005877BB /* CCRenderer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCRenderer.o; sourceTree = ""; }; + 15CBA332196EE66F005877BB /* CCRenderer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCRenderer.o.d; sourceTree = ""; }; + 15CBA333196EE66F005877BB /* ccShaders.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccShaders.o; sourceTree = ""; }; + 15CBA334196EE66F005877BB /* ccShaders.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccShaders.o.d; sourceTree = ""; }; + 15CBA335196EE66F005877BB /* CCTexture2D.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTexture2D.o; sourceTree = ""; }; + 15CBA336196EE66F005877BB /* CCTexture2D.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTexture2D.o.d; sourceTree = ""; }; + 15CBA337196EE66F005877BB /* CCTextureAtlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTextureAtlas.o; sourceTree = ""; }; + 15CBA338196EE66F005877BB /* CCTextureAtlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTextureAtlas.o.d; sourceTree = ""; }; + 15CBA339196EE66F005877BB /* CCTextureCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTextureCache.o; sourceTree = ""; }; + 15CBA33A196EE66F005877BB /* CCTextureCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTextureCache.o.d; sourceTree = ""; }; + 15CBA33C196EE66F005877BB /* CCApplication.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCApplication.o; sourceTree = ""; }; + 15CBA33D196EE66F005877BB /* CCApplication.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCApplication.o.d; sourceTree = ""; }; + 15CBA33E196EE66F005877BB /* CCCommon.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCCommon.o; sourceTree = ""; }; + 15CBA33F196EE66F005877BB /* CCCommon.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCCommon.o.d; sourceTree = ""; }; + 15CBA340196EE66F005877BB /* CCDevice.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDevice.o; sourceTree = ""; }; + 15CBA341196EE66F005877BB /* CCDevice.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDevice.o.d; sourceTree = ""; }; + 15CBA342196EE66F005877BB /* CCFileUtilsAndroid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFileUtilsAndroid.o; sourceTree = ""; }; + 15CBA343196EE66F005877BB /* CCFileUtilsAndroid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFileUtilsAndroid.o.d; sourceTree = ""; }; + 15CBA344196EE66F005877BB /* CCGLView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCGLView.o; sourceTree = ""; }; + 15CBA345196EE66F005877BB /* CCGLView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCGLView.o.d; sourceTree = ""; }; + 15CBA346196EE66F005877BB /* javaactivity.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = javaactivity.o; sourceTree = ""; }; + 15CBA347196EE66F005877BB /* javaactivity.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = javaactivity.o.d; sourceTree = ""; }; + 15CBA349196EE66F005877BB /* DPIJni.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = DPIJni.o; sourceTree = ""; }; + 15CBA34A196EE66F005877BB /* DPIJni.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = DPIJni.o.d; sourceTree = ""; }; + 15CBA34B196EE66F005877BB /* IMEJni.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = IMEJni.o; sourceTree = ""; }; + 15CBA34C196EE66F005877BB /* IMEJni.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = IMEJni.o.d; sourceTree = ""; }; + 15CBA34D196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o; sourceTree = ""; }; + 15CBA34E196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o.d; sourceTree = ""; }; + 15CBA34F196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxBitmap.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Java_org_cocos2dx_lib_Cocos2dxBitmap.o; sourceTree = ""; }; + 15CBA350196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxBitmap.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Java_org_cocos2dx_lib_Cocos2dxBitmap.o.d; sourceTree = ""; }; + 15CBA351196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Java_org_cocos2dx_lib_Cocos2dxHelper.o; sourceTree = ""; }; + 15CBA352196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Java_org_cocos2dx_lib_Cocos2dxHelper.o.d; sourceTree = ""; }; + 15CBA353196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxRenderer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Java_org_cocos2dx_lib_Cocos2dxRenderer.o; sourceTree = ""; }; + 15CBA354196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxRenderer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Java_org_cocos2dx_lib_Cocos2dxRenderer.o.d; sourceTree = ""; }; + 15CBA355196EE66F005877BB /* JniHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = JniHelper.o; sourceTree = ""; }; + 15CBA356196EE66F005877BB /* JniHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = JniHelper.o.d; sourceTree = ""; }; + 15CBA357196EE66F005877BB /* TouchesJni.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TouchesJni.o; sourceTree = ""; }; + 15CBA358196EE66F005877BB /* TouchesJni.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TouchesJni.o.d; sourceTree = ""; }; + 15CBA35B196EE66F005877BB /* AssetsManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AssetsManager.o; sourceTree = ""; }; + 15CBA35C196EE66F005877BB /* AssetsManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AssetsManager.o.d; sourceTree = ""; }; + 15CBA35F196EE66F005877BB /* CCControl.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControl.o; sourceTree = ""; }; + 15CBA360196EE66F005877BB /* CCControl.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControl.o.d; sourceTree = ""; }; + 15CBA361196EE66F005877BB /* CCControlButton.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlButton.o; sourceTree = ""; }; + 15CBA362196EE66F005877BB /* CCControlButton.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlButton.o.d; sourceTree = ""; }; + 15CBA363196EE66F005877BB /* CCControlColourPicker.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlColourPicker.o; sourceTree = ""; }; + 15CBA364196EE66F005877BB /* CCControlColourPicker.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlColourPicker.o.d; sourceTree = ""; }; + 15CBA365196EE66F005877BB /* CCControlHuePicker.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlHuePicker.o; sourceTree = ""; }; + 15CBA366196EE66F005877BB /* CCControlHuePicker.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlHuePicker.o.d; sourceTree = ""; }; + 15CBA367196EE66F005877BB /* CCControlPotentiometer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlPotentiometer.o; sourceTree = ""; }; + 15CBA368196EE66F005877BB /* CCControlPotentiometer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlPotentiometer.o.d; sourceTree = ""; }; + 15CBA369196EE66F005877BB /* CCControlSaturationBrightnessPicker.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlSaturationBrightnessPicker.o; sourceTree = ""; }; + 15CBA36A196EE66F005877BB /* CCControlSaturationBrightnessPicker.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlSaturationBrightnessPicker.o.d; sourceTree = ""; }; + 15CBA36B196EE66F005877BB /* CCControlSlider.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlSlider.o; sourceTree = ""; }; + 15CBA36C196EE66F005877BB /* CCControlSlider.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlSlider.o.d; sourceTree = ""; }; + 15CBA36D196EE66F005877BB /* CCControlStepper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlStepper.o; sourceTree = ""; }; + 15CBA36E196EE66F005877BB /* CCControlStepper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlStepper.o.d; sourceTree = ""; }; + 15CBA36F196EE66F005877BB /* CCControlSwitch.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlSwitch.o; sourceTree = ""; }; + 15CBA370196EE66F005877BB /* CCControlSwitch.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlSwitch.o.d; sourceTree = ""; }; + 15CBA371196EE66F005877BB /* CCControlUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlUtils.o; sourceTree = ""; }; + 15CBA372196EE66F005877BB /* CCControlUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlUtils.o.d; sourceTree = ""; }; + 15CBA373196EE66F005877BB /* CCInvocation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCInvocation.o; sourceTree = ""; }; + 15CBA374196EE66F005877BB /* CCInvocation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCInvocation.o.d; sourceTree = ""; }; + 15CBA375196EE66F005877BB /* CCScale9Sprite.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScale9Sprite.o; sourceTree = ""; }; + 15CBA376196EE66F005877BB /* CCScale9Sprite.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScale9Sprite.o.d; sourceTree = ""; }; + 15CBA378196EE66F005877BB /* CCEditBox.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEditBox.o; sourceTree = ""; }; + 15CBA379196EE66F005877BB /* CCEditBox.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEditBox.o.d; sourceTree = ""; }; + 15CBA37A196EE66F005877BB /* CCEditBoxImplAndroid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEditBoxImplAndroid.o; sourceTree = ""; }; + 15CBA37B196EE66F005877BB /* CCEditBoxImplAndroid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEditBoxImplAndroid.o.d; sourceTree = ""; }; + 15CBA37C196EE66F005877BB /* CCEditBoxImplNone.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEditBoxImplNone.o; sourceTree = ""; }; + 15CBA37D196EE66F005877BB /* CCEditBoxImplNone.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEditBoxImplNone.o.d; sourceTree = ""; }; + 15CBA37E196EE66F005877BB /* CCEditBoxImplWin.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCEditBoxImplWin.o; sourceTree = ""; }; + 15CBA37F196EE66F005877BB /* CCEditBoxImplWin.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCEditBoxImplWin.o.d; sourceTree = ""; }; + 15CBA381196EE66F005877BB /* CCScrollView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScrollView.o; sourceTree = ""; }; + 15CBA382196EE66F005877BB /* CCScrollView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScrollView.o.d; sourceTree = ""; }; + 15CBA383196EE66F005877BB /* CCTableView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTableView.o; sourceTree = ""; }; + 15CBA384196EE66F005877BB /* CCTableView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTableView.o.d; sourceTree = ""; }; + 15CBA385196EE66F005877BB /* CCTableViewCell.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTableViewCell.o; sourceTree = ""; }; + 15CBA386196EE66F005877BB /* CCTableViewCell.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTableViewCell.o.d; sourceTree = ""; }; + 15CBA388196EE66F005877BB /* CCPhysicsDebugNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsDebugNode.o; sourceTree = ""; }; + 15CBA389196EE66F005877BB /* CCPhysicsDebugNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsDebugNode.o.d; sourceTree = ""; }; + 15CBA38A196EE66F005877BB /* CCPhysicsSprite.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCPhysicsSprite.o; sourceTree = ""; }; + 15CBA38B196EE66F005877BB /* CCPhysicsSprite.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCPhysicsSprite.o.d; sourceTree = ""; }; + 15CBA393196EE66F005877BB /* auxiliar.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = auxiliar.o; sourceTree = ""; }; + 15CBA394196EE670005877BB /* auxiliar.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = auxiliar.o.d; sourceTree = ""; }; + 15CBA395196EE670005877BB /* buffer.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = buffer.o; sourceTree = ""; }; + 15CBA396196EE670005877BB /* buffer.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = buffer.o.d; sourceTree = ""; }; + 15CBA397196EE670005877BB /* except.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = except.o; sourceTree = ""; }; + 15CBA398196EE670005877BB /* except.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = except.o.d; sourceTree = ""; }; + 15CBA399196EE670005877BB /* inet.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = inet.o; sourceTree = ""; }; + 15CBA39A196EE670005877BB /* inet.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = inet.o.d; sourceTree = ""; }; + 15CBA39B196EE670005877BB /* io.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = io.o; sourceTree = ""; }; + 15CBA39C196EE670005877BB /* io.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = io.o.d; sourceTree = ""; }; + 15CBA39D196EE670005877BB /* luasocket.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = luasocket.o; sourceTree = ""; }; + 15CBA39E196EE670005877BB /* luasocket.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = luasocket.o.d; sourceTree = ""; }; + 15CBA39F196EE670005877BB /* mime.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = mime.o; sourceTree = ""; }; + 15CBA3A0196EE670005877BB /* mime.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = mime.o.d; sourceTree = ""; }; + 15CBA3A1196EE670005877BB /* options.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = options.o; sourceTree = ""; }; + 15CBA3A2196EE670005877BB /* options.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = options.o.d; sourceTree = ""; }; + 15CBA3A3196EE670005877BB /* select.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = select.o; sourceTree = ""; }; + 15CBA3A4196EE670005877BB /* select.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = select.o.d; sourceTree = ""; }; + 15CBA3A5196EE670005877BB /* serial.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = serial.o; sourceTree = ""; }; + 15CBA3A6196EE670005877BB /* serial.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = serial.o.d; sourceTree = ""; }; + 15CBA3A7196EE670005877BB /* tcp.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tcp.o; sourceTree = ""; }; + 15CBA3A8196EE670005877BB /* tcp.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tcp.o.d; sourceTree = ""; }; + 15CBA3A9196EE670005877BB /* timeout.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = timeout.o; sourceTree = ""; }; + 15CBA3AA196EE670005877BB /* timeout.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = timeout.o.d; sourceTree = ""; }; + 15CBA3AB196EE670005877BB /* udp.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = udp.o; sourceTree = ""; }; + 15CBA3AC196EE670005877BB /* udp.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = udp.o.d; sourceTree = ""; }; + 15CBA3AD196EE670005877BB /* unix.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = unix.o; sourceTree = ""; }; + 15CBA3AE196EE670005877BB /* unix.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = unix.o.d; sourceTree = ""; }; + 15CBA3AF196EE670005877BB /* usocket.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = usocket.o; sourceTree = ""; }; + 15CBA3B0196EE670005877BB /* usocket.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = usocket.o.d; sourceTree = ""; }; + 15CBA3B2196EE670005877BB /* tolua_event.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_event.o; sourceTree = ""; }; + 15CBA3B3196EE670005877BB /* tolua_event.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_event.o.d; sourceTree = ""; }; + 15CBA3B4196EE670005877BB /* tolua_is.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_is.o; sourceTree = ""; }; + 15CBA3B5196EE670005877BB /* tolua_is.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_is.o.d; sourceTree = ""; }; + 15CBA3B6196EE670005877BB /* tolua_map.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_map.o; sourceTree = ""; }; + 15CBA3B7196EE670005877BB /* tolua_map.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_map.o.d; sourceTree = ""; }; + 15CBA3B8196EE670005877BB /* tolua_push.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_push.o; sourceTree = ""; }; + 15CBA3B9196EE670005877BB /* tolua_push.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_push.o.d; sourceTree = ""; }; + 15CBA3BA196EE670005877BB /* tolua_to.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_to.o; sourceTree = ""; }; + 15CBA3BB196EE670005877BB /* tolua_to.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_to.o.d; sourceTree = ""; }; + 15CBA3BD196EE670005877BB /* xxtea.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = xxtea.o; sourceTree = ""; }; + 15CBA3BE196EE670005877BB /* xxtea.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = xxtea.o.d; sourceTree = ""; }; + 15CBA3C0196EE670005877BB /* lua_cocos2dx_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_auto.o; sourceTree = ""; }; + 15CBA3C1196EE670005877BB /* lua_cocos2dx_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_auto.o.d; sourceTree = ""; }; + 15CBA3C2196EE670005877BB /* lua_cocos2dx_controller_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_controller_auto.o; sourceTree = ""; }; + 15CBA3C3196EE670005877BB /* lua_cocos2dx_controller_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_controller_auto.o.d; sourceTree = ""; }; + 15CBA3C4196EE670005877BB /* lua_cocos2dx_extension_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_extension_auto.o; sourceTree = ""; }; + 15CBA3C5196EE670005877BB /* lua_cocos2dx_extension_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_extension_auto.o.d; sourceTree = ""; }; + 15CBA3C6196EE670005877BB /* lua_cocos2dx_physics_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_physics_auto.o; sourceTree = ""; }; + 15CBA3C7196EE670005877BB /* lua_cocos2dx_physics_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_physics_auto.o.d; sourceTree = ""; }; + 15CBA3C8196EE670005877BB /* lua_cocos2dx_spine_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_spine_auto.o; sourceTree = ""; }; + 15CBA3C9196EE670005877BB /* lua_cocos2dx_spine_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_spine_auto.o.d; sourceTree = ""; }; + 15CBA3CA196EE670005877BB /* lua_cocos2dx_studio_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_studio_auto.o; sourceTree = ""; }; + 15CBA3CB196EE670005877BB /* lua_cocos2dx_studio_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_studio_auto.o.d; sourceTree = ""; }; + 15CBA3CC196EE670005877BB /* lua_cocos2dx_ui_auto.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_ui_auto.o; sourceTree = ""; }; + 15CBA3CD196EE670005877BB /* lua_cocos2dx_ui_auto.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_ui_auto.o.d; sourceTree = ""; }; + 15CBA3CF196EE670005877BB /* CCBProxy.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBProxy.o; sourceTree = ""; }; + 15CBA3D0196EE670005877BB /* CCBProxy.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBProxy.o.d; sourceTree = ""; }; + 15CBA3D1196EE670005877BB /* CCLuaBridge.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLuaBridge.o; sourceTree = ""; }; + 15CBA3D2196EE670005877BB /* CCLuaBridge.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLuaBridge.o.d; sourceTree = ""; }; + 15CBA3D3196EE670005877BB /* CCLuaEngine.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLuaEngine.o; sourceTree = ""; }; + 15CBA3D4196EE670005877BB /* CCLuaEngine.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLuaEngine.o.d; sourceTree = ""; }; + 15CBA3D5196EE670005877BB /* CCLuaStack.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLuaStack.o; sourceTree = ""; }; + 15CBA3D6196EE670005877BB /* CCLuaStack.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLuaStack.o.d; sourceTree = ""; }; + 15CBA3D7196EE670005877BB /* CCLuaValue.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLuaValue.o; sourceTree = ""; }; + 15CBA3D8196EE670005877BB /* CCLuaValue.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLuaValue.o.d; sourceTree = ""; }; + 15CBA3D9196EE670005877BB /* Cocos2dxLuaLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Cocos2dxLuaLoader.o; sourceTree = ""; }; + 15CBA3DA196EE670005877BB /* Cocos2dxLuaLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Cocos2dxLuaLoader.o.d; sourceTree = ""; }; + 15CBA3DB196EE670005877BB /* lua_cocos2dx_coco_studio_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_coco_studio_manual.o; sourceTree = ""; }; + 15CBA3DC196EE670005877BB /* lua_cocos2dx_coco_studio_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_coco_studio_manual.o.d; sourceTree = ""; }; + 15CBA3DD196EE670005877BB /* lua_cocos2dx_controller_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_controller_manual.o; sourceTree = ""; }; + 15CBA3DE196EE670005877BB /* lua_cocos2dx_controller_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_controller_manual.o.d; sourceTree = ""; }; + 15CBA3DF196EE670005877BB /* lua_cocos2dx_deprecated.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_deprecated.o; sourceTree = ""; }; + 15CBA3E0196EE670005877BB /* lua_cocos2dx_deprecated.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_deprecated.o.d; sourceTree = ""; }; + 15CBA3E1196EE670005877BB /* lua_cocos2dx_extension_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_extension_manual.o; sourceTree = ""; }; + 15CBA3E2196EE670005877BB /* lua_cocos2dx_extension_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_extension_manual.o.d; sourceTree = ""; }; + 15CBA3E3196EE670005877BB /* lua_cocos2dx_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_manual.o; sourceTree = ""; }; + 15CBA3E4196EE670005877BB /* lua_cocos2dx_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_manual.o.d; sourceTree = ""; }; + 15CBA3E5196EE670005877BB /* lua_cocos2dx_physics_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_physics_manual.o; sourceTree = ""; }; + 15CBA3E6196EE670005877BB /* lua_cocos2dx_physics_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_physics_manual.o.d; sourceTree = ""; }; + 15CBA3E7196EE670005877BB /* lua_cocos2dx_spine_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_spine_manual.o; sourceTree = ""; }; + 15CBA3E8196EE670005877BB /* lua_cocos2dx_spine_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_spine_manual.o.d; sourceTree = ""; }; + 15CBA3E9196EE670005877BB /* lua_cocos2dx_ui_manual.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_cocos2dx_ui_manual.o; sourceTree = ""; }; + 15CBA3EA196EE670005877BB /* lua_cocos2dx_ui_manual.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_cocos2dx_ui_manual.o.d; sourceTree = ""; }; + 15CBA3EB196EE670005877BB /* lua_debugger.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_debugger.o; sourceTree = ""; }; + 15CBA3EC196EE670005877BB /* lua_debugger.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_debugger.o.d; sourceTree = ""; }; + 15CBA3ED196EE670005877BB /* lua_extensions.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_extensions.o; sourceTree = ""; }; + 15CBA3EE196EE670005877BB /* lua_extensions.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_extensions.o.d; sourceTree = ""; }; + 15CBA3EF196EE670005877BB /* Lua_web_socket.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Lua_web_socket.o; sourceTree = ""; }; + 15CBA3F0196EE670005877BB /* Lua_web_socket.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Lua_web_socket.o.d; sourceTree = ""; }; + 15CBA3F1196EE670005877BB /* lua_xml_http_request.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = lua_xml_http_request.o; sourceTree = ""; }; + 15CBA3F2196EE670005877BB /* lua_xml_http_request.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = lua_xml_http_request.o.d; sourceTree = ""; }; + 15CBA3F3196EE670005877BB /* LuaBasicConversions.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LuaBasicConversions.o; sourceTree = ""; }; + 15CBA3F4196EE670005877BB /* LuaBasicConversions.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LuaBasicConversions.o.d; sourceTree = ""; }; + 15CBA3F5196EE670005877BB /* LuaOpengl.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LuaOpengl.o; sourceTree = ""; }; + 15CBA3F6196EE670005877BB /* LuaOpengl.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LuaOpengl.o.d; sourceTree = ""; }; + 15CBA3F7196EE670005877BB /* LuaScriptHandlerMgr.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LuaScriptHandlerMgr.o; sourceTree = ""; }; + 15CBA3F8196EE670005877BB /* LuaScriptHandlerMgr.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LuaScriptHandlerMgr.o.d; sourceTree = ""; }; + 15CBA3F9196EE670005877BB /* LuaSkeletonAnimation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LuaSkeletonAnimation.o; sourceTree = ""; }; + 15CBA3FA196EE670005877BB /* LuaSkeletonAnimation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LuaSkeletonAnimation.o.d; sourceTree = ""; }; + 15CBA3FD196EE670005877BB /* CCLuaJavaBridge.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLuaJavaBridge.o; sourceTree = ""; }; + 15CBA3FE196EE670005877BB /* CCLuaJavaBridge.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLuaJavaBridge.o.d; sourceTree = ""; }; + 15CBA400196EE670005877BB /* Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o; sourceTree = ""; }; + 15CBA401196EE670005877BB /* Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o.d; sourceTree = ""; }; + 15CBA402196EE670005877BB /* tolua_fix.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = tolua_fix.o; sourceTree = ""; }; + 15CBA403196EE670005877BB /* tolua_fix.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = tolua_fix.o.d; sourceTree = ""; }; + 15CBA405196EE670005877BB /* HttpClient.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = HttpClient.o; sourceTree = ""; }; + 15CBA406196EE670005877BB /* HttpClient.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = HttpClient.o.d; sourceTree = ""; }; + 15CBA407196EE670005877BB /* SocketIO.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SocketIO.o; sourceTree = ""; }; + 15CBA408196EE670005877BB /* SocketIO.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SocketIO.o.d; sourceTree = ""; }; + 15CBA409196EE670005877BB /* WebSocket.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = WebSocket.o; sourceTree = ""; }; + 15CBA40A196EE670005877BB /* WebSocket.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = WebSocket.o.d; sourceTree = ""; }; + 15CBA40C196EE670005877BB /* CCProtectedNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCProtectedNode.o; sourceTree = ""; }; + 15CBA40D196EE670005877BB /* CCProtectedNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCProtectedNode.o.d; sourceTree = ""; }; + 15CBA40E196EE670005877BB /* CocosGUI.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CocosGUI.o; sourceTree = ""; }; + 15CBA40F196EE670005877BB /* CocosGUI.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CocosGUI.o.d; sourceTree = ""; }; + 15CBA410196EE670005877BB /* UIButton.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIButton.o; sourceTree = ""; }; + 15CBA411196EE670005877BB /* UIButton.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIButton.o.d; sourceTree = ""; }; + 15CBA412196EE670005877BB /* UICheckBox.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UICheckBox.o; sourceTree = ""; }; + 15CBA413196EE670005877BB /* UICheckBox.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UICheckBox.o.d; sourceTree = ""; }; + 15CBA414196EE670005877BB /* UIDeprecated.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIDeprecated.o; sourceTree = ""; }; + 15CBA415196EE670005877BB /* UIDeprecated.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIDeprecated.o.d; sourceTree = ""; }; + 15CBA416196EE670005877BB /* UIHBox.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIHBox.o; sourceTree = ""; }; + 15CBA417196EE670005877BB /* UIHBox.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIHBox.o.d; sourceTree = ""; }; + 15CBA418196EE670005877BB /* UIHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIHelper.o; sourceTree = ""; }; + 15CBA419196EE670005877BB /* UIHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIHelper.o.d; sourceTree = ""; }; + 15CBA41A196EE670005877BB /* UIImageView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIImageView.o; sourceTree = ""; }; + 15CBA41B196EE670005877BB /* UIImageView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIImageView.o.d; sourceTree = ""; }; + 15CBA41C196EE670005877BB /* UILayout.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UILayout.o; sourceTree = ""; }; + 15CBA41D196EE670005877BB /* UILayout.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UILayout.o.d; sourceTree = ""; }; + 15CBA41E196EE670005877BB /* UILayoutManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UILayoutManager.o; sourceTree = ""; }; + 15CBA41F196EE670005877BB /* UILayoutManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UILayoutManager.o.d; sourceTree = ""; }; + 15CBA420196EE670005877BB /* UILayoutParameter.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UILayoutParameter.o; sourceTree = ""; }; + 15CBA421196EE670005877BB /* UILayoutParameter.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UILayoutParameter.o.d; sourceTree = ""; }; + 15CBA422196EE670005877BB /* UIListView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIListView.o; sourceTree = ""; }; + 15CBA423196EE670005877BB /* UIListView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIListView.o.d; sourceTree = ""; }; + 15CBA424196EE670005877BB /* UILoadingBar.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UILoadingBar.o; sourceTree = ""; }; + 15CBA425196EE670005877BB /* UILoadingBar.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UILoadingBar.o.d; sourceTree = ""; }; + 15CBA426196EE670005877BB /* UIPageView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIPageView.o; sourceTree = ""; }; + 15CBA427196EE670005877BB /* UIPageView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIPageView.o.d; sourceTree = ""; }; + 15CBA428196EE670005877BB /* UIRelativeBox.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIRelativeBox.o; sourceTree = ""; }; + 15CBA429196EE670005877BB /* UIRelativeBox.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIRelativeBox.o.d; sourceTree = ""; }; + 15CBA42A196EE670005877BB /* UIRichText.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIRichText.o; sourceTree = ""; }; + 15CBA42B196EE670005877BB /* UIRichText.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIRichText.o.d; sourceTree = ""; }; + 15CBA42C196EE670005877BB /* UIScrollView.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIScrollView.o; sourceTree = ""; }; + 15CBA42D196EE670005877BB /* UIScrollView.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIScrollView.o.d; sourceTree = ""; }; + 15CBA42E196EE670005877BB /* UISlider.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UISlider.o; sourceTree = ""; }; + 15CBA42F196EE670005877BB /* UISlider.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UISlider.o.d; sourceTree = ""; }; + 15CBA430196EE670005877BB /* UIText.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIText.o; sourceTree = ""; }; + 15CBA431196EE670005877BB /* UIText.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIText.o.d; sourceTree = ""; }; + 15CBA432196EE670005877BB /* UITextAtlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UITextAtlas.o; sourceTree = ""; }; + 15CBA433196EE670005877BB /* UITextAtlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UITextAtlas.o.d; sourceTree = ""; }; + 15CBA434196EE670005877BB /* UITextBMFont.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UITextBMFont.o; sourceTree = ""; }; + 15CBA435196EE670005877BB /* UITextBMFont.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UITextBMFont.o.d; sourceTree = ""; }; + 15CBA436196EE670005877BB /* UITextField.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UITextField.o; sourceTree = ""; }; + 15CBA437196EE670005877BB /* UITextField.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UITextField.o.d; sourceTree = ""; }; + 15CBA438196EE670005877BB /* UIVBox.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIVBox.o; sourceTree = ""; }; + 15CBA439196EE670005877BB /* UIVBox.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIVBox.o.d; sourceTree = ""; }; + 15CBA43A196EE670005877BB /* UIVideoPlayerAndroid.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIVideoPlayerAndroid.o; sourceTree = ""; }; + 15CBA43B196EE670005877BB /* UIVideoPlayerAndroid.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIVideoPlayerAndroid.o.d; sourceTree = ""; }; + 15CBA43C196EE670005877BB /* UIWidget.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = UIWidget.o; sourceTree = ""; }; + 15CBA43D196EE670005877BB /* UIWidget.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = UIWidget.o.d; sourceTree = ""; }; + 15CBA43F196EE670005877BB /* CCBAnimationManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBAnimationManager.o; sourceTree = ""; }; + 15CBA440196EE670005877BB /* CCBAnimationManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBAnimationManager.o.d; sourceTree = ""; }; + 15CBA441196EE670005877BB /* CCBFileLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBFileLoader.o; sourceTree = ""; }; + 15CBA442196EE670005877BB /* CCBFileLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBFileLoader.o.d; sourceTree = ""; }; + 15CBA443196EE670005877BB /* CCBKeyframe.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBKeyframe.o; sourceTree = ""; }; + 15CBA444196EE670005877BB /* CCBKeyframe.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBKeyframe.o.d; sourceTree = ""; }; + 15CBA445196EE670005877BB /* CCBReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBReader.o; sourceTree = ""; }; + 15CBA446196EE670005877BB /* CCBReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBReader.o.d; sourceTree = ""; }; + 15CBA447196EE670005877BB /* CCBSequence.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBSequence.o; sourceTree = ""; }; + 15CBA448196EE670005877BB /* CCBSequence.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBSequence.o.d; sourceTree = ""; }; + 15CBA449196EE670005877BB /* CCBSequenceProperty.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBSequenceProperty.o; sourceTree = ""; }; + 15CBA44A196EE670005877BB /* CCBSequenceProperty.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBSequenceProperty.o.d; sourceTree = ""; }; + 15CBA44B196EE670005877BB /* CCControlButtonLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlButtonLoader.o; sourceTree = ""; }; + 15CBA44C196EE670005877BB /* CCControlButtonLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlButtonLoader.o.d; sourceTree = ""; }; + 15CBA44D196EE670005877BB /* CCControlLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCControlLoader.o; sourceTree = ""; }; + 15CBA44E196EE670005877BB /* CCControlLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCControlLoader.o.d; sourceTree = ""; }; + 15CBA44F196EE670005877BB /* CCLabelBMFontLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelBMFontLoader.o; sourceTree = ""; }; + 15CBA450196EE670005877BB /* CCLabelBMFontLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelBMFontLoader.o.d; sourceTree = ""; }; + 15CBA451196EE670005877BB /* CCLabelTTFLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLabelTTFLoader.o; sourceTree = ""; }; + 15CBA452196EE670005877BB /* CCLabelTTFLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLabelTTFLoader.o.d; sourceTree = ""; }; + 15CBA453196EE670005877BB /* CCLayerColorLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLayerColorLoader.o; sourceTree = ""; }; + 15CBA454196EE670005877BB /* CCLayerColorLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLayerColorLoader.o.d; sourceTree = ""; }; + 15CBA455196EE670005877BB /* CCLayerGradientLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLayerGradientLoader.o; sourceTree = ""; }; + 15CBA456196EE670005877BB /* CCLayerGradientLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLayerGradientLoader.o.d; sourceTree = ""; }; + 15CBA457196EE670005877BB /* CCLayerLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCLayerLoader.o; sourceTree = ""; }; + 15CBA458196EE670005877BB /* CCLayerLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCLayerLoader.o.d; sourceTree = ""; }; + 15CBA459196EE670005877BB /* CCMenuItemImageLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMenuItemImageLoader.o; sourceTree = ""; }; + 15CBA45A196EE670005877BB /* CCMenuItemImageLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMenuItemImageLoader.o.d; sourceTree = ""; }; + 15CBA45B196EE670005877BB /* CCMenuItemLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCMenuItemLoader.o; sourceTree = ""; }; + 15CBA45C196EE670005877BB /* CCMenuItemLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCMenuItemLoader.o.d; sourceTree = ""; }; + 15CBA45D196EE670005877BB /* CCNode+CCBRelativePositioning.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "CCNode+CCBRelativePositioning.o"; sourceTree = ""; }; + 15CBA45E196EE670005877BB /* CCNode+CCBRelativePositioning.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = "CCNode+CCBRelativePositioning.o.d"; sourceTree = ""; }; + 15CBA45F196EE670005877BB /* CCNodeLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNodeLoader.o; sourceTree = ""; }; + 15CBA460196EE670005877BB /* CCNodeLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNodeLoader.o.d; sourceTree = ""; }; + 15CBA461196EE670005877BB /* CCNodeLoaderLibrary.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNodeLoaderLibrary.o; sourceTree = ""; }; + 15CBA462196EE670005877BB /* CCNodeLoaderLibrary.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNodeLoaderLibrary.o.d; sourceTree = ""; }; + 15CBA463196EE670005877BB /* CCParticleSystemQuadLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCParticleSystemQuadLoader.o; sourceTree = ""; }; + 15CBA464196EE670005877BB /* CCParticleSystemQuadLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCParticleSystemQuadLoader.o.d; sourceTree = ""; }; + 15CBA465196EE670005877BB /* CCScale9SpriteLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScale9SpriteLoader.o; sourceTree = ""; }; + 15CBA466196EE670005877BB /* CCScale9SpriteLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScale9SpriteLoader.o.d; sourceTree = ""; }; + 15CBA467196EE670005877BB /* CCScrollViewLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCScrollViewLoader.o; sourceTree = ""; }; + 15CBA468196EE670005877BB /* CCScrollViewLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCScrollViewLoader.o.d; sourceTree = ""; }; + 15CBA469196EE670005877BB /* CCSpriteLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSpriteLoader.o; sourceTree = ""; }; + 15CBA46A196EE670005877BB /* CCSpriteLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSpriteLoader.o.d; sourceTree = ""; }; + 15CBA46C196EE670005877BB /* ccdandroidUtils.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ccdandroidUtils.o; sourceTree = ""; }; + 15CBA46D196EE670005877BB /* ccdandroidUtils.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ccdandroidUtils.o.d; sourceTree = ""; }; + 15CBA46E196EE670005877BB /* cddSimpleAudioEngine.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cddSimpleAudioEngine.o; sourceTree = ""; }; + 15CBA46F196EE670005877BB /* cddSimpleAudioEngine.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cddSimpleAudioEngine.o.d; sourceTree = ""; }; + 15CBA471196EE670005877BB /* cddandroidAndroidJavaEngine.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = cddandroidAndroidJavaEngine.o; sourceTree = ""; }; + 15CBA472196EE670005877BB /* cddandroidAndroidJavaEngine.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = cddandroidAndroidJavaEngine.o.d; sourceTree = ""; }; + 15CBA475196EE670005877BB /* CCActionTimeline.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionTimeline.o; sourceTree = ""; }; + 15CBA476196EE670005877BB /* CCActionTimeline.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionTimeline.o.d; sourceTree = ""; }; + 15CBA477196EE670005877BB /* CCActionTimelineCache.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionTimelineCache.o; sourceTree = ""; }; + 15CBA478196EE670005877BB /* CCActionTimelineCache.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionTimelineCache.o.d; sourceTree = ""; }; + 15CBA479196EE670005877BB /* CCFrame.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCFrame.o; sourceTree = ""; }; + 15CBA47A196EE670005877BB /* CCFrame.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCFrame.o.d; sourceTree = ""; }; + 15CBA47B196EE670005877BB /* CCNodeReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCNodeReader.o; sourceTree = ""; }; + 15CBA47C196EE670005877BB /* CCNodeReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCNodeReader.o.d; sourceTree = ""; }; + 15CBA47D196EE670005877BB /* CCTimeLine.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTimeLine.o; sourceTree = ""; }; + 15CBA47E196EE670005877BB /* CCTimeLine.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTimeLine.o.d; sourceTree = ""; }; + 15CBA47F196EE670005877BB /* CCActionFrame.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionFrame.o; sourceTree = ""; }; + 15CBA480196EE670005877BB /* CCActionFrame.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionFrame.o.d; sourceTree = ""; }; + 15CBA481196EE670005877BB /* CCActionFrameEasing.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionFrameEasing.o; sourceTree = ""; }; + 15CBA482196EE670005877BB /* CCActionFrameEasing.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionFrameEasing.o.d; sourceTree = ""; }; + 15CBA483196EE670005877BB /* CCActionManagerEx.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionManagerEx.o; sourceTree = ""; }; + 15CBA484196EE670005877BB /* CCActionManagerEx.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionManagerEx.o.d; sourceTree = ""; }; + 15CBA485196EE670005877BB /* CCActionNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionNode.o; sourceTree = ""; }; + 15CBA486196EE670005877BB /* CCActionNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionNode.o.d; sourceTree = ""; }; + 15CBA487196EE670005877BB /* CCActionObject.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCActionObject.o; sourceTree = ""; }; + 15CBA488196EE670005877BB /* CCActionObject.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCActionObject.o.d; sourceTree = ""; }; + 15CBA489196EE670005877BB /* CCArmature.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCArmature.o; sourceTree = ""; }; + 15CBA48A196EE670005877BB /* CCArmature.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCArmature.o.d; sourceTree = ""; }; + 15CBA48B196EE670005877BB /* CCArmatureAnimation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCArmatureAnimation.o; sourceTree = ""; }; + 15CBA48C196EE670005877BB /* CCArmatureAnimation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCArmatureAnimation.o.d; sourceTree = ""; }; + 15CBA48D196EE670005877BB /* CCArmatureDataManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCArmatureDataManager.o; sourceTree = ""; }; + 15CBA48E196EE670005877BB /* CCArmatureDataManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCArmatureDataManager.o.d; sourceTree = ""; }; + 15CBA48F196EE670005877BB /* CCArmatureDefine.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCArmatureDefine.o; sourceTree = ""; }; + 15CBA490196EE670005877BB /* CCArmatureDefine.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCArmatureDefine.o.d; sourceTree = ""; }; + 15CBA491196EE670005877BB /* CCBatchNode.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBatchNode.o; sourceTree = ""; }; + 15CBA492196EE670005877BB /* CCBatchNode.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBatchNode.o.d; sourceTree = ""; }; + 15CBA493196EE670005877BB /* CCBone.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCBone.o; sourceTree = ""; }; + 15CBA494196EE670005877BB /* CCBone.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCBone.o.d; sourceTree = ""; }; + 15CBA495196EE670005877BB /* CCColliderDetector.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCColliderDetector.o; sourceTree = ""; }; + 15CBA496196EE670005877BB /* CCColliderDetector.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCColliderDetector.o.d; sourceTree = ""; }; + 15CBA497196EE670005877BB /* CCComAttribute.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComAttribute.o; sourceTree = ""; }; + 15CBA498196EE670005877BB /* CCComAttribute.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComAttribute.o.d; sourceTree = ""; }; + 15CBA499196EE670005877BB /* CCComAudio.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComAudio.o; sourceTree = ""; }; + 15CBA49A196EE670005877BB /* CCComAudio.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComAudio.o.d; sourceTree = ""; }; + 15CBA49B196EE670005877BB /* CCComController.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComController.o; sourceTree = ""; }; + 15CBA49C196EE670005877BB /* CCComController.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComController.o.d; sourceTree = ""; }; + 15CBA49D196EE670005877BB /* CCComRender.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCComRender.o; sourceTree = ""; }; + 15CBA49E196EE670005877BB /* CCComRender.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCComRender.o.d; sourceTree = ""; }; + 15CBA49F196EE670005877BB /* CCDataReaderHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDataReaderHelper.o; sourceTree = ""; }; + 15CBA4A0196EE670005877BB /* CCDataReaderHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDataReaderHelper.o.d; sourceTree = ""; }; + 15CBA4A1196EE670005877BB /* CCDatas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDatas.o; sourceTree = ""; }; + 15CBA4A2196EE670005877BB /* CCDatas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDatas.o.d; sourceTree = ""; }; + 15CBA4A3196EE670005877BB /* CCDecorativeDisplay.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDecorativeDisplay.o; sourceTree = ""; }; + 15CBA4A4196EE670005877BB /* CCDecorativeDisplay.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDecorativeDisplay.o.d; sourceTree = ""; }; + 15CBA4A5196EE670005877BB /* CCDisplayFactory.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDisplayFactory.o; sourceTree = ""; }; + 15CBA4A6196EE670005877BB /* CCDisplayFactory.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDisplayFactory.o.d; sourceTree = ""; }; + 15CBA4A7196EE670005877BB /* CCDisplayManager.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCDisplayManager.o; sourceTree = ""; }; + 15CBA4A8196EE670005877BB /* CCDisplayManager.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCDisplayManager.o.d; sourceTree = ""; }; + 15CBA4A9196EE670005877BB /* CCInputDelegate.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCInputDelegate.o; sourceTree = ""; }; + 15CBA4AA196EE670005877BB /* CCInputDelegate.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCInputDelegate.o.d; sourceTree = ""; }; + 15CBA4AB196EE670005877BB /* CCProcessBase.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCProcessBase.o; sourceTree = ""; }; + 15CBA4AC196EE670005877BB /* CCProcessBase.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCProcessBase.o.d; sourceTree = ""; }; + 15CBA4AD196EE670005877BB /* CCSGUIReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSGUIReader.o; sourceTree = ""; }; + 15CBA4AE196EE670005877BB /* CCSGUIReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSGUIReader.o.d; sourceTree = ""; }; + 15CBA4AF196EE670005877BB /* CCSkin.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSkin.o; sourceTree = ""; }; + 15CBA4B0196EE670005877BB /* CCSkin.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSkin.o.d; sourceTree = ""; }; + 15CBA4B1196EE671005877BB /* CCSpriteFrameCacheHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSpriteFrameCacheHelper.o; sourceTree = ""; }; + 15CBA4B2196EE671005877BB /* CCSpriteFrameCacheHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSpriteFrameCacheHelper.o.d; sourceTree = ""; }; + 15CBA4B3196EE671005877BB /* CCSSceneReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSSceneReader.o; sourceTree = ""; }; + 15CBA4B4196EE671005877BB /* CCSSceneReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSSceneReader.o.d; sourceTree = ""; }; + 15CBA4B5196EE671005877BB /* CCTransformHelp.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTransformHelp.o; sourceTree = ""; }; + 15CBA4B6196EE671005877BB /* CCTransformHelp.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTransformHelp.o.d; sourceTree = ""; }; + 15CBA4B7196EE671005877BB /* CCTween.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCTween.o; sourceTree = ""; }; + 15CBA4B8196EE671005877BB /* CCTween.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCTween.o.d; sourceTree = ""; }; + 15CBA4B9196EE671005877BB /* CCUtilMath.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCUtilMath.o; sourceTree = ""; }; + 15CBA4BA196EE671005877BB /* CCUtilMath.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCUtilMath.o.d; sourceTree = ""; }; + 15CBA4BB196EE671005877BB /* CocoLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CocoLoader.o; sourceTree = ""; }; + 15CBA4BC196EE671005877BB /* CocoLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CocoLoader.o.d; sourceTree = ""; }; + 15CBA4BD196EE671005877BB /* DictionaryHelper.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = DictionaryHelper.o; sourceTree = ""; }; + 15CBA4BE196EE671005877BB /* DictionaryHelper.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = DictionaryHelper.o.d; sourceTree = ""; }; + 15CBA4BF196EE671005877BB /* TriggerBase.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TriggerBase.o; sourceTree = ""; }; + 15CBA4C0196EE671005877BB /* TriggerBase.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TriggerBase.o.d; sourceTree = ""; }; + 15CBA4C1196EE671005877BB /* TriggerMng.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TriggerMng.o; sourceTree = ""; }; + 15CBA4C2196EE671005877BB /* TriggerMng.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TriggerMng.o.d; sourceTree = ""; }; + 15CBA4C3196EE671005877BB /* TriggerObj.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TriggerObj.o; sourceTree = ""; }; + 15CBA4C4196EE671005877BB /* TriggerObj.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TriggerObj.o.d; sourceTree = ""; }; + 15CBA4C7196EE671005877BB /* ButtonReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ButtonReader.o; sourceTree = ""; }; + 15CBA4C8196EE671005877BB /* ButtonReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ButtonReader.o.d; sourceTree = ""; }; + 15CBA4CA196EE671005877BB /* CheckBoxReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CheckBoxReader.o; sourceTree = ""; }; + 15CBA4CB196EE671005877BB /* CheckBoxReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CheckBoxReader.o.d; sourceTree = ""; }; + 15CBA4CD196EE671005877BB /* ImageViewReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ImageViewReader.o; sourceTree = ""; }; + 15CBA4CE196EE671005877BB /* ImageViewReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ImageViewReader.o.d; sourceTree = ""; }; + 15CBA4D0196EE671005877BB /* LayoutReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LayoutReader.o; sourceTree = ""; }; + 15CBA4D1196EE671005877BB /* LayoutReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LayoutReader.o.d; sourceTree = ""; }; + 15CBA4D3196EE671005877BB /* ListViewReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ListViewReader.o; sourceTree = ""; }; + 15CBA4D4196EE671005877BB /* ListViewReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ListViewReader.o.d; sourceTree = ""; }; + 15CBA4D6196EE671005877BB /* LoadingBarReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = LoadingBarReader.o; sourceTree = ""; }; + 15CBA4D7196EE671005877BB /* LoadingBarReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = LoadingBarReader.o.d; sourceTree = ""; }; + 15CBA4D9196EE671005877BB /* PageViewReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = PageViewReader.o; sourceTree = ""; }; + 15CBA4DA196EE671005877BB /* PageViewReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = PageViewReader.o.d; sourceTree = ""; }; + 15CBA4DC196EE671005877BB /* ScrollViewReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = ScrollViewReader.o; sourceTree = ""; }; + 15CBA4DD196EE671005877BB /* ScrollViewReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = ScrollViewReader.o.d; sourceTree = ""; }; + 15CBA4DF196EE671005877BB /* SliderReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SliderReader.o; sourceTree = ""; }; + 15CBA4E0196EE671005877BB /* SliderReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SliderReader.o.d; sourceTree = ""; }; + 15CBA4E2196EE671005877BB /* TextAtlasReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TextAtlasReader.o; sourceTree = ""; }; + 15CBA4E3196EE671005877BB /* TextAtlasReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TextAtlasReader.o.d; sourceTree = ""; }; + 15CBA4E5196EE671005877BB /* TextBMFontReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TextBMFontReader.o; sourceTree = ""; }; + 15CBA4E6196EE671005877BB /* TextBMFontReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TextBMFontReader.o.d; sourceTree = ""; }; + 15CBA4E8196EE671005877BB /* TextFieldReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TextFieldReader.o; sourceTree = ""; }; + 15CBA4E9196EE671005877BB /* TextFieldReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TextFieldReader.o.d; sourceTree = ""; }; + 15CBA4EB196EE671005877BB /* TextReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = TextReader.o; sourceTree = ""; }; + 15CBA4EC196EE671005877BB /* TextReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = TextReader.o.d; sourceTree = ""; }; + 15CBA4ED196EE671005877BB /* WidgetReader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = WidgetReader.o; sourceTree = ""; }; + 15CBA4EE196EE671005877BB /* WidgetReader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = WidgetReader.o.d; sourceTree = ""; }; + 15CBA4F0196EE671005877BB /* cpu-features.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "cpu-features.o"; sourceTree = ""; }; + 15CBA4F1196EE671005877BB /* cpu-features.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = "cpu-features.o.d"; sourceTree = ""; }; + 15CBA4F6196EE671005877BB /* AppDelegate.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AppDelegate.o; sourceTree = ""; }; + 15CBA4F7196EE671005877BB /* AppDelegate.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AppDelegate.o.d; sourceTree = ""; }; + 15CBA4F8196EE671005877BB /* main.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = main.o; sourceTree = ""; }; + 15CBA4F9196EE671005877BB /* main.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = main.o.d; sourceTree = ""; }; + 15CBA4FB196EE671005877BB /* Animation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Animation.o; sourceTree = ""; }; + 15CBA4FC196EE671005877BB /* Animation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Animation.o.d; sourceTree = ""; }; + 15CBA4FD196EE671005877BB /* AnimationState.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AnimationState.o; sourceTree = ""; }; + 15CBA4FE196EE671005877BB /* AnimationState.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AnimationState.o.d; sourceTree = ""; }; + 15CBA4FF196EE671005877BB /* AnimationStateData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AnimationStateData.o; sourceTree = ""; }; + 15CBA500196EE671005877BB /* AnimationStateData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AnimationStateData.o.d; sourceTree = ""; }; + 15CBA501196EE671005877BB /* Atlas.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Atlas.o; sourceTree = ""; }; + 15CBA502196EE671005877BB /* Atlas.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Atlas.o.d; sourceTree = ""; }; + 15CBA503196EE671005877BB /* AtlasAttachmentLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AtlasAttachmentLoader.o; sourceTree = ""; }; + 15CBA504196EE671005877BB /* AtlasAttachmentLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AtlasAttachmentLoader.o.d; sourceTree = ""; }; + 15CBA505196EE671005877BB /* Attachment.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Attachment.o; sourceTree = ""; }; + 15CBA506196EE671005877BB /* Attachment.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Attachment.o.d; sourceTree = ""; }; + 15CBA507196EE671005877BB /* AttachmentLoader.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = AttachmentLoader.o; sourceTree = ""; }; + 15CBA508196EE671005877BB /* AttachmentLoader.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = AttachmentLoader.o.d; sourceTree = ""; }; + 15CBA509196EE671005877BB /* Bone.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Bone.o; sourceTree = ""; }; + 15CBA50A196EE671005877BB /* Bone.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Bone.o.d; sourceTree = ""; }; + 15CBA50B196EE671005877BB /* BoneData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BoneData.o; sourceTree = ""; }; + 15CBA50C196EE671005877BB /* BoneData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = BoneData.o.d; sourceTree = ""; }; + 15CBA50D196EE671005877BB /* BoundingBoxAttachment.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = BoundingBoxAttachment.o; sourceTree = ""; }; + 15CBA50E196EE671005877BB /* BoundingBoxAttachment.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = BoundingBoxAttachment.o.d; sourceTree = ""; }; + 15CBA50F196EE671005877BB /* CCSkeleton.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSkeleton.o; sourceTree = ""; }; + 15CBA510196EE671005877BB /* CCSkeleton.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSkeleton.o.d; sourceTree = ""; }; + 15CBA511196EE671005877BB /* CCSkeletonAnimation.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = CCSkeletonAnimation.o; sourceTree = ""; }; + 15CBA512196EE671005877BB /* CCSkeletonAnimation.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = CCSkeletonAnimation.o.d; sourceTree = ""; }; + 15CBA513196EE671005877BB /* Event.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Event.o; sourceTree = ""; }; + 15CBA514196EE671005877BB /* Event.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Event.o.d; sourceTree = ""; }; + 15CBA515196EE671005877BB /* EventData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = EventData.o; sourceTree = ""; }; + 15CBA516196EE671005877BB /* EventData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = EventData.o.d; sourceTree = ""; }; + 15CBA517196EE671005877BB /* extension.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = extension.o; sourceTree = ""; }; + 15CBA518196EE671005877BB /* extension.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = extension.o.d; sourceTree = ""; }; + 15CBA519196EE671005877BB /* Json.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Json.o; sourceTree = ""; }; + 15CBA51A196EE671005877BB /* Json.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Json.o.d; sourceTree = ""; }; + 15CBA51B196EE671005877BB /* RegionAttachment.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = RegionAttachment.o; sourceTree = ""; }; + 15CBA51C196EE671005877BB /* RegionAttachment.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = RegionAttachment.o.d; sourceTree = ""; }; + 15CBA51D196EE671005877BB /* Skeleton.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Skeleton.o; sourceTree = ""; }; + 15CBA51E196EE671005877BB /* Skeleton.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Skeleton.o.d; sourceTree = ""; }; + 15CBA51F196EE671005877BB /* SkeletonBounds.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SkeletonBounds.o; sourceTree = ""; }; + 15CBA520196EE671005877BB /* SkeletonBounds.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SkeletonBounds.o.d; sourceTree = ""; }; + 15CBA521196EE671005877BB /* SkeletonData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SkeletonData.o; sourceTree = ""; }; + 15CBA522196EE671005877BB /* SkeletonData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SkeletonData.o.d; sourceTree = ""; }; + 15CBA523196EE671005877BB /* SkeletonJson.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SkeletonJson.o; sourceTree = ""; }; + 15CBA524196EE671005877BB /* SkeletonJson.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SkeletonJson.o.d; sourceTree = ""; }; + 15CBA525196EE671005877BB /* Skin.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Skin.o; sourceTree = ""; }; + 15CBA526196EE671005877BB /* Skin.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Skin.o.d; sourceTree = ""; }; + 15CBA527196EE671005877BB /* Slot.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = Slot.o; sourceTree = ""; }; + 15CBA528196EE671005877BB /* Slot.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = Slot.o.d; sourceTree = ""; }; + 15CBA529196EE671005877BB /* SlotData.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = SlotData.o; sourceTree = ""; }; + 15CBA52A196EE671005877BB /* SlotData.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = SlotData.o.d; sourceTree = ""; }; + 15CBA52B196EE671005877BB /* spine-cocos2dx.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; path = "spine-cocos2dx.o"; sourceTree = ""; }; + 15CBA52C196EE671005877BB /* spine-cocos2dx.o.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = "spine-cocos2dx.o.d"; sourceTree = ""; }; + 15CBA52D196EE671005877BB /* proguard-project.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "proguard-project.txt"; sourceTree = ""; }; + 15CBA52E196EE671005877BB /* project.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = project.properties; sourceTree = ""; }; + 15CBA531196EE671005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA533196EE671005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA535196EE671005877BB /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; + 15CBA537196EE671005877BB /* strings.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = strings.xml; sourceTree = ""; }; + 15CBA53C196EE671005877BB /* AppActivity.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = AppActivity.java; sourceTree = ""; }; + 15CBA53E196EE671005877BB /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; + 15CBA53F196EE671005877BB /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; + 15CBA540196EE671005877BB /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + 15CBA541196EE671005877BB /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + 15CBA542196EE671005877BB /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; + 15CBA543196EE671005877BB /* HelloLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloLua_Prefix.pch; sourceTree = ""; }; + 15CBA544196EE671005877BB /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = ""; }; + 15CBA545196EE671005877BB /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-120.png"; sourceTree = ""; }; + 15CBA546196EE671005877BB /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = ""; }; + 15CBA547196EE671005877BB /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-152.png"; sourceTree = ""; }; + 15CBA548196EE671005877BB /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = ""; }; + 15CBA549196EE671005877BB /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; }; + 15CBA54A196EE671005877BB /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-76.png"; sourceTree = ""; }; + 15CBA54B196EE671005877BB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 15CBA54C196EE671005877BB /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 15CBA54D196EE671005877BB /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; + 15CBA54E196EE671005877BB /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = ""; }; + 15CBA9A4196EE6B1005877BB /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = ""; }; + 15CBA9A7196EE6DB005877BB /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; + 15CBA9C0196EE943005877BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9C2196EE951005877BB /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9C4196EE962005877BB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9C6196EE971005877BB /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9C8196EE97F005877BB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9D3196EEA33005877BB /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9D6196EEA63005877BB /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9D8196EEA7D005877BB /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9DA196EEA90005877BB /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; }; + 15CBA9DC196EEAA6005877BB /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; }; + 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_controller_auto.cpp; path = "../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp"; sourceTree = ""; }; + 15CBA9EC196F7BD8005877BB /* lua_cocos2dx_controller_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = lua_cocos2dx_controller_auto.hpp; path = "../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp"; sourceTree = ""; }; + 15CBA9EE196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lua_cocos2dx_controller_manual.cpp; path = "../../../../cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp"; sourceTree = ""; }; + 15CBA9EF196F7BEC005877BB /* lua_cocos2dx_controller_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = lua_cocos2dx_controller_manual.hpp; path = "../../../../cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp"; sourceTree = ""; }; 1A0EE2B218CDF6DA004CD58F /* cpp-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE31418CDF733004CD58F /* lua-empty-test Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "lua-empty-test Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1A0EE41318CDF775004CD58F /* cpp-empty-test iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-empty-test iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1822,14 +3020,14 @@ 1D6058910D05DD3D006BFB54 /* cpp-tests Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cpp-tests Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1F33634D18E37E840074764D /* RefPtrTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefPtrTest.cpp; sourceTree = ""; }; 1F33634E18E37E840074764D /* RefPtrTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtrTest.h; sourceTree = ""; }; - 29080D1A191B574B0066F8DF /* UITest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UITest.cpp; path = UITest/UITest.cpp; sourceTree = ""; }; - 29080D1B191B574B0066F8DF /* UITest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UITest.h; path = UITest/UITest.h; sourceTree = ""; }; + 29080D1A191B574B0066F8DF /* UITest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UITest.cpp; path = ../UITest.cpp; sourceTree = ""; }; + 29080D1B191B574B0066F8DF /* UITest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UITest.h; path = ../UITest.h; sourceTree = ""; }; 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUIScene.cpp; sourceTree = ""; }; 29080D20191B595E0066F8DF /* CocosGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUIScene.h; sourceTree = ""; }; 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocoStudioGUITest.cpp; sourceTree = ""; }; 29080D22191B595E0066F8DF /* CocoStudioGUITest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoStudioGUITest.h; sourceTree = ""; }; - 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomGUIScene.cpp; sourceTree = ""; }; - 29080D24191B595E0066F8DF /* CustomGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomGUIScene.h; sourceTree = ""; }; + 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomGUIScene.cpp; path = ../CustomGUIScene.cpp; sourceTree = ""; }; + 29080D24191B595E0066F8DF /* CustomGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomGUIScene.h; path = ../CustomGUIScene.h; sourceTree = ""; }; 29080D27191B595E0066F8DF /* CustomImageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomImageTest.cpp; sourceTree = ""; }; 29080D28191B595E0066F8DF /* CustomImageTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomImageTest.h; sourceTree = ""; }; 29080D2A191B595E0066F8DF /* CustomParticleWidgetTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomParticleWidgetTest.cpp; sourceTree = ""; }; @@ -1914,6 +3112,10 @@ 29080D8A191B595E0066F8DF /* UIWidgetAddNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest.h; sourceTree = ""; }; 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest_Editor.cpp; sourceTree = ""; }; 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = ""; }; + 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocostudioParserTest.cpp; path = ../CocostudioParserTest.cpp; sourceTree = ""; }; + 290E94B4196FC16900694919 /* CocostudioParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocostudioParserTest.h; path = ../CocostudioParserTest.h; sourceTree = ""; }; + 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocostudioParserJsonTest.cpp; sourceTree = ""; }; + 29FBBBFD196A9ECD00E65826 /* CocostudioParserJsonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocostudioParserJsonTest.h; sourceTree = ""; }; 38FA2E71194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionTimelineTestScene.cpp; sourceTree = ""; }; 38FA2E72194AEBE100FF2BE4 /* ActionTimelineTestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionTimelineTestScene.h; sourceTree = ""; }; 38FA2E75194AECF800FF2BE4 /* ActionTimeline */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ActionTimeline; path = "../tests/cpp-tests/Resources/ActionTimeline"; sourceTree = ""; }; @@ -1977,6 +3179,30 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 15CBA025196EE56C005877BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 15CBA9E0196EEBD4005877BB /* MediaPlayer.framework in Frameworks */, + 15CBA9DE196EEAF8005877BB /* GameController.framework in Frameworks */, + 15CBA9DD196EEAA6005877BB /* libz.dylib in Frameworks */, + 15CBA9DB196EEA90005877BB /* CoreMotion.framework in Frameworks */, + 15CBA9D7196EEA63005877BB /* AudioToolbox.framework in Frameworks */, + 15CBA9D4196EEA33005877BB /* OpenAL.framework in Frameworks */, + 15CBA9D9196EEA7D005877BB /* QuartzCore.framework in Frameworks */, + 15CBA9D5196EEA43005877BB /* CoreGraphics.framework in Frameworks */, + 15CBA9D2196EEA33005877BB /* OpenGLES.framework in Frameworks */, + 15CBA9D0196EEA05005877BB /* UIKit.framework in Frameworks */, + 15CBA9CF196EE9FB005877BB /* AVFoundation.framework in Frameworks */, + 15CBA9D1196EEA1D005877BB /* Foundation.framework in Frameworks */, + 15CBA9BB196EE910005877BB /* libchipmunk iOS.a in Frameworks */, + 15CBA9DF196EEBB3005877BB /* libcocos2dx iOS.a in Frameworks */, + 15CBA9BD196EE910005877BB /* libcocos2dx-extensions iOS.a in Frameworks */, + 15CBA9BE196EE910005877BB /* libCocosDenshion iOS.a in Frameworks */, + 15CBA9BF196EE910005877BB /* libluabindings iOS.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1A0EE29F18CDF6DA004CD58F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2043,6 +3269,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AECE25195D467D00907DB0 /* MediaPlayer.framework in Frameworks */, 1A0EE42C18CDF799004CD58F /* libz.dylib in Frameworks */, 1A0EE42D18CDF799004CD58F /* CoreMotion.framework in Frameworks */, 1A0EE42E18CDF799004CD58F /* AudioToolbox.framework in Frameworks */, @@ -2087,6 +3314,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AECE0B195C0F8A00907DB0 /* MediaPlayer.framework in Frameworks */, 1ABCA3B018CDA06D0087CE3A /* libz.dylib in Frameworks */, 1ABCA3AA18CD9F1A0087CE3A /* CoreMotion.framework in Frameworks */, 1ABCA3A918CD9F130087CE3A /* AudioToolbox.framework in Frameworks */, @@ -2132,8 +3360,6 @@ buildActionMask = 2147483647; files = ( 3E61773D1960FBD200DE83F5 /* GameController.framework in Frameworks */, - 3E61773B1960FBC300DE83F5 /* CFNetwork.framework in Frameworks */, - 3E6177391960FBB800DE83F5 /* SystemConfiguration.framework in Frameworks */, 3E6177211960FAED00DE83F5 /* libchipmunk iOS.a in Frameworks */, 3E6177221960FAED00DE83F5 /* libcocos2dx iOS.a in Frameworks */, 3E6177231960FAED00DE83F5 /* libCocosDenshion iOS.a in Frameworks */, @@ -2176,6 +3402,2096 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 15CBA087196EE66D005877BB /* lua-game-controller-test */ = { + isa = PBXGroup; + children = ( + 15CBA089196EE66D005877BB /* project */, + 15CBA9A6196EE6DB005877BB /* res */, + 15CBA9A4196EE6B1005877BB /* src */, + ); + name = "lua-game-controller-test"; + path = "../tests/lua-game-controller-test"; + sourceTree = ""; + }; + 15CBA089196EE66D005877BB /* project */ = { + isa = PBXGroup; + children = ( + 15CBA08A196EE66D005877BB /* Classes */, + 15CBA08E196EE66D005877BB /* proj.android */, + 15CBA53D196EE671005877BB /* proj.ios */, + ); + path = project; + sourceTree = ""; + }; + 15CBA08A196EE66D005877BB /* Classes */ = { + isa = PBXGroup; + children = ( + 15CBA9EE196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp */, + 15CBA9EF196F7BEC005877BB /* lua_cocos2dx_controller_manual.hpp */, + 15CBA9EB196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp */, + 15CBA9EC196F7BD8005877BB /* lua_cocos2dx_controller_auto.hpp */, + 15CBA08B196EE66D005877BB /* AppDelegate.cpp */, + 15CBA08C196EE66D005877BB /* AppDelegate.h */, + ); + path = Classes; + sourceTree = ""; + }; + 15CBA08E196EE66D005877BB /* proj.android */ = { + isa = PBXGroup; + children = ( + 15CBA08F196EE66D005877BB /* .classpath */, + 15CBA090196EE66D005877BB /* .project */, + 15CBA091196EE66D005877BB /* AndroidManifest.xml */, + 15CBA092196EE66D005877BB /* ant.properties */, + 15CBA093196EE66D005877BB /* assets */, + 15CBA0D8196EE66D005877BB /* bin */, + 15CBA104196EE66E005877BB /* build-cfg.json */, + 15CBA105196EE66E005877BB /* build.xml */, + 15CBA106196EE66E005877BB /* gen */, + 15CBA10F196EE66E005877BB /* jni */, + 15CBA113196EE66E005877BB /* libs */, + 15CBA116196EE66E005877BB /* local.properties */, + 15CBA117196EE66E005877BB /* obj */, + 15CBA52D196EE671005877BB /* proguard-project.txt */, + 15CBA52E196EE671005877BB /* project.properties */, + 15CBA52F196EE671005877BB /* res */, + 15CBA538196EE671005877BB /* src */, + ); + path = proj.android; + sourceTree = ""; + }; + 15CBA093196EE66D005877BB /* assets */ = { + isa = PBXGroup; + children = ( + 15CBA094196EE66D005877BB /* AudioEngine.lua */, + 15CBA095196EE66D005877BB /* CCBReaderLoad.lua */, + 15CBA096196EE66D005877BB /* Cocos2d.lua */, + 15CBA097196EE66D005877BB /* Cocos2dConstants.lua */, + 15CBA098196EE66D005877BB /* CocoStudio.lua */, + 15CBA099196EE66D005877BB /* Deprecated.lua */, + 15CBA09A196EE66D005877BB /* DeprecatedClass.lua */, + 15CBA09B196EE66D005877BB /* DeprecatedEnum.lua */, + 15CBA09C196EE66D005877BB /* DeprecatedOpenglEnum.lua */, + 15CBA09D196EE66D005877BB /* DrawPrimitives.lua */, + 15CBA09E196EE66D005877BB /* extern.lua */, + 15CBA09F196EE66D005877BB /* ftp.lua */, + 15CBA0A0196EE66D005877BB /* GuiConstants.lua */, + 15CBA0A1196EE66D005877BB /* headers.lua */, + 15CBA0A2196EE66D005877BB /* http.lua */, + 15CBA0A3196EE66D005877BB /* json.lua */, + 15CBA0A4196EE66D005877BB /* ltn12.lua */, + 15CBA0A5196EE66D005877BB /* luaj.lua */, + 15CBA0A6196EE66D005877BB /* luaoc.lua */, + 15CBA0A7196EE66D005877BB /* mbox.lua */, + 15CBA0A8196EE66D005877BB /* mime.lua */, + 15CBA0A9196EE66D005877BB /* Opengl.lua */, + 15CBA0AA196EE66D005877BB /* OpenglConstants.lua */, + 15CBA0AB196EE66D005877BB /* res */, + 15CBA0D0196EE66D005877BB /* smtp.lua */, + 15CBA0D1196EE66D005877BB /* socket.lua */, + 15CBA0D2196EE66D005877BB /* src */, + 15CBA0D5196EE66D005877BB /* StudioConstants.lua */, + 15CBA0D6196EE66D005877BB /* tp.lua */, + 15CBA0D7196EE66D005877BB /* url.lua */, + ); + path = assets; + sourceTree = ""; + }; + 15CBA0AB196EE66D005877BB /* res */ = { + isa = PBXGroup; + children = ( + 15CBA0AC196EE66D005877BB /* fonts */, + 15CBA0AE196EE66D005877BB /* ipad */, + 15CBA0BE196EE66D005877BB /* ipadhd */, + 15CBA0CD196EE66D005877BB /* iphone */, + ); + path = res; + sourceTree = ""; + }; + 15CBA0AC196EE66D005877BB /* fonts */ = { + isa = PBXGroup; + children = ( + 15CBA0AD196EE66D005877BB /* Marker Felt.ttf */, + ); + path = fonts; + sourceTree = ""; + }; + 15CBA0AE196EE66D005877BB /* ipad */ = { + isa = PBXGroup; + children = ( + 15CBA0AF196EE66D005877BB /* A.png */, + 15CBA0B0196EE66D005877BB /* B.png */, + 15CBA0B1196EE66D005877BB /* CloseNormal.png */, + 15CBA0B2196EE66D005877BB /* CloseSelected.png */, + 15CBA0B3196EE66D005877BB /* controller-1.png */, + 15CBA0B4196EE66D005877BB /* controller-2.png */, + 15CBA0B5196EE66D005877BB /* dpad-key.png */, + 15CBA0B6196EE66D005877BB /* dPad.png */, + 15CBA0B7196EE66D005877BB /* joystick.png */, + 15CBA0B8196EE66D005877BB /* L1.png */, + 15CBA0B9196EE66D005877BB /* L2.png */, + 15CBA0BA196EE66D005877BB /* R1.png */, + 15CBA0BB196EE66D005877BB /* R2.png */, + 15CBA0BC196EE66D005877BB /* X.png */, + 15CBA0BD196EE66D005877BB /* Y.png */, + ); + path = ipad; + sourceTree = ""; + }; + 15CBA0BE196EE66D005877BB /* ipadhd */ = { + isa = PBXGroup; + children = ( + 15CBA0BF196EE66D005877BB /* A.png */, + 15CBA0C0196EE66D005877BB /* B.png */, + 15CBA0C1196EE66D005877BB /* CloseNormal.png */, + 15CBA0C2196EE66D005877BB /* CloseSelected.png */, + 15CBA0C3196EE66D005877BB /* controller-1.png */, + 15CBA0C4196EE66D005877BB /* controller-2.png */, + 15CBA0C5196EE66D005877BB /* dPad.png */, + 15CBA0C6196EE66D005877BB /* joystick.png */, + 15CBA0C7196EE66D005877BB /* L1.png */, + 15CBA0C8196EE66D005877BB /* L2.png */, + 15CBA0C9196EE66D005877BB /* R1.png */, + 15CBA0CA196EE66D005877BB /* R2.png */, + 15CBA0CB196EE66D005877BB /* X.png */, + 15CBA0CC196EE66D005877BB /* Y.png */, + ); + path = ipadhd; + sourceTree = ""; + }; + 15CBA0CD196EE66D005877BB /* iphone */ = { + isa = PBXGroup; + children = ( + 15CBA0CE196EE66D005877BB /* CloseNormal.png */, + 15CBA0CF196EE66D005877BB /* CloseSelected.png */, + ); + path = iphone; + sourceTree = ""; + }; + 15CBA0D2196EE66D005877BB /* src */ = { + isa = PBXGroup; + children = ( + 15CBA0D3196EE66D005877BB /* GameControllerTest.lua */, + 15CBA0D4196EE66D005877BB /* main.lua */, + ); + path = src; + sourceTree = ""; + }; + 15CBA0D8196EE66D005877BB /* bin */ = { + isa = PBXGroup; + children = ( + 15CBA0D9196EE66D005877BB /* AndroidManifest.xml */, + 15CBA0DA196EE66D005877BB /* AndroidManifest.xml.d */, + 15CBA0DB196EE66D005877BB /* build.prop */, + 15CBA0DC196EE66D005877BB /* classes */, + 15CBA0EB196EE66D005877BB /* classes.dex */, + 15CBA0EC196EE66D005877BB /* classes.dex.d */, + 15CBA0ED196EE66D005877BB /* dexedLibs */, + 15CBA0F3196EE66E005877BB /* jarlist.cache */, + 15CBA0F4196EE66E005877BB /* LuaGameControllerTest-debug-unaligned.apk */, + 15CBA0F5196EE66E005877BB /* LuaGameControllerTest-debug-unaligned.apk.d */, + 15CBA0F6196EE66E005877BB /* LuaGameControllerTest-debug.apk */, + 15CBA0F7196EE66E005877BB /* LuaGameControllerTest.ap_ */, + 15CBA0F8196EE66E005877BB /* LuaGameControllerTest.ap_.d */, + 15CBA0F9196EE66E005877BB /* LuaGameControllerTest.apk */, + 15CBA0FA196EE66E005877BB /* proguard.txt */, + 15CBA0FB196EE66E005877BB /* R.txt */, + 15CBA0FC196EE66E005877BB /* res */, + 15CBA103196EE66E005877BB /* resources.ap_ */, + ); + path = bin; + sourceTree = ""; + }; + 15CBA0DC196EE66D005877BB /* classes */ = { + isa = PBXGroup; + children = ( + 15CBA0DD196EE66D005877BB /* org */, + 15CBA0EA196EE66D005877BB /* R.java.d */, + ); + path = classes; + sourceTree = ""; + }; + 15CBA0DD196EE66D005877BB /* org */ = { + isa = PBXGroup; + children = ( + 15CBA0DE196EE66D005877BB /* cocos2dx */, + ); + path = org; + sourceTree = ""; + }; + 15CBA0DE196EE66D005877BB /* cocos2dx */ = { + isa = PBXGroup; + children = ( + 15CBA0DF196EE66D005877BB /* lib */, + 15CBA0E3196EE66D005877BB /* LuaGameControllerTest */, + ); + path = cocos2dx; + sourceTree = ""; + }; + 15CBA0DF196EE66D005877BB /* lib */ = { + isa = PBXGroup; + children = ( + 15CBA0E0196EE66D005877BB /* R$drawable.class */, + 15CBA0E1196EE66D005877BB /* R$string.class */, + 15CBA0E2196EE66D005877BB /* R.class */, + ); + path = lib; + sourceTree = ""; + }; + 15CBA0E3196EE66D005877BB /* LuaGameControllerTest */ = { + isa = PBXGroup; + children = ( + 15CBA0E4196EE66D005877BB /* AppActivity.class */, + 15CBA0E5196EE66D005877BB /* BuildConfig.class */, + 15CBA0E6196EE66D005877BB /* R$attr.class */, + 15CBA0E7196EE66D005877BB /* R$drawable.class */, + 15CBA0E8196EE66D005877BB /* R$string.class */, + 15CBA0E9196EE66D005877BB /* R.class */, + ); + path = LuaGameControllerTest; + sourceTree = ""; + }; + 15CBA0ED196EE66D005877BB /* dexedLibs */ = { + isa = PBXGroup; + children = ( + 15CBA0EE196EE66D005877BB /* com.bda.controller-2a2221a1ab7454168b1de77b0fcb60b5.jar */, + 15CBA0EF196EE66D005877BB /* libcocos2dx-6607f245d91af6aef71b17fa98444a4b.jar */, + 15CBA0F0196EE66E005877BB /* libcontrollermanualadapter-e17761caab08972308a4bbfa589d7d02.jar */, + 15CBA0F1196EE66E005877BB /* nibiru_lib_2_1_7-67e12061a63fd16ecf47bdef1767938c.jar */, + 15CBA0F2196EE66E005877BB /* ouya-sdk-f5c122a155623a2270a639db2ebe8685.jar */, + ); + path = dexedLibs; + sourceTree = ""; + }; + 15CBA0FC196EE66E005877BB /* res */ = { + isa = PBXGroup; + children = ( + 15CBA0FD196EE66E005877BB /* drawable-hdpi */, + 15CBA0FF196EE66E005877BB /* drawable-ldpi */, + 15CBA101196EE66E005877BB /* drawable-mdpi */, + ); + path = res; + sourceTree = ""; + }; + 15CBA0FD196EE66E005877BB /* drawable-hdpi */ = { + isa = PBXGroup; + children = ( + 15CBA0FE196EE66E005877BB /* icon.png */, + ); + path = "drawable-hdpi"; + sourceTree = ""; + }; + 15CBA0FF196EE66E005877BB /* drawable-ldpi */ = { + isa = PBXGroup; + children = ( + 15CBA100196EE66E005877BB /* icon.png */, + ); + path = "drawable-ldpi"; + sourceTree = ""; + }; + 15CBA101196EE66E005877BB /* drawable-mdpi */ = { + isa = PBXGroup; + children = ( + 15CBA102196EE66E005877BB /* icon.png */, + ); + path = "drawable-mdpi"; + sourceTree = ""; + }; + 15CBA106196EE66E005877BB /* gen */ = { + isa = PBXGroup; + children = ( + 15CBA107196EE66E005877BB /* org */, + 15CBA10E196EE66E005877BB /* R.java.d */, + ); + path = gen; + sourceTree = ""; + }; + 15CBA107196EE66E005877BB /* org */ = { + isa = PBXGroup; + children = ( + 15CBA108196EE66E005877BB /* cocos2dx */, + ); + path = org; + sourceTree = ""; + }; + 15CBA108196EE66E005877BB /* cocos2dx */ = { + isa = PBXGroup; + children = ( + 15CBA109196EE66E005877BB /* lib */, + 15CBA10B196EE66E005877BB /* LuaGameControllerTest */, + ); + path = cocos2dx; + sourceTree = ""; + }; + 15CBA109196EE66E005877BB /* lib */ = { + isa = PBXGroup; + children = ( + 15CBA10A196EE66E005877BB /* R.java */, + ); + path = lib; + sourceTree = ""; + }; + 15CBA10B196EE66E005877BB /* LuaGameControllerTest */ = { + isa = PBXGroup; + children = ( + 15CBA10C196EE66E005877BB /* BuildConfig.java */, + 15CBA10D196EE66E005877BB /* R.java */, + ); + path = LuaGameControllerTest; + sourceTree = ""; + }; + 15CBA10F196EE66E005877BB /* jni */ = { + isa = PBXGroup; + children = ( + 15CBA110196EE66E005877BB /* Android.mk */, + 15CBA111196EE66E005877BB /* Application.mk */, + 15CBA112196EE66E005877BB /* main.cpp */, + ); + path = jni; + sourceTree = ""; + }; + 15CBA113196EE66E005877BB /* libs */ = { + isa = PBXGroup; + children = ( + 15CBA114196EE66E005877BB /* armeabi */, + ); + path = libs; + sourceTree = ""; + }; + 15CBA114196EE66E005877BB /* armeabi */ = { + isa = PBXGroup; + children = ( + 15CBA115196EE66E005877BB /* liblua_game_controller.so */, + ); + path = armeabi; + sourceTree = ""; + }; + 15CBA117196EE66E005877BB /* obj */ = { + isa = PBXGroup; + children = ( + 15CBA118196EE66E005877BB /* local */, + ); + path = obj; + sourceTree = ""; + }; + 15CBA118196EE66E005877BB /* local */ = { + isa = PBXGroup; + children = ( + 15CBA119196EE66E005877BB /* armeabi */, + ); + path = local; + sourceTree = ""; + }; + 15CBA119196EE66E005877BB /* armeabi */ = { + isa = PBXGroup; + children = ( + 15CBA11A196EE66E005877BB /* libbox2d.a */, + 15CBA11B196EE66E005877BB /* libchipmunk.a */, + 15CBA11C196EE66E005877BB /* libcocos2d.a */, + 15CBA11D196EE66E005877BB /* libcocos2dandroid.a */, + 15CBA11E196EE66E005877BB /* libcocosbuilder.a */, + 15CBA11F196EE66E005877BB /* libcocosdenshion.a */, + 15CBA120196EE66E005877BB /* libcocostudio.a */, + 15CBA121196EE66E005877BB /* libcpufeatures.a */, + 15CBA122196EE66E005877BB /* libextension.a */, + 15CBA123196EE66E005877BB /* liblua.a */, + 15CBA124196EE66E005877BB /* liblua_game_controller.so */, + 15CBA125196EE66E005877BB /* libnetwork.a */, + 15CBA126196EE66E005877BB /* libspine.a */, + 15CBA127196EE66E005877BB /* libui.a */, + 15CBA128196EE66E005877BB /* objs-debug */, + ); + path = armeabi; + sourceTree = ""; + }; + 15CBA128196EE66E005877BB /* objs-debug */ = { + isa = PBXGroup; + children = ( + 15CBA129196EE66E005877BB /* box2d_static */, + 15CBA18D196EE66E005877BB /* chipmunk_static */, + 15CBA1CA196EE66E005877BB /* cocos2dx_static */, + 15CBA33B196EE66F005877BB /* cocos2dxandroid_static */, + 15CBA359196EE66F005877BB /* cocos_extension_static */, + 15CBA38C196EE66F005877BB /* cocos_lua_static */, + 15CBA404196EE670005877BB /* cocos_network_static */, + 15CBA40B196EE670005877BB /* cocos_ui_static */, + 15CBA43E196EE670005877BB /* cocosbuilder_static */, + 15CBA46B196EE670005877BB /* cocosdenshion_static */, + 15CBA473196EE670005877BB /* cocostudio_static */, + 15CBA4EF196EE671005877BB /* cpufeatures */, + 15CBA4F2196EE671005877BB /* lua_game_controller_test_shared */, + 15CBA4FA196EE671005877BB /* spine_static */, + ); + path = "objs-debug"; + sourceTree = ""; + }; + 15CBA129196EE66E005877BB /* box2d_static */ = { + isa = PBXGroup; + children = ( + 15CBA12A196EE66E005877BB /* Collision */, + 15CBA144196EE66E005877BB /* Common */, + 15CBA151196EE66E005877BB /* Dynamics */, + 15CBA18A196EE66E005877BB /* Rope */, + ); + path = box2d_static; + sourceTree = ""; + }; + 15CBA12A196EE66E005877BB /* Collision */ = { + isa = PBXGroup; + children = ( + 15CBA12B196EE66E005877BB /* b2BroadPhase.o */, + 15CBA12C196EE66E005877BB /* b2BroadPhase.o.d */, + 15CBA12D196EE66E005877BB /* b2CollideCircle.o */, + 15CBA12E196EE66E005877BB /* b2CollideCircle.o.d */, + 15CBA12F196EE66E005877BB /* b2CollideEdge.o */, + 15CBA130196EE66E005877BB /* b2CollideEdge.o.d */, + 15CBA131196EE66E005877BB /* b2CollidePolygon.o */, + 15CBA132196EE66E005877BB /* b2CollidePolygon.o.d */, + 15CBA133196EE66E005877BB /* b2Collision.o */, + 15CBA134196EE66E005877BB /* b2Collision.o.d */, + 15CBA135196EE66E005877BB /* b2Distance.o */, + 15CBA136196EE66E005877BB /* b2Distance.o.d */, + 15CBA137196EE66E005877BB /* b2DynamicTree.o */, + 15CBA138196EE66E005877BB /* b2DynamicTree.o.d */, + 15CBA139196EE66E005877BB /* b2TimeOfImpact.o */, + 15CBA13A196EE66E005877BB /* b2TimeOfImpact.o.d */, + 15CBA13B196EE66E005877BB /* Shapes */, + ); + path = Collision; + sourceTree = ""; + }; + 15CBA13B196EE66E005877BB /* Shapes */ = { + isa = PBXGroup; + children = ( + 15CBA13C196EE66E005877BB /* b2ChainShape.o */, + 15CBA13D196EE66E005877BB /* b2ChainShape.o.d */, + 15CBA13E196EE66E005877BB /* b2CircleShape.o */, + 15CBA13F196EE66E005877BB /* b2CircleShape.o.d */, + 15CBA140196EE66E005877BB /* b2EdgeShape.o */, + 15CBA141196EE66E005877BB /* b2EdgeShape.o.d */, + 15CBA142196EE66E005877BB /* b2PolygonShape.o */, + 15CBA143196EE66E005877BB /* b2PolygonShape.o.d */, + ); + path = Shapes; + sourceTree = ""; + }; + 15CBA144196EE66E005877BB /* Common */ = { + isa = PBXGroup; + children = ( + 15CBA145196EE66E005877BB /* b2BlockAllocator.o */, + 15CBA146196EE66E005877BB /* b2BlockAllocator.o.d */, + 15CBA147196EE66E005877BB /* b2Draw.o */, + 15CBA148196EE66E005877BB /* b2Draw.o.d */, + 15CBA149196EE66E005877BB /* b2Math.o */, + 15CBA14A196EE66E005877BB /* b2Math.o.d */, + 15CBA14B196EE66E005877BB /* b2Settings.o */, + 15CBA14C196EE66E005877BB /* b2Settings.o.d */, + 15CBA14D196EE66E005877BB /* b2StackAllocator.o */, + 15CBA14E196EE66E005877BB /* b2StackAllocator.o.d */, + 15CBA14F196EE66E005877BB /* b2Timer.o */, + 15CBA150196EE66E005877BB /* b2Timer.o.d */, + ); + path = Common; + sourceTree = ""; + }; + 15CBA151196EE66E005877BB /* Dynamics */ = { + isa = PBXGroup; + children = ( + 15CBA152196EE66E005877BB /* b2Body.o */, + 15CBA153196EE66E005877BB /* b2Body.o.d */, + 15CBA154196EE66E005877BB /* b2ContactManager.o */, + 15CBA155196EE66E005877BB /* b2ContactManager.o.d */, + 15CBA156196EE66E005877BB /* b2Fixture.o */, + 15CBA157196EE66E005877BB /* b2Fixture.o.d */, + 15CBA158196EE66E005877BB /* b2Island.o */, + 15CBA159196EE66E005877BB /* b2Island.o.d */, + 15CBA15A196EE66E005877BB /* b2World.o */, + 15CBA15B196EE66E005877BB /* b2World.o.d */, + 15CBA15C196EE66E005877BB /* b2WorldCallbacks.o */, + 15CBA15D196EE66E005877BB /* b2WorldCallbacks.o.d */, + 15CBA15E196EE66E005877BB /* Contacts */, + 15CBA171196EE66E005877BB /* Joints */, + ); + path = Dynamics; + sourceTree = ""; + }; + 15CBA15E196EE66E005877BB /* Contacts */ = { + isa = PBXGroup; + children = ( + 15CBA15F196EE66E005877BB /* b2ChainAndCircleContact.o */, + 15CBA160196EE66E005877BB /* b2ChainAndCircleContact.o.d */, + 15CBA161196EE66E005877BB /* b2ChainAndPolygonContact.o */, + 15CBA162196EE66E005877BB /* b2ChainAndPolygonContact.o.d */, + 15CBA163196EE66E005877BB /* b2CircleContact.o */, + 15CBA164196EE66E005877BB /* b2CircleContact.o.d */, + 15CBA165196EE66E005877BB /* b2Contact.o */, + 15CBA166196EE66E005877BB /* b2Contact.o.d */, + 15CBA167196EE66E005877BB /* b2ContactSolver.o */, + 15CBA168196EE66E005877BB /* b2ContactSolver.o.d */, + 15CBA169196EE66E005877BB /* b2EdgeAndCircleContact.o */, + 15CBA16A196EE66E005877BB /* b2EdgeAndCircleContact.o.d */, + 15CBA16B196EE66E005877BB /* b2EdgeAndPolygonContact.o */, + 15CBA16C196EE66E005877BB /* b2EdgeAndPolygonContact.o.d */, + 15CBA16D196EE66E005877BB /* b2PolygonAndCircleContact.o */, + 15CBA16E196EE66E005877BB /* b2PolygonAndCircleContact.o.d */, + 15CBA16F196EE66E005877BB /* b2PolygonContact.o */, + 15CBA170196EE66E005877BB /* b2PolygonContact.o.d */, + ); + path = Contacts; + sourceTree = ""; + }; + 15CBA171196EE66E005877BB /* Joints */ = { + isa = PBXGroup; + children = ( + 15CBA172196EE66E005877BB /* b2DistanceJoint.o */, + 15CBA173196EE66E005877BB /* b2DistanceJoint.o.d */, + 15CBA174196EE66E005877BB /* b2FrictionJoint.o */, + 15CBA175196EE66E005877BB /* b2FrictionJoint.o.d */, + 15CBA176196EE66E005877BB /* b2GearJoint.o */, + 15CBA177196EE66E005877BB /* b2GearJoint.o.d */, + 15CBA178196EE66E005877BB /* b2Joint.o */, + 15CBA179196EE66E005877BB /* b2Joint.o.d */, + 15CBA17A196EE66E005877BB /* b2MotorJoint.o */, + 15CBA17B196EE66E005877BB /* b2MotorJoint.o.d */, + 15CBA17C196EE66E005877BB /* b2MouseJoint.o */, + 15CBA17D196EE66E005877BB /* b2MouseJoint.o.d */, + 15CBA17E196EE66E005877BB /* b2PrismaticJoint.o */, + 15CBA17F196EE66E005877BB /* b2PrismaticJoint.o.d */, + 15CBA180196EE66E005877BB /* b2PulleyJoint.o */, + 15CBA181196EE66E005877BB /* b2PulleyJoint.o.d */, + 15CBA182196EE66E005877BB /* b2RevoluteJoint.o */, + 15CBA183196EE66E005877BB /* b2RevoluteJoint.o.d */, + 15CBA184196EE66E005877BB /* b2RopeJoint.o */, + 15CBA185196EE66E005877BB /* b2RopeJoint.o.d */, + 15CBA186196EE66E005877BB /* b2WeldJoint.o */, + 15CBA187196EE66E005877BB /* b2WeldJoint.o.d */, + 15CBA188196EE66E005877BB /* b2WheelJoint.o */, + 15CBA189196EE66E005877BB /* b2WheelJoint.o.d */, + ); + path = Joints; + sourceTree = ""; + }; + 15CBA18A196EE66E005877BB /* Rope */ = { + isa = PBXGroup; + children = ( + 15CBA18B196EE66E005877BB /* b2Rope.o */, + 15CBA18C196EE66E005877BB /* b2Rope.o.d */, + ); + path = Rope; + sourceTree = ""; + }; + 15CBA18D196EE66E005877BB /* chipmunk_static */ = { + isa = PBXGroup; + children = ( + 15CBA18E196EE66E005877BB /* src */, + ); + path = chipmunk_static; + sourceTree = ""; + }; + 15CBA18E196EE66E005877BB /* src */ = { + isa = PBXGroup; + children = ( + 15CBA18F196EE66E005877BB /* chipmunk.o */, + 15CBA190196EE66E005877BB /* chipmunk.o.d */, + 15CBA191196EE66E005877BB /* constraints */, + 15CBA1A8196EE66E005877BB /* cpArbiter.o */, + 15CBA1A9196EE66E005877BB /* cpArbiter.o.d */, + 15CBA1AA196EE66E005877BB /* cpArray.o */, + 15CBA1AB196EE66E005877BB /* cpArray.o.d */, + 15CBA1AC196EE66E005877BB /* cpBB.o */, + 15CBA1AD196EE66E005877BB /* cpBB.o.d */, + 15CBA1AE196EE66E005877BB /* cpBBTree.o */, + 15CBA1AF196EE66E005877BB /* cpBBTree.o.d */, + 15CBA1B0196EE66E005877BB /* cpBody.o */, + 15CBA1B1196EE66E005877BB /* cpBody.o.d */, + 15CBA1B2196EE66E005877BB /* cpCollision.o */, + 15CBA1B3196EE66E005877BB /* cpCollision.o.d */, + 15CBA1B4196EE66E005877BB /* cpHashSet.o */, + 15CBA1B5196EE66E005877BB /* cpHashSet.o.d */, + 15CBA1B6196EE66E005877BB /* cpPolyShape.o */, + 15CBA1B7196EE66E005877BB /* cpPolyShape.o.d */, + 15CBA1B8196EE66E005877BB /* cpShape.o */, + 15CBA1B9196EE66E005877BB /* cpShape.o.d */, + 15CBA1BA196EE66E005877BB /* cpSpace.o */, + 15CBA1BB196EE66E005877BB /* cpSpace.o.d */, + 15CBA1BC196EE66E005877BB /* cpSpaceComponent.o */, + 15CBA1BD196EE66E005877BB /* cpSpaceComponent.o.d */, + 15CBA1BE196EE66E005877BB /* cpSpaceHash.o */, + 15CBA1BF196EE66E005877BB /* cpSpaceHash.o.d */, + 15CBA1C0196EE66E005877BB /* cpSpaceQuery.o */, + 15CBA1C1196EE66E005877BB /* cpSpaceQuery.o.d */, + 15CBA1C2196EE66E005877BB /* cpSpaceStep.o */, + 15CBA1C3196EE66E005877BB /* cpSpaceStep.o.d */, + 15CBA1C4196EE66E005877BB /* cpSpatialIndex.o */, + 15CBA1C5196EE66E005877BB /* cpSpatialIndex.o.d */, + 15CBA1C6196EE66E005877BB /* cpSweep1D.o */, + 15CBA1C7196EE66E005877BB /* cpSweep1D.o.d */, + 15CBA1C8196EE66E005877BB /* cpVect.o */, + 15CBA1C9196EE66E005877BB /* cpVect.o.d */, + ); + path = src; + sourceTree = ""; + }; + 15CBA191196EE66E005877BB /* constraints */ = { + isa = PBXGroup; + children = ( + 15CBA192196EE66E005877BB /* cpConstraint.o */, + 15CBA193196EE66E005877BB /* cpConstraint.o.d */, + 15CBA194196EE66E005877BB /* cpDampedRotarySpring.o */, + 15CBA195196EE66E005877BB /* cpDampedRotarySpring.o.d */, + 15CBA196196EE66E005877BB /* cpDampedSpring.o */, + 15CBA197196EE66E005877BB /* cpDampedSpring.o.d */, + 15CBA198196EE66E005877BB /* cpGearJoint.o */, + 15CBA199196EE66E005877BB /* cpGearJoint.o.d */, + 15CBA19A196EE66E005877BB /* cpGrooveJoint.o */, + 15CBA19B196EE66E005877BB /* cpGrooveJoint.o.d */, + 15CBA19C196EE66E005877BB /* cpPinJoint.o */, + 15CBA19D196EE66E005877BB /* cpPinJoint.o.d */, + 15CBA19E196EE66E005877BB /* cpPivotJoint.o */, + 15CBA19F196EE66E005877BB /* cpPivotJoint.o.d */, + 15CBA1A0196EE66E005877BB /* cpRatchetJoint.o */, + 15CBA1A1196EE66E005877BB /* cpRatchetJoint.o.d */, + 15CBA1A2196EE66E005877BB /* cpRotaryLimitJoint.o */, + 15CBA1A3196EE66E005877BB /* cpRotaryLimitJoint.o.d */, + 15CBA1A4196EE66E005877BB /* cpSimpleMotor.o */, + 15CBA1A5196EE66E005877BB /* cpSimpleMotor.o.d */, + 15CBA1A6196EE66E005877BB /* cpSlideJoint.o */, + 15CBA1A7196EE66E005877BB /* cpSlideJoint.o.d */, + ); + path = constraints; + sourceTree = ""; + }; + 15CBA1CA196EE66E005877BB /* cocos2dx_static */ = { + isa = PBXGroup; + children = ( + 15CBA1CB196EE66E005877BB /* 2d */, + 15CBA24E196EE66F005877BB /* 3d */, + 15CBA261196EE66F005877BB /* __ */, + 15CBA276196EE66F005877BB /* base */, + 15CBA2D5196EE66F005877BB /* cocos2d.o */, + 15CBA2D6196EE66F005877BB /* cocos2d.o.d */, + 15CBA2D7196EE66F005877BB /* deprecated */, + 15CBA2E4196EE66F005877BB /* math */, + 15CBA2F9196EE66F005877BB /* physics */, + 15CBA30F196EE66F005877BB /* platform */, + 15CBA31A196EE66F005877BB /* renderer */, + ); + path = cocos2dx_static; + sourceTree = ""; + }; + 15CBA1CB196EE66E005877BB /* 2d */ = { + isa = PBXGroup; + children = ( + 15CBA1CC196EE66E005877BB /* CCAction.o */, + 15CBA1CD196EE66E005877BB /* CCAction.o.d */, + 15CBA1CE196EE66E005877BB /* CCActionCamera.o */, + 15CBA1CF196EE66E005877BB /* CCActionCamera.o.d */, + 15CBA1D0196EE66E005877BB /* CCActionCatmullRom.o */, + 15CBA1D1196EE66E005877BB /* CCActionCatmullRom.o.d */, + 15CBA1D2196EE66E005877BB /* CCActionEase.o */, + 15CBA1D3196EE66E005877BB /* CCActionEase.o.d */, + 15CBA1D4196EE66E005877BB /* CCActionGrid.o */, + 15CBA1D5196EE66E005877BB /* CCActionGrid.o.d */, + 15CBA1D6196EE66E005877BB /* CCActionGrid3D.o */, + 15CBA1D7196EE66E005877BB /* CCActionGrid3D.o.d */, + 15CBA1D8196EE66E005877BB /* CCActionInstant.o */, + 15CBA1D9196EE66E005877BB /* CCActionInstant.o.d */, + 15CBA1DA196EE66E005877BB /* CCActionInterval.o */, + 15CBA1DB196EE66E005877BB /* CCActionInterval.o.d */, + 15CBA1DC196EE66E005877BB /* CCActionManager.o */, + 15CBA1DD196EE66E005877BB /* CCActionManager.o.d */, + 15CBA1DE196EE66E005877BB /* CCActionPageTurn3D.o */, + 15CBA1DF196EE66E005877BB /* CCActionPageTurn3D.o.d */, + 15CBA1E0196EE66E005877BB /* CCActionProgressTimer.o */, + 15CBA1E1196EE66E005877BB /* CCActionProgressTimer.o.d */, + 15CBA1E2196EE66E005877BB /* CCActionTiledGrid.o */, + 15CBA1E3196EE66E005877BB /* CCActionTiledGrid.o.d */, + 15CBA1E4196EE66E005877BB /* CCActionTween.o */, + 15CBA1E5196EE66E005877BB /* CCActionTween.o.d */, + 15CBA1E6196EE66E005877BB /* CCAnimation.o */, + 15CBA1E7196EE66E005877BB /* CCAnimation.o.d */, + 15CBA1E8196EE66E005877BB /* CCAnimationCache.o */, + 15CBA1E9196EE66E005877BB /* CCAnimationCache.o.d */, + 15CBA1EA196EE66E005877BB /* CCAtlasNode.o */, + 15CBA1EB196EE66E005877BB /* CCAtlasNode.o.d */, + 15CBA1EC196EE66E005877BB /* CCClippingNode.o */, + 15CBA1ED196EE66E005877BB /* CCClippingNode.o.d */, + 15CBA1EE196EE66E005877BB /* CCComponent.o */, + 15CBA1EF196EE66E005877BB /* CCComponent.o.d */, + 15CBA1F0196EE66E005877BB /* CCComponentContainer.o */, + 15CBA1F1196EE66E005877BB /* CCComponentContainer.o.d */, + 15CBA1F2196EE66E005877BB /* CCDrawingPrimitives.o */, + 15CBA1F3196EE66E005877BB /* CCDrawingPrimitives.o.d */, + 15CBA1F4196EE66E005877BB /* CCDrawNode.o */, + 15CBA1F5196EE66E005877BB /* CCDrawNode.o.d */, + 15CBA1F6196EE66E005877BB /* CCFastTMXLayer.o */, + 15CBA1F7196EE66E005877BB /* CCFastTMXLayer.o.d */, + 15CBA1F8196EE66E005877BB /* CCFastTMXTiledMap.o */, + 15CBA1F9196EE66E005877BB /* CCFastTMXTiledMap.o.d */, + 15CBA1FA196EE66E005877BB /* CCFont.o */, + 15CBA1FB196EE66E005877BB /* CCFont.o.d */, + 15CBA1FC196EE66E005877BB /* CCFontAtlas.o */, + 15CBA1FD196EE66E005877BB /* CCFontAtlas.o.d */, + 15CBA1FE196EE66E005877BB /* CCFontAtlasCache.o */, + 15CBA1FF196EE66E005877BB /* CCFontAtlasCache.o.d */, + 15CBA200196EE66E005877BB /* CCFontCharMap.o */, + 15CBA201196EE66E005877BB /* CCFontCharMap.o.d */, + 15CBA202196EE66E005877BB /* CCFontFNT.o */, + 15CBA203196EE66E005877BB /* CCFontFNT.o.d */, + 15CBA204196EE66E005877BB /* CCFontFreeType.o */, + 15CBA205196EE66E005877BB /* CCFontFreeType.o.d */, + 15CBA206196EE66E005877BB /* CCGLBufferedNode.o */, + 15CBA207196EE66E005877BB /* CCGLBufferedNode.o.d */, + 15CBA208196EE66E005877BB /* CCGrabber.o */, + 15CBA209196EE66E005877BB /* CCGrabber.o.d */, + 15CBA20A196EE66E005877BB /* CCGrid.o */, + 15CBA20B196EE66E005877BB /* CCGrid.o.d */, + 15CBA20C196EE66E005877BB /* CCLabel.o */, + 15CBA20D196EE66E005877BB /* CCLabel.o.d */, + 15CBA20E196EE66E005877BB /* CCLabelAtlas.o */, + 15CBA20F196EE66E005877BB /* CCLabelAtlas.o.d */, + 15CBA210196EE66E005877BB /* CCLabelBMFont.o */, + 15CBA211196EE66E005877BB /* CCLabelBMFont.o.d */, + 15CBA212196EE66E005877BB /* CCLabelTextFormatter.o */, + 15CBA213196EE66E005877BB /* CCLabelTextFormatter.o.d */, + 15CBA214196EE66E005877BB /* CCLabelTTF.o */, + 15CBA215196EE66E005877BB /* CCLabelTTF.o.d */, + 15CBA216196EE66E005877BB /* CCLayer.o */, + 15CBA217196EE66E005877BB /* CCLayer.o.d */, + 15CBA218196EE66E005877BB /* CCMenu.o */, + 15CBA219196EE66E005877BB /* CCMenu.o.d */, + 15CBA21A196EE66E005877BB /* CCMenuItem.o */, + 15CBA21B196EE66E005877BB /* CCMenuItem.o.d */, + 15CBA21C196EE66E005877BB /* CCMotionStreak.o */, + 15CBA21D196EE66E005877BB /* CCMotionStreak.o.d */, + 15CBA21E196EE66E005877BB /* CCNode.o */, + 15CBA21F196EE66E005877BB /* CCNode.o.d */, + 15CBA220196EE66E005877BB /* CCNodeGrid.o */, + 15CBA221196EE66E005877BB /* CCNodeGrid.o.d */, + 15CBA222196EE66E005877BB /* CCParallaxNode.o */, + 15CBA223196EE66E005877BB /* CCParallaxNode.o.d */, + 15CBA224196EE66E005877BB /* CCParticleBatchNode.o */, + 15CBA225196EE66E005877BB /* CCParticleBatchNode.o.d */, + 15CBA226196EE66E005877BB /* CCParticleExamples.o */, + 15CBA227196EE66E005877BB /* CCParticleExamples.o.d */, + 15CBA228196EE66E005877BB /* CCParticleSystem.o */, + 15CBA229196EE66E005877BB /* CCParticleSystem.o.d */, + 15CBA22A196EE66E005877BB /* CCParticleSystemQuad.o */, + 15CBA22B196EE66E005877BB /* CCParticleSystemQuad.o.d */, + 15CBA22C196EE66E005877BB /* CCProgressTimer.o */, + 15CBA22D196EE66E005877BB /* CCProgressTimer.o.d */, + 15CBA22E196EE66E005877BB /* CCRenderTexture.o */, + 15CBA22F196EE66E005877BB /* CCRenderTexture.o.d */, + 15CBA230196EE66E005877BB /* CCScene.o */, + 15CBA231196EE66E005877BB /* CCScene.o.d */, + 15CBA232196EE66E005877BB /* CCSprite.o */, + 15CBA233196EE66E005877BB /* CCSprite.o.d */, + 15CBA234196EE66E005877BB /* CCSpriteBatchNode.o */, + 15CBA235196EE66E005877BB /* CCSpriteBatchNode.o.d */, + 15CBA236196EE66E005877BB /* CCSpriteFrame.o */, + 15CBA237196EE66E005877BB /* CCSpriteFrame.o.d */, + 15CBA238196EE66E005877BB /* CCSpriteFrameCache.o */, + 15CBA239196EE66E005877BB /* CCSpriteFrameCache.o.d */, + 15CBA23A196EE66E005877BB /* CCTextFieldTTF.o */, + 15CBA23B196EE66E005877BB /* CCTextFieldTTF.o.d */, + 15CBA23C196EE66E005877BB /* CCTileMapAtlas.o */, + 15CBA23D196EE66E005877BB /* CCTileMapAtlas.o.d */, + 15CBA23E196EE66E005877BB /* CCTMXLayer.o */, + 15CBA23F196EE66E005877BB /* CCTMXLayer.o.d */, + 15CBA240196EE66E005877BB /* CCTMXObjectGroup.o */, + 15CBA241196EE66E005877BB /* CCTMXObjectGroup.o.d */, + 15CBA242196EE66E005877BB /* CCTMXTiledMap.o */, + 15CBA243196EE66E005877BB /* CCTMXTiledMap.o.d */, + 15CBA244196EE66E005877BB /* CCTMXXMLParser.o */, + 15CBA245196EE66E005877BB /* CCTMXXMLParser.o.d */, + 15CBA246196EE66E005877BB /* CCTransition.o */, + 15CBA247196EE66E005877BB /* CCTransition.o.d */, + 15CBA248196EE66E005877BB /* CCTransitionPageTurn.o */, + 15CBA249196EE66E005877BB /* CCTransitionPageTurn.o.d */, + 15CBA24A196EE66E005877BB /* CCTransitionProgress.o */, + 15CBA24B196EE66E005877BB /* CCTransitionProgress.o.d */, + 15CBA24C196EE66F005877BB /* CCTweenFunction.o */, + 15CBA24D196EE66F005877BB /* CCTweenFunction.o.d */, + ); + path = 2d; + sourceTree = ""; + }; + 15CBA24E196EE66F005877BB /* 3d */ = { + isa = PBXGroup; + children = ( + 15CBA24F196EE66F005877BB /* CCAnimate3D.o */, + 15CBA250196EE66F005877BB /* CCAnimate3D.o.d */, + 15CBA251196EE66F005877BB /* CCAnimation3D.o */, + 15CBA252196EE66F005877BB /* CCAnimation3D.o.d */, + 15CBA253196EE66F005877BB /* CCBundle3D.o */, + 15CBA254196EE66F005877BB /* CCBundle3D.o.d */, + 15CBA255196EE66F005877BB /* CCBundleReader.o */, + 15CBA256196EE66F005877BB /* CCBundleReader.o.d */, + 15CBA257196EE66F005877BB /* CCMesh.o */, + 15CBA258196EE66F005877BB /* CCMesh.o.d */, + 15CBA259196EE66F005877BB /* CCMeshSkin.o */, + 15CBA25A196EE66F005877BB /* CCMeshSkin.o.d */, + 15CBA25B196EE66F005877BB /* CCObjLoader.o */, + 15CBA25C196EE66F005877BB /* CCObjLoader.o.d */, + 15CBA25D196EE66F005877BB /* CCSprite3D.o */, + 15CBA25E196EE66F005877BB /* CCSprite3D.o.d */, + 15CBA25F196EE66F005877BB /* CCSprite3DMaterial.o */, + 15CBA260196EE66F005877BB /* CCSprite3DMaterial.o.d */, + ); + path = 3d; + sourceTree = ""; + }; + 15CBA261196EE66F005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA262196EE66F005877BB /* external */, + ); + path = __; + sourceTree = ""; + }; + 15CBA262196EE66F005877BB /* external */ = { + isa = PBXGroup; + children = ( + 15CBA263196EE66F005877BB /* ConvertUTF */, + 15CBA268196EE66F005877BB /* edtaa3func */, + 15CBA26B196EE66F005877BB /* tinyxml2 */, + 15CBA26E196EE66F005877BB /* unzip */, + 15CBA273196EE66F005877BB /* xxhash */, + ); + path = external; + sourceTree = ""; + }; + 15CBA263196EE66F005877BB /* ConvertUTF */ = { + isa = PBXGroup; + children = ( + 15CBA264196EE66F005877BB /* ConvertUTF.o */, + 15CBA265196EE66F005877BB /* ConvertUTF.o.d */, + 15CBA266196EE66F005877BB /* ConvertUTFWrapper.o */, + 15CBA267196EE66F005877BB /* ConvertUTFWrapper.o.d */, + ); + path = ConvertUTF; + sourceTree = ""; + }; + 15CBA268196EE66F005877BB /* edtaa3func */ = { + isa = PBXGroup; + children = ( + 15CBA269196EE66F005877BB /* edtaa3func.o */, + 15CBA26A196EE66F005877BB /* edtaa3func.o.d */, + ); + path = edtaa3func; + sourceTree = ""; + }; + 15CBA26B196EE66F005877BB /* tinyxml2 */ = { + isa = PBXGroup; + children = ( + 15CBA26C196EE66F005877BB /* tinyxml2.o */, + 15CBA26D196EE66F005877BB /* tinyxml2.o.d */, + ); + path = tinyxml2; + sourceTree = ""; + }; + 15CBA26E196EE66F005877BB /* unzip */ = { + isa = PBXGroup; + children = ( + 15CBA26F196EE66F005877BB /* ioapi.o */, + 15CBA270196EE66F005877BB /* ioapi.o.d */, + 15CBA271196EE66F005877BB /* unzip.o */, + 15CBA272196EE66F005877BB /* unzip.o.d */, + ); + path = unzip; + sourceTree = ""; + }; + 15CBA273196EE66F005877BB /* xxhash */ = { + isa = PBXGroup; + children = ( + 15CBA274196EE66F005877BB /* xxhash.o */, + 15CBA275196EE66F005877BB /* xxhash.o.d */, + ); + path = xxhash; + sourceTree = ""; + }; + 15CBA276196EE66F005877BB /* base */ = { + isa = PBXGroup; + children = ( + 15CBA277196EE66F005877BB /* atitc.o */, + 15CBA278196EE66F005877BB /* atitc.o.d */, + 15CBA279196EE66F005877BB /* base64.o */, + 15CBA27A196EE66F005877BB /* base64.o.d */, + 15CBA27B196EE66F005877BB /* CCAutoreleasePool.o */, + 15CBA27C196EE66F005877BB /* CCAutoreleasePool.o.d */, + 15CBA27D196EE66F005877BB /* ccCArray.o */, + 15CBA27E196EE66F005877BB /* ccCArray.o.d */, + 15CBA27F196EE66F005877BB /* CCConfiguration.o */, + 15CBA280196EE66F005877BB /* CCConfiguration.o.d */, + 15CBA281196EE66F005877BB /* CCConsole.o */, + 15CBA282196EE66F005877BB /* CCConsole.o.d */, + 15CBA283196EE66F005877BB /* CCController-android.o */, + 15CBA284196EE66F005877BB /* CCController-android.o.d */, + 15CBA285196EE66F005877BB /* CCController.o */, + 15CBA286196EE66F005877BB /* CCController.o.d */, + 15CBA287196EE66F005877BB /* CCData.o */, + 15CBA288196EE66F005877BB /* CCData.o.d */, + 15CBA289196EE66F005877BB /* CCDataVisitor.o */, + 15CBA28A196EE66F005877BB /* CCDataVisitor.o.d */, + 15CBA28B196EE66F005877BB /* CCDirector.o */, + 15CBA28C196EE66F005877BB /* CCDirector.o.d */, + 15CBA28D196EE66F005877BB /* CCEvent.o */, + 15CBA28E196EE66F005877BB /* CCEvent.o.d */, + 15CBA28F196EE66F005877BB /* CCEventAcceleration.o */, + 15CBA290196EE66F005877BB /* CCEventAcceleration.o.d */, + 15CBA291196EE66F005877BB /* CCEventController.o */, + 15CBA292196EE66F005877BB /* CCEventController.o.d */, + 15CBA293196EE66F005877BB /* CCEventCustom.o */, + 15CBA294196EE66F005877BB /* CCEventCustom.o.d */, + 15CBA295196EE66F005877BB /* CCEventDispatcher.o */, + 15CBA296196EE66F005877BB /* CCEventDispatcher.o.d */, + 15CBA297196EE66F005877BB /* CCEventFocus.o */, + 15CBA298196EE66F005877BB /* CCEventFocus.o.d */, + 15CBA299196EE66F005877BB /* CCEventKeyboard.o */, + 15CBA29A196EE66F005877BB /* CCEventKeyboard.o.d */, + 15CBA29B196EE66F005877BB /* CCEventListener.o */, + 15CBA29C196EE66F005877BB /* CCEventListener.o.d */, + 15CBA29D196EE66F005877BB /* CCEventListenerAcceleration.o */, + 15CBA29E196EE66F005877BB /* CCEventListenerAcceleration.o.d */, + 15CBA29F196EE66F005877BB /* CCEventListenerController.o */, + 15CBA2A0196EE66F005877BB /* CCEventListenerController.o.d */, + 15CBA2A1196EE66F005877BB /* CCEventListenerCustom.o */, + 15CBA2A2196EE66F005877BB /* CCEventListenerCustom.o.d */, + 15CBA2A3196EE66F005877BB /* CCEventListenerFocus.o */, + 15CBA2A4196EE66F005877BB /* CCEventListenerFocus.o.d */, + 15CBA2A5196EE66F005877BB /* CCEventListenerKeyboard.o */, + 15CBA2A6196EE66F005877BB /* CCEventListenerKeyboard.o.d */, + 15CBA2A7196EE66F005877BB /* CCEventListenerMouse.o */, + 15CBA2A8196EE66F005877BB /* CCEventListenerMouse.o.d */, + 15CBA2A9196EE66F005877BB /* CCEventListenerTouch.o */, + 15CBA2AA196EE66F005877BB /* CCEventListenerTouch.o.d */, + 15CBA2AB196EE66F005877BB /* CCEventMouse.o */, + 15CBA2AC196EE66F005877BB /* CCEventMouse.o.d */, + 15CBA2AD196EE66F005877BB /* CCEventTouch.o */, + 15CBA2AE196EE66F005877BB /* CCEventTouch.o.d */, + 15CBA2AF196EE66F005877BB /* ccFPSImages.o */, + 15CBA2B0196EE66F005877BB /* ccFPSImages.o.d */, + 15CBA2B1196EE66F005877BB /* CCIMEDispatcher.o */, + 15CBA2B2196EE66F005877BB /* CCIMEDispatcher.o.d */, + 15CBA2B3196EE66F005877BB /* CCNS.o */, + 15CBA2B4196EE66F005877BB /* CCNS.o.d */, + 15CBA2B5196EE66F005877BB /* CCProfiling.o */, + 15CBA2B6196EE66F005877BB /* CCProfiling.o.d */, + 15CBA2B7196EE66F005877BB /* CCRef.o */, + 15CBA2B8196EE66F005877BB /* CCRef.o.d */, + 15CBA2B9196EE66F005877BB /* CCScheduler.o */, + 15CBA2BA196EE66F005877BB /* CCScheduler.o.d */, + 15CBA2BB196EE66F005877BB /* CCScriptSupport.o */, + 15CBA2BC196EE66F005877BB /* CCScriptSupport.o.d */, + 15CBA2BD196EE66F005877BB /* CCTouch.o */, + 15CBA2BE196EE66F005877BB /* CCTouch.o.d */, + 15CBA2BF196EE66F005877BB /* ccTypes.o */, + 15CBA2C0196EE66F005877BB /* ccTypes.o.d */, + 15CBA2C1196EE66F005877BB /* CCUserDefault.o */, + 15CBA2C2196EE66F005877BB /* CCUserDefault.o.d */, + 15CBA2C3196EE66F005877BB /* CCUserDefaultAndroid.o */, + 15CBA2C4196EE66F005877BB /* CCUserDefaultAndroid.o.d */, + 15CBA2C5196EE66F005877BB /* ccUTF8.o */, + 15CBA2C6196EE66F005877BB /* ccUTF8.o.d */, + 15CBA2C7196EE66F005877BB /* ccUtils.o */, + 15CBA2C8196EE66F005877BB /* ccUtils.o.d */, + 15CBA2C9196EE66F005877BB /* CCValue.o */, + 15CBA2CA196EE66F005877BB /* CCValue.o.d */, + 15CBA2CB196EE66F005877BB /* etc1.o */, + 15CBA2CC196EE66F005877BB /* etc1.o.d */, + 15CBA2CD196EE66F005877BB /* ObjectFactory.o */, + 15CBA2CE196EE66F005877BB /* ObjectFactory.o.d */, + 15CBA2CF196EE66F005877BB /* s3tc.o */, + 15CBA2D0196EE66F005877BB /* s3tc.o.d */, + 15CBA2D1196EE66F005877BB /* TGAlib.o */, + 15CBA2D2196EE66F005877BB /* TGAlib.o.d */, + 15CBA2D3196EE66F005877BB /* ZipUtils.o */, + 15CBA2D4196EE66F005877BB /* ZipUtils.o.d */, + ); + path = base; + sourceTree = ""; + }; + 15CBA2D7196EE66F005877BB /* deprecated */ = { + isa = PBXGroup; + children = ( + 15CBA2D8196EE66F005877BB /* CCArray.o */, + 15CBA2D9196EE66F005877BB /* CCArray.o.d */, + 15CBA2DA196EE66F005877BB /* CCDeprecated.o */, + 15CBA2DB196EE66F005877BB /* CCDeprecated.o.d */, + 15CBA2DC196EE66F005877BB /* CCDictionary.o */, + 15CBA2DD196EE66F005877BB /* CCDictionary.o.d */, + 15CBA2DE196EE66F005877BB /* CCNotificationCenter.o */, + 15CBA2DF196EE66F005877BB /* CCNotificationCenter.o.d */, + 15CBA2E0196EE66F005877BB /* CCSet.o */, + 15CBA2E1196EE66F005877BB /* CCSet.o.d */, + 15CBA2E2196EE66F005877BB /* CCString.o */, + 15CBA2E3196EE66F005877BB /* CCString.o.d */, + ); + path = deprecated; + sourceTree = ""; + }; + 15CBA2E4196EE66F005877BB /* math */ = { + isa = PBXGroup; + children = ( + 15CBA2E5196EE66F005877BB /* CCAffineTransform.o */, + 15CBA2E6196EE66F005877BB /* CCAffineTransform.o.d */, + 15CBA2E7196EE66F005877BB /* CCGeometry.o */, + 15CBA2E8196EE66F005877BB /* CCGeometry.o.d */, + 15CBA2E9196EE66F005877BB /* CCVertex.o */, + 15CBA2EA196EE66F005877BB /* CCVertex.o.d */, + 15CBA2EB196EE66F005877BB /* Mat4.o */, + 15CBA2EC196EE66F005877BB /* Mat4.o.d */, + 15CBA2ED196EE66F005877BB /* MathUtil.o */, + 15CBA2EE196EE66F005877BB /* MathUtil.o.d */, + 15CBA2EF196EE66F005877BB /* Quaternion.o */, + 15CBA2F0196EE66F005877BB /* Quaternion.o.d */, + 15CBA2F1196EE66F005877BB /* TransformUtils.o */, + 15CBA2F2196EE66F005877BB /* TransformUtils.o.d */, + 15CBA2F3196EE66F005877BB /* Vec2.o */, + 15CBA2F4196EE66F005877BB /* Vec2.o.d */, + 15CBA2F5196EE66F005877BB /* Vec3.o */, + 15CBA2F6196EE66F005877BB /* Vec3.o.d */, + 15CBA2F7196EE66F005877BB /* Vec4.o */, + 15CBA2F8196EE66F005877BB /* Vec4.o.d */, + ); + path = math; + sourceTree = ""; + }; + 15CBA2F9196EE66F005877BB /* physics */ = { + isa = PBXGroup; + children = ( + 15CBA2FA196EE66F005877BB /* CCPhysicsBody.o */, + 15CBA2FB196EE66F005877BB /* CCPhysicsBody.o.d */, + 15CBA2FC196EE66F005877BB /* CCPhysicsContact.o */, + 15CBA2FD196EE66F005877BB /* CCPhysicsContact.o.d */, + 15CBA2FE196EE66F005877BB /* CCPhysicsJoint.o */, + 15CBA2FF196EE66F005877BB /* CCPhysicsJoint.o.d */, + 15CBA300196EE66F005877BB /* CCPhysicsShape.o */, + 15CBA301196EE66F005877BB /* CCPhysicsShape.o.d */, + 15CBA302196EE66F005877BB /* CCPhysicsWorld.o */, + 15CBA303196EE66F005877BB /* CCPhysicsWorld.o.d */, + 15CBA304196EE66F005877BB /* chipmunk */, + ); + path = physics; + sourceTree = ""; + }; + 15CBA304196EE66F005877BB /* chipmunk */ = { + isa = PBXGroup; + children = ( + 15CBA305196EE66F005877BB /* CCPhysicsBodyInfo_chipmunk.o */, + 15CBA306196EE66F005877BB /* CCPhysicsBodyInfo_chipmunk.o.d */, + 15CBA307196EE66F005877BB /* CCPhysicsContactInfo_chipmunk.o */, + 15CBA308196EE66F005877BB /* CCPhysicsContactInfo_chipmunk.o.d */, + 15CBA309196EE66F005877BB /* CCPhysicsJointInfo_chipmunk.o */, + 15CBA30A196EE66F005877BB /* CCPhysicsJointInfo_chipmunk.o.d */, + 15CBA30B196EE66F005877BB /* CCPhysicsShapeInfo_chipmunk.o */, + 15CBA30C196EE66F005877BB /* CCPhysicsShapeInfo_chipmunk.o.d */, + 15CBA30D196EE66F005877BB /* CCPhysicsWorldInfo_chipmunk.o */, + 15CBA30E196EE66F005877BB /* CCPhysicsWorldInfo_chipmunk.o.d */, + ); + path = chipmunk; + sourceTree = ""; + }; + 15CBA30F196EE66F005877BB /* platform */ = { + isa = PBXGroup; + children = ( + 15CBA310196EE66F005877BB /* CCFileUtils.o */, + 15CBA311196EE66F005877BB /* CCFileUtils.o.d */, + 15CBA312196EE66F005877BB /* CCGLViewProtocol.o */, + 15CBA313196EE66F005877BB /* CCGLViewProtocol.o.d */, + 15CBA314196EE66F005877BB /* CCImage.o */, + 15CBA315196EE66F005877BB /* CCImage.o.d */, + 15CBA316196EE66F005877BB /* CCSAXParser.o */, + 15CBA317196EE66F005877BB /* CCSAXParser.o.d */, + 15CBA318196EE66F005877BB /* CCThread.o */, + 15CBA319196EE66F005877BB /* CCThread.o.d */, + ); + path = platform; + sourceTree = ""; + }; + 15CBA31A196EE66F005877BB /* renderer */ = { + isa = PBXGroup; + children = ( + 15CBA31B196EE66F005877BB /* CCBatchCommand.o */, + 15CBA31C196EE66F005877BB /* CCBatchCommand.o.d */, + 15CBA31D196EE66F005877BB /* CCCustomCommand.o */, + 15CBA31E196EE66F005877BB /* CCCustomCommand.o.d */, + 15CBA31F196EE66F005877BB /* CCGLProgram.o */, + 15CBA320196EE66F005877BB /* CCGLProgram.o.d */, + 15CBA321196EE66F005877BB /* CCGLProgramCache.o */, + 15CBA322196EE66F005877BB /* CCGLProgramCache.o.d */, + 15CBA323196EE66F005877BB /* CCGLProgramState.o */, + 15CBA324196EE66F005877BB /* CCGLProgramState.o.d */, + 15CBA325196EE66F005877BB /* CCGLProgramStateCache.o */, + 15CBA326196EE66F005877BB /* CCGLProgramStateCache.o.d */, + 15CBA327196EE66F005877BB /* ccGLStateCache.o */, + 15CBA328196EE66F005877BB /* ccGLStateCache.o.d */, + 15CBA329196EE66F005877BB /* CCGroupCommand.o */, + 15CBA32A196EE66F005877BB /* CCGroupCommand.o.d */, + 15CBA32B196EE66F005877BB /* CCMeshCommand.o */, + 15CBA32C196EE66F005877BB /* CCMeshCommand.o.d */, + 15CBA32D196EE66F005877BB /* CCQuadCommand.o */, + 15CBA32E196EE66F005877BB /* CCQuadCommand.o.d */, + 15CBA32F196EE66F005877BB /* CCRenderCommand.o */, + 15CBA330196EE66F005877BB /* CCRenderCommand.o.d */, + 15CBA331196EE66F005877BB /* CCRenderer.o */, + 15CBA332196EE66F005877BB /* CCRenderer.o.d */, + 15CBA333196EE66F005877BB /* ccShaders.o */, + 15CBA334196EE66F005877BB /* ccShaders.o.d */, + 15CBA335196EE66F005877BB /* CCTexture2D.o */, + 15CBA336196EE66F005877BB /* CCTexture2D.o.d */, + 15CBA337196EE66F005877BB /* CCTextureAtlas.o */, + 15CBA338196EE66F005877BB /* CCTextureAtlas.o.d */, + 15CBA339196EE66F005877BB /* CCTextureCache.o */, + 15CBA33A196EE66F005877BB /* CCTextureCache.o.d */, + ); + path = renderer; + sourceTree = ""; + }; + 15CBA33B196EE66F005877BB /* cocos2dxandroid_static */ = { + isa = PBXGroup; + children = ( + 15CBA33C196EE66F005877BB /* CCApplication.o */, + 15CBA33D196EE66F005877BB /* CCApplication.o.d */, + 15CBA33E196EE66F005877BB /* CCCommon.o */, + 15CBA33F196EE66F005877BB /* CCCommon.o.d */, + 15CBA340196EE66F005877BB /* CCDevice.o */, + 15CBA341196EE66F005877BB /* CCDevice.o.d */, + 15CBA342196EE66F005877BB /* CCFileUtilsAndroid.o */, + 15CBA343196EE66F005877BB /* CCFileUtilsAndroid.o.d */, + 15CBA344196EE66F005877BB /* CCGLView.o */, + 15CBA345196EE66F005877BB /* CCGLView.o.d */, + 15CBA346196EE66F005877BB /* javaactivity.o */, + 15CBA347196EE66F005877BB /* javaactivity.o.d */, + 15CBA348196EE66F005877BB /* jni */, + ); + path = cocos2dxandroid_static; + sourceTree = ""; + }; + 15CBA348196EE66F005877BB /* jni */ = { + isa = PBXGroup; + children = ( + 15CBA349196EE66F005877BB /* DPIJni.o */, + 15CBA34A196EE66F005877BB /* DPIJni.o.d */, + 15CBA34B196EE66F005877BB /* IMEJni.o */, + 15CBA34C196EE66F005877BB /* IMEJni.o.d */, + 15CBA34D196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o */, + 15CBA34E196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxAccelerometer.o.d */, + 15CBA34F196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxBitmap.o */, + 15CBA350196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxBitmap.o.d */, + 15CBA351196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxHelper.o */, + 15CBA352196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxHelper.o.d */, + 15CBA353196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxRenderer.o */, + 15CBA354196EE66F005877BB /* Java_org_cocos2dx_lib_Cocos2dxRenderer.o.d */, + 15CBA355196EE66F005877BB /* JniHelper.o */, + 15CBA356196EE66F005877BB /* JniHelper.o.d */, + 15CBA357196EE66F005877BB /* TouchesJni.o */, + 15CBA358196EE66F005877BB /* TouchesJni.o.d */, + ); + path = jni; + sourceTree = ""; + }; + 15CBA359196EE66F005877BB /* cocos_extension_static */ = { + isa = PBXGroup; + children = ( + 15CBA35A196EE66F005877BB /* assets-manager */, + 15CBA35D196EE66F005877BB /* GUI */, + 15CBA387196EE66F005877BB /* physics-nodes */, + ); + path = cocos_extension_static; + sourceTree = ""; + }; + 15CBA35A196EE66F005877BB /* assets-manager */ = { + isa = PBXGroup; + children = ( + 15CBA35B196EE66F005877BB /* AssetsManager.o */, + 15CBA35C196EE66F005877BB /* AssetsManager.o.d */, + ); + path = "assets-manager"; + sourceTree = ""; + }; + 15CBA35D196EE66F005877BB /* GUI */ = { + isa = PBXGroup; + children = ( + 15CBA35E196EE66F005877BB /* CCControlExtension */, + 15CBA377196EE66F005877BB /* CCEditBox */, + 15CBA380196EE66F005877BB /* CCScrollView */, + ); + path = GUI; + sourceTree = ""; + }; + 15CBA35E196EE66F005877BB /* CCControlExtension */ = { + isa = PBXGroup; + children = ( + 15CBA35F196EE66F005877BB /* CCControl.o */, + 15CBA360196EE66F005877BB /* CCControl.o.d */, + 15CBA361196EE66F005877BB /* CCControlButton.o */, + 15CBA362196EE66F005877BB /* CCControlButton.o.d */, + 15CBA363196EE66F005877BB /* CCControlColourPicker.o */, + 15CBA364196EE66F005877BB /* CCControlColourPicker.o.d */, + 15CBA365196EE66F005877BB /* CCControlHuePicker.o */, + 15CBA366196EE66F005877BB /* CCControlHuePicker.o.d */, + 15CBA367196EE66F005877BB /* CCControlPotentiometer.o */, + 15CBA368196EE66F005877BB /* CCControlPotentiometer.o.d */, + 15CBA369196EE66F005877BB /* CCControlSaturationBrightnessPicker.o */, + 15CBA36A196EE66F005877BB /* CCControlSaturationBrightnessPicker.o.d */, + 15CBA36B196EE66F005877BB /* CCControlSlider.o */, + 15CBA36C196EE66F005877BB /* CCControlSlider.o.d */, + 15CBA36D196EE66F005877BB /* CCControlStepper.o */, + 15CBA36E196EE66F005877BB /* CCControlStepper.o.d */, + 15CBA36F196EE66F005877BB /* CCControlSwitch.o */, + 15CBA370196EE66F005877BB /* CCControlSwitch.o.d */, + 15CBA371196EE66F005877BB /* CCControlUtils.o */, + 15CBA372196EE66F005877BB /* CCControlUtils.o.d */, + 15CBA373196EE66F005877BB /* CCInvocation.o */, + 15CBA374196EE66F005877BB /* CCInvocation.o.d */, + 15CBA375196EE66F005877BB /* CCScale9Sprite.o */, + 15CBA376196EE66F005877BB /* CCScale9Sprite.o.d */, + ); + path = CCControlExtension; + sourceTree = ""; + }; + 15CBA377196EE66F005877BB /* CCEditBox */ = { + isa = PBXGroup; + children = ( + 15CBA378196EE66F005877BB /* CCEditBox.o */, + 15CBA379196EE66F005877BB /* CCEditBox.o.d */, + 15CBA37A196EE66F005877BB /* CCEditBoxImplAndroid.o */, + 15CBA37B196EE66F005877BB /* CCEditBoxImplAndroid.o.d */, + 15CBA37C196EE66F005877BB /* CCEditBoxImplNone.o */, + 15CBA37D196EE66F005877BB /* CCEditBoxImplNone.o.d */, + 15CBA37E196EE66F005877BB /* CCEditBoxImplWin.o */, + 15CBA37F196EE66F005877BB /* CCEditBoxImplWin.o.d */, + ); + path = CCEditBox; + sourceTree = ""; + }; + 15CBA380196EE66F005877BB /* CCScrollView */ = { + isa = PBXGroup; + children = ( + 15CBA381196EE66F005877BB /* CCScrollView.o */, + 15CBA382196EE66F005877BB /* CCScrollView.o.d */, + 15CBA383196EE66F005877BB /* CCTableView.o */, + 15CBA384196EE66F005877BB /* CCTableView.o.d */, + 15CBA385196EE66F005877BB /* CCTableViewCell.o */, + 15CBA386196EE66F005877BB /* CCTableViewCell.o.d */, + ); + path = CCScrollView; + sourceTree = ""; + }; + 15CBA387196EE66F005877BB /* physics-nodes */ = { + isa = PBXGroup; + children = ( + 15CBA388196EE66F005877BB /* CCPhysicsDebugNode.o */, + 15CBA389196EE66F005877BB /* CCPhysicsDebugNode.o.d */, + 15CBA38A196EE66F005877BB /* CCPhysicsSprite.o */, + 15CBA38B196EE66F005877BB /* CCPhysicsSprite.o.d */, + ); + path = "physics-nodes"; + sourceTree = ""; + }; + 15CBA38C196EE66F005877BB /* cocos_lua_static */ = { + isa = PBXGroup; + children = ( + 15CBA38D196EE66F005877BB /* __ */, + 15CBA3BF196EE670005877BB /* auto */, + 15CBA3CE196EE670005877BB /* manual */, + ); + path = cocos_lua_static; + sourceTree = ""; + }; + 15CBA38D196EE66F005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA38E196EE66F005877BB /* __ */, + ); + path = __; + sourceTree = ""; + }; + 15CBA38E196EE66F005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA38F196EE66F005877BB /* __ */, + ); + path = __; + sourceTree = ""; + }; + 15CBA38F196EE66F005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA390196EE66F005877BB /* external */, + ); + path = __; + sourceTree = ""; + }; + 15CBA390196EE66F005877BB /* external */ = { + isa = PBXGroup; + children = ( + 15CBA391196EE66F005877BB /* lua */, + 15CBA3BC196EE670005877BB /* xxtea */, + ); + path = external; + sourceTree = ""; + }; + 15CBA391196EE66F005877BB /* lua */ = { + isa = PBXGroup; + children = ( + 15CBA392196EE66F005877BB /* luasocket */, + 15CBA3B1196EE670005877BB /* tolua */, + ); + path = lua; + sourceTree = ""; + }; + 15CBA392196EE66F005877BB /* luasocket */ = { + isa = PBXGroup; + children = ( + 15CBA393196EE66F005877BB /* auxiliar.o */, + 15CBA394196EE670005877BB /* auxiliar.o.d */, + 15CBA395196EE670005877BB /* buffer.o */, + 15CBA396196EE670005877BB /* buffer.o.d */, + 15CBA397196EE670005877BB /* except.o */, + 15CBA398196EE670005877BB /* except.o.d */, + 15CBA399196EE670005877BB /* inet.o */, + 15CBA39A196EE670005877BB /* inet.o.d */, + 15CBA39B196EE670005877BB /* io.o */, + 15CBA39C196EE670005877BB /* io.o.d */, + 15CBA39D196EE670005877BB /* luasocket.o */, + 15CBA39E196EE670005877BB /* luasocket.o.d */, + 15CBA39F196EE670005877BB /* mime.o */, + 15CBA3A0196EE670005877BB /* mime.o.d */, + 15CBA3A1196EE670005877BB /* options.o */, + 15CBA3A2196EE670005877BB /* options.o.d */, + 15CBA3A3196EE670005877BB /* select.o */, + 15CBA3A4196EE670005877BB /* select.o.d */, + 15CBA3A5196EE670005877BB /* serial.o */, + 15CBA3A6196EE670005877BB /* serial.o.d */, + 15CBA3A7196EE670005877BB /* tcp.o */, + 15CBA3A8196EE670005877BB /* tcp.o.d */, + 15CBA3A9196EE670005877BB /* timeout.o */, + 15CBA3AA196EE670005877BB /* timeout.o.d */, + 15CBA3AB196EE670005877BB /* udp.o */, + 15CBA3AC196EE670005877BB /* udp.o.d */, + 15CBA3AD196EE670005877BB /* unix.o */, + 15CBA3AE196EE670005877BB /* unix.o.d */, + 15CBA3AF196EE670005877BB /* usocket.o */, + 15CBA3B0196EE670005877BB /* usocket.o.d */, + ); + path = luasocket; + sourceTree = ""; + }; + 15CBA3B1196EE670005877BB /* tolua */ = { + isa = PBXGroup; + children = ( + 15CBA3B2196EE670005877BB /* tolua_event.o */, + 15CBA3B3196EE670005877BB /* tolua_event.o.d */, + 15CBA3B4196EE670005877BB /* tolua_is.o */, + 15CBA3B5196EE670005877BB /* tolua_is.o.d */, + 15CBA3B6196EE670005877BB /* tolua_map.o */, + 15CBA3B7196EE670005877BB /* tolua_map.o.d */, + 15CBA3B8196EE670005877BB /* tolua_push.o */, + 15CBA3B9196EE670005877BB /* tolua_push.o.d */, + 15CBA3BA196EE670005877BB /* tolua_to.o */, + 15CBA3BB196EE670005877BB /* tolua_to.o.d */, + ); + path = tolua; + sourceTree = ""; + }; + 15CBA3BC196EE670005877BB /* xxtea */ = { + isa = PBXGroup; + children = ( + 15CBA3BD196EE670005877BB /* xxtea.o */, + 15CBA3BE196EE670005877BB /* xxtea.o.d */, + ); + path = xxtea; + sourceTree = ""; + }; + 15CBA3BF196EE670005877BB /* auto */ = { + isa = PBXGroup; + children = ( + 15CBA3C0196EE670005877BB /* lua_cocos2dx_auto.o */, + 15CBA3C1196EE670005877BB /* lua_cocos2dx_auto.o.d */, + 15CBA3C2196EE670005877BB /* lua_cocos2dx_controller_auto.o */, + 15CBA3C3196EE670005877BB /* lua_cocos2dx_controller_auto.o.d */, + 15CBA3C4196EE670005877BB /* lua_cocos2dx_extension_auto.o */, + 15CBA3C5196EE670005877BB /* lua_cocos2dx_extension_auto.o.d */, + 15CBA3C6196EE670005877BB /* lua_cocos2dx_physics_auto.o */, + 15CBA3C7196EE670005877BB /* lua_cocos2dx_physics_auto.o.d */, + 15CBA3C8196EE670005877BB /* lua_cocos2dx_spine_auto.o */, + 15CBA3C9196EE670005877BB /* lua_cocos2dx_spine_auto.o.d */, + 15CBA3CA196EE670005877BB /* lua_cocos2dx_studio_auto.o */, + 15CBA3CB196EE670005877BB /* lua_cocos2dx_studio_auto.o.d */, + 15CBA3CC196EE670005877BB /* lua_cocos2dx_ui_auto.o */, + 15CBA3CD196EE670005877BB /* lua_cocos2dx_ui_auto.o.d */, + ); + path = auto; + sourceTree = ""; + }; + 15CBA3CE196EE670005877BB /* manual */ = { + isa = PBXGroup; + children = ( + 15CBA3CF196EE670005877BB /* CCBProxy.o */, + 15CBA3D0196EE670005877BB /* CCBProxy.o.d */, + 15CBA3D1196EE670005877BB /* CCLuaBridge.o */, + 15CBA3D2196EE670005877BB /* CCLuaBridge.o.d */, + 15CBA3D3196EE670005877BB /* CCLuaEngine.o */, + 15CBA3D4196EE670005877BB /* CCLuaEngine.o.d */, + 15CBA3D5196EE670005877BB /* CCLuaStack.o */, + 15CBA3D6196EE670005877BB /* CCLuaStack.o.d */, + 15CBA3D7196EE670005877BB /* CCLuaValue.o */, + 15CBA3D8196EE670005877BB /* CCLuaValue.o.d */, + 15CBA3D9196EE670005877BB /* Cocos2dxLuaLoader.o */, + 15CBA3DA196EE670005877BB /* Cocos2dxLuaLoader.o.d */, + 15CBA3DB196EE670005877BB /* lua_cocos2dx_coco_studio_manual.o */, + 15CBA3DC196EE670005877BB /* lua_cocos2dx_coco_studio_manual.o.d */, + 15CBA3DD196EE670005877BB /* lua_cocos2dx_controller_manual.o */, + 15CBA3DE196EE670005877BB /* lua_cocos2dx_controller_manual.o.d */, + 15CBA3DF196EE670005877BB /* lua_cocos2dx_deprecated.o */, + 15CBA3E0196EE670005877BB /* lua_cocos2dx_deprecated.o.d */, + 15CBA3E1196EE670005877BB /* lua_cocos2dx_extension_manual.o */, + 15CBA3E2196EE670005877BB /* lua_cocos2dx_extension_manual.o.d */, + 15CBA3E3196EE670005877BB /* lua_cocos2dx_manual.o */, + 15CBA3E4196EE670005877BB /* lua_cocos2dx_manual.o.d */, + 15CBA3E5196EE670005877BB /* lua_cocos2dx_physics_manual.o */, + 15CBA3E6196EE670005877BB /* lua_cocos2dx_physics_manual.o.d */, + 15CBA3E7196EE670005877BB /* lua_cocos2dx_spine_manual.o */, + 15CBA3E8196EE670005877BB /* lua_cocos2dx_spine_manual.o.d */, + 15CBA3E9196EE670005877BB /* lua_cocos2dx_ui_manual.o */, + 15CBA3EA196EE670005877BB /* lua_cocos2dx_ui_manual.o.d */, + 15CBA3EB196EE670005877BB /* lua_debugger.o */, + 15CBA3EC196EE670005877BB /* lua_debugger.o.d */, + 15CBA3ED196EE670005877BB /* lua_extensions.o */, + 15CBA3EE196EE670005877BB /* lua_extensions.o.d */, + 15CBA3EF196EE670005877BB /* Lua_web_socket.o */, + 15CBA3F0196EE670005877BB /* Lua_web_socket.o.d */, + 15CBA3F1196EE670005877BB /* lua_xml_http_request.o */, + 15CBA3F2196EE670005877BB /* lua_xml_http_request.o.d */, + 15CBA3F3196EE670005877BB /* LuaBasicConversions.o */, + 15CBA3F4196EE670005877BB /* LuaBasicConversions.o.d */, + 15CBA3F5196EE670005877BB /* LuaOpengl.o */, + 15CBA3F6196EE670005877BB /* LuaOpengl.o.d */, + 15CBA3F7196EE670005877BB /* LuaScriptHandlerMgr.o */, + 15CBA3F8196EE670005877BB /* LuaScriptHandlerMgr.o.d */, + 15CBA3F9196EE670005877BB /* LuaSkeletonAnimation.o */, + 15CBA3FA196EE670005877BB /* LuaSkeletonAnimation.o.d */, + 15CBA3FB196EE670005877BB /* platform */, + 15CBA402196EE670005877BB /* tolua_fix.o */, + 15CBA403196EE670005877BB /* tolua_fix.o.d */, + ); + path = manual; + sourceTree = ""; + }; + 15CBA3FB196EE670005877BB /* platform */ = { + isa = PBXGroup; + children = ( + 15CBA3FC196EE670005877BB /* android */, + ); + path = platform; + sourceTree = ""; + }; + 15CBA3FC196EE670005877BB /* android */ = { + isa = PBXGroup; + children = ( + 15CBA3FD196EE670005877BB /* CCLuaJavaBridge.o */, + 15CBA3FE196EE670005877BB /* CCLuaJavaBridge.o.d */, + 15CBA3FF196EE670005877BB /* jni */, + ); + path = android; + sourceTree = ""; + }; + 15CBA3FF196EE670005877BB /* jni */ = { + isa = PBXGroup; + children = ( + 15CBA400196EE670005877BB /* Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o */, + 15CBA401196EE670005877BB /* Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.o.d */, + ); + path = jni; + sourceTree = ""; + }; + 15CBA404196EE670005877BB /* cocos_network_static */ = { + isa = PBXGroup; + children = ( + 15CBA405196EE670005877BB /* HttpClient.o */, + 15CBA406196EE670005877BB /* HttpClient.o.d */, + 15CBA407196EE670005877BB /* SocketIO.o */, + 15CBA408196EE670005877BB /* SocketIO.o.d */, + 15CBA409196EE670005877BB /* WebSocket.o */, + 15CBA40A196EE670005877BB /* WebSocket.o.d */, + ); + path = cocos_network_static; + sourceTree = ""; + }; + 15CBA40B196EE670005877BB /* cocos_ui_static */ = { + isa = PBXGroup; + children = ( + 15CBA40C196EE670005877BB /* CCProtectedNode.o */, + 15CBA40D196EE670005877BB /* CCProtectedNode.o.d */, + 15CBA40E196EE670005877BB /* CocosGUI.o */, + 15CBA40F196EE670005877BB /* CocosGUI.o.d */, + 15CBA410196EE670005877BB /* UIButton.o */, + 15CBA411196EE670005877BB /* UIButton.o.d */, + 15CBA412196EE670005877BB /* UICheckBox.o */, + 15CBA413196EE670005877BB /* UICheckBox.o.d */, + 15CBA414196EE670005877BB /* UIDeprecated.o */, + 15CBA415196EE670005877BB /* UIDeprecated.o.d */, + 15CBA416196EE670005877BB /* UIHBox.o */, + 15CBA417196EE670005877BB /* UIHBox.o.d */, + 15CBA418196EE670005877BB /* UIHelper.o */, + 15CBA419196EE670005877BB /* UIHelper.o.d */, + 15CBA41A196EE670005877BB /* UIImageView.o */, + 15CBA41B196EE670005877BB /* UIImageView.o.d */, + 15CBA41C196EE670005877BB /* UILayout.o */, + 15CBA41D196EE670005877BB /* UILayout.o.d */, + 15CBA41E196EE670005877BB /* UILayoutManager.o */, + 15CBA41F196EE670005877BB /* UILayoutManager.o.d */, + 15CBA420196EE670005877BB /* UILayoutParameter.o */, + 15CBA421196EE670005877BB /* UILayoutParameter.o.d */, + 15CBA422196EE670005877BB /* UIListView.o */, + 15CBA423196EE670005877BB /* UIListView.o.d */, + 15CBA424196EE670005877BB /* UILoadingBar.o */, + 15CBA425196EE670005877BB /* UILoadingBar.o.d */, + 15CBA426196EE670005877BB /* UIPageView.o */, + 15CBA427196EE670005877BB /* UIPageView.o.d */, + 15CBA428196EE670005877BB /* UIRelativeBox.o */, + 15CBA429196EE670005877BB /* UIRelativeBox.o.d */, + 15CBA42A196EE670005877BB /* UIRichText.o */, + 15CBA42B196EE670005877BB /* UIRichText.o.d */, + 15CBA42C196EE670005877BB /* UIScrollView.o */, + 15CBA42D196EE670005877BB /* UIScrollView.o.d */, + 15CBA42E196EE670005877BB /* UISlider.o */, + 15CBA42F196EE670005877BB /* UISlider.o.d */, + 15CBA430196EE670005877BB /* UIText.o */, + 15CBA431196EE670005877BB /* UIText.o.d */, + 15CBA432196EE670005877BB /* UITextAtlas.o */, + 15CBA433196EE670005877BB /* UITextAtlas.o.d */, + 15CBA434196EE670005877BB /* UITextBMFont.o */, + 15CBA435196EE670005877BB /* UITextBMFont.o.d */, + 15CBA436196EE670005877BB /* UITextField.o */, + 15CBA437196EE670005877BB /* UITextField.o.d */, + 15CBA438196EE670005877BB /* UIVBox.o */, + 15CBA439196EE670005877BB /* UIVBox.o.d */, + 15CBA43A196EE670005877BB /* UIVideoPlayerAndroid.o */, + 15CBA43B196EE670005877BB /* UIVideoPlayerAndroid.o.d */, + 15CBA43C196EE670005877BB /* UIWidget.o */, + 15CBA43D196EE670005877BB /* UIWidget.o.d */, + ); + path = cocos_ui_static; + sourceTree = ""; + }; + 15CBA43E196EE670005877BB /* cocosbuilder_static */ = { + isa = PBXGroup; + children = ( + 15CBA43F196EE670005877BB /* CCBAnimationManager.o */, + 15CBA440196EE670005877BB /* CCBAnimationManager.o.d */, + 15CBA441196EE670005877BB /* CCBFileLoader.o */, + 15CBA442196EE670005877BB /* CCBFileLoader.o.d */, + 15CBA443196EE670005877BB /* CCBKeyframe.o */, + 15CBA444196EE670005877BB /* CCBKeyframe.o.d */, + 15CBA445196EE670005877BB /* CCBReader.o */, + 15CBA446196EE670005877BB /* CCBReader.o.d */, + 15CBA447196EE670005877BB /* CCBSequence.o */, + 15CBA448196EE670005877BB /* CCBSequence.o.d */, + 15CBA449196EE670005877BB /* CCBSequenceProperty.o */, + 15CBA44A196EE670005877BB /* CCBSequenceProperty.o.d */, + 15CBA44B196EE670005877BB /* CCControlButtonLoader.o */, + 15CBA44C196EE670005877BB /* CCControlButtonLoader.o.d */, + 15CBA44D196EE670005877BB /* CCControlLoader.o */, + 15CBA44E196EE670005877BB /* CCControlLoader.o.d */, + 15CBA44F196EE670005877BB /* CCLabelBMFontLoader.o */, + 15CBA450196EE670005877BB /* CCLabelBMFontLoader.o.d */, + 15CBA451196EE670005877BB /* CCLabelTTFLoader.o */, + 15CBA452196EE670005877BB /* CCLabelTTFLoader.o.d */, + 15CBA453196EE670005877BB /* CCLayerColorLoader.o */, + 15CBA454196EE670005877BB /* CCLayerColorLoader.o.d */, + 15CBA455196EE670005877BB /* CCLayerGradientLoader.o */, + 15CBA456196EE670005877BB /* CCLayerGradientLoader.o.d */, + 15CBA457196EE670005877BB /* CCLayerLoader.o */, + 15CBA458196EE670005877BB /* CCLayerLoader.o.d */, + 15CBA459196EE670005877BB /* CCMenuItemImageLoader.o */, + 15CBA45A196EE670005877BB /* CCMenuItemImageLoader.o.d */, + 15CBA45B196EE670005877BB /* CCMenuItemLoader.o */, + 15CBA45C196EE670005877BB /* CCMenuItemLoader.o.d */, + 15CBA45D196EE670005877BB /* CCNode+CCBRelativePositioning.o */, + 15CBA45E196EE670005877BB /* CCNode+CCBRelativePositioning.o.d */, + 15CBA45F196EE670005877BB /* CCNodeLoader.o */, + 15CBA460196EE670005877BB /* CCNodeLoader.o.d */, + 15CBA461196EE670005877BB /* CCNodeLoaderLibrary.o */, + 15CBA462196EE670005877BB /* CCNodeLoaderLibrary.o.d */, + 15CBA463196EE670005877BB /* CCParticleSystemQuadLoader.o */, + 15CBA464196EE670005877BB /* CCParticleSystemQuadLoader.o.d */, + 15CBA465196EE670005877BB /* CCScale9SpriteLoader.o */, + 15CBA466196EE670005877BB /* CCScale9SpriteLoader.o.d */, + 15CBA467196EE670005877BB /* CCScrollViewLoader.o */, + 15CBA468196EE670005877BB /* CCScrollViewLoader.o.d */, + 15CBA469196EE670005877BB /* CCSpriteLoader.o */, + 15CBA46A196EE670005877BB /* CCSpriteLoader.o.d */, + ); + path = cocosbuilder_static; + sourceTree = ""; + }; + 15CBA46B196EE670005877BB /* cocosdenshion_static */ = { + isa = PBXGroup; + children = ( + 15CBA46C196EE670005877BB /* ccdandroidUtils.o */, + 15CBA46D196EE670005877BB /* ccdandroidUtils.o.d */, + 15CBA46E196EE670005877BB /* cddSimpleAudioEngine.o */, + 15CBA46F196EE670005877BB /* cddSimpleAudioEngine.o.d */, + 15CBA470196EE670005877BB /* jni */, + ); + path = cocosdenshion_static; + sourceTree = ""; + }; + 15CBA470196EE670005877BB /* jni */ = { + isa = PBXGroup; + children = ( + 15CBA471196EE670005877BB /* cddandroidAndroidJavaEngine.o */, + 15CBA472196EE670005877BB /* cddandroidAndroidJavaEngine.o.d */, + ); + path = jni; + sourceTree = ""; + }; + 15CBA473196EE670005877BB /* cocostudio_static */ = { + isa = PBXGroup; + children = ( + 15CBA474196EE670005877BB /* ActionTimeline */, + 15CBA47F196EE670005877BB /* CCActionFrame.o */, + 15CBA480196EE670005877BB /* CCActionFrame.o.d */, + 15CBA481196EE670005877BB /* CCActionFrameEasing.o */, + 15CBA482196EE670005877BB /* CCActionFrameEasing.o.d */, + 15CBA483196EE670005877BB /* CCActionManagerEx.o */, + 15CBA484196EE670005877BB /* CCActionManagerEx.o.d */, + 15CBA485196EE670005877BB /* CCActionNode.o */, + 15CBA486196EE670005877BB /* CCActionNode.o.d */, + 15CBA487196EE670005877BB /* CCActionObject.o */, + 15CBA488196EE670005877BB /* CCActionObject.o.d */, + 15CBA489196EE670005877BB /* CCArmature.o */, + 15CBA48A196EE670005877BB /* CCArmature.o.d */, + 15CBA48B196EE670005877BB /* CCArmatureAnimation.o */, + 15CBA48C196EE670005877BB /* CCArmatureAnimation.o.d */, + 15CBA48D196EE670005877BB /* CCArmatureDataManager.o */, + 15CBA48E196EE670005877BB /* CCArmatureDataManager.o.d */, + 15CBA48F196EE670005877BB /* CCArmatureDefine.o */, + 15CBA490196EE670005877BB /* CCArmatureDefine.o.d */, + 15CBA491196EE670005877BB /* CCBatchNode.o */, + 15CBA492196EE670005877BB /* CCBatchNode.o.d */, + 15CBA493196EE670005877BB /* CCBone.o */, + 15CBA494196EE670005877BB /* CCBone.o.d */, + 15CBA495196EE670005877BB /* CCColliderDetector.o */, + 15CBA496196EE670005877BB /* CCColliderDetector.o.d */, + 15CBA497196EE670005877BB /* CCComAttribute.o */, + 15CBA498196EE670005877BB /* CCComAttribute.o.d */, + 15CBA499196EE670005877BB /* CCComAudio.o */, + 15CBA49A196EE670005877BB /* CCComAudio.o.d */, + 15CBA49B196EE670005877BB /* CCComController.o */, + 15CBA49C196EE670005877BB /* CCComController.o.d */, + 15CBA49D196EE670005877BB /* CCComRender.o */, + 15CBA49E196EE670005877BB /* CCComRender.o.d */, + 15CBA49F196EE670005877BB /* CCDataReaderHelper.o */, + 15CBA4A0196EE670005877BB /* CCDataReaderHelper.o.d */, + 15CBA4A1196EE670005877BB /* CCDatas.o */, + 15CBA4A2196EE670005877BB /* CCDatas.o.d */, + 15CBA4A3196EE670005877BB /* CCDecorativeDisplay.o */, + 15CBA4A4196EE670005877BB /* CCDecorativeDisplay.o.d */, + 15CBA4A5196EE670005877BB /* CCDisplayFactory.o */, + 15CBA4A6196EE670005877BB /* CCDisplayFactory.o.d */, + 15CBA4A7196EE670005877BB /* CCDisplayManager.o */, + 15CBA4A8196EE670005877BB /* CCDisplayManager.o.d */, + 15CBA4A9196EE670005877BB /* CCInputDelegate.o */, + 15CBA4AA196EE670005877BB /* CCInputDelegate.o.d */, + 15CBA4AB196EE670005877BB /* CCProcessBase.o */, + 15CBA4AC196EE670005877BB /* CCProcessBase.o.d */, + 15CBA4AD196EE670005877BB /* CCSGUIReader.o */, + 15CBA4AE196EE670005877BB /* CCSGUIReader.o.d */, + 15CBA4AF196EE670005877BB /* CCSkin.o */, + 15CBA4B0196EE670005877BB /* CCSkin.o.d */, + 15CBA4B1196EE671005877BB /* CCSpriteFrameCacheHelper.o */, + 15CBA4B2196EE671005877BB /* CCSpriteFrameCacheHelper.o.d */, + 15CBA4B3196EE671005877BB /* CCSSceneReader.o */, + 15CBA4B4196EE671005877BB /* CCSSceneReader.o.d */, + 15CBA4B5196EE671005877BB /* CCTransformHelp.o */, + 15CBA4B6196EE671005877BB /* CCTransformHelp.o.d */, + 15CBA4B7196EE671005877BB /* CCTween.o */, + 15CBA4B8196EE671005877BB /* CCTween.o.d */, + 15CBA4B9196EE671005877BB /* CCUtilMath.o */, + 15CBA4BA196EE671005877BB /* CCUtilMath.o.d */, + 15CBA4BB196EE671005877BB /* CocoLoader.o */, + 15CBA4BC196EE671005877BB /* CocoLoader.o.d */, + 15CBA4BD196EE671005877BB /* DictionaryHelper.o */, + 15CBA4BE196EE671005877BB /* DictionaryHelper.o.d */, + 15CBA4BF196EE671005877BB /* TriggerBase.o */, + 15CBA4C0196EE671005877BB /* TriggerBase.o.d */, + 15CBA4C1196EE671005877BB /* TriggerMng.o */, + 15CBA4C2196EE671005877BB /* TriggerMng.o.d */, + 15CBA4C3196EE671005877BB /* TriggerObj.o */, + 15CBA4C4196EE671005877BB /* TriggerObj.o.d */, + 15CBA4C5196EE671005877BB /* WidgetReader */, + ); + path = cocostudio_static; + sourceTree = ""; + }; + 15CBA474196EE670005877BB /* ActionTimeline */ = { + isa = PBXGroup; + children = ( + 15CBA475196EE670005877BB /* CCActionTimeline.o */, + 15CBA476196EE670005877BB /* CCActionTimeline.o.d */, + 15CBA477196EE670005877BB /* CCActionTimelineCache.o */, + 15CBA478196EE670005877BB /* CCActionTimelineCache.o.d */, + 15CBA479196EE670005877BB /* CCFrame.o */, + 15CBA47A196EE670005877BB /* CCFrame.o.d */, + 15CBA47B196EE670005877BB /* CCNodeReader.o */, + 15CBA47C196EE670005877BB /* CCNodeReader.o.d */, + 15CBA47D196EE670005877BB /* CCTimeLine.o */, + 15CBA47E196EE670005877BB /* CCTimeLine.o.d */, + ); + path = ActionTimeline; + sourceTree = ""; + }; + 15CBA4C5196EE671005877BB /* WidgetReader */ = { + isa = PBXGroup; + children = ( + 15CBA4C6196EE671005877BB /* ButtonReader */, + 15CBA4C9196EE671005877BB /* CheckBoxReader */, + 15CBA4CC196EE671005877BB /* ImageViewReader */, + 15CBA4CF196EE671005877BB /* LayoutReader */, + 15CBA4D2196EE671005877BB /* ListViewReader */, + 15CBA4D5196EE671005877BB /* LoadingBarReader */, + 15CBA4D8196EE671005877BB /* PageViewReader */, + 15CBA4DB196EE671005877BB /* ScrollViewReader */, + 15CBA4DE196EE671005877BB /* SliderReader */, + 15CBA4E1196EE671005877BB /* TextAtlasReader */, + 15CBA4E4196EE671005877BB /* TextBMFontReader */, + 15CBA4E7196EE671005877BB /* TextFieldReader */, + 15CBA4EA196EE671005877BB /* TextReader */, + 15CBA4ED196EE671005877BB /* WidgetReader.o */, + 15CBA4EE196EE671005877BB /* WidgetReader.o.d */, + ); + path = WidgetReader; + sourceTree = ""; + }; + 15CBA4C6196EE671005877BB /* ButtonReader */ = { + isa = PBXGroup; + children = ( + 15CBA4C7196EE671005877BB /* ButtonReader.o */, + 15CBA4C8196EE671005877BB /* ButtonReader.o.d */, + ); + path = ButtonReader; + sourceTree = ""; + }; + 15CBA4C9196EE671005877BB /* CheckBoxReader */ = { + isa = PBXGroup; + children = ( + 15CBA4CA196EE671005877BB /* CheckBoxReader.o */, + 15CBA4CB196EE671005877BB /* CheckBoxReader.o.d */, + ); + path = CheckBoxReader; + sourceTree = ""; + }; + 15CBA4CC196EE671005877BB /* ImageViewReader */ = { + isa = PBXGroup; + children = ( + 15CBA4CD196EE671005877BB /* ImageViewReader.o */, + 15CBA4CE196EE671005877BB /* ImageViewReader.o.d */, + ); + path = ImageViewReader; + sourceTree = ""; + }; + 15CBA4CF196EE671005877BB /* LayoutReader */ = { + isa = PBXGroup; + children = ( + 15CBA4D0196EE671005877BB /* LayoutReader.o */, + 15CBA4D1196EE671005877BB /* LayoutReader.o.d */, + ); + path = LayoutReader; + sourceTree = ""; + }; + 15CBA4D2196EE671005877BB /* ListViewReader */ = { + isa = PBXGroup; + children = ( + 15CBA4D3196EE671005877BB /* ListViewReader.o */, + 15CBA4D4196EE671005877BB /* ListViewReader.o.d */, + ); + path = ListViewReader; + sourceTree = ""; + }; + 15CBA4D5196EE671005877BB /* LoadingBarReader */ = { + isa = PBXGroup; + children = ( + 15CBA4D6196EE671005877BB /* LoadingBarReader.o */, + 15CBA4D7196EE671005877BB /* LoadingBarReader.o.d */, + ); + path = LoadingBarReader; + sourceTree = ""; + }; + 15CBA4D8196EE671005877BB /* PageViewReader */ = { + isa = PBXGroup; + children = ( + 15CBA4D9196EE671005877BB /* PageViewReader.o */, + 15CBA4DA196EE671005877BB /* PageViewReader.o.d */, + ); + path = PageViewReader; + sourceTree = ""; + }; + 15CBA4DB196EE671005877BB /* ScrollViewReader */ = { + isa = PBXGroup; + children = ( + 15CBA4DC196EE671005877BB /* ScrollViewReader.o */, + 15CBA4DD196EE671005877BB /* ScrollViewReader.o.d */, + ); + path = ScrollViewReader; + sourceTree = ""; + }; + 15CBA4DE196EE671005877BB /* SliderReader */ = { + isa = PBXGroup; + children = ( + 15CBA4DF196EE671005877BB /* SliderReader.o */, + 15CBA4E0196EE671005877BB /* SliderReader.o.d */, + ); + path = SliderReader; + sourceTree = ""; + }; + 15CBA4E1196EE671005877BB /* TextAtlasReader */ = { + isa = PBXGroup; + children = ( + 15CBA4E2196EE671005877BB /* TextAtlasReader.o */, + 15CBA4E3196EE671005877BB /* TextAtlasReader.o.d */, + ); + path = TextAtlasReader; + sourceTree = ""; + }; + 15CBA4E4196EE671005877BB /* TextBMFontReader */ = { + isa = PBXGroup; + children = ( + 15CBA4E5196EE671005877BB /* TextBMFontReader.o */, + 15CBA4E6196EE671005877BB /* TextBMFontReader.o.d */, + ); + path = TextBMFontReader; + sourceTree = ""; + }; + 15CBA4E7196EE671005877BB /* TextFieldReader */ = { + isa = PBXGroup; + children = ( + 15CBA4E8196EE671005877BB /* TextFieldReader.o */, + 15CBA4E9196EE671005877BB /* TextFieldReader.o.d */, + ); + path = TextFieldReader; + sourceTree = ""; + }; + 15CBA4EA196EE671005877BB /* TextReader */ = { + isa = PBXGroup; + children = ( + 15CBA4EB196EE671005877BB /* TextReader.o */, + 15CBA4EC196EE671005877BB /* TextReader.o.d */, + ); + path = TextReader; + sourceTree = ""; + }; + 15CBA4EF196EE671005877BB /* cpufeatures */ = { + isa = PBXGroup; + children = ( + 15CBA4F0196EE671005877BB /* cpu-features.o */, + 15CBA4F1196EE671005877BB /* cpu-features.o.d */, + ); + path = cpufeatures; + sourceTree = ""; + }; + 15CBA4F2196EE671005877BB /* lua_game_controller_test_shared */ = { + isa = PBXGroup; + children = ( + 15CBA4F3196EE671005877BB /* __ */, + 15CBA4F8196EE671005877BB /* main.o */, + 15CBA4F9196EE671005877BB /* main.o.d */, + ); + path = lua_game_controller_test_shared; + sourceTree = ""; + }; + 15CBA4F3196EE671005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA4F4196EE671005877BB /* __ */, + ); + path = __; + sourceTree = ""; + }; + 15CBA4F4196EE671005877BB /* __ */ = { + isa = PBXGroup; + children = ( + 15CBA4F5196EE671005877BB /* Classes */, + ); + path = __; + sourceTree = ""; + }; + 15CBA4F5196EE671005877BB /* Classes */ = { + isa = PBXGroup; + children = ( + 15CBA4F6196EE671005877BB /* AppDelegate.o */, + 15CBA4F7196EE671005877BB /* AppDelegate.o.d */, + ); + path = Classes; + sourceTree = ""; + }; + 15CBA4FA196EE671005877BB /* spine_static */ = { + isa = PBXGroup; + children = ( + 15CBA4FB196EE671005877BB /* Animation.o */, + 15CBA4FC196EE671005877BB /* Animation.o.d */, + 15CBA4FD196EE671005877BB /* AnimationState.o */, + 15CBA4FE196EE671005877BB /* AnimationState.o.d */, + 15CBA4FF196EE671005877BB /* AnimationStateData.o */, + 15CBA500196EE671005877BB /* AnimationStateData.o.d */, + 15CBA501196EE671005877BB /* Atlas.o */, + 15CBA502196EE671005877BB /* Atlas.o.d */, + 15CBA503196EE671005877BB /* AtlasAttachmentLoader.o */, + 15CBA504196EE671005877BB /* AtlasAttachmentLoader.o.d */, + 15CBA505196EE671005877BB /* Attachment.o */, + 15CBA506196EE671005877BB /* Attachment.o.d */, + 15CBA507196EE671005877BB /* AttachmentLoader.o */, + 15CBA508196EE671005877BB /* AttachmentLoader.o.d */, + 15CBA509196EE671005877BB /* Bone.o */, + 15CBA50A196EE671005877BB /* Bone.o.d */, + 15CBA50B196EE671005877BB /* BoneData.o */, + 15CBA50C196EE671005877BB /* BoneData.o.d */, + 15CBA50D196EE671005877BB /* BoundingBoxAttachment.o */, + 15CBA50E196EE671005877BB /* BoundingBoxAttachment.o.d */, + 15CBA50F196EE671005877BB /* CCSkeleton.o */, + 15CBA510196EE671005877BB /* CCSkeleton.o.d */, + 15CBA511196EE671005877BB /* CCSkeletonAnimation.o */, + 15CBA512196EE671005877BB /* CCSkeletonAnimation.o.d */, + 15CBA513196EE671005877BB /* Event.o */, + 15CBA514196EE671005877BB /* Event.o.d */, + 15CBA515196EE671005877BB /* EventData.o */, + 15CBA516196EE671005877BB /* EventData.o.d */, + 15CBA517196EE671005877BB /* extension.o */, + 15CBA518196EE671005877BB /* extension.o.d */, + 15CBA519196EE671005877BB /* Json.o */, + 15CBA51A196EE671005877BB /* Json.o.d */, + 15CBA51B196EE671005877BB /* RegionAttachment.o */, + 15CBA51C196EE671005877BB /* RegionAttachment.o.d */, + 15CBA51D196EE671005877BB /* Skeleton.o */, + 15CBA51E196EE671005877BB /* Skeleton.o.d */, + 15CBA51F196EE671005877BB /* SkeletonBounds.o */, + 15CBA520196EE671005877BB /* SkeletonBounds.o.d */, + 15CBA521196EE671005877BB /* SkeletonData.o */, + 15CBA522196EE671005877BB /* SkeletonData.o.d */, + 15CBA523196EE671005877BB /* SkeletonJson.o */, + 15CBA524196EE671005877BB /* SkeletonJson.o.d */, + 15CBA525196EE671005877BB /* Skin.o */, + 15CBA526196EE671005877BB /* Skin.o.d */, + 15CBA527196EE671005877BB /* Slot.o */, + 15CBA528196EE671005877BB /* Slot.o.d */, + 15CBA529196EE671005877BB /* SlotData.o */, + 15CBA52A196EE671005877BB /* SlotData.o.d */, + 15CBA52B196EE671005877BB /* spine-cocos2dx.o */, + 15CBA52C196EE671005877BB /* spine-cocos2dx.o.d */, + ); + path = spine_static; + sourceTree = ""; + }; + 15CBA52F196EE671005877BB /* res */ = { + isa = PBXGroup; + children = ( + 15CBA530196EE671005877BB /* drawable-hdpi */, + 15CBA532196EE671005877BB /* drawable-ldpi */, + 15CBA534196EE671005877BB /* drawable-mdpi */, + 15CBA536196EE671005877BB /* values */, + ); + path = res; + sourceTree = ""; + }; + 15CBA530196EE671005877BB /* drawable-hdpi */ = { + isa = PBXGroup; + children = ( + 15CBA531196EE671005877BB /* icon.png */, + ); + path = "drawable-hdpi"; + sourceTree = ""; + }; + 15CBA532196EE671005877BB /* drawable-ldpi */ = { + isa = PBXGroup; + children = ( + 15CBA533196EE671005877BB /* icon.png */, + ); + path = "drawable-ldpi"; + sourceTree = ""; + }; + 15CBA534196EE671005877BB /* drawable-mdpi */ = { + isa = PBXGroup; + children = ( + 15CBA535196EE671005877BB /* icon.png */, + ); + path = "drawable-mdpi"; + sourceTree = ""; + }; + 15CBA536196EE671005877BB /* values */ = { + isa = PBXGroup; + children = ( + 15CBA537196EE671005877BB /* strings.xml */, + ); + path = values; + sourceTree = ""; + }; + 15CBA538196EE671005877BB /* src */ = { + isa = PBXGroup; + children = ( + 15CBA539196EE671005877BB /* org */, + ); + path = src; + sourceTree = ""; + }; + 15CBA539196EE671005877BB /* org */ = { + isa = PBXGroup; + children = ( + 15CBA53A196EE671005877BB /* cocos2dx */, + ); + path = org; + sourceTree = ""; + }; + 15CBA53A196EE671005877BB /* cocos2dx */ = { + isa = PBXGroup; + children = ( + 15CBA53B196EE671005877BB /* LuaGameControllerTest */, + ); + path = cocos2dx; + sourceTree = ""; + }; + 15CBA53B196EE671005877BB /* LuaGameControllerTest */ = { + isa = PBXGroup; + children = ( + 15CBA53C196EE671005877BB /* AppActivity.java */, + ); + path = LuaGameControllerTest; + sourceTree = ""; + }; + 15CBA53D196EE671005877BB /* proj.ios */ = { + isa = PBXGroup; + children = ( + 15CBA53E196EE671005877BB /* AppController.h */, + 15CBA53F196EE671005877BB /* AppController.mm */, + 15CBA540196EE671005877BB /* Default-568h@2x.png */, + 15CBA541196EE671005877BB /* Default.png */, + 15CBA542196EE671005877BB /* Default@2x.png */, + 15CBA543196EE671005877BB /* HelloLua_Prefix.pch */, + 15CBA544196EE671005877BB /* Icon-114.png */, + 15CBA545196EE671005877BB /* Icon-120.png */, + 15CBA546196EE671005877BB /* Icon-144.png */, + 15CBA547196EE671005877BB /* Icon-152.png */, + 15CBA548196EE671005877BB /* Icon-57.png */, + 15CBA549196EE671005877BB /* Icon-72.png */, + 15CBA54A196EE671005877BB /* Icon-76.png */, + 15CBA54B196EE671005877BB /* Info.plist */, + 15CBA54C196EE671005877BB /* main.m */, + 15CBA54D196EE671005877BB /* RootViewController.h */, + 15CBA54E196EE671005877BB /* RootViewController.mm */, + ); + path = proj.ios; + sourceTree = ""; + }; + 15CBA9A6196EE6DB005877BB /* res */ = { + isa = PBXGroup; + children = ( + 15CBA9A7196EE6DB005877BB /* .gitignore */, + ); + path = res; + sourceTree = ""; + }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( @@ -2188,6 +5504,7 @@ 1A0EE41318CDF775004CD58F /* cpp-empty-test iOS.app */, 1A0EE47E18CDF799004CD58F /* lua-empty-test iOS.app */, 3E6177311960FAED00DE83F5 /* game-controller-test IOS.app */, + 15CBA063196EE56C005877BB /* lua-game-controller-test iOS.app */, ); name = Products; sourceTree = ""; @@ -2214,6 +5531,7 @@ 1ABCA36418CD9E060087CE3A /* Lua Common */ = { isa = PBXGroup; children = ( + 15AECE1E195D0EC500907DB0 /* experimentalConstants.lua */, 1503FAA918DA8B6C00F6518C /* ftp.lua */, 1503FAAA18DA8B6C00F6518C /* headers.lua */, 1503FAAB18DA8B6C00F6518C /* http.lua */, @@ -3567,6 +6885,7 @@ 1AC35E0318CEE78300F37B72 /* tests */ = { isa = PBXGroup; children = ( + 15CBA087196EE66D005877BB /* lua-game-controller-test */, 3E6176B51960FA6300DE83F5 /* game-controller-test */, 1AC358B618CEC19F00F37B72 /* cpp-empty-test */, 1AC3592118CECEFF00F37B72 /* cpp-tests */, @@ -3580,8 +6899,6 @@ isa = PBXGroup; children = ( 29080D1E191B595E0066F8DF /* CocoStudioGUITest */, - 29080D1A191B574B0066F8DF /* UITest.cpp */, - 29080D1B191B574B0066F8DF /* UITest.h */, ); name = UITest; sourceTree = ""; @@ -3589,41 +6906,13 @@ 29080D1E191B595E0066F8DF /* CocoStudioGUITest */ = { isa = PBXGroup; children = ( - 3EA0FB6F191C844400B170C8 /* UIVideoPlayerTest */, - 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */, - 29080D20191B595E0066F8DF /* CocosGUIScene.h */, + 29080D1A191B574B0066F8DF /* UITest.cpp */, + 29080D1B191B574B0066F8DF /* UITest.h */, 29080D21191B595E0066F8DF /* CocoStudioGUITest.cpp */, 29080D22191B595E0066F8DF /* CocoStudioGUITest.h */, - 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */, - 29080D24191B595E0066F8DF /* CustomGUIScene.h */, + 29FBBC00196A9F0D00E65826 /* UIAndEditorTests */, + 29FBBBFB196A9ECD00E65826 /* CocostudioParserTest */, 29080D25191B595E0066F8DF /* CustomTest */, - 29080D2C191B595E0066F8DF /* CustomWidget */, - 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */, - 29080D38191B595E0066F8DF /* GUIEditorTest.h */, - 29080D39191B595E0066F8DF /* UIButtonTest */, - 29080D3E191B595E0066F8DF /* UICheckBoxTest */, - 29080D43191B595E0066F8DF /* UIFocusTest */, - 29080D46191B595E0066F8DF /* UIImageViewTest */, - 29080D4B191B595E0066F8DF /* UILayoutTest */, - 29080D50191B595E0066F8DF /* UIListViewTest */, - 29080D55191B595E0066F8DF /* UILoadingBarTest */, - 29080D5A191B595E0066F8DF /* UIPageViewTest */, - 29080D5F191B595E0066F8DF /* UIRichTextTest */, - 29080D62191B595E0066F8DF /* UIScene.cpp */, - 29080D63191B595E0066F8DF /* UIScene.h */, - 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */, - 29080D65191B595E0066F8DF /* UIScene_Editor.h */, - 29080D66191B595E0066F8DF /* UISceneManager.cpp */, - 29080D67191B595E0066F8DF /* UISceneManager.h */, - 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */, - 29080D69191B595E0066F8DF /* UISceneManager_Editor.h */, - 29080D6A191B595E0066F8DF /* UIScrollViewTest */, - 29080D6F191B595E0066F8DF /* UISliderTest */, - 29080D74191B595E0066F8DF /* UITextAtlasTest */, - 29080D79191B595E0066F8DF /* UITextBMFontTest */, - 29080D7E191B595E0066F8DF /* UITextFieldTest */, - 29080D83191B595E0066F8DF /* UITextTest */, - 29080D88191B595E0066F8DF /* UIWidgetAddNodeTest */, ); name = CocoStudioGUITest; path = UITest/CocoStudioGUITest; @@ -3632,6 +6921,9 @@ 29080D25191B595E0066F8DF /* CustomTest */ = { isa = PBXGroup; children = ( + 29080D2C191B595E0066F8DF /* CustomWidget */, + 29080D23191B595E0066F8DF /* CustomGUIScene.cpp */, + 29080D24191B595E0066F8DF /* CustomGUIScene.h */, 29080D26191B595E0066F8DF /* CustomImageTest */, 29080D29191B595E0066F8DF /* CustomParticleWidgetTest */, ); @@ -3670,7 +6962,8 @@ 29080D35191B595E0066F8DF /* CustomReader.cpp */, 29080D36191B595E0066F8DF /* CustomReader.h */, ); - path = CustomWidget; + name = CustomWidget; + path = ../CustomWidget; sourceTree = ""; }; 29080D39191B595E0066F8DF /* UIButtonTest */ = { @@ -3861,6 +7154,16 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 15CBA9DC196EEAA6005877BB /* libz.dylib */, + 15CBA9DA196EEA90005877BB /* CoreMotion.framework */, + 15CBA9D8196EEA7D005877BB /* QuartzCore.framework */, + 15CBA9D6196EEA63005877BB /* AudioToolbox.framework */, + 15CBA9D3196EEA33005877BB /* OpenAL.framework */, + 15CBA9C8196EE97F005877BB /* CoreGraphics.framework */, + 15CBA9C6196EE971005877BB /* OpenGLES.framework */, + 15CBA9C4196EE962005877BB /* UIKit.framework */, + 15CBA9C2196EE951005877BB /* AVFoundation.framework */, + 15CBA9C0196EE943005877BB /* Foundation.framework */, 3E61773C1960FBD100DE83F5 /* GameController.framework */, 3E61773A1960FBC300DE83F5 /* CFNetwork.framework */, 3E6177381960FBB800DE83F5 /* SystemConfiguration.framework */, @@ -3901,6 +7204,53 @@ name = Frameworks; sourceTree = ""; }; + 29FBBBFB196A9ECD00E65826 /* CocostudioParserTest */ = { + isa = PBXGroup; + children = ( + 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */, + 290E94B4196FC16900694919 /* CocostudioParserTest.h */, + 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */, + 29FBBBFD196A9ECD00E65826 /* CocostudioParserJsonTest.h */, + ); + path = CocostudioParserTest; + sourceTree = ""; + }; + 29FBBC00196A9F0D00E65826 /* UIAndEditorTests */ = { + isa = PBXGroup; + children = ( + 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */, + 29080D20191B595E0066F8DF /* CocosGUIScene.h */, + 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */, + 29080D38191B595E0066F8DF /* GUIEditorTest.h */, + 29080D62191B595E0066F8DF /* UIScene.cpp */, + 29080D63191B595E0066F8DF /* UIScene.h */, + 29080D64191B595E0066F8DF /* UIScene_Editor.cpp */, + 29080D65191B595E0066F8DF /* UIScene_Editor.h */, + 29080D66191B595E0066F8DF /* UISceneManager.cpp */, + 29080D67191B595E0066F8DF /* UISceneManager.h */, + 29080D68191B595E0066F8DF /* UISceneManager_Editor.cpp */, + 29080D69191B595E0066F8DF /* UISceneManager_Editor.h */, + 29080D6A191B595E0066F8DF /* UIScrollViewTest */, + 29080D6F191B595E0066F8DF /* UISliderTest */, + 29080D74191B595E0066F8DF /* UITextAtlasTest */, + 29080D79191B595E0066F8DF /* UITextBMFontTest */, + 29080D7E191B595E0066F8DF /* UITextFieldTest */, + 29080D83191B595E0066F8DF /* UITextTest */, + 29080D88191B595E0066F8DF /* UIWidgetAddNodeTest */, + 29080D39191B595E0066F8DF /* UIButtonTest */, + 29080D3E191B595E0066F8DF /* UICheckBoxTest */, + 29080D43191B595E0066F8DF /* UIFocusTest */, + 29080D46191B595E0066F8DF /* UIImageViewTest */, + 29080D4B191B595E0066F8DF /* UILayoutTest */, + 29080D50191B595E0066F8DF /* UIListViewTest */, + 29080D55191B595E0066F8DF /* UILoadingBarTest */, + 29080D5A191B595E0066F8DF /* UIPageViewTest */, + 29080D5F191B595E0066F8DF /* UIRichTextTest */, + 3EA0FB6F191C844400B170C8 /* UIVideoPlayerTest */, + ); + name = UIAndEditorTests; + sourceTree = ""; + }; 38FA2E70194AEBE100FF2BE4 /* CocoStudioActionTimelineTest */ = { isa = PBXGroup; children = ( @@ -4009,6 +7359,28 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 15CBA015196EE56C005877BB /* lua-game-controller-test iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 15CBA060196EE56C005877BB /* Build configuration list for PBXNativeTarget "lua-game-controller-test iOS" */; + buildPhases = ( + 15CBA020196EE56C005877BB /* Sources */, + 15CBA025196EE56C005877BB /* Frameworks */, + 15CBA036196EE56C005877BB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 15CBA016196EE56C005877BB /* PBXTargetDependency */, + 15CBA018196EE56C005877BB /* PBXTargetDependency */, + 15CBA01A196EE56C005877BB /* PBXTargetDependency */, + 15CBA01C196EE56C005877BB /* PBXTargetDependency */, + 15CBA01E196EE56C005877BB /* PBXTargetDependency */, + ); + name = "lua-game-controller-test iOS"; + productName = "Test lua iOS"; + productReference = 15CBA063196EE56C005877BB /* lua-game-controller-test iOS.app */; + productType = "com.apple.product-type.application"; + }; 1A0EE1C618CDF6DA004CD58F /* cpp-empty-test Mac */ = { isa = PBXNativeTarget; buildConfigurationList = 1A0EE2AF18CDF6DA004CD58F /* Build configuration list for PBXNativeTarget "cpp-empty-test Mac" */; @@ -4247,6 +7619,7 @@ 1ABCA2CC18CD93580087CE3A /* lua-tests iOS */, 1A0EE41918CDF799004CD58F /* lua-empty-test iOS */, 3E6176FF1960FAED00DE83F5 /* game-controller-test IOS */, + 15CBA015196EE56C005877BB /* lua-game-controller-test iOS */, ); }; /* End PBXProject section */ @@ -4339,6 +7712,26 @@ /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + 15CBA036196EE56C005877BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15CBA9B3196EE824005877BB /* src in Resources */, + 15CBA9AF196EE80B005877BB /* fonts in Resources */, + 15CBA9B0196EE80B005877BB /* ipad in Resources */, + 15CBA9B1196EE80B005877BB /* ipadhd in Resources */, + 15CBA9B2196EE80B005877BB /* iphone in Resources */, + 15CBA9F2196F8718005877BB /* extern.lua in Resources */, + 15CBA9F1196F865C005877BB /* json.lua in Resources */, + 15CBA9A9196EE7FA005877BB /* Cocos2d.lua in Resources */, + 15CBA9AA196EE7FA005877BB /* Cocos2dConstants.lua in Resources */, + 15CBA9AB196EE7FA005877BB /* CocoStudio.lua in Resources */, + 15CBA9AC196EE7FA005877BB /* Deprecated.lua in Resources */, + 15CBA9AD196EE7FA005877BB /* DeprecatedClass.lua in Resources */, + 15CBA9AE196EE7FA005877BB /* DeprecatedEnum.lua in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1A0EE1D118CDF6DA004CD58F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -4364,6 +7757,7 @@ 1AC35D5D18CEDE9E00F37B72 /* MainMenu.xib in Resources */, 1503FABD18DA8B6C00F6518C /* mime.lua in Resources */, 1A0EE56F18CDFBBE004CD58F /* CCBReaderLoad.lua in Resources */, + 15AECE23195D122600907DB0 /* experimentalConstants.lua in Resources */, 1A0EE57018CDFBBE004CD58F /* Cocos2d.lua in Resources */, 1A0EE57B18CDFBBE004CD58F /* luaj.lua in Resources */, 1A0EE57918CDFBBE004CD58F /* GuiConstants.lua in Resources */, @@ -4433,6 +7827,7 @@ 1A0EE56018CDFBBD004CD58F /* CocoStudio.lua in Resources */, 1A0EE56318CDFBBD004CD58F /* DeprecatedEnum.lua in Resources */, 1503FAB818DA8B6C00F6518C /* http.lua in Resources */, + 15AECE22195D122400907DB0 /* experimentalConstants.lua in Resources */, 1AC35D4B18CEDE9400F37B72 /* Icon-144.png in Resources */, 1503FAC618DA8B6C00F6518C /* url.lua in Resources */, 1AC35D4618CEDE9400F37B72 /* Default-568h@2x.png in Resources */, @@ -4477,6 +7872,7 @@ 1AC35DBB18CEE65100F37B72 /* components in Resources */, 1AC35DE218CEE65900F37B72 /* effect2.ogg in Resources */, 1ABCA39A18CD9E180087CE3A /* StudioConstants.lua in Resources */, + 15AECE24195D122700907DB0 /* experimentalConstants.lua in Resources */, 15C90B4318E66C1700D69802 /* mime.lua in Resources */, 1AC35DB118CEE5DA00F37B72 /* InfoPlist.strings in Resources */, 1AC35DDD18CEE65900F37B72 /* CocosBuilderExample.ccbproj in Resources */, @@ -4539,6 +7935,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15AECE0F195C1FDD00907DB0 /* cocosvideo.mp4 in Resources */, 15B0870D195AD52000D6F62B /* ActionTimeline in Resources */, 15E66FC8192D957100C20A52 /* Sprite3DTest in Resources */, 15C90B4418E66C1800D69802 /* mime.lua in Resources */, @@ -4555,6 +7952,7 @@ 1AC35DD718CEE65200F37B72 /* Particles in Resources */, 1AC35D9D18CEE5D100F37B72 /* Icon-120.png in Resources */, 15C90B3E18E66BF200D69802 /* http.lua in Resources */, + 15AECE1F195D0EC500907DB0 /* experimentalConstants.lua in Resources */, 1AC35DA018CEE5D100F37B72 /* Icon-57.png in Resources */, 1ABCA37F18CD9E180087CE3A /* Cocos2dConstants.lua in Resources */, 1AC35DF118CEE65B00F37B72 /* fileLookup.plist in Resources */, @@ -4733,6 +8131,19 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 15CBA020196EE56C005877BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15CBA9B7196EE8D9005877BB /* AppController.mm in Sources */, + 15CBA9B8196EE8D9005877BB /* main.m in Sources */, + 15CBA9B9196EE8D9005877BB /* RootViewController.mm in Sources */, + 15CBA9F0196F7BEC005877BB /* lua_cocos2dx_controller_manual.cpp in Sources */, + 15CBA9ED196F7BD8005877BB /* lua_cocos2dx_controller_auto.cpp in Sources */, + 15CBA9B4196EE8A0005877BB /* AppDelegate.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 1A0EE1F618CDF6DA004CD58F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -4857,6 +8268,7 @@ 1AC35C5118CECF0C00F37B72 /* testBasic.cpp in Sources */, 1AC35B7918CECF0C00F37B72 /* EnemyController.cpp in Sources */, 1AC35B6B18CECF0C00F37B72 /* CocosBuilderTest.cpp in Sources */, + 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */, 1AC35B4118CECF0C00F37B72 /* QuestionContainerSprite.cpp in Sources */, 1AC35B6118CECF0C00F37B72 /* DrawPrimitivesTest.cpp in Sources */, 1AC35C1718CECF0C00F37B72 /* MotionStreakTest.cpp in Sources */, @@ -4898,6 +8310,7 @@ 1AC35BF318CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */, 1AC35B3518CECF0C00F37B72 /* TestEntries.cpp in Sources */, 1AC35B2D18CECF0C00F37B72 /* Box2dTest.cpp in Sources */, + 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */, 29080DDB191B595E0066F8DF /* UITextFieldTest.cpp in Sources */, 1AC35C1118CECF0C00F37B72 /* LabelTestNew.cpp in Sources */, 1AC35B4D18CECF0C00F37B72 /* ChipmunkTest.cpp in Sources */, @@ -5149,6 +8562,7 @@ 1AC35C0218CECF0C00F37B72 /* TableViewTestScene.cpp in Sources */, 1AC35C4C18CECF0C00F37B72 /* ShaderTest2.cpp in Sources */, 1AC35C6618CECF0C00F37B72 /* UnitTest.cpp in Sources */, + 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */, 1AC35B4018CECF0C00F37B72 /* Bug-458.cpp in Sources */, 1AC35C3A18CECF0C00F37B72 /* PerformanceTextureTest.cpp in Sources */, 29080DC4191B595E0066F8DF /* UIScene.cpp in Sources */, @@ -5162,6 +8576,7 @@ 1AC35B7418CECF0C00F37B72 /* TimelineCallbackTestLayer.cpp in Sources */, 29080D9E191B595E0066F8DF /* CustomParticleWidgetReader.cpp in Sources */, 1AC35BFC18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */, + 29FBBBFF196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */, 1AC35C3618CECF0C00F37B72 /* PerformanceSpriteTest.cpp in Sources */, 1AC35C3C18CECF0C00F37B72 /* PerformanceTouchesTest.cpp in Sources */, 29080DA2191B595E0066F8DF /* GUIEditorTest.cpp in Sources */, @@ -5177,6 +8592,31 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 15CBA016196EE56C005877BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx iOS"; + targetProxy = 15CBA017196EE56C005877BB /* PBXContainerItemProxy */; + }; + 15CBA018196EE56C005877BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "cocos2dx-extensions iOS"; + targetProxy = 15CBA019196EE56C005877BB /* PBXContainerItemProxy */; + }; + 15CBA01A196EE56C005877BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "chipmunk iOS"; + targetProxy = 15CBA01B196EE56C005877BB /* PBXContainerItemProxy */; + }; + 15CBA01C196EE56C005877BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CocosDenshion iOS"; + targetProxy = 15CBA01D196EE56C005877BB /* PBXContainerItemProxy */; + }; + 15CBA01E196EE56C005877BB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "luabindings iOS"; + targetProxy = 15CBA01F196EE56C005877BB /* PBXContainerItemProxy */; + }; 1A0EE1C718CDF6DA004CD58F /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "cocos2dx Mac"; @@ -5487,6 +8927,59 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 15CBA061196EE56C005877BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-game-controller-test/project/proj.ios/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/cocos2d/MyWork/cocos2d-x-develop/tests/lua-game-controller-test/project/proj.android/obj/local/armeabi", + "$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib", + ); + PRODUCT_NAME = "lua-game-controller-test iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base"; + }; + name = Debug; + }; + 15CBA062196EE56C005877BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + CC_TARGET_OS_IPHONE, + ); + INFOPLIST_FILE = "$(SRCROOT)/../tests/lua-game-controller-test/project/proj.ios/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/Users/cocos2d/MyWork/cocos2d-x-develop/tests/lua-game-controller-test/project/proj.android/obj/local/armeabi", + "$(DEVELOPER_DIR)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib", + ); + PRODUCT_NAME = "lua-game-controller-test iOS"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/.. $(SRCROOT)/../cocos/platform/ios $(SRCROOT)/../external $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua $(SRCROOT)/../cocos/scripting/lua-bindings/manual $(SRCROOT)/../cocos/scripting/lua-bindings/auto $(SRCROOT)/../cocos/base"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 1A0EE2B018CDF6DA004CD58F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5728,6 +9221,7 @@ "$(inherited)", CC_TARGET_OS_IPHONE, ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; INFOPLIST_FILE = "$(SRCROOT)/../tests/game-controller-test/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "game-controller-test IOS"; @@ -5745,6 +9239,7 @@ "$(inherited)", CC_TARGET_OS_IPHONE, ); + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ""; INFOPLIST_FILE = "$(SRCROOT)/../tests/game-controller-test/proj.ios/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; PRODUCT_NAME = "game-controller-test IOS"; @@ -5878,6 +9373,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 15CBA060196EE56C005877BB /* Build configuration list for PBXNativeTarget "lua-game-controller-test iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15CBA061196EE56C005877BB /* Debug */, + 15CBA062196EE56C005877BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; 1A0EE2AF18CDF6DA004CD58F /* Build configuration list for PBXNativeTarget "cpp-empty-test Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme new file mode 100644 index 0000000000..c13623f4a0 --- /dev/null +++ b/build/cocos2d_tests.xcodeproj/xcshareddata/xcschemes/lua-game-controller-test iOS.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/2d/CCActionInterval.h b/cocos/2d/CCActionInterval.h index b735a1fb3b..d112f04e1f 100644 --- a/cocos/2d/CCActionInterval.h +++ b/cocos/2d/CCActionInterval.h @@ -585,7 +585,7 @@ public: virtual JumpTo* clone() const override; virtual JumpTo* reverse(void) const override; -private: +CC_CONSTRUCTOR_ACCESS: JumpTo() {} virtual ~JumpTo() {} CC_DISALLOW_COPY_AND_ASSIGN(JumpTo); @@ -750,7 +750,7 @@ public: virtual ScaleBy* clone() const override; virtual ScaleBy* reverse(void) const override; -protected: +CC_CONSTRUCTOR_ACCESS: ScaleBy() {} virtual ~ScaleBy() {} @@ -842,7 +842,7 @@ public: void setReverseAction(FadeTo* ac); -protected: +CC_CONSTRUCTOR_ACCESS: FadeIn():_reverseAction(nullptr) {} virtual ~FadeIn() {} @@ -869,7 +869,7 @@ public: void setReverseAction(FadeTo* ac); -protected: +CC_CONSTRUCTOR_ACCESS: FadeOut():_reverseAction(nullptr) {} virtual ~FadeOut() {} private: @@ -961,7 +961,7 @@ public: virtual DelayTime* reverse() const override; virtual DelayTime* clone() const override; -protected: +CC_CONSTRUCTOR_ACCESS: DelayTime() {} virtual ~DelayTime() {} diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index 5462b7f6ce..e942e11103 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -194,8 +194,8 @@ bool DrawNode::init() #if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO - auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ - /** listen the event that coming to foreground on Android */ + auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event){ + /** listen the event that renderer was recreated on Android/WP8 */ this->init(); }); diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index f9f6df7db1..072021780d 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -31,6 +31,7 @@ #include "base/CCEventDispatcher.h" #include "base/CCEventType.h" + NS_CC_BEGIN const int FontAtlas::CacheTextureWidth = 512; @@ -41,9 +42,9 @@ FontAtlas::FontAtlas(Font &theFont) : _font(&theFont) , _currentPageData(nullptr) , _fontAscender(0) -, _toForegroundListener(nullptr) -, _toBackgroundListener(nullptr) +, _rendererRecreatedListener(nullptr) , _antialiasEnabled(true) +, _rendererRecreate(false) { _font->retain(); @@ -77,12 +78,12 @@ FontAtlas::FontAtlas(Font &theFont) addTexture(texture,0); texture->release(); + #if CC_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); - _toBackgroundListener = EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(FontAtlas::listenToBackground, this)); - eventDispatcher->addEventListenerWithFixedPriority(_toBackgroundListener, 1); - _toForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(FontAtlas::listenToForeground, this)); - eventDispatcher->addEventListenerWithFixedPriority(_toForegroundListener, 1); + + _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(FontAtlas::listenRendererRecreated, this)); + eventDispatcher->addEventListenerWithFixedPriority(_rendererRecreatedListener, 1); #endif } } @@ -91,19 +92,11 @@ FontAtlas::~FontAtlas() { #if CC_ENABLE_CACHE_TEXTURE_DATA FontFreeType* fontTTf = dynamic_cast(_font); - if (fontTTf) + if (fontTTf && _rendererRecreatedListener) { auto eventDispatcher = Director::getInstance()->getEventDispatcher(); - if (_toForegroundListener) - { - eventDispatcher->removeEventListener(_toForegroundListener); - _toForegroundListener = nullptr; - } - if (_toBackgroundListener) - { - eventDispatcher->removeEventListener(_toBackgroundListener); - _toBackgroundListener = nullptr; - } + eventDispatcher->removeEventListener(_rendererRecreatedListener); + _rendererRecreatedListener = nullptr; } #endif @@ -149,11 +142,10 @@ void FontAtlas::purgeTexturesAtlas() } } -void FontAtlas::listenToBackground(EventCustom *event) +void FontAtlas::listenRendererRecreated(EventCustom *event) { -#if CC_ENABLE_CACHE_TEXTURE_DATA FontFreeType* fontTTf = dynamic_cast(_font); - if (fontTTf && _atlasTextures.size() > 1) + if (fontTTf) { for( auto &item: _atlasTextures) { @@ -171,30 +163,12 @@ void FontAtlas::listenToBackground(EventCustom *event) _currentPage = 0; _currentPageOrigX = 0; _currentPageOrigY = 0; - } -#endif -} -void FontAtlas::listenToForeground(EventCustom *event) -{ -#if CC_ENABLE_CACHE_TEXTURE_DATA - FontFreeType* fontTTf = dynamic_cast(_font); - if (fontTTf) - { - if (_currentPageOrigX == 0 && _currentPageOrigY == 0) - { - auto eventDispatcher = Director::getInstance()->getEventDispatcher(); - eventDispatcher->dispatchCustomEvent(EVENT_PURGE_TEXTURES,this); - } - else - { - auto pixelFormat = fontTTf->getOutlineSize() > 0 ? Texture2D::PixelFormat::AI88 : Texture2D::PixelFormat::A8; - - _atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, - pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) ); - } + _rendererRecreate = true; + auto eventDispatcher = Director::getInstance()->getEventDispatcher(); + eventDispatcher->dispatchCustomEvent(EVENT_PURGE_TEXTURES,this); + _rendererRecreate = false; } -#endif } void FontAtlas::addLetterDefinition(const FontLetterDefinition &letterDefinition) @@ -223,7 +197,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String) FontFreeType* fontTTf = dynamic_cast(_font); if(fontTTf == nullptr) return false; - + size_t length = utf16String.length(); float offsetAdjust = _letterPadding / 2; @@ -333,17 +307,25 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String) if(existNewLetter) { - unsigned char *data = nullptr; - if(pixelFormat == Texture2D::PixelFormat::AI88) + if (_rendererRecreate) { - data = _currentPageData + CacheTextureWidth * (int)startY * 2; - } + _atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, + pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) ); + } else { - data = _currentPageData + CacheTextureWidth * (int)startY; + unsigned char *data = nullptr; + if(pixelFormat == Texture2D::PixelFormat::AI88) + { + data = _currentPageData + CacheTextureWidth * (int)startY * 2; + } + else + { + data = _currentPageData + CacheTextureWidth * (int)startY; + } + _atlasTextures[_currentPage]->updateWithData(data, 0, startY, + CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight); } - _atlasTextures[_currentPage]->updateWithData(data, 0, startY, - CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight); } return true; } diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index f55c6938d9..56a76bca29 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -84,15 +84,10 @@ public: Texture2D* getTexture(int slot); const Font* getFont() const; - /** Listen "come to background" message, and clear the texture atlas. - It only has effect on Android. + /** listen the event that renderer was recreated on Android/WP8 + It only has effect on Android and WP8. */ - void listenToBackground(EventCustom *event); - - /** Listen "come to foreground" message and restore the texture atlas. - It only has effect on Android. - */ - void listenToForeground(EventCustom *event); + void listenRendererRecreated(EventCustom *event); /** Removes textures atlas. It will purge the textures atlas and if multiple texture exist in the FontAtlas. @@ -129,9 +124,9 @@ private: bool _makeDistanceMap; int _fontAscender; - EventListenerCustom* _toBackgroundListener; - EventListenerCustom* _toForegroundListener; + EventListenerCustom* _rendererRecreatedListener; bool _antialiasEnabled; + bool _rendererRecreate; }; diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index e7ac43edf1..6071882ea9 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -266,20 +266,13 @@ Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = Te setAnchorPoint(Vec2::ANCHOR_MIDDLE); reset(); -#if CC_ENABLE_CACHE_TEXTURE_DATA - auto toBackgroundListener = EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, [this](EventCustom* event){ - if (_fontAtlas && _currentLabelType == LabelType::TTF) - { - _batchNodes.clear(); - _batchNodes.push_back(this); - Node::removeAllChildrenWithCleanup(true); - } - }); - _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this); -#endif auto purgeTextureListener = EventListenerCustom::create(FontAtlas::EVENT_PURGE_TEXTURES, [this](EventCustom* event){ if (_fontAtlas && _currentLabelType == LabelType::TTF && event->getUserData() == _fontAtlas) { + Node::removeAllChildrenWithCleanup(true); + _batchNodes.clear(); + _batchNodes.push_back(this); + alignText(); } }); diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index be8c324ed2..886091396d 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -133,6 +133,11 @@ bool LabelAtlas::initWithString(const std::string& theString, const std::string& //CCLabelAtlas - Atlas generation void LabelAtlas::updateAtlasValues() { + if(_itemsPerRow == 0) + { + return; + } + ssize_t n = _string.length(); const unsigned char *s = (unsigned char*)_string.c_str(); diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index 558cbdde19..753f744c88 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -884,7 +884,7 @@ LayerMultiplex * LayerMultiplex::create(Layer * layer, ...) LayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer) { - return LayerMultiplex::create(layer, NULL); + return LayerMultiplex::create(layer, nullptr); } LayerMultiplex* LayerMultiplex::create() diff --git a/cocos/2d/CCMenu.cpp b/cocos/2d/CCMenu.cpp index a118b3019b..5d9a861e48 100644 --- a/cocos/2d/CCMenu.cpp +++ b/cocos/2d/CCMenu.cpp @@ -25,7 +25,6 @@ THE SOFTWARE. ****************************************************************************/ #include "2d/CCMenu.h" #include "base/CCDirector.h" -#include "CCApplication.h" #include "base/CCTouch.h" #include "CCStdC.h" #include "base/CCEventListenerTouch.h" diff --git a/cocos/2d/CCMenuItem.cpp b/cocos/2d/CCMenuItem.cpp index ceda096b82..54146875dc 100644 --- a/cocos/2d/CCMenuItem.cpp +++ b/cocos/2d/CCMenuItem.cpp @@ -839,6 +839,18 @@ MenuItemToggle * MenuItemToggle::createWithTarget(Ref* target, SEL_MenuHandler s return ret; } +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +MenuItemToggle * MenuItemToggle::createWithCallbackVA(const ccMenuCallback &callback, MenuItem* item, ...) +{ + va_list args; + va_start(args, item); + MenuItemToggle *ret = new MenuItemToggle(); + ret->initWithCallback(callback, item, args); + ret->autorelease(); + va_end(args); + return ret; +} +#else MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callback, MenuItem* item, ...) { va_list args; @@ -849,6 +861,7 @@ MenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callba va_end(args); return ret; } +#endif MenuItemToggle * MenuItemToggle::create() { diff --git a/cocos/2d/CCMenuItem.h b/cocos/2d/CCMenuItem.h index 2152046acc..b089f914d4 100644 --- a/cocos/2d/CCMenuItem.h +++ b/cocos/2d/CCMenuItem.h @@ -478,7 +478,25 @@ public: /** creates a menu item from a Array with a callable object */ static MenuItemToggle * createWithCallback(const ccMenuCallback& callback, const Vector& menuItems); /** creates a menu item from a list of items with a callable object */ +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + // WP8 in VS2012 does not support nullptr in variable args lists and variadic templates are also not supported + typedef MenuItem* M; + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, M m6, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, m6, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, M m6, M m7, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, m6, m7, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, M m6, M m7, M m8, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, m6, m7, m8, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, M m6, M m7, M m8, M m9, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, m6, m7, m8, m9, NULL); } + static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, M m1, M m2, M m3, M m4, M m5, M m6, M m7, M m8, M m9, M m10, std::nullptr_t listEnd) { return createWithCallbackVA(callback, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, NULL); } + + // On WP8 for lists longer than 10 items, use createWithArray or variadicCreate with NULL as the last argument + static MenuItemToggle* createWithCallbackVA(const ccMenuCallback& callback, M item, ...); +#else static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION; +#endif /** creates a menu item with no target/selector and no items */ static MenuItemToggle* create(); /** creates a menu item with a item */ diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index 37edc2573c..2a52bd1a2d 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -842,23 +842,13 @@ void Node::enumerateChildren(const std::string &name, std::function 2 && name[0] == '/' && name[1] == '/') { - if (length > 2 && name[1] == '/') - { - searchFromRootRecursive = true; - subStrStartPos = 2; - subStrlength -= 2; - } - else - { - searchFromRoot = true; - subStrStartPos = 1; - subStrlength -= 1; - } + searchRecursively = true; + subStrStartPos = 2; + subStrlength -= 2; } // End with '/..'? @@ -872,7 +862,7 @@ void Node::enumerateChildren(const std::string &name, std::functiondoEnumerate(newName, callback); - } - } - else if (searchFromRootRecursive) + + if (searchRecursively) { // name is '//xxx' - auto root = getScene(); - if (root) - { - doEnumerateRecursive(root, newName, callback); - } + doEnumerateRecursive(this, newName, callback); } else { @@ -1305,6 +1283,9 @@ Mat4 Node::transform(const Mat4& parentTransform) void Node::onEnter() { + if (_onEnterCallback) + _onEnterCallback(); + #if CC_ENABLE_SCRIPT_BINDING if (_scriptType == kScriptTypeJavascript) { @@ -1332,6 +1313,9 @@ void Node::onEnter() void Node::onEnterTransitionDidFinish() { + if (_onEnterTransitionDidFinishCallback) + _onEnterTransitionDidFinishCallback(); + #if CC_ENABLE_SCRIPT_BINDING if (_scriptType == kScriptTypeJavascript) { @@ -1354,6 +1338,9 @@ void Node::onEnterTransitionDidFinish() void Node::onExitTransitionDidStart() { + if (_onExitTransitionDidStartCallback) + _onExitTransitionDidStartCallback(); + #if CC_ENABLE_SCRIPT_BINDING if (_scriptType == kScriptTypeJavascript) { @@ -1375,6 +1362,9 @@ void Node::onExitTransitionDidStart() void Node::onExit() { + if (_onExitCallback) + _onExitCallback(); + #if CC_ENABLE_SCRIPT_BINDING if (_scriptType == kScriptTypeJavascript) { @@ -1623,17 +1613,19 @@ const Mat4& Node::getNodeToParentTransform() const bool needsSkewMatrix = ( _skewX || _skewY ); + Vec2 anchorPoint; + anchorPoint.x = _anchorPointInPoints.x * _scaleX; + anchorPoint.y = _anchorPointInPoints.y * _scaleY; // optimization: // inline anchor point calculation if skew is not needed // Adjusted transform calculation for rotational skew if (! needsSkewMatrix && !_anchorPointInPoints.equals(Vec2::ZERO)) { - x += cy * -_anchorPointInPoints.x * _scaleX + -sx * -_anchorPointInPoints.y * _scaleY; - y += sy * -_anchorPointInPoints.x * _scaleX + cx * -_anchorPointInPoints.y * _scaleY; + x += cy * -anchorPoint.x + -sx * -anchorPoint.y; + y += sy * -anchorPoint.x + cx * -anchorPoint.y; } - // Build Transform Matrix // Adjusted transform calculation for rotational skew float mat[] = { @@ -1644,6 +1636,11 @@ const Mat4& Node::getNodeToParentTransform() const _transform.set(mat); + if(!_ignoreAnchorPointForPosition) + { + _transform.translate(anchorPoint.x, anchorPoint.y, 0); + } + // XXX // FIX ME: Expensive operation. // FIX ME: It should be done together with the rotationZ @@ -1658,6 +1655,11 @@ const Mat4& Node::getNodeToParentTransform() const _transform = _transform * rotX; } + if(!_ignoreAnchorPointForPosition) + { + _transform.translate(-anchorPoint.x, -anchorPoint.y, 0); + } + // XXX: Try to inline skew // If skew is needed, apply skew and then anchor point if (needsSkewMatrix) diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 6e70e85731..7b26969cea 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -714,23 +714,19 @@ public: virtual Node* getChildByName(const std::string& name) const; /** Search the children of the receiving node to perform processing for nodes which share a name. * - * @param name The name to search for, supports c++11 regular expression + * @param name The name to search for, supports c++11 regular expression. * Search syntax options: - * `/` : When placed at the start of the search string, this indicates that the search should be performed on the tree's node. - * `//`: Can only be placed at the begin of the search string. This indicates that the search should be performed on the tree's node - * and be performed recursively across the entire node tree. + * `//`: Can only be placed at the begin of the search string. This indicates that it will search recursively. * `..`: The search should move up to the node's parent. Can only be placed at the end of string - * `/` : When placed anywhere but the start of the search string, this indicates that the search should move to the node's children + * `/` : When placed anywhere but the start of the search string, this indicates that the search should move to the node's children. * * @code - * enumerateChildren("/MyName", ...): This searches the root's children and matches any node with the name `MyName`. - * enumerateChildren("//MyName", ...): This searches the root's children recursively and matches any node with the name `MyName`. + * enumerateChildren("//MyName", ...): This searches the children recursively and matches any node with the name `MyName`. * enumerateChildren("[[:alnum:]]+", ...): This search string matches every node of its children. - * enumerateChildren("/MyName", ...): This searches the node tree and matches the parent node of every node named `MyName`. * enumerateChildren("A[[:digit:]]", ...): This searches the node's children and returns any child named `A0`, `A1`, ..., `A9` * enumerateChildren("Abby/Normal", ...): This searches the node's grandchildren and returns any node whose name is `Normal` * and whose parent is named `Abby`. - * enumerateChildren("//Abby/Normal", ...): This searches the node tree and returns any node whose name is `Normal` and whose + * enumerateChildren("//Abby/Normal", ...): This searches recursively and returns any node whose name is `Normal` and whose * parent is named `Abby`. * @endcode * @@ -1466,7 +1462,16 @@ public: virtual void setOpacityModifyRGB(bool value) {CC_UNUSED_PARAM(value);} virtual bool isOpacityModifyRGB() const { return false; }; - + + void setOnEnterCallback(const std::function& callback) { _onEnterCallback = callback; } + const std::function& getOnEnterCallback() const { return _onEnterCallback; } + void setOnExitCallback(const std::function& callback) { _onExitCallback = callback; } + const std::function& getOnExitCallback() const { return _onExitCallback; } + void setonEnterTransitionDidFinishCallback(const std::function& callback) { _onEnterTransitionDidFinishCallback = callback; } + const std::function& getonEnterTransitionDidFinishCallback() const { return _onEnterTransitionDidFinishCallback; } + void setonExitTransitionDidStartCallback(const std::function& callback) { _onExitTransitionDidStartCallback = callback; } + const std::function& getonExitTransitionDidStartCallback() const { return _onExitTransitionDidStartCallback; } + CC_CONSTRUCTOR_ACCESS: // Nodes should be created using create(); Node(); @@ -1605,6 +1610,11 @@ protected: static int s_globalOrderOfArrival; + std::function _onEnterCallback; + std::function _onExitCallback; + std::function _onEnterTransitionDidFinishCallback; + std::function _onExitTransitionDidStartCallback; + private: CC_DISALLOW_COPY_AND_ASSIGN(Node); diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index 70143fe75f..44f707a46f 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -135,7 +135,7 @@ bool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles) #if CC_ENABLE_CACHE_TEXTURE_DATA // Need to listen the event only when not use batchnode, because it will use VBO - auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(ParticleSystemQuad::listenBackToForeground, this)); + auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(ParticleSystemQuad::listenRendererRecreated, this)); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); #endif @@ -509,7 +509,7 @@ void ParticleSystemQuad::setupVBO() CHECK_GL_ERROR_DEBUG(); } -void ParticleSystemQuad::listenBackToForeground(EventCustom* event) +void ParticleSystemQuad::listenRendererRecreated(EventCustom* event) { if (Configuration::getInstance()->supportsShareableVAO()) { diff --git a/cocos/2d/CCParticleSystemQuad.h b/cocos/2d/CCParticleSystemQuad.h index b3a701c1ba..73386f152d 100644 --- a/cocos/2d/CCParticleSystemQuad.h +++ b/cocos/2d/CCParticleSystemQuad.h @@ -81,11 +81,11 @@ public: */ void setTextureWithRect(Texture2D *texture, const Rect& rect); - /** listen the event that coming to foreground on Android + /** listen the event that renderer was recreated on Android/WP8 * @js NA * @lua NA */ - void listenBackToForeground(EventCustom* event); + void listenRendererRecreated(EventCustom* event); /** * @js NA diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 487a6b328d..0ca9b2bded 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -85,6 +85,10 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity) CCASSERT(capacity>=0, "Capacity must be >= 0"); _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; + if(tex->hasPremultipliedAlpha()) + { + _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; + } _textureAtlas = new TextureAtlas(); if (capacity == 0) diff --git a/cocos/2d/cocos2d.vcxproj b/cocos/2d/cocos2d.vcxproj index 50db022b6f..9e8280f3a4 100644 --- a/cocos/2d/cocos2d.vcxproj +++ b/cocos/2d/cocos2d.vcxproj @@ -222,7 +222,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou - diff --git a/cocos/2d/cocos2d_winrt.vcxproj b/cocos/2d/cocos2d_winrt.vcxproj index 878c3072e7..54bec1007c 100644 --- a/cocos/2d/cocos2d_winrt.vcxproj +++ b/cocos/2d/cocos2d_winrt.vcxproj @@ -353,7 +353,6 @@ - diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index ba2f24834b..f6416d1bca 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -280,7 +280,6 @@ - diff --git a/cocos/2d/cocos2d_wp8_headers.props b/cocos/2d/cocos2d_wp8_headers.props index d9e60d6d8c..ca110ab470 100644 --- a/cocos/2d/cocos2d_wp8_headers.props +++ b/cocos/2d/cocos2d_wp8_headers.props @@ -7,7 +7,7 @@ - $(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(GeneratedFilesDir) + $(EngineRoot)cocos\platform\wp8;$(EngineRoot)cocos\platform\winrt;$(EngineRoot)\external\winrt-specific\angle\include;$(EngineRoot)\external\curl\include\wp8;$(EngineRoot)\external\winrt-specific;$(EngineRoot)cocos\audio\include;$(EngineRoot)cocos;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)external;$(EngineRoot)cocos\editor-support;$(EngineRoot);$(EngineRoot)external\ConvertUTF;$(EngineRoot)external\wp8-specific\zlib\include;$(GeneratedFilesDir) _VARIADIC_MAX=10;NOMINMAX;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true true diff --git a/cocos/3d/CCAnimate3D.cpp b/cocos/3d/CCAnimate3D.cpp index 5f13d70cc7..da1e2c6a80 100644 --- a/cocos/3d/CCAnimate3D.cpp +++ b/cocos/3d/CCAnimate3D.cpp @@ -66,12 +66,12 @@ Animate3D* Animate3D::clone() const auto animate = const_cast(this); auto copy = Animate3D::create(animate->_animation); - copy->_speed = _speed; + copy->_absSpeed = _absSpeed; copy->_weight = _weight; copy->_elapsed = _elapsed; copy->_start = _start; copy->_last = _last; - copy->_playBack = _playBack; + copy->_playReverse = _playReverse; copy->setDuration(animate->getDuration()); return copy; @@ -81,7 +81,7 @@ Animate3D* Animate3D::clone() const Animate3D* Animate3D::reverse() const { auto animate = clone(); - animate->_playBack = !animate->_playBack; + animate->_playReverse = !animate->_playReverse; return animate; } @@ -112,16 +112,16 @@ void Animate3D::startWithTarget(Node *target) //! called every frame with it's delta time. DON'T override unless you know what you are doing. void Animate3D::step(float dt) { - ActionInterval::step(dt * _speed); + ActionInterval::step(dt * _absSpeed); } void Animate3D::update(float t) { - if (_target) + if (_target && _weight > 0.f) { float transDst[3], rotDst[4], scaleDst[3]; float* trans = nullptr, *rot = nullptr, *scale = nullptr; - if (_playBack) + if (_playReverse) t = 1 - t; t = _start + t * _last; @@ -149,13 +149,29 @@ void Animate3D::update(float t) } +float Animate3D::getSpeed() const +{ + return _playReverse ? -_absSpeed : _absSpeed; +} +void Animate3D::setSpeed(float speed) +{ + _absSpeed = fabsf(speed); + _playReverse = speed < 0; +} + +void Animate3D::setWeight(float weight) +{ + CCASSERT(weight >= 0.0f, "invalid weight"); + _weight = fabsf(weight); +} + Animate3D::Animate3D() -: _speed(1) +: _absSpeed(1.f) , _weight(1.f) , _start(0.f) , _last(1.f) , _animation(nullptr) -, _playBack(false) +, _playReverse(false) { } diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index fbda6328b5..ba8ccee7ae 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -32,12 +32,13 @@ #include "base/ccMacros.h" #include "base/CCRef.h" #include "base/ccTypes.h" +#include "base/CCPlatformMacros.h" #include "2d/CCActionInterval.h" NS_CC_BEGIN class Animation3D; -class Bone; +class Bone3D; /** * Animate3D, Animates a Sprite3D given with an Animation3D */ @@ -66,17 +67,17 @@ public: virtual void update(float t) override; - /**get & set speed */ - float getSpeed() const { return _speed; } - void setSpeed(float speed) { _speed = speed; } + /**get & set speed, negative speed means playing reverse */ + float getSpeed() const; + void setSpeed(float speed); - /**get & set blend weight*/ + /**get & set blend weight, weight must positive*/ float getWeight() const { return _weight; } - void setWeight(float weight) { _weight = weight; } + void setWeight(float weight); - /**get & set play back*/ - bool getPlayBack() const { return _playBack; } - void setPlayBack(bool playBack) { _playBack = playBack; } + /**get & set play reverse, these are deprecated, use set negative speed instead*/ + CC_DEPRECATED_ATTRIBUTE bool getPlayBack() const { return _playReverse; } + CC_DEPRECATED_ATTRIBUTE void setPlayBack(bool reverse) { _playReverse = reverse; } CC_CONSTRUCTOR_ACCESS: @@ -86,12 +87,12 @@ CC_CONSTRUCTOR_ACCESS: protected: Animation3D* _animation; //animation data - float _speed; //playing speed + float _absSpeed; //playing speed float _weight; //blend weight float _start; //start time 0 - 1, used to generate sub Animate3D float _last; //last time 0 - 1, used to generate sub Animate3D - bool _playBack; // is playing back - std::map _boneCurves; //weak ref + bool _playReverse; // is playing reverse + std::map _boneCurves; //weak ref }; NS_CC_END diff --git a/cocos/3d/CCAnimation3D.cpp b/cocos/3d/CCAnimation3D.cpp index 9455a3e47e..611b130fe1 100644 --- a/cocos/3d/CCAnimation3D.cpp +++ b/cocos/3d/CCAnimation3D.cpp @@ -30,7 +30,7 @@ NS_CC_BEGIN -Animation3D* Animation3D::getOrCreate(const std::string& fileName, const std::string& animationName) +Animation3D* Animation3D::create(const std::string& fileName, const std::string& animationName) { std::string fullPath = FileUtils::getInstance()->fullPathForFilename(fileName); std::string key = fullPath + "#" + animationName; diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index a6f2a30a96..1d18cf6b0a 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -59,8 +59,10 @@ public: ~Curve(); }; - /**read all animation or only the animation with given animationName? animationName == "" read all.*/ - static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = ""); + /**read all animation or only the animation with given animationName? animationName == "" read the first.*/ + static Animation3D* create(const std::string& filename, const std::string& animationName = ""); + + CC_DEPRECATED_ATTRIBUTE static Animation3D* getOrCreate(const std::string& filename, const std::string& animationName = ""){ return create(filename, animationName); } /**get duration*/ float getDuration() const { return _duration; } diff --git a/cocos/3d/CCBundle3D.cpp b/cocos/3d/CCBundle3D.cpp index 754aa67f60..991aaec32d 100644 --- a/cocos/3d/CCBundle3D.cpp +++ b/cocos/3d/CCBundle3D.cpp @@ -447,8 +447,7 @@ bool Bundle3D::loadBinary(const std::string& path) return false; } - // Create bundle reader - //CC_SAFE_DELETE(_bundleReader); + // Initialise bundle reader _binaryReader.init( (char*)_binaryBuffer->getBytes(), _binaryBuffer->getSize() ); // Read identifier info @@ -463,20 +462,23 @@ bool Bundle3D::loadBinary(const std::string& path) // Read version unsigned char ver[2]; - if (_binaryReader.read(ver, 1, 2) == 2) - { - if (ver[0] != 0) { - clear(); - CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]); - return false; - } - - if (ver[1] <= 0 || ver[1] > 2) { - clear(); - CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]); - return false; - } + if (_binaryReader.read(ver, 1, 2)!= 2){ + CCLOG("Failed to read version:"); + return false; } + + if (ver[0] != 0) { + clear(); + CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]); + return false; + } + + if (ver[1] <= 0 || ver[1] > 2) { + clear(); + CCLOGINFO(false, "Unsupported version: (%d, %d)", ver[0], ver[1]); + return false; + } + // Read ref table size if (_binaryReader.read(&_referenceCount, 4, 1) != 1) @@ -766,17 +768,37 @@ bool Bundle3D::loadAnimationDataBinary(Animation3DData* animationdata) GLenum Bundle3D::parseGLType(const std::string& str) { - if (str == "GL_FLOAT") + if (str == "GL_BYTE") { - return GL_FLOAT; + return GL_BYTE; + } + else if(str == "GL_UNSIGNED_BYTE") + { + return GL_UNSIGNED_BYTE; + } + else if(str == "GL_SHORT") + { + return GL_SHORT; + } + else if(str == "GL_UNSIGNED_SHORT") + { + return GL_UNSIGNED_SHORT; + } + else if(str == "GL_INT") + { + return GL_INT; } else if (str == "GL_UNSIGNED_INT") { return GL_UNSIGNED_INT; } + else if (str == "GL_FLOAT") + { + return GL_FLOAT; + } else { - assert(0); + CCASSERT(false, "Wrong GL type"); return 0; } } diff --git a/cocos/3d/CCBundleReader.cpp b/cocos/3d/CCBundleReader.cpp index 2bdeda2c43..b3974b07f5 100644 --- a/cocos/3d/CCBundleReader.cpp +++ b/cocos/3d/CCBundleReader.cpp @@ -5,7 +5,7 @@ NS_CC_BEGIN BundleReader::BundleReader() { - m_buffer = NULL; + m_buffer = nullptr; m_position = 0; m_length = 0; }; @@ -65,7 +65,7 @@ char* BundleReader::readLine(int num,char* line) char* p = line; char c; ssize_t readNum = 0; - while((c=*buffer) != 10 && readNum < (ssize_t)num && m_position<(long int)m_length) + while((c=*buffer) != 10 && readNum < (ssize_t)num && m_position < m_length) { *p = c; p++; @@ -91,7 +91,7 @@ ssize_t BundleReader::length() return m_length; } -long int BundleReader::tell() +ssize_t BundleReader::tell() { if (!m_buffer) return -1; @@ -123,7 +123,7 @@ bool BundleReader::seek(long int offset, int origin) bool BundleReader::rewind() { - if (m_buffer != NULL) + if (m_buffer != nullptr) { m_position = 0; return true; diff --git a/cocos/3d/CCBundleReader.h b/cocos/3d/CCBundleReader.h index b991412d8f..4efc71f368 100644 --- a/cocos/3d/CCBundleReader.h +++ b/cocos/3d/CCBundleReader.h @@ -112,7 +112,7 @@ public: bool readMatrix(float* m); private: - long int m_position; + ssize_t m_position; ssize_t m_length; char* m_buffer; }; @@ -136,6 +136,7 @@ inline bool BundleReader::readArray(unsigned int *length, std::vector *values { return false; } + if (*length > 0 && values) { values->resize(*length); diff --git a/cocos/3d/CCMesh.cpp b/cocos/3d/CCMesh.cpp index f3a5050c3c..c0511afad1 100644 --- a/cocos/3d/CCMesh.cpp +++ b/cocos/3d/CCMesh.cpp @@ -125,7 +125,7 @@ bool RenderMeshData::init(const std::vector& positions, return true; } -bool RenderMeshData::init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount) +bool RenderMeshData::init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, const std::vector& attribs) { _vertexs = vertices; _indices = indices; @@ -174,10 +174,10 @@ Mesh* Mesh::create(const std::vector& positions, const std::vector return nullptr; } -Mesh* Mesh::create(const std::vector &vertices, int vertexSizeInFloat, const std::vector &indices, int numIndex, const std::vector &attribs, int attribCount) +Mesh* Mesh::create(const std::vector &vertices, int vertexSizeInFloat, const std::vector &indices, const std::vector &attribs) { auto mesh = new Mesh(); - if (mesh && mesh->init(vertices, vertexSizeInFloat, indices, numIndex, attribs, attribCount)) + if (mesh && mesh->init(vertices, vertexSizeInFloat, indices, attribs)) { mesh->autorelease(); return mesh; @@ -192,17 +192,17 @@ bool Mesh::init(const std::vector& positions, const std::vector& n if (!bRet) return false; - restore(); + buildBuffer(); return true; } -bool Mesh::init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount) +bool Mesh::init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, const std::vector& attribs) { - bool bRet = _renderdata.init(vertices, vertexSizeInFloat, indices, numIndex, attribs, attribCount); + bool bRet = _renderdata.init(vertices, vertexSizeInFloat, indices, attribs); if (!bRet) return false; - restore(); + buildBuffer(); return true; } @@ -242,20 +242,20 @@ void Mesh::buildBuffer() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); unsigned int indexSize = 2; - IndexFormat indexformat = IndexFormat::INDEX16; glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexSize * _renderdata._indices.size(), &_renderdata._indices[0], GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); _primitiveType = PrimitiveType::TRIANGLES; - _indexFormat = indexformat; + _indexFormat = IndexFormat::INDEX16; _indexCount = _renderdata._indices.size(); } void Mesh::restore() { - cleanAndFreeBuffers(); + _vertexBuffer = 0; + _indexBuffer = 0; buildBuffer(); } @@ -322,22 +322,22 @@ void MeshCache::removeUnusedMesh() MeshCache::MeshCache() { -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - // listen the event when app go to foreground - _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(MeshCache::listenBackToForeground, this)); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + // listen the event that renderer was recreated on Android/WP8 + _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(MeshCache::listenRendererRecreated, this)); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_rendererRecreatedListener, -1); #endif } MeshCache::~MeshCache() { removeAllMeshes(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -void MeshCache::listenBackToForeground(EventCustom* event) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +void MeshCache::listenRendererRecreated(EventCustom* event) { for (auto iter = _meshes.begin(); iter != _meshes.end(); ++iter) { diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 176e802105..eb6a959286 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -49,7 +49,7 @@ public: } bool hasVertexAttrib(int attrib); bool init(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); - bool init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount); + bool init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, const std::vector& attribs); protected: @@ -90,7 +90,10 @@ public: static Mesh* create(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); /**create mesh with vertex attributes*/ - static Mesh* create(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount); + CC_DEPRECATED_ATTRIBUTE static Mesh* create(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount) { return create(vertices, vertexSizeInFloat, indices, attribs); } + + /**create mesh with vertex attributes*/ + static Mesh* create(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, const std::vector& attribs); /**get vertex buffer*/ inline GLuint getVertexBuffer() const { return _vertexBuffer; } @@ -124,7 +127,7 @@ CC_CONSTRUCTOR_ACCESS: bool init(const std::vector& positions, const std::vector& normals, const std::vector& texs, const std::vector& indices); /**init mesh*/ - bool init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, int numIndex, const std::vector& attribs, int attribCount); + bool init(const std::vector& vertices, int vertexSizeInFloat, const std::vector& indices, const std::vector& attribs); /**build buffer*/ void buildBuffer(); @@ -163,8 +166,8 @@ public: /**remove unused meshes*/ void removeUnusedMesh(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - void listenBackToForeground(EventCustom* event); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + void listenRendererRecreated(EventCustom* event); #endif CC_CONSTRUCTOR_ACCESS: @@ -178,8 +181,8 @@ protected: std::unordered_map _meshes; //cached meshes -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - EventListenerCustom* _backToForegroundlistener; +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/cocos/3d/CCMeshSkin.cpp b/cocos/3d/CCMeshSkin.cpp index 64add14d67..3e8d563888 100644 --- a/cocos/3d/CCMeshSkin.cpp +++ b/cocos/3d/CCMeshSkin.cpp @@ -36,22 +36,22 @@ NS_CC_BEGIN * * @param m C3DMatrix representing the inverse bind pose for this Bone. */ -void Bone::setInverseBindPose(const Mat4& m) +void Bone3D::setInverseBindPose(const Mat4& m) { _invBindPose = m; } -const Mat4& Bone::getInverseBindPose() +const Mat4& Bone3D::getInverseBindPose() { return _invBindPose; } -void Bone::setOriPose(const Mat4& m) +void Bone3D::setOriPose(const Mat4& m) { _oriPose = m; } -void Bone::resetPose() +void Bone3D::resetPose() { _local =_oriPose; @@ -60,7 +60,7 @@ void Bone::resetPose() } } -void Bone::setWorldMatDirty(bool dirty) +void Bone3D::setWorldMatDirty(bool dirty) { _worldDirty = dirty; for (auto it : _children) { @@ -69,7 +69,7 @@ void Bone::setWorldMatDirty(bool dirty) } //update own world matrix and children's -void Bone::updateWorldMat() +void Bone3D::updateWorldMat() { getWorldMat(); for (auto itor : _children) { @@ -77,7 +77,7 @@ void Bone::updateWorldMat() } } -const Mat4& Bone::getWorldMat() +const Mat4& Bone3D::getWorldMat() { if (_worldDirty) { @@ -95,7 +95,7 @@ const Mat4& Bone::getWorldMat() return _world; } -void Bone::setAnimationValue(float* trans, float* rot, float* scale, void* tag, float weight) +void Bone3D::setAnimationValue(float* trans, float* rot, float* scale, void* tag, float weight) { for (auto& it : _blendStates) { if (it.tag == tag) @@ -124,7 +124,7 @@ void Bone::setAnimationValue(float* trans, float* rot, float* scale, void* tag, _blendStates.push_back(state); } -void Bone::clearBoneBlendState() +void Bone3D::clearBoneBlendState() { _blendStates.clear(); for (auto it : _children) { @@ -135,14 +135,14 @@ void Bone::clearBoneBlendState() /** * Creates C3DBone. */ -Bone* Bone::create(const std::string& id) +Bone3D* Bone3D::create(const std::string& id) { - auto bone = new Bone(id); + auto bone = new Bone3D(id); bone->autorelease(); return bone; } -void Bone::updateJointMatrix(Vec4* matrixPalette) +void Bone3D::updateJointMatrix(Vec4* matrixPalette) { { static Mat4 t; @@ -154,37 +154,37 @@ void Bone::updateJointMatrix(Vec4* matrixPalette) } } -Bone* Bone::getParentBone() +Bone3D* Bone3D::getParentBone() { return _parent; } -ssize_t Bone::getChildBoneCount() const +ssize_t Bone3D::getChildBoneCount() const { return _children.size(); } -Bone* Bone::getChildBoneByIndex(int index) +Bone3D* Bone3D::getChildBoneByIndex(int index) { return _children.at(index); } -void Bone::addChildBone(Bone* bone) +void Bone3D::addChildBone(Bone3D* bone) { if (_children.find(bone) == _children.end()) _children.pushBack(bone); } -void Bone::removeChildBoneByIndex(int index) +void Bone3D::removeChildBoneByIndex(int index) { _children.erase(index); } -void Bone::removeChildBone(Bone* bone) +void Bone3D::removeChildBone(Bone3D* bone) { _children.eraseObject(bone); } -void Bone::removeAllChildBone() +void Bone3D::removeAllChildBone() { _children.clear(); } -Bone::Bone(const std::string& id) +Bone3D::Bone3D(const std::string& id) : _name(id) , _parent(nullptr) , _worldDirty(true) @@ -192,12 +192,12 @@ Bone::Bone(const std::string& id) } -Bone::~Bone() +Bone3D::~Bone3D() { removeAllChildBone(); } -void Bone::updateLocalMat() +void Bone3D::updateLocalMat() { if (_blendStates.size()) { @@ -299,13 +299,13 @@ bool MeshSkin::initFromSkinData(const SkinData& skindata) { ssize_t i = 0; for (; i < skindata.skinBoneNames.size(); i++) { - auto bone = Bone::create(skindata.skinBoneNames[i]); + auto bone = Bone3D::create(skindata.skinBoneNames[i]); bone->_invBindPose = skindata.inverseBindPoseMatrices[i]; bone->setOriPose(skindata.skinBoneOriginMatrices[i]); addSkinBone(bone); } for (i = 0; i < skindata.nodeBoneNames.size(); i++) { - auto bone = Bone::create(skindata.nodeBoneNames[i]); + auto bone = Bone3D::create(skindata.nodeBoneNames[i]); bone->setOriPose(skindata.nodeBoneOriginMatrices[i]); addNodeBone(bone); } @@ -330,7 +330,7 @@ ssize_t MeshSkin::getBoneCount() const } //get bone -Bone* MeshSkin::getBoneByIndex(unsigned int index) const +Bone3D* MeshSkin::getBoneByIndex(unsigned int index) const { if (index < _skinBones.size()) return _skinBones.at(index); @@ -340,7 +340,7 @@ Bone* MeshSkin::getBoneByIndex(unsigned int index) const return nullptr; } -Bone* MeshSkin::getBoneByName(const std::string& id) const +Bone3D* MeshSkin::getBoneByName(const std::string& id) const { //search from skin bones for (auto it : _skinBones) { @@ -355,18 +355,18 @@ Bone* MeshSkin::getBoneByName(const std::string& id) const return nullptr; } -Bone* MeshSkin::getRootBone() const +Bone3D* MeshSkin::getRootBone() const { return _rootBone; } -void MeshSkin::setRootBone(Bone* joint) +void MeshSkin::setRootBone(Bone3D* joint) { CC_SAFE_RETAIN(joint); CC_SAFE_RELEASE(_rootBone); _rootBone = joint; } -int MeshSkin::getBoneIndex(Bone* bone) const +int MeshSkin::getBoneIndex(Bone3D* bone) const { int i = 0; for (; i < _skinBones.size(); i++) { @@ -419,12 +419,12 @@ void MeshSkin::removeAllBones() CC_SAFE_RELEASE(_rootBone); } -void MeshSkin::addSkinBone(Bone* bone) +void MeshSkin::addSkinBone(Bone3D* bone) { _skinBones.pushBack(bone); } -void MeshSkin::addNodeBone(Bone* bone) +void MeshSkin::addNodeBone(Bone3D* bone) { _nodeBones.pushBack(bone); } diff --git a/cocos/3d/CCMeshSkin.h b/cocos/3d/CCMeshSkin.h index eaeaa03467..b031afeefb 100644 --- a/cocos/3d/CCMeshSkin.h +++ b/cocos/3d/CCMeshSkin.h @@ -40,7 +40,7 @@ NS_CC_BEGIN /** * Defines a basic hierachial structure of transformation spaces. */ -class Bone : public Ref +class Bone3D : public Ref { friend class MeshSkin; public: @@ -76,7 +76,7 @@ public: /** * Creates C3DBone. */ - static Bone* create(const std::string& id); + static Bone3D* create(const std::string& id); /** * Sets the inverse bind pose matrix. @@ -105,17 +105,17 @@ public: void updateJointMatrix(Vec4* matrixPalette); /**bone tree, we do not inherit from Node, Node has too many properties that we do not need. A clean Node is needed.*/ - Bone* getParentBone(); + Bone3D* getParentBone(); /**get child bone count*/ ssize_t getChildBoneCount() const; /**get child bone by index*/ - Bone* getChildBoneByIndex(int index); + Bone3D* getChildBoneByIndex(int index); /**add child bone*/ - void addChildBone(Bone* bone); + void addChildBone(Bone3D* bone); /**remove child bone by index*/ void removeChildBoneByIndex(int index); /**remove child bone*/ - void removeChildBone(Bone* bone); + void removeChildBone(Bone3D* bone); /**remove all child bone*/ void removeAllChildBone(); @@ -143,12 +143,12 @@ protected: /** * Constructor. */ - Bone(const std::string& id); + Bone3D(const std::string& id); /** * Destructor. */ - virtual ~Bone(); + virtual ~Bone3D(); /** * Update local matrix @@ -166,9 +166,9 @@ protected: Mat4 _oriPose; //original bone pose - Bone* _parent; //parent bone + Bone3D* _parent; //parent bone - Vector _children; + Vector _children; bool _worldDirty; Mat4 _world; @@ -193,15 +193,15 @@ public: ssize_t getBoneCount() const; /**get bone*/ - Bone* getBoneByIndex(unsigned int index) const; - Bone* getBoneByName(const std::string& id) const; + Bone3D* getBoneByIndex(unsigned int index) const; + Bone3D* getBoneByName(const std::string& id) const; /**get & set root bone*/ - Bone* getRootBone() const; - void setRootBone(Bone* bone); + Bone3D* getRootBone() const; + void setRootBone(Bone3D* bone); /**get bone index*/ - int getBoneIndex(Bone* bone) const; + int getBoneIndex(Bone3D* bone) const; /**compute matrix palette used by gpu skin*/ Vec4* getMatrixPalette(); @@ -225,17 +225,17 @@ CC_CONSTRUCTOR_ACCESS: void removeAllBones(); /**add skin bone*/ - void addSkinBone(Bone* bone); + void addSkinBone(Bone3D* bone); /**add Node bone*/ - void addNodeBone(Bone* bone); + void addNodeBone(Bone3D* bone); protected: - Vector _skinBones; // bones with skin - Vector _nodeBones; //bones without skin, only used to compute transform of children + Vector _skinBones; // bones with skin + Vector _nodeBones; //bones without skin, only used to compute transform of children - Bone* _rootBone; + Bone3D* _rootBone; // Pointer to the array of palette matrices. // This array is passed to the vertex shader as a uniform. diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index f92e4dc475..a1244d2efb 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -193,7 +193,7 @@ bool Sprite3D::loadFromC3x(const std::string& path) return false; } - _mesh = Mesh::create(meshdata.vertex, meshdata.vertexSizeInFloat, meshdata.indices, meshdata.numIndex, meshdata.attribs, meshdata.attribCount); + _mesh = Mesh::create(meshdata.vertex, meshdata.vertexSizeInFloat, meshdata.indices, meshdata.attribs); CC_SAFE_RETAIN(_mesh); _skin = MeshSkin::create(fullPath, ""); @@ -342,7 +342,7 @@ void Sprite3D::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) _meshCommand.setDepthTestEnabled(true); if (_skin) { - _meshCommand.setMatrixPaletteSize(_skin->getMatrixPaletteSize()); + _meshCommand.setMatrixPaletteSize((int)_skin->getMatrixPaletteSize()); _meshCommand.setMatrixPalette(_skin->getMatrixPalette()); } //support tint and fade diff --git a/cocos/Android.mk b/cocos/Android.mk index 23cc18c905..219098f275 100644 --- a/cocos/Android.mk +++ b/cocos/Android.mk @@ -141,13 +141,8 @@ base/ccUTF8.cpp \ base/ccUtils.cpp \ base/etc1.cpp \ base/s3tc.cpp \ +base/CCController.cpp \ base/CCController-android.cpp \ -base/CCControllerAxisInput.cpp \ -base/CCControllerButtonInput.cpp \ -base/CCControllerDirectionPad.cpp \ -base/CCControllerElement.cpp \ -base/CCControllerThumbstick.cpp \ -base/CCGamepad.cpp \ base/ObjectFactory.cpp \ renderer/CCBatchCommand.cpp \ renderer/CCCustomCommand.cpp \ diff --git a/cocos/base/CCConsole.cpp b/cocos/base/CCConsole.cpp index 744d31ac80..e06185654c 100644 --- a/cocos/base/CCConsole.cpp +++ b/cocos/base/CCConsole.cpp @@ -222,7 +222,7 @@ static void _log(const char *format, va_list args) WCHAR wszBuf[MAX_LOG_LENGTH] = {0}; MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf)); OutputDebugStringW(wszBuf); - WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, buf, sizeof(buf), NULL, FALSE); + WideCharToMultiByte(CP_ACP, 0, wszBuf, -1, buf, sizeof(buf), nullptr, FALSE); printf("%s", buf); fflush(stdout); #else @@ -337,7 +337,7 @@ bool Console::listenOnTCP(int port) #endif #endif - if ( (n = getaddrinfo(NULL, serv, &hints, &res)) != 0) { + if ( (n = getaddrinfo(nullptr, serv, &hints, &res)) != 0) { fprintf(stderr,"net_listen error for %s: %s", serv, gai_strerror(n)); return false; } @@ -359,9 +359,9 @@ bool Console::listenOnTCP(int port) #else close(listenfd); #endif - } while ( (res = res->ai_next) != NULL); + } while ( (res = res->ai_next) != nullptr); - if (res == NULL) { + if (res == nullptr) { perror("net_listen:"); freeaddrinfo(ressave); return false; @@ -372,14 +372,14 @@ bool Console::listenOnTCP(int port) if (res->ai_family == AF_INET) { char buf[INET_ADDRSTRLEN] = ""; struct sockaddr_in *sin = (struct sockaddr_in*) res->ai_addr; - if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != NULL ) + if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != nullptr ) cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin_port)); else perror("inet_ntop"); } else if (res->ai_family == AF_INET6) { char buf[INET6_ADDRSTRLEN] = ""; struct sockaddr_in6 *sin = (struct sockaddr_in6*) res->ai_addr; - if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != NULL ) + if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != nullptr ) cocos2d::log("Console: listening on %s : %d", buf, ntohs(sin->sin6_port)); else perror("inet_ntop"); @@ -1042,7 +1042,7 @@ void Console::loop() copy_set = _read_set; timeout_copy = timeout; - int nready = select(_maxfd+1, ©_set, NULL, NULL, &timeout_copy); + int nready = select(_maxfd+1, ©_set, nullptr, nullptr, &timeout_copy); if( nready == -1 ) { diff --git a/cocos/base/CCConsole.h b/cocos/base/CCConsole.h index 7db9d397b3..9ab18ff443 100644 --- a/cocos/base/CCConsole.h +++ b/cocos/base/CCConsole.h @@ -47,6 +47,7 @@ typedef SSIZE_T ssize_t; #include #include +#include "base/CCRef.h" #include "base/ccMacros.h" #include "base/CCPlatformMacros.h" @@ -73,6 +74,7 @@ void CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2); #if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT) class CC_DLL Console + : public Ref { public: struct Command { diff --git a/cocos/base/CCController-android.cpp b/cocos/base/CCController-android.cpp index c268009de0..c87f75ef36 100644 --- a/cocos/base/CCController-android.cpp +++ b/cocos/base/CCController-android.cpp @@ -26,258 +26,94 @@ #include "CCController.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - -#include "CCGamepad.h" -#include "CCControllerDirectionPad.h" -#include "CCControllerButtonInput.h" -#include "CCControllerAxisInput.h" -#include "CCControllerThumbstick.h" - +#include #include "ccMacros.h" -#include "CCEventDispatcher.h" -#include "CCEventController.h" -#include "CCEventListenerController.h" #include "CCDirector.h" - #include "jni/JniHelper.h" - +#include "base/CCEventController.h" NS_CC_BEGIN -enum class AndroidControllerCode -{ - THUMBSTICK_LEFT_X = 100, - THUMBSTICK_LEFT_Y = 101, - THUMBSTICK_RIGHT_X = 102, - THUMBSTICK_RIGHT_Y = 103, - BUTTON_A = 110, - BUTTON_B = 111, - BUTTON_C = 112, - BUTTON_X = 113, - BUTTON_Y = 114, - BUTTON_Z = 115, - BUTTON_LEFT_SHOULDER = 120, - BUTTON_RIGHT_SHOULDER = 121, - BUTTON_LEFT_TRIGGER = 122, - BUTTON_RIGHT_TRIGGER = 123, - BUTTON_DPAD_UP = 130, - BUTTON_DPAD_DOWN = 131, - BUTTON_DPAD_LEFT = 132, - BUTTON_DPAD_RIGHT = 133, - BUTTON_DPAD_CENTER = 134, - BUTTON_LEFT_THUMBSTICK = 140, - BUTTON_RIGHT_THUMBSTICK = 141, - BUTTON_START = 150, - BUTTON_SELECT = 151, -}; - class ControllerImpl { public: ControllerImpl(Controller* controller) : _controller(controller) - , _controllerID(-1) { } - static std::vector::iterator findController(const std::string& vendorName, int controllerID) + static std::vector::iterator findController(const std::string& deviceName, int deviceId) { - auto iter = std::find_if(Controller::_controllers.begin(), Controller::_controllers.end(), [&](Controller* controller){ - return (vendorName == controller->getVendorName()) && (controllerID == controller->_impl->_controllerID); + auto iter = std::find_if(Controller::s_allController.begin(), Controller::s_allController.end(), [&](Controller* controller){ + return (deviceName == controller->_deviceName) && (deviceId == controller->_deviceId); }); + + return iter; } - static void onConnected(const std::string& vendorName, int controllerID) + static void onConnected(const std::string& deviceName, int deviceId) { // Check whether the controller is already connected. - auto iter = findController(vendorName, controllerID); - if (iter != Controller::_controllers.end()) + CCLOG("onConnected %s,%d", deviceName.c_str(),deviceId); + + auto iter = findController(deviceName, deviceId); + if (iter != Controller::s_allController.end()) return; // It's a new controller being connected. auto controller = new cocos2d::Controller(); - controller->_vendorName = vendorName; - Controller::_controllers.push_back(controller); - controller->_impl->_controllerID = controllerID; - EventController evt(EventController::ControllerEventType::CONNECTION, controller, true); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); + controller->_deviceId = deviceId; + controller->_deviceName = deviceName; + Controller::s_allController.push_back(controller); + + controller->onConnected(); } - static void onDisconnected(const std::string& vendorName, int controllerID) + static void onDisconnected(const std::string& deviceName, int deviceId) { - auto iter = findController(vendorName, controllerID); - if (iter == Controller::_controllers.end()) + CCLOG("onDisconnected %s,%d", deviceName.c_str(),deviceId); + + auto iter = findController(deviceName, deviceId); + if (iter == Controller::s_allController.end()) { CCLOGERROR("Could not find the controller!"); return; } - EventController evt(EventController::ControllerEventType::CONNECTION, *iter, false); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - - Controller::_controllers.erase(iter); + (*iter)->onDisconnected(); + Controller::s_allController.erase(iter); } - void sendEventButton(ControllerButtonInput* button, bool isPressed, float value, bool isAnalog) + static void onButtonEvent(const std::string& deviceName, int deviceId, int keyCode, bool isPressed, float value, bool isAnalog) { - button->setPressed(isPressed); - button->setValue(value); - button->setAnalog(isAnalog); - EventController evt(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, _controller, button); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); + auto iter = findController(deviceName, deviceId); + if (iter == Controller::s_allController.end()) + { + CCLOG("onButtonEvent:connect new controller."); + onConnected(deviceName, deviceId); + iter = findController(deviceName, deviceId); + } + + (*iter)->onButtonEvent(keyCode, isPressed, value, isAnalog); } - void sendEventAxis(ControllerAxisInput* axis, float value, bool isAnalog) + static void onAxisEvent(const std::string& deviceName, int deviceId, int axisCode, float value, bool isAnalog) { - axis->setValue(value); - axis->setAnalog(isAnalog); - EventController evt(EventController::ControllerEventType::AXIS_STATUS_CHANGED, _controller, axis); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - } - - static void onButtonEvent(const std::string& vendorName, int controllerID, AndroidControllerCode btnCode, bool isPressed, float value, bool isAnalog) - { - auto iter = findController(vendorName, controllerID); - if (iter == Controller::_controllers.end()) + auto iter = findController(deviceName, deviceId); + if (iter == Controller::s_allController.end()) { - onConnected(vendorName, controllerID); - iter = findController(vendorName, controllerID); - } - - auto gamepad = (*iter)->getGamepad(); - auto thiz = (*iter)->getImpl(); - switch(btnCode) - { - case AndroidControllerCode::BUTTON_A: - { - thiz->sendEventButton(gamepad->getButtonA(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_B: - { - thiz->sendEventButton(gamepad->getButtonB(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_X: - { - thiz->sendEventButton(gamepad->getButtonX(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_Y: - { - thiz->sendEventButton(gamepad->getButtonY(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_LEFT_SHOULDER: - { - thiz->sendEventButton(gamepad->getLeftShoulder(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_RIGHT_SHOULDER: - { - thiz->sendEventButton(gamepad->getRightShoulder(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_LEFT_TRIGGER: - { - thiz->sendEventButton(gamepad->getLeftTrigger(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_RIGHT_TRIGGER: - { - thiz->sendEventButton(gamepad->getRightTrigger(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_DPAD_UP: - { - thiz->sendEventButton(gamepad->getDirectionPad()->getUp(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_DPAD_DOWN: - { - thiz->sendEventButton(gamepad->getDirectionPad()->getDown(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_DPAD_LEFT: - { - thiz->sendEventButton(gamepad->getDirectionPad()->getLeft(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_DPAD_RIGHT: - { - thiz->sendEventButton(gamepad->getDirectionPad()->getRight(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_START: - { - thiz->sendEventButton(gamepad->getButtonStart(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_SELECT: - { - thiz->sendEventButton(gamepad->getButtonSelect(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_LEFT_THUMBSTICK: - { - thiz->sendEventButton(gamepad->getLeftThumbstick()->getButton(), isPressed, value, isAnalog); - } - break; - case AndroidControllerCode::BUTTON_RIGHT_THUMBSTICK: - { - thiz->sendEventButton(gamepad->getRightThumbstick()->getButton(), isPressed, value, isAnalog); - } - break; - default: - // CCASSERT(false, "Invalid controller button code!"); - break; - } - } - - static void onAxisEvent(const std::string& vendorName, int controllerID, AndroidControllerCode axisCode, float value, bool isAnalog) - { - // log("vendorName: %s, controller id: %d, axis: %d, value: %f", vendorName.c_str(), controllerID, axisCode, value); - auto iter = findController(vendorName, controllerID); - if (iter == Controller::_controllers.end()) - { - onConnected(vendorName, controllerID); - iter = findController(vendorName, controllerID); - } - auto gamepad = (*iter)->getGamepad(); - auto thiz = (*iter)->getImpl(); - switch (axisCode) - { - case AndroidControllerCode::THUMBSTICK_LEFT_X: - thiz->sendEventAxis(gamepad->getLeftThumbstick()->getAxisX(), value, isAnalog); - break; - case AndroidControllerCode::THUMBSTICK_LEFT_Y: - thiz->sendEventAxis(gamepad->getLeftThumbstick()->getAxisY(), value, isAnalog); - break; - case AndroidControllerCode::THUMBSTICK_RIGHT_X: - thiz->sendEventAxis(gamepad->getRightThumbstick()->getAxisX(), value, isAnalog); - break; - case AndroidControllerCode::THUMBSTICK_RIGHT_Y: - thiz->sendEventAxis(gamepad->getRightThumbstick()->getAxisY(), value, isAnalog); - break; - default: - CCASSERT(false, "Invalid controller axis code!"); - break; + CCLOG("onAxisEvent:connect new controller."); + onConnected(deviceName, deviceId); + iter = findController(deviceName, deviceId); } + + (*iter)->onAxisEvent(axisCode, value, isAnalog); } private: Controller* _controller; - int _controllerID; }; - -std::vector Controller::_controllers; - -const std::vector& Controller::getControllers() -{ - return _controllers; -} - void Controller::startDiscoveryController() { // Empty implementation on Android @@ -288,9 +124,17 @@ void Controller::stopDiscoveryController() // Empty implementation on Android } -const std::string& Controller::getVendorName() +Controller::~Controller() +{ + delete _impl; + + delete _connectEvent; + delete _keyEvent; + delete _axisEvent; +} + +void Controller::registerListeners() { - return _vendorName; } bool Controller::isConnected() const @@ -301,61 +145,50 @@ bool Controller::isConnected() const return true; } -int Controller::getPlayerIndex() const -{ - return _playerIndex; -} - -void Controller::setPlayerIndex(int playerIndex) -{ - _playerIndex = playerIndex; -} - -Gamepad* Controller::getGamepad() const -{ - return _gamepad; -} - Controller::Controller() - : _playerIndex(PLAYER_INDEX_UNSET) - , _gamepad(new Gamepad) + : _controllerTag(TAG_UNSET) , _impl(new ControllerImpl(this)) + , _connectEvent(nullptr) + , _keyEvent(nullptr) + , _axisEvent(nullptr) { - _gamepad->_controller = this; + init(); } -Controller::~Controller() +void Controller::receiveExternalKeyEvent(int externalKeyCode,bool receive) { - CC_SAFE_DELETE(_impl); - CC_SAFE_DELETE(_gamepad); + JniMethodInfo t; + if (JniHelper::getStaticMethodInfo(t, "org/cocos2dx/lib/GameControllerHelper", "receiveExternalKeyEvent", "(IIZ)V")) { + + t.env->CallStaticVoidMethod(t.classID, t.methodID, _deviceId, externalKeyCode, receive); + t.env->DeleteLocalRef(t.classID); + } } NS_CC_END extern "C" { - JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerConnected(JNIEnv* env, jobject thiz, jstring vendorName, jint controllerID) + void Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerConnected(JNIEnv* env, jobject thiz, jstring deviceName, jint controllerID) { CCLOG("controller id: %d connected!", controllerID); - cocos2d::ControllerImpl::onConnected(cocos2d::JniHelper::jstring2string(vendorName), controllerID); + cocos2d::ControllerImpl::onConnected(cocos2d::JniHelper::jstring2string(deviceName), controllerID); } - JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerDisconnected(JNIEnv* env, jobject thiz, jstring vendorName, jint controllerID) + void Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerDisconnected(JNIEnv* env, jobject thiz, jstring deviceName, jint controllerID) { CCLOG("controller id: %d disconnected!", controllerID); - cocos2d::ControllerImpl::onDisconnected(cocos2d::JniHelper::jstring2string(vendorName), controllerID); + cocos2d::ControllerImpl::onDisconnected(cocos2d::JniHelper::jstring2string(deviceName), controllerID); } - JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerButtonEvent(JNIEnv* env, jobject thiz, jstring vendorName, jint controllerID, jint button, jboolean isPressed, jfloat value, jboolean isAnalog) + void Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerButtonEvent(JNIEnv* env, jobject thiz, jstring deviceName, jint controllerID, jint button, jboolean isPressed, jfloat value, jboolean isAnalog) { - CCLOG("controller id: %d, btn code: %d, isPressed: %d, value: %f, isAnalog:%d", controllerID, button, (int)isPressed, value, (int)isAnalog); - cocos2d::ControllerImpl::onButtonEvent(cocos2d::JniHelper::jstring2string(vendorName), controllerID, static_cast(button), isPressed, value, isAnalog); + cocos2d::ControllerImpl::onButtonEvent(cocos2d::JniHelper::jstring2string(deviceName), controllerID, button, isPressed, value, isAnalog); } - JNIEXPORT void JNICALL Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerAxisEvent(JNIEnv* env, jobject thiz, jstring vendorName, jint controllerID, jint axis, jfloat value, jboolean isAnalog) + void Java_org_cocos2dx_lib_GameControllerAdapter_nativeControllerAxisEvent(JNIEnv* env, jobject thiz, jstring deviceName, jint controllerID, jint axis, jfloat value, jboolean isAnalog) { - // CCLOG("controller id: %d, axis code: %d, value: %f, isAnalog:%d", controllerID, axis, value, (int)isAnalog); - cocos2d::ControllerImpl::onAxisEvent(cocos2d::JniHelper::jstring2string(vendorName), controllerID, static_cast(axis), value, isAnalog); + cocos2d::ControllerImpl::onAxisEvent(cocos2d::JniHelper::jstring2string(deviceName), controllerID, axis, value, isAnalog); } } // extern "C" { diff --git a/cocos/base/CCController-iOS.mm b/cocos/base/CCController-iOS.mm index 69ecbf88ad..e53f85bccf 100644 --- a/cocos/base/CCController-iOS.mm +++ b/cocos/base/CCController-iOS.mm @@ -27,17 +27,12 @@ #include "base/CCPlatformConfig.h" #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -#include "CCGamepad.h" -#include "CCControllerDirectionPad.h" -#include "CCControllerButtonInput.h" -#include "CCControllerAxisInput.h" -#include "CCControllerThumbstick.h" - #include "ccMacros.h" #include "CCEventDispatcher.h" #include "CCEventController.h" #include "CCEventListenerController.h" #include "CCDirector.h" +#include "CCLabel.h" #import @@ -105,90 +100,49 @@ static GCControllerConnectionEventHandler* __instance = nil; NS_CC_BEGIN -#define sendEventButton(dstID, srcID) \ -dstID->setPressed(srcID.isPressed); \ -dstID->setValue(srcID.value); \ -dstID->setAnalog(srcID.isAnalog); \ -EventController evt(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, _gamepad->_controller, dstID); \ -Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - - -#define sendEventAxis(dstID, srcID) \ -\ -dstID->setValue(srcID.value); \ -dstID->setAnalog(srcID.isAnalog); \ -\ -EventController evt(EventController::ControllerEventType::AXIS_STATUS_CHANGED, _gamepad->_controller, dstID); \ -Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - class ControllerImpl { public: ControllerImpl(Controller* controller) : _controller(controller) , _gcController(nil) - , _lazyRegisterListener(true) - { - - } - - ~ControllerImpl() { } Controller* _controller; GCController* _gcController; - bool _lazyRegisterListener; }; -std::vector Controller::_controllers; - -const std::vector& Controller::getControllers() -{ - return _controllers; -} - void Controller::startDiscoveryController() { [GCController startWirelessControllerDiscoveryWithCompletionHandler: nil]; [[GCControllerConnectionEventHandler getInstance] observerConnection: ^(GCController* gcController) { + auto controller = new Controller(); controller->_impl->_gcController = gcController; + controller->_deviceName = [gcController.vendorName UTF8String]; - gcController.controllerPausedHandler = ^(GCController* gcCon){ - - auto iter = std::find_if(_controllers.begin(), _controllers.end(), [gcCon](Controller* c){ return c->_impl->_gcController == gcCon; }); - - CCASSERT(iter != _controllers.end(), "Could not find the controller"); - - auto button = (*iter)->getGamepad()->getButtonPause(); - button->setPressed(true); - EventController evt(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, (*iter), button); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - - // Reset the pause button status to unpressed. - button->setPressed(false); - }; + s_allController.push_back(controller); - _controllers.push_back(controller); + controller->registerListeners(); + controller->getDeviceName(); - - EventController evt(EventController::ControllerEventType::CONNECTION, controller, true); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); + controller->onConnected(); } disconnection: ^(GCController* gcController) { + auto iter = std::find_if(s_allController.begin(), s_allController.end(), [gcController](Controller* c){ return c->_impl->_gcController == gcController; }); - auto iter = std::find_if(_controllers.begin(), _controllers.end(), [gcController](Controller* c){ return c->_impl->_gcController == gcController; }); + if(iter == s_allController.end()) + { + log("disconnect:Could not find the controller"); + return; + } - CCASSERT(iter != _controllers.end(), "Could not find the controller"); + (*iter)->onDisconnected(); + s_allController.erase(iter); - EventController evt(EventController::ControllerEventType::CONNECTION, *iter, false); - Director::getInstance()->getEventDispatcher()->dispatchEvent(&evt); - - delete (*iter); - _controllers.erase(iter); }]; } @@ -198,26 +152,156 @@ void Controller::stopDiscoveryController() } Controller::Controller() +: _controllerTag(TAG_UNSET) +, _impl(new ControllerImpl(this)) +, _connectEvent(nullptr) +, _keyEvent(nullptr) +, _axisEvent(nullptr) +, _deviceId(0) { - _playerIndex = PLAYER_INDEX_UNSET; - _gamepad = new Gamepad(); - _gamepad->_controller = this; - _impl = new ControllerImpl(this); + init(); } Controller::~Controller() { - CC_SAFE_DELETE(_impl); - CC_SAFE_DELETE(_gamepad); + delete _impl; + + delete _connectEvent; + delete _keyEvent; + delete _axisEvent; } -const std::string& Controller::getVendorName() +void Controller::registerListeners() { - if (_vendorName.empty()) + if (_impl->_gcController.extendedGamepad != nil) { - _vendorName = [_impl->_gcController.vendorName UTF8String]; + _impl->_gcController.extendedGamepad.dpad.up.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_UP, pressed, value, button.isAnalog); + }; + + _impl->_gcController.extendedGamepad.dpad.down.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_DOWN, pressed, value, button.isAnalog); + }; + + _impl->_gcController.extendedGamepad.dpad.left.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_LEFT, pressed, value, button.isAnalog); + }; + + _impl->_gcController.extendedGamepad.dpad.right.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_RIGHT, pressed, value, button.isAnalog); + }; + + _impl->_gcController.extendedGamepad.leftThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ + onAxisEvent(Key::JOYSTICK_LEFT_X, value, axis.isAnalog); + }; + + _impl->_gcController.extendedGamepad.leftThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ + onAxisEvent(Key::JOYSTICK_LEFT_Y, value, axis.isAnalog); + }; + + _impl->_gcController.extendedGamepad.rightThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ + onAxisEvent(Key::JOYSTICK_RIGHT_X, value, axis.isAnalog); + }; + + _impl->_gcController.extendedGamepad.rightThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ + onAxisEvent(Key::JOYSTICK_RIGHT_Y, value, axis.isAnalog); + }; + + _impl->_gcController.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element){ + if (element == gamepad.buttonA) + { + onButtonEvent(Key::BUTTON_A, gamepad.buttonA.isPressed, gamepad.buttonA.value, gamepad.buttonA.isAnalog); + } + else if (element == gamepad.buttonB) + { + onButtonEvent(Key::BUTTON_B, gamepad.buttonB.isPressed, gamepad.buttonB.value, gamepad.buttonB.isAnalog); + } + else if (element == gamepad.buttonX) + { + onButtonEvent(Key::BUTTON_X, gamepad.buttonX.isPressed, gamepad.buttonX.value, gamepad.buttonX.isAnalog); + } + else if (element == gamepad.buttonY) + { + onButtonEvent(Key::BUTTON_Y, gamepad.buttonY.isPressed, gamepad.buttonY.value, gamepad.buttonY.isAnalog); + } + else if (element == gamepad.leftShoulder) + { + onButtonEvent(Key::BUTTON_LEFT_SHOULDER, gamepad.leftShoulder.isPressed, gamepad.leftShoulder.value, gamepad.leftShoulder.isAnalog); + } + else if (element == gamepad.rightShoulder) + { + onButtonEvent(Key::BUTTON_RIGHT_SHOULDER, gamepad.rightShoulder.isPressed, gamepad.rightShoulder.value, gamepad.rightShoulder.isAnalog); + } + else if (element == gamepad.leftTrigger) + { + onAxisEvent(Key::AXIS_LEFT_TRIGGER, gamepad.leftTrigger.value, gamepad.leftTrigger.isAnalog); + } + else if (element == gamepad.rightTrigger) + { + onAxisEvent(Key::AXIS_RIGHT_TRIGGER, gamepad.rightTrigger.value, gamepad.rightTrigger.isAnalog); + } + }; } - return _vendorName; + else + { + _impl->_gcController.gamepad.dpad.up.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_UP, pressed, value, button.isAnalog); + }; + + _impl->_gcController.gamepad.dpad.down.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_DOWN, pressed, value, button.isAnalog); + }; + + _impl->_gcController.gamepad.dpad.left.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_LEFT, pressed, value, button.isAnalog); + }; + + _impl->_gcController.gamepad.dpad.right.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ + onButtonEvent(Key::BUTTON_DPAD_RIGHT, pressed, value, button.isAnalog); + }; + + _impl->_gcController.gamepad.valueChangedHandler = ^(GCGamepad *gamepad, GCControllerElement *element){ + + if (element == gamepad.buttonA) + { + onButtonEvent(Key::BUTTON_A, gamepad.buttonA.isPressed, gamepad.buttonA.value, gamepad.buttonA.isAnalog); + } + else if (element == gamepad.buttonB) + { + onButtonEvent(Key::BUTTON_B, gamepad.buttonB.isPressed, gamepad.buttonB.value, gamepad.buttonB.isAnalog); + } + else if (element == gamepad.buttonX) + { + onButtonEvent(Key::BUTTON_X, gamepad.buttonX.isPressed, gamepad.buttonX.value, gamepad.buttonX.isAnalog); + } + else if (element == gamepad.buttonY) + { + onButtonEvent(Key::BUTTON_Y, gamepad.buttonY.isPressed, gamepad.buttonY.value, gamepad.buttonY.isAnalog); + } + else if (element == gamepad.leftShoulder) + { + onButtonEvent(Key::BUTTON_LEFT_SHOULDER, gamepad.leftShoulder.isPressed, gamepad.leftShoulder.value, gamepad.leftShoulder.isAnalog); + } + else if (element == gamepad.rightShoulder) + { + onButtonEvent(Key::BUTTON_RIGHT_SHOULDER, gamepad.rightShoulder.isPressed, gamepad.rightShoulder.value, gamepad.rightShoulder.isAnalog); + } + }; + } + + _impl->_gcController.controllerPausedHandler = ^(GCController* gcCon){ + + auto iter = std::find_if(s_allController.begin(), s_allController.end(), [gcCon](Controller* c){ return c->_impl->_gcController == gcCon; }); + + if(iter == s_allController.end()) + { + log("Could not find the controller"); + return; + } + + onButtonEvent(Key::BUTTON_PAUSE, true, 1.0f, false); + onButtonEvent(Key::BUTTON_PAUSE, false, 0.0f, false); + }; } bool Controller::isConnected() const @@ -225,145 +309,8 @@ bool Controller::isConnected() const return _impl->_gcController.isAttachedToDevice == YES; } -int Controller::getPlayerIndex() const +void Controller::receiveExternalKeyEvent(int externalKeyCode,bool receive) { - return _playerIndex; -} - -void Controller::setPlayerIndex(int playerIndex) -{ - _playerIndex = playerIndex; -} - -Gamepad* Controller::getGamepad() const -{ - if (_impl->_gcController == nil) - return nullptr; - if(_impl->_gcController.gamepad == nil && _impl->_gcController.extendedGamepad == nil) - { - CCASSERT(false, "No gamepad was found!"); - } - else if (_impl->_lazyRegisterListener) - { - _impl->_lazyRegisterListener = false; - if (_impl->_gcController.extendedGamepad != nil) - { - _impl->_gcController.extendedGamepad.dpad.up.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getUp(), button); - }; - - _impl->_gcController.extendedGamepad.dpad.down.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getDown(), button); - }; - - _impl->_gcController.extendedGamepad.dpad.left.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getLeft(), button); - }; - - _impl->_gcController.extendedGamepad.dpad.right.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getRight(), button); - }; - - _impl->_gcController.extendedGamepad.leftThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ - sendEventAxis(_gamepad->getLeftThumbstick()->getAxisX(), axis); - }; - - _impl->_gcController.extendedGamepad.leftThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ - sendEventAxis(_gamepad->getLeftThumbstick()->getAxisY(), axis); - }; - - _impl->_gcController.extendedGamepad.rightThumbstick.xAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ - sendEventAxis(_gamepad->getRightThumbstick()->getAxisX(), axis); - }; - - _impl->_gcController.extendedGamepad.rightThumbstick.yAxis.valueChangedHandler = ^(GCControllerAxisInput *axis, float value){ - sendEventAxis(_gamepad->getRightThumbstick()->getAxisY(), axis); - }; - - _impl->_gcController.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element){ - if (element == gamepad.buttonA) - { - sendEventButton(_gamepad->getButtonA(), gamepad.buttonA); - } - else if (element == gamepad.buttonB) - { - sendEventButton(_gamepad->getButtonB(), gamepad.buttonB); - } - else if (element == gamepad.buttonX) - { - sendEventButton(_gamepad->getButtonX(), gamepad.buttonX); - } - else if (element == gamepad.buttonY) - { - sendEventButton(_gamepad->getButtonY(), gamepad.buttonY); - } - else if (element == gamepad.leftShoulder) - { - sendEventButton(_gamepad->getLeftShoulder(), gamepad.leftShoulder); - } - else if (element == gamepad.rightShoulder) - { - sendEventButton(_gamepad->getRightShoulder(), gamepad.rightShoulder); - } - else if (element == gamepad.leftTrigger) - { - sendEventButton(_gamepad->getLeftTrigger(), gamepad.leftTrigger); - } - else if (element == gamepad.rightTrigger) - { - sendEventButton(_gamepad->getRightTrigger(), gamepad.rightTrigger); - } - }; - } - else - { - _impl->_gcController.gamepad.dpad.up.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getUp(), button); - }; - - _impl->_gcController.gamepad.dpad.down.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getDown(), button); - }; - - _impl->_gcController.gamepad.dpad.left.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getLeft(), button); - }; - - _impl->_gcController.gamepad.dpad.right.valueChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed){ - sendEventButton(_gamepad->getDirectionPad()->getRight(), button); - }; - - _impl->_gcController.gamepad.valueChangedHandler = ^(GCGamepad *gamepad, GCControllerElement *element){ - - if (element == gamepad.buttonA) - { - sendEventButton(_gamepad->getButtonA(), gamepad.buttonA); - } - else if (element == gamepad.buttonB) - { - sendEventButton(_gamepad->getButtonB(), gamepad.buttonB); - } - else if (element == gamepad.buttonX) - { - sendEventButton(_gamepad->getButtonX(), gamepad.buttonX); - } - else if (element == gamepad.buttonY) - { - sendEventButton(_gamepad->getButtonY(), gamepad.buttonY); - } - else if (element == gamepad.leftShoulder) - { - sendEventButton(_gamepad->getLeftShoulder(), gamepad.leftShoulder); - } - else if (element == gamepad.rightShoulder) - { - sendEventButton(_gamepad->getRightShoulder(), gamepad.rightShoulder); - } - }; - } - } - - return _gamepad; } NS_CC_END diff --git a/cocos/base/CCController.cpp b/cocos/base/CCController.cpp new file mode 100644 index 0000000000..566b80ad52 --- /dev/null +++ b/cocos/base/CCController.cpp @@ -0,0 +1,117 @@ +/**************************************************************************** + Copyright (c) 2014 cocos2d-x.org + Copyright (c) 2014 Chukong Technologies Inc. + + 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 "CCController.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#include "ccMacros.h" +#include "CCEventDispatcher.h" +#include "CCEventController.h" +#include "CCEventListenerController.h" +#include "CCDirector.h" + +NS_CC_BEGIN + +std::vector Controller::s_allController; + +Controller* Controller::getControllerByTag(int tag) +{ + for (auto controller:Controller::s_allController) + { + if (controller->_controllerTag == tag) + { + return controller; + } + } + return nullptr; +} + +void Controller::init() +{ + for (int key = Key::JOYSTICK_LEFT_X; key < Key::KEY_MAX; ++key) + { + _allKeyStatus[key].isPressed = false; + _allKeyStatus[key].value = 0.0f; + + _allKeyPrevStatus[key].isPressed = false; + _allKeyPrevStatus[key].value = 0.0f; + } + + _eventDispatcher = Director::getInstance()->getEventDispatcher(); + _connectEvent = new EventController(EventController::ControllerEventType::CONNECTION, this, false); + _keyEvent = new EventController(EventController::ControllerEventType::BUTTON_STATUS_CHANGED, this, 0); + _axisEvent = new EventController(EventController::ControllerEventType::AXIS_STATUS_CHANGED, this, 0); +} + +const Controller::KeyStatus& Controller::getKeyStatus(int keyCode) +{ + if (_allKeyStatus.find(keyCode) == _allKeyStatus.end()) + { + _allKeyStatus[keyCode].isPressed = false; + _allKeyStatus[keyCode].value = 0.0f; + } + + return _allKeyStatus[keyCode]; +} + +void Controller::onConnected() +{ + _connectEvent->setConnectStatus(true); + _eventDispatcher->dispatchEvent(_connectEvent); +} + +void Controller::onDisconnected() +{ + _connectEvent->setConnectStatus(false); + _eventDispatcher->dispatchEvent(_connectEvent); + + delete this; +} + +void Controller::onButtonEvent(int keyCode, bool isPressed, float value, bool isAnalog) +{ + _allKeyPrevStatus[keyCode] = _allKeyStatus[keyCode]; + _allKeyStatus[keyCode].isPressed = isPressed; + _allKeyStatus[keyCode].value = value; + _allKeyStatus[keyCode].isAnalog = isAnalog; + + _keyEvent->setKeyCode(keyCode); + _eventDispatcher->dispatchEvent(_keyEvent); +} + +void Controller::onAxisEvent(int axisCode, float value, bool isAnalog) +{ + _allKeyPrevStatus[axisCode] = _allKeyStatus[axisCode]; + _allKeyStatus[axisCode].value = value; + _allKeyStatus[axisCode].isAnalog = isAnalog; + + _axisEvent->setKeyCode(axisCode); + _eventDispatcher->dispatchEvent(_axisEvent); +} + +NS_CC_END + +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) diff --git a/cocos/base/CCController.h b/cocos/base/CCController.h index 83b8d547ae..0c596f3cfe 100644 --- a/cocos/base/CCController.h +++ b/cocos/base/CCController.h @@ -27,50 +27,140 @@ #define __cocos2d_libs__CCController__ #include "CCPlatformMacros.h" - #include #include -#include - +#include NS_CC_BEGIN -class Gamepad; class ControllerImpl; +class EventListenerController; +class EventController; +class EventDispatcher; class Controller { public: - static const std::vector& getControllers(); + /** Controllers' standard key + * Controller receives only standard key which contained within enum Key by default. + */ + enum Key + { + JOYSTICK_LEFT_X = 1000, + JOYSTICK_LEFT_Y, + JOYSTICK_RIGHT_X, + JOYSTICK_RIGHT_Y, + BUTTON_A, + BUTTON_B, + BUTTON_C, + BUTTON_X, + BUTTON_Y, + BUTTON_Z, + + BUTTON_DPAD_UP, + BUTTON_DPAD_DOWN, + BUTTON_DPAD_LEFT, + BUTTON_DPAD_RIGHT, + BUTTON_DPAD_CENTER, + + BUTTON_LEFT_SHOULDER, + BUTTON_RIGHT_SHOULDER, + + AXIS_LEFT_TRIGGER, + AXIS_RIGHT_TRIGGER, + + BUTTON_LEFT_THUMBSTICK, + BUTTON_RIGHT_THUMBSTICK, + + BUTTON_START, + BUTTON_SELECT, + + BUTTON_PAUSE, + KEY_MAX + }; + + typedef struct _keyStatus + { + bool isPressed; + float value; + bool isAnalog; + }KeyStatus; + + static const int TAG_UNSET = -1; + + static const std::vector& getAllController(){ return s_allController;} + /** Gets a controller with its tag + * @param tag An identifier to find the controller. + */ + static Controller* getControllerByTag(int tag); + /** To start discovering new controllers + * @warning The API only work on the IOS platform.Empty implementation on Android + */ static void startDiscoveryController(); + /** End the discovery process + * @warning The API only work on the IOS platform.Empty implementation on Android + */ static void stopDiscoveryController(); - const std::string& getVendorName(); + const std::string& getDeviceName() const { return _deviceName;} + int getDeviceId() const { return _deviceId;} + bool isConnected() const; - static const int PLAYER_INDEX_UNSET = -1; + const KeyStatus& getKeyStatus(int keyCode); + + /** Activate receives key event from external key. e.g. back,menu. + * Controller receives only standard key which contained within enum Key by default. + * @warning The API only work on the android platform for support diversified game controller. + * + * @param externalKeyCode external key code + * @param receive true if external key event on this controller should be receive, false otherwise. + */ + void receiveExternalKeyEvent(int externalKeyCode,bool receive); - int getPlayerIndex() const; - void setPlayerIndex(int playerIndex); + /** Changes the tag that is used to identify the controller easily. + * @param tag A integer that identifies the controller. + */ + void setTag(int tag) { _controllerTag = tag;} + /** + * Returns a tag that is used to identify the controller easily. + * + * @return An integer that identifies the controller. + */ + int getTag() const { return _controllerTag;} - Gamepad* getGamepad() const; - - // For internal use only - inline ControllerImpl* getImpl() const { return _impl; }; +private: + static std::vector s_allController; Controller(); virtual ~Controller(); -private: - static std::vector _controllers; + void init(); - std::string _vendorName; - int _playerIndex; - Gamepad* _gamepad; + void onConnected(); + void onDisconnected(); + void onButtonEvent(int keyCode, bool isPressed, float value, bool isAnalog); + void onAxisEvent(int axisCode, float value, bool isAnalog); + void registerListeners(); + + std::unordered_map _allKeyStatus; + std::unordered_map _allKeyPrevStatus; + + std::string _deviceName; + int _deviceId; + + int _controllerTag; + + ControllerImpl* _impl; + + EventDispatcher* _eventDispatcher; + EventController *_connectEvent; + EventController *_keyEvent; + EventController *_axisEvent; friend class ControllerImpl; - ControllerImpl* _impl; + friend class EventListenerController; }; diff --git a/cocos/base/CCControllerButtonInput.h b/cocos/base/CCControllerButtonInput.h deleted file mode 100644 index ff6c1a723d..0000000000 --- a/cocos/base/CCControllerButtonInput.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 __cocos2d_libs__CCControllerButtonInput__ -#define __cocos2d_libs__CCControllerButtonInput__ - -#include "CCPlatformMacros.h" -#include "CCControllerElement.h" - -NS_CC_BEGIN - -class ControllerButtonInput : public ControllerElement -{ -public: - float getValue() const; - bool isPressed() const; - bool isPrevStatusPressed() const; - -protected: - - ControllerButtonInput(); - virtual ~ControllerButtonInput(); - - void setValue(float value); - void setPressed(bool isPressed); - - float _value; - bool _isPressed; - - bool _isPrevStatusPressed; // Whether previous status is pressed - - friend class Controller; - friend class ControllerImpl; - friend class ControllerDirectionPad; - friend class ControllerThumbstick; - friend class Gamepad; -}; - -NS_CC_END - -#endif /* defined(__cocos2d_libs__CCControllerButtonInput__) */ diff --git a/cocos/base/CCControllerDirectionPad.cpp b/cocos/base/CCControllerDirectionPad.cpp deleted file mode 100644 index d5671bb481..0000000000 --- a/cocos/base/CCControllerDirectionPad.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 "CCControllerDirectionPad.h" -#include "CCControllerAxisInput.h" -#include "CCControllerButtonInput.h" - -NS_CC_BEGIN - -ControllerDirectionPad::ControllerDirectionPad() -: _up(new ControllerButtonInput()) -, _down(new ControllerButtonInput()) -, _left(new ControllerButtonInput()) -, _right(new ControllerButtonInput()) -{ - _up->setCollection(this); - _down->setCollection(this); - _left->setCollection(this); - _right->setCollection(this); -} - -ControllerDirectionPad::~ControllerDirectionPad() -{ - CC_SAFE_DELETE(_up); - CC_SAFE_DELETE(_down); - CC_SAFE_DELETE(_left); - CC_SAFE_DELETE(_right); -} - -ControllerButtonInput* ControllerDirectionPad::getUp() const -{ - return _up; -} - -ControllerButtonInput* ControllerDirectionPad::getDown() const -{ - return _down; -} - -ControllerButtonInput* ControllerDirectionPad::getLeft() const -{ - return _left; -} - -ControllerButtonInput* ControllerDirectionPad::getRight() const -{ - return _right; -} - - - -NS_CC_END \ No newline at end of file diff --git a/cocos/base/CCControllerDirectionPad.h b/cocos/base/CCControllerDirectionPad.h deleted file mode 100644 index d7dbe3041a..0000000000 --- a/cocos/base/CCControllerDirectionPad.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 __cocos2d_libs__CCControllerDirectionPad__ -#define __cocos2d_libs__CCControllerDirectionPad__ - -#include "CCPlatformMacros.h" -#include "CCControllerElement.h" - -NS_CC_BEGIN - -class ControllerAxisInput; -class ControllerButtonInput; - -class ControllerDirectionPad : public ControllerElement -{ -public: - ControllerButtonInput* getUp() const; - ControllerButtonInput* getDown() const; - ControllerButtonInput* getLeft() const; - ControllerButtonInput* getRight() const; - -protected: - - friend class Controller; - friend class Gamepad; - - ControllerDirectionPad(); - virtual ~ControllerDirectionPad(); - - ControllerButtonInput* _up; - ControllerButtonInput* _down; - ControllerButtonInput* _left; - ControllerButtonInput* _right; -}; - -NS_CC_END - -#endif /* defined(__cocos2d_libs__CCControllerDirectionPad__) */ diff --git a/cocos/base/CCControllerElement.h b/cocos/base/CCControllerElement.h deleted file mode 100644 index 95f0bfd841..0000000000 --- a/cocos/base/CCControllerElement.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 __cocos2d_libs__CCControllerElement__ -#define __cocos2d_libs__CCControllerElement__ - -#include "CCPlatformMacros.h" - -NS_CC_BEGIN - -/** - Every controller element knows which collection it belongs to and whether its input value is analog or digital. - */ -class ControllerElement -{ -public: - /** - Each element can be part of a wider collection of inputs that map to a single logical element. A directional pad (dpad) - is a logical collection of two axis inputs and thus each axis belongs to the same collection element - the dpad. - */ - ControllerElement * getCollection(); - - /** - Check if the element can support more than just digital values, such as decimal ranges between 0 and 1. - */ - bool isAnalog() const; - -protected: - - ControllerElement(); - virtual ~ControllerElement(); - - void setAnalog(bool isAnalog); - void setCollection(ControllerElement* collection); - - bool _isAnalog; - ControllerElement* _collection; -}; - -NS_CC_END - -#endif /* defined(__cocos2d_libs__CCControllerElement__) */ diff --git a/cocos/base/CCControllerThumbstick.cpp b/cocos/base/CCControllerThumbstick.cpp deleted file mode 100644 index 287cf07a6a..0000000000 --- a/cocos/base/CCControllerThumbstick.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 "CCControllerThumbstick.h" -#include "CCControllerAxisInput.h" -#include "CCControllerButtonInput.h" - -NS_CC_BEGIN - -ControllerThumbstick::ControllerThumbstick() -: _axisX(new ControllerAxisInput()) -, _axisY(new ControllerAxisInput()) -, _button(new ControllerButtonInput()) -{ - _axisX->setCollection(this); - _axisY->setCollection(this); - _button->setCollection(this); -} - -ControllerThumbstick::~ControllerThumbstick() -{ - CC_SAFE_DELETE(_axisX); - CC_SAFE_DELETE(_axisY); - CC_SAFE_DELETE(_button); -} - -ControllerAxisInput* ControllerThumbstick::getAxisX() const -{ - return _axisX; -} - -ControllerAxisInput* ControllerThumbstick::getAxisY() const -{ - return _axisY; -} - -ControllerButtonInput* ControllerThumbstick::getButton() const -{ - return _button; -} - - - -NS_CC_END diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index ac7519a062..fe22befbce 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -177,7 +177,6 @@ Director::~Director(void) CC_SAFE_RELEASE(_scheduler); CC_SAFE_RELEASE(_actionManager); - delete _eventAfterUpdate; delete _eventAfterDraw; delete _eventAfterVisit; @@ -191,12 +190,11 @@ Director::~Director(void) CC_SAFE_RELEASE(_eventDispatcher); - // clean auto release pool - PoolManager::destroyInstance(); - // delete _lastUpdate CC_SAFE_DELETE(_lastUpdate); + Configuration::destroyInstance(); + s_SharedDirector = nullptr; } @@ -976,7 +974,6 @@ void Director::purgeDirector() GLProgramCache::destroyInstance(); GLProgramStateCache::destroyInstance(); FileUtils::destroyInstance(); - Configuration::destroyInstance(); // cocos2d-x specific data structures UserDefault::destroyInstance(); diff --git a/cocos/base/CCEventController.cpp b/cocos/base/CCEventController.cpp index 19f34ce560..3176f7d82c 100644 --- a/cocos/base/CCEventController.cpp +++ b/cocos/base/CCEventController.cpp @@ -27,10 +27,10 @@ NS_CC_BEGIN -EventController::EventController(ControllerEventType type, Controller* controller, ControllerElement* element) +EventController::EventController(ControllerEventType type, Controller* controller, int keyCode) : Event(Type::GAME_CONTROLLER) , _controllerEventType(type) -, _element(element) +, _keyCode(keyCode) , _controller(controller) , _isConnected(true) { @@ -40,31 +40,11 @@ EventController::EventController(ControllerEventType type, Controller* controlle EventController::EventController(ControllerEventType type, Controller* controller, bool isConnected) : Event(Type::GAME_CONTROLLER) , _controllerEventType(type) -, _element(nullptr) , _controller(controller) , _isConnected(isConnected) +, _keyCode(0) { } -EventController::ControllerEventType EventController::getControllerEventType() const -{ - return _controllerEventType; -} - -Controller* EventController::getController() const -{ - return _controller; -} - -ControllerElement* EventController::getControllerElement() const -{ - return _element; -} - -bool EventController::isConnected() const -{ - return _isConnected; -} - NS_CC_END diff --git a/cocos/base/CCEventController.h b/cocos/base/CCEventController.h index c87a8c9418..d8190a0b8e 100644 --- a/cocos/base/CCEventController.h +++ b/cocos/base/CCEventController.h @@ -31,10 +31,8 @@ NS_CC_BEGIN -class ControllerButtonInput; -class ControllerAxisInput; -class ControllerElement; class Controller; +class EventListenerController; class EventController : public Event { @@ -46,19 +44,25 @@ public: AXIS_STATUS_CHANGED, }; - EventController(ControllerEventType type, Controller* controller, ControllerElement* element); + EventController(ControllerEventType type, Controller* controller, int keyCode); EventController(ControllerEventType type, Controller* controller, bool isConnected); - ControllerEventType getControllerEventType() const; - Controller* getController() const; - ControllerElement* getControllerElement() const; - bool isConnected() const; + ControllerEventType getControllerEventType() const { return _controllerEventType; } + Controller* getController() const { return _controller; } + + int getKeyCode() const{ return _keyCode; } + void setKeyCode(int keyCode) { _keyCode = keyCode;} + + void setConnectStatus(bool isConnected) {_isConnected = isConnected;} + bool isConnected() const { return _isConnected; } protected: ControllerEventType _controllerEventType; - ControllerElement* _element; Controller* _controller; + int _keyCode; bool _isConnected; + + friend class EventListenerController; }; NS_CC_END diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index e7bc3ae889..5c5fc374b6 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -211,6 +211,7 @@ EventDispatcher::EventDispatcher() // Therefore, internal listeners would not be cleaned when removeAllEventListeners is invoked. _internalCustomListenerIDs.insert(EVENT_COME_TO_FOREGROUND); _internalCustomListenerIDs.insert(EVENT_COME_TO_BACKGROUND); + _internalCustomListenerIDs.insert(EVENT_RENDERER_RECREATED); } EventDispatcher::~EventDispatcher() @@ -613,7 +614,7 @@ void EventDispatcher::removeEventListener(EventListener* listener) if (l->getAssociatedNode() != nullptr) { dissociateNodeAndEventListener(l->getAssociatedNode(), l); - l->setAssociatedNode(nullptr); // NULL out the node pointer so we don't have any dangling pointers to destroyed nodes. + l->setAssociatedNode(nullptr); // nullptr out the node pointer so we don't have any dangling pointers to destroyed nodes. } if (_inDispatch == 0) @@ -1276,7 +1277,7 @@ void EventDispatcher::removeEventListenersForListenerID(const EventListener::Lis if (l->getAssociatedNode() != nullptr) { dissociateNodeAndEventListener(l->getAssociatedNode(), l); - l->setAssociatedNode(nullptr); // NULL out the node pointer so we don't have any dangling pointers to destroyed nodes. + l->setAssociatedNode(nullptr); // nullptr out the node pointer so we don't have any dangling pointers to destroyed nodes. } if (_inDispatch == 0) diff --git a/cocos/base/CCEventListenerController.cpp b/cocos/base/CCEventListenerController.cpp index cb3c137800..6f664e73d8 100644 --- a/cocos/base/CCEventListenerController.cpp +++ b/cocos/base/CCEventListenerController.cpp @@ -25,9 +25,8 @@ #include "CCEventListenerController.h" #include "CCEventController.h" -#include "CCControllerButtonInput.h" -#include "CCControllerAxisInput.h" #include "ccMacros.h" +#include "base/CCController.h" NS_CC_BEGIN @@ -51,8 +50,9 @@ bool EventListenerController::init() { auto listener = [this](Event* event){ auto evtController = static_cast(event); - if (evtController->getControllerEventType() == EventController::ControllerEventType::CONNECTION) + switch (evtController->getControllerEventType()) { + case EventController::ControllerEventType::CONNECTION: if (evtController->isConnected()) { if (this->onConnected) @@ -63,45 +63,40 @@ bool EventListenerController::init() if (this->onDisconnected) this->onDisconnected(evtController->getController(), event); } - } - else - { - switch (evtController->getControllerEventType()) { - case EventController::ControllerEventType::BUTTON_STATUS_CHANGED: - { - auto button = static_cast(evtController->getControllerElement()); + break; + case EventController::ControllerEventType::BUTTON_STATUS_CHANGED: + { + const auto& keyStatus = evtController->_controller->_allKeyStatus[evtController->_keyCode]; + const auto& keyPrevStatus = evtController->_controller->_allKeyPrevStatus[evtController->_keyCode]; - if (this->onButtonPressed && button->isPressed() && !button->isPrevStatusPressed()) - { - this->onButtonPressed(evtController->getController(), button, event); - } - else if (this->onButtonReleased && !button->isPressed() && button->isPrevStatusPressed()) - { - this->onButtonReleased(evtController->getController(), button, event); - } - - if (this->onButtonValueChanged) - { - this->onButtonValueChanged(evtController->getController(), button, event); - } - } - break; - case EventController::ControllerEventType::AXIS_STATUS_CHANGED: - { - if (this->onAxisValueChanged) - { - auto axis = static_cast(evtController->getControllerElement()); - this->onAxisValueChanged(evtController->getController(), axis, event); - } - } - break; - default: - CCASSERT(false, "Invalid EventController type"); - break; + if (this->onKeyDown && keyStatus.isPressed && !keyPrevStatus.isPressed) + { + this->onKeyDown(evtController->_controller, evtController->_keyCode, event); + } + else if (this->onKeyUp && !keyStatus.isPressed && keyPrevStatus.isPressed) + { + this->onKeyUp(evtController->_controller, evtController->_keyCode, event); + } + else if (this->onKeyRepeat && keyStatus.isPressed && keyPrevStatus.isPressed) + { + this->onKeyRepeat(evtController->_controller, evtController->_keyCode, event); + } } + break; + case EventController::ControllerEventType::AXIS_STATUS_CHANGED: + { + if (this->onAxisEvent) + { + this->onAxisEvent(evtController->_controller, evtController->_keyCode, event); + } + } + break; + default: + CCASSERT(false, "Invalid EventController type"); + break; } }; - + if (EventListener::init(EventListener::Type::GAME_CONTROLLER, LISTENER_ID, listener)) { return true; diff --git a/cocos/base/CCEventListenerController.h b/cocos/base/CCEventListenerController.h index af44711d5d..ebb3f09e50 100644 --- a/cocos/base/CCEventListenerController.h +++ b/cocos/base/CCEventListenerController.h @@ -33,8 +33,6 @@ NS_CC_BEGIN class Event; class Controller; -class ControllerButtonInput; -class ControllerAxisInput; class EventListenerController : public EventListener { @@ -50,11 +48,11 @@ public: std::function onConnected; std::function onDisconnected; - std::function onButtonPressed; - std::function onButtonReleased; - std::function onButtonValueChanged; + std::function onKeyDown; + std::function onKeyUp; + std::function onKeyRepeat; - std::function onAxisValueChanged; + std::function onAxisEvent; protected: bool init(); diff --git a/cocos/base/CCEventMouse.cpp b/cocos/base/CCEventMouse.cpp index c1013d4d26..447862de49 100644 --- a/cocos/base/CCEventMouse.cpp +++ b/cocos/base/CCEventMouse.cpp @@ -30,7 +30,7 @@ NS_CC_BEGIN EventMouse::EventMouse(MouseEventType mouseEventCode) : Event(Type::MOUSE) , _mouseEventType(mouseEventCode) -, _mouseButton(0) +, _mouseButton(-1) , _x(0.0f) , _y(0.0f) , _scrollX(0.0f) diff --git a/cocos/base/CCEventType.h b/cocos/base/CCEventType.h index bc3b8a6194..c50ecff4f9 100644 --- a/cocos/base/CCEventType.h +++ b/cocos/base/CCEventType.h @@ -30,13 +30,17 @@ */ // The application will come to foreground. -// This message is used for reloading resources before come to foreground on Android. -// This message is posted in main.cpp. +// This message is posted in cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp. #define EVENT_COME_TO_FOREGROUND "event_come_to_foreground" +// The renderer[android:GLSurfaceView.Renderer WP8:Cocos2dRenderer] was recreated. +// This message is used for reloading resources before renderer is recreated on Android/WP8. +// This message is posted in cocos/platform/android/javaactivity.cpp and cocos\platform\wp8-xaml\cpp\Cocos2dRenderer.cpp. +#define EVENT_RENDERER_RECREATED "event_renderer_recreated" + // The application will come to background. // This message is used for doing something before coming to background, such as save RenderTexture. -// This message is posted in cocos2dx/platform/android/jni/MessageJni.cpp. +// This message is posted in cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp and cocos\platform\wp8-xaml\cpp\Cocos2dRenderer.cpp. #define EVENT_COME_TO_BACKGROUND "event_come_to_background" #endif // __CCEVENT_TYPE_H__ diff --git a/cocos/base/CCGameController.h b/cocos/base/CCGameController.h index df195a6bf8..0aa4df4abb 100644 --- a/cocos/base/CCGameController.h +++ b/cocos/base/CCGameController.h @@ -26,12 +26,6 @@ #ifndef __cocos2d_libs__CCGameController__ #define __cocos2d_libs__CCGameController__ -#include "CCControllerElement.h" -#include "CCControllerButtonInput.h" -#include "CCControllerAxisInput.h" -#include "CCControllerDirectionPad.h" -#include "CCControllerThumbstick.h" -#include "CCGamepad.h" #include "CCController.h" #include "CCEventController.h" #include "CCEventListenerController.h" diff --git a/cocos/base/CCGamepad.cpp b/cocos/base/CCGamepad.cpp deleted file mode 100644 index 9502689772..0000000000 --- a/cocos/base/CCGamepad.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 "CCGamepad.h" -#include "CCControllerDirectionPad.h" -#include "CCControllerButtonInput.h" -#include "CCControllerThumbstick.h" - -NS_CC_BEGIN - -Gamepad::Gamepad() -: _controller(nullptr) -, _directionPad(new ControllerDirectionPad()) -, _buttonA(new ControllerButtonInput()) -, _buttonB(new ControllerButtonInput()) -, _buttonX(new ControllerButtonInput()) -, _buttonY(new ControllerButtonInput()) -, _buttonSelect(new ControllerButtonInput()) -, _buttonStart(new ControllerButtonInput()) -, _buttonPause(new ControllerButtonInput()) -, _leftShoulder(new ControllerButtonInput()) -, _rightShoulder(new ControllerButtonInput()) -, _leftThumbstick(new ControllerThumbstick()) -, _rightThumbstick(new ControllerThumbstick()) -, _leftTrigger(new ControllerButtonInput()) -, _rightTrigger(new ControllerButtonInput()) -{ - -} - -Gamepad::~Gamepad() -{ - CC_SAFE_DELETE(_directionPad); - CC_SAFE_DELETE(_buttonA); - CC_SAFE_DELETE(_buttonB); - CC_SAFE_DELETE(_buttonX); - CC_SAFE_DELETE(_buttonY); - CC_SAFE_DELETE(_buttonSelect); - CC_SAFE_DELETE(_buttonStart); - CC_SAFE_DELETE(_buttonPause); - CC_SAFE_DELETE(_leftShoulder); - CC_SAFE_DELETE(_rightShoulder); - CC_SAFE_DELETE(_leftThumbstick); - CC_SAFE_DELETE(_rightThumbstick); - CC_SAFE_DELETE(_leftTrigger); - CC_SAFE_DELETE(_rightTrigger); -} - -Controller* Gamepad::getController() -{ - return _controller; -} - -ControllerDirectionPad* Gamepad::getDirectionPad() const -{ - return _directionPad; -} - -ControllerButtonInput* Gamepad::getButtonA() const -{ - return _buttonA; -} - -ControllerButtonInput* Gamepad::getButtonB() const -{ - return _buttonB; -} - -ControllerButtonInput* Gamepad::getButtonX() const -{ - return _buttonX; -} - -ControllerButtonInput* Gamepad::getButtonY() const -{ - return _buttonY; -} - -ControllerButtonInput* Gamepad::getButtonPause() const -{ - return _buttonPause; -} - -ControllerButtonInput* Gamepad::getButtonSelect() const -{ - return _buttonSelect; -} - -ControllerButtonInput* Gamepad::getButtonStart() const -{ - return _buttonStart; -} - -ControllerButtonInput* Gamepad::getLeftShoulder() const -{ - return _leftShoulder; -} - -ControllerButtonInput* Gamepad::getRightShoulder() const -{ - return _rightShoulder; -} - -ControllerThumbstick* Gamepad::getLeftThumbstick() const -{ - return _leftThumbstick; -} - -ControllerThumbstick* Gamepad::getRightThumbstick() const -{ - return _rightThumbstick; -} - -ControllerButtonInput* Gamepad::getLeftTrigger() const -{ - return _leftTrigger; -} - -ControllerButtonInput* Gamepad::getRightTrigger() const -{ - return _rightTrigger; -} - -NS_CC_END diff --git a/cocos/base/CCGamepad.h b/cocos/base/CCGamepad.h deleted file mode 100644 index 472fdb08e4..0000000000 --- a/cocos/base/CCGamepad.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. - - 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 __cocos2d_libs__CCGamepad__ -#define __cocos2d_libs__CCGamepad__ - -#include "CCPlatformMacros.h" - -NS_CC_BEGIN - -class ControllerButtonInput; -class ControllerDirectionPad; -class ControllerThumbstick; -class Controller; - -class Gamepad -{ -public: - /** - A profile keeps a reference to the controller that this profile is mapping input from. - */ - Controller* getController(); - - // API for Standard / Extended Gamepad - - ControllerDirectionPad* getDirectionPad() const; - - /** - All face buttons are required to be analog in the Extended profile. These must be arranged - in the diamond pattern given below: - Y - / \ - X B - \ / - A - */ - ControllerButtonInput* getButtonA() const; - ControllerButtonInput* getButtonB() const; - ControllerButtonInput* getButtonX() const; - ControllerButtonInput* getButtonY() const; - - // Select button - ControllerButtonInput* getButtonSelect() const; - - // Start button - ControllerButtonInput* getButtonStart() const; - - // Pause button - ControllerButtonInput* getButtonPause() const; - - // Shoulder buttons - ControllerButtonInput* getLeftShoulder() const; - ControllerButtonInput* getRightShoulder() const; - - // API for Extended Gamepad only - - /** - A thumbstick is a 2-axis control that is physically required to be analog. All the elements of this directional input are thus analog. - */ - ControllerThumbstick* getLeftThumbstick() const; - ControllerThumbstick* getRightThumbstick() const; - - /** - If Trigger button supports analog inputs, it could be used as acceleration and decelleration in a driving game for example. - */ - ControllerButtonInput* getLeftTrigger() const; - ControllerButtonInput* getRightTrigger() const; - -protected: - - Gamepad(); - virtual ~Gamepad(); - - friend class Controller; - Controller* _controller; - - ControllerDirectionPad* _directionPad; - - ControllerButtonInput* _buttonA; - ControllerButtonInput* _buttonB; - ControllerButtonInput* _buttonX; - ControllerButtonInput* _buttonY; - - ControllerButtonInput* _buttonSelect; - ControllerButtonInput* _buttonStart; - ControllerButtonInput* _buttonPause; - - ControllerButtonInput* _leftShoulder; - ControllerButtonInput* _rightShoulder; - - ControllerThumbstick* _leftThumbstick; - ControllerThumbstick* _rightThumbstick; - - ControllerButtonInput* _leftTrigger; - ControllerButtonInput* _rightTrigger; -}; - -NS_CC_END - -#endif /* defined(__cocos2d_libs__CCGamepad__) */ diff --git a/cocos/base/CCRef.cpp b/cocos/base/CCRef.cpp index 1f2c3a4ce7..747b08ccdf 100644 --- a/cocos/base/CCRef.cpp +++ b/cocos/base/CCRef.cpp @@ -46,6 +46,7 @@ Ref::Ref() static unsigned int uObjectCount = 0; _luaID = 0; _ID = ++uObjectCount; + _scriptObject = nullptr; #endif #if CC_USE_MEM_LEAK_DETECTION @@ -64,7 +65,7 @@ Ref::~Ref() else { ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine(); - if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript) + if (pEngine != nullptr && pEngine->getScriptType() == kScriptTypeJavascript) { pEngine->removeScriptObjectByObject(this); } diff --git a/cocos/base/CCRef.h b/cocos/base/CCRef.h index 50f8c8b05c..283fd1cae7 100644 --- a/cocos/base/CCRef.h +++ b/cocos/base/CCRef.h @@ -142,6 +142,8 @@ public: unsigned int _ID; /// Lua reference id int _luaID; + /// scriptObject, support for swift + void* _scriptObject; #endif // Memory leak diagnostic data (only included when CC_USE_MEM_LEAK_DETECTION is defined and its value isn't zero) diff --git a/cocos/base/CCUserDefault.h b/cocos/base/CCUserDefault.h index 6d98743da2..8ba6bcf7d8 100644 --- a/cocos/base/CCUserDefault.h +++ b/cocos/base/CCUserDefault.h @@ -173,7 +173,7 @@ public: /** * @js NA */ - const static std::string& getXMLFilePath(); + static const std::string& getXMLFilePath(); /** * @js NA */ diff --git a/cocos/base/CCUserDefaultAndroid.cpp b/cocos/base/CCUserDefaultAndroid.cpp index fb96d39e37..63ee9182db 100644 --- a/cocos/base/CCUserDefaultAndroid.cpp +++ b/cocos/base/CCUserDefaultAndroid.cpp @@ -455,7 +455,7 @@ void UserDefault::setDataForKey(const char* pKey, const Data& value) deleteNodeByKey(pKey); #endif - CCLOG("SET DATA FOR KEY: --%s--%d", value.getBytes(), value.getSize()); + CCLOG("SET DATA FOR KEY: --%s--%d", value.getBytes(), (int)(value.getSize())); char * encodedData = nullptr; unsigned int encodedDataLen = base64Encode(value.getBytes(), value.getSize(), &encodedData); diff --git a/cocos/base/TGAlib.cpp b/cocos/base/TGAlib.cpp index 5c097f6c46..16462d5a60 100644 --- a/cocos/base/TGAlib.cpp +++ b/cocos/base/TGAlib.cpp @@ -181,7 +181,7 @@ void tgaFlipImage( tImageTGA *info ) unsigned char *row = (unsigned char *)malloc(rowbytes); int y; - if (row == NULL) return; + if (row == nullptr) return; for( y = 0; y < (info->height/2); y++ ) { @@ -233,7 +233,7 @@ tImageTGA* tgaLoadBuffer(unsigned char* buffer, long size) info->imageData = (unsigned char *)malloc(sizeof(unsigned char) * total); // check to make sure we have the memory required - if (info->imageData == NULL) + if (info->imageData == nullptr) { info->status = TGA_ERROR_MEMORY; break; diff --git a/cocos/base/ccConfig.h b/cocos/base/ccConfig.h index 5fb3474a7f..3e36c6c702 100644 --- a/cocos/base/ccConfig.h +++ b/cocos/base/ccConfig.h @@ -202,9 +202,6 @@ Only valid for cocos2d-mac. Not supported on cocos2d-ios. 0 -- disabled 1 -- draw bounding box 2 -- draw texture box - 0 -- disabled - 1 -- draw bounding box - 2 -- draw texture box */ #ifndef CC_SPRITE_DEBUG_DRAW #define CC_SPRITE_DEBUG_DRAW 0 diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 2c25850967..0aa38f29bc 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -33,6 +33,7 @@ THE SOFTWARE. #include "math/CCGeometry.h" #include "math/CCMath.h" #include "CCGL.h" +#include "CCRef.h" NS_CC_BEGIN @@ -65,15 +66,15 @@ struct Color3B GLubyte g; GLubyte b; - const static Color3B WHITE; - const static Color3B YELLOW; - const static Color3B BLUE; - const static Color3B GREEN; - const static Color3B RED; - const static Color3B MAGENTA; - const static Color3B BLACK; - const static Color3B ORANGE; - const static Color3B GRAY; + static const Color3B WHITE; + static const Color3B YELLOW; + static const Color3B BLUE; + static const Color3B GREEN; + static const Color3B RED; + static const Color3B MAGENTA; + static const Color3B BLACK; + static const Color3B ORANGE; + static const Color3B GRAY; }; /** RGBA color composed of 4 bytes @@ -98,15 +99,15 @@ struct Color4B GLubyte b; GLubyte a; - const static Color4B WHITE; - const static Color4B YELLOW; - const static Color4B BLUE; - const static Color4B GREEN; - const static Color4B RED; - const static Color4B MAGENTA; - const static Color4B BLACK; - const static Color4B ORANGE; - const static Color4B GRAY; + static const Color4B WHITE; + static const Color4B YELLOW; + static const Color4B BLUE; + static const Color4B GREEN; + static const Color4B RED; + static const Color4B MAGENTA; + static const Color4B BLACK; + static const Color4B ORANGE; + static const Color4B GRAY; }; @@ -137,15 +138,15 @@ struct Color4F GLfloat b; GLfloat a; - const static Color4F WHITE; - const static Color4F YELLOW; - const static Color4F BLUE; - const static Color4F GREEN; - const static Color4F RED; - const static Color4F MAGENTA; - const static Color4F BLACK; - const static Color4F ORANGE; - const static Color4F GRAY; + static const Color4F WHITE; + static const Color4F YELLOW; + static const Color4F BLUE; + static const Color4F GREEN; + static const Color4F RED; + static const Color4F MAGENTA; + static const Color4F BLACK; + static const Color4F ORANGE; + static const Color4F GRAY; }; /** A vertex composed of 2 floats: x, y @@ -334,13 +335,13 @@ struct BlendFunc GLenum dst; //! Blending disabled. Uses {GL_ONE, GL_ZERO} - const static BlendFunc DISABLE; + static const BlendFunc DISABLE; //! Blending enabled for textures with Alpha premultiplied. Uses {GL_ONE, GL_ONE_MINUS_SRC_ALPHA} - const static BlendFunc ALPHA_PREMULTIPLIED; + static const BlendFunc ALPHA_PREMULTIPLIED; //! Blending enabled for textures with Alpha NON premultiplied. Uses {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA} - const static BlendFunc ALPHA_NON_PREMULTIPLIED; + static const BlendFunc ALPHA_NON_PREMULTIPLIED; //! Enables Additive blending. Uses {GL_SRC_ALPHA, GL_ONE} - const static BlendFunc ADDITIVE; + static const BlendFunc ADDITIVE; bool operator==(const BlendFunc &a) const { @@ -484,6 +485,7 @@ public: @brief The device accelerometer reports values for each axis in units of g-force */ class Acceleration + : public Ref { public: double x; diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index 86a9e47df5..34b671cd8e 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -31,7 +31,7 @@ NS_CC_BEGIN const char* cocos2dVersion() { - return "cocos2d-x 3.2alpha0"; + return "cocos2d-x 3.2beta0"; } NS_CC_END diff --git a/cocos/cocos2d.h b/cocos/cocos2d.h index 1e795488b2..db8e89fa4c 100644 --- a/cocos/cocos2d.h +++ b/cocos/cocos2d.h @@ -253,6 +253,8 @@ THE SOFTWARE. #include "2d/CCTMXTiledMap.h" #include "2d/CCTMXXMLParser.h" #include "2d/CCTileMapAtlas.h" +#include "2d/CCFastTMXTiledMap.h" +#include "2d/CCFastTMXLayer.h" // component #include "2d/CCComponent.h" @@ -261,6 +263,10 @@ THE SOFTWARE. //3d #include "3d/CCSprite3D.h" #include "3d/CCMesh.h" +#include "3d/CCMeshSkin.h" +#include "3d/CCAnimate3D.h" +#include "3d/CCAnimation3D.h" +#include "3d/CCSprite3DMaterial.h" // Audio #include "audio/include/SimpleAudioEngine.h" diff --git a/cocos/deprecated/CCDeprecated.h b/cocos/deprecated/CCDeprecated.h index 685a47fc4b..b1837b6d17 100644 --- a/cocos/deprecated/CCDeprecated.h +++ b/cocos/deprecated/CCDeprecated.h @@ -1020,7 +1020,7 @@ CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnableVertexAttribs(unsigned int CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2D(GLuint textureId) { GL::bindTexture2D(textureId); } CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2DN(GLuint textureUnit, GLuint textureId) { GL::bindTexture2DN(textureUnit, textureId); } CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTexture(GLuint textureId) { GL::deleteTexture(textureId); } -CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTextureN(textureUnit, textureId); } +CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTexture(textureId); } CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindVAO(GLuint vaoId) { GL::bindVAO(vaoId); } CC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnable( int flags ) { /* ignore */ }; CC_DEPRECATED_ATTRIBUTE typedef int ccGLServerState; diff --git a/cocos/deprecated/CCDictionary.cpp b/cocos/deprecated/CCDictionary.cpp index 96ae7dcc7a..23919b6daf 100644 --- a/cocos/deprecated/CCDictionary.cpp +++ b/cocos/deprecated/CCDictionary.cpp @@ -97,7 +97,7 @@ unsigned int __Dictionary::count() __Array* __Dictionary::allKeys() { int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; + if (iKeyCount <= 0) return nullptr; __Array* array = __Array::createWithCapacity(iKeyCount); @@ -127,7 +127,7 @@ __Array* __Dictionary::allKeys() __Array* __Dictionary::allKeysForObject(Ref* object) { int iKeyCount = this->count(); - if (iKeyCount <= 0) return NULL; + if (iKeyCount <= 0) return nullptr; __Array* array = __Array::create(); DictElement *pElement, *tmp; @@ -161,16 +161,16 @@ __Array* __Dictionary::allKeysForObject(Ref* object) Ref* __Dictionary::objectForKey(const std::string& key) { - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; + // if dictionary wasn't initialized, return nullptr directly. + if (_dictType == kDictUnknown) return nullptr; // __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."); - Ref* pRetObject = NULL; - DictElement *pElement = NULL; + Ref* pRetObject = nullptr; + DictElement *pElement = nullptr; HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement != NULL) + if (pElement != nullptr) { pRetObject = pElement->_object; } @@ -179,16 +179,16 @@ Ref* __Dictionary::objectForKey(const std::string& key) Ref* __Dictionary::objectForKey(intptr_t key) { - // if dictionary wasn't initialized, return NULL directly. - if (_dictType == kDictUnknown) return NULL; + // if dictionary wasn't initialized, return nullptr directly. + if (_dictType == kDictUnknown) return nullptr; // __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."); - Ref* pRetObject = NULL; - DictElement *pElement = NULL; + Ref* pRetObject = nullptr; + DictElement *pElement = nullptr; HASH_FIND_PTR(_elements, &key, pElement); - if (pElement != NULL) + if (pElement != nullptr) { pRetObject = pElement->_object; } @@ -198,7 +198,7 @@ Ref* __Dictionary::objectForKey(intptr_t key) const __String* __Dictionary::valueForKey(const std::string& key) { __String* pStr = dynamic_cast<__String*>(objectForKey(key)); - if (pStr == NULL) + if (pStr == nullptr) { pStr = __String::create(""); } @@ -208,7 +208,7 @@ const __String* __Dictionary::valueForKey(const std::string& key) const __String* __Dictionary::valueForKey(intptr_t key) { __String* pStr = dynamic_cast<__String*>(objectForKey(key)); - if (pStr == NULL) + if (pStr == nullptr) { pStr = __String::create(""); } @@ -217,7 +217,7 @@ const __String* __Dictionary::valueForKey(intptr_t key) void __Dictionary::setObject(Ref* pObject, const std::string& key) { - CCASSERT(key.length() > 0 && pObject != NULL, "Invalid Argument!"); + CCASSERT(key.length() > 0 && pObject != nullptr, "Invalid Argument!"); if (_dictType == kDictUnknown) { _dictType = kDictStr; @@ -225,9 +225,9 @@ void __Dictionary::setObject(Ref* pObject, const std::string& key) CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as key."); - DictElement *pElement = NULL; + DictElement *pElement = nullptr; HASH_FIND_STR(_elements, key.c_str(), pElement); - if (pElement == NULL) + if (pElement == nullptr) { setObjectUnSafe(pObject, key); } @@ -243,7 +243,7 @@ void __Dictionary::setObject(Ref* pObject, const std::string& key) void __Dictionary::setObject(Ref* pObject, intptr_t key) { - CCASSERT(pObject != NULL, "Invalid Argument!"); + CCASSERT(pObject != nullptr, "Invalid Argument!"); if (_dictType == kDictUnknown) { _dictType = kDictInt; @@ -251,9 +251,9 @@ void __Dictionary::setObject(Ref* pObject, intptr_t key) CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as key."); - DictElement *pElement = NULL; + DictElement *pElement = nullptr; HASH_FIND_PTR(_elements, &key, pElement); - if (pElement == NULL) + if (pElement == nullptr) { setObjectUnSafe(pObject, key); } @@ -277,7 +277,7 @@ void __Dictionary::removeObjectForKey(const std::string& key) CCASSERT(_dictType == kDictStr, "this dictionary doesn't use string as its key"); CCASSERT(key.length() > 0, "Invalid Argument!"); - DictElement *pElement = NULL; + DictElement *pElement = nullptr; HASH_FIND_STR(_elements, key.c_str(), pElement); removeObjectForElememt(pElement); } @@ -290,7 +290,7 @@ void __Dictionary::removeObjectForKey(intptr_t key) } CCASSERT(_dictType == kDictInt, "this dictionary doesn't use integer as its key"); - DictElement *pElement = NULL; + DictElement *pElement = nullptr; HASH_FIND_PTR(_elements, &key, pElement); removeObjectForElememt(pElement); } @@ -311,7 +311,7 @@ void __Dictionary::setObjectUnSafe(Ref* pObject, const intptr_t key) void __Dictionary::removeObjectsForKeys(__Array* pKey__Array) { - Ref* pObj = NULL; + Ref* pObj = nullptr; CCARRAY_FOREACH(pKey__Array, pObj) { __String* pStr = static_cast<__String*>(pObj); @@ -321,7 +321,7 @@ void __Dictionary::removeObjectsForKeys(__Array* pKey__Array) void __Dictionary::removeObjectForElememt(DictElement* pElement) { - if (pElement != NULL) + if (pElement != nullptr) { HASH_DEL(_elements, pElement); pElement->_object->release(); @@ -345,7 +345,7 @@ Ref* __Dictionary::randomObject() { if (_dictType == kDictUnknown) { - return NULL; + return nullptr; } Ref* key = allKeys()->getRandomObject(); @@ -360,7 +360,7 @@ Ref* __Dictionary::randomObject() } else { - return NULL; + return nullptr; } } @@ -566,9 +566,9 @@ __Dictionary* __Dictionary::clone() const { __Dictionary* newDict = __Dictionary::create(); - DictElement* element = NULL; - Ref* tmpObj = NULL; - Clonable* obj = NULL; + DictElement* element = nullptr; + Ref* tmpObj = nullptr; + Clonable* obj = nullptr; if (_dictType == kDictInt) { CCDICT_FOREACH(this, element) diff --git a/cocos/deprecated/CCSet.cpp b/cocos/deprecated/CCSet.cpp index 081b7a5de6..28c1d9bedb 100644 --- a/cocos/deprecated/CCSet.cpp +++ b/cocos/deprecated/CCSet.cpp @@ -66,7 +66,7 @@ __Set * __Set::create() { __Set * pRet = new __Set(); - if (pRet != NULL) + if (pRet != nullptr) { pRet->autorelease(); } diff --git a/cocos/deprecated/CCString.cpp b/cocos/deprecated/CCString.cpp index 8492573d70..06bf28d7de 100644 --- a/cocos/deprecated/CCString.cpp +++ b/cocos/deprecated/CCString.cpp @@ -69,7 +69,7 @@ bool __String::initWithFormatAndValist(const char* format, va_list ap) { bool bRet = false; char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) + if (pBuf != nullptr) { vsnprintf(pBuf, kMaxStringLen, format, ap); _string = pBuf; @@ -170,7 +170,7 @@ void __String::appendWithFormat(const char* format, ...) va_start(ap, format); char* pBuf = (char*)malloc(kMaxStringLen); - if (pBuf != NULL) + if (pBuf != nullptr) { vsnprintf(pBuf, kMaxStringLen, format, ap); _string.append(pBuf); @@ -207,7 +207,7 @@ bool __String::isEqual(const Ref* pObject) { bool bRet = false; const __String* pStr = dynamic_cast(pObject); - if (pStr != NULL) + if (pStr != nullptr) { if (0 == _string.compare(pStr->_string)) { @@ -226,11 +226,11 @@ __String* __String::create(const std::string& str) __String* __String::createWithData(const unsigned char* data, size_t nLen) { - __String* ret = NULL; - if (data != NULL) + __String* ret = nullptr; + if (data != nullptr) { char* pStr = (char*)malloc(nLen+1); - if (pStr != NULL) + if (pStr != nullptr) { pStr[nLen] = '\0'; if (nLen > 0) diff --git a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp index ba20f8fd13..7cd0f56cf4 100644 --- a/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp @@ -86,15 +86,15 @@ void ControlButtonLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, con void ControlButtonLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_NORMAL) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::NORMAL); } } else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_HIGHLIGHTED) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::HIGH_LIGHTED); } } else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_DISABLED) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::DISABLED); } } else { diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp index 21bb3b0b6b..cd093fdb59 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp @@ -10,15 +10,15 @@ namespace cocosbuilder { void MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((MenuItemImage *)pNode)->setNormalSpriteFrame(pSpriteFrame); } } else if(strcmp(pPropertyName, PROPERTY_SELECTEDDISPLAYFRAME) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((MenuItemImage *)pNode)->setSelectedSpriteFrame(pSpriteFrame); } } else if(strcmp(pPropertyName, PROPERTY_DISABLEDDISPLAYFRAME) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((MenuItemImage *)pNode)->setDisabledSpriteFrame(pSpriteFrame); } } else { diff --git a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp index 1388c3f4ef..6afd3304e2 100644 --- a/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp @@ -9,7 +9,7 @@ namespace cocosbuilder { void MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) { - if (NULL != pBlockData) // Add this condition to allow MenuItemImage without target/selector predefined + if (nullptr != pBlockData) // Add this condition to allow MenuItemImage without target/selector predefined { ((MenuItem *)pNode)->setCallback( std::bind( pBlockData->mSELMenuHandler, pBlockData->_target, std::placeholders::_1) ); // ((MenuItem *)pNode)->setTarget(pBlockData->_target, pBlockData->mSELMenuHandler); diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp index f97adba07f..fd8b7a9765 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp @@ -71,7 +71,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe // #endif // Forward properties for sub ccb files - if (dynamic_cast(pNode) != NULL) + if (dynamic_cast(pNode) != nullptr) { CCBFile *ccbNode = (CCBFile*)pNode; if (ccbNode->getCCBFileNode() && isExtraProp) @@ -80,7 +80,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe // Skip properties that doesn't have a value to override __Array *extraPropsNames = (__Array*)pNode->getUserObject(); - Ref* pObj = NULL; + Ref* pObj = nullptr; bool bFound = false; CCARRAY_FOREACH(extraPropsNames, pObj) { @@ -346,7 +346,7 @@ void NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbRe case CCBReader::PropertyType::BLOCK_CONTROL: { BlockControlData * blockControlData = this->parsePropTypeBlockControl(pNode, pParent, ccbReader); - if(setProp && blockControlData != NULL) { + if(setProp && blockControlData != nullptr) { this->onHandlePropTypeBlockControl(pNode, pParent, propertyName.c_str(), blockControlData, ccbReader); } CC_SAFE_DELETE(blockControlData); @@ -574,14 +574,14 @@ SpriteFrame * NodeLoader::parsePropTypeSpriteFrame(Node * pNode, Node * pParent, std::string spriteSheet = ccbReader->readCachedString(); std::string spriteFile = ccbReader->readCachedString(); - SpriteFrame *spriteFrame = NULL; + SpriteFrame *spriteFrame = nullptr; if (spriteFile.length() != 0) { if (spriteSheet.length() == 0) { spriteFile = ccbReader->getCCBRootPath() + spriteFile; Texture2D * texture = Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str()); - if(texture != NULL) { + if(texture != nullptr) { Rect bounds = Rect(0, 0, texture->getContentSize().width, texture->getContentSize().height); spriteFrame = SpriteFrame::createWithTexture(texture, bounds); } @@ -613,7 +613,7 @@ Animation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCB std::string animationFile = ccbReader->getCCBRootPath() + ccbReader->readCachedString(); std::string animation = ccbReader->readCachedString(); - Animation * ccAnimation = NULL; + Animation * ccAnimation = nullptr; // Support for stripping relative file paths, since ios doesn't currently // know what to do with them, since its pulling from bundle. @@ -642,7 +642,7 @@ Texture2D * NodeLoader::parsePropTypeTexture(Node * pNode, Node * pParent, CCBRe } else { - return NULL; + return nullptr; } } @@ -761,7 +761,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead if(selectorTarget != CCBReader::TargetType::NONE) { - Ref* target = NULL; + Ref* target = nullptr; if(!ccbReader->isJSControlled()) { if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT) @@ -773,7 +773,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead target = ccbReader->getOwner(); } - if(target != NULL) + if(target != nullptr) { if(selectorName.length() > 0) { @@ -781,7 +781,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast(target); - if(targetAsCCBSelectorResolver != NULL) + if(targetAsCCBSelectorResolver != nullptr) { selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str()); } @@ -789,7 +789,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead if(selMenuHandler == 0) { CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver(); - if(ccbSelectorResolver != NULL) + if(ccbSelectorResolver != nullptr) { selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str()); } @@ -809,7 +809,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead CCLOG("Unexpected empty selector."); } } else { - CCLOG("Unexpected NULL target for selector."); + CCLOG("Unexpected nullptr target for selector."); } } else @@ -831,7 +831,7 @@ BlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBRead } } - return NULL; + return nullptr; } BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader) @@ -844,7 +844,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP { if(!ccbReader->isJSControlled()) { - Ref* target = NULL; + Ref* target = nullptr; if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT) { target = ccbReader->getAnimationManager()->getRootNode(); @@ -854,7 +854,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP target = ccbReader->getOwner(); } - if(target != NULL) + if(target != nullptr) { if(selectorName.length() > 0) { @@ -862,7 +862,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast(target); - if(targetAsCCBSelectorResolver != NULL) + if(targetAsCCBSelectorResolver != nullptr) { selControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str()); } @@ -870,7 +870,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP if(selControlHandler == 0) { CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver(); - if(ccbSelectorResolver != NULL) + if(ccbSelectorResolver != nullptr) { selControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str()); } @@ -894,7 +894,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP CCLOG("Unexpected empty selector."); } } else { - CCLOG("Unexpected NULL target for selector."); + CCLOG("Unexpected nullptr target for selector."); } } else @@ -914,7 +914,7 @@ BlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pP } } - return NULL; + return nullptr; } Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * pCCBReader) { @@ -960,7 +960,7 @@ Node * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader reader->getAnimationManager()->runAnimationsForSequenceIdTweenDuration(reader->getAnimationManager()->getAutoPlaySequenceId(), 0); } - if (reader->isJSControlled() && pCCBReader->isJSControlled() && NULL == reader->_owner) + if (reader->isJSControlled() && pCCBReader->isJSControlled() && nullptr == reader->_owner) { //set variables and callback to owner //set callback diff --git a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp index ff497635e0..339058bce8 100644 --- a/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp +++ b/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp @@ -79,10 +79,10 @@ void NodeLoaderLibrary::purge(bool pReleaseNodeLoaders) { -static NodeLoaderLibrary * sSharedNodeLoaderLibrary = NULL; +static NodeLoaderLibrary * sSharedNodeLoaderLibrary = nullptr; NodeLoaderLibrary * NodeLoaderLibrary::getInstance() { - if(sSharedNodeLoaderLibrary == NULL) { + if(sSharedNodeLoaderLibrary == nullptr) { sSharedNodeLoaderLibrary = new NodeLoaderLibrary(); sSharedNodeLoaderLibrary->registerDefaultNodeLoaders(); diff --git a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp index 0194ffd6b2..ab6df19a96 100644 --- a/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp @@ -12,10 +12,10 @@ namespace cocosbuilder { void SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) { - if(pSpriteFrame != NULL) { + if(pSpriteFrame != nullptr) { ((Sprite *)pNode)->setSpriteFrame(pSpriteFrame); } else { - CCLOG("ERROR: SpriteFrame NULL"); + CCLOG("ERROR: SpriteFrame nullptr"); } } else { NodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader); diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp index 7ec73711d8..4c123c2f30 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -278,8 +278,8 @@ void ActionTimeline::emitFrameEvent(Frame* frame) void ActionTimeline::gotoFrame(int frameIndex) { - int size = _timelineList.size(); - for(int i = 0; igotoFrame(frameIndex); } @@ -287,8 +287,8 @@ void ActionTimeline::gotoFrame(int frameIndex) void ActionTimeline::stepToFrame(int frameIndex) { - int size = _timelineList.size(); - for(int i = 0; istepToFrame(frameIndex); } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp index 657db83656..5ccc31f8d9 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp @@ -68,7 +68,7 @@ VisibleFrame* VisibleFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } VisibleFrame::VisibleFrame() @@ -104,7 +104,7 @@ TextureFrame* TextureFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } TextureFrame::TextureFrame() @@ -155,7 +155,7 @@ RotationFrame* RotationFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } RotationFrame::RotationFrame() @@ -204,7 +204,7 @@ SkewFrame* SkewFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } SkewFrame::SkewFrame() @@ -261,7 +261,7 @@ RotationSkewFrame* RotationSkewFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } RotationSkewFrame::RotationSkewFrame() @@ -314,7 +314,7 @@ PositionFrame* PositionFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } PositionFrame::PositionFrame() @@ -366,7 +366,7 @@ ScaleFrame* ScaleFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } ScaleFrame::ScaleFrame() @@ -421,7 +421,7 @@ AnchorPointFrame* AnchorPointFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } AnchorPointFrame::AnchorPointFrame() @@ -457,7 +457,7 @@ InnerActionFrame* InnerActionFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } InnerActionFrame::InnerActionFrame() @@ -493,7 +493,7 @@ ColorFrame* ColorFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } ColorFrame::ColorFrame() @@ -559,7 +559,7 @@ EventFrame* EventFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } EventFrame::EventFrame() @@ -594,7 +594,7 @@ ZOrderFrame* ZOrderFrame::create() return frame; } CC_SAFE_DELETE(frame); - return NULL; + return nullptr; } ZOrderFrame::ZOrderFrame() @@ -605,7 +605,7 @@ ZOrderFrame::ZOrderFrame() void ZOrderFrame::onEnter(Frame *nextFrame) { if(_node) - _node->setZOrder(_zorder); + _node->setLocalZOrder(_zorder); } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp index 3078dcd54a..6d180fc4e2 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCNodeReader.cpp @@ -284,9 +284,9 @@ void NodeReader::initNode(Node* node, const rapidjson::Value& json) if (rotation != 0) node->setRotation(rotation); if(rotationSkewX != 0) - node->setRotationX(rotationSkewX); + node->setRotationSkewX(rotationSkewX); if(rotationSkewY != 0) - node->setRotationY(rotationSkewY); + node->setRotationSkewY(rotationSkewY); if(skewx != 0) node->setSkewX(skewx); if(skewy != 0) @@ -296,19 +296,17 @@ void NodeReader::initNode(Node* node, const rapidjson::Value& json) if(width != 0 || height != 0) node->setContentSize(Size(width, height)); if(zorder != 0) - node->setZOrder(zorder); + node->setLocalZOrder(zorder); if(visible != true) node->setVisible(visible); if(alpha != 255) { node->setOpacity(alpha); - node->setCascadeOpacityEnabled(true); } if(red != 255 || green != 255 || blue != 255) { node->setColor(Color3B(red, green, blue)); - node->setCascadeColorEnabled(true); } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp index 7516cbc255..c9f04cc985 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCTimeLine.cpp @@ -104,7 +104,7 @@ void Timeline::insertFrame(Frame* frame, int index) void Timeline::removeFrame(Frame* frame) { _frames.eraseObject(frame); - frame->setTimeline(NULL); + frame->setTimeline(nullptr); } void Timeline::setNode(Node* node) @@ -131,8 +131,8 @@ void Timeline::apply(int frameIndex) void Timeline::binarySearchKeyFrame(int frameIndex) { - Frame *from = NULL; - Frame *to = NULL; + Frame *from = nullptr; + Frame *to = nullptr; long length = _frames.size(); bool needEnterFrame = false; diff --git a/cocos/editor-support/cocostudio/CCArmature.cpp b/cocos/editor-support/cocostudio/CCArmature.cpp index c7a465485c..d385cc1f4c 100644 --- a/cocos/editor-support/cocostudio/CCArmature.cpp +++ b/cocos/editor-support/cocostudio/CCArmature.cpp @@ -402,9 +402,9 @@ void Armature::draw(cocos2d::Renderer *renderer, const Mat4 &transform, uint32_t Skin *skin = static_cast(node); skin->updateTransform(); - bool blendDirty = bone->isBlendDirty(); + BlendFunc func = bone->getBlendFunc(); - if (blendDirty) + if (func.src != _blendFunc.src || func.dst != _blendFunc.dst) { skin->setBlendFunc(bone->getBlendFunc()); } diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index 5c0daf2e79..7a446d1521 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -201,8 +201,8 @@ void Bone::update(float delta) _worldInfo->y = _tweenData->y + _position.y; _worldInfo->scaleX = _tweenData->scaleX * _scaleX; _worldInfo->scaleY = _tweenData->scaleY * _scaleY; - _worldInfo->skewX = _tweenData->skewX + _skewX + _rotationX; - _worldInfo->skewY = _tweenData->skewY + _skewY - _rotationY; + _worldInfo->skewX = _tweenData->skewX + _skewX + _rotationZ_X; + _worldInfo->skewY = _tweenData->skewY + _skewY - _rotationZ_Y; if(_parentBone) { diff --git a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp index 64ca8917b9..88be54e2cb 100644 --- a/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp +++ b/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp @@ -1311,7 +1311,7 @@ void DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, Data length = DICTOOL->getArrayCount_json(json, CONFIG_FILE_PATH); // json[CONFIG_FILE_PATH].IsNull() ? 0 : json[CONFIG_FILE_PATH].Size(); for (int i = 0; i < length; i++) { - const char *path = DICTOOL->getStringValueFromArray_json(json, CONFIG_FILE_PATH, i); // json[CONFIG_FILE_PATH][i].IsNull() ? NULL : json[CONFIG_FILE_PATH][i].GetString(); + const char *path = DICTOOL->getStringValueFromArray_json(json, CONFIG_FILE_PATH, i); // json[CONFIG_FILE_PATH][i].IsNull() ? nullptr : json[CONFIG_FILE_PATH][i].GetString(); if (path == nullptr) { CCLOG("load CONFIG_FILE_PATH error."); @@ -2426,21 +2426,21 @@ void DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json, } else if (key.compare(A_HEIGHT) == 0) { - if(str != NULL) + if(str != nullptr) { textureData->height = atof(str); } } else if (key.compare(A_PIVOT_X) == 0) { - if(str != NULL) + if(str != nullptr) { textureData->pivotX = atof(str); } } else if (key.compare(A_PIVOT_Y) == 0) { - if(str != NULL) + if(str != nullptr) { textureData->pivotY = atof(str); } diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 9204b255de..7e706e4455 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -351,7 +351,7 @@ Widget* GUIReader::widgetFromBinaryFile(const char *fileName) const char* fileVersion = ""; ui::Widget* widget = nullptr; - if (pBuffer != NULL && nSize > 0) + if (pBuffer != nullptr && nSize > 0) { CocoLoader tCocoLoader; if(true == tCocoLoader.ReadCocoBinBuff((char*)pBuffer)) @@ -494,7 +494,7 @@ Widget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, c if (widget->getContentSize().equals(Size::ZERO)) { Layout* rootWidget = dynamic_cast(widget); - rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight)); + rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight)); } /* ********************** */ @@ -608,7 +608,7 @@ void WidgetPropertiesReader0250::setPropsForWidgetFromJsonDictionary(Widget*widg float w = DICTOOL->getFloatValue_json(options, "width"); float h = DICTOOL->getFloatValue_json(options, "height"); - widget->setSize(Size(w, h)); + widget->setContentSize(Size(w, h)); widget->setTag(DICTOOL->getIntValue_json(options, "tag")); widget->setActionTag(DICTOOL->getIntValue_json(options, "actiontag")); @@ -707,7 +707,7 @@ void WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widg { float swf = DICTOOL->getFloatValue_json(options, "scale9Width"); float shf = DICTOOL->getFloatValue_json(options, "scale9Height"); - button->setSize(Size(swf, shf)); + button->setContentSize(Size(swf, shf)); } } else @@ -823,7 +823,7 @@ void WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*w { float swf = DICTOOL->getFloatValue_json(options, "scale9Width"); float shf = DICTOOL->getFloatValue_json(options, "scale9Height"); - imageView->setSize(Size(swf, shf)); + imageView->setContentSize(Size(swf, shf)); } float cx = DICTOOL->getFloatValue_json(options, "capInsetsX"); @@ -1016,7 +1016,7 @@ void WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widg { slider->loadBarTexture(imageFileName_tp); } - slider->setSize(Size(barLength, slider->getContentSize().height)); + slider->setContentSize(Size(barLength, slider->getContentSize().height)); } else { @@ -1204,7 +1204,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c if (widget->getContentSize().equals(Size::ZERO)) { Layout* rootWidget = dynamic_cast(widget); - rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight)); + rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight)); } /* ********************** */ @@ -1268,7 +1268,7 @@ Widget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, c if (widget->getContentSize().equals(Size::ZERO)) { Layout* rootWidget = dynamic_cast(widget); - rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight)); + rootWidget->setContentSize(Size(fileDesignWidth, fileDesignHeight)); } } } @@ -1340,7 +1340,7 @@ Widget* WidgetPropertiesReader0300::widgetFromBinary(CocoLoader* cocoLoader, st setPropsForAllWidgetFromBinary(reader, widget, cocoLoader, optionsNode); // 2nd., custom widget parse with custom reader //2nd. parse custom property - const char* customProperty = NULL; + const char* customProperty = nullptr; stExpCocoNode *optionChildNode = optionsNode->GetChildArray(cocoLoader); for (int k = 0; k < optionsNode->GetChildNum(); ++k) { std::string key = optionChildNode[k].GetName(cocoLoader); @@ -1459,7 +1459,7 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va } setPropsForAllCustomWidgetFromJsonDictionary(classname, widget, customJsonDict); }else{ - CCLOG("Widget or WidgetReader doesn't exists!!! Please check your csb file."); + CCLOG("Widget or WidgetReader doesn't exists!!! Please check your json file."); } } diff --git a/cocos/editor-support/cocostudio/CCSSceneReader.cpp b/cocos/editor-support/cocostudio/CCSSceneReader.cpp index c6ca142de4..92177e9284 100644 --- a/cocos/editor-support/cocostudio/CCSSceneReader.cpp +++ b/cocos/editor-support/cocostudio/CCSSceneReader.cpp @@ -531,7 +531,7 @@ void SceneReader::setPropertyFromJsonDict(CocoLoader *cocoLoader, stExpCocoNode else if (key == "zorder") { nZorder = atoi(value.c_str()); - node->setZOrder(nZorder); + node->setLocalZOrder(nZorder); } else if(key == "scalex") { diff --git a/cocos/editor-support/cocostudio/CocoLoader.cpp b/cocos/editor-support/cocostudio/CocoLoader.cpp index 8a0aeced5b..da84bd9200 100644 --- a/cocos/editor-support/cocostudio/CocoLoader.cpp +++ b/cocos/editor-support/cocostudio/CocoLoader.cpp @@ -92,7 +92,7 @@ Type stExpCocoNode::GetType(CocoLoader* pCoco) char* stExpCocoNode::GetName(CocoLoader* pCoco) { - char* szName = NULL ; + char* szName = nullptr ; if(m_ObjIndex >= 0) { stExpCocoObjectDesc* tpCocoObjectDesc = pCoco->GetCocoObjectDescArray(); @@ -132,9 +132,15 @@ char* stExpCocoNode::GetName(CocoLoader* pCoco) char* stExpCocoNode::GetValue(CocoLoader* pCoco) { - return ( pCoco->GetMemoryAddr_String() + m_szValue ); + char* szValue = ( pCoco->GetMemoryAddr_String() + m_szValue ); + if( 0==strcmp(szValue,"null") && GetType(pCoco) == kStringType ) + { + strcpy(szValue,""); + } + return szValue; } + int stExpCocoNode::GetChildNum() { return m_ChildNum; @@ -147,9 +153,9 @@ stExpCocoNode* stExpCocoNode::GetChildArray(CocoLoader* pCoco) CocoLoader::CocoLoader() { - m_pRootNode = NULL; - m_pObjectDescArray = NULL; - m_pMemoryBuff = NULL; + m_pRootNode = nullptr; + m_pObjectDescArray = nullptr; + m_pMemoryBuff = nullptr; } CocoLoader::~CocoLoader() @@ -157,7 +163,7 @@ CocoLoader::~CocoLoader() if(m_pMemoryBuff) { delete[] m_pMemoryBuff; - m_pMemoryBuff = NULL; + m_pMemoryBuff = nullptr; } } @@ -176,7 +182,7 @@ bool CocoLoader::ReadCocoBinBuff(char* pBinBuff) char* pDestBuff = new char[m_pFileHeader->m_nDataSize]; uLongf dwSrcSize = m_pFileHeader->m_nCompressSize; uLongf dwDestSize = m_pFileHeader->m_nDataSize; - int nRes = uncompress((Bytef*)pDestBuff,&dwDestSize,(Bytef*)m_pMemoryBuff,dwSrcSize); + uncompress((Bytef*)pDestBuff,&dwDestSize,(Bytef*)m_pMemoryBuff,dwSrcSize); pStartAddr = m_pMemoryBuff = pDestBuff; } @@ -198,7 +204,7 @@ stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(const char* szObjDesc) return &m_pObjectDescArray[i]; } } - return NULL; + return nullptr; } stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(int vIndex) @@ -207,7 +213,7 @@ stExpCocoObjectDesc* CocoLoader::GetCocoObjectDesc(int vIndex) { return &m_pObjectDescArray[vIndex]; } - return NULL; + return nullptr; } char* CocoLoader::GetMemoryAddr_AttribDesc() diff --git a/cocos/editor-support/cocostudio/TriggerMng.cpp b/cocos/editor-support/cocostudio/TriggerMng.cpp index 5e90a13d71..779b5dca86 100755 --- a/cocos/editor-support/cocostudio/TriggerMng.cpp +++ b/cocos/editor-support/cocostudio/TriggerMng.cpp @@ -115,7 +115,7 @@ void TriggerMng::parse(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCoc #if CC_ENABLE_SCRIPT_BINDING ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine(); - bool useBindings = engine != NULL; + bool useBindings = engine != nullptr; if (useBindings) { @@ -234,7 +234,7 @@ bool TriggerMng::isEmpty(void) const const char *str2 = pActionArray[i3].GetValue(pCocoLoader); if (key2.compare("classname") == 0) { - if (str2 != NULL) + if (str2 != nullptr) { action.AddMember("classname", str2, allocator); } @@ -255,7 +255,7 @@ bool TriggerMng::isEmpty(void) const const char *str3 = pDataItemArray[i5].GetValue(pCocoLoader); if (key3.compare("key") == 0) { - if (str3 != NULL) + if (str3 != nullptr) { dataitem.AddMember("key", str3, allocator); } @@ -310,7 +310,7 @@ bool TriggerMng::isEmpty(void) const const char *str4 = pConditionArray[i7].GetValue(pCocoLoader); if (key4.compare("classname") == 0) { - if (str4 != NULL) + if (str4 != nullptr) { cond.AddMember("classname", str4, allocator); } @@ -331,7 +331,7 @@ bool TriggerMng::isEmpty(void) const const char *str5 = pDataItemArray[i9].GetValue(pCocoLoader); if (key5.compare("key") == 0) { - if (str5 != NULL) + if (str5 != nullptr) { dataitem.AddMember("key", str5, allocator); } @@ -380,7 +380,7 @@ bool TriggerMng::isEmpty(void) const stExpCocoNode *pEventArray = pEventsArray->GetChildArray(pCocoLoader); std::string key6 = pEventArray[0].GetName(pCocoLoader); const char *str6 = pEventArray[0].GetValue(pCocoLoader); - if (key6.compare("id") == 0 && str6 != NULL) + if (key6.compare("id") == 0 && str6 != nullptr) { event.AddMember("id", atoi(str6), allocator); eventsItem.PushBack(event, allocator); @@ -390,7 +390,7 @@ bool TriggerMng::isEmpty(void) const } else if (key1.compare("id") == 0) { - if (str1 != NULL) + if (str1 != nullptr) { vElemItem.AddMember("id", atoi(str1), allocator); } diff --git a/cocos/editor-support/cocostudio/TriggerObj.cpp b/cocos/editor-support/cocostudio/TriggerObj.cpp index 444780de5e..7fec68a848 100755 --- a/cocos/editor-support/cocostudio/TriggerObj.cpp +++ b/cocos/editor-support/cocostudio/TriggerObj.cpp @@ -253,7 +253,7 @@ void TriggerObj::serialize(const rapidjson::Value &val) const char* str0 = pTriggerObjArray[i0].GetValue(pCocoLoader); if (key.compare("id") == 0) { - if (str0 != NULL) + if (str0 != nullptr) { _id = atoi(str0); //(unsigned int)(DICTOOL->getIntValue_json(val, "id")); } @@ -292,7 +292,7 @@ void TriggerObj::serialize(const rapidjson::Value &val) continue; } BaseTriggerAction *act = dynamic_cast(ObjectFactory::getInstance()->createObject(classname)); - CCAssert(act != NULL, "class named classname can not implement!"); + CCAssert(act != nullptr, "class named classname can not implement!"); act->serialize(pCocoLoader, &pActionArray[1]); act->init(); _acts.pushBack(act); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index c96a1dfbe7..0587e91454 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -152,7 +152,7 @@ namespace cocostudio if (button->isScale9Enabled()) { button->setCapInsets(Rect(capsx, capsy, capsWidth, capsHeight)); - button->setSize(Size(scale9Width, scale9Height)); + button->setContentSize(Size(scale9Width, scale9Height)); } button->setTitleColor(Color3B(cri, cgi, cbi)); @@ -203,7 +203,7 @@ namespace cocostudio { float swf = DICTOOL->getFloatValue_json(options, P_Scale9Width); float shf = DICTOOL->getFloatValue_json(options, P_Scale9Height); - button->setSize(Size(swf, shf)); + button->setContentSize(Size(swf, shf)); } } bool tt = DICTOOL->checkObjectExist_json(options, P_Text); diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index 691097d1eb..85a6775411 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -15,7 +15,7 @@ namespace cocostudio static const char* P_BackGroundBoxDisabledData = "backGroundBoxDisabledData"; static const char* P_FrontCrossDisabledData = "frontCrossDisabledData"; - static CheckBoxReader* instanceCheckBoxReader = NULL; + static CheckBoxReader* instanceCheckBoxReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(CheckBoxReader) diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index 4e8be4ac45..2558a17d85 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -19,7 +19,7 @@ namespace cocostudio static const char* P_Scale9Height = "scale9Height"; - static ImageViewReader* instanceImageViewReader = NULL; + static ImageViewReader* instanceImageViewReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(ImageViewReader) @@ -128,7 +128,7 @@ namespace cocostudio float swf = DICTOOL->getFloatValue_json(options, P_Scale9Width,80.0f); float shf = DICTOOL->getFloatValue_json(options, P_Scale9Height,80.0f); - imageView->setSize(Size(swf, shf)); + imageView->setContentSize(Size(swf, shf)); float cx = DICTOOL->getFloatValue_json(options, P_CapInsetsX); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index 1d8db7e9c3..42c504a1d2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -34,7 +34,7 @@ namespace cocostudio static const char* P_BackGroundImageData = "backGroundImageData"; static const char* P_LayoutType = "layoutType"; - static LayoutReader* instanceLayoutReader = NULL; + static LayoutReader* instanceLayoutReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(LayoutReader) @@ -72,7 +72,7 @@ namespace cocostudio int ecr=0, ecg=0, ecb= 0; float bgcv1 = 0.0f, bgcv2= 0.0f; float capsx = 0.0f, capsy = 0.0, capsWidth = 0.0, capsHeight = 0.0f; - Layout::Type layoutType; + Layout::Type layoutType = Layout::Type::ABSOLUTE; int bgColorOpacity = panel->getBackGroundColorOpacity(); for (int i = 0; i < cocoNode->GetChildNum(); ++i) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index 0870898954..89e5c72344 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -12,7 +12,7 @@ namespace cocostudio static const char* P_Direction = "direction"; static const char* P_ItemMargin = "itemMargin"; - static ListViewReader* instanceListViewReader = NULL; + static ListViewReader* instanceListViewReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(ListViewReader) diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index 3c09400c96..f283ac4c56 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -19,7 +19,7 @@ namespace cocostudio static const char* P_Direction = "direction"; static const char* P_Percent = "percent"; - static LoadingBarReader* instanceLoadingBar = NULL; + static LoadingBarReader* instanceLoadingBar = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(LoadingBarReader) @@ -130,7 +130,7 @@ namespace cocostudio float width = DICTOOL->getFloatValue_json(options, P_Width); float height = DICTOOL->getFloatValue_json(options, P_Height); - loadingBar->setSize(Size(width, height)); + loadingBar->setContentSize(Size(width, height)); /**/ diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index a4531be2e8..e15cd2b52f 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -18,9 +18,7 @@ namespace cocostudio static const char* P_BallDisabledData = "ballDisabledData"; static const char* P_ProgressBarData = "progressBarData"; - static const char* P_BarFileName = "barFileName"; - - static SliderReader* instanceSliderReader = NULL; + static SliderReader* instanceSliderReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(SliderReader) @@ -125,7 +123,7 @@ namespace cocostudio } //end of for loop if (slider->isScale9Enabled()) { - slider->setSize(Size(barLength, slider->getContentSize().height)); + slider->setContentSize(Size(barLength, slider->getContentSize().height)); } slider->setPercent(percent); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index b4ff2c7561..45fccfda69 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -15,10 +15,7 @@ namespace cocostudio static const char* P_ItemHeight = "itemHeight"; static const char* P_StartCharMap = "startCharMap"; - - static const char* P_CharMapFile = "charMapFile"; - - static TextAtlasReader* instanceTextAtalsReader = NULL; + static TextAtlasReader* instanceTextAtalsReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(TextAtlasReader) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index 99c6f3735a..a13dffde8a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -12,7 +12,7 @@ namespace cocostudio static const char* P_FileNameData = "fileNameData"; static const char* P_Text = "text"; - static TextBMFontReader* instanceTextBMFontReader = NULL; + static TextBMFontReader* instanceTextBMFontReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(TextBMFontReader) diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index 5d844a5cff..117a4d3216 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -9,7 +9,7 @@ using namespace ui; namespace cocostudio { - static TextFieldReader* instanceTextFieldReader = NULL; + static TextFieldReader* instanceTextFieldReader = nullptr; static const char* P_PlaceHolder = "placeHolder"; static const char* P_Text = "text"; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index d0b021582d..6cd77cf038 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -18,7 +18,7 @@ namespace cocostudio static const char* P_HAlignment = "hAlignment"; static const char* P_VAlignment = "vAlignment"; - static TextReader* instanceTextReader = NULL; + static TextReader* instanceTextReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(TextReader) @@ -49,7 +49,7 @@ namespace cocostudio Text* label = static_cast(widget); - std::string jsonPath = GUIReader::getInstance()->getFilePath(); + std::string binaryFilePath = GUIReader::getInstance()->getFilePath(); for (int i = 0; i < cocoNode->GetChildNum(); ++i) { @@ -69,8 +69,13 @@ namespace cocostudio }else if(key == P_FontSize){ label->setFontSize(valueToInt(value)); }else if(key == P_FontName){ - std::string fontFilePath = jsonPath.append(value); - label->setFontName(fontFilePath); + std::string fontFilePath; + fontFilePath = binaryFilePath.append(value); + if (FileUtils::getInstance()->isFileExist(fontFilePath)) { + label->setFontName(fontFilePath); + }else{ + label->setFontName(value); + } }else if(key == P_AreaWidth){ label->setTextAreaSize(Size(valueToFloat(value), label->getTextAreaSize().height)); }else if(key == P_AreaHeight){ @@ -101,8 +106,15 @@ namespace cocostudio label->setFontSize(DICTOOL->getIntValue_json(options, P_FontSize,20)); std::string fontName = DICTOOL->getStringValue_json(options, P_FontName, "微软雅黑"); + std::string fontFilePath = jsonPath.append(fontName); - label->setFontName(fontFilePath); + if (FileUtils::getInstance()->isFileExist(fontFilePath)) + { + label->setFontName(fontFilePath); + } + else{ + label->setFontName(fontName); + } bool aw = DICTOOL->checkObjectExist_json(options, P_AreaWidth); bool ah = DICTOOL->checkObjectExist_json(options, P_AreaHeight); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 06478699ae..f68f2af107 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -59,7 +59,7 @@ namespace cocostudio const char* P_Path = "path"; - static WidgetReader* instanceWidgetReader = NULL; + static WidgetReader* instanceWidgetReader = nullptr; IMPLEMENT_CLASS_WIDGET_READER_INFO(WidgetReader) @@ -114,8 +114,10 @@ namespace cocostudio void WidgetReader::setPropsFromJsonDictionary(Widget *widget, const rapidjson::Value &options) { - widget->ignoreContentAdaptWithSize(DICTOOL->getBooleanValue_json(options, P_IgnoreSize,false)); - + bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, P_IgnoreSize); + if (ignoreSizeExsit) { + widget->ignoreContentAdaptWithSize(DICTOOL->getBooleanValue_json(options, P_IgnoreSize)); + } widget->setSizeType((Widget::SizeType)DICTOOL->getIntValue_json(options, P_SizeType)); widget->setPositionType((Widget::PositionType)DICTOOL->getIntValue_json(options, P_PositionType)); @@ -137,7 +139,7 @@ namespace cocostudio w = DICTOOL->getFloatValue_json(options, P_Width); h = DICTOOL->getFloatValue_json(options, P_Height); } - widget->setSize(Size(w, h)); + widget->setContentSize(Size(w, h)); widget->setTag(DICTOOL->getIntValue_json(options, P_Tag)); widget->setActionTag(DICTOOL->getIntValue_json(options, P_ActionTag)); @@ -257,7 +259,7 @@ namespace cocostudio widget->setOpacity(_opacity); //the setSize method will be conflict with scale9Width & scale9Height if (!widget->isIgnoreContentAdaptWithSize()) { - widget->setSize(Size(_width, _height)); + widget->setContentSize(Size(_width, _height)); } widget->setPosition(_position); widget->setAnchorPoint(_originalAnchorPoint); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index 319b525190..ca62aab066 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -174,7 +174,7 @@ namespace cocostudio }else if(key == P_Visbile){ \ widget->setVisible(valueToBool(value)); \ }else if(key == P_ZOrder){ \ - widget->setZOrder(valueToInt(value)); \ + widget->setLocalZOrder(valueToInt(value)); \ }else if(key == P_LayoutParameter){ \ stExpCocoNode *layoutCocosNode = stChildArray[i].GetChildArray(cocoLoader); \ ui::LinearLayoutParameter *linearParameter = ui::LinearLayoutParameter::create(); \ diff --git a/cocos/math/Mat4.cpp b/cocos/math/Mat4.cpp index cd6217f1ad..ff598d3da8 100644 --- a/cocos/math/Mat4.cpp +++ b/cocos/math/Mat4.cpp @@ -156,7 +156,7 @@ void Mat4::createOrthographicOffCenter(float left, float right, float bottom, fl void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, const Vec3& cameraUpVector, Mat4* dst) { - createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, NULL, dst); + createBillboardHelper(objectPosition, cameraPosition, cameraUpVector, nullptr, dst); } void Mat4::createBillboard(const Vec3& objectPosition, const Vec3& cameraPosition, @@ -441,7 +441,7 @@ bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const } // Nothing left to do. - if (scale == NULL && rotation == NULL) + if (scale == nullptr && rotation == nullptr) return true; // Extract the scale. @@ -469,7 +469,7 @@ bool Mat4::decompose(Vec3* scale, Quaternion* rotation, Vec3* translation) const } // Nothing left to do. - if (rotation == NULL) + if (rotation == nullptr) return true; // Scale too close to zero, can't decompose rotation. @@ -559,17 +559,17 @@ float Mat4::determinant() const void Mat4::getScale(Vec3* scale) const { - decompose(scale, NULL, NULL); + decompose(scale, nullptr, nullptr); } bool Mat4::getRotation(Quaternion* rotation) const { - return decompose(NULL, rotation, NULL); + return decompose(nullptr, rotation, nullptr); } void Mat4::getTranslation(Vec3* translation) const { - decompose(NULL, NULL, translation); + decompose(nullptr, nullptr, translation); } void Mat4::getUpVector(Vec3* dst) const diff --git a/cocos/network/SocketIO.cpp b/cocos/network/SocketIO.cpp index 0afb564976..ac36095145 100644 --- a/cocos/network/SocketIO.cpp +++ b/cocos/network/SocketIO.cpp @@ -401,9 +401,9 @@ void SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data) s_data = payload; - SIOClient *c = NULL; + SIOClient *c = nullptr; c = getClient(endpoint); - if (c == NULL) log("SIOClientImpl::onMessage client lookup returned NULL"); + if (c == nullptr) log("SIOClientImpl::onMessage client lookup returned nullptr"); switch(control) { @@ -671,7 +671,7 @@ SIOClient* SocketIO::connect(const std::string& uri, SocketIO::SIODelegate& dele //check if already connected to endpoint, handle c = socket->getClient(path); - if(c == NULL) + if(c == nullptr) { c = new SIOClient(host, port, path, socket, delegate); diff --git a/cocos/network/WebSocket.cpp b/cocos/network/WebSocket.cpp index 4035af022d..e0729b7f98 100644 --- a/cocos/network/WebSocket.cpp +++ b/cocos/network/WebSocket.cpp @@ -445,7 +445,7 @@ void WebSocket::onSubThreadStarted() _path.c_str(), _host.c_str(), _host.c_str(), name.c_str(), -1); - if(NULL == _wsInstance) { + if(nullptr == _wsInstance) { WsMessage* msg = new WsMessage(); msg->what = WS_MSG_TO_UITHREAD_ERROR; _readyState = State::CLOSING; diff --git a/cocos/platform/CCApplicationProtocol.h b/cocos/platform/CCApplicationProtocol.h index bf040c059d..32727027e2 100644 --- a/cocos/platform/CCApplicationProtocol.h +++ b/cocos/platform/CCApplicationProtocol.h @@ -27,6 +27,8 @@ THE SOFTWARE. #define __CC_APPLICATION_PROTOCOL_H__ #include "base/CCPlatformMacros.h" +#include "base/CCScriptSupport.h" +#include "base/CCAutoreleasePool.h" NS_CC_BEGIN @@ -61,7 +63,13 @@ public: * @js NA * @lua NA */ - virtual ~ApplicationProtocol() {} + virtual ~ApplicationProtocol(){ +#if CC_ENABLE_SCRIPT_BINDING + ScriptEngineManager::destroyInstance(); +#endif + // clean auto release pool + PoolManager::destroyInstance(); + } /** @brief Implement Director and Scene init code here. diff --git a/cocos/platform/CCGLViewProtocol.cpp b/cocos/platform/CCGLViewProtocol.cpp index 194ae5d696..1e8423a155 100644 --- a/cocos/platform/CCGLViewProtocol.cpp +++ b/cocos/platform/CCGLViewProtocol.cpp @@ -315,7 +315,7 @@ void GLViewProtocol::handleTouchesMove(int num, intptr_t ids[], float xs[], floa else { // It is error, should return. - CCLOG("Moving touches with id: %ld error", id); + CCLOG("Moving touches with id: %ld error", (long int)id); return; } } diff --git a/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_7.jar b/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_7.jar deleted file mode 100644 index 9cd732aa00..0000000000 Binary files a/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_7.jar and /dev/null differ diff --git a/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_8.jar b/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_8.jar new file mode 100644 index 0000000000..5aa738c296 Binary files /dev/null and b/cocos/platform/android/ControllerManualAdapter/libs/nibiru_lib_2_1_8.jar differ diff --git a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java index caaaba23aa..f5bc665c2b 100644 --- a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java +++ b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerActivity.java @@ -31,7 +31,6 @@ import org.cocos2dx.lib.inputmanagercompat.InputManagerCompat.InputDeviceListene import org.cocos2dx.lib.Cocos2dxActivity; import android.os.Bundle; -import android.view.InputDevice; import android.view.KeyEvent; import android.view.MotionEvent; import android.util.Log; @@ -189,14 +188,16 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements if (mControllerNibiru != null) { handled |= mControllerNibiru.dispatchKeyEvent(event); } - if (mControllerMoga != null) { + if (handled == false && mControllerMoga != null) { handled |= mControllerMoga.dispatchKeyEvent(event); } - if (mControllerOuya != null) { + if (handled == false && mControllerOuya != null) { handled |= mControllerOuya.dispatchKeyEvent(event); } - handled |= mControllerHelper.dispatchKeyEvent(event); + if (handled == false) { + handled |= mControllerHelper.dispatchKeyEvent(event); + } return handled || super.dispatchKeyEvent(event); } @@ -207,31 +208,25 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements if (mControllerNibiru != null) { handled |= mControllerNibiru.dispatchGenericMotionEvent(event); } - if (mControllerMoga != null) { + if (handled == false && mControllerMoga != null) { handled |= mControllerMoga.dispatchGenericMotionEvent(event); } - if (mControllerOuya != null) { + if (handled == false && mControllerOuya != null) { handled |= mControllerOuya.dispatchGenericMotionEvent(event); } - handled |= mControllerHelper.dispatchGenericMotionEvent(event); + if (handled == false) { + handled |= mControllerHelper.dispatchGenericMotionEvent(event); + } return handled || super.dispatchGenericMotionEvent(event); } @Override - public void onInputDeviceAdded(int deviceId) { - + public void onInputDeviceAdded(int deviceId) { Log.d(TAG,"onInputDeviceAdded:" + deviceId); - InputDevice device = InputDevice.getDevice(deviceId); - int deviceSource = device.getSources(); - - if ( ((deviceSource & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) - || ((deviceSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) ) - { - GameControllerAdapter.onConnected("Standard", deviceId); - } + mControllerHelper.onInputDeviceAdded(deviceId); } /* * This is an unusual case. Input devices don't typically change, but they @@ -244,7 +239,7 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements */ @Override public void onInputDeviceChanged(int deviceId) { - Log.d(TAG,"onInputDeviceChanged:" + deviceId); + Log.w(TAG,"onInputDeviceChanged:" + deviceId); } /* @@ -258,14 +253,7 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements public void onInputDeviceRemoved(int deviceId) { Log.d(TAG,"onInputDeviceRemoved:" + deviceId); - InputDevice device = InputDevice.getDevice(deviceId); - int deviceSource = device.getSources(); - - if ( ((deviceSource & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) - || ((deviceSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) ) - { - GameControllerAdapter.onDisconnected("Standard", deviceId); - } + mControllerHelper.onInputDeviceRemoved(deviceId); } @Override @@ -281,8 +269,10 @@ public abstract class GameControllerActivity extends Cocos2dxActivity implements if (mControllerOuya != null) { mControllerOuya.onResume(); } + + mControllerHelper.gatherControllers(); } - + @Override protected void onPause() { if (mControllerNibiru != null) { diff --git a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java index acf0d7f299..e4c756e074 100644 --- a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java +++ b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerHelper.java @@ -1,6 +1,8 @@ package org.cocos2dx.lib; -import android.util.Log; +import java.util.ArrayList; + +import android.util.SparseArray; import android.util.SparseIntArray; import android.view.InputDevice; import android.view.KeyEvent; @@ -53,7 +55,6 @@ public class GameControllerHelper { ControllerKeyMap.put(KeyEvent.KEYCODE_BUTTON_START, GameControllerDelegate.BUTTON_START); ControllerKeyMap.put(KeyEvent.KEYCODE_BUTTON_SELECT, GameControllerDelegate.BUTTON_SELECT); - //KEYCODE_BUTTON_MODE } private float mOldLeftThumbstickX = 0.0f; @@ -76,87 +77,71 @@ public class GameControllerHelper { || ((eventSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) ) { if (event.getAction() == MotionEvent.ACTION_MOVE) { - int devicedId = event.getDeviceId(); + int deviceId = event.getDeviceId(); + String deviceName = event.getDevice().getName(); + if(mGameController.get(deviceId) == null){ + mGameController.append(deviceId, deviceName); + } float newAXIS_LX = event.getAxisValue(AXIS_X); if (Float.compare(newAXIS_LX , mOldLeftThumbstickX) != 0) { - GameControllerAdapter.onAxisEvent(StandardControllerName, devicedId, GameControllerDelegate.THUMBSTICK_LEFT_X, newAXIS_LX, true); + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_X, newAXIS_LX, true); mOldLeftThumbstickX = newAXIS_LX; handled = true; } float newAXIS_LY = event.getAxisValue(AXIS_Y); if (Float.compare(newAXIS_LY , mOldLeftThumbstickY) != 0) { - GameControllerAdapter.onAxisEvent(StandardControllerName, devicedId, GameControllerDelegate.THUMBSTICK_LEFT_Y, newAXIS_LY, true); + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_Y, newAXIS_LY, true); mOldLeftThumbstickY = newAXIS_LY; handled = true; } float newAXIS_RX = event.getAxisValue(AXIS_Z); if (Float.compare(newAXIS_RX , mOldRightThumbstickX) != 0) { - GameControllerAdapter.onAxisEvent(StandardControllerName, devicedId, GameControllerDelegate.THUMBSTICK_RIGHT_X, newAXIS_RX, true); + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_X, newAXIS_RX, true); mOldRightThumbstickX = newAXIS_RX; handled = true; } float newAXIS_RY = event.getAxisValue(AXIS_RZ); if (Float.compare(newAXIS_RY , mOldRightThumbstickY) != 0) { - GameControllerAdapter.onAxisEvent(StandardControllerName, devicedId, GameControllerDelegate.THUMBSTICK_RIGHT_Y, newAXIS_RY, true); + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_Y, newAXIS_RY, true); mOldRightThumbstickY = newAXIS_RY; handled = true; } float newAXIS_LTRIGGER = event.getAxisValue(AXIS_LTRIGGER); if (Float.compare(newAXIS_LTRIGGER , mOldLeftTrigger) != 0) { - if (Float.compare(newAXIS_LTRIGGER, 0.0f) == 0) { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, false, 0.0f, true); - }else { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, true, newAXIS_LTRIGGER, true); - } + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, newAXIS_LTRIGGER, true); mOldLeftTrigger = newAXIS_LTRIGGER; handled = true; } float newAXIS_RTRIGGER = event.getAxisValue(AXIS_RTRIGGER); if (Float.compare(newAXIS_RTRIGGER , mOldRightTrigger) != 0) { - if (Float.compare(newAXIS_RTRIGGER, 0.0f) == 0) { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, false, 0.0f, true); - }else { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, true, newAXIS_RTRIGGER, true); - } + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, newAXIS_RTRIGGER, true); mOldRightTrigger = newAXIS_RTRIGGER; handled = true; } float newAXIS_BRAKE = event.getAxisValue(AXIS_BRAKE); if (Float.compare(newAXIS_BRAKE , mOldBrake) != 0) { - if (Float.compare(newAXIS_BRAKE, 0.0f) == 0) { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, false, 0.0f, true); - }else { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, true, newAXIS_BRAKE, true); - } + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, newAXIS_BRAKE, true); mOldBrake = newAXIS_BRAKE; handled = true; } float newAXIS_THROTTLE = event.getAxisValue(AXIS_THROTTLE); if (Float.compare(newAXIS_THROTTLE , mOldThrottle) != 0) { - if (Float.compare(newAXIS_THROTTLE, 0.0f) == 0) { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, false, 0.0f, true); - }else { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, true, newAXIS_THROTTLE, true); - } + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, newAXIS_THROTTLE, true); mOldThrottle = newAXIS_THROTTLE; handled = true; } float newAXIS_GAS = event.getAxisValue(AXIS_GAS); if (Float.compare(newAXIS_GAS , mOldGas) != 0) { - if (Float.compare(newAXIS_GAS, 0.0f) == 0) { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, false, 0.0f, true); - }else { - GameControllerAdapter.onButtonEvent(StandardControllerName, devicedId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, true, newAXIS_GAS, true); - } + GameControllerAdapter.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, newAXIS_GAS, true); mOldGas = newAXIS_GAS; handled = true; } @@ -166,26 +151,105 @@ public class GameControllerHelper { return handled; } + private static SparseArray> mControllerExtendKey = new SparseArray>(); + public boolean dispatchKeyEvent(KeyEvent event) { boolean handled = false; int eventSource = event.getSource(); - int controllerKey = ControllerKeyMap.get(event.getKeyCode()); + int keyCode = event.getKeyCode(); + int controllerKey = ControllerKeyMap.get(keyCode); - if (controllerKey != 0 && (((eventSource & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) - || ((eventSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) - || ((eventSource & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD))) + if (((eventSource & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) + || ((eventSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) ) { + int deviceId = event.getDeviceId(); + String deviceName = event.getDevice().getName(); + + if(mGameController.get(deviceId) == null){ + mGameController.append(deviceId, deviceName); + } + + if (controllerKey == 0) { + if (mControllerExtendKey.get(deviceId) != null && mControllerExtendKey.get(deviceId).contains(keyCode)) { + controllerKey = keyCode; + }else { + return false; + } + } + int action = event.getAction(); if (action == KeyEvent.ACTION_DOWN) { handled = true; - GameControllerAdapter.onButtonEvent(StandardControllerName,event.getDeviceId(), controllerKey,true, 1.0f, false); + GameControllerAdapter.onButtonEvent(deviceName, deviceId, controllerKey,true, 1.0f, false); }else if (action == KeyEvent.ACTION_UP) { handled = true; - GameControllerAdapter.onButtonEvent(StandardControllerName,event.getDeviceId(), controllerKey,false, 0.0f, false); + GameControllerAdapter.onButtonEvent(deviceName, deviceId, controllerKey,false, 0.0f, false); } } return handled; } + + public static void receiveExternalKeyEvent(int deviceId,int externalKeyCode,boolean receive) { + if (receive) { + if (mControllerExtendKey.get(deviceId) == null) { + mControllerExtendKey.put(deviceId, new ArrayList()); + } + mControllerExtendKey.get(deviceId).add(externalKeyCode); + } else { + if (mControllerExtendKey.get(deviceId) != null) { + mControllerExtendKey.get(deviceId).remove(Integer.valueOf(externalKeyCode)); + } + } + } + + SparseArray mGameController = new SparseArray(); + + void onInputDeviceAdded(int deviceId){ + try { + InputDevice device = InputDevice.getDevice(deviceId); + int deviceSource = device.getSources(); + + if ( ((deviceSource & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) + || ((deviceSource & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK) ) + { + String deviceName = device.getName(); + mGameController.append(deviceId, deviceName); + GameControllerAdapter.onConnected(deviceName, deviceId); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + void onInputDeviceChanged(int deviceId){ + gatherControllers(); + } + + void onInputDeviceRemoved(int deviceId) { + if (mGameController.get(deviceId) != null) { + GameControllerAdapter.onDisconnected(mGameController.get(deviceId), deviceId); + mGameController.delete(deviceId); + } + } + + void gatherControllers(){ + int controllerCount = mGameController.size(); + for (int i = 0; i < controllerCount; i++) { + try { + int controllerDeveceId = mGameController.keyAt(i); + InputDevice device = InputDevice.getDevice(controllerDeveceId); + if (device == null) { + GameControllerAdapter.onDisconnected(mGameController.get(controllerDeveceId), controllerDeveceId); + mGameController.delete(controllerDeveceId); + } + } catch (Exception e) { + int controllerDeveceId = mGameController.keyAt(i); + GameControllerAdapter.onDisconnected(mGameController.get(controllerDeveceId), controllerDeveceId); + mGameController.delete(controllerDeveceId); + e.printStackTrace(); + } + } + } } diff --git a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java index 0ebfc23a70..2fe73a642b 100644 --- a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java +++ b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerMoga.java @@ -129,28 +129,18 @@ public class GameControllerMoga implements ControllerListener, GameControllerDel float newLeftTrigger = event.getAxisValue(MotionEvent.AXIS_LTRIGGER); if (newLeftTrigger != mOldLeftTrigger) { - boolean isPressed = true; - if (Float.compare(newLeftTrigger, 0.0f) == 0) { - isPressed = false; - } - mControllerEventListener.onButtonEvent(mVendorName, + mControllerEventListener.onAxisEvent(mVendorName, controllerId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, - isPressed, newLeftTrigger, true); mOldLeftTrigger = newLeftTrigger; } float newRightTrigger = event.getAxisValue(MotionEvent.AXIS_RTRIGGER); if (newRightTrigger != mOldRightTrigger) { - boolean isPressed = true; - if (Float.compare(newRightTrigger, 0.0f) == 0) { - isPressed = false; - } - mControllerEventListener.onButtonEvent(mVendorName, + mControllerEventListener.onAxisEvent(mVendorName, controllerId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, - isPressed, newRightTrigger, true); mOldRightTrigger = newRightTrigger; } diff --git a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerNibiru.java b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerNibiru.java index c53a661500..142a19f671 100644 --- a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerNibiru.java +++ b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerNibiru.java @@ -27,7 +27,6 @@ public class GameControllerNibiru implements OnControllerSeviceListener, OnKeyLi OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameControllerDelegate { private static final String TAG = "NibiruTag"; - private static final String mVendorName = "Nibiru"; private Context mContext; private SparseIntArray mKeyMap; @@ -74,7 +73,7 @@ OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameContr mControllerService.setEnableLR2(true); mControllerService.setAutoKeyUpMode(false); - mControllerService.checkNibiruInstall(mContext, true); + mControllerService.checkNibiruInstall(mContext, false); } } @@ -132,7 +131,14 @@ OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameContr } if (mControllerEventListener != null) { - mControllerEventListener.onButtonEvent(mVendorName, playerOrder, mKeyMap.get(keyCode), true, 1.0f, false); + try { + ControllerDevice controllerDevice = mControllerService.getDeviceByPlayerOrder(playerOrder); + + mControllerEventListener.onButtonEvent(controllerDevice.getDeviceName(), controllerDevice.getDeviceId(), + mKeyMap.get(keyCode), true, 1.0f, false); + } catch (ControllerServiceException e) { + e.printStackTrace(); + } } } @@ -144,28 +150,52 @@ OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameContr } if (mControllerEventListener != null) { - mControllerEventListener.onButtonEvent(mVendorName, playerOrder, - mKeyMap.get(keyCode), false, 0.0f, false); + try { + ControllerDevice controllerDevice = mControllerService.getDeviceByPlayerOrder(playerOrder); + + mControllerEventListener.onButtonEvent(controllerDevice.getDeviceName(), controllerDevice.getDeviceId(), + mKeyMap.get(keyCode), false, 0.0f, false); + } catch (ControllerServiceException e) { + e.printStackTrace(); + } } } @Override public void onLeftStickChanged(int playerOrder, float x, float y) { if (mControllerEventListener != null) { - mControllerEventListener.onAxisEvent(mVendorName, playerOrder, - GameControllerDelegate.THUMBSTICK_LEFT_X, x, true); - mControllerEventListener.onAxisEvent(mVendorName, playerOrder, - GameControllerDelegate.THUMBSTICK_LEFT_Y, y, true); + try { + ControllerDevice controllerDevice = mControllerService.getDeviceByPlayerOrder(playerOrder); + + String deviceName = controllerDevice.getDeviceName(); + int deviceId = controllerDevice.getDeviceId(); + + mControllerEventListener.onAxisEvent(deviceName, deviceId, + GameControllerDelegate.THUMBSTICK_LEFT_X, x, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, + GameControllerDelegate.THUMBSTICK_LEFT_Y, y, true); + } catch (ControllerServiceException e) { + e.printStackTrace(); + } } } @Override public void onRightStickChanged(int playerOrder, float x, float y) { if (mControllerEventListener != null) { - mControllerEventListener.onAxisEvent(mVendorName, playerOrder, - GameControllerDelegate.THUMBSTICK_RIGHT_X, x, true); - mControllerEventListener.onAxisEvent(mVendorName, playerOrder, - GameControllerDelegate.THUMBSTICK_RIGHT_Y, y, true); + try { + ControllerDevice controllerDevice = mControllerService.getDeviceByPlayerOrder(playerOrder); + + String deviceName = controllerDevice.getDeviceName(); + int deviceId = controllerDevice.getDeviceId(); + + mControllerEventListener.onAxisEvent(deviceName, deviceId, + GameControllerDelegate.THUMBSTICK_RIGHT_X, x, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, + GameControllerDelegate.THUMBSTICK_RIGHT_Y, y, true); + } catch (ControllerServiceException e) { + e.printStackTrace(); + } } } @@ -174,11 +204,11 @@ OnSimpleStickListener, OnAccListener, OnGyroListener, OnStateListener, GameContr if (mControllerEventListener != null) { if (state == ControllerDevice.STATE_CONN) { - mControllerEventListener.onConnected(mVendorName, playerOrder); + mControllerEventListener.onConnected(device.getDeviceName(), device.getDeviceId()); } else if (state == ControllerDevice.STATE_DISCONN) { - mControllerEventListener.onDisconnected(mVendorName, playerOrder); + mControllerEventListener.onDisconnected(device.getDeviceName(), device.getDeviceId()); } } } diff --git a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerOuya.java b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerOuya.java index 30149f7761..ca6ccede4f 100644 --- a/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerOuya.java +++ b/cocos/platform/android/ControllerManualAdapter/src/org/cocos2dx/lib/GameControllerOuya.java @@ -10,8 +10,6 @@ import android.view.KeyEvent; import android.view.MotionEvent; public class GameControllerOuya implements GameControllerDelegate{ - - public static final String sVendorName = "Ouya"; private SparseIntArray mKeyMap; @@ -61,35 +59,28 @@ public class GameControllerOuya implements GameControllerDelegate{ if (handled && mControllerEventListener != null) { - OuyaController c = OuyaController.getControllerByDeviceId(event.getDeviceId()); - int controllerID = OuyaController.getPlayerNumByDeviceId(event.getDeviceId()); + int deviceId = event.getDeviceId(); + String deviceName = event.getDevice().getName(); + OuyaController c = OuyaController.getControllerByDeviceId(deviceId); float newLeftTrigger = c.getAxisValue(OuyaController.AXIS_L2); if (Float.compare(newLeftTrigger, mOldLeftTrigger) != 0) { - if (Float.compare(newLeftTrigger, 0.0f) == 0) { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, GameControllerDelegate.BUTTON_LEFT_TRIGGER, false, 0.0f, true); - }else { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, GameControllerDelegate.BUTTON_LEFT_TRIGGER, true, newLeftTrigger, true); - } + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_LEFT_TRIGGER, newLeftTrigger, true); mOldLeftTrigger = newLeftTrigger; } float newRightTrigger = c.getAxisValue(OuyaController.AXIS_R2); if (Float.compare(newRightTrigger, mOldRightTrigger) != 0) { - if (Float.compare(newRightTrigger, 0.0f) == 0) { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, false, 0.0f, true); - }else { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, true, newRightTrigger, true); - } + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.BUTTON_RIGHT_TRIGGER, newRightTrigger, true); mOldRightTrigger = newRightTrigger; } float newLeftThumbstickX = c.getAxisValue(OuyaController.AXIS_LS_X); if (Float.compare(newLeftThumbstickX, mOldLeftThumbstickX) != 0) { if (Float.compare(newLeftThumbstickX, 0.0f) == 0) { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_LEFT_X, 0.0f, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_X, 0.0f, true); }else { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_LEFT_X, newLeftThumbstickX, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_X, newLeftThumbstickX, true); } mOldLeftThumbstickX = newLeftThumbstickX; } @@ -97,9 +88,9 @@ public class GameControllerOuya implements GameControllerDelegate{ float newLeftThumbstickY = c.getAxisValue(OuyaController.AXIS_LS_Y); if (Float.compare(newLeftThumbstickY, mOldLeftThumbstickY) != 0) { if (Float.compare(newLeftThumbstickY, 0.0f) == 0) { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_LEFT_Y, 0.0f, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_Y, 0.0f, true); }else { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_LEFT_Y, newLeftThumbstickY, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_LEFT_Y, newLeftThumbstickY, true); } mOldLeftThumbstickY = newLeftThumbstickY; } @@ -107,9 +98,9 @@ public class GameControllerOuya implements GameControllerDelegate{ float newRightThumbstickX = c.getAxisValue(OuyaController.AXIS_RS_X); if (Float.compare(newRightThumbstickX, mOldRightThumbstickX) != 0) { if (Float.compare(newRightThumbstickX, 0.0f) == 0) { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_RIGHT_X, 0.0f, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_X, 0.0f, true); }else { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_RIGHT_X, newRightThumbstickX, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_X, newRightThumbstickX, true); } mOldRightThumbstickX = newRightThumbstickX; } @@ -117,9 +108,9 @@ public class GameControllerOuya implements GameControllerDelegate{ float newRightThumbstickY = c.getAxisValue(OuyaController.AXIS_RS_Y); if (Float.compare(newRightThumbstickY, mOldRightThumbstickY) != 0) { if (Float.compare(newRightThumbstickY, 0.0f) == 0) { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_RIGHT_Y, 0.0f, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_Y, 0.0f, true); }else { - mControllerEventListener.onAxisEvent(sVendorName, controllerID, GameControllerDelegate.THUMBSTICK_RIGHT_Y, newRightThumbstickY, true); + mControllerEventListener.onAxisEvent(deviceName, deviceId, GameControllerDelegate.THUMBSTICK_RIGHT_Y, newRightThumbstickY, true); } mOldRightThumbstickY = newRightThumbstickY; } @@ -130,9 +121,14 @@ public class GameControllerOuya implements GameControllerDelegate{ public boolean dispatchKeyEvent(KeyEvent event) { boolean handled = false; + int action = event.getAction(); int keyCode = event.getKeyCode(); + if (keyCode == KeyEvent.KEYCODE_BUTTON_L2 || keyCode == KeyEvent.KEYCODE_BUTTON_R2) { + return true; + } + if (action == KeyEvent.ACTION_DOWN) { handled = OuyaController.onKeyDown(keyCode, event); } @@ -147,11 +143,10 @@ public class GameControllerOuya implements GameControllerDelegate{ isAnalog = true; } - int controllerID = OuyaController.getPlayerNumByDeviceId(event.getDeviceId()); if (action == KeyEvent.ACTION_DOWN) { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, mKeyMap.get(keyCode), true, 1.0f, isAnalog); + mControllerEventListener.onButtonEvent(event.getDevice().getName(), event.getDeviceId(), mKeyMap.get(keyCode), true, 1.0f, isAnalog); }else { - mControllerEventListener.onButtonEvent(sVendorName, controllerID, mKeyMap.get(keyCode), false, 0.0f, isAnalog); + mControllerEventListener.onButtonEvent(event.getDevice().getName(), event.getDeviceId(), mKeyMap.get(keyCode), false, 0.0f, isAnalog); } } diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java b/cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java index 68d486d3e6..9f90704dbe 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java @@ -6,34 +6,36 @@ import android.view.MotionEvent; public interface GameControllerDelegate { - public static final int THUMBSTICK_LEFT_X = 100; - public static final int THUMBSTICK_LEFT_Y = 101; - public static final int THUMBSTICK_RIGHT_X = 102; - public static final int THUMBSTICK_RIGHT_Y = 103; + static final int KEY_BASE = 1000; + + public static final int THUMBSTICK_LEFT_X = KEY_BASE; + public static final int THUMBSTICK_LEFT_Y = KEY_BASE + 1; + public static final int THUMBSTICK_RIGHT_X = KEY_BASE + 2; + public static final int THUMBSTICK_RIGHT_Y = KEY_BASE + 3; - public static final int BUTTON_A = 110; - public static final int BUTTON_B = 111; - public static final int BUTTON_C = 112; - public static final int BUTTON_X = 113; - public static final int BUTTON_Y = 114; - public static final int BUTTON_Z = 115; + public static final int BUTTON_A = KEY_BASE + 4; + public static final int BUTTON_B = KEY_BASE + 5; + public static final int BUTTON_C = KEY_BASE + 6; + public static final int BUTTON_X = KEY_BASE + 7; + public static final int BUTTON_Y = KEY_BASE + 8; + public static final int BUTTON_Z = KEY_BASE + 9; - public static final int BUTTON_LEFT_SHOULDER = 120; - public static final int BUTTON_RIGHT_SHOULDER = 121; - public static final int BUTTON_LEFT_TRIGGER = 122; - public static final int BUTTON_RIGHT_TRIGGER = 123; + public static final int BUTTON_DPAD_UP = KEY_BASE + 10; + public static final int BUTTON_DPAD_DOWN = KEY_BASE + 11; + public static final int BUTTON_DPAD_LEFT = KEY_BASE + 12; + public static final int BUTTON_DPAD_RIGHT = KEY_BASE + 13; + public static final int BUTTON_DPAD_CENTER = KEY_BASE + 14; - public static final int BUTTON_DPAD_UP = 130; - public static final int BUTTON_DPAD_DOWN = 131; - public static final int BUTTON_DPAD_LEFT = 132; - public static final int BUTTON_DPAD_RIGHT = 133; - public static final int BUTTON_DPAD_CENTER = 134; + public static final int BUTTON_LEFT_SHOULDER = KEY_BASE + 15; + public static final int BUTTON_RIGHT_SHOULDER = KEY_BASE + 16; + public static final int BUTTON_LEFT_TRIGGER = KEY_BASE + 17; + public static final int BUTTON_RIGHT_TRIGGER = KEY_BASE + 18; - public static final int BUTTON_LEFT_THUMBSTICK = 140; - public static final int BUTTON_RIGHT_THUMBSTICK = 141; + public static final int BUTTON_LEFT_THUMBSTICK = KEY_BASE + 19; + public static final int BUTTON_RIGHT_THUMBSTICK = KEY_BASE + 20; - public static final int BUTTON_START = 150; - public static final int BUTTON_SELECT = 151; + public static final int BUTTON_START = KEY_BASE + 21; + public static final int BUTTON_SELECT = KEY_BASE + 22; void onCreate(Context context); void onPause(); diff --git a/cocos/platform/android/javaactivity.cpp b/cocos/platform/android/javaactivity.cpp index 58524d839a..866318527f 100644 --- a/cocos/platform/android/javaactivity.cpp +++ b/cocos/platform/android/javaactivity.cpp @@ -75,8 +75,8 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); - cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - director->getEventDispatcher()->dispatchEvent(&foregroundEvent); + cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED); + director->getEventDispatcher()->dispatchEvent(&recreatedEvent); director->setGLDefaultValues(); } diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp index 5a37af879f..b3742e00e5 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp @@ -24,6 +24,8 @@ extern "C" { JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() { if (Director::getInstance()->getOpenGLView()) { Application::getInstance()->applicationWillEnterForeground(); + cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); + cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); } } diff --git a/cocos/platform/desktop/CCGLView.cpp b/cocos/platform/desktop/CCGLView.cpp index 702244a29e..a934875204 100644 --- a/cocos/platform/desktop/CCGLView.cpp +++ b/cocos/platform/desktop/CCGLView.cpp @@ -564,20 +564,22 @@ void GLView::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int } } } + + //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here + float cursorX = (_mouseX - _viewPortRect.origin.x) / _scaleX; + float cursorY = (_viewPortRect.origin.y + _viewPortRect.size.height - _mouseY) / _scaleY; if(GLFW_PRESS == action) { EventMouse event(EventMouse::MouseEventType::MOUSE_DOWN); - //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here - event.setCursorPosition(_mouseX, this->getViewPortRect().size.height - _mouseY); + event.setCursorPosition(cursorX, cursorY); event.setMouseButton(button); Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } else if(GLFW_RELEASE == action) { EventMouse event(EventMouse::MouseEventType::MOUSE_UP); - //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here - event.setCursorPosition(_mouseX, this->getViewPortRect().size.height - _mouseY); + event.setCursorPosition(cursorX, cursorY); event.setMouseButton(button); Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } @@ -605,10 +607,26 @@ void GLView::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y) intptr_t id = 0; this->handleTouchesMove(1, &id, &_mouseX, &_mouseY); } + + //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here + float cursorX = (_mouseX - _viewPortRect.origin.x) / _scaleX; + float cursorY = (_viewPortRect.origin.y + _viewPortRect.size.height - _mouseY) / _scaleY; EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE); - //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here - event.setCursorPosition(_mouseX, this->getViewPortRect().size.height - _mouseY); + // Set current button + if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS) + { + event.setMouseButton(GLFW_MOUSE_BUTTON_LEFT); + } + else if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS) + { + event.setMouseButton(GLFW_MOUSE_BUTTON_RIGHT); + } + else if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS) + { + event.setMouseButton(GLFW_MOUSE_BUTTON_MIDDLE); + } + event.setCursorPosition(cursorX, cursorY); Director::getInstance()->getEventDispatcher()->dispatchEvent(&event); } @@ -685,9 +703,9 @@ static bool glew_dynamic_binding() const char *gl_extensions = (const char*)glGetString(GL_EXTENSIONS); // If the current opengl driver doesn't have framebuffers methods, check if an extension exists - if (glGenFramebuffers == NULL) + if (glGenFramebuffers == nullptr) { - log("OpenGL: glGenFramebuffers is NULL, try to detect an extension"); + log("OpenGL: glGenFramebuffers is nullptr, try to detect an extension"); if (strstr(gl_extensions, "ARB_framebuffer_object")) { log("OpenGL: ARB_framebuffer_object is supported"); diff --git a/cocos/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm index fb14b01f71..f04767cb74 100644 --- a/cocos/platform/ios/CCDevice.mm +++ b/cocos/platform/ios/CCDevice.mm @@ -348,7 +348,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align, } // text color - CGContextSetRGBFillColor(context, info->tintColorR, info->tintColorG, info->tintColorB, 1); + CGContextSetRGBFillColor(context, info->tintColorR / 255.0f, info->tintColorG / 255.0f, info->tintColorB / 255.0f, 1); // move Y rendering to the top of the image CGContextTranslateCTM(context, 0.0f, (dim.height - shadowStrokePaddingY) ); CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential diff --git a/cocos/platform/ios/CCEAGLView.mm b/cocos/platform/ios/CCEAGLView.mm index af72e0b787..fcbddd02e7 100644 --- a/cocos/platform/ios/CCEAGLView.mm +++ b/cocos/platform/ios/CCEAGLView.mm @@ -393,7 +393,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. if (isKeyboardShown_) { [self handleTouchesAfterKeyboardShow]; - return; } UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0}; @@ -414,10 +413,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - if (isKeyboardShown_) - { - return; - } UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0}; float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f}; float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f}; @@ -436,11 +431,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - if (isKeyboardShown_) - { - return; - } - UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0}; float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f}; float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f}; @@ -459,11 +449,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - if (isKeyboardShown_) - { - return; - } - UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0}; float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f}; float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f}; diff --git a/cocos/platform/win32/CCApplication.cpp b/cocos/platform/win32/CCApplication.cpp index 2afa94595b..1192732492 100644 --- a/cocos/platform/win32/CCApplication.cpp +++ b/cocos/platform/win32/CCApplication.cpp @@ -55,7 +55,7 @@ Application::Application() Application::~Application() { CC_ASSERT(this == sm_pSharedApplication); - sm_pSharedApplication = NULL; + sm_pSharedApplication = nullptr; } int Application::run() @@ -248,7 +248,7 @@ static void PVRFrameEnableControlWindow(bool bEnable) KEY_ALL_ACCESS, 0, &hKey, - NULL)) + nullptr)) { return; } @@ -257,7 +257,7 @@ static void PVRFrameEnableControlWindow(bool bEnable) const WCHAR* wszNewData = (bEnable) ? L"NO" : L"YES"; WCHAR wszOldData[256] = {0}; DWORD dwSize = sizeof(wszOldData); - LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, NULL, (LPBYTE)wszOldData, &dwSize); + LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, nullptr, (LPBYTE)wszOldData, &dwSize); if (ERROR_FILE_NOT_FOUND == status // the key not exist || (ERROR_SUCCESS == status // or the hide_gui value is exist && 0 != wcscmp(wszNewData, wszOldData))) // but new data and old data not equal diff --git a/cocos/platform/win32/CCCommon.cpp b/cocos/platform/win32/CCCommon.cpp index a95ed75d00..a1e2319055 100644 --- a/cocos/platform/win32/CCCommon.cpp +++ b/cocos/platform/win32/CCCommon.cpp @@ -35,12 +35,12 @@ NS_CC_BEGIN void MessageBox(const char * pszMsg, const char * pszTitle) { - MessageBoxA(NULL, pszMsg, pszTitle, MB_OK); + MessageBoxA(nullptr, pszMsg, pszTitle, MB_OK); } void LuaLog(const char *pszMsg) { - int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0); + int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, nullptr, 0); WCHAR* widebuff = new WCHAR[bufflen + 1]; memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1)); MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen); @@ -48,10 +48,10 @@ void LuaLog(const char *pszMsg) OutputDebugStringW(widebuff); OutputDebugStringA("\n"); - bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL); + bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, nullptr, 0, nullptr, nullptr); char* buff = new char[bufflen + 1]; memset(buff, 0, sizeof(char) * (bufflen + 1)); - WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, nullptr, nullptr); puts(buff); delete[] widebuff; diff --git a/cocos/platform/win32/CCDevice.cpp b/cocos/platform/win32/CCDevice.cpp index ab9b3e489b..778b58aaa7 100644 --- a/cocos/platform/win32/CCDevice.cpp +++ b/cocos/platform/win32/CCDevice.cpp @@ -37,10 +37,10 @@ int Device::getDPI() static int dpi = -1; if (dpi == -1) { - HDC hScreenDC = GetDC( NULL ); + HDC hScreenDC = GetDC( nullptr ); int PixelsX = GetDeviceCaps( hScreenDC, HORZRES ); int MMX = GetDeviceCaps( hScreenDC, HORZSIZE ); - ReleaseDC( NULL, hScreenDC ); + ReleaseDC( nullptr, hScreenDC ); dpi = 254.0f*PixelsX/MMX/10; } return dpi; @@ -55,7 +55,7 @@ void Device::setAccelerometerInterval(float interval) class BitmapDC { public: - BitmapDC(HWND hWnd = NULL) + BitmapDC(HWND hWnd = nullptr) : _DC(nullptr) , _bmp(nullptr) , _font((HFONT)GetStockObject(DEFAULT_GUI_FONT)) @@ -79,7 +79,7 @@ public: wchar_t * utf8ToUtf16(const std::string& str) { - wchar_t * pwszBuffer = NULL; + wchar_t * pwszBuffer = nullptr; do { if (str.empty()) @@ -99,7 +99,7 @@ public: } - bool setFont(const char * pFontName = NULL, int nSize = 0) + bool setFont(const char * pFontName = nullptr, int nSize = 0) { bool bRet = false; do @@ -154,7 +154,7 @@ public: SendMessage( _wnd, WM_FONTCHANGE, 0, 0); } delete [] pwszBuffer; - pwszBuffer = NULL; + pwszBuffer = nullptr; } } @@ -214,11 +214,11 @@ public: if (_bmp) { DeleteObject(_bmp); - _bmp = NULL; + _bmp = nullptr; } if (nWidth > 0 && nHeight > 0) { - _bmp = CreateBitmap(nWidth, nHeight, 1, 32, NULL); + _bmp = CreateBitmap(nWidth, nHeight, 1, 32, nullptr); if (! _bmp) { return false; @@ -364,7 +364,7 @@ private: RemoveFontResource(pwszBuffer); SendMessage( _wnd, WM_FONTCHANGE, 0, 0); delete [] pwszBuffer; - pwszBuffer = NULL; + pwszBuffer = nullptr; } _curFontPath.clear(); } @@ -404,7 +404,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text } bi = {0}; bi.bmiHeader.biSize = sizeof(bi.bmiHeader); CC_BREAK_IF(! GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, - NULL, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); + nullptr, (LPBITMAPINFO)&bi, DIB_RGB_COLORS)); width = (short)size.cx; height = (short)size.cy; @@ -416,7 +416,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text (LPBITMAPINFO)&bi, DIB_RGB_COLORS); // change pixel's alpha value to 255, when it's RGB != 0 - COLORREF * pPixel = NULL; + COLORREF * pPixel = nullptr; for (int y = 0; y < height; ++y) { pPixel = (COLORREF *)dataBuf + y * width; diff --git a/cocos/platform/win32/CCFileUtilsWin32.cpp b/cocos/platform/win32/CCFileUtilsWin32.cpp index 2d036c5dfc..a652850879 100644 --- a/cocos/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/platform/win32/CCFileUtilsWin32.cpp @@ -63,7 +63,7 @@ static void _checkPath() GetCurrentDirectoryW(sizeof(utf16Path)-1, utf16Path); char utf8Path[CC_MAX_PATH] = {0}; - int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), NULL, NULL); + int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), nullptr, nullptr); s_resourcePath = convertPathFormatToUnixStyle(utf8Path); s_resourcePath.append("/"); @@ -72,13 +72,13 @@ static void _checkPath() FileUtils* FileUtils::getInstance() { - if (s_sharedFileUtils == NULL) + if (s_sharedFileUtils == nullptr) { s_sharedFileUtils = new FileUtilsWin32(); if(!s_sharedFileUtils->init()) { delete s_sharedFileUtils; - s_sharedFileUtils = NULL; + s_sharedFileUtils = nullptr; CCLOG("ERROR: Could not init CCFileUtilsWin32"); } } @@ -147,10 +147,10 @@ static Data getData(const std::string& filename, bool forString) WCHAR wszBuf[CC_MAX_PATH] = {0}; MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0])); - HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL); + HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr); CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE); - size = ::GetFileSize(fileHandle, NULL); + size = ::GetFileSize(fileHandle, nullptr); if (forString) { @@ -163,7 +163,7 @@ static Data getData(const std::string& filename, bool forString) } DWORD sizeRead = 0; BOOL successed = FALSE; - successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, NULL); + successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, nullptr); ::CloseHandle(fileHandle); if (!successed) @@ -212,7 +212,7 @@ Data FileUtilsWin32::getDataFromFile(const std::string& filename) unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const char* mode, ssize_t* size) { - unsigned char * pBuffer = NULL; + unsigned char * pBuffer = nullptr; *size = 0; do { @@ -222,15 +222,15 @@ unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const ch WCHAR wszBuf[CC_MAX_PATH] = {0}; MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0])); - HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL); + HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr); CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE); - *size = ::GetFileSize(fileHandle, NULL); + *size = ::GetFileSize(fileHandle, nullptr); pBuffer = (unsigned char*) malloc(*size); DWORD sizeRead = 0; BOOL successed = FALSE; - successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, NULL); + successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, nullptr); ::CloseHandle(fileHandle); if (!successed) @@ -275,7 +275,7 @@ string FileUtilsWin32::getWritablePath() const { // Get full path of executable, e.g. c:\Program Files (x86)\My Game Folder\MyGame.exe char full_path[CC_MAX_PATH + 1]; - ::GetModuleFileNameA(NULL, full_path, CC_MAX_PATH + 1); + ::GetModuleFileNameA(nullptr, full_path, CC_MAX_PATH + 1); // Debug app uses executable directory; Non-debug app uses local app data directory #ifndef _DEBUG @@ -287,7 +287,7 @@ string FileUtilsWin32::getWritablePath() const char app_data_path[CC_MAX_PATH + 1]; // Get local app data directory, e.g. C:\Documents and Settings\username\Local Settings\Application Data - if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, app_data_path))) + if (SUCCEEDED(SHGetFolderPathA(nullptr, CSIDL_LOCAL_APPDATA, nullptr, SHGFP_TYPE_CURRENT, app_data_path))) { string ret((char*)app_data_path); @@ -300,7 +300,7 @@ string FileUtilsWin32::getWritablePath() const ret += "\\"; // Create directory - if (SUCCEEDED(SHCreateDirectoryExA(NULL, ret.c_str(), NULL))) + if (SUCCEEDED(SHCreateDirectoryExA(nullptr, ret.c_str(), nullptr))) { return convertPathFormatToUnixStyle(ret); } diff --git a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp index 608a524861..4e74c6f298 100644 --- a/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp +++ b/cocos/platform/wp8-xaml/cpp/Cocos2dRenderer.cpp @@ -67,8 +67,8 @@ void Cocos2dRenderer::CreateGLResources() cocos2d::ShaderCache::getInstance()->reloadDefaultGLPrograms(); cocos2d::DrawPrimitives::init(); cocos2d::VolatileTextureMgr::reloadAllTextures(); - cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); - director->getEventDispatcher()->dispatchEvent(&foregroundEvent); + cocos2d::EventCustom recreatedEvent(EVENT_RENDERER_RECREATED); + director->getEventDispatcher()->dispatchEvent(&recreatedEvent); cocos2d::Application::getInstance()->applicationWillEnterForeground(); director->setGLDefaultValues(); } diff --git a/cocos/renderer/CCGLProgram.cpp b/cocos/renderer/CCGLProgram.cpp index d5b492e941..7533d991be 100644 --- a/cocos/renderer/CCGLProgram.cpp +++ b/cocos/renderer/CCGLProgram.cpp @@ -254,7 +254,7 @@ bool GLProgram::initWithPrecompiledProgramByteArray(const GLchar* vShaderByteArr haveProgram = CCPrecompiledShaders::getInstance()->loadProgram(_program, vShaderByteArray, fShaderByteArray); CHECK_GL_ERROR_DEBUG(); - _hashForUniforms = NULL; + _hashForUniforms = nullptr; CHECK_GL_ERROR_DEBUG(); @@ -311,7 +311,7 @@ void GLProgram::parseVertexAttribs() for(int i = 0; i < activeAttributes; ++i) { // Query attribute info. - glGetActiveAttrib(_program, i, length, NULL, &attribute.size, &attribute.type, attribName); + glGetActiveAttrib(_program, i, length, nullptr, &attribute.size, &attribute.type, attribName); attribName[length] = '\0'; attribute.name = std::string(attribName); @@ -343,7 +343,7 @@ void GLProgram::parseUniforms() for(int i = 0; i < activeUniforms; ++i) { // Query uniform info. - glGetActiveUniform(_program, i, length, NULL, &uniform.size, &uniform.type, uniformName); + glGetActiveUniform(_program, i, length, nullptr, &uniform.size, &uniform.type, uniformName); uniformName[length] = '\0'; // Only add uniforms that are not built-in. diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 5652db4e8e..6ce072b370 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -279,9 +279,9 @@ GLProgramState::GLProgramState() , _uniformAttributeValueDirty(true) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - // listen the event when app go to foreground - CCLOG("create _backToForegroundlistener for GLProgramState"); - _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { _uniformAttributeValueDirty = true; }); + /** listen the event that renderer was recreated on Android/WP8 */ + CCLOG("create rendererRecreatedListener for GLProgramState"); + _backToForegroundlistener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _uniformAttributeValueDirty = true; }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); #endif } diff --git a/cocos/renderer/CCMeshCommand.cpp b/cocos/renderer/CCMeshCommand.cpp index ce74ee031c..ad251cb9cc 100644 --- a/cocos/renderer/CCMeshCommand.cpp +++ b/cocos/renderer/CCMeshCommand.cpp @@ -56,10 +56,10 @@ MeshCommand::MeshCommand() , _vao(0) { _type = RenderCommand::Type::MESH_COMMAND; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - // listen the event when app go to foreground - _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(MeshCommand::listenBackToForeground, this)); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + // listen the event that renderer was recreated on Android/WP8 + _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(MeshCommand::listenRendererRecreated, this)); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_rendererRecreatedListener, -1); #endif } @@ -117,8 +117,8 @@ void MeshCommand::setDisplayColor(const Vec4& color) MeshCommand::~MeshCommand() { releaseVAO(); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } @@ -172,7 +172,7 @@ void MeshCommand::genMaterialID(GLuint texID, void* glProgramState, void* mesh, void MeshCommand::MatrixPalleteCallBack( GLProgram* glProgram, Uniform* uniform) { - glProgram->setUniformLocationWith4fv(uniform->location, (const float*)_matrixPalette, _matrixPaletteSize); + glUniform4fv( uniform->location, (GLsizei)_matrixPaletteSize, (const float*)_matrixPalette ); } void MeshCommand::preBatchDraw() @@ -183,12 +183,11 @@ void MeshCommand::preBatchDraw() GL::bindTexture2D(_textureID); GL::blendFunc(_blendType.src, _blendType.dst); - if (_vao == 0) + if (Configuration::getInstance()->supportsShareableVAO() && _vao == 0) buildVAO(); if (_vao) { GL::bindVAO(_vao); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); } else { @@ -265,30 +264,27 @@ void MeshCommand::execute() void MeshCommand::buildVAO() { releaseVAO(); - if (Configuration::getInstance()->supportsShareableVAO()) - { - glGenVertexArrays(1, &_vao); - GL::bindVAO(_vao); - glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); - auto flags = _glProgramState->getVertexAttribsFlags(); - for (int i = 0; flags > 0; i++) { - int flag = 1 << i; - if (flag & flags) - glEnableVertexAttribArray(i); - flags &= ~flag; - } - _glProgramState->applyAttributes(false); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); - - GL::bindVAO(0); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glGenVertexArrays(1, &_vao); + GL::bindVAO(_vao); + glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); + auto flags = _glProgramState->getVertexAttribsFlags(); + for (int i = 0; flags > 0; i++) { + int flag = 1 << i; + if (flag & flags) + glEnableVertexAttribArray(i); + flags &= ~flag; } + _glProgramState->applyAttributes(false); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer); + + GL::bindVAO(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } void MeshCommand::releaseVAO() { - if (Configuration::getInstance()->supportsShareableVAO() && _vao) + if (_vao) { glDeleteVertexArrays(1, &_vao); _vao = 0; @@ -296,10 +292,10 @@ void MeshCommand::releaseVAO() } } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -void MeshCommand::listenBackToForeground(EventCustom* event) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) +void MeshCommand::listenRendererRecreated(EventCustom* event) { - releaseVAO(); + _vao = 0; } #endif diff --git a/cocos/renderer/CCMeshCommand.h b/cocos/renderer/CCMeshCommand.h index 266e55e5be..d1e995da7a 100644 --- a/cocos/renderer/CCMeshCommand.h +++ b/cocos/renderer/CCMeshCommand.h @@ -74,8 +74,8 @@ public: uint32_t getMaterialID() const { return _materialID; } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - void listenBackToForeground(EventCustom* event); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + void listenRendererRecreated(EventCustom* event); #endif protected: @@ -122,8 +122,8 @@ protected: // ModelView transform Mat4 _mv; -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - EventListenerCustom* _backToForegroundlistener; +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) + EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index e40fd56dcb..b7c9b47e23 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -145,8 +145,8 @@ Renderer::~Renderer() void Renderer::initGLView() { #if CC_ENABLE_CACHE_TEXTURE_DATA - _cacheTextureListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ - /** listen the event that coming to foreground on Android */ + _cacheTextureListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event){ + /** listen the event that renderer was recreated on Android/WP8 */ this->setupBuffer(); }); diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 3449f5a7a6..e41a610dd5 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -711,7 +711,7 @@ std::string Texture2D::getDescription() const // implementation Texture2D (Image) bool Texture2D::initWithImage(Image *image) { - return initWithImage(image, image->getRenderFormat()); + return initWithImage(image, g_defaultAlphaPixelFormat); } bool Texture2D::initWithImage(Image *image, PixelFormat format) @@ -736,14 +736,14 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format) unsigned char* tempData = image->getData(); Size imageSize = Size((float)imageWidth, (float)imageHeight); - PixelFormat pixelFormat = PixelFormat::NONE; + PixelFormat pixelFormat = ((PixelFormat::NONE == format) || (PixelFormat::AUTO == format)) ? image->getRenderFormat() : format; PixelFormat renderFormat = image->getRenderFormat(); size_t tempDataLen = image->getDataLen(); if (image->getNumberOfMipmaps() > 1) { - if (format != PixelFormat::NONE) + if (pixelFormat != image->getRenderFormat()) { CCLOG("cocos2d: WARNING: This image has more than 1 mipmaps and we will not convert the data format"); } @@ -754,7 +754,7 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format) } else if (image->isCompressed()) { - if (format != PixelFormat::NONE) + if (pixelFormat != image->getRenderFormat()) { CCLOG("cocos2d: WARNING: This image is compressed and we cann't convert it for now"); } @@ -764,15 +764,6 @@ bool Texture2D::initWithImage(Image *image, PixelFormat format) } else { - // compute pixel format - if (format != PixelFormat::NONE) - { - pixelFormat = format; - }else - { - pixelFormat = g_defaultAlphaPixelFormat; - } - unsigned char* outTempData = nullptr; ssize_t outTempDataLen = 0; diff --git a/cocos/renderer/CCTextureAtlas.cpp b/cocos/renderer/CCTextureAtlas.cpp index 332a0246bb..d6b1a7578c 100644 --- a/cocos/renderer/CCTextureAtlas.cpp +++ b/cocos/renderer/CCTextureAtlas.cpp @@ -57,7 +57,7 @@ TextureAtlas::TextureAtlas() ,_texture(nullptr) ,_quads(nullptr) #if CC_ENABLE_CACHE_TEXTURE_DATA - ,_backToForegroundlistener(nullptr) + ,_rendererRecreatedListener(nullptr) #endif {} @@ -78,7 +78,7 @@ TextureAtlas::~TextureAtlas() CC_SAFE_RELEASE(_texture); #if CC_ENABLE_CACHE_TEXTURE_DATA - Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener); + Director::getInstance()->getEventDispatcher()->removeEventListener(_rendererRecreatedListener); #endif } @@ -192,9 +192,9 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, ssize_t capacity) memset( _indices, 0, _capacity * 6 * sizeof(GLushort) ); #if CC_ENABLE_CACHE_TEXTURE_DATA - // listen the event when app go to background - _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(TextureAtlas::listenBackToForeground, this)); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); + /** listen the event that renderer was recreated on Android/WP8 */ + _rendererRecreatedListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, CC_CALLBACK_1(TextureAtlas::listenRendererRecreated, this)); + Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_rendererRecreatedListener, -1); #endif this->setupIndices(); @@ -213,7 +213,7 @@ bool TextureAtlas::initWithTexture(Texture2D *texture, ssize_t capacity) return true; } -void TextureAtlas::listenBackToForeground(EventCustom* event) +void TextureAtlas::listenRendererRecreated(EventCustom* event) { if (Configuration::getInstance()->supportsShareableVAO()) { diff --git a/cocos/renderer/CCTextureAtlas.h b/cocos/renderer/CCTextureAtlas.h index 5dd431d116..1e3c561ff3 100644 --- a/cocos/renderer/CCTextureAtlas.h +++ b/cocos/renderer/CCTextureAtlas.h @@ -189,9 +189,9 @@ public: /** draws all the Atlas's Quads */ void drawQuads(); - /** listen the event that coming to foreground on Android + /** listen the event that renderer was recreated on Android */ - void listenBackToForeground(EventCustom* event); + void listenRendererRecreated(EventCustom* event); /** whether or not the array buffer of the VBO needs to be updated*/ inline bool isDirty(void) { return _dirty; } @@ -244,7 +244,7 @@ protected: V3F_C4B_T2F_Quad* _quads; #if CC_ENABLE_CACHE_TEXTURE_DATA - EventListenerCustom* _backToForegroundlistener; + EventListenerCustom* _rendererRecreatedListener; #endif }; diff --git a/cocos/renderer/ccShader_3D_PositionTex.vert b/cocos/renderer/ccShader_3D_PositionTex.vert index 95af35228c..92a359922b 100644 --- a/cocos/renderer/ccShader_3D_PositionTex.vert +++ b/cocos/renderer/ccShader_3D_PositionTex.vert @@ -15,7 +15,7 @@ void main(void) ); const char* cc3D_SkinPositionTex_vert = STRINGIFY( -attribute vec4 a_position; +attribute vec3 a_position; attribute vec4 a_blendWeight; attribute vec4 a_blendIndex; @@ -70,10 +70,11 @@ vec4 getPosition() vec4 _skinnedPosition; - _skinnedPosition.x = dot(a_position, matrixPalette1); - _skinnedPosition.y = dot(a_position, matrixPalette2); - _skinnedPosition.z = dot(a_position, matrixPalette3); - _skinnedPosition.w = a_position.w; + vec4 postion = vec4(a_position, 1.0); + _skinnedPosition.x = dot(postion, matrixPalette1); + _skinnedPosition.y = dot(postion, matrixPalette2); + _skinnedPosition.z = dot(postion, matrixPalette3); + _skinnedPosition.w = postion.w; return _skinnedPosition; } diff --git a/cocos/scripting/lua-bindings/Android.mk b/cocos/scripting/lua-bindings/Android.mk index 6d0b337577..c926b1d11c 100644 --- a/cocos/scripting/lua-bindings/Android.mk +++ b/cocos/scripting/lua-bindings/Android.mk @@ -23,6 +23,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \ manual/lua_cocos2dx_ui_manual.cpp \ manual/lua_cocos2dx_spine_manual.cpp \ manual/lua_cocos2dx_physics_manual.cpp \ + manual/lua_cocos2dx_experimental_video_manual.cpp \ manual/lua_cocos2dx_deprecated.cpp \ manual/lua_xml_http_request.cpp \ manual/platform/android/CCLuaJavaBridge.cpp \ @@ -35,6 +36,7 @@ LOCAL_SRC_FILES := manual/CCLuaBridge.cpp \ auto/lua_cocos2dx_ui_auto.cpp \ auto/lua_cocos2dx_spine_auto.cpp \ auto/lua_cocos2dx_physics_auto.cpp \ + auto/lua_cocos2dx_experimental_video_auto.cpp \ ../../../external/lua/tolua/tolua_event.c \ ../../../external/lua/tolua/tolua_is.c \ ../../../external/lua/tolua/tolua_map.c \ diff --git a/cocos/scripting/lua-bindings/auto/api/Animate3D.lua b/cocos/scripting/lua-bindings/auto/api/Animate3D.lua index ce1be4d011..4657cc4cb8 100644 --- a/cocos/scripting/lua-bindings/auto/api/Animate3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Animate3D.lua @@ -5,9 +5,9 @@ -- @parent_module cc -------------------------------- --- @function [parent=#Animate3D] getSpeed +-- @function [parent=#Animate3D] setSpeed -- @param self --- @return float#float ret (return value: float) +-- @param #float float -------------------------------- -- @function [parent=#Animate3D] setWeight @@ -15,19 +15,9 @@ -- @param #float float -------------------------------- --- @function [parent=#Animate3D] getPlayBack +-- @function [parent=#Animate3D] getSpeed -- @param self --- @return bool#bool ret (return value: bool) - --------------------------------- --- @function [parent=#Animate3D] setPlayBack --- @param self --- @param #bool bool - --------------------------------- --- @function [parent=#Animate3D] setSpeed --- @param self --- @param #float float +-- @return float#float ret (return value: float) -------------------------------- -- @function [parent=#Animate3D] getWeight diff --git a/cocos/scripting/lua-bindings/auto/api/Animation3D.lua b/cocos/scripting/lua-bindings/auto/api/Animation3D.lua index 8fa94f84ef..7eacf8e403 100644 --- a/cocos/scripting/lua-bindings/auto/api/Animation3D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Animation3D.lua @@ -10,7 +10,7 @@ -- @return float#float ret (return value: float) -------------------------------- --- @function [parent=#Animation3D] getOrCreate +-- @function [parent=#Animation3D] create -- @param self -- @param #string str -- @param #string str diff --git a/cocos/scripting/lua-bindings/auto/api/Console.lua b/cocos/scripting/lua-bindings/auto/api/Console.lua index 3aa8ce6965..cdca8f4060 100644 --- a/cocos/scripting/lua-bindings/auto/api/Console.lua +++ b/cocos/scripting/lua-bindings/auto/api/Console.lua @@ -1,6 +1,7 @@ -------------------------------- -- @module Console +-- @extend Ref -- @parent_module cc -------------------------------- diff --git a/cocos/scripting/lua-bindings/auto/api/Controller.lua b/cocos/scripting/lua-bindings/auto/api/Controller.lua new file mode 100644 index 0000000000..160b455817 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/Controller.lua @@ -0,0 +1,51 @@ + +-------------------------------- +-- @module Controller +-- @parent_module cc + +-------------------------------- +-- @function [parent=#Controller] receiveExternalKeyEvent +-- @param self +-- @param #int int +-- @param #bool bool + +-------------------------------- +-- @function [parent=#Controller] getDeviceName +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#Controller] isConnected +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#Controller] getDeviceId +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#Controller] setTag +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#Controller] getTag +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#Controller] startDiscoveryController +-- @param self + +-------------------------------- +-- @function [parent=#Controller] stopDiscoveryController +-- @param self + +-------------------------------- +-- @function [parent=#Controller] getControllerByTag +-- @param self +-- @param #int int +-- @return Controller#Controller ret (return value: cc.Controller) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/EventController.lua b/cocos/scripting/lua-bindings/auto/api/EventController.lua new file mode 100644 index 0000000000..289b55d97c --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/EventController.lua @@ -0,0 +1,48 @@ + +-------------------------------- +-- @module EventController +-- @extend Event +-- @parent_module cc + +-------------------------------- +-- @function [parent=#EventController] getControllerEventType +-- @param self +-- @return EventController::ControllerEventType#EventController::ControllerEventType ret (return value: cc.EventController::ControllerEventType) + +-------------------------------- +-- @function [parent=#EventController] setConnectStatus +-- @param self +-- @param #bool bool + +-------------------------------- +-- @function [parent=#EventController] isConnected +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#EventController] setKeyCode +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#EventController] getController +-- @param self +-- @return Controller#Controller ret (return value: cc.Controller) + +-------------------------------- +-- @function [parent=#EventController] getKeyCode +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- overload function: EventController(cc.EventController::ControllerEventType, cc.Controller, bool) +-- +-- overload function: EventController(cc.EventController::ControllerEventType, cc.Controller, int) +-- +-- @function [parent=#EventController] EventController +-- @param self +-- @param #cc.EventController::ControllerEventType controllereventtype +-- @param #cc.Controller controller +-- @param #int int + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/EventListenerController.lua b/cocos/scripting/lua-bindings/auto/api/EventListenerController.lua new file mode 100644 index 0000000000..338b93fcd1 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/EventListenerController.lua @@ -0,0 +1,22 @@ + +-------------------------------- +-- @module EventListenerController +-- @extend EventListener +-- @parent_module cc + +-------------------------------- +-- @function [parent=#EventListenerController] create +-- @param self +-- @return EventListenerController#EventListenerController ret (return value: cc.EventListenerController) + +-------------------------------- +-- @function [parent=#EventListenerController] clone +-- @param self +-- @return EventListenerController#EventListenerController ret (return value: cc.EventListenerController) + +-------------------------------- +-- @function [parent=#EventListenerController] checkAvailable +-- @param self +-- @return bool#bool ret (return value: bool) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/FastTMXLayer.lua b/cocos/scripting/lua-bindings/auto/api/FastTMXLayer.lua new file mode 100644 index 0000000000..d159f6f54d --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/FastTMXLayer.lua @@ -0,0 +1,146 @@ + +-------------------------------- +-- @module FastTMXLayer +-- @extend Node +-- @parent_module cc + +-------------------------------- +-- @function [parent=#FastTMXLayer] getPositionAt +-- @param self +-- @param #vec2_table vec2 +-- @return vec2_table#vec2_table ret (return value: vec2_table) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setLayerOrientation +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#FastTMXLayer] getLayerSize +-- @param self +-- @return size_table#size_table ret (return value: size_table) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setMapTileSize +-- @param self +-- @param #size_table size + +-------------------------------- +-- @function [parent=#FastTMXLayer] getLayerOrientation +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setProperties +-- @param self +-- @param #map_table map + +-------------------------------- +-- @function [parent=#FastTMXLayer] setLayerName +-- @param self +-- @param #string str + +-------------------------------- +-- @function [parent=#FastTMXLayer] removeTileAt +-- @param self +-- @param #vec2_table vec2 + +-------------------------------- +-- overload function: getProperties() +-- +-- overload function: getProperties() +-- +-- @function [parent=#FastTMXLayer] getProperties +-- @param self +-- @return map_table#map_table ret (retunr value: map_table) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setupTiles +-- @param self + +-------------------------------- +-- @function [parent=#FastTMXLayer] setupTileSprite +-- @param self +-- @param #cc.Sprite sprite +-- @param #vec2_table vec2 +-- @param #int int + +-------------------------------- +-- overload function: setTileGID(int, vec2_table, cc.TMXTileFlags_) +-- +-- overload function: setTileGID(int, vec2_table) +-- +-- @function [parent=#FastTMXLayer] setTileGID +-- @param self +-- @param #int int +-- @param #vec2_table vec2 +-- @param #cc.TMXTileFlags_ tmxtileflags_ + +-------------------------------- +-- @function [parent=#FastTMXLayer] getMapTileSize +-- @param self +-- @return size_table#size_table ret (return value: size_table) + +-------------------------------- +-- @function [parent=#FastTMXLayer] getProperty +-- @param self +-- @param #string str +-- @return Value#Value ret (return value: cc.Value) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setLayerSize +-- @param self +-- @param #size_table size + +-------------------------------- +-- @function [parent=#FastTMXLayer] getLayerName +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#FastTMXLayer] setTileSet +-- @param self +-- @param #cc.TMXTilesetInfo tmxtilesetinfo + +-------------------------------- +-- @function [parent=#FastTMXLayer] getTileSet +-- @param self +-- @return TMXTilesetInfo#TMXTilesetInfo ret (return value: cc.TMXTilesetInfo) + +-------------------------------- +-- @function [parent=#FastTMXLayer] getTileAt +-- @param self +-- @param #vec2_table vec2 +-- @return Sprite#Sprite ret (return value: cc.Sprite) + +-------------------------------- +-- @function [parent=#FastTMXLayer] create +-- @param self +-- @param #cc.TMXTilesetInfo tmxtilesetinfo +-- @param #cc.TMXLayerInfo tmxlayerinfo +-- @param #cc.TMXMapInfo map +-- @return FastTMXLayer#FastTMXLayer ret (return value: cc.FastTMXLayer) + +-------------------------------- +-- @function [parent=#FastTMXLayer] removeChild +-- @param self +-- @param #cc.Node node +-- @param #bool bool + +-------------------------------- +-- @function [parent=#FastTMXLayer] draw +-- @param self +-- @param #cc.Renderer renderer +-- @param #mat4_table mat4 +-- @param #unsigned int int + +-------------------------------- +-- @function [parent=#FastTMXLayer] getDescription +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#FastTMXLayer] FastTMXLayer +-- @param self + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/FastTMXTiledMap.lua b/cocos/scripting/lua-bindings/auto/api/FastTMXTiledMap.lua new file mode 100644 index 0000000000..008fdc4b61 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/FastTMXTiledMap.lua @@ -0,0 +1,103 @@ + +-------------------------------- +-- @module FastTMXTiledMap +-- @extend Node +-- @parent_module cc + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] setObjectGroups +-- @param self +-- @param #array_table array + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getProperty +-- @param self +-- @param #string str +-- @return Value#Value ret (return value: cc.Value) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] setMapSize +-- @param self +-- @param #size_table size + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getObjectGroup +-- @param self +-- @param #string str +-- @return TMXObjectGroup#TMXObjectGroup ret (return value: cc.TMXObjectGroup) + +-------------------------------- +-- overload function: getObjectGroups() +-- +-- overload function: getObjectGroups() +-- +-- @function [parent=#FastTMXTiledMap] getObjectGroups +-- @param self +-- @return array_table#array_table ret (retunr value: array_table) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getTileSize +-- @param self +-- @return size_table#size_table ret (return value: size_table) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getMapSize +-- @param self +-- @return size_table#size_table ret (return value: size_table) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getProperties +-- @param self +-- @return map_table#map_table ret (return value: map_table) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getPropertiesForGID +-- @param self +-- @param #int int +-- @return Value#Value ret (return value: cc.Value) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] setTileSize +-- @param self +-- @param #size_table size + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] setProperties +-- @param self +-- @param #map_table map + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getLayer +-- @param self +-- @param #string str +-- @return FastTMXLayer#FastTMXLayer ret (return value: cc.FastTMXLayer) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getMapOrientation +-- @param self +-- @return int#int ret (return value: int) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] setMapOrientation +-- @param self +-- @param #int int + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] create +-- @param self +-- @param #string str +-- @return FastTMXTiledMap#FastTMXTiledMap ret (return value: cc.FastTMXTiledMap) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] createWithXML +-- @param self +-- @param #string str +-- @param #string str +-- @return FastTMXTiledMap#FastTMXTiledMap ret (return value: cc.FastTMXTiledMap) + +-------------------------------- +-- @function [parent=#FastTMXTiledMap] getDescription +-- @param self +-- @return string#string ret (return value: string) + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/Node.lua b/cocos/scripting/lua-bindings/auto/api/Node.lua index fe14b7b795..846ddc9af9 100644 --- a/cocos/scripting/lua-bindings/auto/api/Node.lua +++ b/cocos/scripting/lua-bindings/auto/api/Node.lua @@ -59,6 +59,11 @@ -- @param self -- @return array_table#array_table ret (retunr value: array_table) +-------------------------------- +-- @function [parent=#Node] setOnExitCallback +-- @param self +-- @param #function func + -------------------------------- -- @function [parent=#Node] pause -- @param self @@ -110,6 +115,11 @@ -- @param self -- @param #float float +-------------------------------- +-- @function [parent=#Node] setonEnterTransitionDidFinishCallback +-- @param self +-- @param #function func + -------------------------------- -- @function [parent=#Node] removeAllComponents -- @param self @@ -124,6 +134,11 @@ -- @param self -- @return int#int ret (return value: int) +-------------------------------- +-- @function [parent=#Node] getonEnterTransitionDidFinishCallback +-- @param self +-- @return function#function ret (return value: function) + -------------------------------- -- @function [parent=#Node] getGLProgram -- @param self @@ -171,6 +186,11 @@ -- @param self -- @param #cc.GLProgramState glprogramstate +-------------------------------- +-- @function [parent=#Node] setOnEnterCallback +-- @param self +-- @param #function func + -------------------------------- -- @function [parent=#Node] getOpacity -- @param self @@ -181,6 +201,11 @@ -- @param self -- @param #vec2_table vec2 +-------------------------------- +-- @function [parent=#Node] setonExitTransitionDidStartCallback +-- @param self +-- @param #function func + -------------------------------- -- @function [parent=#Node] convertTouchToNodeSpace -- @param self @@ -232,6 +257,11 @@ -- @param #cc.Touch touch -- @return vec2_table#vec2_table ret (return value: vec2_table) +-------------------------------- +-- @function [parent=#Node] getOnEnterCallback +-- @param self +-- @return function#function ret (return value: function) + -------------------------------- -- @function [parent=#Node] convertToNodeSpace -- @param self @@ -540,6 +570,11 @@ -- @param #float float -- @param #float float +-------------------------------- +-- @function [parent=#Node] getOnExitCallback +-- @param self +-- @return function#function ret (return value: function) + -------------------------------- -- @function [parent=#Node] getChildByTag -- @param self @@ -638,10 +673,9 @@ -- @param #cc.Ref ref -------------------------------- --- @function [parent=#Node] enumerateChildren +-- @function [parent=#Node] getonExitTransitionDidStartCallback -- @param self --- @param #string str --- @param #function func +-- @return function#function ret (return value: function) -------------------------------- -- overload function: removeFromParentAndCleanup(bool) diff --git a/cocos/scripting/lua-bindings/auto/api/ParticleSystemQuad.lua b/cocos/scripting/lua-bindings/auto/api/ParticleSystemQuad.lua index 40b95f9386..3b41c5710a 100644 --- a/cocos/scripting/lua-bindings/auto/api/ParticleSystemQuad.lua +++ b/cocos/scripting/lua-bindings/auto/api/ParticleSystemQuad.lua @@ -15,6 +15,11 @@ -- @param #cc.Texture2D texture2d -- @param #rect_table rect +-------------------------------- +-- @function [parent=#ParticleSystemQuad] listenRendererRecreated +-- @param self +-- @param #cc.EventCustom eventcustom + -------------------------------- -- overload function: create(string) -- diff --git a/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua new file mode 100644 index 0000000000..81ca7db206 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua @@ -0,0 +1,95 @@ + +-------------------------------- +-- @module VideoPlayer +-- @extend Widget +-- @parent_module ccexprimental + +-------------------------------- +-- @function [parent=#VideoPlayer] getFileName +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#VideoPlayer] getURL +-- @param self +-- @return string#string ret (return value: string) + +-------------------------------- +-- @function [parent=#VideoPlayer] play +-- @param self + +-------------------------------- +-- @function [parent=#VideoPlayer] pause +-- @param self + +-------------------------------- +-- @function [parent=#VideoPlayer] setKeepAspectRatioEnabled +-- @param self +-- @param #bool bool + +-------------------------------- +-- @function [parent=#VideoPlayer] resume +-- @param self + +-------------------------------- +-- @function [parent=#VideoPlayer] stop +-- @param self + +-------------------------------- +-- @function [parent=#VideoPlayer] setFullScreenEnabled +-- @param self +-- @param #bool bool + +-------------------------------- +-- @function [parent=#VideoPlayer] setFileName +-- @param self +-- @param #string str + +-------------------------------- +-- @function [parent=#VideoPlayer] setURL +-- @param self +-- @param #string str + +-------------------------------- +-- @function [parent=#VideoPlayer] isKeepAspectRatioEnabled +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#VideoPlayer] onPlayEvent +-- @param self +-- @param #cc.experimental::ui::VideoPlayer::EventType eventtype + +-------------------------------- +-- @function [parent=#VideoPlayer] isFullScreenEnabled +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#VideoPlayer] isPlaying +-- @param self +-- @return bool#bool ret (return value: bool) + +-------------------------------- +-- @function [parent=#VideoPlayer] seekTo +-- @param self +-- @param #float float + +-------------------------------- +-- @function [parent=#VideoPlayer] create +-- @param self +-- @return experimental::ui::VideoPlayer#experimental::ui::VideoPlayer ret (return value: cc.experimental::ui::VideoPlayer) + +-------------------------------- +-- @function [parent=#VideoPlayer] draw +-- @param self +-- @param #cc.Renderer renderer +-- @param #mat4_table mat4 +-- @param #unsigned int int + +-------------------------------- +-- @function [parent=#VideoPlayer] setVisible +-- @param self +-- @param #bool bool + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index 63856c59c7..2d798d773a 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -1196,6 +1196,16 @@ -- @field [parent=#cc] TileMapAtlas#TileMapAtlas TileMapAtlas preloaded module +-------------------------------------------------------- +-- the cc FastTMXTiledMap +-- @field [parent=#cc] FastTMXTiledMap#FastTMXTiledMap FastTMXTiledMap preloaded module + + +-------------------------------------------------------- +-- the cc FastTMXLayer +-- @field [parent=#cc] FastTMXLayer#FastTMXLayer FastTMXLayer preloaded module + + -------------------------------------------------------- -- the cc Component -- @field [parent=#cc] Component#Component Component preloaded module @@ -1211,16 +1221,6 @@ -- @field [parent=#cc] Mesh#Mesh Mesh preloaded module --------------------------------------------------------- --- the cc SimpleAudioEngine --- @field [parent=#cc] SimpleAudioEngine#SimpleAudioEngine SimpleAudioEngine preloaded module - - --------------------------------------------------------- --- the cc ProtectedNode --- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode preloaded module - - -------------------------------------------------------- -- the cc Animation3D -- @field [parent=#cc] Animation3D#Animation3D Animation3D preloaded module @@ -1231,4 +1231,14 @@ -- @field [parent=#cc] Animate3D#Animate3D Animate3D preloaded module +-------------------------------------------------------- +-- the cc SimpleAudioEngine +-- @field [parent=#cc] SimpleAudioEngine#SimpleAudioEngine SimpleAudioEngine preloaded module + + +-------------------------------------------------------- +-- the cc ProtectedNode +-- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode preloaded module + + return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_controller_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_controller_auto_api.lua new file mode 100644 index 0000000000..30ab29ef7b --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_controller_auto_api.lua @@ -0,0 +1,19 @@ +-------------------------------- +-- @module cc + +-------------------------------------------------------- +-- the cc Controller +-- @field [parent=#cc] Controller#Controller Controller preloaded module + + +-------------------------------------------------------- +-- the cc EventController +-- @field [parent=#cc] EventController#EventController EventController preloaded module + + +-------------------------------------------------------- +-- the cc EventListenerController +-- @field [parent=#cc] EventListenerController#EventListenerController EventListenerController preloaded module + + +return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_video_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_video_auto_api.lua new file mode 100644 index 0000000000..515fad0841 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_video_auto_api.lua @@ -0,0 +1,9 @@ +-------------------------------- +-- @module ccexprimental + +-------------------------------------------------------- +-- the ccexprimental VideoPlayer +-- @field [parent=#ccexprimental] VideoPlayer#VideoPlayer VideoPlayer preloaded module + + +return nil diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index 8e7d0cd0b9..c64da13f70 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -353,7 +353,7 @@ static int lua_cocos2dx_Console_finalize(lua_State* tolua_S) int lua_register_cocos2dx_Console(lua_State* tolua_S) { tolua_usertype(tolua_S,"cc.Console"); - tolua_cclass(tolua_S,"Console","cc.Console","",nullptr); + tolua_cclass(tolua_S,"Console","cc.Console","cc.Ref",nullptr); tolua_beginmodule(tolua_S,"Console"); tolua_function(tolua_S,"stop",lua_cocos2dx_Console_stop); @@ -4031,6 +4031,56 @@ int lua_cocos2dx_Node_getChildren(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_setOnExitCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setOnExitCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::function arg0; + + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + if(!ok) + return 0; + cobj->setOnExitCallback(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setOnExitCallback",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setOnExitCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_pause(lua_State* tolua_S) { int argc = 0; @@ -4488,6 +4538,56 @@ int lua_cocos2dx_Node_setRotationSkewX(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_setonEnterTransitionDidFinishCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setonEnterTransitionDidFinishCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::function arg0; + + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + if(!ok) + return 0; + cobj->setonEnterTransitionDidFinishCallback(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setonEnterTransitionDidFinishCallback",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setonEnterTransitionDidFinishCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_removeAllComponents(lua_State* tolua_S) { int argc = 0; @@ -4621,6 +4721,50 @@ int lua_cocos2dx_Node_getTag(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_getonEnterTransitionDidFinishCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getonEnterTransitionDidFinishCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::function& ret = cobj->getonEnterTransitionDidFinishCallback(); + #pragma warning NO CONVERSION FROM NATIVE FOR std::function; + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getonEnterTransitionDidFinishCallback",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_getonEnterTransitionDidFinishCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_getGLProgram(lua_State* tolua_S) { int argc = 0; @@ -5039,6 +5183,56 @@ int lua_cocos2dx_Node_setGLProgramState(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_setOnEnterCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setOnEnterCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::function arg0; + + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + if(!ok) + return 0; + cobj->setOnEnterCallback(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setOnEnterCallback",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setOnEnterCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_getOpacity(lua_State* tolua_S) { int argc = 0; @@ -5129,6 +5323,56 @@ int lua_cocos2dx_Node_setNormalizedPosition(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_setonExitTransitionDidStartCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_setonExitTransitionDidStartCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::function arg0; + + do { + // Lambda binding for lua is not supported. + assert(false); + } while(0) + ; + if(!ok) + return 0; + cobj->setonExitTransitionDidStartCallback(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setonExitTransitionDidStartCallback",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_setonExitTransitionDidStartCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S) { int argc = 0; @@ -5538,6 +5782,50 @@ int lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_getOnEnterCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getOnEnterCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::function& ret = cobj->getOnEnterCallback(); + #pragma warning NO CONVERSION FROM NATIVE FOR std::function; + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOnEnterCallback",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_getOnEnterCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_convertToNodeSpace(lua_State* tolua_S) { int argc = 0; @@ -8091,6 +8379,50 @@ int lua_cocos2dx_Node_setScale(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_getOnExitCallback(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getOnExitCallback'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::function& ret = cobj->getOnExitCallback(); + #pragma warning NO CONVERSION FROM NATIVE FOR std::function; + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getOnExitCallback",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_getOnExitCallback'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_Node_getChildByTag(lua_State* tolua_S) { int argc = 0; @@ -8913,7 +9245,7 @@ int lua_cocos2dx_Node_setUserObject(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Node_enumerateChildren(lua_State* tolua_S) +int lua_cocos2dx_Node_getonExitTransitionDidStartCallback(lua_State* tolua_S) { int argc = 0; cocos2d::Node* cobj = nullptr; @@ -8933,35 +9265,26 @@ int lua_cocos2dx_Node_enumerateChildren(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_enumerateChildren'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_getonExitTransitionDidStartCallback'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) + if (argc == 0) { - std::string arg0; - std::function arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; if(!ok) return 0; - cobj->enumerateChildren(arg0, arg1); - return 0; + const std::function& ret = cobj->getonExitTransitionDidStartCallback(); + #pragma warning NO CONVERSION FROM NATIVE FOR std::function; + return 1; } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "enumerateChildren",argc, 2); + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getonExitTransitionDidStartCallback",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_enumerateChildren'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_getonExitTransitionDidStartCallback'.",&tolua_err); #endif return 0; @@ -9604,6 +9927,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"setOpacityModifyRGB",lua_cocos2dx_Node_setOpacityModifyRGB); tolua_function(tolua_S,"setCascadeOpacityEnabled",lua_cocos2dx_Node_setCascadeOpacityEnabled); tolua_function(tolua_S,"getChildren",lua_cocos2dx_Node_getChildren); + tolua_function(tolua_S,"setOnExitCallback",lua_cocos2dx_Node_setOnExitCallback); tolua_function(tolua_S,"pause",lua_cocos2dx_Node_pause); tolua_function(tolua_S,"convertToWorldSpaceAR",lua_cocos2dx_Node_convertToWorldSpaceAR); tolua_function(tolua_S,"isIgnoreAnchorPointForPosition",lua_cocos2dx_Node_isIgnoreAnchorPointForPosition); @@ -9614,9 +9938,11 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"setScaleY",lua_cocos2dx_Node_setScaleY); tolua_function(tolua_S,"setScaleX",lua_cocos2dx_Node_setScaleX); tolua_function(tolua_S,"setRotationSkewX",lua_cocos2dx_Node_setRotationSkewX); + tolua_function(tolua_S,"setonEnterTransitionDidFinishCallback",lua_cocos2dx_Node_setonEnterTransitionDidFinishCallback); tolua_function(tolua_S,"removeAllComponents",lua_cocos2dx_Node_removeAllComponents); tolua_function(tolua_S,"_setLocalZOrder",lua_cocos2dx_Node__setLocalZOrder); tolua_function(tolua_S,"getTag",lua_cocos2dx_Node_getTag); + tolua_function(tolua_S,"getonEnterTransitionDidFinishCallback",lua_cocos2dx_Node_getonEnterTransitionDidFinishCallback); tolua_function(tolua_S,"getGLProgram",lua_cocos2dx_Node_getGLProgram); tolua_function(tolua_S,"getNodeToWorldTransform",lua_cocos2dx_Node_getNodeToWorldTransform); tolua_function(tolua_S,"getPosition3D",lua_cocos2dx_Node_getPosition3D); @@ -9626,8 +9952,10 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"getEventDispatcher",lua_cocos2dx_Node_getEventDispatcher); tolua_function(tolua_S,"setSkewX",lua_cocos2dx_Node_setSkewX); tolua_function(tolua_S,"setGLProgramState",lua_cocos2dx_Node_setGLProgramState); + tolua_function(tolua_S,"setOnEnterCallback",lua_cocos2dx_Node_setOnEnterCallback); tolua_function(tolua_S,"getOpacity",lua_cocos2dx_Node_getOpacity); tolua_function(tolua_S,"setNormalizedPosition",lua_cocos2dx_Node_setNormalizedPosition); + tolua_function(tolua_S,"setonExitTransitionDidStartCallback",lua_cocos2dx_Node_setonExitTransitionDidStartCallback); tolua_function(tolua_S,"convertTouchToNodeSpace",lua_cocos2dx_Node_convertTouchToNodeSpace); tolua_function(tolua_S,"removeAllChildren",lua_cocos2dx_Node_removeAllChildrenWithCleanup); tolua_function(tolua_S,"getNodeToParentAffineTransform",lua_cocos2dx_Node_getNodeToParentAffineTransform); @@ -9637,6 +9965,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"getRotation3D",lua_cocos2dx_Node_getRotation3D); tolua_function(tolua_S,"getNodeToParentTransform",lua_cocos2dx_Node_getNodeToParentTransform); tolua_function(tolua_S,"convertTouchToNodeSpaceAR",lua_cocos2dx_Node_convertTouchToNodeSpaceAR); + tolua_function(tolua_S,"getOnEnterCallback",lua_cocos2dx_Node_getOnEnterCallback); tolua_function(tolua_S,"convertToNodeSpace",lua_cocos2dx_Node_convertToNodeSpace); tolua_function(tolua_S,"resume",lua_cocos2dx_Node_resume); tolua_function(tolua_S,"getPhysicsBody",lua_cocos2dx_Node_getPhysicsBody); @@ -9692,6 +10021,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"getParentToNodeTransform",lua_cocos2dx_Node_getParentToNodeTransform); tolua_function(tolua_S,"setGlobalZOrder",lua_cocos2dx_Node_setGlobalZOrder); tolua_function(tolua_S,"setScale",lua_cocos2dx_Node_setScale); + tolua_function(tolua_S,"getOnExitCallback",lua_cocos2dx_Node_getOnExitCallback); tolua_function(tolua_S,"getChildByTag",lua_cocos2dx_Node_getChildByTag); tolua_function(tolua_S,"setOrderOfArrival",lua_cocos2dx_Node_setOrderOfArrival); tolua_function(tolua_S,"getScaleZ",lua_cocos2dx_Node_getScaleZ); @@ -9710,7 +10040,7 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"getGlobalZOrder",lua_cocos2dx_Node_getGlobalZOrder); tolua_function(tolua_S,"draw",lua_cocos2dx_Node_draw); tolua_function(tolua_S,"setUserObject",lua_cocos2dx_Node_setUserObject); - tolua_function(tolua_S,"enumerateChildren",lua_cocos2dx_Node_enumerateChildren); + tolua_function(tolua_S,"getonExitTransitionDidStartCallback",lua_cocos2dx_Node_getonExitTransitionDidStartCallback); tolua_function(tolua_S,"removeFromParent",lua_cocos2dx_Node_removeFromParentAndCleanup); tolua_function(tolua_S,"setPosition3D",lua_cocos2dx_Node_setPosition3D); tolua_function(tolua_S,"update",lua_cocos2dx_Node_update); @@ -51618,6 +51948,52 @@ int lua_cocos2dx_ParticleSystemQuad_setTextureWithRect(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ParticleSystemQuad* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.ParticleSystemQuad",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ParticleSystemQuad*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::EventCustom* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.EventCustom",&arg0); + if(!ok) + return 0; + cobj->listenRendererRecreated(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "listenRendererRecreated",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated'.",&tolua_err); +#endif + + return 0; +} int lua_cocos2dx_ParticleSystemQuad_create(lua_State* tolua_S) { int argc = 0; @@ -51723,6 +52099,7 @@ int lua_register_cocos2dx_ParticleSystemQuad(lua_State* tolua_S) tolua_beginmodule(tolua_S,"ParticleSystemQuad"); tolua_function(tolua_S,"setDisplayFrame",lua_cocos2dx_ParticleSystemQuad_setDisplayFrame); tolua_function(tolua_S,"setTextureWithRect",lua_cocos2dx_ParticleSystemQuad_setTextureWithRect); + tolua_function(tolua_S,"listenRendererRecreated",lua_cocos2dx_ParticleSystemQuad_listenRendererRecreated); tolua_function(tolua_S,"create", lua_cocos2dx_ParticleSystemQuad_create); tolua_function(tolua_S,"createWithTotalParticles", lua_cocos2dx_ParticleSystemQuad_createWithTotalParticles); tolua_endmodule(tolua_S); @@ -61596,6 +61973,1751 @@ int lua_register_cocos2dx_TileMapAtlas(lua_State* tolua_S) return 1; } +int lua_cocos2dx_FastTMXTiledMap_setObjectGroups(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setObjectGroups'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vector arg0; + + ok &= luaval_to_ccvector(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setObjectGroups(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setObjectGroups",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setObjectGroups'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getProperty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getProperty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::Value ret = cobj->getProperty(arg0); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getProperty",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getProperty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_setMapSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setMapSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Size arg0; + + ok &= luaval_to_size(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setMapSize(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setMapSize",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setMapSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getObjectGroup(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroup'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::TMXObjectGroup* ret = cobj->getObjectGroup(arg0); + object_to_luaval(tolua_S, "cc.TMXObjectGroup",(cocos2d::TMXObjectGroup*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getObjectGroup",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroup'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getObjectGroups(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroups'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 0) { + cocos2d::Vector& ret = cobj->getObjectGroups(); + ccvector_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 0) { + const cocos2d::Vector& ret = cobj->getObjectGroups(); + ccvector_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getObjectGroups",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getObjectGroups'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getTileSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getTileSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Size& ret = cobj->getTileSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTileSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getTileSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getMapSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getMapSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Size& ret = cobj->getMapSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMapSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getMapSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getProperties(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getProperties'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::ValueMap& ret = cobj->getProperties(); + ccvaluemap_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getProperties",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getProperties'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cocos2d::Value ret = cobj->getPropertiesForGID(arg0); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPropertiesForGID",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_setTileSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setTileSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Size arg0; + + ok &= luaval_to_size(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setTileSize(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTileSize",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setTileSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_setProperties(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setProperties'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::ValueMap arg0; + + ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setProperties(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setProperties",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setProperties'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getLayer(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getLayer'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::FastTMXLayer* ret = cobj->getLayer(arg0); + object_to_luaval(tolua_S, "cc.FastTMXLayer",(cocos2d::FastTMXLayer*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayer",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getLayer'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_getMapOrientation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_getMapOrientation'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getMapOrientation(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMapOrientation",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_getMapOrientation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_setMapOrientation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXTiledMap* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXTiledMap*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXTiledMap_setMapOrientation'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->setMapOrientation(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setMapOrientation",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_setMapOrientation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::FastTMXTiledMap* ret = cocos2d::FastTMXTiledMap::create(arg0); + object_to_luaval(tolua_S, "cc.FastTMXTiledMap",(cocos2d::FastTMXTiledMap*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_create'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_FastTMXTiledMap_createWithXML(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.FastTMXTiledMap",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 2) + { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + ok &= luaval_to_std_string(tolua_S, 3,&arg1); + if(!ok) + return 0; + cocos2d::FastTMXTiledMap* ret = cocos2d::FastTMXTiledMap::createWithXML(arg0, arg1); + object_to_luaval(tolua_S, "cc.FastTMXTiledMap",(cocos2d::FastTMXTiledMap*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "createWithXML",argc, 2); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXTiledMap_createWithXML'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_FastTMXTiledMap_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (FastTMXTiledMap)"); + return 0; +} + +int lua_register_cocos2dx_FastTMXTiledMap(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.FastTMXTiledMap"); + tolua_cclass(tolua_S,"FastTMXTiledMap","cc.FastTMXTiledMap","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"FastTMXTiledMap"); + tolua_function(tolua_S,"setObjectGroups",lua_cocos2dx_FastTMXTiledMap_setObjectGroups); + tolua_function(tolua_S,"getProperty",lua_cocos2dx_FastTMXTiledMap_getProperty); + tolua_function(tolua_S,"setMapSize",lua_cocos2dx_FastTMXTiledMap_setMapSize); + tolua_function(tolua_S,"getObjectGroup",lua_cocos2dx_FastTMXTiledMap_getObjectGroup); + tolua_function(tolua_S,"getObjectGroups",lua_cocos2dx_FastTMXTiledMap_getObjectGroups); + tolua_function(tolua_S,"getTileSize",lua_cocos2dx_FastTMXTiledMap_getTileSize); + tolua_function(tolua_S,"getMapSize",lua_cocos2dx_FastTMXTiledMap_getMapSize); + tolua_function(tolua_S,"getProperties",lua_cocos2dx_FastTMXTiledMap_getProperties); + tolua_function(tolua_S,"getPropertiesForGID",lua_cocos2dx_FastTMXTiledMap_getPropertiesForGID); + tolua_function(tolua_S,"setTileSize",lua_cocos2dx_FastTMXTiledMap_setTileSize); + tolua_function(tolua_S,"setProperties",lua_cocos2dx_FastTMXTiledMap_setProperties); + tolua_function(tolua_S,"getLayer",lua_cocos2dx_FastTMXTiledMap_getLayer); + tolua_function(tolua_S,"getMapOrientation",lua_cocos2dx_FastTMXTiledMap_getMapOrientation); + tolua_function(tolua_S,"setMapOrientation",lua_cocos2dx_FastTMXTiledMap_setMapOrientation); + tolua_function(tolua_S,"create", lua_cocos2dx_FastTMXTiledMap_create); + tolua_function(tolua_S,"createWithXML", lua_cocos2dx_FastTMXTiledMap_createWithXML); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::FastTMXTiledMap).name(); + g_luaType[typeName] = "cc.FastTMXTiledMap"; + g_typeCast["FastTMXTiledMap"] = "cc.FastTMXTiledMap"; + return 1; +} + +int lua_cocos2dx_FastTMXLayer_getPositionAt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getPositionAt'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + if(!ok) + return 0; + cocos2d::Vec2 ret = cobj->getPositionAt(arg0); + vec2_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPositionAt",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getPositionAt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setLayerOrientation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerOrientation'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->setLayerOrientation(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setLayerOrientation",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerOrientation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getLayerSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Size& ret = cobj->getLayerSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayerSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setMapTileSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setMapTileSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Size arg0; + + ok &= luaval_to_size(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setMapTileSize(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setMapTileSize",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setMapTileSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getLayerOrientation(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerOrientation'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getLayerOrientation(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayerOrientation",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerOrientation'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setProperties(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setProperties'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::ValueMap arg0; + + ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setProperties(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setProperties",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setProperties'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setLayerName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setLayerName(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setLayerName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_removeTileAt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_removeTileAt'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->removeTileAt(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "removeTileAt",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_removeTileAt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getProperties(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getProperties'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 0) { + cocos2d::ValueMap& ret = cobj->getProperties(); + ccvaluemap_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 0) { + const cocos2d::ValueMap& ret = cobj->getProperties(); + ccvaluemap_to_luaval(tolua_S, ret); + return 1; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getProperties",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getProperties'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setupTiles(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setupTiles'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->setupTiles(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setupTiles",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setupTiles'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setupTileSprite(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setupTileSprite'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 3) + { + cocos2d::Sprite* arg0; + cocos2d::Vec2 arg1; + int arg2; + + ok &= luaval_to_object(tolua_S, 2, "cc.Sprite",&arg0); + + ok &= luaval_to_vec2(tolua_S, 3, &arg1); + + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); + if(!ok) + return 0; + cobj->setupTileSprite(arg0, arg1, arg2); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setupTileSprite",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setupTileSprite'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setTileGID(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setTileGID'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1); + + if (!ok) { break; } + cocos2d::TMXTileFlags_ arg2; + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); + + if (!ok) { break; } + cobj->setTileGID(arg0, arg1, arg2); + return 0; + } + }while(0); + ok = true; + do{ + if (argc == 2) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1); + + if (!ok) { break; } + cobj->setTileGID(arg0, arg1); + return 0; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTileGID",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setTileGID'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getMapTileSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getMapTileSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const cocos2d::Size& ret = cobj->getMapTileSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getMapTileSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getMapTileSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getProperty(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getProperty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::Value ret = cobj->getProperty(arg0); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getProperty",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getProperty'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setLayerSize(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setLayerSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Size arg0; + + ok &= luaval_to_size(tolua_S, 2, &arg0); + if(!ok) + return 0; + cobj->setLayerSize(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setLayerSize",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setLayerSize'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getLayerName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getLayerName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getLayerName(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getLayerName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getLayerName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_setTileSet(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_setTileSet'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::TMXTilesetInfo* arg0; + + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); + if(!ok) + return 0; + cobj->setTileSet(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTileSet",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_setTileSet'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getTileSet(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileSet'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::TMXTilesetInfo* ret = cobj->getTileSet(); + object_to_luaval(tolua_S, "cc.TMXTilesetInfo",(cocos2d::TMXTilesetInfo*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTileSet",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileSet'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_getTileAt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileAt'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + if(!ok) + return 0; + cocos2d::Sprite* ret = cobj->getTileAt(arg0); + object_to_luaval(tolua_S, "cc.Sprite",(cocos2d::Sprite*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTileAt",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileAt'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_FastTMXLayer_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 3) + { + cocos2d::TMXTilesetInfo* arg0; + cocos2d::TMXLayerInfo* arg1; + cocos2d::TMXMapInfo* arg2; + ok &= luaval_to_object(tolua_S, 2, "cc.TMXTilesetInfo",&arg0); + ok &= luaval_to_object(tolua_S, 3, "cc.TMXLayerInfo",&arg1); + ok &= luaval_to_object(tolua_S, 4, "cc.TMXMapInfo",&arg2); + if(!ok) + return 0; + cocos2d::FastTMXLayer* ret = cocos2d::FastTMXLayer::create(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.FastTMXLayer",(cocos2d::FastTMXLayer*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 3); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_create'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_FastTMXLayer_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj = new cocos2d::FastTMXLayer(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.FastTMXLayer"); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "FastTMXLayer",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_FastTMXLayer_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (FastTMXLayer)"); + return 0; +} + +int lua_register_cocos2dx_FastTMXLayer(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.FastTMXLayer"); + tolua_cclass(tolua_S,"FastTMXLayer","cc.FastTMXLayer","cc.Node",nullptr); + + tolua_beginmodule(tolua_S,"FastTMXLayer"); + tolua_function(tolua_S,"new",lua_cocos2dx_FastTMXLayer_constructor); + tolua_function(tolua_S,"getPositionAt",lua_cocos2dx_FastTMXLayer_getPositionAt); + tolua_function(tolua_S,"setLayerOrientation",lua_cocos2dx_FastTMXLayer_setLayerOrientation); + tolua_function(tolua_S,"getLayerSize",lua_cocos2dx_FastTMXLayer_getLayerSize); + tolua_function(tolua_S,"setMapTileSize",lua_cocos2dx_FastTMXLayer_setMapTileSize); + tolua_function(tolua_S,"getLayerOrientation",lua_cocos2dx_FastTMXLayer_getLayerOrientation); + tolua_function(tolua_S,"setProperties",lua_cocos2dx_FastTMXLayer_setProperties); + tolua_function(tolua_S,"setLayerName",lua_cocos2dx_FastTMXLayer_setLayerName); + tolua_function(tolua_S,"removeTileAt",lua_cocos2dx_FastTMXLayer_removeTileAt); + tolua_function(tolua_S,"getProperties",lua_cocos2dx_FastTMXLayer_getProperties); + tolua_function(tolua_S,"setupTiles",lua_cocos2dx_FastTMXLayer_setupTiles); + tolua_function(tolua_S,"setupTileSprite",lua_cocos2dx_FastTMXLayer_setupTileSprite); + tolua_function(tolua_S,"setTileGID",lua_cocos2dx_FastTMXLayer_setTileGID); + tolua_function(tolua_S,"getMapTileSize",lua_cocos2dx_FastTMXLayer_getMapTileSize); + tolua_function(tolua_S,"getProperty",lua_cocos2dx_FastTMXLayer_getProperty); + tolua_function(tolua_S,"setLayerSize",lua_cocos2dx_FastTMXLayer_setLayerSize); + tolua_function(tolua_S,"getLayerName",lua_cocos2dx_FastTMXLayer_getLayerName); + tolua_function(tolua_S,"setTileSet",lua_cocos2dx_FastTMXLayer_setTileSet); + tolua_function(tolua_S,"getTileSet",lua_cocos2dx_FastTMXLayer_getTileSet); + tolua_function(tolua_S,"getTileAt",lua_cocos2dx_FastTMXLayer_getTileAt); + tolua_function(tolua_S,"create", lua_cocos2dx_FastTMXLayer_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::FastTMXLayer).name(); + g_luaType[typeName] = "cc.FastTMXLayer"; + g_typeCast["FastTMXLayer"] = "cc.FastTMXLayer"; + return 1; +} + int lua_cocos2dx_Component_setEnabled(lua_State* tolua_S) { int argc = 0; @@ -62751,6 +64873,374 @@ int lua_register_cocos2dx_Mesh(lua_State* tolua_S) return 1; } +int lua_cocos2dx_Animation3D_getDuration(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animation3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animation3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animation3D_getDuration'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getDuration(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDuration",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_getDuration'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Animation3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0); + object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); + return 1; + } + if (argc == 2) + { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + ok &= luaval_to_std_string(tolua_S, 3,&arg1); + if(!ok) + return 0; + cocos2d::Animation3D* ret = cocos2d::Animation3D::create(arg0, arg1); + object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_Animation3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Animation3D)"); + return 0; +} + +int lua_register_cocos2dx_Animation3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Animation3D"); + tolua_cclass(tolua_S,"Animation3D","cc.Animation3D","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Animation3D"); + tolua_function(tolua_S,"getDuration",lua_cocos2dx_Animation3D_getDuration); + tolua_function(tolua_S,"create", lua_cocos2dx_Animation3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Animation3D).name(); + g_luaType[typeName] = "cc.Animation3D"; + g_typeCast["Animation3D"] = "cc.Animation3D"; + return 1; +} + +int lua_cocos2dx_Animate3D_setSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setSpeed(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSpeed",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setSpeed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Animate3D_setWeight(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setWeight'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setWeight(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setWeight",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setWeight'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getSpeed'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getSpeed(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSpeed",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getSpeed'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Animate3D_getWeight(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Animate3D* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getWeight'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + double ret = cobj->getWeight(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWeight",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getWeight'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_Animate3D_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 3) + { + cocos2d::Animation3D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2); + if (!ok) { break; } + cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); + object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Animation3D* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); + if (!ok) { break; } + cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); + object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); + return 1; + } + } while (0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_Animate3D_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Animate3D)"); + return 0; +} + +int lua_register_cocos2dx_Animate3D(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Animate3D"); + tolua_cclass(tolua_S,"Animate3D","cc.Animate3D","cc.ActionInterval",nullptr); + + tolua_beginmodule(tolua_S,"Animate3D"); + tolua_function(tolua_S,"setSpeed",lua_cocos2dx_Animate3D_setSpeed); + tolua_function(tolua_S,"setWeight",lua_cocos2dx_Animate3D_setWeight); + tolua_function(tolua_S,"getSpeed",lua_cocos2dx_Animate3D_getSpeed); + tolua_function(tolua_S,"getWeight",lua_cocos2dx_Animate3D_getWeight); + tolua_function(tolua_S,"create", lua_cocos2dx_Animate3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Animate3D).name(); + g_luaType[typeName] = "cc.Animate3D"; + g_typeCast["Animate3D"] = "cc.Animate3D"; + return 1; +} + int lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic(lua_State* tolua_S) { int argc = 0; @@ -64413,466 +66903,6 @@ int lua_register_cocos2dx_ProtectedNode(lua_State* tolua_S) g_typeCast["ProtectedNode"] = "cc.ProtectedNode"; return 1; } - -int lua_cocos2dx_Animation3D_getDuration(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animation3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animation3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animation3D_getDuration'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getDuration(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDuration",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_getDuration'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animation3D_getOrCreate(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Animation3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - if(!ok) - return 0; - cocos2d::Animation3D* ret = cocos2d::Animation3D::getOrCreate(arg0); - object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); - return 1; - } - if (argc == 2) - { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0); - ok &= luaval_to_std_string(tolua_S, 3,&arg1); - if(!ok) - return 0; - cocos2d::Animation3D* ret = cocos2d::Animation3D::getOrCreate(arg0, arg1); - object_to_luaval(tolua_S, "cc.Animation3D",(cocos2d::Animation3D*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getOrCreate",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animation3D_getOrCreate'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Animation3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Animation3D)"); - return 0; -} - -int lua_register_cocos2dx_Animation3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Animation3D"); - tolua_cclass(tolua_S,"Animation3D","cc.Animation3D","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Animation3D"); - tolua_function(tolua_S,"getDuration",lua_cocos2dx_Animation3D_getDuration); - tolua_function(tolua_S,"getOrCreate", lua_cocos2dx_Animation3D_getOrCreate); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Animation3D).name(); - g_luaType[typeName] = "cc.Animation3D"; - g_typeCast["Animation3D"] = "cc.Animation3D"; - return 1; -} - -int lua_cocos2dx_Animate3D_getSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getSpeed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getSpeed(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getSpeed",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getSpeed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_setWeight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setWeight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0); - if(!ok) - return 0; - cobj->setWeight(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setWeight",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setWeight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_getPlayBack(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getPlayBack'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - bool ret = cobj->getPlayBack(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPlayBack",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getPlayBack'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_setPlayBack(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setPlayBack'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - bool arg0; - - ok &= luaval_to_boolean(tolua_S, 2,&arg0); - if(!ok) - return 0; - cobj->setPlayBack(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setPlayBack",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setPlayBack'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_setSpeed(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_setSpeed'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0); - if(!ok) - return 0; - cobj->setSpeed(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setSpeed",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_setSpeed'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_getWeight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Animate3D* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Animate3D*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Animate3D_getWeight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getWeight(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getWeight",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_getWeight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_Animate3D_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Animate3D",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 3) - { - cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); - if (!ok) { break; } - double arg1; - ok &= luaval_to_number(tolua_S, 3,&arg1); - if (!ok) { break; } - double arg2; - ok &= luaval_to_number(tolua_S, 4,&arg2); - if (!ok) { break; } - cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::Animation3D* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Animation3D",&arg0); - if (!ok) { break; } - cocos2d::Animate3D* ret = cocos2d::Animate3D::create(arg0); - object_to_luaval(tolua_S, "cc.Animate3D",(cocos2d::Animate3D*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Animate3D_create'.",&tolua_err); -#endif - return 0; -} -static int lua_cocos2dx_Animate3D_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Animate3D)"); - return 0; -} - -int lua_register_cocos2dx_Animate3D(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Animate3D"); - tolua_cclass(tolua_S,"Animate3D","cc.Animate3D","cc.ActionInterval",nullptr); - - tolua_beginmodule(tolua_S,"Animate3D"); - tolua_function(tolua_S,"getSpeed",lua_cocos2dx_Animate3D_getSpeed); - tolua_function(tolua_S,"setWeight",lua_cocos2dx_Animate3D_setWeight); - tolua_function(tolua_S,"getPlayBack",lua_cocos2dx_Animate3D_getPlayBack); - tolua_function(tolua_S,"setPlayBack",lua_cocos2dx_Animate3D_setPlayBack); - tolua_function(tolua_S,"setSpeed",lua_cocos2dx_Animate3D_setSpeed); - tolua_function(tolua_S,"getWeight",lua_cocos2dx_Animate3D_getWeight); - tolua_function(tolua_S,"create", lua_cocos2dx_Animate3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::Animate3D).name(); - g_luaType[typeName] = "cc.Animate3D"; - g_typeCast["Animate3D"] = "cc.Animate3D"; - return 1; -} TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) { tolua_open(tolua_S); @@ -64880,8 +66910,8 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) tolua_module(tolua_S,"cc",0); tolua_beginmodule(tolua_S,"cc"); - lua_register_cocos2dx_Console(tolua_S); lua_register_cocos2dx_Ref(tolua_S); + lua_register_cocos2dx_Console(tolua_S); lua_register_cocos2dx_Node(tolua_S); lua_register_cocos2dx_Scene(tolua_S); lua_register_cocos2dx_TransitionScene(tolua_S); @@ -65017,6 +67047,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_Sprite3D(tolua_S); lua_register_cocos2dx_EventListenerMouse(tolua_S); lua_register_cocos2dx_TiledGrid3D(tolua_S); + lua_register_cocos2dx_FastTMXTiledMap(tolua_S); lua_register_cocos2dx_ParticleGalaxy(tolua_S); lua_register_cocos2dx_Twirl(tolua_S); lua_register_cocos2dx_MenuItemLabel(tolua_S); @@ -65049,6 +67080,7 @@ TOLUA_API int register_all_cocos2dx(lua_State* tolua_S) lua_register_cocos2dx_SpriteFrame(tolua_S); lua_register_cocos2dx_ActionManager(tolua_S); lua_register_cocos2dx_UserDefault(tolua_S); + lua_register_cocos2dx_FastTMXLayer(tolua_S); lua_register_cocos2dx_TransitionZoomFlipX(tolua_S); lua_register_cocos2dx_EventFocus(tolua_S); lua_register_cocos2dx_EaseQuinticActionInOut(tolua_S); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 62a4c37607..a14e56b1b4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1,3 +1,4 @@ +#include "base/ccConfig.h" #ifndef __cocos2dx_h__ #define __cocos2dx_h__ @@ -1548,6 +1549,52 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp new file mode 100644 index 0000000000..160c684a1d --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp @@ -0,0 +1,826 @@ +#include "lua_cocos2dx_controller_auto.hpp" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#include "CCGameController.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" + + + +int lua_cocos2dx_controller_Controller_receiveExternalKeyEvent(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_receiveExternalKeyEvent'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + int arg0; + bool arg1; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + + ok &= luaval_to_boolean(tolua_S, 3,&arg1); + if(!ok) + return 0; + cobj->receiveExternalKeyEvent(arg0, arg1); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "receiveExternalKeyEvent",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_receiveExternalKeyEvent'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_getDeviceName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_getDeviceName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getDeviceName(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDeviceName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_getDeviceName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_isConnected(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_isConnected'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isConnected(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "isConnected",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_isConnected'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_getDeviceId(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_getDeviceId'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getDeviceId(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getDeviceId",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_getDeviceId'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_setTag(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_setTag'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->setTag(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setTag",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_setTag'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_getTag(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Controller* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Controller*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_Controller_getTag'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getTag(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTag",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_getTag'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_Controller_startDiscoveryController(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Controller::startDiscoveryController(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "startDiscoveryController",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_startDiscoveryController'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_controller_Controller_stopDiscoveryController(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Controller::stopDiscoveryController(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "stopDiscoveryController",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_stopDiscoveryController'.",&tolua_err); +#endif + return 0; +} +int lua_cocos2dx_controller_Controller_getControllerByTag(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.Controller",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cocos2d::Controller* ret = cocos2d::Controller::getControllerByTag(arg0); + object_to_luaval(tolua_S, "cc.Controller",(cocos2d::Controller*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getControllerByTag",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_Controller_getControllerByTag'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_controller_Controller_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (Controller)"); + return 0; +} + +int lua_register_cocos2dx_controller_Controller(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.Controller"); + tolua_cclass(tolua_S,"Controller","cc.Controller","",nullptr); + + tolua_beginmodule(tolua_S,"Controller"); + tolua_function(tolua_S,"receiveExternalKeyEvent",lua_cocos2dx_controller_Controller_receiveExternalKeyEvent); + tolua_function(tolua_S,"getDeviceName",lua_cocos2dx_controller_Controller_getDeviceName); + tolua_function(tolua_S,"isConnected",lua_cocos2dx_controller_Controller_isConnected); + tolua_function(tolua_S,"getDeviceId",lua_cocos2dx_controller_Controller_getDeviceId); + tolua_function(tolua_S,"setTag",lua_cocos2dx_controller_Controller_setTag); + tolua_function(tolua_S,"getTag",lua_cocos2dx_controller_Controller_getTag); + tolua_function(tolua_S,"startDiscoveryController", lua_cocos2dx_controller_Controller_startDiscoveryController); + tolua_function(tolua_S,"stopDiscoveryController", lua_cocos2dx_controller_Controller_stopDiscoveryController); + tolua_function(tolua_S,"getControllerByTag", lua_cocos2dx_controller_Controller_getControllerByTag); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::Controller).name(); + g_luaType[typeName] = "cc.Controller"; + g_typeCast["Controller"] = "cc.Controller"; + return 1; +} + +int lua_cocos2dx_controller_EventController_getControllerEventType(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_getControllerEventType'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = (int)cobj->getControllerEventType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getControllerEventType",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_getControllerEventType'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_setConnectStatus(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_setConnectStatus'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setConnectStatus(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setConnectStatus",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_setConnectStatus'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_isConnected(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_isConnected'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isConnected(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "isConnected",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_isConnected'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_setKeyCode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_setKeyCode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->setKeyCode(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setKeyCode",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_setKeyCode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_getController(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_getController'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::Controller* ret = cobj->getController(); + object_to_luaval(tolua_S, "cc.Controller",(cocos2d::Controller*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getController",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_getController'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_getKeyCode(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.EventController",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::EventController*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_controller_EventController_getKeyCode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + int ret = cobj->getKeyCode(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getKeyCode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_getKeyCode'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_controller_EventController_constructor(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::EventController* cobj = nullptr; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + argc = lua_gettop(tolua_S)-1; + do{ + if (argc == 3) { + cocos2d::EventController::ControllerEventType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + + if (!ok) { break; } + cocos2d::Controller* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1); + + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2); + + if (!ok) { break; } + cobj = new cocos2d::EventController(arg0, arg1, arg2); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EventController"); + return 1; + } + }while(0); + ok = true; + do{ + if (argc == 3) { + cocos2d::EventController::ControllerEventType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + + if (!ok) { break; } + cocos2d::Controller* arg1; + ok &= luaval_to_object(tolua_S, 3, "cc.Controller",&arg1); + + if (!ok) { break; } + int arg2; + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2); + + if (!ok) { break; } + cobj = new cocos2d::EventController(arg0, arg1, arg2); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EventController"); + return 1; + } + }while(0); + ok = true; + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "EventController",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventController_constructor'.",&tolua_err); +#endif + + return 0; +} + +static int lua_cocos2dx_controller_EventController_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (EventController)"); + return 0; +} + +int lua_register_cocos2dx_controller_EventController(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.EventController"); + tolua_cclass(tolua_S,"EventController","cc.EventController","cc.Event",nullptr); + + tolua_beginmodule(tolua_S,"EventController"); + tolua_function(tolua_S,"new",lua_cocos2dx_controller_EventController_constructor); + tolua_function(tolua_S,"getControllerEventType",lua_cocos2dx_controller_EventController_getControllerEventType); + tolua_function(tolua_S,"setConnectStatus",lua_cocos2dx_controller_EventController_setConnectStatus); + tolua_function(tolua_S,"isConnected",lua_cocos2dx_controller_EventController_isConnected); + tolua_function(tolua_S,"setKeyCode",lua_cocos2dx_controller_EventController_setKeyCode); + tolua_function(tolua_S,"getController",lua_cocos2dx_controller_EventController_getController); + tolua_function(tolua_S,"getKeyCode",lua_cocos2dx_controller_EventController_getKeyCode); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::EventController).name(); + g_luaType[typeName] = "cc.EventController"; + g_typeCast["EventController"] = "cc.EventController"; + return 1; +} + +int lua_cocos2dx_controller_EventListenerController_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"cc.EventListenerController",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::EventListenerController* ret = cocos2d::EventListenerController::create(); + object_to_luaval(tolua_S, "cc.EventListenerController",(cocos2d::EventListenerController*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_controller_EventListenerController_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_controller_EventListenerController_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (EventListenerController)"); + return 0; +} + +int lua_register_cocos2dx_controller_EventListenerController(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"cc.EventListenerController"); + tolua_cclass(tolua_S,"EventListenerController","cc.EventListenerController","cc.EventListener",nullptr); + + tolua_beginmodule(tolua_S,"EventListenerController"); + tolua_function(tolua_S,"create", lua_cocos2dx_controller_EventListenerController_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::EventListenerController).name(); + g_luaType[typeName] = "cc.EventListenerController"; + g_typeCast["EventListenerController"] = "cc.EventListenerController"; + return 1; +} +TOLUA_API int register_all_cocos2dx_controller(lua_State* tolua_S) +{ + tolua_open(tolua_S); + + tolua_module(tolua_S,"cc",0); + tolua_beginmodule(tolua_S,"cc"); + + lua_register_cocos2dx_controller_EventListenerController(tolua_S); + lua_register_cocos2dx_controller_Controller(tolua_S); + lua_register_cocos2dx_controller_EventController(tolua_S); + + tolua_endmodule(tolua_S); + return 1; +} + +#endif diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp new file mode 100644 index 0000000000..4fd667b49f --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp @@ -0,0 +1,37 @@ +#include "base/ccConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#ifndef __cocos2dx_controller_h__ +#define __cocos2dx_controller_h__ + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +int register_all_cocos2dx_controller(lua_State* tolua_S); + + + + + + + + + + + + + + + + + + + + + +#endif // __cocos2dx_controller_h__ +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp new file mode 100644 index 0000000000..408da55ffc --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp @@ -0,0 +1,755 @@ +#include "lua_cocos2dx_experimental_video_auto.hpp" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#include "UIVideoPlayer.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" + + + +int lua_cocos2dx_experimental_video_VideoPlayer_getFileName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_getFileName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getFileName(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getFileName",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_getFileName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_getURL(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_getURL'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + const std::string& ret = cobj->getURL(); + tolua_pushcppstring(tolua_S,ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getURL",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_getURL'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_play(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_play'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->play(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "play",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_play'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_pause(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_pause'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->pause(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "pause",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_pause'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setKeepAspectRatioEnabled(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setKeepAspectRatioEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_resume(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_resume'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->resume(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "resume",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_resume'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_stop(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_stop'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + cobj->stop(); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "stop",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_stop'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + + ok &= luaval_to_boolean(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setFullScreenEnabled(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setFullScreenEnabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_setFileName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setFileName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setFileName(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setFileName",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setFileName'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_setURL(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_setURL'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + std::string arg0; + + ok &= luaval_to_std_string(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->setURL(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "setURL",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_setURL'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isKeepAspectRatioEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "isKeepAspectRatioEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_onPlayEvent(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_onPlayEvent'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::experimental::ui::VideoPlayer::EventType arg0; + + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0); + if(!ok) + return 0; + cobj->onPlayEvent(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "onPlayEvent",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_onPlayEvent'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isFullScreenEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "isFullScreenEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_isPlaying(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_isPlaying'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + if(!ok) + return 0; + bool ret = cobj->isPlaying(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "isPlaying",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_isPlaying'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_seekTo(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::experimental::ui::VideoPlayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + + ok &= luaval_to_number(tolua_S, 2,&arg0); + if(!ok) + return 0; + cobj->seekTo(arg0); + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "seekTo",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_seekTo'.",&tolua_err); +#endif + + return 0; +} +int lua_cocos2dx_experimental_video_VideoPlayer_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + if(!ok) + return 0; + cocos2d::experimental::ui::VideoPlayer* ret = cocos2d::experimental::ui::VideoPlayer::create(); + object_to_luaval(tolua_S, "ccexp.VideoPlayer",(cocos2d::experimental::ui::VideoPlayer*)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_experimental_video_VideoPlayer_create'.",&tolua_err); +#endif + return 0; +} +static int lua_cocos2dx_experimental_video_VideoPlayer_finalize(lua_State* tolua_S) +{ + printf("luabindings: finalizing LUA object (VideoPlayer)"); + return 0; +} + +int lua_register_cocos2dx_experimental_video_VideoPlayer(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"ccexp.VideoPlayer"); + tolua_cclass(tolua_S,"VideoPlayer","ccexp.VideoPlayer","ccui.Widget",nullptr); + + tolua_beginmodule(tolua_S,"VideoPlayer"); + tolua_function(tolua_S,"getFileName",lua_cocos2dx_experimental_video_VideoPlayer_getFileName); + tolua_function(tolua_S,"getURL",lua_cocos2dx_experimental_video_VideoPlayer_getURL); + tolua_function(tolua_S,"play",lua_cocos2dx_experimental_video_VideoPlayer_play); + tolua_function(tolua_S,"pause",lua_cocos2dx_experimental_video_VideoPlayer_pause); + tolua_function(tolua_S,"setKeepAspectRatioEnabled",lua_cocos2dx_experimental_video_VideoPlayer_setKeepAspectRatioEnabled); + tolua_function(tolua_S,"resume",lua_cocos2dx_experimental_video_VideoPlayer_resume); + tolua_function(tolua_S,"stop",lua_cocos2dx_experimental_video_VideoPlayer_stop); + tolua_function(tolua_S,"setFullScreenEnabled",lua_cocos2dx_experimental_video_VideoPlayer_setFullScreenEnabled); + tolua_function(tolua_S,"setFileName",lua_cocos2dx_experimental_video_VideoPlayer_setFileName); + tolua_function(tolua_S,"setURL",lua_cocos2dx_experimental_video_VideoPlayer_setURL); + tolua_function(tolua_S,"isKeepAspectRatioEnabled",lua_cocos2dx_experimental_video_VideoPlayer_isKeepAspectRatioEnabled); + tolua_function(tolua_S,"onPlayEvent",lua_cocos2dx_experimental_video_VideoPlayer_onPlayEvent); + tolua_function(tolua_S,"isFullScreenEnabled",lua_cocos2dx_experimental_video_VideoPlayer_isFullScreenEnabled); + tolua_function(tolua_S,"isPlaying",lua_cocos2dx_experimental_video_VideoPlayer_isPlaying); + tolua_function(tolua_S,"seekTo",lua_cocos2dx_experimental_video_VideoPlayer_seekTo); + tolua_function(tolua_S,"create", lua_cocos2dx_experimental_video_VideoPlayer_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocos2d::experimental::ui::VideoPlayer).name(); + g_luaType[typeName] = "ccexp.VideoPlayer"; + g_typeCast["VideoPlayer"] = "ccexp.VideoPlayer"; + return 1; +} +TOLUA_API int register_all_cocos2dx_experimental_video(lua_State* tolua_S) +{ + tolua_open(tolua_S); + + tolua_module(tolua_S,"ccexprimental",0); + tolua_beginmodule(tolua_S,"ccexprimental"); + + lua_register_cocos2dx_experimental_video_VideoPlayer(tolua_S); + + tolua_endmodule(tolua_S); + return 1; +} + +#endif diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp new file mode 100644 index 0000000000..ca7986e43f --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp @@ -0,0 +1,34 @@ +#include "base/ccConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#ifndef __cocos2dx_experimental_video_h__ +#define __cocos2dx_experimental_video_h__ + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif + +int register_all_cocos2dx_experimental_video(lua_State* tolua_S); + + + + + + + + + + + + + + + + + + +#endif // __cocos2dx_experimental_video_h__ +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp index 9a70c65430..4aeaa3a638 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp @@ -1,3 +1,4 @@ +#include "base/ccConfig.h" #ifndef __cocos2dx_extension_h__ #define __cocos2dx_extension_h__ @@ -364,6 +365,7 @@ int register_all_cocos2dx_extension(lua_State* tolua_S); + #endif // __cocos2dx_extension_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp index 799661839b..e6a4da2f3c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp @@ -1,4 +1,5 @@ #include "lua_cocos2dx_physics_auto.hpp" +#if CC_USE_PHYSICS #include "cocos2d.h" #include "tolua_fix.h" #include "LuaBasicConversions.h" @@ -10943,3 +10944,4 @@ TOLUA_API int register_all_cocos2dx_physics(lua_State* tolua_S) return 1; } +#endif diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp index ac13735604..6ef0ca4ab5 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp @@ -1,3 +1,5 @@ +#include "base/ccConfig.h" +#if CC_USE_PHYSICS #ifndef __cocos2dx_physics_h__ #define __cocos2dx_physics_h__ @@ -258,6 +260,8 @@ int register_all_cocos2dx_physics(lua_State* tolua_S); + #endif // __cocos2dx_physics_h__ +#endif //#if CC_USE_PHYSICS diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.hpp index 8601fbf0f5..82266a8afb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.hpp @@ -1,3 +1,4 @@ +#include "base/ccConfig.h" #ifndef __cocos2dx_spine_h__ #define __cocos2dx_spine_h__ @@ -23,4 +24,5 @@ int register_all_cocos2dx_spine(lua_State* tolua_S); + #endif // __cocos2dx_spine_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp index 82c1e824ea..a97498c0c3 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.hpp @@ -1,3 +1,4 @@ +#include "base/ccConfig.h" #ifndef __cocos2dx_studio_h__ #define __cocos2dx_studio_h__ @@ -490,6 +491,7 @@ int register_all_cocos2dx_studio(lua_State* tolua_S); + #endif // __cocos2dx_studio_h__ diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp index abb0672abd..a894093755 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.hpp @@ -1,3 +1,4 @@ +#include "base/ccConfig.h" #ifndef __cocos2dx_ui_h__ #define __cocos2dx_ui_h__ @@ -394,6 +395,7 @@ int register_all_cocos2dx_ui(lua_State* tolua_S); + #endif // __cocos2dx_ui_h__ diff --git a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp index ff19c31618..d8fc0cf0d6 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -46,9 +46,14 @@ extern "C" { #include "platform/android/CCLuaJavaBridge.h" #endif +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) +#include "platform/android/CCLuaJavaBridge.h" +#endif + #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #include "Lua_web_socket.h" #endif + #include "LuaOpengl.h" #include "LuaScriptHandlerMgr.h" #include "lua_cocos2dx_auto.hpp" @@ -66,6 +71,8 @@ extern "C" { #include "lua_cocos2dx_physics_manual.hpp" #include "lua_cocos2dx_ui_auto.hpp" #include "lua_cocos2dx_ui_manual.hpp" +#include "lua_cocos2dx_experimental_video_auto.hpp" +#include "lua_cocos2dx_experimental_video_manual.hpp" namespace { int lua_print(lua_State * luastate) @@ -160,6 +167,7 @@ bool LuaStack::init(void) register_all_cocos2dx_ui(_state); register_all_cocos2dx_studio(_state); register_all_cocos2dx_manual(_state); + register_all_cocos2dx_module_manual(_state); register_all_cocos2dx_extension_manual(_state); register_all_cocos2dx_coco_studio_manual(_state); register_all_cocos2dx_ui_manual(_state); @@ -170,10 +178,16 @@ bool LuaStack::init(void) register_all_cocos2dx_physics(_state); register_all_cocos2dx_physics_manual(_state); #endif + #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaObjcBridge::luaopen_luaoc(_state); #endif +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + register_all_cocos2dx_experimental_video(_state); + register_all_cocos2dx_experimental_video_manual(_state); +#endif + #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) LuaJavaBridge::luaopen_luaj(_state); #endif @@ -493,86 +507,92 @@ int LuaStack::reallocateScriptHandler(int nHandler) int LuaStack::executeFunctionReturnArray(int handler,int numArgs,int numResults,__Array& resultArray) { + int top = lua_gettop(_state); if (pushFunctionByHandler(handler)) /* L: ... arg1 arg2 ... func */ { if (numArgs > 0) { lua_insert(_state, -(numArgs + 1)); /* L: ... func arg1 arg2 ... */ - int functionIndex = -(numArgs + 1); - if (!lua_isfunction(_state, functionIndex)) + } + int functionIndex = -(numArgs + 1); + if (!lua_isfunction(_state, functionIndex)) + { + CCLOG("value at stack [%d] is not function", functionIndex); + lua_pop(_state, numArgs + 1); // remove function and arguments + lua_settop(_state,top); + return 0; + } + + int traceback = 0; + lua_getglobal(_state, "__G__TRACKBACK__"); /* L: ... func arg1 arg2 ... G */ + if (!lua_isfunction(_state, -1)) + { + lua_pop(_state, 1); /* L: ... func arg1 arg2 ... */ + } + else + { + lua_insert(_state, functionIndex - 1); /* L: ... G func arg1 arg2 ... */ + traceback = functionIndex - 1; + } + + int error = 0; + ++_callFromLua; + error = lua_pcall(_state, numArgs, numResults, traceback); /* L: ... [G] ret1 ret2 ... retResults*/ + --_callFromLua; + if (error) + { + if (traceback == 0) { - CCLOG("value at stack [%d] is not function", functionIndex); - lua_pop(_state, numArgs + 1); // remove function and arguments - return 0; + CCLOG("[LUA ERROR] %s", lua_tostring(_state, - 1)); /* L: ... error */ + lua_pop(_state, 1); // remove error message from stack } - - int traceback = 0; - lua_getglobal(_state, "__G__TRACKBACK__"); /* L: ... func arg1 arg2 ... G */ - if (!lua_isfunction(_state, -1)) + else /* L: ... G error */ { - lua_pop(_state, 1); /* L: ... func arg1 arg2 ... */ + lua_pop(_state, 2); // remove __G__TRACKBACK__ and error message from stack } - else - { - lua_insert(_state, functionIndex - 1); /* L: ... G func arg1 arg2 ... */ - traceback = functionIndex - 1; - } - - int error = 0; - ++_callFromLua; - error = lua_pcall(_state, numArgs, numResults, traceback); /* L: ... [G] ret1 ret2 ... retResults*/ - --_callFromLua; - if (error) - { - if (traceback == 0) - { - CCLOG("[LUA ERROR] %s", lua_tostring(_state, - 1)); /* L: ... error */ - lua_pop(_state, 1); // remove error message from stack - } - else /* L: ... G error */ - { - lua_pop(_state, 2); // remove __G__TRACKBACK__ and error message from stack - } - return 0; - } - - // get return value,don't pass LUA_MULTRET to numResults, - if (numResults <= 0) - return 0; - - for (int i = 0 ; i < numResults; i++) - { - if (lua_type(_state, -1) == LUA_TBOOLEAN) { - - bool value = lua_toboolean(_state, -1); - resultArray.addObject(Bool::create(value)) ; - - }else if (lua_type(_state, -1) == LUA_TNUMBER) { - - double value = lua_tonumber(_state, -1); - resultArray.addObject(Double::create(value)); - - }else if (lua_type(_state, -1) == LUA_TSTRING) { - - const char* value = lua_tostring(_state, -1); - resultArray.addObject(String::create(value)); - - }else{ - - resultArray.addObject(static_cast(tolua_tousertype(_state, -1, NULL))); - } - // remove return value from stack - lua_pop(_state, 1); /* L: ... [G] ret1 ret2 ... ret*/ - } - /* L: ... [G]*/ - - if (traceback) - { - lua_pop(_state, 1); // remove __G__TRACKBACK__ from stack /* L: ... */ + lua_settop(_state,top); + return 0; + } + + // get return value,don't pass LUA_MULTRET to numResults, + if (numResults <= 0) + { + lua_settop(_state,top); + return 0; + } + + for (int i = 0 ; i < numResults; i++) + { + if (lua_type(_state, -1) == LUA_TBOOLEAN) { + + bool value = lua_toboolean(_state, -1); + resultArray.addObject(Bool::create(value)) ; + + }else if (lua_type(_state, -1) == LUA_TNUMBER) { + + double value = lua_tonumber(_state, -1); + resultArray.addObject(Double::create(value)); + + }else if (lua_type(_state, -1) == LUA_TSTRING) { + + const char* value = lua_tostring(_state, -1); + resultArray.addObject(String::create(value)); + + }else{ + + resultArray.addObject(static_cast(tolua_tousertype(_state, -1, NULL))); } + // remove return value from stack + lua_pop(_state, 1); /* L: ... [G] ret1 ret2 ... ret*/ + } + /* L: ... [G]*/ + + if (traceback) + { + lua_pop(_state, 1); // remove __G__TRACKBACK__ from stack /* L: ... */ } } - lua_settop(_state, 0); + lua_settop(_state,top); return 1; } diff --git a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp index 2b5aba203b..8d7e5c100b 100644 --- a/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaOpengl.cpp @@ -2604,7 +2604,7 @@ static int tolua_Cocos2d_glLineWidth00(lua_State* tolua_S) #endif { float arg0 = (float)tolua_tonumber(tolua_S, 1, 0); - glLineWidth((GLfloat)arg0 ); + glLineWidth(arg0); } return 0; #ifndef TOLUA_RELEASE @@ -2684,9 +2684,9 @@ static int tolua_Cocos2d_glPolygonOffset00(lua_State* tolua_S) else #endif { - int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - glPolygonOffset((GLfloat)arg0 , (GLfloat)arg1 ); + float arg0 = (float)tolua_tonumber(tolua_S, 1, 0); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + glPolygonOffset(arg0, arg1); } return 0; #ifndef TOLUA_RELEASE @@ -3165,7 +3165,7 @@ static int tolua_Cocos2d_glTexParameterf00(lua_State* tolua_S) { unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0); unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); glTexParameterf((GLenum)arg0 , (GLenum)arg1 , (GLfloat)arg2 ); } return 0; @@ -3287,8 +3287,8 @@ static int tolua_Cocos2d_glUniform1f00(lua_State* tolua_S) #endif { int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - glUniform1f((GLint)arg0 , (GLfloat)arg1 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + glUniform1f(arg0,arg1); } return 0; #ifndef TOLUA_RELEASE @@ -3426,9 +3426,9 @@ static int tolua_Cocos2d_glUniform2f00(lua_State* tolua_S) #endif { int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - glUniform2f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2); + float arg1 = (int)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (int)tolua_tonumber(tolua_S, 3, 0); + glUniform2f(arg0, arg1, arg2); } return 0; #ifndef TOLUA_RELEASE @@ -3569,10 +3569,10 @@ static int tolua_Cocos2d_glUniform3f00(lua_State* tolua_S) #endif { int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - int arg3 = (int)tolua_tonumber(tolua_S, 4, 0); - glUniform3f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); + float arg3 = (float)tolua_tonumber(tolua_S, 4, 0); + glUniform3f(arg0, arg1, arg2, arg3); } return 0; #ifndef TOLUA_RELEASE @@ -3716,11 +3716,11 @@ static int tolua_Cocos2d_glUniform4f00(lua_State* tolua_S) #endif { int arg0 = (int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - int arg3 = (int)tolua_tonumber(tolua_S, 4, 0); - int arg4 = (int)tolua_tonumber(tolua_S, 5, 0); - glUniform4f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); + float arg3 = (float)tolua_tonumber(tolua_S, 4, 0); + float arg4 = (float)tolua_tonumber(tolua_S, 5, 0); + glUniform4f(arg0 , arg1, arg2, arg3, arg4); } return 0; #ifndef TOLUA_RELEASE @@ -4042,8 +4042,8 @@ static int tolua_Cocos2d_glVertexAttrib1f00(lua_State* tolua_S) #endif { unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - glVertexAttrib1f((GLuint)arg0 , (GLfloat)arg1 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + glVertexAttrib1f(arg0 , arg1); } return 0; #ifndef TOLUA_RELEASE @@ -4113,9 +4113,9 @@ static int tolua_Cocos2d_glVertexAttrib2f00(lua_State* tolua_S) #endif { unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - glVertexAttrib2f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); + glVertexAttrib2f(arg0, arg1, arg2); } return 0; #ifndef TOLUA_RELEASE @@ -4186,10 +4186,10 @@ static int tolua_Cocos2d_glVertexAttrib3f00(lua_State* tolua_S) #endif { unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - int arg3 = (int)tolua_tonumber(tolua_S, 4, 0); - glVertexAttrib3f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); + float arg3 = (float)tolua_tonumber(tolua_S, 4, 0); + glVertexAttrib3f(arg0 , arg1, arg2, arg3); } return 0; #ifndef TOLUA_RELEASE @@ -4261,11 +4261,11 @@ static int tolua_Cocos2d_glVertexAttrib4f00(lua_State* tolua_S) #endif { unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0); - int arg1 = (int)tolua_tonumber(tolua_S, 2, 0); - int arg2 = (int)tolua_tonumber(tolua_S, 3, 0); - int arg3 = (int)tolua_tonumber(tolua_S, 4, 0); - int arg4 = (int)tolua_tonumber(tolua_S, 5, 0); - glVertexAttrib4f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4 ); + float arg1 = (float)tolua_tonumber(tolua_S, 2, 0); + float arg2 = (float)tolua_tonumber(tolua_S, 3, 0); + float arg3 = (float)tolua_tonumber(tolua_S, 4, 0); + float arg4 = (float)tolua_tonumber(tolua_S, 5, 0); + glVertexAttrib4f(arg0, arg1, arg2, arg3, arg4); } return 0; #ifndef TOLUA_RELEASE @@ -5031,10 +5031,10 @@ static int tolua_cocos2d_DrawPrimitives_drawColor4F00(lua_State* tolua_S) else #endif { - unsigned char r = (( unsigned char) tolua_tonumber(tolua_S,1,0)); - unsigned char g = (( unsigned char) tolua_tonumber(tolua_S,2,0)); - unsigned char b = (( unsigned char) tolua_tonumber(tolua_S,3,0)); - unsigned char a = (( unsigned char) tolua_tonumber(tolua_S,4,0)); + float r = (float)tolua_tonumber(tolua_S,1,0); + float g = (float)tolua_tonumber(tolua_S,2,0); + float b = (float)tolua_tonumber(tolua_S,3,0); + float a = (float)tolua_tonumber(tolua_S,4,0); DrawPrimitives::setDrawColor4F(r,g,b,a); } return 0; diff --git a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h index afe3017b63..27c1473adb 100644 --- a/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h +++ b/cocos/scripting/lua-bindings/manual/LuaScriptHandlerMgr.h @@ -163,6 +163,13 @@ public: EVENT_FOCUS, + EVENT_CONTROLLER_CONNECTED, + EVENT_CONTROLLER_DISCONNECTED, + EVENT_CONTROLLER_KEYDOWN, + EVENT_CONTROLLER_KEYUP, + EVENT_CONTROLLER_KEYREPEAT, + EVENT_CONTROLLER_AXIS, + EVENT_CUSTOM_BEGAN = 10000, EVENT_CUSTOM_ENDED = 11000, }; diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.cpp index a16eec37f0..5291ac5a92 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.cpp @@ -176,7 +176,7 @@ static int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L) ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - self->setFrameEventCallFunc([=](Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){ + self->setFrameEventCallFunc([=](cocostudio::Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){ if (0 != handler) { diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp new file mode 100644 index 0000000000..b5885874e9 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp @@ -0,0 +1,373 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + 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 "lua_cocos2dx_controller_manual.hpp" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#include "cocos2d.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" +#include "LuaScriptHandlerMgr.h" +#include "CCLuaValue.h" +#include "CCLuaEngine.h" +#include "CCGameController.h" + + +static void cloneEventListenerControllerHandler(const cocos2d::EventListenerController* src,cocos2d::EventListenerController* dst, ScriptHandlerMgr::HandlerType type) +{ + if (nullptr == src || nullptr == dst) + return; + + LUA_FUNCTION handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)src, type); + if (0 != handler) + { + int newscriptHandler = ScriptEngineManager::getInstance()->getScriptEngine()->reallocateScriptHandler(handler); + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)dst, newscriptHandler, type); + switch (type) + { + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_CONNECTED: + { + dst->onConnected = [=](cocos2d::Controller* controller, Event* event){ + + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_DISCONNECTED: + { + dst->onDisconnected = [=](cocos2d::Controller* controller, Event* event){ + + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYDOWN: + { + dst->onKeyDown = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYUP: + { + dst->onKeyUp = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYREPEAT: + { + dst->onKeyRepeat = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_AXIS: + { + dst->onAxisEvent = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + }; + } + break; + default: + break; + } + } +} + +static int tolua_cocos2dx_EventListenerController_clone(lua_State* tolua_S) +{ + if (nullptr == tolua_S) + return 0; + + int argc = 0; + cocos2d::EventListenerController* self = nullptr; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "cc.EventListenerController", 0, &tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(tolua_S,1,0)); +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2dx_EventListenerController_clone'\n", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 0) + { + cocos2d::EventListenerController* tolua_ret = cocos2d::EventListenerController::create(); + if(nullptr == tolua_ret) + return 0; + + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_CONNECTED); + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_DISCONNECTED); + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYDOWN); + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYUP); + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYREPEAT); + cloneEventListenerControllerHandler(self, tolua_ret, ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_AXIS); + + int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,"cc.EventListenerController"); + + return 1; + } + + CCLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'clone'.",&tolua_err); + return 0; +#endif +} + +static int tolua_cocos2dx_EventListenerController_registerScriptHandler(lua_State* tolua_S) +{ + if (nullptr == tolua_S) + return 0; + + int argc = 0; + cocos2d::EventListenerController* self = nullptr; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "cc.EventListenerController", 0, &tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(tolua_S,1,0)); +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2dx_EventListenerController_registerScriptHandler'\n", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S) - 1; + + if (argc == 2) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err) || + !tolua_isnumber(tolua_S, 3, 0, &tolua_err)) + { + goto tolua_lerror; + } +#endif + LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0); + ScriptHandlerMgr::HandlerType type = static_cast((int)tolua_tonumber(tolua_S, 3, 0)); + + switch (type) + { + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_CONNECTED: + { + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onConnected = [=](cocos2d::Controller* controller, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_DISCONNECTED: + { + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onDisconnected = [=](cocos2d::Controller* controller, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYDOWN: + { + + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onKeyDown = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + tolua_pushnumber(tolua_S, (lua_Number) keyCode); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 3); + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYUP: + { + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onKeyUp = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + tolua_pushnumber(tolua_S, (lua_Number) keyCode); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 3); + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_KEYREPEAT: + { + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onKeyRepeat = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + tolua_pushnumber(tolua_S, (lua_Number) keyCode); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 3); + }; + } + break; + case ScriptHandlerMgr::HandlerType::EVENT_CONTROLLER_AXIS: + { + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type); + + self->onAxisEvent = [=](cocos2d::Controller* controller, int keyCode, Event* event){ + tolua_pushusertype(tolua_S, (void*)controller, "cc.Controller"); + tolua_pushnumber(tolua_S, (lua_Number) keyCode); + int ID = (event) ? (int)event->_ID : -1; + int* luaID = (event) ? &event->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)event,"cc.event"); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 3); + }; + } + break; + default: + break; + } + return 0; + } + + CCLOG("'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\n", argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'registerScriptHandler'.",&tolua_err); + return 0; +#endif +} + + +static void extendEventListenerController(lua_State* L) +{ + lua_pushstring(L, "cc.EventListenerController"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "clone", tolua_cocos2dx_EventListenerController_clone); + tolua_function(L, "registerScriptHandler", tolua_cocos2dx_EventListenerController_registerScriptHandler); + } + lua_pop(L, 1); +} + +static int tolua_cocos2dx_Controller_getKeyStatus(lua_State* tolua_S) +{ + if (nullptr == tolua_S) + return 0; + + int argc = 0; + cocos2d::Controller* self = nullptr; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "cc.Controller", 0, &tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(tolua_S,1,0)); +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2dx_Controller_getKeyStatus'\n", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err)) + goto tolua_lerror; +#endif + int keyCode = (int)tolua_tonumber(tolua_S, 2, 0); + cocos2d::Controller::KeyStatus keyStatus = self->getKeyStatus(keyCode); + + lua_newtable(tolua_S); /* L: table */ + lua_pushstring(tolua_S, "isPressed"); /* L: table key */ + lua_pushboolean(tolua_S, (int)keyStatus.isPressed); /* L: table key value*/ + lua_rawset(tolua_S, -3); /* table[key] = value, L: table */ + lua_pushstring(tolua_S, "value"); /* L: table key */ + lua_pushnumber(tolua_S, (lua_Number) keyStatus.value); /* L: table key value*/ + lua_rawset(tolua_S, -3); /* table[key] = value, L: table */ + lua_pushstring(tolua_S, "isAnalog"); /* L: table key */ + lua_pushnumber(tolua_S, (int) keyStatus.isAnalog); /* L: table key value*/ + lua_rawset(tolua_S, -3); /* table[key] = value, L: table */ + + return 1; + } + + CCLOG("'clone' has wrong number of arguments: %d, was expecting %d\n", argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'getKeyStatus'.",&tolua_err); + return 0; +#endif +} + +static void extendController(lua_State* L) +{ + lua_pushstring(L, "cc.Controller"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "getKeyStatus", tolua_cocos2dx_Controller_getKeyStatus); + } + lua_pop(L, 1); +} + + +int register_all_cocos2dx_controller_manual(lua_State* L) +{ + if (nullptr == L) + return 0; + + extendEventListenerController(L); + extendController(L); + + return 0; +} + +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/base/CCControllerAxisInput.h b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp similarity index 63% rename from cocos/base/CCControllerAxisInput.h rename to cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp index 2f6298b95b..7d44970ea0 100644 --- a/cocos/base/CCControllerAxisInput.h +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp @@ -1,6 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,34 +21,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CONTROLLER_MANUAL_H +#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CONTROLLER_MANUAL_H -#ifndef __cocos2d_libs__CCControllerAxisInput__ -#define __cocos2d_libs__CCControllerAxisInput__ +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus +} +#endif -#include "CCPlatformMacros.h" -#include "CCControllerElement.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -NS_CC_BEGIN +TOLUA_API int register_all_cocos2dx_controller_manual(lua_State* L); -class ControllerAxisInput : public ControllerElement -{ -public: - float getValue() const; +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -protected: - ControllerAxisInput(); - virtual ~ControllerAxisInput(); - - void setValue(float value); - - float _value; - - friend class Controller; - friend class ControllerImpl; - friend class ControllerDirectionPad; - friend class ControllerThumbstick; -}; - -NS_CC_END - -#endif /* defined(__cocos2d_libs__CCControllerAxisInput__) */ +#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CONTROLLER_MANUAL_H diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp new file mode 100644 index 0000000000..9b144fa828 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp @@ -0,0 +1,87 @@ +#include "lua_cocos2dx_experimental_video_manual.hpp" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#include "UIVideoPlayer.h" +#include "tolua_fix.h" +#include "LuaBasicConversions.h" +#include "CCLuaValue.h" +#include "CCLuaEngine.h" + + + +static int lua_cocos2dx_experimental_video_VideoPlayer_addEventListener(lua_State* L) +{ + + int argc = 0; + cocos2d::experimental::ui::VideoPlayer* self = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"ccexp.VideoPlayer",0,&tolua_err)) goto tolua_lerror; +#endif + + self = static_cast(tolua_tousertype(L,1,0)); + +#if COCOS2D_DEBUG >= 1 + if (nullptr == self) { + tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\n", nullptr); + return 0; + } +#endif + + argc = lua_gettop(L) - 1; + + if (argc == 1) + { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + + LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + + self->addEventListener([=](cocos2d::Ref* ref, cocos2d::experimental::ui::VideoPlayer::EventType eventType){ + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + + stack->pushObject(ref, "cc.Ref"); + stack->pushInt((int)eventType); + + stack->executeFunctionByHandler(handler, 2); + }); + + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "addEventListener",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(L, "#ferror in function 'lua_cocos2dx_experimental_VideoPlayer_addEventListener'.", &tolua_err); +#endif + return 0; +} + +static void extendVideoPlayer(lua_State* L) +{ + lua_pushstring(L, "ccexp.VideoPlayer"); + lua_rawget(L, LUA_REGISTRYINDEX); + if (lua_istable(L,-1)) + { + tolua_function(L, "addEventListener", lua_cocos2dx_experimental_video_VideoPlayer_addEventListener); + } + lua_pop(L, 1); +} + +int register_all_cocos2dx_experimental_video_manual(lua_State* L) +{ + if (nullptr == L) + return 0; + + extendVideoPlayer(L); + + return 0; +} + +#endif diff --git a/cocos/base/CCControllerButtonInput.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp similarity index 62% rename from cocos/base/CCControllerButtonInput.cpp rename to cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp index f234df1974..fa4072a24e 100644 --- a/cocos/base/CCControllerButtonInput.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp @@ -1,6 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -22,48 +21,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ +#include "base/ccConfig.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) -#include "CCControllerButtonInput.h" +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H +#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H -NS_CC_BEGIN - -ControllerButtonInput::ControllerButtonInput() -: _value(0.0f) -, _isPressed(false) -, _isPrevStatusPressed(false) -{ - +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua++.h" +#ifdef __cplusplus } +#endif -ControllerButtonInput::~ControllerButtonInput() -{ - -} +TOLUA_API int register_all_cocos2dx_experimental_video_manual(lua_State* L); -float ControllerButtonInput::getValue() const -{ - return _value; -} - -bool ControllerButtonInput::isPressed() const -{ - return _isPressed; -} - -bool ControllerButtonInput::isPrevStatusPressed() const -{ - return _isPrevStatusPressed; -} - -void ControllerButtonInput::setValue(float value) -{ - _value = value; -} - -void ControllerButtonInput::setPressed(bool isPressed) -{ - _isPrevStatusPressed = _isPressed; - _isPressed = isPressed; -} - -NS_CC_END \ No newline at end of file +#endif // COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_EXPERIMENTAL_VIDEO_MANUAL_H +#endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index edee61b00e..c19e2b77c3 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -2215,6 +2215,66 @@ tolua_lerror: #endif } +static int lua_cocos2dx_Node_enumerateChildren(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node_enumerateChildren'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { +#if COCOS2D_DEBUG >= 1 + if (!tolua_isstring(tolua_S, 2, 0, &tolua_err) || + !toluafix_isfunction(tolua_S,3,"LUA_FUNCTION",0,&tolua_err)) + { + goto tolua_lerror; + } +#endif + + std::string name = (std::string)tolua_tocppstring(tolua_S,2,0); + LUA_FUNCTION handler = toluafix_ref_function(tolua_S,3,0); + + cobj->enumerateChildren(name, [=](Node* node)->bool{ + int id = node ? (int)node->_ID : -1; + int* luaID = node ? &node->_luaID : nullptr; + toluafix_pushusertype_ccobject(tolua_S, id, luaID, (void*)node,"cc.Node"); + bool ret = LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + LuaEngine::getInstance()->removeScriptHandler(handler); + return ret; + }); + + return 0; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "enumerateChildren",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node_enumerateChildren'.",&tolua_err); +#endif + + return 0; +} + static int tolua_cocos2d_Spawn_create(lua_State* tolua_S) { if (NULL == tolua_S) @@ -3920,6 +3980,9 @@ static void extendNode(lua_State* tolua_S) lua_pushstring(tolua_S, "setAnchorPoint"); lua_pushcfunction(tolua_S, tolua_cocos2d_Node_setAnchorPoint); lua_rawset(tolua_S, -3); + lua_pushstring(tolua_S, "enumerateChildren"); + lua_pushcfunction(tolua_S, lua_cocos2dx_Node_enumerateChildren); + lua_rawset(tolua_S, -3); } lua_pop(tolua_S, 1); } @@ -6373,6 +6436,80 @@ static void extendApplication(lua_State* tolua_S) lua_pop(tolua_S, 1); } +static int lua_cocos2dx_FastTMXLayer_getTileGIDAt(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::FastTMXLayer* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S,1,"cc.FastTMXLayer",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::FastTMXLayer*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_FastTMXLayer_getTileGIDAt'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + cocos2d::Vec2 arg0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + if(!ok) + return 0; + int ret = cobj->getTileGIDAt(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + if (argc == 2) + { + cocos2d::Vec2 arg0; + int arg1 = 0; + + ok &= luaval_to_vec2(tolua_S, 2, &arg0); + ok &= luaval_to_int32(tolua_S, 3, &arg1); + + if(!ok) + return 0; + + unsigned int ret = cobj->getTileGIDAt(arg0, (cocos2d::TMXTileFlags*)&arg1); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getTileGIDAt",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_FastTMXLayer_getTileGIDAt'.",&tolua_err); +#endif + + return 0; +} + +static void extendFastTMXLayer(lua_State* tolua_S) +{ + lua_pushstring(tolua_S, "cc.FastTMXLayer"); + lua_rawget(tolua_S, LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "getTileGIDAt", lua_cocos2dx_FastTMXLayer_getTileGIDAt); + } + lua_pop(tolua_S, 1); +} + int register_all_cocos2dx_manual(lua_State* tolua_S) { if (NULL == tolua_S) @@ -6426,6 +6563,94 @@ int register_all_cocos2dx_manual(lua_State* tolua_S) extendTMXLayer(tolua_S); extendEventListenerFocus(tolua_S); extendApplication(tolua_S); + extendFastTMXLayer(tolua_S); + + return 0; +} + +static int tolua_cocos2d_utils_captureScreen(lua_State* tolua_S) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_istable(tolua_S,1,0, &tolua_err) || + !toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err) || + !tolua_isstring(tolua_S, 3, 0, &tolua_err) + ) + goto tolua_lerror; + else +#endif + { + LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0); + std::string fileName = tolua_tocppstring(tolua_S, 3, ""); + cocos2d::utils::captureScreen([=](bool succeed, const std::string& name ){ + + tolua_pushboolean(tolua_S, succeed); + tolua_pushstring(tolua_S, name.c_str()); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); + LuaEngine::getInstance()->removeScriptHandler(handler); + }, fileName); + + return 0; + } +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'captureScreen'.",&tolua_err); + return 0; +#endif +} + +static int tolua_cocos2d_utils_findChildren(lua_State* tolua_S) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_istable(tolua_S,1,0, &tolua_err) || + !tolua_isusertype(tolua_S, 2, "cc.Node", 0, &tolua_err) || + !tolua_isstring(tolua_S, 3, 0, &tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cocos2d::Node* node = static_cast(tolua_tousertype(tolua_S, 2, nullptr)); + std::string name = tolua_tocppstring(tolua_S, 3, ""); + std::vector children = cocos2d::utils::findChildren(*node, name); + lua_newtable(tolua_S); + int index = 1; + for (const auto& obj : children) + { + if (nullptr == obj) + continue; + + lua_pushnumber(tolua_S, (lua_Number)index); + int ID = (obj) ? (int)obj->_ID : -1; + int* luaID = (obj) ? &obj->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)obj, "cc.Node"); + lua_rawset(tolua_S, -3); + ++index; + } + return 1; + } +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'findChildren'.",&tolua_err); + return 0; +#endif +} + +int register_all_cocos2dx_module_manual(lua_State* tolua_S) +{ + if (nullptr == tolua_S) + return 0; + + tolua_open(tolua_S); + tolua_module(tolua_S, "cc", 0); + tolua_beginmodule(tolua_S, "cc"); + tolua_module(tolua_S, "utils", 0); + tolua_beginmodule(tolua_S,"utils"); + tolua_function(tolua_S, "captureScreen", tolua_cocos2d_utils_captureScreen); + tolua_function(tolua_S, "findChildren", tolua_cocos2d_utils_findChildren); + tolua_endmodule(tolua_S); + tolua_endmodule(tolua_S); return 0; } diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.hpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.hpp index d8dae90200..814b25578c 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.hpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.hpp @@ -55,6 +55,8 @@ TOLUA_API int register_all_cocos2dx_manual(lua_State* tolua_S); TOLUA_API int register_cocos2dx_event_releated(lua_State* tolua_S); +TOLUA_API int register_all_cocos2dx_module_manual(lua_State* tolua_S); + struct LuaEventAccelerationData { void* acc; diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index afa4c1df66..8306a270c4 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -19,6 +19,10 @@ 1540AF58193EC30500717D8E /* xxtea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1540AF55193EC30500717D8E /* xxtea.cpp */; }; 1540AF59193EC30500717D8E /* xxtea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1540AF56193EC30500717D8E /* xxtea.h */; }; 1540AF5A193EC30500717D8E /* xxtea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1540AF56193EC30500717D8E /* xxtea.h */; }; + 15AECE12195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */; }; + 15AECE13195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */; }; + 15AECE16195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */; }; + 15AECE17195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */; }; 1A262AB818BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; 1A262AB918BEEF5900D2DB92 /* tolua_fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */; }; 1AACE7B518BC45C200215002 /* lua_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */; }; @@ -220,6 +224,10 @@ 1503FAA018DA8A1C00F6518C /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = ""; }; 1540AF55193EC30500717D8E /* xxtea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xxtea.cpp; sourceTree = ""; }; 1540AF56193EC30500717D8E /* xxtea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxtea.h; sourceTree = ""; }; + 15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_auto.cpp; sourceTree = ""; }; + 15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_auto.hpp; sourceTree = ""; }; + 15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_experimental_video_manual.cpp; sourceTree = ""; }; + 15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_experimental_video_manual.hpp; sourceTree = ""; }; 1A262AB718BEEF5900D2DB92 /* tolua_fix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tolua_fix.cpp; sourceTree = ""; }; 1AACE74618BC45A000215002 /* libluabindings Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings Mac.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 1AACE74718BC45A000215002 /* libluabindings iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libluabindings iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -365,6 +373,8 @@ 1AACE74818BC45C200215002 /* auto */ = { isa = PBXGroup; children = ( + 15AECE10195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp */, + 15AECE11195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp */, 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */, 2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */, 1AACE74918BC45C200215002 /* lua_cocos2dx_auto.cpp */, @@ -385,6 +395,8 @@ 1AACE75B18BC45C200215002 /* manual */ = { isa = PBXGroup; children = ( + 15AECE14195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp */, + 15AECE15195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp */, 2905FAD418CF143800240AA3 /* lua_cocos2dx_ui_manual.cpp */, 2905FAD518CF143800240AA3 /* lua_cocos2dx_ui_manual.hpp */, 1AACE75E18BC45C200215002 /* CCBProxy.cpp */, @@ -611,8 +623,10 @@ 1ABCA1ED18CD8F470087CE3A /* lua.h in Headers */, 1AACE7F418BC45C200215002 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */, 1ABCA26818CD8F7D0087CE3A /* udp.h in Headers */, + 15AECE17195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.hpp in Headers */, 1ABCA25418CD8F7D0087CE3A /* select.h in Headers */, 1AACE7D618BC45C200215002 /* lua_cocos2dx_studio_auto.hpp in Headers */, + 15AECE13195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -752,9 +766,11 @@ 1AACE81E18BC45C200215002 /* LuaOpengl.cpp in Sources */, 1AACE7CE18BC45C200215002 /* lua_cocos2dx_spine_auto.cpp in Sources */, 1AACE80218BC45C200215002 /* lua_cocos2dx_manual.cpp in Sources */, + 15AECE16195C28DF00907DB0 /* lua_cocos2dx_experimental_video_manual.cpp in Sources */, 1ABCA23E18CD8F7D0087CE3A /* luasocket.c in Sources */, 1ABCA25218CD8F7D0087CE3A /* select.c in Sources */, 1ABCA24A18CD8F7D0087CE3A /* mime.c in Sources */, + 15AECE12195C277100907DB0 /* lua_cocos2dx_experimental_video_auto.cpp in Sources */, 1540AF58193EC30500717D8E /* xxtea.cpp in Sources */, 1ABCA26218CD8F7D0087CE3A /* timeout.c in Sources */, 1503FAA618DA8A1C00F6518C /* io.c in Sources */, diff --git a/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua b/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua index 059cccc32c..efcac61305 100644 --- a/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua +++ b/cocos/scripting/lua-bindings/script/Cocos2dConstants.lua @@ -349,6 +349,14 @@ cc.Handler.EVENT_PHYSICS_CONTACT_BEGIN = 53 cc.Handler.EVENT_PHYSICS_CONTACT_PRESOLVE = 54 cc.Handler.EVENT_PHYSICS_CONTACT_POSTSOLVE = 55 cc.Handler.EVENT_PHYSICS_CONTACT_SEPERATE = 56 +cc.Handler.EVENT_FOCUS = 57 +cc.Handler.EVENT_CONTROLLER_CONNECTED = 58 +cc.Handler.EVENT_CONTROLLER_DISCONNECTED = 59 +cc.Handler.EVENT_CONTROLLER_KEYDOWN = 60 +cc.Handler.EVENT_CONTROLLER_KEYUP = 61 +cc.Handler.EVENT_CONTROLLER_KEYREPEAT = 62 +cc.Handler.EVENT_CONTROLLER_AXIS = 63 + cc.EVENT_UNKNOWN = 0 cc.EVENT_TOUCH_ONE_BY_ONE = 1 @@ -561,5 +569,46 @@ end cc.KeyCode.KEY_BACK = cc.KeyCode.KEY_ESCAPE +cc.EventCode = +{ + BEGAN = 0, + MOVED = 1, + ENDED = 2, + CANCELLED = 3, +} +cc.ControllerKey = +{ + JOYSTICK_LEFT_X = 1000, + JOYSTICK_LEFT_Y = 1001, + JOYSTICK_RIGHT_X = 1002, + JOYSTICK_RIGHT_Y = 1003, + BUTTON_A = 1004, + BUTTON_B = 1005, + BUTTON_C = 1006, + BUTTON_X = 1007, + BUTTON_Y = 1008, + BUTTON_Z = 1009, + + BUTTON_DPAD_UP = 1010, + BUTTON_DPAD_DOWN = 1011, + BUTTON_DPAD_LEFT = 1012, + BUTTON_DPAD_RIGHT = 1013, + BUTTON_DPAD_CENTER = 1014, + + BUTTON_LEFT_SHOULDER = 1015, + BUTTON_RIGHT_SHOULDER = 1016, + + AXIS_LEFT_TRIGGER = 1017, + AXIS_RIGHT_TRIGGER = 1018, + + BUTTON_LEFT_THUMBSTICK = 1019, + BUTTON_RIGHT_THUMBSTICK = 1020, + + BUTTON_START = 1021, + BUTTON_SELECT = 1022, + + BUTTON_PAUSE = 1023, + KEY_MAX = 1024, +} diff --git a/cocos/scripting/lua-bindings/script/experimentalConstants.lua b/cocos/scripting/lua-bindings/script/experimentalConstants.lua new file mode 100644 index 0000000000..9fea50ca3b --- /dev/null +++ b/cocos/scripting/lua-bindings/script/experimentalConstants.lua @@ -0,0 +1,9 @@ +ccexprimental = ccexprimental or {} + + +ccexprimental.VideoPlayerEvent = { + PLAYING = 0, + PAUSED = 1, + STOPPED= 2, + COMPLETED =3, +} diff --git a/cocos/storage/local-storage/LocalStorage.cpp b/cocos/storage/local-storage/LocalStorage.cpp index 3c485fa226..f925b12d71 100644 --- a/cocos/storage/local-storage/LocalStorage.cpp +++ b/cocos/storage/local-storage/LocalStorage.cpp @@ -48,7 +48,7 @@ static void localStorageCreateTable() { const char *sql_createtable = "CREATE TABLE IF NOT EXISTS data(key TEXT PRIMARY KEY,value TEXT);"; sqlite3_stmt *stmt; - int ok=sqlite3_prepare_v2(_db, sql_createtable, -1, &stmt, NULL); + int ok=sqlite3_prepare_v2(_db, sql_createtable, -1, &stmt, nullptr); ok |= sqlite3_step(stmt); ok |= sqlite3_finalize(stmt); @@ -71,15 +71,15 @@ void localStorageInit( const std::string& fullpath/* = "" */) // SELECT const char *sql_select = "SELECT value FROM data WHERE key=?;"; - ret |= sqlite3_prepare_v2(_db, sql_select, -1, &_stmt_select, NULL); + ret |= sqlite3_prepare_v2(_db, sql_select, -1, &_stmt_select, nullptr); // REPLACE const char *sql_update = "REPLACE INTO data (key, value) VALUES (?,?);"; - ret |= sqlite3_prepare_v2(_db, sql_update, -1, &_stmt_update, NULL); + ret |= sqlite3_prepare_v2(_db, sql_update, -1, &_stmt_update, nullptr); // DELETE const char *sql_remove = "DELETE FROM data WHERE key=?;"; - ret |= sqlite3_prepare_v2(_db, sql_remove, -1, &_stmt_remove, NULL); + ret |= sqlite3_prepare_v2(_db, sql_remove, -1, &_stmt_remove, nullptr); if( ret != SQLITE_OK ) { printf("Error initializing DB\n"); diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 39718575f3..6cfdbecc86 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -263,9 +263,6 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType) updateFlippedX(); updateFlippedY(); - _buttonNormalRenderer->setColor(this->getColor()); - _buttonNormalRenderer->setOpacity(this->getOpacity()); - updateContentSizeWithTextureSize(_normalTextureSize); _normalTextureLoaded = true; _normalTextureAdaptDirty = true; @@ -314,9 +311,6 @@ void Button::loadTexturePressed(const std::string& selected,TextureResType texTy updateFlippedX(); updateFlippedY(); - _buttonDisableRenderer->setColor(this->getColor()); - _buttonDisableRenderer->setOpacity(this->getOpacity()); - _pressedTextureLoaded = true; _pressedTextureAdaptDirty = true; } @@ -363,8 +357,6 @@ void Button::loadTextureDisabled(const std::string& disabled,TextureResType texT _disabledTextureSize = _buttonDisableRenderer->getContentSize(); updateFlippedX(); updateFlippedY(); - _buttonDisableRenderer->setColor(this->getColor()); - _buttonDisableRenderer->setOpacity(this->getOpacity()); _disabledTextureLoaded = true; _disabledTextureAdaptDirty = true; diff --git a/cocos/ui/UICheckBox.cpp b/cocos/ui/UICheckBox.cpp index 47b4e040bb..4ddb8799ab 100644 --- a/cocos/ui/UICheckBox.cpp +++ b/cocos/ui/UICheckBox.cpp @@ -184,8 +184,6 @@ void CheckBox::loadTextureBackGround(const std::string& backGround,TextureResTyp } updateFlippedX(); updateFlippedY(); - _backGroundBoxRenderer->setColor(this->getColor()); - _backGroundBoxRenderer->setOpacity(this->getOpacity()); updateContentSizeWithTextureSize(_backGroundBoxRenderer->getContentSize()); _backGroundBoxRendererAdaptDirty = true; @@ -212,8 +210,7 @@ void CheckBox::loadTextureBackGroundSelected(const std::string& backGroundSelect } updateFlippedX(); updateFlippedY(); - _backGroundSelectedBoxRenderer->setColor(this->getColor()); - _backGroundSelectedBoxRenderer->setOpacity(this->getOpacity()); + _backGroundSelectedBoxRendererAdaptDirty = true; } @@ -238,8 +235,7 @@ void CheckBox::loadTextureFrontCross(const std::string& cross,TextureResType tex } updateFlippedX(); updateFlippedY(); - _frontCrossRenderer->setColor(this->getColor()); - _frontCrossRenderer->setOpacity(this->getOpacity()); + _frontCrossRendererAdaptDirty = true; } @@ -264,8 +260,6 @@ void CheckBox::loadTextureBackGroundDisabled(const std::string& backGroundDisabl } updateFlippedX(); updateFlippedY(); - _backGroundBoxDisabledRenderer->setColor(this->getColor()); - _backGroundBoxDisabledRenderer->setOpacity(this->getOpacity()); _backGroundBoxDisabledRendererAdaptDirty = true; } @@ -291,8 +285,6 @@ void CheckBox::loadTextureFrontCrossDisabled(const std::string& frontCrossDisabl } updateFlippedX(); updateFlippedY(); - _frontCrossDisabledRenderer->setColor(this->getColor()); - _frontCrossDisabledRenderer->setOpacity(this->getOpacity()); _frontCrossDisabledRendererAdaptDirty = true; } diff --git a/cocos/ui/UICheckBox.h b/cocos/ui/UICheckBox.h index 05c77d836b..b1b6a28177 100644 --- a/cocos/ui/UICheckBox.h +++ b/cocos/ui/UICheckBox.h @@ -33,13 +33,13 @@ class Sprite; namespace ui { -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { CHECKBOX_STATE_EVENT_SELECTED, CHECKBOX_STATE_EVENT_UNSELECTED }CheckBoxEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType); +typedef void (Ref::*SEL_SelectedStateEvent)(Ref*,CheckBoxEventType); #define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR) /** diff --git a/cocos/ui/UIImageView.cpp b/cocos/ui/UIImageView.cpp index cfc5d76d62..6f3471e0b7 100644 --- a/cocos/ui/UIImageView.cpp +++ b/cocos/ui/UIImageView.cpp @@ -154,8 +154,6 @@ void ImageView::loadTexture(const std::string& fileName, TextureResType texType) _imageTextureSize = _imageRenderer->getContentSize(); updateFlippedX(); updateFlippedY(); - _imageRenderer->setColor(this->getColor()); - _imageRenderer->setOpacity(this->getOpacity()); updateContentSizeWithTextureSize(_imageTextureSize); _imageRendererAdaptDirty = true; diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index cf3f8acc7d..7064ec73d5 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -1648,7 +1648,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c if (direction == FocusDirection::LEFT) { if (index == 0) { - return true * isLastWidgetInContainer(parent, direction); + return isLastWidgetInContainer(parent, direction); } else { @@ -1658,7 +1658,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c if (direction == FocusDirection::RIGHT) { if (index == container.size()-1) { - return true * isLastWidgetInContainer(parent, direction); + return isLastWidgetInContainer(parent, direction); } else { @@ -1681,7 +1681,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c { if (index == 0) { - return true * isLastWidgetInContainer(parent, direction); + return isLastWidgetInContainer(parent, direction); } else @@ -1693,7 +1693,7 @@ bool Layout::isLastWidgetInContainer(Widget* widget, FocusDirection direction)c { if (index == container.size() - 1) { - return true * isLastWidgetInContainer(parent, direction); + return isLastWidgetInContainer(parent, direction); } else { diff --git a/cocos/ui/UIListView.h b/cocos/ui/UIListView.h index 42a4d5050d..2409bd3763 100644 --- a/cocos/ui/UIListView.h +++ b/cocos/ui/UIListView.h @@ -32,13 +32,13 @@ NS_CC_BEGIN namespace ui{ -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { LISTVIEW_ONSELECTEDITEM_START, LISTVIEW_ONSELECTEDITEM_END }ListViewEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_ListViewEvent)(Ref*,ListViewEventType); +typedef void (Ref::*SEL_ListViewEvent)(Ref*,ListViewEventType); #define listvieweventselector(_SELECTOR) (SEL_ListViewEvent)(&_SELECTOR) class ListView : public ScrollView diff --git a/cocos/ui/UILoadingBar.cpp b/cocos/ui/UILoadingBar.cpp index 6cc2f658f0..6e7e34415d 100644 --- a/cocos/ui/UILoadingBar.cpp +++ b/cocos/ui/UILoadingBar.cpp @@ -160,8 +160,6 @@ void LoadingBar::loadTexture(const std::string& texture,TextureResType texType) default: break; } - _barRenderer->setColor(this->getColor()); - _barRenderer->setOpacity(this->getOpacity()); _barRendererTextureSize = _barRenderer->getContentSize(); diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index 1e04e9168f..0dce9f9afa 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -134,7 +134,7 @@ void PageView::addPage(Layout* page) } - addProtectedChild(page); + addChild(page); _pages.pushBack(page); _doLayoutDirty = true; @@ -156,7 +156,7 @@ void PageView::insertPage(Layout* page, int idx) else { _pages.insert(idx, page); - addProtectedChild(page); + addChild(page); } @@ -169,7 +169,7 @@ void PageView::removePage(Layout* page) { return; } - removeProtectedChild(page); + removeChild(page); _pages.eraseObject(page); _doLayoutDirty = true; @@ -189,7 +189,7 @@ void PageView::removeAllPages() { for(const auto& node : _pages) { - removeProtectedChild(node); + removeChild(node); } _pages.clear(); } diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index f3544f0a47..70c764ee6a 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -31,12 +31,12 @@ NS_CC_BEGIN namespace ui { -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { PAGEVIEW_EVENT_TURNING, }PageViewEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_PageViewEvent)(Ref*, PageViewEventType); +typedef void (Ref::*SEL_PageViewEvent)(Ref*, PageViewEventType); #define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR) class PageView : public Layout diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index 1f4050039f..6bff82c007 100644 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -66,7 +66,7 @@ RichElementText* RichElementText::create(int tag, const Color3B &color, GLubyte return element; } CC_SAFE_DELETE(element); - return NULL; + return nullptr; } bool RichElementText::init(int tag, const Color3B &color, GLubyte opacity, const std::string& text, const std::string& fontName, float fontSize) @@ -90,7 +90,7 @@ RichElementImage* RichElementImage::create(int tag, const Color3B &color, GLubyt return element; } CC_SAFE_DELETE(element); - return NULL; + return nullptr; } bool RichElementImage::init(int tag, const Color3B &color, GLubyte opacity, const std::string& filePath) @@ -112,7 +112,7 @@ RichElementCustomNode* RichElementCustomNode::create(int tag, const Color3B &col return element; } CC_SAFE_DELETE(element); - return NULL; + return nullptr; } bool RichElementCustomNode::init(int tag, const Color3B &color, GLubyte opacity, cocos2d::Node *customNode) @@ -149,7 +149,7 @@ RichText* RichText::create() return widget; } CC_SAFE_DELETE(widget); - return NULL; + return nullptr; } bool RichText::init() @@ -204,7 +204,7 @@ void RichText::formatText() for (ssize_t i=0; i<_richElements.size(); i++) { RichElement* element = _richElements.at(i); - Node* elementRenderer = NULL; + Node* elementRenderer = nullptr; switch (element->_type) { case RichElement::Type::TEXT: diff --git a/cocos/ui/UIScrollView.h b/cocos/ui/UIScrollView.h index 39ec4dc8bd..c02d68fd1e 100644 --- a/cocos/ui/UIScrollView.h +++ b/cocos/ui/UIScrollView.h @@ -33,7 +33,7 @@ class EventFocusListener; namespace ui { -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { SCROLLVIEW_EVENT_SCROLL_TO_TOP, SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM, @@ -46,7 +46,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum SCROLLVIEW_EVENT_BOUNCE_RIGHT }ScrollviewEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType); +typedef void (Ref::*SEL_ScrollViewEvent)(Ref*, ScrollviewEventType); #define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR) diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 38b5bf678c..642749d540 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -148,8 +148,6 @@ void Slider::loadBarTexture(const std::string& fileName, TextureResType texType) default: break; } - _barRenderer->setColor(this->getColor()); - _barRenderer->setOpacity(this->getOpacity()); _barRendererAdaptDirty = true; _progressBarRendererDirty = true; @@ -190,9 +188,6 @@ void Slider::loadProgressBarTexture(const std::string& fileName, TextureResType break; } - _progressBarRenderer->setColor(this->getColor()); - _progressBarRenderer->setOpacity(this->getOpacity()); - _progressBarRenderer->setAnchorPoint(Vec2(0.0f, 0.5f)); _progressBarTextureSize = _progressBarRenderer->getContentSize(); _progressBarRendererDirty = true; @@ -314,8 +309,6 @@ void Slider::loadSlidBallTextureNormal(const std::string& normal,TextureResType default: break; } - _slidBallNormalRenderer->setColor(this->getColor()); - _slidBallNormalRenderer->setOpacity(this->getOpacity()); } void Slider::loadSlidBallTexturePressed(const std::string& pressed,TextureResType texType) @@ -337,8 +330,6 @@ void Slider::loadSlidBallTexturePressed(const std::string& pressed,TextureResTyp default: break; } - _slidBallPressedRenderer->setColor(this->getColor()); - _slidBallPressedRenderer->setOpacity(this->getOpacity()); } void Slider::loadSlidBallTextureDisabled(const std::string& disabled,TextureResType texType) @@ -360,8 +351,6 @@ void Slider::loadSlidBallTexturePressed(const std::string& pressed,TextureResTyp default: break; } - _slidBallDisabledRenderer->setColor(this->getColor()); - _slidBallDisabledRenderer->setOpacity(this->getOpacity()); } void Slider::setPercent(int percent) diff --git a/cocos/ui/UISlider.h b/cocos/ui/UISlider.h index 451cd6ca2c..f8a711dcf1 100644 --- a/cocos/ui/UISlider.h +++ b/cocos/ui/UISlider.h @@ -33,12 +33,12 @@ class Sprite; namespace ui { -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { SLIDER_PERCENTCHANGED }SliderEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType); +typedef void (Ref::*SEL_SlidPercentChangedEvent)(Ref*,SliderEventType); #define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR) /** diff --git a/cocos/ui/UITextBMFont.cpp b/cocos/ui/UITextBMFont.cpp index 52187ecda1..02ad64ea84 100644 --- a/cocos/ui/UITextBMFont.cpp +++ b/cocos/ui/UITextBMFont.cpp @@ -88,8 +88,6 @@ void TextBMFont::setFntFile(const std::string& fileName) _fntFileName = fileName; _labelBMFontRenderer->setBMFontFilePath(fileName); - _labelBMFontRenderer->setColor(this->getColor()); - _labelBMFontRenderer->setOpacity(this->getOpacity()); _fntFileHasInit = true; setString(_stringValue); } diff --git a/cocos/ui/UITextField.cpp b/cocos/ui/UITextField.cpp index 90b65063ca..7d6cf660f7 100644 --- a/cocos/ui/UITextField.cpp +++ b/cocos/ui/UITextField.cpp @@ -584,6 +584,8 @@ bool TextField::onTouchBegan(Touch *touch, Event *unusedEvent) if (_hitted) { _textFieldRenderer->attachWithIME(); + } else { + this->didNotSelectSelf(); } return pass; } diff --git a/cocos/ui/UITextField.h b/cocos/ui/UITextField.h index b343ed4a7d..cc7ef355a8 100644 --- a/cocos/ui/UITextField.h +++ b/cocos/ui/UITextField.h @@ -91,7 +91,7 @@ protected: bool _deleteBackward; }; -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { TEXTFIELD_EVENT_ATTACH_WITH_IME, TEXTFIELD_EVENT_DETACH_WITH_IME, @@ -99,7 +99,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum TEXTFIELD_EVENT_DELETE_BACKWARD, }TextFiledEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_TextFieldEvent)(Ref*, TextFiledEventType); +typedef void (Ref::*SEL_TextFieldEvent)(Ref*, TextFiledEventType); #define textfieldeventselector(_SELECTOR) (SEL_TextFieldEvent)(&_SELECTOR) /** class UITextField : public Widget diff --git a/cocos/ui/UIWidget.h b/cocos/ui/UIWidget.h index a0cc42b27a..935d6f8628 100644 --- a/cocos/ui/UIWidget.h +++ b/cocos/ui/UIWidget.h @@ -37,7 +37,7 @@ class EventListenerTouchOneByOne; namespace ui { -CC_DEPRECATED_ATTRIBUTE typedef enum +typedef enum { TOUCH_EVENT_BEGAN, TOUCH_EVENT_MOVED, @@ -45,7 +45,7 @@ CC_DEPRECATED_ATTRIBUTE typedef enum TOUCH_EVENT_CANCELED }TouchEventType; -CC_DEPRECATED_ATTRIBUTE typedef void (Ref::*SEL_TouchEvent)(Ref*,TouchEventType); +typedef void (Ref::*SEL_TouchEvent)(Ref*,TouchEventType); #define toucheventselector(_SELECTOR) (SEL_TouchEvent)(&_SELECTOR) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 1ab713b913..0ebf4815cd 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,8 +1,8 @@ -# cocos2d-x v3.2-alpha0 Release Notes # +# cocos2d-x v3.2rc0 Release Notes # **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* -- [cocos2d-x v3.2-alpha0 Release Notes](#user-content-cocos2d-x-v32-alpha0-release-notes) +- [cocos2d-x v3.2rc0 Release Notes](#user-content-cocos2d-x-v32rc0-release-notes) - [Misc Information](#user-content-misc-information) - [Requirements](#user-content-requirements) - [Runtime Requirements](#user-content-runtime-requirements) @@ -13,18 +13,21 @@ - [Windows](#user-content-windows) - [Linux](#user-content-linux) - [How to start a new game](#user-content-how-to-start-a-new-game) -- [Highlights of v3.2 alpha0](#user-content-highlights-of-v32-alpha0) +- [Highlights of v3.2rc0](#user-content-highlights-of-v32rc0) +- [Toolchain requirement changed](#user-content-toolchain-requirement-changed) - [Features in detail](#user-content-features-in-detail) - - [Animation3D](#user-content-animation3d) + - [Sprite3d](#user-content-sprite3d) - [fbx-conv usage](#user-content-fbx-conv-usage) - - [Sample code](#user-content-sample-code) - - [captureScreen](#user-content-capturescreen) + - [Controller support](#user-content-controller-support) + - [Fast tilemap](#user-content-fast-tilemap) + - [Node::enumerateChildren](#user-content-nodeenumeratechildren) + - [utils::findChildren](#user-content-utilsfindchildren) # Misc Information -* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.2alpha0.zip -* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.2alpha0/CHANGELOG -* ~~API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0/index.html~~ +* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.2rc0.zip +* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.2rc0/CHANGELOG +* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.2rc0/index.html * v3.0 Release Notes can be found here: [v3.0 Release Notes](https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0/docs/RELEASE_NOTES.md) # Requirements @@ -36,14 +39,14 @@ * OS X 10.7 or newer * Windows 7 or newer * Windows Phone 8 or newer -* Linux Ubuntu 12.04 or newer +* Linux Ubuntu 14.04 or newer * ~~Browsers via Emscripten~~ N/A for the moment ## Compiler Requirements * Xcode 4.6 or newer for iOS or Mac -* gcc 4.7 or newer for Linux -* gcc 4.7 and ndk-r9 or newer for Android +* gcc 4.9 or newer for Linux +* ndk-r9d or newer for Android * Visual Studio 2012 or newer for Windows (win32) * Visual Studio 2012 or newer for Windows Phone 8 @@ -111,66 +114,104 @@ Run Please refer to this document: [ReadMe](../README.md) -# Highlights of v3.2 alpha0 +# Highlights of v3.2rc0 -* `Animation3D`/`Animate3d`, new nodes for 3d animation. lua-binding and WP8 is not supported now. -* Updated libcurl.a to use OpenSSL v1.0.1h, [news](http://cocos2d-x.org/news/286) for it -* Added `utils::captureScreen` to take screeshot +* `fbx-conv` support generating binary format, and `Sprite3D` support it +* about 20% performance improved in `Sprite3D` +* game controller support +* fast tilemap support, it is faster for static tilemap +* physics body supports scale and rotation +* added Node::enumearteChildren(), and support c++ 11 regular expression + +# Toolchain requirement changed + +`Node::enumerateChildren()` uses `std::regex` which will cause crash using gcc v4.8 or lower version. So + +* NDK r9d or newer version is required for Android building +* gcc 4.9 is required for linux building # Features in detail -## Animation3D +## Sprite3d -Animation3D is skeletal animation in 3D Game. It allows the artist animate a 3D model using bone in 3D modeling tools. Then export the model file and use it in the game. +Sample code to use binary version +```c++ +auto sprite3d = Sprite3D::create("filename.c3b"); +addChild(sprite3d); +``` -Work flow - -* Artist produce 3D models in modeling tools and then export it to FBX file -* Use `fbx-conv` convert FBX file to c3t file -* Load c3t file in the game - -Note - -* The API may change in final version -* binary format of c3t will be added in final version -* the bones in the FBX file should not be more than 50. ### `fbx-conv` usage -* windows +* Mac OS X ``` -cd COCOS2DX_ROOT/tools/fbx-convert/win32 -fbx-conv FBXFile -``` -* mac os x - -``` -cd COCOS2DX_ROOT/tools/fbx-convert/mac -./fbx-conv FBXFile +$ cd COCOS2DX_ROOT/tools/fbx-conv/mac +$ ./fbx-conv [-a|-b|-t] FBXFile ``` +* Windows -### Sample code +``` +cd COCOS2DX_ROOT/tools/fbx-conv/windows +fbx-conv [-a|-b|-t] FBXFile +``` + +Options: + +* -a: export both text and binary format +* -b: export binary format +* -t: export text format + +## Controller support + +Supported controller type: + +* amazon tv +* OUYA +* Moga +* Nibiru +* iOS standard controllers + +In order to use controller on Android, you should refer to this Android project(`COCOS2DX_ROOT/cocos/platform/android/ControllerManualAdapter`). + +Full demo please refer to `COCOS2DX_ROOT/tests/game-controler-test`. + +## Fast tilemap + +Fast tilemap has the same API as `TMXTiledMap` without deprecated functions. + +Sample code +```c++ +auto tilemap = FastTMXTiledMap::create("MyFile.tmx"); +addChild(tilemap); +``` + +Full demo please refer to `COCOS2DX_ROOT/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp`. + +## Node::enumerateChildren + +This functions is used to enumerate children of a `Node` recursively. It supports c++ 11 regular expression. ```c++ -//load Sprite3D -auto sprite = Sprite3D::create("girl.c3t"); -addChild(sprite); -sprite->setPosition(Vec2( 0, 0)); - -//load animation and play it -auto animation = Animation3D::getOrCreate("girl.c3t"); -if (animation) -{ - auto animate = Animate3D::create(animation); - sprite->runAction(RepeatForever::create(animate)); -} +// Find nodes whose name is 'nameToFind' and end with digits. +node->enumerateChildren("nameToFind[[:digit:]]+", [](Node* node) -> bool { + ... + return false; // return true to stop at first match +}); ``` -Full sample please refer to [Sprite3D test](https://github.com/cocos2d/cocos2d-x/blob/v3/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp). +Full test please refer to `NodeNameTest` in `COCOS2DX_ROOT/tests/cpp-tests/NodeTest/NodeTest.cpp`. -## captureScreen +Because this function uses `std::regex` which is not supported well in gcc 4.8 or lower version. So we use `clang` and `stdc++` instead for Android building. This lead to the result that `NDK r9d` or newer is required. And `gcc 4.9` is required on linux. -Please refer to [here](https://github.com/cocos2d/cocos2d-x/blob/v3/tests/cpp-tests/Classes/NewRendererTest/NewRendererTest.cpp) for usage. +## utils::findChildren + +This is a helper function to find children of a `Node` share a name. The implementation of this function bases on `Node::enumerateChildren`. + +```c++ +auto children = utils::findChildren(node, "nameToFind"); + +... +``` diff --git a/extensions/GUI/CCControlExtension/CCControl.cpp b/extensions/GUI/CCControlExtension/CCControl.cpp index 128443fa5f..3975d514e0 100644 --- a/extensions/GUI/CCControlExtension/CCControl.cpp +++ b/extensions/GUI/CCControlExtension/CCControl.cpp @@ -59,7 +59,7 @@ Control* Control::create() else { CC_SAFE_DELETE(pRet); - return NULL; + return nullptr; } } @@ -154,7 +154,7 @@ void Control::addTargetWithActionForControlEvents(Ref* target, Handler action, E * * @param target The target object that is, the object to which the action * message is sent. It cannot be nil. The target is not retained. - * @param action A selector identifying an action message. It cannot be NULL. + * @param action A selector identifying an action message. It cannot be nullptr. * @param controlEvent A control event for which the action message is sent. * See "CCControlEvent" for constants. */ @@ -320,7 +320,7 @@ bool Control::isHighlighted() const bool Control::hasVisibleParents() const { auto parent = this->getParent(); - for( auto c = parent; c != NULL; c = c->getParent() ) + for( auto c = parent; c != nullptr; c = c->getParent() ) { if( !c->isVisible() ) { diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 6d342e7946..19978cfd65 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -135,7 +135,7 @@ void ControlColourPicker::setColor(const Color3B& color) void ControlColourPicker::setEnabled(bool enabled) { Control::setEnabled(enabled); - if (_huePicker != NULL) + if (_huePicker != nullptr) { _huePicker->setEnabled(enabled); } diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index 9850aacff8..96721a80b6 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp @@ -118,7 +118,7 @@ void ControlHuePicker::setHuePercentage(float hueValueInPercent) void ControlHuePicker::setEnabled(bool enabled) { Control::setEnabled(enabled); - if (_slider != NULL) + if (_slider != nullptr) { _slider->setOpacity(enabled ? 255 : 128); } diff --git a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp index 13698bcbdf..b77cfeb9e8 100644 --- a/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp +++ b/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp @@ -48,7 +48,7 @@ ControlPotentiometer::~ControlPotentiometer() ControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, const char* progressFile, const char* thumbFile) { ControlPotentiometer* pRet = new ControlPotentiometer(); - if (pRet != NULL) + if (pRet != nullptr) { // Prepare track for potentiometer Sprite *backgroundSprite = Sprite::create(backgroundFile); @@ -97,7 +97,7 @@ bool ControlPotentiometer::initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite* void ControlPotentiometer::setEnabled(bool enabled) { Control::setEnabled(enabled); - if (_thumbSprite != NULL) + if (_thumbSprite != nullptr) { _thumbSprite->setOpacity((enabled) ? 255 : 128); } diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp index d23eba4ab2..ade1f462d4 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp @@ -50,10 +50,10 @@ ControlSaturationBrightnessPicker::~ControlSaturationBrightnessPicker() { removeAllChildrenWithCleanup(true); - _background = NULL; - _overlay = NULL; - _shadow = NULL; - _slider = NULL; + _background = nullptr; + _overlay = nullptr; + _shadow = nullptr; + _slider = nullptr; } bool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Vec2 pos) @@ -88,7 +88,7 @@ ControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Nod void ControlSaturationBrightnessPicker::setEnabled(bool enabled) { Control::setEnabled(enabled); - if (_slider != NULL) + if (_slider != nullptr) { _slider->setOpacity(enabled ? 255 : 128); } diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index 42cf2dae6a..4e64f1e462 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -169,7 +169,7 @@ bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressS void ControlSlider::setEnabled(bool enabled) { Control::setEnabled(enabled); - if (_thumbSprite != NULL) + if (_thumbSprite != nullptr) { _thumbSprite->setOpacity((enabled) ? 255 : 128); } @@ -271,8 +271,8 @@ void ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent) void ControlSlider::needsLayout() { - if (NULL == _thumbSprite || NULL == _selectedThumbSprite || NULL == _backgroundSprite - || NULL == _progressSprite) + if (nullptr == _thumbSprite || nullptr == _selectedThumbSprite || nullptr == _backgroundSprite + || nullptr == _progressSprite) { return; } diff --git a/extensions/GUI/CCControlExtension/CCControlStepper.cpp b/extensions/GUI/CCControlExtension/CCControlStepper.cpp index f96d27496d..dfb3a86564 100644 --- a/extensions/GUI/CCControlExtension/CCControlStepper.cpp +++ b/extensions/GUI/CCControlExtension/CCControlStepper.cpp @@ -118,7 +118,7 @@ bool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprit ControlStepper* ControlStepper::create(Sprite *minusSprite, Sprite *plusSprite) { ControlStepper* pRet = new ControlStepper(); - if (pRet != NULL && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite)) + if (pRet != nullptr && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite)) { pRet->autorelease(); } diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index d8b73a587e..3f3aad0743 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -291,13 +291,13 @@ ControlSwitch::~ControlSwitch() bool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite) { - return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL); + return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr); } ControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite) { ControlSwitch* pRet = new ControlSwitch(); - if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL)) + if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, nullptr, nullptr)) { pRet->autorelease(); } @@ -382,7 +382,7 @@ void ControlSwitch::setOn(bool isOn, bool animated) void ControlSwitch::setEnabled(bool enabled) { _enabled = enabled; - if (_switchSprite != NULL) + if (_switchSprite != nullptr) { _switchSprite->setOpacity((enabled) ? 255 : 128); } diff --git a/extensions/GUI/CCControlExtension/CCControlUtils.cpp b/extensions/GUI/CCControlExtension/CCControlUtils.cpp index 414e43bd86..f2c868d20c 100644 --- a/extensions/GUI/CCControlExtension/CCControlUtils.cpp +++ b/extensions/GUI/CCControlExtension/CCControlUtils.cpp @@ -31,7 +31,7 @@ Sprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName, Sprite *sprite =Sprite::createWithSpriteFrameName(spriteName); if (!sprite) - return NULL; + return nullptr; sprite->setPosition(pos); sprite->setAnchorPoint(anchor); diff --git a/extensions/GUI/CCControlExtension/CCInvocation.cpp b/extensions/GUI/CCControlExtension/CCInvocation.cpp index a93429303e..f105392831 100644 --- a/extensions/GUI/CCControlExtension/CCInvocation.cpp +++ b/extensions/GUI/CCControlExtension/CCInvocation.cpp @@ -31,7 +31,7 @@ NS_CC_EXT_BEGIN Invocation* Invocation::create(Ref* target, Control::Handler action, Control::EventType controlEvent) { Invocation* pRet = new Invocation(target, action, controlEvent); - if (pRet != NULL) + if (pRet != nullptr) { pRet->autorelease(); } diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index 43664de763..8d55e46003 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -71,7 +71,7 @@ Scale9Sprite::~Scale9Sprite() bool Scale9Sprite::init() { - return this->initWithBatchNode(NULL, Rect::ZERO, Rect::ZERO); + return this->initWithBatchNode(nullptr, Rect::ZERO, Rect::ZERO); } bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets) @@ -389,13 +389,13 @@ void Scale9Sprite::setContentSize(const Size &size) void Scale9Sprite::updatePositions() { - // Check that instances are non-NULL + // Check that instances are non-nullptr if(!((_topLeft) && (_topRight) && (_bottomRight) && (_bottomLeft) && (_centre))) { - // if any of the above sprites are NULL, return + // if any of the above sprites are nullptr, return return; } @@ -462,7 +462,7 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect, c return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect) @@ -480,7 +480,7 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect) return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } @@ -499,7 +499,7 @@ Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& fil return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithFile(const std::string& file) @@ -518,16 +518,16 @@ Scale9Sprite* Scale9Sprite::create(const std::string& file) return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) { Texture2D* texture = spriteFrame->getTexture(); - CCASSERT(texture != NULL, "CCTexture must be not nil"); + CCASSERT(texture != nullptr, "CCTexture must be not nil"); SpriteBatchNode *batchnode = SpriteBatchNode::createWithTexture(texture, 9); - CCASSERT(batchnode != NULL, "CCSpriteBatchNode must be not nil"); + CCASSERT(batchnode != nullptr, "CCSpriteBatchNode must be not nil"); bool pReturn = this->initWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), capInsets); return pReturn; @@ -542,11 +542,11 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, cons return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) { - CCASSERT(spriteFrame != NULL, "Invalid spriteFrame for sprite"); + CCASSERT(spriteFrame != nullptr, "Invalid spriteFrame for sprite"); bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); return pReturn; } @@ -560,17 +560,17 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) { - CCASSERT((SpriteFrameCache::getInstance()) != NULL, "SpriteFrameCache::getInstance() must be non-NULL"); + CCASSERT((SpriteFrameCache::getInstance()) != nullptr, "SpriteFrameCache::getInstance() must be non-nullptr"); SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); - CCASSERT(frame != NULL, "CCSpriteFrame must be non-NULL"); + CCASSERT(frame != nullptr, "CCSpriteFrame must be non-nullptr"); - if (NULL == frame) return false; + if (nullptr == frame) return false; bool pReturn = this->initWithSpriteFrame(frame, capInsets); return pReturn; @@ -585,7 +585,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteF return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) @@ -605,7 +605,7 @@ Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteF CC_SAFE_DELETE(pReturn); log("Could not allocate Scale9Sprite()"); - return NULL; + return nullptr; } @@ -618,7 +618,7 @@ Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } Scale9Sprite* Scale9Sprite::create() @@ -630,7 +630,7 @@ Scale9Sprite* Scale9Sprite::create() return pReturn; } CC_SAFE_DELETE(pReturn); - return NULL; + return nullptr; } /** sets the opacity. diff --git a/extensions/GUI/CCEditBox/CCEditBox.cpp b/extensions/GUI/CCEditBox/CCEditBox.cpp index ceea82382d..97c34951c7 100644 --- a/extensions/GUI/CCEditBox/CCEditBox.cpp +++ b/extensions/GUI/CCEditBox/CCEditBox.cpp @@ -62,18 +62,18 @@ void EditBox::touchDownAction(Ref *sender, Control::EventType controlEvent) _editBoxImpl->openKeyboard(); } -EditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = NULL*/, Scale9Sprite* pDisabled9SpriteBg/* = NULL*/) +EditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = nullptr*/, Scale9Sprite* pDisabled9SpriteBg/* = nullptr*/) { EditBox* pRet = new EditBox(); - if (pRet != NULL && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) + if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) { - if (pPressed9SpriteBg != NULL) + if (pPressed9SpriteBg != nullptr) { pRet->setBackgroundSpriteForState(pPressed9SpriteBg, Control::State::HIGH_LIGHTED); } - if (pDisabled9SpriteBg != NULL) + if (pDisabled9SpriteBg != nullptr) { pRet->setBackgroundSpriteForState(pDisabled9SpriteBg, Control::State::DISABLED); } @@ -108,7 +108,7 @@ bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pP void EditBox::setDelegate(EditBoxDelegate* pDelegate) { _delegate = pDelegate; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setDelegate(pDelegate); } @@ -121,10 +121,10 @@ EditBoxDelegate* EditBox::getDelegate() void EditBox::setText(const char* pText) { - if (pText != NULL) + if (pText != nullptr) { _text = pText; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setText(pText); } @@ -133,10 +133,10 @@ void EditBox::setText(const char* pText) const char* EditBox::getText(void) { - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { const char* pText = _editBoxImpl->getText(); - if(pText != NULL) + if(pText != nullptr) return pText; } @@ -147,9 +147,9 @@ void EditBox::setFont(const char* pFontName, int fontSize) { _fontName = pFontName; _fontSize = fontSize; - if (pFontName != NULL) + if (pFontName != nullptr) { - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setFont(pFontName, fontSize); } @@ -159,7 +159,7 @@ void EditBox::setFont(const char* pFontName, int fontSize) void EditBox::setFontName(const char* pFontName) { _fontName = pFontName; - if (_editBoxImpl != NULL && _fontSize != -1) + if (_editBoxImpl != nullptr && _fontSize != -1) { _editBoxImpl->setFont(pFontName, _fontSize); } @@ -168,7 +168,7 @@ void EditBox::setFontName(const char* pFontName) void EditBox::setFontSize(int fontSize) { _fontSize = fontSize; - if (_editBoxImpl != NULL && _fontName.length() > 0) + if (_editBoxImpl != nullptr && _fontName.length() > 0) { _editBoxImpl->setFont(_fontName.c_str(), _fontSize); } @@ -177,7 +177,7 @@ void EditBox::setFontSize(int fontSize) void EditBox::setFontColor(const Color3B& color) { _colText = color; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setFontColor(color); } @@ -187,9 +187,9 @@ void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) { _placeholderFontName = pFontName; _placeholderFontSize = fontSize; - if (pFontName != NULL) + if (pFontName != nullptr) { - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setPlaceholderFont(pFontName, fontSize); } @@ -199,7 +199,7 @@ void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) void EditBox::setPlaceholderFontName(const char* pFontName) { _placeholderFontName = pFontName; - if (_editBoxImpl != NULL && _placeholderFontSize != -1) + if (_editBoxImpl != nullptr && _placeholderFontSize != -1) { _editBoxImpl->setPlaceholderFont(pFontName, _fontSize); } @@ -208,7 +208,7 @@ void EditBox::setPlaceholderFontName(const char* pFontName) void EditBox::setPlaceholderFontSize(int fontSize) { _placeholderFontSize = fontSize; - if (_editBoxImpl != NULL && _placeholderFontName.length() > 0) + if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0) { _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize); } @@ -217,7 +217,7 @@ void EditBox::setPlaceholderFontSize(int fontSize) void EditBox::setPlaceholderFontColor(const Color3B& color) { _colText = color; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setPlaceholderFontColor(color); } @@ -225,10 +225,10 @@ void EditBox::setPlaceholderFontColor(const Color3B& color) void EditBox::setPlaceHolder(const char* pText) { - if (pText != NULL) + if (pText != nullptr) { _placeHolder = pText; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setPlaceHolder(pText); } @@ -243,7 +243,7 @@ const char* EditBox::getPlaceHolder(void) void EditBox::setInputMode(EditBox::InputMode inputMode) { _editBoxInputMode = inputMode; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setInputMode(inputMode); } @@ -252,7 +252,7 @@ void EditBox::setInputMode(EditBox::InputMode inputMode) void EditBox::setMaxLength(int maxLength) { _maxLength = maxLength; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setMaxLength(maxLength); } @@ -267,7 +267,7 @@ int EditBox::getMaxLength() void EditBox::setInputFlag(EditBox::InputFlag inputFlag) { _editBoxInputFlag = inputFlag; - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setInputFlag(inputFlag); } @@ -275,7 +275,7 @@ void EditBox::setInputFlag(EditBox::InputFlag inputFlag) void EditBox::setReturnType(EditBox::KeyboardReturnType returnType) { - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setReturnType(returnType); } @@ -285,7 +285,7 @@ void EditBox::setReturnType(EditBox::KeyboardReturnType returnType) void EditBox::setPosition(const Vec2& pos) { ControlButton::setPosition(pos); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setPosition(pos); } @@ -294,7 +294,7 @@ void EditBox::setPosition(const Vec2& pos) void EditBox::setVisible(bool visible) { ControlButton::setVisible(visible); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setVisible(visible); } @@ -303,7 +303,7 @@ void EditBox::setVisible(bool visible) void EditBox::setContentSize(const Size& size) { ControlButton::setContentSize(size); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setContentSize(size); } @@ -312,7 +312,7 @@ void EditBox::setContentSize(const Size& size) void EditBox::setAnchorPoint(const Vec2& anchorPoint) { ControlButton::setAnchorPoint(anchorPoint); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->setAnchorPoint(anchorPoint); } @@ -321,7 +321,7 @@ void EditBox::setAnchorPoint(const Vec2& anchorPoint) void EditBox::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) { ControlButton::visit(renderer, parentTransform, parentFlags); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->visit(); } @@ -338,7 +338,7 @@ void EditBox::onEnter(void) #endif ControlButton::onEnter(); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->onEnter(); } @@ -358,7 +358,7 @@ void EditBox::updatePosition(float dt) void EditBox::onExit(void) { ControlButton::onExit(); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { // remove system edit control _editBoxImpl->closeKeyboard(); @@ -390,7 +390,7 @@ void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info) _adjustHeight = info.end.getMaxY() - rectTracked.getMinY(); // CCLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, _adjustHeight); } @@ -404,7 +404,7 @@ void EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& info) void EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info) { // CCLOG("CCEditBox::keyboardWillHide"); - if (_editBoxImpl != NULL) + if (_editBoxImpl != nullptr) { _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight); } diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp index d98082746f..3ae5275689 100644 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp +++ b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp @@ -93,12 +93,12 @@ bool EditBoxImplWin::initWithSize(const Size& size) void EditBoxImplWin::setFont(const char* pFontName, int fontSize) { - if(_label != NULL) { + if(_label != nullptr) { _label->setSystemFontName(pFontName); _label->setSystemFontSize(fontSize); } - if(_labelPlaceHolder != NULL) { + if(_labelPlaceHolder != nullptr) { _labelPlaceHolder->setSystemFontName(pFontName); _labelPlaceHolder->setSystemFontSize(fontSize); } @@ -112,7 +112,7 @@ void EditBoxImplWin::setFontColor(const Color3B& color) void EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize) { - if(_labelPlaceHolder != NULL) { + if(_labelPlaceHolder != nullptr) { _labelPlaceHolder->setSystemFontName(pFontName); _labelPlaceHolder->setSystemFontSize(fontSize); } @@ -156,7 +156,7 @@ bool EditBoxImplWin::isEditing() void EditBoxImplWin::setText(const char* pText) { - if (pText != NULL) + if (pText != nullptr) { _text = pText; @@ -199,7 +199,7 @@ const char* EditBoxImplWin::getText(void) void EditBoxImplWin::setPlaceHolder(const char* pText) { - if (pText != NULL) + if (pText != nullptr) { _placeHolder = pText; if (_placeHolder.length() > 0 && _text.length() == 0) @@ -236,13 +236,13 @@ void EditBoxImplWin::visit(void) void EditBoxImplWin::openKeyboard() { - if (_delegate != NULL) + if (_delegate != nullptr) { _delegate->editBoxEditingDidBegin(_editBox); } EditBox* pEditBox = this->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) { CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); ScriptEvent event(kCommonEvent,(void*)&data); @@ -265,7 +265,7 @@ void EditBoxImplWin::openKeyboard() if (didChange) setText(pText); - if (_delegate != NULL) { + if (_delegate != nullptr) { if (didChange) _delegate->editBoxTextChanged(_editBox, getText()); _delegate->editBoxEditingDidEnd(_editBox); diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 69a1742b40..d45c9f62a8 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -75,7 +75,7 @@ ScrollView::~ScrollView() } -ScrollView* ScrollView::create(Size size, Node* container/* = NULL*/) +ScrollView* ScrollView::create(Size size, Node* container/* = nullptr*/) { ScrollView* pRet = new ScrollView(); if (pRet && pRet->initWithViewSize(size, container)) @@ -104,7 +104,7 @@ ScrollView* ScrollView::create() } -bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) +bool ScrollView::initWithViewSize(Size size, Node *container/* = nullptr*/) { if (Layer::init()) { @@ -123,7 +123,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) _touches.reserve(EventTouch::MAX_TOUCHES); - _delegate = NULL; + _delegate = nullptr; _bounceable = true; _clippingToBounds = true; //_container->setContentSize(Size::ZERO); @@ -142,7 +142,7 @@ bool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/) bool ScrollView::init() { - return this->initWithViewSize(Size(200, 200), NULL); + return this->initWithViewSize(Size(200, 200), nullptr); } bool ScrollView::isNodeVisible(Node* node) @@ -225,7 +225,7 @@ void ScrollView::setContentOffset(Vec2 offset, bool animated/* = false*/) _container->setPosition(offset); - if (_delegate != NULL) + if (_delegate != nullptr) { _delegate->scrollViewDidScroll(this); } @@ -269,7 +269,7 @@ void ScrollView::setZoomScale(float s) newCenter = _container->convertToWorldSpace(oldCenter); const Vec2 offset = center - newCenter; - if (_delegate != NULL) + if (_delegate != nullptr) { _delegate->scrollViewDidZoom(this); } @@ -329,9 +329,9 @@ Node * ScrollView::getContainer() void ScrollView::setContainer(Node * pContainer) { - // Make sure that '_container' has a non-NULL value since there are + // Make sure that '_container' has a non-nullptr value since there are // lots of logic that use '_container'. - if (NULL == pContainer) + if (nullptr == pContainer) return; this->removeAllChildrenWithCleanup(true); @@ -430,7 +430,7 @@ void ScrollView::stoppedAnimatedScroll(Node * node) { this->unschedule(schedule_selector(ScrollView::performedAnimatedScroll)); // After the animation stopped, "scrollViewDidScroll" should be invoked, this could fix the bug of lack of tableview cells. - if (_delegate != NULL) + if (_delegate != nullptr) { _delegate->scrollViewDidScroll(this); } @@ -444,7 +444,7 @@ void ScrollView::performedAnimatedScroll(float dt) return; } - if (_delegate != NULL) + if (_delegate != nullptr) { _delegate->scrollViewDidScroll(this); } @@ -458,7 +458,7 @@ const Size& ScrollView::getContentSize() const void ScrollView::setContentSize(const Size & size) { - if (this->getContainer() != NULL) + if (this->getContainer() != nullptr) { this->getContainer()->setContentSize(size); this->updateInset(); @@ -467,7 +467,7 @@ void ScrollView::setContentSize(const Size & size) void ScrollView::updateInset() { - if (this->getContainer() != NULL) + if (this->getContainer() != nullptr) { _maxInset = this->maxContainerOffset(); _maxInset = Vec2(_maxInset.x + _viewSize.width * INSET_RATIO, @@ -812,7 +812,7 @@ Rect ScrollView::getViewRect() float scaleX = this->getScaleX(); float scaleY = this->getScaleY(); - for (Node *p = _parent; p != NULL; p = p->getParent()) { + for (Node *p = _parent; p != nullptr; p = p->getParent()) { scaleX *= p->getScaleX(); scaleY *= p->getScaleY(); } diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 3ba3c9c216..b074fc4e88 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -35,7 +35,7 @@ TableView* TableView::create() TableView* TableView::create(TableViewDataSource* dataSource, Size size) { - return TableView::create(dataSource, size, NULL); + return TableView::create(dataSource, size, nullptr); } TableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *container) @@ -50,7 +50,7 @@ TableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *c return table; } -bool TableView::initWithViewSize(Size size, Node* container/* = NULL*/) +bool TableView::initWithViewSize(Size size, Node* container/* = nullptr*/) { if (ScrollView::initWithViewSize(size,container)) { @@ -103,7 +103,7 @@ void TableView::reloadData() _oldDirection = Direction::NONE; for(const auto &cell : _cellsUsed) { - if(_tableViewDelegate != NULL) { + if(_tableViewDelegate != nullptr) { _tableViewDelegate->tableCellWillRecycle(this, cell); } @@ -242,7 +242,7 @@ TableViewCell *TableView::dequeueCell() TableViewCell *cell; if (_cellsFreed.empty()) { - cell = NULL; + cell = nullptr; } else { cell = _cellsFreed.at(0); cell->retain(); @@ -396,7 +396,7 @@ long TableView::__indexFromOffset(Vec2 offset) void TableView::_moveCellOutOfSight(TableViewCell *cell) { - if(_tableViewDelegate != NULL) { + if(_tableViewDelegate != nullptr) { _tableViewDelegate->tableCellWillRecycle(this, cell); } @@ -464,7 +464,7 @@ void TableView::scrollViewDidScroll(ScrollView* view) }); } - if(_tableViewDelegate != NULL) { + if(_tableViewDelegate != nullptr) { _tableViewDelegate->scrollViewDidScroll(this); } @@ -577,13 +577,13 @@ void TableView::onTouchEnded(Touch *pTouch, Event *pEvent) Rect bb = this->getBoundingBox(); bb.origin = _parent->convertToWorldSpace(bb.origin); - if (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != NULL) + if (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != nullptr) { _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); _tableViewDelegate->tableCellTouched(this, _touchedCell); } - _touchedCell = NULL; + _touchedCell = nullptr; } ScrollView::onTouchEnded(pTouch, pEvent); @@ -608,26 +608,26 @@ bool TableView::onTouchBegan(Touch *pTouch, Event *pEvent) index = this->_indexFromOffset(point); if (index == CC_INVALID_INDEX) { - _touchedCell = NULL; + _touchedCell = nullptr; } else { _touchedCell = this->cellAtIndex(index); } - if (_touchedCell && _tableViewDelegate != NULL) + if (_touchedCell && _tableViewDelegate != nullptr) { _tableViewDelegate->tableCellHighlight(this, _touchedCell); } } else if (_touchedCell) { - if(_tableViewDelegate != NULL) + if(_tableViewDelegate != nullptr) { _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); } - _touchedCell = NULL; + _touchedCell = nullptr; } return touchResult; @@ -639,12 +639,12 @@ void TableView::onTouchMoved(Touch *pTouch, Event *pEvent) if (_touchedCell && isTouchMoved()) { - if(_tableViewDelegate != NULL) + if(_tableViewDelegate != nullptr) { _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); } - _touchedCell = NULL; + _touchedCell = nullptr; } } @@ -654,12 +654,12 @@ void TableView::onTouchCancelled(Touch *pTouch, Event *pEvent) if (_touchedCell) { - if(_tableViewDelegate != NULL) + if(_tableViewDelegate != nullptr) { _tableViewDelegate->tableCellUnhighlight(this, _touchedCell); } - _touchedCell = NULL; + _touchedCell = nullptr; } } diff --git a/extensions/assets-manager/AssetsManager.cpp b/extensions/assets-manager/AssetsManager.cpp index 637cd18c98..52073d2f07 100644 --- a/extensions/assets-manager/AssetsManager.cpp +++ b/extensions/assets-manager/AssetsManager.cpp @@ -77,7 +77,7 @@ struct ProgressMessage // Implementation of AssetsManager -AssetsManager::AssetsManager(const char* packageUrl/* =NULL */, const char* versionFileUrl/* =NULL */, const char* storagePath/* =NULL */) +AssetsManager::AssetsManager(const char* packageUrl/* =nullptr */, const char* versionFileUrl/* =nullptr */, const char* storagePath/* =nullptr */) : _storagePath(storagePath) , _version("") , _packageUrl(packageUrl) @@ -309,9 +309,9 @@ bool AssetsManager::uncompress() &fileInfo, fileName, MAX_FILENAME, - NULL, + nullptr, 0, - NULL, + nullptr, 0) != UNZ_OK) { CCLOG("can not read file info"); @@ -455,7 +455,7 @@ bool AssetsManager::createDirectory(const char *path) return true; #else - BOOL ret = CreateDirectoryA(path, NULL); + BOOL ret = CreateDirectoryA(path, nullptr); if (!ret && ERROR_ALREADY_EXISTS != GetLastError()) { return false; @@ -632,7 +632,7 @@ void AssetsManager::createStoragePath() { // Remove downloaded files #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) - DIR *dir = NULL; + DIR *dir = nullptr; dir = opendir (_storagePath.c_str()); if (!dir) diff --git a/extensions/physics-nodes/CCPhysicsDebugNode.cpp b/extensions/physics-nodes/CCPhysicsDebugNode.cpp index 18f55cefe4..2fbc2c4fb9 100644 --- a/extensions/physics-nodes/CCPhysicsDebugNode.cpp +++ b/extensions/physics-nodes/CCPhysicsDebugNode.cpp @@ -70,7 +70,7 @@ static Vec2 cpVert2Point(const cpVect &vert) static Vec2* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count) { - if (count == 0) return NULL; + if (count == 0) return nullptr; Vec2* pPoints = new Vec2[count]; for (unsigned int i = 0; i < count; ++i) diff --git a/extensions/physics-nodes/CCPhysicsSprite.cpp b/extensions/physics-nodes/CCPhysicsSprite.cpp index 0c896a5677..a335a1b385 100644 --- a/extensions/physics-nodes/CCPhysicsSprite.cpp +++ b/extensions/physics-nodes/CCPhysicsSprite.cpp @@ -172,7 +172,7 @@ const Vec2& PhysicsSprite::getPosition() const void PhysicsSprite::getPosition(float* x, float* y) const { - if (x == NULL || y == NULL) { + if (x == nullptr || y == nullptr) { return; } const Vec2& pos = getPosFromPhysics(); diff --git a/extensions/proj.win32/Win32InputBox.cpp b/extensions/proj.win32/Win32InputBox.cpp index bc115dfc54..da1cb12301 100644 --- a/extensions/proj.win32/Win32InputBox.cpp +++ b/extensions/proj.win32/Win32InputBox.cpp @@ -138,11 +138,11 @@ INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param) #else HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG); #endif - if (rcDlg == NULL) + if (rcDlg == nullptr) return 0; HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg); - if (hglobalDlg == NULL) + if (hglobalDlg == nullptr) return 0; dlgTemplate = (LPDLGTEMPLATE) hglobalDlg; @@ -336,16 +336,16 @@ std::string CWin32InputBox::AnsiToUtf8(std::string strAnsi) std::string ret; if (strAnsi.length() > 0) { - int nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, NULL, 0); + int nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, nullptr, 0); WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR)); memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR)); - int nUtf8Length = WideCharToMultiByte( CP_UTF8,0,pwszBuf,-1,NULL,0,NULL,FALSE ); + int nUtf8Length = WideCharToMultiByte( CP_UTF8,0,pwszBuf,-1,nullptr,0,nullptr,FALSE ); char* pszUtf8Buf = (char*)malloc((nUtf8Length+1)*sizeof(char)); memset(pszUtf8Buf, 0, (nUtf8Length+1)*sizeof(char)); - WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length+1)*sizeof(char), NULL, FALSE); + WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length+1)*sizeof(char), nullptr, FALSE); ret = pszUtf8Buf; free(pszUtf8Buf); @@ -359,16 +359,16 @@ std::string CWin32InputBox::Utf8ToAnsi(std::string strUTF8) std::string ret; if (strUTF8.length() > 0) { - int nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, NULL, 0); + int nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, nullptr, 0); WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR)); memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR)); MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR)); - int nAnsiStrLength = WideCharToMultiByte( CP_ACP,0,pwszBuf,-1,NULL,0,NULL,FALSE ); + int nAnsiStrLength = WideCharToMultiByte( CP_ACP,0,pwszBuf,-1,nullptr,0,nullptr,FALSE ); char* pszAnsiBuf = (char*)malloc((nAnsiStrLength+1)*sizeof(char)); memset(pszAnsiBuf, 0, (nAnsiStrLength+1)*sizeof(char)); - WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength+1)*sizeof(char), NULL, FALSE); + WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength+1)*sizeof(char), nullptr, FALSE); ret = pszAnsiBuf; free(pszAnsiBuf); diff --git a/setup.py b/setup.py index 9a309edd02..e4343529d9 100755 --- a/setup.py +++ b/setup.py @@ -79,6 +79,7 @@ class SetEnvVar(object): MAC_CHECK_FILES = [ '.bash_profile', '.bash_login', '.profile' ] LINUX_CHECK_FILES = [ '.bashrc' ] + ZSH_CHECK_FILES = ['.zshrc' ] RE_FORMAT = r'^export[ \t]+%s=(.+)' def __init__(self): @@ -96,13 +97,23 @@ class SetEnvVar(object): def _is_mac(self): return sys.platform == 'darwin' - def _get_filepath_for_setup(self): + def _is_zsh(self): + return os.environ.get('SHELL')[-3:] == "zsh" + def _get_unix_file_list(self): file_list = None - if self._isLinux(): + + if self._is_zsh(): + file_list = SetEnvVar.ZSH_CHECK_FILES + elif self._isLinux(): file_list = SetEnvVar.LINUX_CHECK_FILES elif self._is_mac(): file_list = SetEnvVar.MAC_CHECK_FILES + + return file_list + + def _get_filepath_for_setup(self): + file_list = self._get_unix_file_list(); file_to_write = None if file_list is None: @@ -213,11 +224,7 @@ class SetEnvVar(object): ret = os.environ[var] except Exception: if not self._isWindows(): - file_list = None - if self._isLinux(): - file_list = SetEnvVar.LINUX_CHECK_FILES - elif self._is_mac(): - file_list = SetEnvVar.MAC_CHECK_FILES + file_list = self._get_unix_file_list() if file_list is not None: home = os.path.expanduser('~') diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 8133421da1..d34076a41e 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -280,17 +280,8 @@ "cocos/base/CCConsole.h", "cocos/base/CCController-android.cpp", "cocos/base/CCController-iOS.mm", + "cocos/base/CCController.cpp", "cocos/base/CCController.h", - "cocos/base/CCControllerAxisInput.cpp", - "cocos/base/CCControllerAxisInput.h", - "cocos/base/CCControllerButtonInput.cpp", - "cocos/base/CCControllerButtonInput.h", - "cocos/base/CCControllerDirectionPad.cpp", - "cocos/base/CCControllerDirectionPad.h", - "cocos/base/CCControllerElement.cpp", - "cocos/base/CCControllerElement.h", - "cocos/base/CCControllerThumbstick.cpp", - "cocos/base/CCControllerThumbstick.h", "cocos/base/CCData.cpp", "cocos/base/CCData.h", "cocos/base/CCDataVisitor.cpp", @@ -333,8 +324,6 @@ "cocos/base/CCEventTouch.h", "cocos/base/CCEventType.h", "cocos/base/CCGameController.h", - "cocos/base/CCGamepad.cpp", - "cocos/base/CCGamepad.h", "cocos/base/CCIMEDelegate.h", "cocos/base/CCIMEDispatcher.cpp", "cocos/base/CCIMEDispatcher.h", @@ -3642,6 +3631,7 @@ "cocos/scripting/lua-bindings/auto/api/ControlSlider.lua", "cocos/scripting/lua-bindings/auto/api/ControlStepper.lua", "cocos/scripting/lua-bindings/auto/api/ControlSwitch.lua", + "cocos/scripting/lua-bindings/auto/api/Controller.lua", "cocos/scripting/lua-bindings/auto/api/DelayTime.lua", "cocos/scripting/lua-bindings/auto/api/Director.lua", "cocos/scripting/lua-bindings/auto/api/DisplayData.lua", @@ -3687,6 +3677,7 @@ "cocos/scripting/lua-bindings/auto/api/EditBox.lua", "cocos/scripting/lua-bindings/auto/api/Event.lua", "cocos/scripting/lua-bindings/auto/api/EventAcceleration.lua", + "cocos/scripting/lua-bindings/auto/api/EventController.lua", "cocos/scripting/lua-bindings/auto/api/EventCustom.lua", "cocos/scripting/lua-bindings/auto/api/EventDispatcher.lua", "cocos/scripting/lua-bindings/auto/api/EventFocus.lua", @@ -3694,6 +3685,7 @@ "cocos/scripting/lua-bindings/auto/api/EventKeyboard.lua", "cocos/scripting/lua-bindings/auto/api/EventListener.lua", "cocos/scripting/lua-bindings/auto/api/EventListenerAcceleration.lua", + "cocos/scripting/lua-bindings/auto/api/EventListenerController.lua", "cocos/scripting/lua-bindings/auto/api/EventListenerCustom.lua", "cocos/scripting/lua-bindings/auto/api/EventListenerFocus.lua", "cocos/scripting/lua-bindings/auto/api/EventListenerKeyboard.lua", @@ -3713,6 +3705,8 @@ "cocos/scripting/lua-bindings/auto/api/FadeOutTRTiles.lua", "cocos/scripting/lua-bindings/auto/api/FadeOutUpTiles.lua", "cocos/scripting/lua-bindings/auto/api/FadeTo.lua", + "cocos/scripting/lua-bindings/auto/api/FastTMXLayer.lua", + "cocos/scripting/lua-bindings/auto/api/FastTMXTiledMap.lua", "cocos/scripting/lua-bindings/auto/api/FileUtils.lua", "cocos/scripting/lua-bindings/auto/api/FiniteTimeAction.lua", "cocos/scripting/lua-bindings/auto/api/FlipX.lua", @@ -3941,6 +3935,7 @@ "cocos/scripting/lua-bindings/auto/api/Twirl.lua", "cocos/scripting/lua-bindings/auto/api/UserDefault.lua", "cocos/scripting/lua-bindings/auto/api/VBox.lua", + "cocos/scripting/lua-bindings/auto/api/VideoPlayer.lua", "cocos/scripting/lua-bindings/auto/api/VisibleFrame.lua", "cocos/scripting/lua-bindings/auto/api/Waves.lua", "cocos/scripting/lua-bindings/auto/api/Waves3D.lua", @@ -3948,6 +3943,8 @@ "cocos/scripting/lua-bindings/auto/api/Widget.lua", "cocos/scripting/lua-bindings/auto/api/ZOrderFrame.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua", + "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_controller_auto_api.lua", + "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_experimental_video_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_physics_auto_api.lua", "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_spine_auto_api.lua", @@ -3955,6 +3952,10 @@ "cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_ui_auto_api.lua", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.cpp", + "cocos/scripting/lua-bindings/auto/lua_cocos2dx_experimental_video_auto.hpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp", "cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp", @@ -3989,8 +3990,12 @@ "cocos/scripting/lua-bindings/manual/Lua_web_socket.h", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.cpp", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_coco_studio_manual.hpp", + "cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp", + "cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_deprecated.cpp", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_deprecated.h", + "cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.cpp", + "cocos/scripting/lua-bindings/manual/lua_cocos2dx_experimental_video_manual.hpp", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_extension_manual.cpp", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_extension_manual.h", "cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp", @@ -4033,6 +4038,7 @@ "cocos/scripting/lua-bindings/script/Opengl.lua", "cocos/scripting/lua-bindings/script/OpenglConstants.lua", "cocos/scripting/lua-bindings/script/StudioConstants.lua", + "cocos/scripting/lua-bindings/script/experimentalConstants.lua", "cocos/scripting/lua-bindings/script/extern.lua", "cocos/scripting/lua-bindings/script/json.lua", "cocos/scripting/lua-bindings/script/luaj.lua", @@ -4417,6 +4423,8 @@ "tools/bindings-generator/tools/win32/cygwin1.dll", "tools/tolua/README.mdown", "tools/tolua/cocos2dx.ini", + "tools/tolua/cocos2dx_controller.ini", + "tools/tolua/cocos2dx_experimental_video.ini", "tools/tolua/cocos2dx_extension.ini", "tools/tolua/cocos2dx_physics.ini", "tools/tolua/cocos2dx_spine.ini", diff --git a/templates/cpp-template-default/cocos-project-template.json b/templates/cpp-template-default/cocos-project-template.json index ab35bb7a12..9d4ee7d291 100644 --- a/templates/cpp-template-default/cocos-project-template.json +++ b/templates/cpp-template-default/cocos-project-template.json @@ -44,6 +44,18 @@ "files":[ "proj.android/AndroidManifest.xml" ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellocpp", + "files": [ + "proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellocpp", + "files": [ + "proj.ios_mac/ios/Info.plist" + ] } } } diff --git a/templates/cpp-template-default/proj.ios_mac/ios/Info.plist b/templates/cpp-template-default/proj.ios_mac/ios/Info.plist index aff7e3c69e..9613e3c273 100644 --- a/templates/cpp-template-default/proj.ios_mac/ios/Info.plist +++ b/templates/cpp-template-default/proj.ios_mac/ios/Info.plist @@ -42,7 +42,7 @@ Icon-144.png CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellocpp CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/cpp-template-default/proj.ios_mac/mac/Info.plist b/templates/cpp-template-default/proj.ios_mac/mac/Info.plist index a73feb76e9..3b1fd784d9 100644 --- a/templates/cpp-template-default/proj.ios_mac/mac/Info.plist +++ b/templates/cpp-template-default/proj.ios_mac/mac/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile Icon CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellocpp CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/lua-template-default/cocos-project-template.json b/templates/lua-template-default/cocos-project-template.json index 8b3330d819..0eac97ab0f 100644 --- a/templates/lua-template-default/cocos-project-template.json +++ b/templates/lua-template-default/cocos-project-template.json @@ -56,6 +56,18 @@ "files":[ "frameworks/runtime-src/proj.android/AndroidManifest.xml" ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] } } } diff --git a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index b5a2e4f34e..7e99c14a37 100644 --- a/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -19,23 +19,6 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { - // initialize director - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if(!glview) { - glview = GLView::createWithRect("HelloLua", Rect(0,0,900,640)); - director->setOpenGLView(glview); - } - - glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); - - // turn on display FPS - director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - - auto engine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); if (engine->executeScriptFile("src/main.lua")) { diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj index 067c0a1743..bdde18eec0 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 15A8A4841834C73500142BE0 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */; }; 15A8A4851834C73500142BE0 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */; }; 15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; }; + 15AECE29195D482800907DB0 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15AECE28195D482800907DB0 /* MediaPlayer.framework */; }; 1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; }; 5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; }; 5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; }; @@ -277,6 +278,7 @@ /* Begin PBXFileReference section */ 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = "../../cocos2d-x/build/cocos2d_libs.xcodeproj"; sourceTree = ""; }; 15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; }; + 15AECE28195D482800907DB0 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/MediaPlayer.framework; sourceTree = DEVELOPER_DIR; }; 15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "../../cocos2d-x/cocos2dx/platform/third_party/ios/libraries/libcurl.a"; sourceTree = ""; }; 1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; @@ -375,6 +377,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15AECE29195D482800907DB0 /* MediaPlayer.framework in Frameworks */, C03781F618BF65B100FE4F13 /* libluabindings iOS.a in Frameworks */, 15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */, 15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */, @@ -523,6 +526,7 @@ F293B3CB15EB7BE500256477 /* Frameworks */ = { isa = PBXGroup; children = ( + 15AECE28195D482800907DB0 /* MediaPlayer.framework */, 15A8A4871834C90E00142BE0 /* libcurl.dylib */, D6B061341803AC000077942B /* CoreMotion.framework */, 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */, diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist index 105ea833f0..ac80cbf650 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/ios/Info.plist @@ -38,7 +38,7 @@ Icon-144.png CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellolua CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist index a73feb76e9..f72b36417b 100644 --- a/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist +++ b/templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/mac/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile Icon CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellolua CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/lua-template-default/src/main.lua b/templates/lua-template-default/src/main.lua index fb0ada253a..b33be1cbca 100644 --- a/templates/lua-template-default/src/main.lua +++ b/templates/lua-template-default/src/main.lua @@ -20,8 +20,25 @@ local function main() -- avoid memory leak collectgarbage("setpause", 100) collectgarbage("setstepmul", 5000) - cc.FileUtils:getInstance():addSearchResolutionsOrder("src"); - cc.FileUtils:getInstance():addSearchResolutionsOrder("res"); + + -- initialize director + local director = cc.Director:getInstance() + local glview = director:getOpenGLView() + if nil == glview then + glview = cc.GLView:createWithRect("HelloLua", cc.rect(0,0,900,640)) + director:setOpenGLView(glview) + end + + glview:setDesignResolutionSize(480, 320, cc.ResolutionPolicy.NO_BORDER) + + --turn on display FPS + director:setDisplayStats(true) + + --set FPS. the default value is 1.0/60 if you don't call this + director:setAnimationInterval(1.0 / 60) + + cc.FileUtils:getInstance():addSearchPath("src") + cc.FileUtils:getInstance():addSearchPath("res") local schedulerID = 0 --support debug local targetPlatform = cc.Application:getInstance():getTargetPlatform() diff --git a/templates/lua-template-runtime/cocos-project-template.json b/templates/lua-template-runtime/cocos-project-template.json index 75e0860770..fe5231abd3 100644 --- a/templates/lua-template-runtime/cocos-project-template.json +++ b/templates/lua-template-runtime/cocos-project-template.json @@ -156,6 +156,18 @@ "files": [ "frameworks/runtime-src/proj.android/AndroidManifest.xml" ] + }, + "project_replace_mac_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" + ] + }, + "project_replace_ios_bundleid": { + "src_bundle_id": "org.cocos2dx.hellolua", + "files": [ + "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" + ] } } } diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist index 8c1b27a35d..2b8d4ae1c0 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/ios/Info.plist @@ -38,7 +38,7 @@ Icon-144.png CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellolua CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist index a73feb76e9..f72b36417b 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist +++ b/templates/lua-template-runtime/frameworks/runtime-src/proj.ios_mac/mac/Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile Icon CFBundleIdentifier - org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier} + org.cocos2dx.hellolua CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/templates/lua-template-runtime/src/main.lua b/templates/lua-template-runtime/src/main.lua index e7dc27fb9e..a270259bf4 100644 --- a/templates/lua-template-runtime/src/main.lua +++ b/templates/lua-template-runtime/src/main.lua @@ -21,8 +21,8 @@ local function main() collectgarbage("setpause", 100) collectgarbage("setstepmul", 5000) cc.Director:getInstance():getOpenGLView():setDesignResolutionSize(480, 320, 0) - cc.FileUtils:getInstance():addSearchResolutionsOrder("src"); - cc.FileUtils:getInstance():addSearchResolutionsOrder("res"); + cc.FileUtils:getInstance():addSearchPath("src") + cc.FileUtils:getInstance():addSearchPath("res") local schedulerID = 0 --support debug local targetPlatform = cc.Application:getInstance():getTargetPlatform() diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index 063ef2513f..af90d53565 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -63,6 +63,8 @@ Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp \ Classes/ExtensionsTest/CocoStudioComponentsTest/SceneController.cpp \ Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp \ Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp \ +Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp \ +Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp \ Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp \ Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp \ Classes/UITest/CocoStudioGUITest/UIScene.cpp \ diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index c8e1788bfd..48267493f4 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -81,6 +81,8 @@ set(SAMPLE_SRC Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp Classes/UITest/CocoStudioGUITest/UIScene.cpp Classes/UITest/CocoStudioGUITest/UISceneManager.cpp + Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp + Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index 0ae621cd24..9f3943f535 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -28,7 +28,7 @@ Layer* createActionManagerLayer(int nIndex) case 4: return new ResumeTest(); } - return NULL; + return nullptr; } Layer* nextActionManagerAction() @@ -129,14 +129,14 @@ void CrashTest::onEnter() child->runAction(Sequence::create( DelayTime::create(1.4f), FadeOut::create(1.1f), - NULL) + nullptr) ); //After 1.5 second, self will be removed. runAction( Sequence::create( DelayTime::create(1.4f), CallFunc::create( CC_CALLBACK_0(CrashTest::removeThis,this)), - NULL) + nullptr) ); } @@ -168,7 +168,7 @@ void LogicTest::onEnter() grossini->runAction( Sequence::create( MoveBy::create(1, Vec2(150,0)), CallFuncN::create(CC_CALLBACK_1(LogicTest::bugMe,this)), - NULL) + nullptr) ); } @@ -246,7 +246,7 @@ void StopActionTest::onEnter() auto pMove = MoveBy::create(2, Vec2(200, 0)); auto pCallback = CallFunc::create(CC_CALLBACK_0(StopActionTest::stopAction,this)); - auto pSequence = Sequence::create(pMove, pCallback, NULL); + auto pSequence = Sequence::create(pMove, pCallback, nullptr); pSequence->setTag(kTagSequence); auto pChild = Sprite::create(s_pathGrossini); diff --git a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp index 30a1355732..83232ee376 100644 --- a/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp +++ b/tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp @@ -93,9 +93,9 @@ void SpriteEase::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); auto a2 = _grossini->runAction(RepeatForever::create(seq1)); @@ -149,9 +149,9 @@ void SpriteEaseInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create( move_ease_inout1, delay, move_ease_inout_back1, delay->clone(), NULL); - auto seq2 = Sequence::create( move_ease_inout2, delay->clone(), move_ease_inout_back2, delay->clone(), NULL); - auto seq3 = Sequence::create( move_ease_inout3, delay->clone(), move_ease_inout_back3, delay->clone(), NULL); + auto seq1 = Sequence::create( move_ease_inout1, delay, move_ease_inout_back1, delay->clone(), nullptr); + auto seq2 = Sequence::create( move_ease_inout2, delay->clone(), move_ease_inout_back2, delay->clone(), nullptr); + auto seq3 = Sequence::create( move_ease_inout3, delay->clone(), move_ease_inout_back3, delay->clone(), nullptr); _tamara->runAction(RepeatForever::create(seq1)); _kathia->runAction(RepeatForever::create(seq2)); @@ -185,9 +185,9 @@ void SpriteEaseExponential::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); @@ -218,8 +218,8 @@ void SpriteEaseExponentialInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create( move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create( move_ease, delay, move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create( move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create( move_ease, delay, move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -254,9 +254,9 @@ void SpriteEaseSine::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); @@ -288,8 +288,8 @@ void SpriteEaseSineInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -323,9 +323,9 @@ void SpriteEaseElastic::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -361,9 +361,9 @@ void SpriteEaseElasticInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move_ease_inout1, delay, move_ease_inout_back1, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_inout2, delay->clone(), move_ease_inout_back2, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_inout3, delay->clone(), move_ease_inout_back3, delay->clone(), NULL); + auto seq1 = Sequence::create(move_ease_inout1, delay, move_ease_inout_back1, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_inout2, delay->clone(), move_ease_inout_back2, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_inout3, delay->clone(), move_ease_inout_back3, delay->clone(), nullptr); _tamara->runAction( RepeatForever::create(seq1)); _kathia->runAction( RepeatForever::create(seq2)); @@ -398,9 +398,9 @@ void SpriteEaseBounce::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -432,8 +432,8 @@ void SpriteEaseBounceInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -468,9 +468,9 @@ void SpriteEaseBack::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction(RepeatForever::create(seq1)); _tamara->runAction(RepeatForever::create(seq2)); @@ -501,8 +501,8 @@ void SpriteEaseBackInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -546,7 +546,7 @@ void SpriteEaseBezier::onEnter() bezierEaseForward->setBezierParamer(0.5, 0.5, 1.0, 1.0); auto bezierEaseBack = bezierEaseForward->reverse(); - auto rep = RepeatForever::create(Sequence::create( bezierEaseForward, bezierEaseBack, NULL)); + auto rep = RepeatForever::create(Sequence::create( bezierEaseForward, bezierEaseBack, nullptr)); // sprite 2 @@ -599,9 +599,9 @@ void SpriteEaseQuadratic::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -631,8 +631,8 @@ void SpriteEaseQuadraticInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -667,9 +667,9 @@ void SpriteEaseQuartic::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -699,8 +699,8 @@ void SpriteEaseQuarticInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -734,9 +734,9 @@ void SpriteEaseQuintic::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -767,8 +767,8 @@ void SpriteEaseQuinticInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -802,9 +802,9 @@ void SpriteEaseCircle::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -835,8 +835,8 @@ void SpriteEaseCircleInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -870,9 +870,9 @@ void SpriteEaseCubic::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), NULL); - auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); + auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); _grossini->runAction( RepeatForever::create(seq1)); _tamara->runAction( RepeatForever::create(seq2)); @@ -903,8 +903,8 @@ void SpriteEaseCubicInOut::onEnter() auto delay = DelayTime::create(0.25f); - auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), NULL); - auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), NULL); + auto seq1 = Sequence::create(move, delay, move_back, delay->clone(), nullptr); + auto seq2 = Sequence::create(move_ease, delay->clone(), move_ease_back, delay->clone(), nullptr); this->positionForTwo(); @@ -934,9 +934,9 @@ void SpeedTest::onEnter() auto rot1 = RotateBy::create(4, 360*2); auto rot2 = rot1->reverse(); - auto seq3_1 = Sequence::create(jump2, jump1, NULL); - auto seq3_2 = Sequence::create( rot1, rot2, NULL); - auto spawn = Spawn::create(seq3_1, seq3_2, NULL); + auto seq3_1 = Sequence::create(jump2, jump1, nullptr); + auto seq3_2 = Sequence::create( rot1, rot2, nullptr); + auto spawn = Spawn::create(seq3_1, seq3_2, nullptr); auto action = Speed::create(RepeatForever::create(spawn), 1.0f); action->setTag(kTagAction1); @@ -1017,7 +1017,7 @@ Layer* createEaseLayer(int nIndex) } - return NULL; + return nullptr; } Layer* nextEaseAction() diff --git a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 8783884961..2b83ab8e3b 100644 --- a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -47,7 +47,7 @@ Layer* createLayer(int nIndex) case 6: return new SpriteProgressWithSpriteFrame(); } - return NULL; + return nullptr; } Layer* nextAction() @@ -371,10 +371,10 @@ void SpriteProgressBarTintAndFade::onEnter() auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), TintTo::create(1, 0, 255, 0), TintTo::create(1, 0, 0, 255), - NULL); + nullptr); auto fade = Sequence::create(FadeTo::create(1.0f, 0), FadeTo::create(1.0f, 255), - NULL); + nullptr); auto left = ProgressTimer::create(Sprite::create(s_pathSister1)); left->setType(ProgressTimer::Type::BAR); diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 608ce735d2..6a3dcf8813 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -290,7 +290,7 @@ void ActionMove::onEnter() auto actionByBack = actionBy->reverse(); _tamara->runAction( actionTo); - _grossini->runAction( Sequence::create(actionBy, actionByBack, NULL)); + _grossini->runAction( Sequence::create(actionBy, actionByBack, nullptr)); _kathia->runAction(MoveTo::create(1, Vec2(40,40))); } @@ -315,8 +315,8 @@ void ActionScale::onEnter() auto actionBy2 = ScaleBy::create(2.0f, 5.0f, 1.0f); _grossini->runAction( actionTo); - _tamara->runAction( Sequence::create(actionBy, actionBy->reverse(), NULL)); - _kathia->runAction( Sequence::create(actionBy2, actionBy2->reverse(), NULL)); + _tamara->runAction( Sequence::create(actionBy, actionBy->reverse(), nullptr)); + _kathia->runAction( Sequence::create(actionBy2, actionBy2->reverse(), nullptr)); } std::string ActionScale::subtitle() const @@ -341,10 +341,10 @@ void ActionSkew::onEnter() auto actionBy2 = SkewBy::create(2, 45.0f, 45.0f); auto actionByBack = actionBy->reverse(); - _tamara->runAction(Sequence::create(actionTo, actionToBack, NULL)); - _grossini->runAction(Sequence::create(actionBy, actionByBack, NULL)); + _tamara->runAction(Sequence::create(actionTo, actionToBack, nullptr)); + _grossini->runAction(Sequence::create(actionBy, actionByBack, nullptr)); - _kathia->runAction(Sequence::create(actionBy2, actionBy2->reverse(), NULL)); + _kathia->runAction(Sequence::create(actionBy2, actionBy2->reverse(), nullptr)); } std::string ActionSkew::subtitle() const @@ -367,9 +367,9 @@ void ActionRotationalSkew::onEnter() auto actionBy2 = RotateBy::create(2, 360, 0); auto actionBy2Back = actionBy2->reverse(); - _tamara->runAction( Sequence::create(actionBy, actionByBack, NULL) ); - _grossini->runAction( Sequence::create(actionTo, actionToBack, NULL) ); - _kathia->runAction( Sequence::create(actionBy2, actionBy2Back, NULL) ); + _tamara->runAction( Sequence::create(actionBy, actionByBack, nullptr) ); + _grossini->runAction( Sequence::create(actionTo, actionToBack, nullptr) ); + _kathia->runAction( Sequence::create(actionBy2, actionBy2Back, nullptr) ); } std::string ActionRotationalSkew::subtitle() const @@ -406,7 +406,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter() auto actionTo = SkewBy::create(2, 360, 0); auto actionToBack = SkewBy::create(2, -360, 0); - box->runAction(Sequence::create(actionTo, actionToBack, NULL)); + box->runAction(Sequence::create(actionTo, actionToBack, nullptr)); box = LayerColor::create(Color4B(255,255,0,255)); box->setAnchorPoint(Vec2(0.5,0.5)); @@ -420,7 +420,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter() this->addChild(label); auto actionTo2 = RotateBy::create(2, 360, 0); auto actionToBack2 = RotateBy::create(2, -360, 0); - box->runAction(Sequence::create(actionTo2, actionToBack2, NULL)); + box->runAction(Sequence::create(actionTo2, actionToBack2, nullptr)); } std::string ActionRotationalSkewVSStandardSkew::subtitle() const { @@ -465,9 +465,9 @@ void ActionSkewRotateScale::onEnter() auto rotateToBack = RotateTo::create(2, 0); auto actionToBack = SkewTo::create(2, 0, 0); - box->runAction(Sequence::create(actionTo, actionToBack, NULL)); - box->runAction(Sequence::create(rotateTo, rotateToBack, NULL)); - box->runAction(Sequence::create(actionScaleTo, actionScaleToBack, NULL)); + box->runAction(Sequence::create(actionTo, actionToBack, nullptr)); + box->runAction(Sequence::create(rotateTo, rotateToBack, nullptr)); + box->runAction(Sequence::create(actionScaleTo, actionScaleToBack, nullptr)); } std::string ActionSkewRotateScale::subtitle() const @@ -489,13 +489,13 @@ void ActionRotate::onEnter() auto actionTo = RotateTo::create( 2, 45); auto actionTo2 = RotateTo::create( 2, -45); auto actionTo0 = RotateTo::create(2 , 0); - _tamara->runAction( Sequence::create(actionTo, actionTo0, NULL)); + _tamara->runAction( Sequence::create(actionTo, actionTo0, nullptr)); auto actionBy = RotateBy::create(2 , 360); auto actionByBack = actionBy->reverse(); - _grossini->runAction( Sequence::create(actionBy, actionByBack, NULL)); + _grossini->runAction( Sequence::create(actionBy, actionByBack, nullptr)); - _kathia->runAction( Sequence::create(actionTo2, actionTo0->clone(), NULL)); + _kathia->runAction( Sequence::create(actionTo2, actionTo0->clone(), nullptr)); } std::string ActionRotate::subtitle() const @@ -545,7 +545,7 @@ void ActionJump::onEnter() auto actionByBack = actionBy->reverse(); _tamara->runAction( actionTo); - _grossini->runAction( Sequence::create(actionBy, actionByBack, NULL)); + _grossini->runAction( Sequence::create(actionBy, actionByBack, nullptr)); _kathia->runAction( RepeatForever::create(actionUp)); } std::string ActionJump::subtitle() const @@ -579,7 +579,7 @@ void ActionBezier::onEnter() auto bezierForward = BezierBy::create(3, bezier); auto bezierBack = bezierForward->reverse(); - auto rep = RepeatForever::create(Sequence::create( bezierForward, bezierBack, NULL)); + auto rep = RepeatForever::create(Sequence::create( bezierForward, bezierBack, nullptr)); // sprite 2 @@ -650,9 +650,9 @@ void ActionFade::onEnter() auto action2BackReverseReverse = action2BackReverse->reverse(); _tamara->setOpacity(122); - _tamara->runAction( Sequence::create( action1, action1Back, NULL)); + _tamara->runAction( Sequence::create( action1, action1Back, nullptr)); _kathia->setOpacity(122); - _kathia->runAction( Sequence::create( action2, action2Back,action2BackReverse,action2BackReverseReverse, NULL)); + _kathia->runAction( Sequence::create( action2, action2Back,action2BackReverse,action2BackReverseReverse, nullptr)); } std::string ActionFade::subtitle() const @@ -677,7 +677,7 @@ void ActionTint::onEnter() auto action2Back = action2->reverse(); _tamara->runAction( action1); - _kathia->runAction( Sequence::create( action2, action2Back, NULL)); + _kathia->runAction( Sequence::create( action2, action2Back, nullptr)); } std::string ActionTint::subtitle() const @@ -711,7 +711,7 @@ void ActionAnimate::onEnter() animation->setRestoreOriginalFrame(true); auto action = Animate::create(animation); - _grossini->runAction(Sequence::create(action, action->reverse(), NULL)); + _grossini->runAction(Sequence::create(action, action->reverse(), nullptr)); // // File animation @@ -722,7 +722,7 @@ void ActionAnimate::onEnter() auto animation2 = cache->getAnimation("dance_1"); auto action2 = Animate::create(animation2); - _tamara->runAction(Sequence::create(action2, action2->reverse(), NULL)); + _tamara->runAction(Sequence::create(action2, action2->reverse(), nullptr)); _frameDisplayedListener = EventListenerCustom::create(AnimationFrameDisplayedNotification, [](EventCustom * event){ auto userData = static_cast(event->getUserData()); @@ -774,7 +774,7 @@ void ActionSequence::onEnter() auto action = Sequence::create( MoveBy::create( 2, Vec2(240,0)), RotateBy::create( 2, 540), - NULL); + nullptr); _grossini->runAction(action); } @@ -804,7 +804,7 @@ void ActionSequence2::onEnter() CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback1,this)), CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback2,this,_grossini)), CallFunc::create( CC_CALLBACK_0(ActionSequence2::callback3,this,_grossini,0xbebabeba)), - NULL); + nullptr); _grossini->runAction(action); } @@ -855,7 +855,7 @@ void ActionCallFuncN::onEnter() auto action = Sequence::create( MoveBy::create(2.0f, Vec2(150,0)), CallFuncN::create( CC_CALLBACK_1(ActionCallFuncN::callback, this)), - NULL); + nullptr); _grossini->runAction(action); } @@ -890,7 +890,7 @@ void ActionCallFuncND::onEnter() auto action = Sequence::create( MoveBy::create(2.0f, Vec2(200,0)), CallFuncN::create( CC_CALLBACK_1(ActionCallFuncND::doRemoveFromParentAndCleanup, this, true)), - NULL); + nullptr); _grossini->runAction(action); } @@ -925,7 +925,7 @@ void ActionCallFuncO::onEnter() auto action = Sequence::create( MoveBy::create(2.0f, Vec2(200,0)), CallFunc::create( CC_CALLBACK_0(ActionCallFuncO::callback, this, _grossini, true)), - NULL); + nullptr); _grossini->runAction(action); } @@ -967,19 +967,19 @@ void ActionCallFunction::onEnter() label->setPosition(Vec2( s.width/4*1,s.height/2-40)); this->addChild(label); } ), - NULL); + nullptr); auto action2 = Sequence::create( ScaleBy::create(2 , 2), FadeOut::create(2), CallFunc::create( std::bind(&ActionCallFunction::callback2, this, _tamara) ), - NULL); + nullptr); auto action3 = Sequence::create( RotateBy::create(3 , 360), FadeOut::create(2), CallFunc::create( std::bind(&ActionCallFunction::callback3, this, _kathia, 42) ), - NULL); + nullptr); _grossini->runAction(action1); _tamara->runAction(action2); @@ -1036,7 +1036,7 @@ void ActionSpawn::onEnter() auto action = Spawn::create( JumpBy::create(2, Vec2(300,0), 50, 4), RotateBy::create( 2, 720), - NULL); + nullptr); _grossini->runAction(action); } @@ -1061,7 +1061,7 @@ void ActionRepeatForever::onEnter() auto action = Sequence::create( DelayTime::create(1), CallFunc::create( std::bind( &ActionRepeatForever::repeatForever, this, _grossini) ), - NULL); + nullptr); _grossini->runAction(action); } @@ -1092,7 +1092,7 @@ void ActionRotateToRepeat::onEnter() auto act1 = RotateTo::create(1, 90); auto act2 = RotateTo::create(1, 0); - auto seq = Sequence::create(act1, act2, NULL); + auto seq = Sequence::create(act1, act2, nullptr); auto rep1 = RepeatForever::create(seq); auto rep2 = Repeat::create( seq->clone(), 10); @@ -1120,7 +1120,7 @@ void ActionRotateJerk::onEnter() auto seq = Sequence::create( RotateTo::create(0.5f, -20), RotateTo::create(0.5f, 20), - NULL); + nullptr); auto rep1 = Repeat::create(seq, 10); auto rep2 = RepeatForever::create( seq->clone() ); @@ -1146,7 +1146,7 @@ void ActionReverse::onEnter() alignSpritesLeft(1); auto jump = JumpBy::create(2, Vec2(300,0), 50, 4); - auto action = Sequence::create( jump, jump->reverse(), NULL); + auto action = Sequence::create( jump, jump->reverse(), nullptr); _grossini->runAction(action); } @@ -1169,7 +1169,7 @@ void ActionDelayTime::onEnter() alignSpritesLeft(1); auto move = MoveBy::create(1, Vec2(150,0)); - auto action = Sequence::create( move, DelayTime::create(2), move, NULL); + auto action = Sequence::create( move, DelayTime::create(2), move, nullptr); _grossini->runAction(action); } @@ -1193,8 +1193,8 @@ void ActionReverseSequence::onEnter() auto move1 = MoveBy::create(1, Vec2(250,0)); auto move2 = MoveBy::create(1, Vec2(0,50)); - auto seq = Sequence::create( move1, move2, move1->reverse(), NULL); - auto action = Sequence::create( seq, seq->reverse(), NULL); + auto seq = Sequence::create( move1, move2, move1->reverse(), nullptr); + auto action = Sequence::create( seq, seq->reverse(), nullptr); _grossini->runAction(action); } @@ -1223,8 +1223,8 @@ void ActionReverseSequence2::onEnter() auto move2 = MoveBy::create(1, Vec2(0,50)); auto tog1 = ToggleVisibility::create(); auto tog2 = ToggleVisibility::create(); - auto seq = Sequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL); - auto action = Repeat::create(Sequence::create( seq, seq->reverse(), NULL), 3); + auto seq = Sequence::create( move1, tog1, move2, tog2, move1->reverse(), nullptr); + auto action = Repeat::create(Sequence::create( seq, seq->reverse(), nullptr), 3); // Test: @@ -1234,9 +1234,9 @@ void ActionReverseSequence2::onEnter() auto move_tamara = MoveBy::create(1, Vec2(100,0)); auto move_tamara2 = MoveBy::create(1, Vec2(50,0)); auto hide = Hide::create(); - auto seq_tamara = Sequence::create( move_tamara, hide, move_tamara2, NULL); + auto seq_tamara = Sequence::create( move_tamara, hide, move_tamara2, nullptr); auto seq_back = seq_tamara->reverse(); - _tamara->runAction( Sequence::create( seq_tamara, seq_back, NULL)); + _tamara->runAction( Sequence::create( seq_tamara, seq_back, nullptr)); } std::string ActionReverseSequence2::subtitle() const { @@ -1257,10 +1257,10 @@ void ActionRepeat::onEnter() auto a1 = MoveBy::create(1, Vec2(150,0)); auto action1 = Repeat::create( - Sequence::create( Place::create(Vec2(60,60)), a1, NULL) , + Sequence::create( Place::create(Vec2(60,60)), a1, nullptr) , 3); auto action2 = RepeatForever::create( - Sequence::create(a1->clone(), a1->reverse(), NULL) + Sequence::create(a1->clone(), a1->reverse(), nullptr) ); _kathia->runAction(action1); @@ -1308,7 +1308,7 @@ void ActionOrbit::onEnter() auto move = MoveBy::create(3, Vec2(100,-100)); auto move_back = move->reverse(); - auto seq = Sequence::create(move, move_back, NULL); + auto seq = Sequence::create(move, move_back, nullptr); auto rfe = RepeatForever::create(seq); _kathia->runAction(rfe); _tamara->runAction(rfe->clone() ); @@ -1342,7 +1342,7 @@ void ActionFollow::onEnter() _grossini->setPosition(Vec2(-200, s.height / 2)); auto move = MoveBy::create(2, Vec2(s.width * 3, 0)); auto move_back = move->reverse(); - auto seq = Sequence::create(move, move_back, NULL); + auto seq = Sequence::create(move, move_back, nullptr); auto rep = RepeatForever::create(seq); _grossini->runAction(rep); @@ -1395,7 +1395,7 @@ void ActionTargeted::onEnter() auto t1 = TargetedAction::create(_kathia, jump2); auto t2 = TargetedAction::create(_kathia, rot2); - auto seq = Sequence::create(jump1, t1, rot1, t2, NULL); + auto seq = Sequence::create(jump1, t1, rot1, t2, nullptr); auto always = RepeatForever::create(seq); _tamara->runAction(always); @@ -1426,7 +1426,7 @@ void ActionTargetedReverse::onEnter() auto t1 = TargetedAction::create(_kathia, jump2); auto t2 = TargetedAction::create(_kathia, rot2); - auto seq = Sequence::create(jump1, t1->reverse(), rot1, t2->reverse(), NULL); + auto seq = Sequence::create(jump1, t1->reverse(), rot1, t2->reverse(), nullptr); auto always = RepeatForever::create(seq); _tamara->runAction(always); @@ -1506,14 +1506,14 @@ void ActionMoveStacked::runActionsInSprite(Sprite *sprite) Sequence::create( MoveBy::create(0.05f, Vec2(10,10)), MoveBy::create(0.05f, Vec2(-10,-10)), - NULL))); + nullptr))); auto action = MoveBy::create(2.0f, Vec2(400,0)); auto action_back = action->reverse(); sprite->runAction( RepeatForever::create( - Sequence::create(action, action_back, NULL) + Sequence::create(action, action_back, nullptr) )); } @@ -1532,14 +1532,14 @@ void ActionMoveJumpStacked::runActionsInSprite(Sprite *sprite) Sequence::create( MoveBy::create(0.05f, Vec2(10,2)), MoveBy::create(0.05f, Vec2(-10,-2)), - NULL))); + nullptr))); auto jump = JumpBy::create(2.0f, Vec2(400,0), 100, 5); auto jump_back = jump->reverse(); sprite->runAction( RepeatForever::create( - Sequence::create(jump, jump_back, NULL) + Sequence::create(jump, jump_back, nullptr) )); } @@ -1562,7 +1562,7 @@ void ActionMoveBezierStacked::runActionsInSprite(Sprite *sprite) auto bezierForward = BezierBy::create(3, bezier); auto bezierBack = bezierForward->reverse(); - auto seq = Sequence::create(bezierForward, bezierBack, NULL); + auto seq = Sequence::create(bezierForward, bezierBack, nullptr); auto rep = RepeatForever::create(seq); sprite->runAction(rep); @@ -1571,7 +1571,7 @@ void ActionMoveBezierStacked::runActionsInSprite(Sprite *sprite) Sequence::create( MoveBy::create(0.05f, Vec2(10,0)), MoveBy::create(0.05f, Vec2(-10,0)), - NULL))); + nullptr))); } std::string ActionMoveBezierStacked::title() const @@ -1612,7 +1612,7 @@ void ActionCatmullRomStacked::onEnter() auto action = CatmullRomBy::create(3, array); auto reverse = action->reverse(); - auto seq = Sequence::create(action, reverse, NULL); + auto seq = Sequence::create(action, reverse, nullptr); _tamara->runAction(seq); @@ -1621,7 +1621,7 @@ void ActionCatmullRomStacked::onEnter() Sequence::create( MoveBy::create(0.05f, Vec2(10,0)), MoveBy::create(0.05f, Vec2(-10,0)), - NULL))); + nullptr))); // // sprite 2 (To) @@ -1641,7 +1641,7 @@ void ActionCatmullRomStacked::onEnter() auto action2 = CatmullRomTo::create(3, array2); auto reverse2 = action2->reverse(); - auto seq2 = Sequence::create(action2, reverse2, NULL); + auto seq2 = Sequence::create(action2, reverse2, nullptr); _kathia->runAction(seq2); @@ -1650,7 +1650,7 @@ void ActionCatmullRomStacked::onEnter() Sequence::create( MoveBy::create(0.05f, Vec2(10,0)), MoveBy::create(0.05f, Vec2(-10,0)), - NULL))); + nullptr))); array->retain(); _array1 = array; @@ -1741,7 +1741,7 @@ void ActionCardinalSplineStacked::onEnter() auto action = CardinalSplineBy::create(3, array, 0); auto reverse = action->reverse(); - auto seq = Sequence::create(action, reverse, NULL); + auto seq = Sequence::create(action, reverse, nullptr); _tamara->setPosition(Vec2(50,50)); _tamara->runAction(seq); @@ -1751,7 +1751,7 @@ void ActionCardinalSplineStacked::onEnter() Sequence::create( MoveBy::create(0.05f, Vec2(10,0)), MoveBy::create(0.05f, Vec2(-10,0)), - NULL))); + nullptr))); // // sprite 2 (By) @@ -1762,7 +1762,7 @@ void ActionCardinalSplineStacked::onEnter() auto *action2 = CardinalSplineBy::create(3, array, 1); auto reverse2 = action2->reverse(); - auto seq2 = Sequence::create(action2, reverse2, NULL); + auto seq2 = Sequence::create(action2, reverse2, nullptr); _kathia->setPosition(Vec2(s.width/2,50)); @@ -1773,7 +1773,7 @@ void ActionCardinalSplineStacked::onEnter() Sequence::create( MoveBy::create(0.05f, Vec2(10,0)), MoveBy::create(0.05f, Vec2(-10,0)), - NULL))); + nullptr))); array->retain(); _array = array; @@ -1925,7 +1925,7 @@ void Issue1305_2::onEnter() auto act7 = MoveBy::create(2, Vec2(-100, 0)); auto act8 = CallFunc::create( std::bind( &Issue1305_2::printLog4, this)); - auto actF = Sequence::create(act1, act2, act3, act4, act5, act6, act7, act8, NULL); + auto actF = Sequence::create(act1, act2, act3, act4, act5, act6, act7, act8, nullptr); // [spr runAction:actF); Director::getInstance()->getActionManager()->addAction(actF ,spr, false); @@ -1973,7 +1973,7 @@ void Issue1288::onEnter() auto act1 = MoveBy::create(0.5, Vec2(100, 0)); auto act2 = act1->reverse(); - auto act3 = Sequence::create(act1, act2, NULL); + auto act3 = Sequence::create(act1, act2, nullptr); auto act4 = Repeat::create(act3, 2); spr->runAction(act4); @@ -2032,7 +2032,7 @@ void Issue1327::onEnter() auto act8 = RotateBy::create(0.25, 45); auto act9 = CallFunc::create( std::bind(&Issue1327::logSprRotation, this, spr)); - auto actF = Sequence::create(act1, act2, act3, act4, act5, act6, act7, act8, act9, NULL); + auto actF = Sequence::create(act1, act2, act3, act4, act5, act6, act7, act8, act9, nullptr); spr->runAction(actF); } @@ -2076,7 +2076,7 @@ void Issue1398::onEnter() CallFunc::create( std::bind(&Issue1398::incrementIntegerCallback, this, (void*)"6")), CallFunc::create( std::bind(&Issue1398::incrementIntegerCallback, this, (void*)"7")), CallFunc::create( std::bind(&Issue1398::incrementIntegerCallback, this, (void*)"8")), - NULL)); + nullptr)); } void Issue1398::incrementIntegerCallback(void* data) @@ -2159,7 +2159,7 @@ void ActionCatmullRom::onEnter() auto action = CatmullRomBy::create(3, array); auto reverse = action->reverse(); - auto seq = Sequence::create(action, reverse, NULL); + auto seq = Sequence::create(action, reverse, nullptr); _tamara->runAction(seq); @@ -2182,7 +2182,7 @@ void ActionCatmullRom::onEnter() auto action2 = CatmullRomTo::create(3, array2); auto reverse2 = action2->reverse(); - auto seq2 = Sequence::create(action2, reverse2, NULL); + auto seq2 = Sequence::create(action2, reverse2, nullptr); _kathia->runAction(seq2); @@ -2275,7 +2275,7 @@ void ActionCardinalSpline::onEnter() auto action = CardinalSplineBy::create(3, array, 0); auto reverse = action->reverse(); - auto seq = Sequence::create(action, reverse, NULL); + auto seq = Sequence::create(action, reverse, nullptr); _tamara->setPosition(Vec2(50, 50)); _tamara->runAction(seq); @@ -2289,7 +2289,7 @@ void ActionCardinalSpline::onEnter() auto action2 = CardinalSplineBy::create(3, array, 1); auto reverse2 = action2->reverse(); - auto seq2 = Sequence::create(action2, reverse2, NULL); + auto seq2 = Sequence::create(action2, reverse2, nullptr); _kathia->setPosition(Vec2(s.width/2, 50)); _kathia->runAction(seq2); @@ -2428,7 +2428,7 @@ void ActionRemoveSelf::onEnter() RotateBy::create( 2, 540), ScaleTo::create(1,0.1f), RemoveSelf::create(), - NULL); + nullptr); _grossini->runAction(action); } diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index 75c4bc275a..cf288559cb 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -58,7 +58,7 @@ void BaseTest::onEnter() auto item2 = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(BaseTest::restartCallback, this) ); auto item3 = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(BaseTest::nextCallback, this) ); - auto menu = Menu::create(item1, item2, item3, NULL); + auto menu = Menu::create(item1, item2, item3, nullptr); menu->setPosition(Vec2::ZERO); item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index 5cac77d929..55acd668e8 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -130,7 +130,7 @@ void Box2DTestLayer::createResetButton() s->release(); }); - auto menu = Menu::create(reset, NULL); + auto menu = Menu::create(reset, nullptr); menu->setPosition(Vec2(VisibleRect::bottom().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp index dfadb55929..1c815f3341 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp @@ -67,7 +67,7 @@ bool MenuLayer::initWithEntryID(int entryId) auto item2 = MenuItemImage::create("Images/r1.png","Images/r2.png", CC_CALLBACK_1( MenuLayer::restartCallback, this) ); auto item3 = MenuItemImage::create("Images/f1.png", "Images/f2.png", CC_CALLBACK_1(MenuLayer::nextCallback, this) ); - auto menu = Menu::create(item1, item2, item3, NULL); + auto menu = Menu::create(item1, item2, item3, nullptr); menu->setPosition( Vec2::ZERO ); item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp index be95c13f45..556ab4f9a3 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Test.cpp @@ -25,7 +25,7 @@ void DestructionListener::SayGoodbye(b2Joint* joint) { if (test->m_mouseJoint == joint) { - test->m_mouseJoint = NULL; + test->m_mouseJoint = nullptr; } else { @@ -38,9 +38,9 @@ Test::Test() b2Vec2 gravity; gravity.Set(0.0f, -10.0f); m_world = new b2World(gravity); - m_bomb = NULL; + m_bomb = nullptr; m_textLine = 30; - m_mouseJoint = NULL; + m_mouseJoint = nullptr; m_pointCount = 0; m_destructionListener.test = this; @@ -63,7 +63,7 @@ Test::~Test() { // By deleting the world, we delete the bomb, mouse joint, etc. delete m_world; - m_world = NULL; + m_world = nullptr; } void Test::PreSolve(b2Contact* contact, const b2Manifold* oldManifold) @@ -111,7 +111,7 @@ public: QueryCallback(const b2Vec2& point) { m_point = point; - m_fixture = NULL; + m_fixture = nullptr; } bool ReportFixture(b2Fixture* fixture) @@ -141,7 +141,7 @@ bool Test::MouseDown(const b2Vec2& p) { m_mouseWorld = p; - if (m_mouseJoint != NULL) + if (m_mouseJoint != nullptr) { return false; } @@ -197,7 +197,7 @@ void Test::ShiftMouseDown(const b2Vec2& p) { m_mouseWorld = p; - if (m_mouseJoint != NULL) + if (m_mouseJoint != nullptr) { return; } @@ -210,7 +210,7 @@ void Test::MouseUp(const b2Vec2& p) if (m_mouseJoint) { m_world->DestroyJoint(m_mouseJoint); - m_mouseJoint = NULL; + m_mouseJoint = nullptr; } if (m_bombSpawning) @@ -241,7 +241,7 @@ void Test::LaunchBomb(const b2Vec2& position, const b2Vec2& velocity) if (m_bomb) { m_world->DestroyBody(m_bomb); - m_bomb = NULL; + m_bomb = nullptr; } b2BodyDef bd; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp index 2a6ef994e9..87e1d9f3ef 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp @@ -37,7 +37,7 @@ bool Bug1159Layer::init() sprite_a->runAction(RepeatForever::create(Sequence::create( MoveTo::create(1.0f, Vec2(1024.0f, 384.0f)), MoveTo::create(1.0f, Vec2(0.0f, 384.0f)), - NULL))); + nullptr))); auto sprite_b = LayerColor::create(Color4B(0, 0, 255, 255), 400, 400); sprite_b->setAnchorPoint(Vec2(0.5f, 0.5f)); @@ -46,7 +46,7 @@ bool Bug1159Layer::init() addChild(sprite_b); auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), CC_CALLBACK_1(Bug1159Layer::callBack, this) ); - auto menu = Menu::create(label, NULL); + auto menu = Menu::create(label, nullptr); menu->setPosition(Vec2(s.width - 200.0f, 50.0f)); addChild(menu); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp index 70897f806d..1cfa8861ff 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-422.cpp @@ -34,7 +34,7 @@ void Bug422Layer::reset() auto item1 = MenuItemFont::create("One", CC_CALLBACK_1(Bug422Layer::menuCallback, this) ); log("MenuItemFont: %p", item1); MenuItem *item2 = MenuItemFont::create("Two", CC_CALLBACK_1(Bug422Layer::menuCallback, this) ); - auto menu = Menu::create(item1, item2, NULL); + auto menu = Menu::create(item1, item2, nullptr); menu->alignItemsVertically(); float x = CCRANDOM_0_1() * 50; diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp index 46d61358cc..b8fa720c69 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/Bug-458.cpp @@ -28,7 +28,7 @@ bool Bug458Layer::init() auto layer2 = LayerColor::create(Color4B(255,0,0,255), 100, 100); auto sprite2 = MenuItemSprite::create(layer, layer2, CC_CALLBACK_1(Bug458Layer::selectAnswer, this) ); - auto menu = Menu::create(sprite, sprite2, NULL); + auto menu = Menu::create(sprite, sprite2, nullptr); menu->alignItemsVerticallyWithPadding(100); menu->setPosition(Vec2(size.width / 2, size.height / 2)); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp index 75c601d90f..5084bc63a1 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp @@ -52,7 +52,7 @@ bool Bug914Layer::init() auto label = Label::createWithTTF("Hello World", "fonts/Marker Felt.ttf", 64.0f); auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(Bug914Layer::restart, this)); - auto menu = Menu::create(item1, NULL); + auto menu = Menu::create(item1, nullptr); menu->alignItemsVertically(); menu->setPosition(Vec2(size.width/2, 100)); addChild(menu); diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index 63ed76bcc5..aee50d9cee 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -120,7 +120,7 @@ void BugsTestBaseLayer::onEnter() MenuItemFont::setFontSize(24); auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTestBaseLayer::backCallback, this)); pMainItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto menu = Menu::create(pMainItem, NULL); + auto menu = Menu::create(pMainItem, nullptr); menu->setPosition( Vec2::ZERO ); addChild(menu); } diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index 6db9ab2492..c6b1672922 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -58,7 +58,7 @@ ChipmunkTestLayer::ChipmunkTestLayer() MenuItemFont::setFontSize(18); auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(ChipmunkTestLayer::toggleDebugCallback, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(cocos2d::Vec2(VisibleRect::right().x-100, VisibleRect::top().y-60)); @@ -158,7 +158,7 @@ void ChipmunkTestLayer::createResetButton() { auto reset = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ChipmunkTestLayer::reset, this)); - auto menu = Menu::create(reset, NULL); + auto menu = Menu::create(reset, nullptr); menu->setPosition(cocos2d::Vec2(VisibleRect::center().x, VisibleRect::bottom().y + 30)); this->addChild(menu, -1); diff --git a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp index aadceb2063..25fc7850d6 100644 --- a/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp +++ b/tests/cpp-tests/Classes/ClickAndMoveTest/ClickAndMoveTest.cpp @@ -36,7 +36,7 @@ MainLayer::MainLayer() Sequence::create( FadeIn::create(1), FadeOut::create(1), - NULL) + nullptr) )); } diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index 9e5aae0d4b..5f40e0dbc7 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -170,7 +170,7 @@ Action* BasicTest::actionRotate() Action* BasicTest::actionScale() { auto scale = ScaleBy::create(1.33f, 1.5f); - return RepeatForever::create(Sequence::create(scale, scale->reverse(), NULL)); + return RepeatForever::create(Sequence::create(scale, scale->reverse(), nullptr)); } DrawNode* BasicTest::shape() @@ -195,7 +195,7 @@ Sprite* BasicTest::grossini() Node* BasicTest::stencil() { - return NULL; + return nullptr; } ClippingNode* BasicTest::clipper() @@ -205,7 +205,7 @@ ClippingNode* BasicTest::clipper() Node* BasicTest::content() { - return NULL; + return nullptr; } diff --git a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 7e81abb0db..249517baed 100644 --- a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -36,7 +36,7 @@ public: auto b = new Button(); if (b && !b->initSpriteButton(filePath)) { delete b; - b = NULL; + b = nullptr; } b->autorelease(); return b; @@ -47,7 +47,7 @@ public: auto b = new Button(); if (b && !b->initTextButton(text)) { delete b; - b = NULL; + b = nullptr; } b->autorelease(); return b; @@ -150,7 +150,7 @@ public: auto ret = new AudioSlider(direction); if (ret && !ret->init()) { delete ret; - ret = NULL; + ret = nullptr; } ret->autorelease(); return ret; diff --git a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp index 579ac9f61f..24dad2067e 100644 --- a/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp +++ b/tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp @@ -258,7 +258,7 @@ void ConsoleUploadFile::uploadFile() If socket(2) (or connect(2)) fails, we (close the socket and) try the next address. */ - for (rp = result; rp != NULL; rp = rp->ai_next) { + for (rp = result; rp != nullptr; rp = rp->ai_next) { sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sfd == -1) @@ -274,7 +274,7 @@ void ConsoleUploadFile::uploadFile() #endif } - if (rp == NULL) { /* No address succeeded */ + if (rp == nullptr) { /* No address succeeded */ CCLOG("ConsoleUploadFile: could not connect!"); return; } diff --git a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp index f6b936ac1a..23ef32b8f2 100644 --- a/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp +++ b/tests/cpp-tests/Classes/EffectsAdvancedTest/EffectsAdvancedTest.cpp @@ -37,8 +37,8 @@ void Effect1::onEnter() // auto orbit = OrbitCamera::create(5, 1, 2, 0, 180, 0, -90); // auto orbit_back = orbit->reverse(); - //_bgNode->runAction( RepeatForever::create( Sequence::create( orbit, orbit_back, NULL) ) ); - _bgNode->runAction( Sequence::create(lens, delay, reuse, waves, NULL) ); + //_bgNode->runAction( RepeatForever::create( Sequence::create( orbit, orbit_back, nullptr) ) ); + _bgNode->runAction( Sequence::create(lens, delay, reuse, waves, nullptr) ); } std::string Effect1::title() const @@ -79,7 +79,7 @@ void Effect2::onEnter() // id orbit_back = [orbit reverse]; // // [target runAction: [RepeatForever::create: [Sequence actions: orbit, orbit_back, nil]]]; - _bgNode->runAction(Sequence::create( shaky, delay, reuse, shuffle, delay->clone(), turnoff, turnon, NULL) ); + _bgNode->runAction(Sequence::create( shaky, delay, reuse, shuffle, delay->clone(), turnoff, turnon, nullptr) ); } std::string Effect2::title() const @@ -107,7 +107,7 @@ void Effect3::onEnter() // moving background. Testing issue #244 auto move = MoveBy::create(3, Vec2(200,0) ); - _bgNode->runAction(RepeatForever::create( Sequence::create(move, move->reverse(), NULL) )); + _bgNode->runAction(RepeatForever::create( Sequence::create(move, move->reverse(), nullptr) )); } std::string Effect3::title() const @@ -159,7 +159,7 @@ void Effect4::onEnter() auto lens = Lens3D::create(10, Size(32,24), Vec2(100,180), 150); auto move = JumpBy::create(5, Vec2(380,0), 100, 4); auto move_back = move->reverse(); - auto seq = Sequence::create( move, move_back, NULL); + auto seq = Sequence::create( move, move_back, nullptr); /* In cocos2d-iphone, the type of action's target is 'id', so it supports using the instance of 'Lens3D' as its target. While in cocos2d-x, the target of action only supports Node or its subclass, @@ -201,7 +201,7 @@ void Effect5::onEnter() StopGrid::create(), // [DelayTime::create:2], // [[effect copy] autorelease], - NULL); + nullptr); //auto bg = getChildByTag(kTagBackground); _bgNode->runAction(stopEffect); @@ -228,7 +228,7 @@ void Issue631::onEnter() { EffectAdvanceTextLayer::onEnter(); - auto effect = Sequence::create( DelayTime::create(2.0f), Shaky3D::create(5.0f, Size(5, 5), 16, false), NULL); + auto effect = Sequence::create( DelayTime::create(2.0f), Shaky3D::create(5.0f, Size(5, 5), 16, false), nullptr); // cleanup //auto bg = getChildByTag(kTagBackground); @@ -298,7 +298,7 @@ Layer* createEffectAdvanceLayer(int nIndex) case 5: return new Issue631(); } - return NULL; + return nullptr; } Layer* nextEffectAdvanceAction() @@ -356,7 +356,7 @@ void EffectAdvanceTextLayer::onEnter(void) _target1->setPosition( Vec2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3.0f, VisibleRect::bottom().y+ 200) ); auto sc = ScaleBy::create(2, 5); auto sc_back = sc->reverse(); - _target1->runAction( RepeatForever::create(Sequence::create(sc, sc_back, NULL) ) ); + _target1->runAction( RepeatForever::create(Sequence::create(sc, sc_back, nullptr) ) ); _target2 = NodeGrid::create(); @@ -367,7 +367,7 @@ void EffectAdvanceTextLayer::onEnter(void) _target2->setPosition( Vec2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3.0f,VisibleRect::bottom().y+200) ); auto sc2 = ScaleBy::create(2, 5); auto sc2_back = sc2->reverse(); - _target2->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, NULL) ) ); + _target2->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, nullptr) ) ); } diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index 4ef67521fe..724fb9846e 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -63,7 +63,7 @@ public: auto flipx_back = flipx->reverse(); auto delay = DelayTime::create(2); - return Sequence::create(flipx, delay, flipx_back, NULL); + return Sequence::create(flipx, delay, flipx_back, nullptr); } }; @@ -76,7 +76,7 @@ public: auto flipy_back = flipy->reverse(); auto delay = DelayTime::create(2); - return Sequence::create(flipy, delay, flipy_back, NULL); + return Sequence::create(flipy, delay, flipy_back, nullptr); } }; @@ -162,7 +162,7 @@ public: auto shuffle_back = shuffle->reverse(); auto delay = DelayTime::create(2); - return Sequence::create(shuffle, delay, shuffle_back, NULL); + return Sequence::create(shuffle, delay, shuffle_back, nullptr); } }; @@ -176,7 +176,7 @@ public: auto back = fadeout->reverse(); auto delay = DelayTime::create(0.5f); - return Sequence::create(fadeout, delay, back, NULL); + return Sequence::create(fadeout, delay, back, nullptr); } }; @@ -190,7 +190,7 @@ public: auto back = fadeout->reverse(); auto delay = DelayTime::create(0.5f); - return Sequence::create(fadeout, delay, back, NULL); + return Sequence::create(fadeout, delay, back, nullptr); } }; @@ -204,7 +204,7 @@ public: auto back = fadeout->reverse(); auto delay = DelayTime::create(0.5f); - return Sequence::create(fadeout, delay, back, NULL); + return Sequence::create(fadeout, delay, back, nullptr); } }; @@ -217,7 +217,7 @@ public: auto back = fadeout->reverse(); auto delay = DelayTime::create(0.5f); - return Sequence::create(fadeout, delay, back, NULL); + return Sequence::create(fadeout, delay, back, nullptr); } }; @@ -230,7 +230,7 @@ public: auto back = fadeout->reverse(); auto delay = DelayTime::create(0.5f); - return Sequence::create(fadeout, delay, back, NULL); + return Sequence::create(fadeout, delay, back, nullptr); } }; @@ -318,7 +318,7 @@ ActionInterval* createEffect(int nIndex, float t) case 21: return PageTurn3DDemo::create(t); } - return NULL; + return nullptr; } ActionInterval* getAction() @@ -357,14 +357,14 @@ TextLayer::TextLayer(void) grossini->setPosition( Vec2(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); auto sc = ScaleBy::create(2, 5); auto sc_back = sc->reverse(); - grossini->runAction( RepeatForever::create(Sequence::create(sc, sc_back, NULL) ) ); + grossini->runAction( RepeatForever::create(Sequence::create(sc, sc_back, nullptr) ) ); auto tamara = Sprite::create(s_pathSister1); _gridNodeTarget->addChild(tamara, 1); tamara->setPosition( Vec2(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) ); auto sc2 = ScaleBy::create(2, 5); auto sc2_back = sc2->reverse(); - tamara->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, NULL)) ); + tamara->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, nullptr)) ); auto label = Label::createWithTTF((effectsList[actionIdx]).c_str(), "fonts/Marker Felt.ttf", 32); @@ -378,7 +378,7 @@ TextLayer::TextLayer(void) void TextLayer::checkAnim(float dt) { //auto s2 = getChildByTag(kTagBackground); - if ( _gridNodeTarget->getNumberOfRunningActions() == 0 && _gridNodeTarget->getGrid() != NULL) + if ( _gridNodeTarget->getNumberOfRunningActions() == 0 && _gridNodeTarget->getGrid() != nullptr) _gridNodeTarget->setGrid(nullptr);; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 8e023e244d..b2cff48fa8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -591,7 +591,7 @@ std::string TestFrameEvent::title() const { return "Test Frame Event"; } -void TestFrameEvent::onFrameEvent(Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex) +void TestFrameEvent::onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex) { CCLOG("(%s) emit a frame event (%s) at frame index (%d).", bone->getName().c_str(), evt.c_str(), currentFrameIndex); @@ -633,7 +633,7 @@ void TestParticleDisplay::onEnter() ParticleSystem *p1 = CCParticleSystemQuad::create("Particles/SmallSun.plist"); ParticleSystem *p2 = CCParticleSystemQuad::create("Particles/SmallSun.plist"); - Bone *bone = Bone::create("p1"); + cocostudio::Bone *bone = cocostudio::Bone::create("p1"); bone->addDisplay(p1, 0); bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); @@ -641,7 +641,7 @@ void TestParticleDisplay::onEnter() bone->setScale(1.2f); armature->addBone(bone, "bady-a3"); - bone = Bone::create("p2"); + bone = cocostudio::Bone::create("p2"); bone->addDisplay(p2, 0); bone->changeDisplayWithIndex(0, true); bone->setIgnoreMovementBoneData(true); @@ -773,7 +773,7 @@ std::string TestColliderDetector::title() const { return "Test Collider Detector"; } -void TestColliderDetector::onFrameEvent(Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex) +void TestColliderDetector::onFrameEvent(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex) { CCLOG("(%s) emit a frame event (%s) at frame index (%d).", bone->getName().c_str(), evt.c_str(), currentFrameIndex); @@ -1025,10 +1025,10 @@ void TestColliderDetector::update(float delta) // This code is just telling how to get the vertex. // For a more accurate collider detection, you need to implemente yourself. - const Map& map = armature2->getBoneDic(); + const Map& map = armature2->getBoneDic(); for(const auto& element : map) { - Bone *bone = element.second; + cocostudio::Bone *bone = element.second; ColliderDetector *detector = bone->getColliderDetector(); if (!detector) @@ -1243,7 +1243,7 @@ void Hero::changeMount(Armature *armature) removeFromParentAndCleanup(false); //Get the hero bone - Bone *bone = armature->getBone("hero"); + cocostudio::Bone *bone = armature->getBone("hero"); //Add hero as a display to this bone bone->addDisplay(this, 0); //Change this bone's display @@ -1387,7 +1387,7 @@ void TestPlaySeveralMovement::onEnter() // int index[] = {0, 1, 2}; // std::vector indexes(index, index+3); - Armature *armature = NULL; + Armature *armature = nullptr; armature = Armature::create("Cowboy"); armature->getAnimation()->playWithNames(names); // armature->getAnimation()->playWithIndexes(indexes); @@ -1458,7 +1458,7 @@ void TestChangeAnimationInternal::onEnter() listener->onTouchesEnded = CC_CALLBACK_2(TestPlaySeveralMovement::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - Armature *armature = NULL; + Armature *armature = nullptr; armature = Armature::create("Cowboy"); armature->getAnimation()->playWithIndex(0); armature->setScale(0.2f); @@ -1558,7 +1558,7 @@ void TestLoadFromBinary::onTouchesEnded(const std::vector& touches, Even m_armatureIndex = -2; // is loading } - else if(m_armatureIndex>=0 && m_armature != NULL) + else if(m_armatureIndex>=0 && m_armature != nullptr) { this->removeChild(m_armature); m_armatureIndex = m_armatureIndex==BINARYFILECOUNT-1 ? 0 : m_armatureIndex+1; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp index 8953849118..4c5589b3d0 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/ProjectileController.cpp @@ -133,7 +133,7 @@ void ProjectileController::move(float flocationX, float flocationY) Sequence::create( MoveTo::create(realMoveDuration, realDest), callfunc, - NULL) + nullptr) ); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index e560953416..453b2189f9 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -131,7 +131,7 @@ void SceneEditorTestLayer::onEnter() _loadtypelb = cocos2d::Label::createWithSystemFont(_loadtypeStr[0], "Arial", 12); // #endif MenuItemLabel* itemlb = CCMenuItemLabel::create(_loadtypelb, CC_CALLBACK_1(SceneEditorTestLayer::changeLoadTypeCallback, this)); - Menu* loadtypemenu = CCMenu::create(itemlb, NULL); + Menu* loadtypemenu = CCMenu::create(itemlb, nullptr); loadtypemenu->setPosition(Point(VisibleRect::rightTop().x -50,VisibleRect::rightTop().y -20)); addChild(loadtypemenu,100); @@ -212,11 +212,11 @@ void SceneEditorTestLayer::changeLoadTypeCallback(cocos2d::Ref *pSender) _loadtypelb->setString(_loadtypeStr[(int)_isCsbLoad]); loadFileChangeHelper(_filePath); - if(_rootNode != NULL) + if(_rootNode != nullptr) { this->removeChild(_rootNode); _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { return ; } @@ -277,9 +277,9 @@ cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene() { _filePath = "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; //default is json _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -329,9 +329,9 @@ cocos2d::Node* SpriteComponentTest::createGameScene() { _filePath = "scenetest/SpriteComponentTest/SpriteComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); @@ -391,9 +391,9 @@ cocos2d::Node* ArmatureComponentTest::createGameScene() { _filePath = "scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -447,9 +447,9 @@ cocos2d::Node* UIComponentTest::createGameScene() { _filePath = "scenetest/UIComponentTest/UIComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); @@ -522,9 +522,9 @@ cocos2d::Node* TmxMapComponentTest::createGameScene() { _filePath = "scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -541,9 +541,9 @@ void TmxMapComponentTest::defaultPlay() ActionInterval *rotateToBack = CCRotateTo::create(2, 0); ActionInterval *actionToBack = CCSkewTo::create(2, 0, 0); - tmxMap->getNode()->runAction(CCSequence::create(actionTo, actionToBack, NULL)); - tmxMap->getNode()->runAction(CCSequence::create(rotateTo, rotateToBack, NULL)); - tmxMap->getNode()->runAction(CCSequence::create(actionScaleTo, actionScaleToBack, NULL)); + tmxMap->getNode()->runAction(CCSequence::create(actionTo, actionToBack, nullptr)); + tmxMap->getNode()->runAction(CCSequence::create(rotateTo, rotateToBack, nullptr)); + tmxMap->getNode()->runAction(CCSequence::create(actionScaleTo, actionScaleToBack, nullptr)); } ParticleComponentTest::ParticleComponentTest() @@ -584,9 +584,9 @@ cocos2d::Node* ParticleComponentTest::createGameScene() { _filePath = "scenetest/ParticleComponentTest/ParticleComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -596,7 +596,7 @@ void ParticleComponentTest::defaultPlay() { ComRender* Particle = static_cast(_rootNode->getChildByTag(10020)->getComponent("CCParticleSystemQuad")); ActionInterval* jump = CCJumpBy::create(5, Point(-500,0), 50, 4); - FiniteTimeAction* action = CCSequence::create( jump, jump->reverse(), NULL); + FiniteTimeAction* action = CCSequence::create( jump, jump->reverse(), nullptr); Particle->getNode()->runAction(action); } @@ -639,9 +639,9 @@ cocos2d::Node* EffectComponentTest::createGameScene() { _filePath = "scenetest/EffectComponentTest/EffectComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -706,9 +706,9 @@ cocos2d::Node* BackgroundComponentTest::createGameScene() { _filePath = "scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); return _rootNode; @@ -775,9 +775,9 @@ cocos2d::Node* AttributeComponentTest::createGameScene() { _filePath = "scenetest/AttributeComponentTest/AttributeComponentTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } return _rootNode; } @@ -869,9 +869,9 @@ cocos2d::Node* TriggerTest::createGameScene() { _filePath = "scenetest/TriggerTest/TriggerTest.json"; _rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str()); - if (_rootNode == NULL) + if (_rootNode == nullptr) { - return NULL; + return nullptr; } defaultPlay(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp index f9c9f39337..d48f64e1e7 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/acts.cpp @@ -71,7 +71,7 @@ void PlayMusic::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -80,14 +80,14 @@ void PlayMusic::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "componentName") { - if (str != NULL) + if (str != nullptr) { _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); } @@ -95,7 +95,7 @@ void PlayMusic::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp } else if (key == "type") { - if (str != NULL) + if (str != nullptr) { _type = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } @@ -171,7 +171,7 @@ void TMoveTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -180,14 +180,14 @@ void TMoveTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -195,14 +195,14 @@ void TMoveTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo } else if (key == "x") { - if (str != NULL) + if (str != nullptr) { _pos.x = atof(str); } } else if (key == "y") { - if (str != NULL) + if (str != nullptr) { _pos.y = atoi(str); } @@ -293,7 +293,7 @@ void TMoveBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -302,14 +302,14 @@ void TMoveBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -317,21 +317,21 @@ void TMoveBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo } else if (key == "x") { - if (str != NULL) + if (str != nullptr) { _pos.x = atof(str); } } else if (key == "y") { - if (str != NULL) + if (str != nullptr) { _pos.y = atof(str); } } else if (key == "IsReverse") { - if (str != NULL) + if (str != nullptr) { _reverse = atoi(str)!=0?true:false; //DICTOOL->getIntValue_json(subDict, "value") != 0? true: false; } @@ -406,7 +406,7 @@ void TRotateTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -415,14 +415,14 @@ void TRotateTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -430,7 +430,7 @@ void TRotateTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp } else if (key == "DeltaAngle") { - if (str != NULL) + if (str != nullptr) { _deltaAngle = atof(str); } @@ -519,7 +519,7 @@ void TRotateBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -528,14 +528,14 @@ void TRotateBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -543,14 +543,14 @@ void TRotateBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExp } else if (key == "DeltaAngle") { - if (str != NULL) + if (str != nullptr) { _deltaAngle = atof(str); } } else if (key == "IsReverse") { - if (str != NULL) + if (str != nullptr) { _reverse = atoi(str)!=0?true:false; } @@ -629,7 +629,7 @@ void TScaleTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -638,14 +638,14 @@ void TScaleTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -653,14 +653,14 @@ void TScaleTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC } else if (key == "ScaleX") { - if (str != NULL) + if (str != nullptr) { _scale.x = atof(str); } } else if (key == "ScaleY") { - if (str != NULL) + if (str != nullptr) { _scale.y = atof(str); } @@ -753,7 +753,7 @@ void TScaleBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -762,14 +762,14 @@ void TScaleBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -777,21 +777,21 @@ void TScaleBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpC } else if (key == "ScaleX") { - if (str != NULL) + if (str != nullptr) { _scale.x = atof(str); } } else if (key == "ScaleY") { - if (str != NULL) + if (str != nullptr) { _scale.y = atof(str); } } else if (key == "IsReverse") { - if (str != NULL) + if (str != nullptr) { _reverse = atoi(str)!=0?true:false; //DICTOOL->getIntValue_json(subDict, "value")!= 0? true:false; } @@ -871,7 +871,7 @@ void TSkewTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -880,14 +880,14 @@ void TSkewTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -895,14 +895,14 @@ void TSkewTo::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo } else if (key == "SkewX") { - if (str != NULL) + if (str != nullptr) { _skew.x = atof(str); } } else if (key == "SkewY") { - if (str != NULL) + if (str != nullptr) { _skew.y = atof(str); } @@ -994,7 +994,7 @@ void TSkewBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -1003,14 +1003,14 @@ void TSkewBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str); } } else if (key == "Duration") { - if (str != NULL) + if (str != nullptr) { _duration = atof(str); } @@ -1018,14 +1018,14 @@ void TSkewBy::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stExpCo } else if (key == "SkewX") { - if (str != NULL) + if (str != nullptr) { _skew.x = atof(str); } } else if (key == "SkewY") { - if (str != NULL) + if (str != nullptr) { _skew.y = atof(str); } @@ -1108,7 +1108,7 @@ void TriggerState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::st int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -1117,14 +1117,14 @@ void TriggerState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::st str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "ID") { - if (str != NULL) + if (str != nullptr) { _id = atoi(str); } } else if (key == "State") { - if (str != NULL) + if (str != nullptr) { _state = atoi(str); } @@ -1197,7 +1197,7 @@ void ArmaturePlayAction::serialize(cocostudio::CocoLoader *pCocoLoader, cocostud int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -1206,14 +1206,14 @@ void ArmaturePlayAction::serialize(cocostudio::CocoLoader *pCocoLoader, cocostud str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "componentName") { - if (str != NULL) + if (str != nullptr) { _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); } @@ -1221,7 +1221,7 @@ void ArmaturePlayAction::serialize(cocostudio::CocoLoader *pCocoLoader, cocostud } else if (key == "AnimationName") { - if (str != NULL) + if (str != nullptr) { _aniname = str; //DICTOOL->getStringValue_json(subDict, "value"); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp index a33b2bd455..9ed21d1579 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/TriggerCode/cons.cpp @@ -53,7 +53,7 @@ void TimeElapsed::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stE int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -62,7 +62,7 @@ void TimeElapsed::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stE str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "TotalTime") { - if (str != NULL) + if (str != nullptr) { _totalTime = atof(str); //DICTOOL->getFloatValue_json(subDict, "value"); } @@ -153,7 +153,7 @@ void ArmatureActionState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostu int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -162,14 +162,14 @@ void ArmatureActionState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostu str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "componentName") { - if (str != NULL) + if (str != nullptr) { _comName = str; //DICTOOL->getStringValue_json(subDict, "value"); } @@ -177,14 +177,14 @@ void ArmatureActionState::serialize(cocostudio::CocoLoader *pCocoLoader, cocostu } else if (key == "AnimationName") { - if (str != NULL) + if (str != nullptr) { _aniname = str; //DICTOOL->getStringValue_json(subDict, "value"); } } else if (key == "ActionType") { - if (str != NULL) + if (str != nullptr) { _state = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } @@ -281,7 +281,7 @@ void NodeInRect::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stEx int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -290,35 +290,35 @@ void NodeInRect::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stEx str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "originX") { - if (str != NULL) + if (str != nullptr) { _origin.x = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "originY") { - if (str != NULL) + if (str != nullptr) { _origin.y = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "sizeWidth") { - if (str != NULL) + if (str != nullptr) { _size.width = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "sizeHeight") { - if (str != NULL) + if (str != nullptr) { _size.height = atoi(str); //DICTOOL->getIntValue_json(subDict, "value"); } @@ -383,7 +383,7 @@ void NodeVisible::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stE int count = 0; stExpCocoNode *pDataItemsArray = pCocoNode->GetChildArray(pCocoLoader); std::string key; - const char *str = NULL; + const char *str = nullptr; for (int i = 0; i < length; ++i) { count = pDataItemsArray[i].GetChildNum(); @@ -392,14 +392,14 @@ void NodeVisible::serialize(cocostudio::CocoLoader *pCocoLoader, cocostudio::stE str = pDataItemArray[1].GetValue(pCocoLoader); if (key == "Tag") { - if (str != NULL) + if (str != nullptr) { _tag = atoi(str);//DICTOOL->getIntValue_json(subDict, "value"); } } else if (key == "Visible") { - if (str != NULL) + if (str != nullptr) { _visible = atoi(str) != 0? true:false;//DICTOOL->getIntValue_json(subDict, "value") != 0? true:false; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp index 5be1a5b633..b073dc712e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/AnimationsTest/AnimationsTestLayer.cpp @@ -15,7 +15,7 @@ AnimationsTestLayer::~AnimationsTestLayer() SEL_MenuHandler AnimationsTestLayer::onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } Control::Handler AnimationsTestLayer::onResolveCCBCCControlSelector(Ref *pTarget, const char*pSelectorName) @@ -25,7 +25,7 @@ Control::Handler AnimationsTestLayer::onResolveCCBCCControlSelector(Ref *pTarget CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonJumpClicked", AnimationsTestLayer::onControlButtonJumpClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonFunkyClicked", AnimationsTestLayer::onControlButtonFunkyClicked); - return NULL; + return nullptr; } bool AnimationsTestLayer::onAssignCCBMemberVariable(Ref * pTarget, const char * pMemberVariableName, Node * pNode) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp index 13b7d55000..340ac0773f 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/ButtonTest/ButtonTestLayer.cpp @@ -14,13 +14,13 @@ ButtonTestLayer::~ButtonTestLayer() } SEL_MenuHandler ButtonTestLayer::onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } Control::Handler ButtonTestLayer::onResolveCCBCCControlSelector(Ref * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonClicked", ButtonTestLayer::onControlButtonClicked); - return NULL; + return nullptr; } bool ButtonTestLayer::onAssignCCBMemberVariable(Ref * pTarget, const char * pMemberVariableName, Node * pNode) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp index f63af2aca5..c367915891 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/CocosBuilderTest.cpp @@ -44,7 +44,7 @@ void CocosBuilderTestScene::runThisTest() { ccbReader->release(); - if(node != NULL) { + if(node != nullptr) { this->addChild(node); } @@ -65,7 +65,7 @@ void CocosBuilderTestScene::runThisTest() { // /* Read a ccbi file. */ // auto node = ccbReader->readNodeGraphFromFile("ccb/simple/pub/", "ccb/test.ccbi", ccbiReaderLayer); // -// if(node != NULL) { +// if(node != nullptr) { // ccbiReaderLayer->addChild(node); // } // diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp index 36a83eb5cc..b8769819da 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder/HelloCocosBuilderLayer.cpp @@ -30,7 +30,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); ccNodeLoaderLibrary->registerNodeLoader("TestHeaderLayer", TestHeaderLayerLoader::loader()); - if(nodeName != NULL && nodeLoader != NULL) { + if(nodeName != nullptr && nodeLoader != nullptr) { ccNodeLoaderLibrary->registerNodeLoader(nodeName, nodeLoader); } @@ -48,7 +48,7 @@ void HelloCocosBuilderLayer::openTest(const char * pCCBFileName, const char * no this->mTestTitleLabelTTF->setString(pCCBFileName); auto scene = Scene::create(); - if(node != NULL) { + if(node != nullptr) { scene->addChild(node); } @@ -70,7 +70,7 @@ void HelloCocosBuilderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::N SEL_MenuHandler HelloCocosBuilderLayer::onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } Control::Handler HelloCocosBuilderLayer::onResolveCCBCCControlSelector(Ref * pTarget, const char * pSelectorName) { @@ -82,7 +82,7 @@ Control::Handler HelloCocosBuilderLayer::onResolveCCBCCControlSelector(Ref * pTa CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onScrollViewTestClicked", HelloCocosBuilderLayer::onScrollViewTestClicked); CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onTimelineCallbackSoundClicked", HelloCocosBuilderLayer::onTimelineCallbackSoundClicked); - return NULL; + return nullptr; } bool HelloCocosBuilderLayer::onAssignCCBMemberVariable(Ref * pTarget, const char * pMemberVariableName, Node * pNode) { @@ -164,7 +164,7 @@ void HelloCocosBuilderLayer::onAnimationsTestClicked(Ref * sender, Control::Even this->mTestTitleLabelTTF->setString("TestAnimations.ccbi"); auto scene = Scene::create(); - if(animationsTest != NULL) { + if(animationsTest != nullptr) { scene->addChild(animationsTest); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp index 822c007ed4..c01c44fd94 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TestHeader/TestHeaderLayer.cpp @@ -7,12 +7,12 @@ using namespace cocosbuilder; SEL_MenuHandler TestHeaderLayer::onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName) { CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(this, "onBackClicked", TestHeaderLayer::onBackClicked); - return NULL; + return nullptr; } Control::Handler TestHeaderLayer::onResolveCCBCCControlSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } void TestHeaderLayer::onNodeLoaded(cocos2d::Node * node, cocosbuilder::NodeLoader * nodeLoader) diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp index f4c16a3956..41776bb373 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocosBuilderTest/TimelineCallbackTest/TimelineCallbackTestLayer.cpp @@ -15,18 +15,18 @@ TimelineCallbackTestLayer::~TimelineCallbackTestLayer() } SEL_MenuHandler TimelineCallbackTestLayer::onResolveCCBCCMenuItemSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } Control::Handler TimelineCallbackTestLayer::onResolveCCBCCControlSelector(Ref * pTarget, const char * pSelectorName) { - return NULL; + return nullptr; } SEL_CallFuncN TimelineCallbackTestLayer::onResolveCCBCCCallFuncSelector(Ref * pTarget, const char* pSelectorName) { CCB_SELECTORRESOLVER_CALLFUNC_GLUE(this, "onCallback1", TimelineCallbackTestLayer::onCallback1); CCB_SELECTORRESOLVER_CALLFUNC_GLUE(this, "onCallback2", TimelineCallbackTestLayer::onCallback2); - return NULL; + return nullptr; } bool TimelineCallbackTestLayer::onAssignCCBMemberVariable(Ref * pTarget, const char * pMemberVariableName, Node * pNode) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp index 53f0a9028c..764bd139f3 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp @@ -44,7 +44,7 @@ bool ControlScene::init() { auto pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(ControlScene::toExtensionsMainLayer, this)); pBackItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto pBackMenu = Menu::create(pBackItem, NULL); + auto pBackMenu = Menu::create(pBackItem, nullptr); pBackMenu->setPosition( Vec2::ZERO ); addChild(pBackMenu, 10); @@ -69,7 +69,7 @@ bool ControlScene::init() auto item2 = MenuItemImage::create("Images/r1.png", "Images/r2.png", CC_CALLBACK_1(ControlScene::restartCallback, this)); auto item3 = MenuItemImage::create("Images/f1.png", "Images/f2.png", CC_CALLBACK_1(ControlScene::nextCallback, this)); - auto menu = Menu::create(item1, item3, item2, NULL); + auto menu = Menu::create(item1, item3, item2, nullptr); menu->setPosition(Vec2::ZERO); item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp index 2c5105c8c1..fb0f2d7128 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSceneManager.cpp @@ -58,7 +58,7 @@ static const char* s_testArray[] = { "CCControlStepperTest" }; -static ControlSceneManager *sharedInstance = NULL; +static ControlSceneManager *sharedInstance = nullptr; ControlSceneManager::ControlSceneManager() @@ -73,7 +73,7 @@ ControlSceneManager::~ControlSceneManager() ControlSceneManager * ControlSceneManager::sharedControlSceneManager() { - if (sharedInstance == NULL) + if (sharedInstance == nullptr) { sharedInstance = new ControlSceneManager(); } @@ -111,5 +111,5 @@ Scene *ControlSceneManager::currentControlScene() case kControlPotentiometerTest:return ControlPotentiometerTest::sceneWithTitle(s_testArray[_currentControlSceneId]); case kControlStepperTest:return ControlStepperTest::sceneWithTitle(s_testArray[_currentControlSceneId]); } - return NULL; + return nullptr; } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index 8d465d6390..b54a42aa32 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -30,7 +30,7 @@ EditBoxTest::EditBoxTest() // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(EditBoxTest::toExtensionsMainLayer, this)); itemBack->setPosition(Vec2(visibleOrigin.x+visibleSize.width - 50, visibleOrigin.y+25)); - auto menuBack = Menu::create(itemBack, NULL); + auto menuBack = Menu::create(itemBack, nullptr); menuBack->setPosition(Vec2::ZERO); addChild(menuBack); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 46ff3e394e..ed957a8ef4 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -93,7 +93,7 @@ HttpClientTest::HttpClientTest() // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(HttpClientTest::toExtensionsMainLayer, this)); itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto menuBack = Menu::create(itemBack, NULL); + auto menuBack = Menu::create(itemBack, nullptr); menuBack->setPosition(Vec2::ZERO); addChild(menuBack); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 8d6688c96f..7cb06136ad 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -18,7 +18,7 @@ SocketIOTestLayer::SocketIOTestLayer(void) : _sioClient(nullptr) , _sioEndpoint(nullptr) { - //set the clients to NULL until we are ready to connect + //set the clients to nullptr until we are ready to connect Size winSize = Director::getInstance()->getWinSize(); @@ -90,7 +90,7 @@ SocketIOTestLayer::SocketIOTestLayer(void) // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(SocketIOTestLayer::toExtensionsMainLayer, this)); itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto menuBack = Menu::create(itemBack, NULL); + auto menuBack = Menu::create(itemBack, nullptr); menuBack->setPosition(Vec2::ZERO); addChild(menuBack); @@ -163,45 +163,45 @@ void SocketIOTestLayer::onMenuSIOEndpointClicked(cocos2d::Ref *sender) void SocketIOTestLayer::onMenuTestMessageClicked(cocos2d::Ref *sender) { - //check that the socket is != NULL before sending or emitting events - //the client should be NULL either before initialization and connection or after disconnect - if(_sioClient != NULL) _sioClient->send("Hello Socket.IO!"); + //check that the socket is != nullptr before sending or emitting events + //the client should be nullptr either before initialization and connection or after disconnect + if(_sioClient != nullptr) _sioClient->send("Hello Socket.IO!"); } void SocketIOTestLayer::onMenuTestMessageEndpointClicked(cocos2d::Ref *sender) { - if(_sioEndpoint != NULL) _sioEndpoint->send("Hello Socket.IO!"); + if(_sioEndpoint != nullptr) _sioEndpoint->send("Hello Socket.IO!"); } void SocketIOTestLayer::onMenuTestEventClicked(cocos2d::Ref *sender) { - //check that the socket is != NULL before sending or emitting events - //the client should be NULL either before initialization and connection or after disconnect - if(_sioClient != NULL) _sioClient->emit("echotest","[{\"name\":\"myname\",\"type\":\"mytype\"}]"); + //check that the socket is != nullptr before sending or emitting events + //the client should be nullptr either before initialization and connection or after disconnect + if(_sioClient != nullptr) _sioClient->emit("echotest","[{\"name\":\"myname\",\"type\":\"mytype\"}]"); } void SocketIOTestLayer::onMenuTestEventEndpointClicked(cocos2d::Ref *sender) { - if(_sioEndpoint != NULL) _sioEndpoint->emit("echotest","[{\"name\":\"myname\",\"type\":\"mytype\"}]"); + if(_sioEndpoint != nullptr) _sioEndpoint->emit("echotest","[{\"name\":\"myname\",\"type\":\"mytype\"}]"); } void SocketIOTestLayer::onMenuTestClientDisconnectClicked(cocos2d::Ref *sender) { - if(_sioClient != NULL) _sioClient->disconnect(); + if(_sioClient != nullptr) _sioClient->disconnect(); } void SocketIOTestLayer::onMenuTestEndpointDisconnectClicked(cocos2d::Ref *sender) { - if(_sioEndpoint != NULL) _sioEndpoint->disconnect(); + if(_sioEndpoint != nullptr) _sioEndpoint->disconnect(); } @@ -235,14 +235,14 @@ void SocketIOTestLayer::onClose(network::SIOClient* client) s << client->getTag() << " closed!"; _sioClientStatus->setString(s.str().c_str()); - //set the local pointer to NULL or connect to another client + //set the local pointer to nullptr or connect to another client //the client object will be released on its own after this method completes if(client == _sioClient) { - _sioClient = NULL; + _sioClient = nullptr; } else if(client == _sioEndpoint) { - _sioEndpoint = NULL; + _sioEndpoint = nullptr; } } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index b33ddc961d..8c51def727 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -69,7 +69,7 @@ WebSocketTestLayer::WebSocketTestLayer() // Back Menu auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(WebSocketTestLayer::toExtensionsMainLayer, this)); itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto menuBack = Menu::create(itemBack, NULL); + auto menuBack = Menu::create(itemBack, nullptr); menuBack->setPosition(Vec2::ZERO); addChild(menuBack); @@ -166,15 +166,15 @@ void WebSocketTestLayer::onClose(network::WebSocket* ws) log("websocket instance (%p) closed.", ws); if (ws == _wsiSendText) { - _wsiSendText = NULL; + _wsiSendText = nullptr; } else if (ws == _wsiSendBinary) { - _wsiSendBinary = NULL; + _wsiSendBinary = nullptr; } else if (ws == _wsiError) { - _wsiError = NULL; + _wsiError = nullptr; } // Delete websocket instance. CC_SAFE_DELETE(ws); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index 1a37df2876..5df50ea32d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -49,7 +49,7 @@ void Light::setIsConnectToSwitch(bool bConnectToSwitch) _connected = bConnectToSwitch; if (_connected) { - NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(Light::switchStateChanged), MSG_SWITCH_STATE, NULL); + NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(Light::switchStateChanged), MSG_SWITCH_STATE, nullptr); } else { @@ -83,7 +83,7 @@ NotificationCenterTest::NotificationCenterTest() auto pBackItem = MenuItemFont::create("Back", CC_CALLBACK_1(NotificationCenterTest::toExtensionsMainLayer, this)); pBackItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto pBackMenu = Menu::create(pBackItem, NULL); + auto pBackMenu = Menu::create(pBackItem, nullptr); pBackMenu->setPosition( Vec2::ZERO ); addChild(pBackMenu); @@ -91,10 +91,10 @@ NotificationCenterTest::NotificationCenterTest() auto label2 = Label::createWithTTF("switch on", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); - auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::toggleSwitch, this), item1, item2, NULL); + auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::toggleSwitch, this), item1, item2, nullptr); // turn on item->setSelectedIndex(1); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); menu->setPosition(Vec2(s.width/2+100, s.height/2)); addChild(menu); @@ -113,7 +113,7 @@ NotificationCenterTest::NotificationCenterTest() auto label2 = Label::createWithTTF("connected", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); - auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::connectToSwitch, this), item1, item2, NULL); + auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::connectToSwitch, this), item1, item2, nullptr); item->setTag(kTagConnect+i); item->setPosition(Vec2(light->getPosition().x, light->getPosition().y+50)); menuConnect->addChild(item, 0); @@ -128,9 +128,9 @@ NotificationCenterTest::NotificationCenterTest() NotificationCenter::getInstance()->postNotification(MSG_SWITCH_STATE, (Ref*)(intptr_t)item->getSelectedIndex()); /* for testing removeAllObservers */ - NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer1", NULL); - NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer2", NULL); - NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer3", NULL); + NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer1", nullptr); + NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer2", nullptr); + NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(NotificationCenterTest::doNothing), "random-observer3", nullptr); } void NotificationCenterTest::toExtensionsMainLayer(cocos2d::Ref* sender) diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp index 07982e6498..8f86aae1c7 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp @@ -662,7 +662,7 @@ void S9CascadeOpacityAndColor::onEnter() TintTo::create(1, 0, 255, 0), TintTo::create(1, 255, 255, 255), FadeOut::create(1), - NULL); + nullptr); auto repeat = RepeatForever::create(actions); rgba->runAction(repeat); log("this->addChild"); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index 0bf1dc7681..e472e9e912 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -41,7 +41,7 @@ bool TableViewTestLayer::init() // Back Menu MenuItemFont *itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(TableViewTestLayer::toExtensionsMainLayer, this)); itemBack->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - Menu *menuBack = Menu::create(itemBack, NULL); + Menu *menuBack = Menu::create(itemBack, nullptr); menuBack->setPosition(Vec2::ZERO); addChild(menuBack); diff --git a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp index 5a84b24595..09192591eb 100644 --- a/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp +++ b/tests/cpp-tests/Classes/IntervalTest/IntervalTest.cpp @@ -55,7 +55,7 @@ IntervalLayer::IntervalLayer() auto jump = JumpBy::create(3, Vec2(s.width-80,0), 50, 4); addChild(sprite); - sprite->runAction( RepeatForever::create(Sequence::create(jump, jump->reverse(), NULL) )); + sprite->runAction( RepeatForever::create(Sequence::create(jump, jump->reverse(), nullptr) )); // pause button auto item1 = MenuItemFont::create("Pause", [&](Ref* sender) { if(Director::getInstance()->isPaused()) @@ -63,7 +63,7 @@ IntervalLayer::IntervalLayer() else Director::getInstance()->pause(); }); - auto menu = Menu::create(item1, NULL); + auto menu = Menu::create(item1, nullptr); menu->setPosition( Vec2(s.width/2, s.height-50) ); addChild( menu ); diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp index 2dc431e502..b641d89676 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp @@ -307,7 +307,7 @@ LabelAtlasColorTest::LabelAtlasColorTest() auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); auto cb = CallFunc::create(CC_CALLBACK_0(LabelAtlasColorTest::actionFinishCallback, this)); - auto seq = Sequence::create(fade, fade_in, cb, NULL); + auto seq = Sequence::create(fade, fade_in, cb, nullptr); auto repeat = RepeatForever::create( seq ); label2->runAction( repeat ); @@ -426,7 +426,7 @@ Atlas3::Atlas3() auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), TintTo::create(1, 0, 255, 0), TintTo::create(1, 0, 0, 255), - NULL); + nullptr); label2->runAction( RepeatForever::create(tint) ); auto label3 = LabelBMFont::create("Test", "fonts/bitmapFontTest2.fnt"); @@ -504,7 +504,7 @@ Atlas4::Atlas4() auto scale = ScaleBy::create(2, 1.5f); auto scale_back = scale->reverse(); - auto scale_seq = Sequence::create(scale, scale_back,NULL); + auto scale_seq = Sequence::create(scale, scale_back,nullptr); auto scale_4ever = RepeatForever::create(scale_seq); auto jump = JumpBy::create(0.5f, Vec2::ZERO, 60, 1); @@ -512,7 +512,7 @@ Atlas4::Atlas4() auto fade_out = FadeOut::create(1); auto fade_in = FadeIn::create(1); - auto seq = Sequence::create(fade_out, fade_in, NULL); + auto seq = Sequence::create(fade_out, fade_in, nullptr); auto fade_4ever = RepeatForever::create(seq); BChar->runAction(rot_4ever); @@ -623,7 +623,7 @@ Atlas6::Atlas6() { auto s = Director::getInstance()->getWinSize(); - LabelBMFont* label = NULL; + LabelBMFont* label = nullptr; label = LabelBMFont::create("FaFeFiFoFu", "fonts/bitmapFontTest5.fnt"); addChild(label); label->setPosition( Vec2(s.width/2, s.height/2+50) ); @@ -964,7 +964,7 @@ LabelTTFTest::LabelTTFTest() MenuItemFont::create("Left", CC_CALLBACK_1(LabelTTFTest::setAlignmentLeft, this)), MenuItemFont::create("Center", CC_CALLBACK_1(LabelTTFTest::setAlignmentCenter, this)), MenuItemFont::create("Right", CC_CALLBACK_1(LabelTTFTest::setAlignmentRight, this)), - NULL); + nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50, s.height / 2 - 20)); this->addChild(menu); @@ -973,7 +973,7 @@ LabelTTFTest::LabelTTFTest() MenuItemFont::create("Top", CC_CALLBACK_1(LabelTTFTest::setAlignmentTop, this)), MenuItemFont::create("Middle", CC_CALLBACK_1(LabelTTFTest::setAlignmentMiddle, this)), MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelTTFTest::setAlignmentBottom, this)), - NULL); + nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); this->addChild(menu); @@ -1050,8 +1050,8 @@ void LabelTTFTest::setAlignmentBottom(Ref* sender) const char* LabelTTFTest::getCurrentAlignment() { - const char* vertical = NULL; - const char* horizontal = NULL; + const char* vertical = nullptr; + const char* horizontal = nullptr; switch (_vertAlign) { case TextVAlignment::TOP: vertical = "Top"; @@ -1184,7 +1184,7 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment() auto longSentences = MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(BitmapFontMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", CC_CALLBACK_1(BitmapFontMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", CC_CALLBACK_1(BitmapFontMultiLineAlignment::stringChanged, this)); - auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, NULL); + auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, nullptr); stringMenu->alignItemsVertically(); longSentences->setColor(Color3B::RED); @@ -1198,7 +1198,7 @@ BitmapFontMultiLineAlignment::BitmapFontMultiLineAlignment() auto left = MenuItemFont::create("Left", CC_CALLBACK_1(BitmapFontMultiLineAlignment::alignmentChanged, this)); auto center = MenuItemFont::create("Center", CC_CALLBACK_1(BitmapFontMultiLineAlignment::alignmentChanged, this)); auto right = MenuItemFont::create("Right", CC_CALLBACK_1(BitmapFontMultiLineAlignment::alignmentChanged, this)); - auto alignmentMenu = Menu::create(left, center, right, NULL); + auto alignmentMenu = Menu::create(left, center, right, nullptr); alignmentMenu->alignItemsHorizontallyWithPadding(alignmentItemPadding); center->setColor(Color3B::RED); @@ -1359,7 +1359,7 @@ LabelTTFA8Test::LabelTTFA8Test() auto fadeOut = FadeOut::create(2); auto fadeIn = FadeIn::create(2); - auto seq = Sequence::create(fadeOut, fadeIn, NULL); + auto seq = Sequence::create(fadeOut, fadeIn, nullptr); auto forever = RepeatForever::create(seq); label1->runAction(forever); } diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index df69db7b8a..9dca43b4ae 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -210,7 +210,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() addChild(label1, 0, kTagBitmapAtlas1); auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); - auto seq = Sequence::create(fade, fade_in, NULL); + auto seq = Sequence::create(fade, fade_in, nullptr); auto repeat = RepeatForever::create(seq); label1->runAction(repeat); @@ -220,7 +220,7 @@ LabelFNTColorAndOpacity::LabelFNTColorAndOpacity() auto tint = Sequence::create(TintTo::create(1, 255, 0, 0), TintTo::create(1, 0, 255, 0), TintTo::create(1, 0, 0, 255), - NULL); + nullptr); label2->runAction( RepeatForever::create(tint) ); auto label3 = Label::createWithBMFont("fonts/bitmapFontTest2.fnt", "Test"); @@ -282,7 +282,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto scale = ScaleBy::create(2, 1.5f); auto scale_back = scale->reverse(); - auto scale_seq = Sequence::create(scale, scale_back,NULL); + auto scale_seq = Sequence::create(scale, scale_back,nullptr); auto scale_4ever = RepeatForever::create(scale_seq); auto jump = JumpBy::create(0.5f, Vec2::ZERO, 60, 1); @@ -290,7 +290,7 @@ LabelFNTSpriteActions::LabelFNTSpriteActions() auto fade_out = FadeOut::create(1); auto fade_in = FadeIn::create(1); - auto seq = Sequence::create(fade_out, fade_in, NULL); + auto seq = Sequence::create(fade_out, fade_in, nullptr); auto fade_4ever = RepeatForever::create(seq); BChar->runAction(rot_4ever); @@ -689,7 +689,7 @@ LabelFNTMultiLineAlignment::LabelFNTMultiLineAlignment() auto longSentences = MenuItemFont::create("Long Flowing Sentences", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto lineBreaks = MenuItemFont::create("Short Sentences With Intentional Line Breaks", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); auto mixed = MenuItemFont::create("Long Sentences Mixed With Intentional Line Breaks", CC_CALLBACK_1(LabelFNTMultiLineAlignment::stringChanged, this)); - auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, NULL); + auto stringMenu = Menu::create(longSentences, lineBreaks, mixed, nullptr); stringMenu->alignItemsVertically(); longSentences->setColor(Color3B::RED); @@ -703,7 +703,7 @@ LabelFNTMultiLineAlignment::LabelFNTMultiLineAlignment() auto left = MenuItemFont::create("Left", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); auto center = MenuItemFont::create("Center", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); auto right = MenuItemFont::create("Right", CC_CALLBACK_1(LabelFNTMultiLineAlignment::alignmentChanged, this)); - auto alignmentMenu = Menu::create(left, center, right, NULL); + auto alignmentMenu = Menu::create(left, center, right, nullptr); alignmentMenu->alignItemsHorizontallyWithPadding(alignmentItemPadding); center->setColor(Color3B::RED); @@ -1008,7 +1008,7 @@ LabelTTFDynamicAlignment::LabelTTFDynamicAlignment() MenuItemFont::create("Left", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentLeft, this)), MenuItemFont::create("Center", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentCenter, this)), MenuItemFont::create("Right", CC_CALLBACK_1(LabelTTFDynamicAlignment::setAlignmentRight, this)), - NULL); + nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50, size.height / 4 )); @@ -1436,7 +1436,7 @@ LabelCharMapColorTest::LabelCharMapColorTest() auto fade = FadeOut::create(1.0f); auto fade_in = fade->reverse(); auto cb = CallFunc::create(CC_CALLBACK_0(LabelCharMapColorTest::actionFinishCallback, this)); - auto seq = Sequence::create(fade, fade_in, cb, NULL); + auto seq = Sequence::create(fade, fade_in, cb, nullptr); auto repeat = RepeatForever::create( seq ); label2->runAction( repeat ); @@ -1612,7 +1612,7 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::create("Left", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentLeft, this)), MenuItemFont::create("Center", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentCenter, this)), MenuItemFont::create("Right", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentRight, this)), - NULL); + nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(50, s.height / 2 - 20)); this->addChild(menu); @@ -1621,7 +1621,7 @@ LabelAlignmentTest::LabelAlignmentTest() MenuItemFont::create("Top", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentTop, this)), MenuItemFont::create("Middle", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentMiddle, this)), MenuItemFont::create("Bottom", CC_CALLBACK_1(LabelAlignmentTest::setAlignmentBottom, this)), - NULL); + nullptr); menu->alignItemsVerticallyWithPadding(4); menu->setPosition(Vec2(s.width - 50, s.height / 2 - 20)); this->addChild(menu); @@ -1690,8 +1690,8 @@ void LabelAlignmentTest::setAlignmentBottom(Ref* sender) const char* LabelAlignmentTest::getCurrentAlignment() { - const char* vertical = NULL; - const char* horizontal = NULL; + const char* vertical = nullptr; + const char* horizontal = nullptr; switch (_vertAlign) { case TextVAlignment::TOP: vertical = "Top"; diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index 431daeba67..58f958c477 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -151,7 +151,7 @@ void LayerTestCascadingOpacityA::onEnter() FadeTo::create(4, 0), FadeTo::create(4, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -161,7 +161,7 @@ void LayerTestCascadingOpacityA::onEnter() FadeTo::create(2, 0), FadeTo::create(2, 255), DelayTime::create(1), - NULL))); + nullptr))); // Enable cascading in scene setEnableRecursiveCascading(this, true); @@ -203,7 +203,7 @@ void LayerTestCascadingOpacityB::onEnter() FadeTo::create(4, 0), FadeTo::create(4, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -213,7 +213,7 @@ void LayerTestCascadingOpacityB::onEnter() FadeTo::create(2, 0), FadeTo::create(2, 255), DelayTime::create(1), - NULL))); + nullptr))); // Enable cascading in scene setEnableRecursiveCascading(this, true); @@ -256,7 +256,7 @@ void LayerTestCascadingOpacityC::onEnter() FadeTo::create(4, 0), FadeTo::create(4, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -266,7 +266,7 @@ void LayerTestCascadingOpacityC::onEnter() FadeTo::create(2, 0), FadeTo::create(2, 255), DelayTime::create(1), - NULL))); + nullptr))); } std::string LayerTestCascadingOpacityC::subtitle() const @@ -304,7 +304,7 @@ void LayerTestCascadingColorA::onEnter() TintTo::create(6, 255, 0, 255), TintTo::create(6, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -316,7 +316,7 @@ void LayerTestCascadingColorA::onEnter() TintTo::create(2, 255, 0, 255), TintTo::create(2, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); // Enable cascading in scene setEnableRecursiveCascading(this, true); @@ -357,7 +357,7 @@ void LayerTestCascadingColorB::onEnter() TintTo::create(6, 255, 0, 255), TintTo::create(6, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -369,7 +369,7 @@ void LayerTestCascadingColorB::onEnter() TintTo::create(2, 255, 0, 255), TintTo::create(2, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); // Enable cascading in scene setEnableRecursiveCascading(this, true); @@ -409,7 +409,7 @@ void LayerTestCascadingColorC::onEnter() TintTo::create(6, 255, 0, 255), TintTo::create(6, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); sister1->runAction( RepeatForever::create( @@ -421,7 +421,7 @@ void LayerTestCascadingColorC::onEnter() TintTo::create(2, 255, 0, 255), TintTo::create(2, 255, 255, 255), DelayTime::create(1), - NULL))); + nullptr))); } std::string LayerTestCascadingColorC::subtitle() const @@ -508,12 +508,12 @@ void LayerTest2::onEnter() auto actionTint = TintBy::create(2, -255, -127, 0); auto actionTintBack = actionTint->reverse(); - auto seq1 = Sequence::create( actionTint, actionTintBack, NULL); + auto seq1 = Sequence::create( actionTint, actionTintBack, nullptr); layer1->runAction(seq1); auto actionFade = FadeOut::create(2.0f); auto actionFadeBack = actionFade->reverse(); - auto seq2 = Sequence::create(actionFade, actionFadeBack, NULL); + auto seq2 = Sequence::create(actionFade, actionFadeBack, nullptr); layer2->runAction(seq2); } @@ -592,9 +592,9 @@ LayerGradientTest::LayerGradientTest() auto label2 = Label::createWithTTF("Compressed Interpolation: Disabled", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); - auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, NULL); + auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, nullptr); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); addChild(menu); auto s = Director::getInstance()->getWinSize(); menu->setPosition(Vec2(s.width / 2, 100)); @@ -690,7 +690,7 @@ void LayerIgnoreAnchorPointPos::onEnter() auto move = MoveBy::create(2, Vec2(100,2)); auto back = (MoveBy *)move->reverse(); - auto seq = Sequence::create(move, back, NULL); + auto seq = Sequence::create(move, back, nullptr); l->runAction(RepeatForever::create(seq)); this->addChild(l, 0, kLayerIgnoreAnchorPoint); @@ -701,7 +701,7 @@ void LayerIgnoreAnchorPointPos::onEnter() auto item = MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointPos::onToggle, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(Vec2(s.width/2, s.height/2)); @@ -749,7 +749,7 @@ void LayerIgnoreAnchorPointRot::onEnter() auto item = MenuItemFont::create("Toogle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(Vec2(s.width/2, s.height/2)); @@ -787,7 +787,7 @@ void LayerIgnoreAnchorPointScale::onEnter() auto scale = ScaleBy::create(2, 2); auto back = (ScaleBy*)scale->reverse(); - auto seq = Sequence::create(scale, back, NULL); + auto seq = Sequence::create(scale, back, nullptr); l->runAction(RepeatForever::create(seq)); @@ -800,7 +800,7 @@ void LayerIgnoreAnchorPointScale::onEnter() auto item = MenuItemFont::create("Toogle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointScale::onToggle, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(Vec2(s.width/2, s.height/2)); diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index bb00913264..762fc02754 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -102,10 +102,10 @@ MenuLayerMainMenu::MenuLayerMainMenu() auto color_action = TintBy::create(0.5f, 0, -255, -255); auto color_back = color_action->reverse(); - auto seq = Sequence::create(color_action, color_back, NULL); + auto seq = Sequence::create(color_action, color_back, nullptr); item7->runAction(RepeatForever::create(seq)); - auto menu = Menu::create( item1, item2, item3, item4, item5, item6, item7, item8, NULL); + auto menu = Menu::create( item1, item2, item3, item4, item5, item6, item7, item8, nullptr); menu->alignItemsVertically(); @@ -221,7 +221,7 @@ MenuLayer2::MenuLayer2() item2->setScaleX( 0.5f ); item3->setScaleX( 0.5f ); - auto menu = Menu::create(item1, item2, item3, NULL); + auto menu = Menu::create(item1, item2, item3, nullptr); auto s = Director::getInstance()->getWinSize(); menu->setPosition(Vec2(s.width/2, s.height/2)); @@ -344,7 +344,7 @@ MenuLayer3::MenuLayer3() _disabledItem = item3; item3->retain(); _disabledItem->setEnabled( false ); - auto menu = Menu::create( item1, item2, item3, NULL); + auto menu = Menu::create( item1, item2, item3, nullptr); menu->setPosition( Vec2(0,0) ); auto s = Director::getInstance()->getWinSize(); @@ -354,7 +354,7 @@ MenuLayer3::MenuLayer3() item3->setPosition( Vec2(s.width/2, s.height/2 - 100) ); auto jump = JumpBy::create(3, Vec2(400,0), 50, 4); - item2->runAction( RepeatForever::create(Sequence::create( jump, jump->reverse(), NULL))); + item2->runAction( RepeatForever::create(Sequence::create( jump, jump->reverse(), nullptr))); auto spin1 = RotateBy::create(3, 360); auto spin2 = spin1->clone(); @@ -390,7 +390,7 @@ MenuLayer4::MenuLayer4() auto item1 = MenuItemToggle::createWithCallback( CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "On" ), MenuItemFont::create( "Off"), - NULL ); + nullptr ); MenuItemFont::setFontName( "American Typewriter" ); MenuItemFont::setFontSize(18); @@ -401,7 +401,7 @@ MenuLayer4::MenuLayer4() auto item2 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "On" ), MenuItemFont::create( "Off"), - NULL ); + nullptr ); MenuItemFont::setFontName( "American Typewriter" ); MenuItemFont::setFontSize(18); @@ -412,7 +412,7 @@ MenuLayer4::MenuLayer4() auto item3 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "High" ), MenuItemFont::create( "Low" ), - NULL ); + nullptr ); MenuItemFont::setFontName( "American Typewriter" ); MenuItemFont::setFontSize(18); @@ -422,7 +422,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(34); auto item4 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "Off" ), - NULL ); + nullptr ); // TIP: you can manipulate the items like any other MutableArray item4->getSubItems().pushBack( MenuItemFont::create( "33%" ) ); @@ -443,7 +443,7 @@ MenuLayer4::MenuLayer4() item1, item2, title3, title4, item3, item4, - back, NULL ); // 9 items. + back, nullptr ); // 9 items. menu->alignItemsInColumns(2, 2, 2, 2, 1, NULL); @@ -474,7 +474,7 @@ BugsTest::BugsTest() auto issue1410_2 = MenuItemFont::create("Issue 1410 #2", CC_CALLBACK_1(BugsTest::issue1410v2MenuCallback, this)); auto back = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTest::backMenuCallback, this)); - auto menu = Menu::create(issue1410, issue1410_2, back, NULL); + auto menu = Menu::create(issue1410, issue1410_2, back, nullptr); addChild(menu); menu->alignItemsVertically(); @@ -518,7 +518,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() auto back = MenuItemFont::create("go back", CC_CALLBACK_1(RemoveMenuItemWhenMove::goBack, this)); - auto menu = Menu::create(item, back, NULL); + auto menu = Menu::create(item, back, nullptr); addChild(menu); menu->alignItemsVertically(); @@ -557,7 +557,7 @@ void RemoveMenuItemWhenMove::onTouchMoved(Touch *touch, Event *event) { item->removeFromParentAndCleanup(true); item->release(); - item = NULL; + item = nullptr; } } @@ -572,7 +572,7 @@ void MenuTestScene::runThisTest() auto layer5 = new BugsTest(); auto layer6 = new RemoveMenuItemWhenMove(); - auto layer = LayerMultiplex::create(layer1, layer2, layer3, layer4, layer5, layer6, NULL); + auto layer = LayerMultiplex::create(layer1, layer2, layer3, layer4, layer5, layer6, nullptr); addChild(layer, 0); layer1->release(); diff --git a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp index 233603da5d..6e6c0986c7 100644 --- a/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp +++ b/tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp @@ -79,7 +79,7 @@ void MotionStreakTest1::onEnter() auto action1 = RepeatForever::create(a1); auto motion = MoveBy::create(2, Vec2(100,0) ); - _root->runAction( RepeatForever::create(Sequence::create(motion, motion->reverse(), NULL) ) ); + _root->runAction( RepeatForever::create(Sequence::create(motion, motion->reverse(), nullptr) ) ); _root->runAction( action1 ); auto colorAction = RepeatForever::create(Sequence::create( @@ -90,7 +90,7 @@ void MotionStreakTest1::onEnter() TintTo::create(0.2f, 255, 255, 0), TintTo::create(0.2f, 255, 0, 255), TintTo::create(0.2f, 255, 255, 255), - NULL)); + nullptr)); streak->runAction(colorAction); } @@ -214,9 +214,9 @@ void MotionStreakTest::onEnter() auto itemMode = MenuItemToggle::createWithCallback( CC_CALLBACK_1(MotionStreakTest::modeCallback, this), MenuItemFont::create("Use High Quality Mode"), MenuItemFont::create("Use Fast Mode"), - NULL); + nullptr); - auto menuMode = Menu::create(itemMode, NULL); + auto menuMode = Menu::create(itemMode, nullptr); addChild(menuMode); menuMode->setPosition(Vec2(s.width/2, s.height/4)); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 0355b21751..453d368bca 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -201,7 +201,7 @@ void TouchableSpriteTest::onEnter() nextItem->setFontSizeObj(16); nextItem->setPosition(VisibleRect::right() + Vec2(-100, -30)); - auto menu2 = Menu::create(nextItem, NULL); + auto menu2 = Menu::create(nextItem, nullptr); menu2->setPosition(Vec2(0, 0)); menu2->setAnchorPoint(Vec2(0, 0)); this->addChild(menu2); @@ -405,7 +405,7 @@ void RemoveListenerWhenDispatching::onEnter() (*enable) = true; } - }, MenuItemFont::create("Enabled"), MenuItemFont::create("Disabled"), NULL); + }, MenuItemFont::create("Enabled"), MenuItemFont::create("Disabled"), nullptr); toggleItem->setPosition(origin + Vec2(size.width/2, 80)); auto menu = Menu::create(toggleItem, nullptr); @@ -1153,7 +1153,7 @@ PauseResumeTargetTest::PauseResumeTargetTest() closeItem->setPosition(VisibleRect::center()); - auto closeMenu = Menu::create(closeItem, NULL); + auto closeMenu = Menu::create(closeItem, nullptr); closeMenu->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); closeMenu->setPosition(Vec2::ZERO); @@ -1216,7 +1216,7 @@ Issue4129::Issue4129() nextItem->setFontSizeObj(16); nextItem->setPosition(VisibleRect::right() + Vec2(-100, -30)); - auto menu2 = Menu::create(nextItem, NULL); + auto menu2 = Menu::create(nextItem, nullptr); menu2->setPosition(Vec2(0, 0)); menu2->setAnchorPoint(Vec2(0, 0)); this->addChild(menu2); diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 1ad294deec..729ac092ed 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -183,12 +183,12 @@ void Test2::onEnter() auto a1 = RotateBy::create(2, 360); auto a2 = ScaleBy::create(2, 2); - auto action1 = RepeatForever::create( Sequence::create(a1, a2, a2->reverse(), NULL) ); + auto action1 = RepeatForever::create( Sequence::create(a1, a2, a2->reverse(), nullptr) ); auto action2 = RepeatForever::create( Sequence::create( a1->clone(), a2->clone(), a2->reverse(), - NULL) + nullptr) ); sp2->setAnchorPoint(Vec2(0,0)); @@ -260,7 +260,7 @@ Test5::Test5() auto rot = RotateBy::create(2, 360); auto rot_back = rot->reverse(); - auto forever = RepeatForever::create(Sequence::create(rot, rot_back, NULL)); + auto forever = RepeatForever::create(Sequence::create(rot, rot_back, nullptr)); auto forever2 = forever->clone(); forever->setTag(101); forever2->setTag(102); @@ -315,7 +315,7 @@ Test6::Test6() auto rot = RotateBy::create(2, 360); auto rot_back = rot->reverse(); - auto forever1 = RepeatForever::create(Sequence::create(rot, rot_back, NULL)); + auto forever1 = RepeatForever::create(Sequence::create(rot, rot_back, nullptr)); auto forever11 = forever1->clone(); auto forever2 = forever1->clone(); @@ -394,7 +394,7 @@ void StressTest1::shouldNotCrash(float dt) runAction( Sequence::create( RotateBy::create(2, 360), CallFuncN::create(CC_CALLBACK_1(StressTest1::removeMe, this)), - NULL) ); + nullptr) ); addChild(explosion); } @@ -429,7 +429,7 @@ StressTest2::StressTest2() auto move = MoveBy::create(3, Vec2(350,0)); auto move_ease_inout3 = EaseInOut::create(move->clone(), 2.0f); auto move_ease_inout_back3 = move_ease_inout3->reverse(); - auto seq3 = Sequence::create( move_ease_inout3, move_ease_inout_back3, NULL); + auto seq3 = Sequence::create( move_ease_inout3, move_ease_inout_back3, nullptr); sp1->runAction( RepeatForever::create(seq3) ); sublayer->addChild(sp1, 1); @@ -508,7 +508,7 @@ NodeToWorld::NodeToWorld() auto backSize = back->getContentSize(); auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); menu->alignItemsVertically(); menu->setPosition( Vec2(backSize.width/2, backSize.height/2)); back->addChild(menu); @@ -519,7 +519,7 @@ NodeToWorld::NodeToWorld() auto move = MoveBy::create(3, Vec2(200,0)); auto move_back = move->reverse(); - auto seq = Sequence::create( move, move_back, NULL); + auto seq = Sequence::create( move, move_back, nullptr); auto fe2 = RepeatForever::create(seq); back->runAction(fe2); } @@ -554,7 +554,7 @@ NodeToWorld3D::NodeToWorld3D() auto backSize = back->getContentSize(); auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); menu->alignItemsVertically(); menu->setPosition( Vec2(backSize.width/2, backSize.height/2)); back->addChild(menu); @@ -565,7 +565,7 @@ NodeToWorld3D::NodeToWorld3D() auto move = MoveBy::create(3, Vec2(200,0)); auto move_back = move->reverse(); - auto seq = Sequence::create( move, move_back, NULL); + auto seq = Sequence::create( move, move_back, nullptr); auto fe2 = RepeatForever::create(seq); back->runAction(fe2); @@ -885,7 +885,7 @@ std::string ConvertToNode::subtitle() const NodeOpaqueTest::NodeOpaqueTest() { - Sprite *background = NULL; + Sprite *background = nullptr; for (int i = 0; i < 50; i++) { @@ -910,7 +910,7 @@ std::string NodeOpaqueTest::subtitle() const NodeNonOpaqueTest::NodeNonOpaqueTest() { - Sprite *background = NULL; + Sprite *background = nullptr; for (int i = 0; i < 50; i++) { @@ -1379,8 +1379,8 @@ void NodeNameTest::test(float dt) }); CCAssert(i == 10000, ""); - // name = /xxx : search from root - parent = getScene(); + // name = //xxx : search recursively + parent = Node::create(); for (int j = 0; j < 100; j++) { auto node = Node::create(); @@ -1398,35 +1398,21 @@ void NodeNameTest::test(float dt) } i = 0; - enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return false; - }); - CCAssert(i == 100, ""); - - i = 0; - enumerateChildren("/node[[:digit:]]+", [&i](Node* node) -> bool { - ++i; - return true; - }); - CCAssert(i == 1, ""); - - i = 0; - enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { + parent->enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { ++i; return false; }); CCAssert(i == 10100, ""); // 10000(children) + 100(parent) i = 0; - enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { + parent->enumerateChildren("//node[[:digit:]]+", [&i](Node* node) -> bool { ++i; return true; }); CCAssert(i == 1, ""); i = 0; - enumerateChildren("//node[[:digit:]]+/..", [&i](Node* node) -> bool { + parent->enumerateChildren("//node[[:digit:]]+/..", [&i](Node* node) -> bool { ++i; return false; }); diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp index 2e650c23d2..ae0683541f 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp @@ -68,7 +68,7 @@ Parallax1::Parallax1() auto goDown = goUp->reverse(); auto go = MoveBy::create(8, Vec2(-1000,0) ); auto goBack = go->reverse(); - auto seq = Sequence::create(goUp, go, goDown, goBack, NULL); + auto seq = Sequence::create(goUp, go, goDown, goBack, nullptr); voidNode->runAction( (RepeatForever::create(seq) )); addChild( voidNode ); @@ -247,7 +247,7 @@ Layer* createParallaxTestLayer(int nIndex) case 2: return new Issue2572(); } - return NULL; + return nullptr; } Layer* nextParallaxAction() diff --git a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp index e78a9b133b..5f3beb9d31 100644 --- a/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp @@ -588,7 +588,7 @@ void ParallaxParticle::onEnter() ParticleDemo::onEnter(); _background->getParent()->removeChild(_background, true); - _background = NULL; + _background = nullptr; auto p = ParallaxNode::create(); addChild(p, 5); @@ -612,7 +612,7 @@ void ParallaxParticle::onEnter() auto move = MoveBy::create(4, Vec2(300,0)); auto move_back = move->reverse(); - auto seq = Sequence::create( move, move_back, NULL); + auto seq = Sequence::create( move, move_back, nullptr); p->runAction(RepeatForever::create(seq)); } @@ -632,7 +632,7 @@ void RadiusMode1::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::createWithTotalParticles(200); _emitter->retain(); @@ -716,7 +716,7 @@ void RadiusMode2::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::createWithTotalParticles(200); _emitter->retain(); @@ -800,7 +800,7 @@ void Issue704::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::createWithTotalParticles(100); _emitter->retain(); @@ -892,7 +892,7 @@ void Issue870::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::create("Particles/SpinningPeas.plist"); _emitter->setTextureWithRect(Director::getInstance()->getTextureCache()->addImage("Images/particles.png"), Rect(0,0,32,32)); @@ -932,7 +932,7 @@ void DemoParticleFromFile::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; std::string filename = "Particles/" + _title + ".plist"; _emitter = ParticleSystemQuad::create(filename); @@ -1016,7 +1016,7 @@ Layer* createParticleLayer(int nIndex) break; } - return NULL; + return nullptr; } #define MAX_LAYER 49 @@ -1065,7 +1065,7 @@ void ParticleDemo::onEnter(void) _color = LayerColor::create( Color4B(127,127,127,255) ); this->addChild(_color); - _emitter = NULL; + _emitter = nullptr; auto listener = EventListenerTouchAllAtOnce::create(); listener->onTouchesBegan = CC_CALLBACK_2(ParticleDemo::onTouchesBegan, this); @@ -1079,9 +1079,9 @@ void ParticleDemo::onEnter(void) MenuItemFont::create( "Free Movement" ), MenuItemFont::create( "Relative Movement" ), MenuItemFont::create( "Grouped Movement" ), - NULL ); + nullptr ); - auto menu = Menu::create(item4, NULL); + auto menu = Menu::create(item4, nullptr); menu->setPosition( Vec2::ZERO ); item4->setPosition( Vec2( VisibleRect::left().x, VisibleRect::bottom().y+ 100) ); @@ -1100,7 +1100,7 @@ void ParticleDemo::onEnter(void) auto move = MoveBy::create(4, Vec2(300,0) ); auto move_back = move->reverse(); - auto seq = Sequence::create( move, move_back, NULL); + auto seq = Sequence::create( move, move_back, nullptr); _background->runAction( RepeatForever::create(seq) ); @@ -1139,7 +1139,7 @@ void ParticleDemo::onTouchesEnded(const std::vector& touches, Event *ev pos = _background->convertToWorldSpace(Vec2::ZERO); } - if (_emitter != NULL) + if (_emitter != nullptr) { _emitter->setPosition(location -pos); } @@ -1158,7 +1158,7 @@ void ParticleDemo::update(float dt) void ParticleDemo::toggleCallback(Ref* sender) { - if (_emitter != NULL) + if (_emitter != nullptr) { if (_emitter->getPositionType() == ParticleSystem::PositionType::GROUPED) _emitter->setPositionType(ParticleSystem::PositionType::FREE); @@ -1171,7 +1171,7 @@ void ParticleDemo::toggleCallback(Ref* sender) void ParticleDemo::restartCallback(Ref* sender) { - if (_emitter != NULL) + if (_emitter != nullptr) { _emitter->resetSystem(); } @@ -1196,7 +1196,7 @@ void ParticleDemo::backCallback(Ref* sender) void ParticleDemo::setEmitterPosition() { auto s = Director::getInstance()->getWinSize(); - if (_emitter != NULL) + if (_emitter != nullptr) { _emitter->setPosition( Vec2(s.width / 2, s.height / 2) ); } @@ -1210,7 +1210,7 @@ void ParticleBatchHybrid::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::create("Particles/LavaFlow.plist"); _emitter->retain(); @@ -1231,7 +1231,7 @@ void ParticleBatchHybrid::onEnter() void ParticleBatchHybrid::switchRender(float dt) { - bool usingBatch = ( _emitter->getBatchNode() != NULL ); + bool usingBatch = ( _emitter->getBatchNode() != nullptr ); _emitter->removeFromParentAndCleanup(false); auto newParent = (usingBatch ? _parent2 : _parent1 ); @@ -1258,7 +1258,7 @@ void ParticleBatchMultipleEmitters::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; auto emitter1 = ParticleSystemQuad::create("Particles/LavaFlow.plist"); emitter1->setStartColor(Color4F(1,0,0,1)); @@ -1301,7 +1301,7 @@ void ParticleReorder::onEnter() _order = 0; _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; auto ignore = ParticleSystemQuad::create("Particles/SmallSun.plist"); auto parent1 = Node::create(); @@ -1471,7 +1471,7 @@ void Issue1201::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; RainbowEffect *particle = new RainbowEffect(); particle->initWithTotalParticles(50); @@ -1501,7 +1501,7 @@ void MultipleParticleSystems::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; Director::getInstance()->getTextureCache()->addImage("Images/particles.png"); @@ -1514,7 +1514,7 @@ void MultipleParticleSystems::onEnter() addChild(particleSystem); } - _emitter = NULL; + _emitter = nullptr; } @@ -1536,7 +1536,7 @@ void MultipleParticleSystems::update(float dt) for(const auto &child : _children) { auto item = dynamic_cast(child); - if (item != NULL) + if (item != nullptr) { count += item->getParticleCount(); } @@ -1555,7 +1555,7 @@ void MultipleParticleSystemsBatched::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; ParticleBatchNode *batchNode = ParticleBatchNode::createWithTexture(nullptr, 3000); @@ -1572,7 +1572,7 @@ void MultipleParticleSystemsBatched::onEnter() batchNode->addChild(particleSystem); } - _emitter = NULL; + _emitter = nullptr; } void MultipleParticleSystemsBatched::update(float dt) @@ -1584,7 +1584,7 @@ void MultipleParticleSystemsBatched::update(float dt) auto batchNode = getChildByTag(2); for(const auto &child : batchNode->getChildren()) { auto item = dynamic_cast(child); - if (item != NULL) + if (item != nullptr) { count += item->getParticleCount(); } @@ -1613,10 +1613,10 @@ void AddAndDeleteParticleSystems::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background, true); - _background = NULL; + _background = nullptr; //adds the texture inside the plist to the texture cache - _batchNode = ParticleBatchNode::createWithTexture((Texture2D*)NULL, 16000); + _batchNode = ParticleBatchNode::createWithTexture((Texture2D*)nullptr, 16000); addChild(_batchNode, 1, 2); @@ -1636,7 +1636,7 @@ void AddAndDeleteParticleSystems::onEnter() } schedule(schedule_selector(AddAndDeleteParticleSystems::removeSystem), 0.5f); - _emitter = NULL; + _emitter = nullptr; } @@ -1672,7 +1672,7 @@ void AddAndDeleteParticleSystems::update(float dt) auto batchNode = getChildByTag(2); for(const auto &child : batchNode->getChildren()) { auto item = dynamic_cast(child); - if (item != NULL) + if (item != nullptr) { count += item->getParticleCount(); } @@ -1701,7 +1701,7 @@ void ReorderParticleSystems::onEnter() _color->setColor(Color3B::BLACK); removeChild(_background ,true); - _background = NULL; + _background = nullptr; _batchNode = ParticleBatchNode::create("Images/stars-grayscale.png" ,3000); @@ -1787,7 +1787,7 @@ void ReorderParticleSystems::onEnter() } schedule(schedule_selector(ReorderParticleSystems::reorderSystem), 2.0f); - _emitter = NULL; + _emitter = nullptr; } @@ -1859,7 +1859,7 @@ void PremultipliedAlphaTest::onEnter() _color->setColor(Color3B::BLUE); this->removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::create("Particles/BoilingFoam.plist"); _emitter->retain(); @@ -1893,7 +1893,7 @@ void PremultipliedAlphaTest2::onEnter() _color->setColor(Color3B::BLACK); this->removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::create("Particles/TestPremultipliedAlpha.plist"); _emitter->retain(); @@ -1919,7 +1919,7 @@ void Issue3990::onEnter() _color->setColor(Color3B::BLACK); this->removeChild(_background, true); - _background = NULL; + _background = nullptr; _emitter = ParticleSystemQuad::create("Particles/Spiral.plist"); @@ -1983,7 +1983,7 @@ void ParticleAutoBatching::onEnter() _color->setColor(Color3B::BLACK); this->removeChild(_background, true); - _background = NULL; + _background = nullptr; Size s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp index b7ba926f88..141f7c9c33 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -137,7 +137,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) }); increase->setColor(Color3B(0,200,20)); - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp index b56c156732..fd5ddf10a2 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp @@ -142,7 +142,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) increase->setColor(Color3B(0,200,20)); _increase = increase; - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); @@ -223,7 +223,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) stop->setPosition(VisibleRect::right() + Vec2(0, -40)); _stopItem = stop; - auto menu2 = Menu::create(toggle, start, stop, NULL); + auto menu2 = Menu::create(toggle, start, stop, nullptr); menu2->setPosition(Vec2::ZERO); addChild(menu2); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp index 3eb36c686f..f786ba12ad 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp @@ -140,7 +140,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode increase->setColor(Color3B(0,200,20)); _increase = increase; - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); @@ -240,7 +240,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode stop->setPosition(VisibleRect::right() + Vec2(0, -40)); _stopItem = stop; - auto menu2 = Menu::create(toggle, start, stop, NULL); + auto menu2 = Menu::create(toggle, start, stop, nullptr); menu2->setPosition(Vec2::ZERO); addChild(menu2); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp index a384b31d2f..0948b6ccfa 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -97,7 +97,7 @@ void LabelMainScene::initWithSubTest(int nodes) auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(LabelMainScene::onIncrease, this)); increase->setColor(Color3B(0,200,20)); - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height-65)); addChild(menu, 1); @@ -121,7 +121,7 @@ void LabelMainScene::initWithSubTest(int nodes) MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); - MenuItemFont* autoTestItem = NULL; + MenuItemFont* autoTestItem = nullptr; if (LabelMainScene::_s_autoTest) { autoTestItem = MenuItemFont::create("Auto Test On",CC_CALLBACK_1(LabelMainScene::onAutoTest, this)); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index f7835b201c..d715fc8b9a 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -166,7 +166,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) }); increase->setColor(Color3B(0,200,20)); - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp index b001e31f5d..7f43d0ae6e 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -35,7 +35,7 @@ void ParticleMenuLayer::showCurrentTest() int subTest = scene->getSubTestNum(); int parNum = scene->getParticlesNum(); - ParticleMainScene* pNewScene = NULL; + ParticleMainScene* pNewScene = nullptr; switch (_curCase) { @@ -98,7 +98,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) }); increase->setColor(Color3B(0,200,20)); - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height/2+15)); addChild(menu, 1); @@ -234,7 +234,7 @@ void ParticleMainScene::createParticleSystem() // particleSystem->setTexture(Director::getInstance()->getTextureCache()->addImage("Images/fire.png")); // break; default: - particleSystem = NULL; + particleSystem = nullptr; CCLOG("Shall not happen!"); break; } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp index 0fdeac4065..d26defbd55 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp @@ -15,7 +15,7 @@ static int s_nScenarioCurCase = 0; //////////////////////////////////////////////////////// void ScenarioMenuLayer::showCurrentTest() { - Scene* scene = NULL; + Scene* scene = nullptr; switch (_curCase) { @@ -105,7 +105,7 @@ void ScenarioTest::performTests() MenuItemFont::create( "Add/Remove Sprite" ), MenuItemFont::create( "Add/Remove Particle"), MenuItemFont::create( "Add/Remove Particle System"), - NULL); + nullptr); _itemToggle->setAnchorPoint(Vec2(0.0f, 0.5f)); _itemToggle->setPosition(Vec2(origin.x, origin.y + s.height / 2)); @@ -148,7 +148,7 @@ void ScenarioTest::performTests() increase->setColor(Color3B(0,200,20)); increase->setPosition(Vec2(origin.x + s.width / 2 + 80, origin.y + 80)); - auto menu = Menu::create(_itemToggle, decrease, increase, NULL); + auto menu = Menu::create(_itemToggle, decrease, increase, nullptr); menu->setPosition(Vec2(0.0f, 0.0f)); addChild(menu, 10); @@ -252,7 +252,7 @@ void ScenarioTest::addNewSprites(int num) else action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create( action, action_back, NULL ); + auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 8625056b41..51194ee6a0 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -146,7 +146,7 @@ Sprite* SubTest::createSpriteWithTag(int tag) { TextureCache *cache = Director::getInstance()->getTextureCache(); - Sprite* sprite = NULL; + Sprite* sprite = nullptr; switch (subtestNumber) { /// @@ -319,7 +319,7 @@ void SpriteMenuLayer::backCallback(Ref* sender) void SpriteMenuLayer::showCurrentTest() { - SpriteMainScene* scene = NULL; + SpriteMainScene* scene = nullptr; auto pPreScene = (SpriteMainScene*) getParent(); int nSubTest = pPreScene->getSubTestNum(); int nNodes = pPreScene->getNodesNum(); @@ -386,7 +386,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) auto increase = MenuItemFont::create(" + ", CC_CALLBACK_1(SpriteMainScene::onIncrease, this)); increase->setColor(Color3B(0,200,20)); - auto menu = Menu::create(decrease, increase, NULL); + auto menu = Menu::create(decrease, increase, nullptr); menu->alignItemsHorizontally(); menu->setPosition(Vec2(s.width/2, s.height-65)); addChild(menu, 1); @@ -410,7 +410,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); - MenuItemFont* autoTestItem = NULL; + MenuItemFont* autoTestItem = nullptr; if (SpriteMainScene::_s_autoTest) { autoTestItem = MenuItemFont::create("Auto Test On",CC_CALLBACK_1(SpriteMainScene::onAutoTest, this)); @@ -484,7 +484,7 @@ SpriteMainScene::~SpriteMainScene() if (_subTest) { delete _subTest; - _subTest = NULL; + _subTest = nullptr; } } @@ -617,7 +617,7 @@ void SpriteMainScene::onExit() void SpriteMainScene::autoShowSpriteTests(int curCase, int subTest,int nodes) { - SpriteMainScene* scene = NULL; + SpriteMainScene* scene = nullptr; switch (curCase) { @@ -760,12 +760,12 @@ void performanceActions(Sprite* sprite) float period = 0.5f + (rand() % 1000) / 500.0f; auto rot = RotateBy::create(period, 360.0f * CCRANDOM_0_1()); auto rot_back = rot->reverse(); - auto permanentRotation = RepeatForever::create(Sequence::create(rot, rot_back, NULL)); + auto permanentRotation = RepeatForever::create(Sequence::create(rot, rot_back, nullptr)); sprite->runAction(permanentRotation); float growDuration = 0.5f + (rand() % 1000) / 500.0f; auto grow = ScaleBy::create(growDuration, 0.5f, 0.5f); - auto permanentScaleLoop = RepeatForever::create(Sequence::create(grow, grow->reverse(), NULL)); + auto permanentScaleLoop = RepeatForever::create(Sequence::create(grow, grow->reverse(), nullptr)); sprite->runAction(permanentScaleLoop); } @@ -780,7 +780,7 @@ void performanceActions20(Sprite* sprite) float period = 0.5f + (rand() % 1000) / 500.0f; auto rot = RotateBy::create(period, 360.0f * CCRANDOM_0_1()); auto rot_back = rot->reverse(); - auto permanentRotation = RepeatForever::create(Sequence::create(rot, rot_back, NULL)); + auto permanentRotation = RepeatForever::create(Sequence::create(rot, rot_back, nullptr)); sprite->runAction(permanentRotation); float growDuration = 0.5f + (rand() % 1000) / 500.0f; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp index 745be44c23..e86037c4dd 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp @@ -155,7 +155,7 @@ void PerformBasicLayer::onEnter() MenuItemFont::setFontSize(24); auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(PerformBasicLayer::toMainLayer, this)); pMainItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); - auto menu = Menu::create(pMainItem, NULL); + auto menu = Menu::create(pMainItem, nullptr); menu->setPosition( Vec2::ZERO ); if (_controlMenuVisible) diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp index fe02765945..13ea612adc 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp @@ -11,7 +11,7 @@ float calculateDeltaTime( struct timeval *lastUpdate ) { struct timeval now; - gettimeofday( &now, NULL); + gettimeofday( &now, nullptr); float dt = (now.tv_sec - lastUpdate->tv_sec) + (now.tv_usec - lastUpdate->tv_usec) / 1000000.0f; @@ -25,7 +25,7 @@ float calculateDeltaTime( struct timeval *lastUpdate ) //////////////////////////////////////////////////////// void TextureMenuLayer::showCurrentTest() { - Scene* scene = NULL; + Scene* scene = nullptr; switch (_curCase) { @@ -89,7 +89,7 @@ void TextureTest::performTestsPNG(const char* filename) log("RGBA 8888"); Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888); - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); texture = cache->addImage(filename); if( texture ) log(" ms:%f", calculateDeltaTime(&now) ); @@ -99,7 +99,7 @@ void TextureTest::performTestsPNG(const char* filename) log("RGBA 4444"); Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444); - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); texture = cache->addImage(filename); if( texture ) log(" ms:%f", calculateDeltaTime(&now) ); @@ -109,7 +109,7 @@ void TextureTest::performTestsPNG(const char* filename) log("RGBA 5551"); Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1); - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); texture = cache->addImage(filename); if( texture ) log(" ms:%f", calculateDeltaTime(&now) ); @@ -119,7 +119,7 @@ void TextureTest::performTestsPNG(const char* filename) log("RGB 565"); Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB565); - gettimeofday(&now, NULL); + gettimeofday(&now, nullptr); texture = cache->addImage(filename); if( texture ) log(" ms:%f", calculateDeltaTime(&now) ); @@ -143,7 +143,7 @@ void TextureTest::performTests() // log("--- PVR 128x128 ---"); // log("RGBA 8888"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/test_image_rgba8888.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -152,7 +152,7 @@ void TextureTest::performTests() // cache->removeTexture(texture); // // log("BGRA 8888"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/test_image_bgra8888.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -161,7 +161,7 @@ void TextureTest::performTests() // cache->removeTexture(texture); // // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/test_image_rgba4444.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -170,7 +170,7 @@ void TextureTest::performTests() // cache->removeTexture(texture); // // log("RGB 565"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/test_image_rgb565.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -184,7 +184,7 @@ void TextureTest::performTests() // log("--- PVR 512x512 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/texture512x512_rgba4444.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -204,7 +204,7 @@ void TextureTest::performTests() // log("--- PVR 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -214,7 +214,7 @@ void TextureTest::performTests() // // log("--- PVR.GZ 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.gz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -224,7 +224,7 @@ void TextureTest::performTests() // // log("--- PVR.CCZ 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.ccz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -244,7 +244,7 @@ void TextureTest::performTests() // log("--- PVR 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -254,7 +254,7 @@ void TextureTest::performTests() // // log("--- PVR.GZ 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.gz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -264,7 +264,7 @@ void TextureTest::performTests() // // log("--- PVR.CCZ 1024x1024 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.ccz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -286,7 +286,7 @@ void TextureTest::performTests() // log("--- PVR 1024x1024 ---"); // log("RGBA 8888"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -296,7 +296,7 @@ void TextureTest::performTests() // // log("--- PVR.GZ 1024x1024 ---"); // log("RGBA 8888"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.gz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -306,7 +306,7 @@ void TextureTest::performTests() // // log("--- PVR.CCZ 1024x1024 ---"); // log("RGBA 8888"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.ccz"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); @@ -326,7 +326,7 @@ void TextureTest::performTests() // log("--- PVR 2048x2048 ---"); // log("RGBA 4444"); -// gettimeofday(&now, NULL); +// gettimeofday(&now, nullptr); // texture = cache->addImage("Images/texture2048x2048_rgba4444.pvr"); // if( texture ) // log(" ms:%f", calculateDeltaTime(&now) ); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp index cb3f16091b..e510dcc78e 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp @@ -41,7 +41,7 @@ static int s_nTouchCurCase = 0; //////////////////////////////////////////////////////// void TouchesMainScene::showCurrentTest() { - Layer* layer = NULL; + Layer* layer = nullptr; switch (_curCase) { case 0: @@ -283,7 +283,7 @@ void TouchesPerformTest3::onEnter() }); menuItem->setPosition(Vec2(0, -20)); - auto menu = Menu::create(menuItem, NULL); + auto menu = Menu::create(menuItem, nullptr); addChild(menu); } @@ -294,7 +294,7 @@ std::string TouchesPerformTest3::title() const void TouchesPerformTest3::showCurrentTest() { - Layer* layer = NULL; + Layer* layer = nullptr; switch (_curCase) { case 0: diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index 926d5a1ccb..5826130538 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -156,7 +156,7 @@ void PhysicsDemo::onEnter() MenuItemFont::setFontSize(18); auto item = MenuItemFont::create("Toggle debug", CC_CALLBACK_1(PhysicsDemo::toggleDebugCallback, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(Vec2(VisibleRect::right().x-50, VisibleRect::top().y-10)); } @@ -552,7 +552,7 @@ void PhysicsDemoRayCast::onEnter() MenuItemFont::setFontSize(18); auto item = MenuItemFont::create("Change Mode(any)", CC_CALLBACK_1(PhysicsDemoRayCast::changeModeCallback, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); this->addChild(menu); menu->setPosition(Vec2(VisibleRect::left().x+100, VisibleRect::top().y-10)); @@ -950,9 +950,9 @@ void PhysicsDemoActions::onEnter() auto rotateByBack = RotateBy::create(2, -180); sp1->runAction(RepeatForever::create(actionUp)); - sp2->runAction(RepeatForever::create(Sequence::create(actionBy, actionByBack, NULL))); + sp2->runAction(RepeatForever::create(Sequence::create(actionBy, actionByBack, nullptr))); sp3->runAction(actionTo); - sp4->runAction(RepeatForever::create(Sequence::create(rotateBy, rotateByBack, NULL))); + sp4->runAction(RepeatForever::create(Sequence::create(rotateBy, rotateByBack, nullptr))); } std::string PhysicsDemoActions::title() const @@ -1315,7 +1315,7 @@ void PhysicsContactTest::onEnter() decrease1->setTag(1); increase1->setTag(1); - auto menu1 = Menu::create(decrease1, increase1, NULL); + auto menu1 = Menu::create(decrease1, increase1, nullptr); menu1->alignItemsHorizontally(); menu1->setPosition(Vec2(s.width/2, s.height-50)); addChild(menu1, 1); @@ -1331,7 +1331,7 @@ void PhysicsContactTest::onEnter() decrease2->setTag(2); increase2->setTag(2); - auto menu2 = Menu::create(decrease2, increase2, NULL); + auto menu2 = Menu::create(decrease2, increase2, nullptr); menu2->alignItemsHorizontally(); menu2->setPosition(Vec2(s.width/2, s.height-90)); addChild(menu2, 1); @@ -1347,7 +1347,7 @@ void PhysicsContactTest::onEnter() decrease3->setTag(3); increase3->setTag(3); - auto menu3 = Menu::create(decrease3, increase3, NULL); + auto menu3 = Menu::create(decrease3, increase3, nullptr); menu3->alignItemsHorizontally(); menu3->setPosition(Vec2(s.width/2, s.height-130)); addChild(menu3, 1); @@ -1363,7 +1363,7 @@ void PhysicsContactTest::onEnter() decrease4->setTag(4); increase4->setTag(4); - auto menu4 = Menu::create(decrease4, increase4, NULL); + auto menu4 = Menu::create(decrease4, increase4, nullptr); menu4->alignItemsHorizontally(); menu4->setPosition(Vec2(s.width/2, s.height-170)); addChild(menu4, 1); @@ -1794,13 +1794,13 @@ void PhysicsTransformTest::onEnter() this->addChild(bullet); - MoveBy* move = MoveBy::create(2.0, Vec2(100, 100)); - MoveBy* move2 = MoveBy::create(2.0, Vec2(-200, 0)); - MoveBy* move3 = MoveBy::create(2.0, Vec2(100, -100)); - ScaleTo* scale = ScaleTo::create(3.0, 0.3); - ScaleTo* scale2 = ScaleTo::create(3.0, 1.0); + MoveBy* move = MoveBy::create(2.0f, Vec2(100, 100)); + MoveBy* move2 = MoveBy::create(2.0f, Vec2(-200, 0)); + MoveBy* move3 = MoveBy::create(2.0f, Vec2(100, -100)); + ScaleTo* scale = ScaleTo::create(3.0f, 0.3f); + ScaleTo* scale2 = ScaleTo::create(3.0f, 1.0f); - RotateBy* rotate = RotateBy::create(6.0, 360); + RotateBy* rotate = RotateBy::create(6.0f, 360); this->runAction(RepeatForever::create(Sequence::create(move, move2, move3, nullptr))); this->runAction(RepeatForever::create(Sequence::create(scale, scale2, nullptr))); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 406514ff4b..334d578b79 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -108,7 +108,7 @@ RenderTextureSave::RenderTextureSave() MenuItemFont::setFontSize(16); auto item1 = MenuItemFont::create("Save Image", CC_CALLBACK_1(RenderTextureSave::saveImage, this)); auto item2 = MenuItemFont::create("Clear", CC_CALLBACK_1(RenderTextureSave::clearImage, this)); - auto menu = Menu::create(item1, item2, NULL); + auto menu = Menu::create(item1, item2, nullptr); this->addChild(menu); menu->alignItemsVertically(); menu->setPosition(Vec2(VisibleRect::rightTop().x - 80, VisibleRect::rightTop().y - 30)); @@ -151,7 +151,7 @@ void RenderTextureSave::saveImage(cocos2d::Ref *sender) sprite->setPosition(Vec2(40, 40)); sprite->setRotation(counter * 3); }; - runAction(Sequence::create(action1, CallFunc::create(func), NULL)); + runAction(Sequence::create(action1, CallFunc::create(func), nullptr)); CCLOG("Image saved %s and %s", png, jpg); @@ -239,7 +239,7 @@ RenderTextureIssue937::RenderTextureIssue937() /* A2 & B2 setup */ auto rend = RenderTexture::create(32, 64, Texture2D::PixelFormat::RGBA8888); - if (NULL == rend) + if (nullptr == rend) { return; } @@ -404,7 +404,7 @@ void RenderTextureZbuffer::onTouchesEnded(const std::vector& touches, Ev void RenderTextureZbuffer::renderScreenShot() { auto texture = RenderTexture::create(512, 512); - if (NULL == texture) + if (nullptr == texture) { return; } @@ -425,7 +425,7 @@ void RenderTextureZbuffer::renderScreenShot() sprite->runAction(Sequence::create(FadeTo::create(2, 0), Hide::create(), - NULL)); + nullptr)); } RenderTexturePartTest::RenderTexturePartTest() @@ -465,7 +465,7 @@ RenderTexturePartTest::RenderTexturePartTest() _spriteDraw->setPosition(0,size.height/2); _spriteDraw->setScaleY(-1); _spriteDraw->runAction(RepeatForever::create(Sequence::create - (baseAction,baseAction->reverse(), NULL))); + (baseAction,baseAction->reverse(), nullptr))); addChild(_spriteDraw); } @@ -623,7 +623,7 @@ RenderTextureTargetNode::RenderTextureTargetNode() // Toggle clear on / off auto item = MenuItemFont::create("Clear On/Off", CC_CALLBACK_1(RenderTextureTargetNode::touched, this)); - auto menu = Menu::create(item, NULL); + auto menu = Menu::create(item, nullptr); addChild(menu); menu->setPosition(Vec2(s.width/2, s.height/2)); @@ -722,7 +722,7 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCo sprite->setPosition(p); - FiniteTimeAction *action = NULL; + FiniteTimeAction *action = nullptr; float rd = CCRANDOM_0_1(); if (rd < 0.20) @@ -737,12 +737,12 @@ SpriteRenderTextureBug::SimpleSprite* SpriteRenderTextureBug::addNewSpriteWithCo action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create(action, action_back, NULL); + auto seq = Sequence::create(action, action_back, nullptr); sprite->runAction(RepeatForever::create(seq)); //return sprite; - return NULL; + return nullptr; } void SpriteRenderTextureBug::onTouchesEnded(const std::vector& touches, Event* event) diff --git a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp index e031b10f92..8351125918 100644 --- a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp +++ b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp @@ -67,11 +67,11 @@ void SpriteLayer::onEnter() auto rot1 = RotateBy::create(4, 360*2); auto rot2 = rot1->reverse(); - spriteSister1->runAction(Repeat::create( Sequence::create(jump2, jump1, NULL), 5 )); - spriteSister2->runAction(Repeat::create( Sequence::create(jump1->clone(), jump2->clone(), NULL), 5 )); + spriteSister1->runAction(Repeat::create( Sequence::create(jump2, jump1, nullptr), 5 )); + spriteSister2->runAction(Repeat::create( Sequence::create(jump1->clone(), jump2->clone(), nullptr), 5 )); - spriteSister1->runAction(Repeat::create( Sequence::create(rot1, rot2, NULL), 5 )); - spriteSister2->runAction(Repeat::create( Sequence::create(rot2->clone(), rot1->clone(), NULL), 5 )); + spriteSister1->runAction(Repeat::create( Sequence::create(rot1, rot2, nullptr), 5 )); + spriteSister2->runAction(Repeat::create( Sequence::create(rot2->clone(), rot1->clone(), nullptr), 5 )); } //------------------------------------------------------------------ diff --git a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp index 715bc91a87..862943dd89 100644 --- a/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp +++ b/tests/cpp-tests/Classes/SceneTest/SceneTest.cpp @@ -22,7 +22,7 @@ SceneTestLayer1::SceneTestLayer1() auto item2 = MenuItemFont::create( "Test pushScene w/transition", CC_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this)); auto item3 = MenuItemFont::create( "Quit", CC_CALLBACK_1(SceneTestLayer1::onQuit, this)); - auto menu = Menu::create( item1, item2, item3, NULL ); + auto menu = Menu::create( item1, item2, item3, nullptr ); menu->alignItemsVertically(); addChild( menu ); @@ -107,7 +107,7 @@ SceneTestLayer2::SceneTestLayer2() auto item2 = MenuItemFont::create( "replaceScene w/transition", CC_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this)); auto item3 = MenuItemFont::create( "Go Back", CC_CALLBACK_1(SceneTestLayer2::onGoBack, this)); - auto menu = Menu::create( item1, item2, item3, NULL ); + auto menu = Menu::create( item1, item2, item3, nullptr ); menu->alignItemsVertically(); addChild( menu ); @@ -176,7 +176,7 @@ bool SceneTestLayer3::init() auto item2 = MenuItemFont::create("Touch to popToRootScene", CC_CALLBACK_1(SceneTestLayer3::item2Clicked, this)); auto item3 = MenuItemFont::create("Touch to popToSceneStackLevel(2)", CC_CALLBACK_1(SceneTestLayer3::item3Clicked, this)); - auto menu = Menu::create(item0, item1, item2, item3, NULL); + auto menu = Menu::create(item0, item1, item2, item3, nullptr); this->addChild(menu); menu->alignItemsVertically(); diff --git a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp index 198ff3998b..070c31febc 100644 --- a/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp +++ b/tests/cpp-tests/Classes/SchedulerTest/SchedulerTest.cpp @@ -852,9 +852,9 @@ void SchedulerTimeScale::onEnter() auto rot1 = RotateBy::create(4, 360*2); auto rot2 = rot1->reverse(); - auto seq3_1 = Sequence::create(jump2, jump1, NULL); - auto seq3_2 = Sequence::create(rot1, rot2, NULL); - auto spawn = Spawn::create(seq3_1, seq3_2, NULL); + auto seq3_1 = Sequence::create(jump2, jump1, nullptr); + auto seq3_2 = Sequence::create(rot1, rot2, nullptr); + auto spawn = Spawn::create(seq3_1, seq3_2, nullptr); auto action = Repeat::create(spawn, 50); auto action2 = action->clone(); @@ -946,7 +946,7 @@ void TwoSchedulers::onEnter() auto jump1 = JumpBy::create(4, Vec2(0,0), 100, 4); auto jump2 = jump1->reverse(); - auto seq = Sequence::create(jump2, jump1, NULL); + auto seq = Sequence::create(jump2, jump1, nullptr); auto action = RepeatForever::create(seq); // diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index b4150a8383..b3c4c76249 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -22,7 +22,7 @@ static Layer* createShaderLayer(int nIndex) case 9: return new ShaderGlow(); case 10: return new ShaderMultiTexture(); } - return NULL; + return nullptr; } static Layer* nextAction(void) @@ -132,7 +132,7 @@ ShaderNode* ShaderNode::shaderNodeWithVertex(const std::string &vert, const std: bool ShaderNode::initWithVertex(const std::string &vert, const std::string &frag) { #if CC_ENABLE_CACHE_TEXTURE_DATA - auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event){ this->setGLProgramState(nullptr); loadShaderVertex(_vertFileName, _fragFileName); }); @@ -458,7 +458,7 @@ bool SpriteBlur::initWithTexture(Texture2D* texture, const Rect& rect) if( Sprite::initWithTexture(texture, rect) ) { #if CC_ENABLE_CACHE_TEXTURE_DATA - auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){ + auto listener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event){ setGLProgram(nullptr); initGLProgram(); }); diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp index 5c7fa92f11..780abace13 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest2.cpp @@ -222,7 +222,7 @@ Effect::Effect() : _glprogramstate(nullptr) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - _backgroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, + _backgroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { auto glProgram = _glprogramstate->getGLProgram(); @@ -297,8 +297,8 @@ public: { initGLProgramState("Shaders/example_outline.fsh"); - Vec3 color(1.0, 0.2, 0.3); - GLfloat radius = 0.01; + Vec3 color(1.0f, 0.2f, 0.3f); + GLfloat radius = 0.01f; GLfloat threshold = 1.75; _glprogramstate->setUniformVec3("u_outlineColor", color); @@ -456,7 +456,7 @@ EffectSpriteTest::EffectSpriteTest() _sprite->setEffect(_effects.at(_vectorIndex)); }); - auto menu = Menu::create(itemPrev, itemNext, NULL); + auto menu = Menu::create(itemPrev, itemNext, nullptr); menu->alignItemsHorizontally(); menu->setScale(0.5); menu->setAnchorPoint(Vec2(0,0)); @@ -469,9 +469,9 @@ EffectSpriteTest::EffectSpriteTest() auto jump = JumpBy::create(4, Vec2(s.width,0), 100, 4); auto rot = RotateBy::create(4, 720); - auto spawn = Spawn::create(jump, rot, NULL); + auto spawn = Spawn::create(jump, rot, nullptr); auto rev = spawn->reverse(); - auto seq = Sequence::create(spawn, rev, NULL); + auto seq = Sequence::create(spawn, rev, nullptr); auto repeat = RepeatForever::create(seq); _sprite->runAction(repeat); diff --git a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp index 4b57f848f4..e0887829ab 100644 --- a/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp +++ b/tests/cpp-tests/Classes/SpineTest/SpineTest.cpp @@ -67,7 +67,7 @@ bool SpineTestLayer::init () { skeletonNode->runAction(CCRepeatForever::create(CCSequence::create(CCFadeOut::create(1), CCFadeIn::create(1), CCDelayTime::create(5), - NULL))); + nullptr))); Size windowSize = Director::getInstance()->getWinSize(); skeletonNode->setPosition(Vec2(windowSize.width / 2, 20)); diff --git a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp index ac8281b9f6..6ee4a01e83 100644 --- a/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp +++ b/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp @@ -184,7 +184,7 @@ void Sprite3DBasicTest::addNewSpriteWithCoords(Vec2 p) else action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create( action, action_back, NULL ); + auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); } @@ -325,7 +325,7 @@ Effect3DOutline::Effect3DOutline() , _sprite(nullptr) { #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, + _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { auto glProgram = _glProgramState->getGLProgram(); @@ -504,7 +504,7 @@ void Sprite3DEffectTest::addNewSpriteWithCoords(Vec2 p) else action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create( action, action_back, NULL ); + auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); } @@ -546,24 +546,23 @@ void Sprite3DWithSkinTest::addNewSpriteWithCoords(Vec2 p) addChild(sprite); sprite->setPosition( Vec2( p.x, p.y) ); - auto animation = Animation3D::getOrCreate(fileName); + auto animation = Animation3D::create(fileName); if (animation) { auto animate = Animate3D::create(animation); - if(std::rand() %3 == 0) - { - animate->setPlayBack(true); - } + bool inverse = (std::rand() % 3 == 0); int rand2 = std::rand(); + float speed = 1.0f; if(rand2 % 3 == 1) { - animate->setSpeed(animate->getSpeed() + CCRANDOM_0_1()); + speed = animate->getSpeed() + CCRANDOM_0_1(); } else if(rand2 % 3 == 2) { - animate->setSpeed(animate->getSpeed() - 0.5 * CCRANDOM_0_1()); + speed = animate->getSpeed() - 0.5 * CCRANDOM_0_1(); } + animate->setSpeed(inverse ? -speed : speed); sprite->runAction(RepeatForever::create(animate)); } @@ -652,7 +651,7 @@ void Animate3DTest::addSprite3D() sprite->setPosition(Vec2(s.width * 4.f / 5.f, s.height / 2.f)); addChild(sprite); _sprite = sprite; - auto animation = Animation3D::getOrCreate(fileName); + auto animation = Animation3D::create(fileName); if (animation) { auto animate = Animate3D::create(animation, 0.f, 1.933f); @@ -706,7 +705,7 @@ void Animate3DTest::onTouchesEnded(const std::vector& touches, Event* ev { _sprite->runAction(_hurt); auto delay = DelayTime::create(_hurt->getDuration() - 0.1f); - auto seq = Sequence::create(delay, CallFunc::create(CC_CALLBACK_0(Animate3DTest::renewCallBack, this)), NULL); + auto seq = Sequence::create(delay, CallFunc::create(CC_CALLBACK_0(Animate3DTest::renewCallBack, this)), nullptr); seq->setTag(101); _sprite->runAction(seq); _state = State::SWIMMING_TO_HURT; diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp index adb3919372..af90d8c5f5 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp @@ -131,6 +131,7 @@ static std::function createFunctions[] = CL(AnimationCacheFile), CL(SpriteCullTest1), CL(SpriteCullTest2), + CL(Sprite3DRotationTest), }; #define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) @@ -259,7 +260,7 @@ void Sprite1::addNewSpriteWithCoords(Vec2 p) else action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create( action, action_back, NULL ); + auto seq = Sequence::create( action, action_back, nullptr ); sprite->runAction( RepeatForever::create(seq) ); } @@ -332,7 +333,7 @@ void SpriteBatchNode1::addNewSpriteWithCoords(Vec2 p) action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create(action, action_back, NULL); + auto seq = Sequence::create(action, action_back, nullptr); sprite->runAction( RepeatForever::create(seq)); } @@ -389,19 +390,19 @@ SpriteColorOpacity::SpriteColorOpacity() auto action = FadeIn::create(2); auto action_back = action->reverse(); - auto fade = RepeatForever::create( Sequence::create( action, action_back, NULL) ); + auto fade = RepeatForever::create( Sequence::create( action, action_back, nullptr) ); auto tintred = TintBy::create(2, 0, -255, -255); auto tintred_back = tintred->reverse(); - auto red = RepeatForever::create( Sequence::create( tintred, tintred_back, NULL) ); + auto red = RepeatForever::create( Sequence::create( tintred, tintred_back, nullptr) ); auto tintgreen = TintBy::create(2, -255, 0, -255); auto tintgreen_back = tintgreen->reverse(); - auto green = RepeatForever::create( Sequence::create( tintgreen, tintgreen_back, NULL) ); + auto green = RepeatForever::create( Sequence::create( tintgreen, tintgreen_back, nullptr) ); auto tintblue = TintBy::create(2, -255, -255, 0); auto tintblue_back = tintblue->reverse(); - auto blue = RepeatForever::create( Sequence::create( tintblue, tintblue_back, NULL) ); + auto blue = RepeatForever::create( Sequence::create( tintblue, tintblue_back, nullptr) ); sprite5->runAction(red); sprite6->runAction(green); @@ -480,19 +481,19 @@ SpriteBatchNodeColorOpacity::SpriteBatchNodeColorOpacity() auto action = FadeIn::create(2); auto action_back = action->reverse(); - auto fade = RepeatForever::create( Sequence::create( action, action_back,NULL) ); + auto fade = RepeatForever::create( Sequence::create( action, action_back,nullptr) ); auto tintred = TintBy::create(2, 0, -255, -255); auto tintred_back = tintred->reverse(); - auto red = RepeatForever::create( Sequence::create( tintred, tintred_back,NULL) ); + auto red = RepeatForever::create( Sequence::create( tintred, tintred_back,nullptr) ); auto tintgreen = TintBy::create(2, -255, 0, -255); auto tintgreen_back = tintgreen->reverse(); - auto green = RepeatForever::create( Sequence::create( tintgreen, tintgreen_back,NULL) ); + auto green = RepeatForever::create( Sequence::create( tintgreen, tintgreen_back,nullptr) ); auto tintblue = TintBy::create(2, -255, -255, 0); auto tintblue_back = tintblue->reverse(); - auto blue = RepeatForever::create( Sequence::create( tintblue, tintblue_back,NULL) ); + auto blue = RepeatForever::create( Sequence::create( tintblue, tintblue_back,nullptr) ); sprite5->runAction(red); @@ -1226,12 +1227,12 @@ Sprite6::Sprite6() // SpriteBatchNode actions auto rotate_back = rotate->reverse(); - auto rotate_seq = Sequence::create(rotate, rotate_back, NULL); + auto rotate_seq = Sequence::create(rotate, rotate_back, nullptr); auto rotate_forever = RepeatForever::create(rotate_seq); auto scale = ScaleBy::create(5, 1.5f); auto scale_back = scale->reverse(); - auto scale_seq = Sequence::create( scale, scale_back, NULL); + auto scale_seq = Sequence::create( scale, scale_back, nullptr); auto scale_forever = RepeatForever::create(scale_seq); float step = s.width/4; @@ -1368,7 +1369,7 @@ SpriteAliased::SpriteAliased() auto scale = ScaleBy::create(2, 5); auto scale_back = scale->reverse(); - auto seq = Sequence::create( scale, scale_back, NULL); + auto seq = Sequence::create( scale, scale_back, nullptr); auto repeat = RepeatForever::create(seq); auto repeat2 = repeat->clone(); @@ -1433,7 +1434,7 @@ SpriteBatchNodeAliased::SpriteBatchNodeAliased() auto scale = ScaleBy::create(2, 5); auto scale_back = scale->reverse(); - auto seq = Sequence::create( scale, scale_back, NULL); + auto seq = Sequence::create( scale, scale_back, nullptr); auto repeat = RepeatForever::create(seq); auto repeat2 = repeat->clone(); @@ -1532,7 +1533,7 @@ void SpriteNewTexture::addNewSprite() action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create(action, action_back, NULL); + auto seq = Sequence::create(action, action_back, nullptr); sprite->runAction( RepeatForever::create(seq) ); } @@ -1637,7 +1638,7 @@ void SpriteBatchNodeNewTexture::addNewSprite() else action = FadeOut::create(2); auto action_back = action->reverse(); - auto seq = Sequence::create(action, action_back, NULL); + auto seq = Sequence::create(action, action_back, nullptr); sprite->runAction( RepeatForever::create(seq) ); } @@ -2094,7 +2095,7 @@ SpriteOffsetAnchorScale::SpriteOffsetAnchorScale() auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale)); addChild(sprite, 0); @@ -2176,7 +2177,7 @@ SpriteBatchNodeOffsetAnchorScale::SpriteBatchNodeOffsetAnchorScale() auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale) ); spritesheet->addChild(sprite, i); @@ -2244,7 +2245,7 @@ SpriteAnimationSplit::SpriteAnimationSplit() FlipX::create(true), animate->clone(), FlipX::create(false), - NULL); + nullptr); sprite->runAction(RepeatForever::create( seq ) ); } @@ -2405,8 +2406,8 @@ SpriteBatchNodeChildren::SpriteBatchNodeChildren() sprite2->runAction( RepeatForever::create(seq2) ); sprite1->runAction( RepeatForever::create(action_rot)); - sprite1->runAction( RepeatForever::create(Sequence::create(action, action_back,NULL)) ); - sprite1->runAction( RepeatForever::create(Sequence::create(action_s, action_s_back,NULL)) ); + sprite1->runAction( RepeatForever::create(Sequence::create(action, action_back,nullptr)) ); + sprite1->runAction( RepeatForever::create(Sequence::create(action_s, action_s_back,nullptr)) ); } @@ -3214,7 +3215,7 @@ SpriteBatchNodeSkewNegativeScaleChildren::SpriteBatchNodeSkewNegativeScaleChildr sprite->setScale(-1.0f); } - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); @@ -3273,7 +3274,7 @@ SpriteSkewNegativeScaleChildren::SpriteSkewNegativeScaleChildren() sprite->setScale(-1.0f); } - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png"); @@ -3314,7 +3315,7 @@ SpriteNilTexture::SpriteNilTexture() { auto s = Director::getInstance()->getWinSize(); - Sprite* sprite = NULL; + Sprite* sprite = nullptr; // TEST: If no texture is given, then Opacity + Color should work. @@ -3514,7 +3515,7 @@ SpriteDoubleResolution::SpriteDoubleResolution() // Actions auto scale = ScaleBy::create(2, 0.5); auto scale_back = scale->reverse(); - auto seq = Sequence::create(scale, scale_back, NULL); + auto seq = Sequence::create(scale, scale_back, nullptr); auto seq_copy = seq->clone(); @@ -3610,7 +3611,7 @@ AnimationCacheTest::AnimationCacheTest() auto animG = Animate::create(dance_grey); auto animB = Animate::create(dance_blue); - auto seq = Sequence::create(animN, animG, animB, NULL); + auto seq = Sequence::create(animN, animG, animB, nullptr); // create an sprite without texture auto grossini = Sprite::create(); @@ -3666,7 +3667,7 @@ AnimationCacheFile::AnimationCacheFile() auto animG = Animate::create(dance_grey); auto animB = Animate::create(dance_blue); - auto seq = Sequence::create(animN, animG, animB, NULL); + auto seq = Sequence::create(animN, animG, animB, nullptr); // create an sprite without texture auto grossini = Sprite::create(); @@ -3798,7 +3799,7 @@ SpriteOffsetAnchorSkew::SpriteOffsetAnchorSkew() auto skewY = SkewBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); addChild(sprite, 0); @@ -3881,7 +3882,7 @@ SpriteBatchNodeOffsetAnchorSkew::SpriteBatchNodeOffsetAnchorSkew() auto skewY = SkewBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); spritebatch->addChild(sprite, i); @@ -3962,13 +3963,13 @@ SpriteOffsetAnchorSkewScale::SpriteOffsetAnchorSkewScale() auto skewY = SkewBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); // Scale auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale)); addChild(sprite, 0); @@ -4051,13 +4052,13 @@ SpriteBatchNodeOffsetAnchorSkewScale::SpriteBatchNodeOffsetAnchorSkewScale() auto skewY = SkewBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); // scale auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale)); spritebatch->addChild(sprite, i); @@ -4136,7 +4137,7 @@ SpriteOffsetAnchorFlip::SpriteOffsetAnchorFlip() auto flip = FlipY::create(true); auto flip_back = FlipY::create(false); auto delay = DelayTime::create(1); - auto seq = Sequence::create(delay, flip, delay->clone(), flip_back, NULL); + auto seq = Sequence::create(delay, flip, delay->clone(), flip_back, nullptr); sprite->runAction(RepeatForever::create(seq)); addChild(sprite, 0); @@ -4218,7 +4219,7 @@ SpriteBatchNodeOffsetAnchorFlip::SpriteBatchNodeOffsetAnchorFlip() auto flip = FlipY::create(true); auto flip_back = FlipY::create(false); auto delay = DelayTime::create(1); - auto seq = Sequence::create(delay, flip, delay->clone(), flip_back, NULL); + auto seq = Sequence::create(delay, flip, delay->clone(), flip_back, nullptr); sprite->runAction(RepeatForever::create(seq)); spritebatch->addChild(sprite, i); @@ -4502,7 +4503,7 @@ SpriteOffsetAnchorRotationalSkew::SpriteOffsetAnchorRotationalSkew() auto skewY = RotateBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); addChild(sprite, 0); @@ -4585,7 +4586,7 @@ SpriteBatchNodeOffsetAnchorRotationalSkew::SpriteBatchNodeOffsetAnchorRotational auto skewY = RotateBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); spritebatch->addChild(sprite, i); @@ -4666,13 +4667,13 @@ SpriteOffsetAnchorRotationalSkewScale::SpriteOffsetAnchorRotationalSkewScale() auto skewY = RotateBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); // Scale auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale)); addChild(sprite, i); @@ -4754,13 +4755,13 @@ SpriteBatchNodeOffsetAnchorRotationalSkewScale::SpriteBatchNodeOffsetAnchorRotat auto skewY = RotateBy::create(2, 0, 45); auto skewY_back = skewY->reverse(); - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); // Scale auto scale = ScaleBy::create(2, 2); auto scale_back = scale->reverse(); - auto seq_scale = Sequence::create(scale, scale_back, NULL); + auto seq_scale = Sequence::create(scale, scale_back, nullptr); sprite->runAction(RepeatForever::create(seq_scale)); spritebatch->addChild(sprite, i); @@ -4820,7 +4821,7 @@ SpriteRotationalSkewNegativeScaleChildren::SpriteRotationalSkewNegativeScaleChil sprite->setScale(-1.0f); } - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::create("Images/grossini_dance_01.png"); @@ -4887,7 +4888,7 @@ SpriteBatchNodeRotationalSkewNegativeScaleChildren::SpriteBatchNodeRotationalSke sprite->setScale(-1.0f); } - auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, NULL); + auto seq_skew = Sequence::create(skewX, skewX_back, skewY, skewY_back, nullptr); sprite->runAction(RepeatForever::create(seq_skew)); auto child1 = Sprite::create("Images/grossini_dance_01.png"); @@ -4995,3 +4996,48 @@ std::string SpriteCullTest2::subtitle() const { return "Look at the GL calls"; } + +//------------------------------------------------------------------ +// +// Sprite 3D rotation test +// +//------------------------------------------------------------------ +Sprite3DRotationTest::Sprite3DRotationTest() +{ + Size s = Director::getInstance()->getWinSize(); + + //Create reference sprite that's rotating based on there anchor point + auto s1 = Sprite::create("Images/grossini.png"); + s1->setPosition(s.width/4, s.height/4 * 3); + s1->setAnchorPoint(Vec2(0, 0)); + s1->runAction(RepeatForever::create(RotateBy::create(6, 360))); + addChild(s1); + + auto s2 = Sprite::create("Images/grossini.png"); + s2->setPosition(s.width/4 * 3, s.height/4 * 3); + s2->runAction(RepeatForever::create(RotateBy::create(6, 360))); + addChild(s2); + + sprite1 = Sprite::create("Images/grossini.png"); + sprite1->setPosition(s.width/4, s.height/4); + sprite1->setAnchorPoint(Vec2(0,0)); + + addChild(sprite1); + + sprite2 = Sprite::create("Images/grossini.png"); + sprite2->setPosition(s.width/4 * 3, s.height/4); + + addChild(sprite2); + + scheduleUpdate(); +} + +void Sprite3DRotationTest::update(float delta) +{ + rotation.y += 1; + sprite1->setRotation3D(rotation); + sprite2->setRotation3D(rotation); +} + + + diff --git a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h index e02b16082f..5467d46482 100644 --- a/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h +++ b/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h @@ -749,6 +749,22 @@ public: virtual std::string subtitle() const override; }; +class Sprite3DRotationTest : public SpriteTestDemo +{ +public: + CREATE_FUNC(Sprite3DRotationTest); + Sprite3DRotationTest(); + virtual std::string title() const override { return "3D Rotation Test"; }; + virtual std::string subtitle() const override { return "Rotation should based on the anchor point"; }; + virtual void update(float delta) override; + +protected: + Sprite* sprite1; + Sprite* sprite2; + + Vec3 rotation; +}; + class SpriteTestScene : public TestScene { public: diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp index 92aacdd67c..ea29b7a992 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp @@ -302,7 +302,7 @@ void TextFieldTTFActionTest::onEnter() Sequence::create( FadeOut::create(0.25), FadeIn::create(0.25), - NULL + nullptr )); _textFieldAction->retain(); _action = false; @@ -394,9 +394,9 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const MoveTo::create(duration, endPos), ScaleTo::create(duration, 1), FadeOut::create(duration), - NULL), + nullptr), CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), - NULL); + nullptr); label->runAction(seq); return false; } @@ -428,9 +428,9 @@ bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * sender, co RotateBy::create(rotateDuration, (rand()%2) ? 360 : -360), repeatTime), FadeOut::create(duration), - NULL), + nullptr), CallFuncN::create(CC_CALLBACK_1(TextFieldTTFActionTest::callbackRemoveNodeWhenDidAction, this)), - NULL); + nullptr); label->runAction(seq); return false; } diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index 60f7a34c4b..eb3a4e1e65 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -370,8 +370,8 @@ void TextureMipMap::onEnter() auto scale2 = scale1->clone(); auto sc_back2 = scale2->reverse(); - img0->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, NULL))); - img1->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, NULL))); + img0->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, nullptr))); + img1->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, nullptr))); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -420,8 +420,8 @@ void TexturePVRMipMap::onEnter() auto scale2 = scale1->clone(); auto sc_back2 = scale2->reverse(); - imgMipMap->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, NULL))); - img->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, NULL))); + imgMipMap->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, nullptr))); + img->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, nullptr))); } log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -463,8 +463,8 @@ void TexturePVRMipMap2::onEnter() auto scale2 = scale1->clone(); auto sc_back2 = scale2->reverse(); - imgMipMap->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, NULL))); - img->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, NULL))); + imgMipMap->runAction(RepeatForever::create(Sequence::create(scale1, sc_back, nullptr))); + img->runAction(RepeatForever::create(Sequence::create(scale2, sc_back2, nullptr))); log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str()); } @@ -760,7 +760,7 @@ void TexturePVRRGB888::onEnter() auto s = Director::getInstance()->getWinSize(); auto img = Sprite::create("Images/test_image_rgb888.pvr"); - if (img != NULL) + if (img != nullptr) { img->setPosition(Vec2( s.width/2.0f, s.height/2.0f)); addChild(img); @@ -1361,7 +1361,7 @@ void TextureAlias::onEnter() // scale them to show auto sc = ScaleBy::create(3, 8.0f); auto sc_back = sc->reverse(); - auto scaleforever = RepeatForever::create(Sequence::create(sc, sc_back, NULL)); + auto scaleforever = RepeatForever::create(Sequence::create(sc, sc_back, nullptr)); auto scaleToo = scaleforever->clone(); sprite2->runAction(scaleforever); @@ -1456,7 +1456,7 @@ void TexturePixelFormat::onEnter() auto fadeout = FadeOut::create(2); auto fadein = FadeIn::create(2); - auto seq = Sequence::create(DelayTime::create(2), fadeout, fadein, NULL); + auto seq = Sequence::create(DelayTime::create(2), fadeout, fadein, nullptr); auto seq_4ever = RepeatForever::create(seq); auto seq_4ever2 = seq_4ever->clone(); auto seq_4ever3 = seq_4ever->clone(); @@ -1551,7 +1551,7 @@ void TextureAsync::onEnter() auto scale = ScaleBy::create(0.3f, 2); auto scale_back = scale->reverse(); - auto seq = Sequence::create(scale, scale_back, NULL); + auto seq = Sequence::create(scale, scale_back, nullptr); label->runAction(RepeatForever::create(seq)); scheduleOnce(schedule_selector(TextureAsync::loadImages), 1.0f); @@ -1638,7 +1638,7 @@ void TextureGlClamp::onEnter() sprite->runAction(rotate); auto scale = ScaleBy::create(2, 0.04f); auto scaleBack = scale->reverse(); - auto seq = Sequence::create(scale, scaleBack, NULL); + auto seq = Sequence::create(scale, scaleBack, nullptr); sprite->runAction(seq); } @@ -1675,7 +1675,7 @@ void TextureGlRepeat::onEnter() sprite->runAction(rotate); auto scale = ScaleBy::create(2, 0.04f); auto scaleBack = scale->reverse(); - auto seq = Sequence::create(scale, scaleBack, NULL); + auto seq = Sequence::create(scale, scaleBack, nullptr); sprite->runAction(seq); } @@ -1697,7 +1697,7 @@ TextureGlRepeat::~TextureGlRepeat() void TextureSizeTest::onEnter() { TextureDemo::onEnter(); - Sprite *sprite = NULL; + Sprite *sprite = nullptr; log("Loading 512x512 image..."); sprite = Sprite::create("Images/texture512x512.png"); @@ -1920,7 +1920,7 @@ void TextureTestScene::runThisTest() void TextureMemoryAlloc::onEnter() { TextureDemo::onEnter(); - _background = NULL; + _background = nullptr; MenuItemFont::setFontSize(24); @@ -1939,14 +1939,14 @@ void TextureMemoryAlloc::onEnter() auto item5 = MenuItemFont::create("A8", CC_CALLBACK_1(TextureMemoryAlloc::updateImage, this)); item5->setTag(4); - auto menu = Menu::create(item1, item2, item3, item4, item5, NULL); + auto menu = Menu::create(item1, item2, item3, item4, item5, nullptr); menu->alignItemsHorizontally(); addChild(menu); auto warmup = MenuItemFont::create("warm up texture", CC_CALLBACK_1(TextureMemoryAlloc::changeBackgroundVisible, this)); - auto menu2 = Menu::create(warmup, NULL); + auto menu2 = Menu::create(warmup, nullptr); menu2->alignItemsHorizontally(); @@ -2074,7 +2074,7 @@ void TexturePVRv3Premult::transformSprite(cocos2d::Sprite *sprite) auto fade = FadeOut::create(2); auto dl = DelayTime::create(2); auto fadein = fade->reverse(); - auto seq = Sequence::create(fade, fadein, dl, NULL); + auto seq = Sequence::create(fade, fadein, dl, nullptr); auto repeat = RepeatForever::create(seq); sprite->runAction(repeat); } diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp index 016d5da895..2eb4483885 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp @@ -195,7 +195,7 @@ TileMapTest::TileMapTest() auto scale = ScaleBy::create(4, 0.8f); auto scaleBack = scale->reverse(); - auto seq = Sequence::create(scale, scaleBack, NULL); + auto seq = Sequence::create(scale, scaleBack, nullptr); map->runAction(RepeatForever::create(seq)); } @@ -291,7 +291,7 @@ TMXOrthoTest::TMXOrthoTest() auto scale = ScaleBy::create(10, 0.1f); auto back = scale->reverse(); - auto seq = Sequence::create(scale, back, NULL); + auto seq = Sequence::create(scale, back, nullptr); auto repeat = RepeatForever::create(seq); map->runAction(repeat); @@ -332,7 +332,7 @@ TMXOrthoTest2::TMXOrthoTest2() CCLOG("ContentSize: %f, %f", s.width,s.height); auto& children = map->getChildren(); - SpriteBatchNode* child = NULL; + SpriteBatchNode* child = nullptr; for(const auto &obj : children) { child = static_cast(obj); @@ -361,7 +361,7 @@ TMXOrthoTest3::TMXOrthoTest3() CCLOG("ContentSize: %f, %f", s.width,s.height); auto& children = map->getChildren(); - SpriteBatchNode* child = NULL; + SpriteBatchNode* child = nullptr; for(const auto &node : children) { child = static_cast(node); @@ -483,7 +483,7 @@ TMXReadWriteTest::TMXReadWriteTest() auto fadein = FadeIn::create(2); auto scaleback = ScaleTo::create(1, 1); auto finish = CallFuncN::create(CC_CALLBACK_1(TMXReadWriteTest::removeSprite, this)); - auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, NULL); + auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, nullptr); auto seq1 = seq0->clone(); auto seq2 = seq0->clone(); auto seq3 = seq0->clone(); @@ -947,7 +947,7 @@ TMXIsoZorder::TMXIsoZorder() auto move = MoveBy::create(10, Vec2(300,250)); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq) ); schedule( schedule_selector(TMXIsoZorder::repositionSprite) ); @@ -1013,7 +1013,7 @@ TMXOrthoZorder::TMXOrthoZorder() auto move = MoveBy::create(10, Vec2(400,450)); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq)); schedule( schedule_selector(TMXOrthoZorder::repositionSprite)); @@ -1075,7 +1075,7 @@ TMXIsoVertexZ::TMXIsoVertexZ() auto move = MoveBy::create(10, Vec2(300,250) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq) ); schedule( schedule_selector(TMXIsoVertexZ::repositionSprite)); @@ -1147,7 +1147,7 @@ TMXOrthoVertexZ::TMXOrthoVertexZ() auto move = MoveBy::create(10, Vec2(400,450) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq)); schedule(schedule_selector(TMXOrthoVertexZ::repositionSprite)); @@ -1389,7 +1389,7 @@ TMXOrthoFromXMLTest::TMXOrthoFromXMLTest() std::string file = resources + "/orthogonal-test1.tmx"; auto str = String::createWithContentsOfFile(FileUtils::getInstance()->fullPathForFilename(file.c_str()).c_str()); - CCASSERT(str != NULL, "Unable to open file"); + CCASSERT(str != nullptr, "Unable to open file"); auto map = TMXTiledMap::createWithXML(str->getCString() ,resources.c_str()); addChild(map, 0, kTagTileMap); diff --git a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp index 9b895e65bf..f89cb73e62 100644 --- a/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp +++ b/tests/cpp-tests/Classes/TileMapTest/TileMapTest2.cpp @@ -200,7 +200,7 @@ TileMapTestNew::TileMapTestNew() auto scale = ScaleBy::create(4, 0.8f); auto scaleBack = scale->reverse(); - auto seq = Sequence::create(scale, scaleBack, NULL); + auto seq = Sequence::create(scale, scaleBack, nullptr); map->runAction(RepeatForever::create(seq)); } @@ -296,7 +296,7 @@ TMXOrthoTestNew::TMXOrthoTestNew() auto scale = ScaleBy::create(10, 0.1f); auto back = scale->reverse(); - auto seq = Sequence::create(scale, back, NULL); + auto seq = Sequence::create(scale, back, nullptr); auto repeat = RepeatForever::create(seq); map->runAction(repeat); @@ -462,7 +462,7 @@ TMXReadWriteTestNew::TMXReadWriteTestNew() auto fadein = FadeIn::create(2); auto scaleback = ScaleTo::create(1, 1); auto finish = CallFuncN::create(CC_CALLBACK_1(TMXReadWriteTestNew::removeSprite, this)); - auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, NULL); + auto seq0 = Sequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, nullptr); auto seq1 = seq0->clone(); auto seq2 = seq0->clone(); auto seq3 = seq0->clone(); @@ -917,7 +917,7 @@ TMXIsoZorderNew::TMXIsoZorderNew() auto move = MoveBy::create(10, Vec2(300,250)); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq) ); schedule( schedule_selector(TMXIsoZorderNew::repositionSprite) ); @@ -983,7 +983,7 @@ TMXOrthoZorderNew::TMXOrthoZorderNew() auto move = MoveBy::create(10, Vec2(400,450)); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq)); schedule( schedule_selector(TMXOrthoZorderNew::repositionSprite)); @@ -1045,7 +1045,7 @@ TMXIsoVertexZNew::TMXIsoVertexZNew() auto move = MoveBy::create(10, Vec2(300,250) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq) ); schedule( schedule_selector(TMXIsoVertexZNew::repositionSprite)); @@ -1117,7 +1117,7 @@ TMXOrthoVertexZNew::TMXOrthoVertexZNew() auto move = MoveBy::create(10, Vec2(400,450) * (1/CC_CONTENT_SCALE_FACTOR())); auto back = move->reverse(); - auto seq = Sequence::create(move, back,NULL); + auto seq = Sequence::create(move, back,nullptr); _tamara->runAction( RepeatForever::create(seq)); schedule(schedule_selector(TMXOrthoVertexZNew::repositionSprite)); @@ -1347,7 +1347,7 @@ TMXOrthoFromXMLTestNew::TMXOrthoFromXMLTestNew() std::string file = resources + "/orthogonal-test1.tmx"; auto str = String::createWithContentsOfFile(FileUtils::getInstance()->fullPathForFilename(file.c_str()).c_str()); - CCASSERT(str != NULL, "Unable to open file"); + CCASSERT(str != nullptr, "Unable to open file"); auto map = FastTMXTiledMap::createWithXML(str->getCString() ,resources.c_str()); addChild(map, 0, kTagTileMap); diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp index 5091bc29a5..7f9ec9103b 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp @@ -280,7 +280,7 @@ TestLayer1::TestLayer1(void) auto item2 = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(TestLayer1::restartCallback, this) ); auto item3 = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(TestLayer1::nextCallback, this) ); - auto menu = Menu::create(item1, item2, item3, NULL); + auto menu = Menu::create(item1, item2, item3, nullptr); menu->setPosition( Vec2::ZERO ); item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); @@ -410,7 +410,7 @@ TestLayer2::TestLayer2() auto item2 = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(TestLayer2::restartCallback, this) ); auto item3 = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(TestLayer2::nextCallback, this) ); - auto menu = Menu::create(item1, item2, item3, NULL); + auto menu = Menu::create(item1, item2, item3, nullptr); menu->setPosition( Vec2::ZERO ); item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2)); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp index 0cb3dcabcc..c6e0083a63 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocoStudioGUITest.cpp @@ -7,6 +7,7 @@ #include "CustomGUIScene.h" #include "controller.h" #include "cocostudio/CocoStudio.h" +#include "CocostudioParserTest.h" enum { @@ -48,6 +49,15 @@ g_guisTests[] = scene->release(); } }, + { + "Cocostudio Parser Test", + [](Ref* sender) + { + CocostudioParserTestScene* scene = new CocostudioParserTestScene(); + scene->runThisTest(); + scene->release(); + } + }, }; static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); @@ -109,7 +119,7 @@ void CocoStudioGUITestScene::onEnter() //#endif MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocoStudioGUITestScene::BackCallback, this)); - Menu* pMenu = Menu::create(pMenuItem, NULL); + Menu* pMenu = Menu::create(pMenuItem, nullptr); pMenu->setPosition( Vec2::ZERO ); pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index c626b4359b..e413761014 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -183,7 +183,7 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(kUIPageViewTest); sceneManager->setMinUISceneId(kUIPageViewTest); - sceneManager->setMaxUISceneId(kUIPageViewTest); + sceneManager->setMaxUISceneId(kUIPageViewButtonTest); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } @@ -310,7 +310,7 @@ void CocosGUITestScene::onEnter() //#endif auto pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocosGUITestScene::BackCallback, this)); - Menu* pMenu =Menu::create(pMenuItem, NULL); + Menu* pMenu =Menu::create(pMenuItem, nullptr); pMenu->setPosition( Vec2::ZERO ); pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h index c8dd312d8e..543ff8e52a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.h @@ -56,28 +56,5 @@ public: void BackCallback(Ref* pSender); }; -/* -class CocosGUITestScene : public TestScene -{ -public: - CocosGUITestScene(bool portrait = false); - virtual ~CocosGUITestScene(); - virtual void runThisTest(); - - // The CallBack for back to the main menu scene - virtual void MainMenuCallback(Ref* sender); - - void load(Ref* pSender, int count); - void loadTextureCallBack(Ref *obj); - - void menuCallback(Ref* pSender); - - UILayer* _ul; - - LabelTTF* _label; - - Menu* _itemMenu; -}; - */ #endif /* defined(__TestCpp__CocosGUIScene__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp new file mode 100644 index 0000000000..7b600324aa --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + 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 "CocostudioParserTest.h" + +#include "CocoStudioGUITest.h" +#include "CocostudioParserTest/CocostudioParserJsonTest.h" + +enum +{ + LINE_SPACE = 40, + kItemTagBasic = 1000, +}; + +static struct +{ + const char *name; + std::function callback; +} +g_guisTests[] = +{ + { + "cocostudio 1.3", + [](Ref* sender) + { + CocostudioParserJsonScene* pScene = new CocostudioParserJsonScene("cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson"); + pScene->runThisTest(); + pScene->release(); + } + }, + { + "cocostudio 1.4", + [](Ref* sender) + { + CocostudioParserJsonScene* pScene = new CocostudioParserJsonScene("cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson"); + pScene->runThisTest(); + pScene->release(); + } + }, + { + "cocostudio 1.5", + [](Ref* sender) + { + CocostudioParserJsonScene* pScene = new CocostudioParserJsonScene("cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson"); + pScene->runThisTest(); + pScene->release(); + } + }, + +}; + +static const int g_maxTests = sizeof(g_guisTests) / sizeof(g_guisTests[0]); + +//////////////////////////////////////////////////////// +// +// CocostudioParserTestMainLayer +// +//////////////////////////////////////////////////////// + +static Vec2 _curPos = Vec2::ZERO; + + +void CocostudioParserTestMainLayer::onEnter() +{ + Layer::onEnter(); + + auto s = Director::getInstance()->getWinSize(); + + _itemMenu = Menu::create(); + _itemMenu->setPosition( _curPos ); + MenuItemFont::setFontName("fonts/arial.ttf"); + MenuItemFont::setFontSize(24); + for (int i = 0; i < g_maxTests; ++i) + { + auto pItem = MenuItemFont::create(g_guisTests[i].name, g_guisTests[i].callback); + // pItem->setPosition(Vec2(s.width / 2, s.height / 2)); + pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE)); + _itemMenu->addChild(pItem, kItemTagBasic + i); + } + + auto listener = EventListenerTouchAllAtOnce::create(); + listener->onTouchesBegan = CC_CALLBACK_2(CocostudioParserTestMainLayer::onTouchesBegan, this); + listener->onTouchesMoved = CC_CALLBACK_2(CocostudioParserTestMainLayer::onTouchesMoved, this); + + _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); + + addChild(_itemMenu); +} + +void CocostudioParserTestMainLayer::onTouchesBegan(const std::vector &touches, cocos2d::Event *event) +{ + auto touch = static_cast(touches[0]); + + _beginPos = touch->getLocation(); +} + + +//////////////////////////////////////////////////////// +// +// CocostudioParserTestScene +// +//////////////////////////////////////////////////////// + +void CocostudioParserTestScene::onEnter() +{ + CCScene::onEnter(); + + auto label = Label::createWithTTF("Back", "fonts/arial.ttf", 20); + //#endif + MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocostudioParserTestScene::BackCallback, this)); + + Menu* pMenu = Menu::create(pMenuItem, NULL); + + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + + addChild(pMenu, 1); +} + +void CocostudioParserTestScene::runThisTest() +{ + Layer* pLayer = new CocostudioParserTestMainLayer(); + addChild(pLayer); + pLayer->release(); + + CCDirector::getInstance()->replaceScene(this); +} + +void CocostudioParserTestScene::BackCallback(Ref* pSender) +{ + CocoStudioGUITestScene* pScene = new CocoStudioGUITestScene(); + pScene->runThisTest(); + pScene->release(); +} \ No newline at end of file diff --git a/cocos/base/CCControllerThumbstick.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.h similarity index 60% rename from cocos/base/CCControllerThumbstick.h rename to tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.h index 83d5649b9f..5563542427 100644 --- a/cocos/base/CCControllerThumbstick.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest.h @@ -1,6 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org @@ -23,39 +22,37 @@ THE SOFTWARE. ****************************************************************************/ -#ifndef __cocos2d_libs__CCControllerThumbStick__ -#define __cocos2d_libs__CCControllerThumbStick__ +#ifndef __cocos2d_tests__CocostudioParserTest__ +#define __cocos2d_tests__CocostudioParserTest__ -#include "CCPlatformMacros.h" -#include "CCControllerElement.h" +#include "cocos2d.h" +#include "extensions/cocos-ext.h" +#include "../../testBasic.h" +#include "ui/CocosGUI.h" -NS_CC_BEGIN +USING_NS_CC; +USING_NS_CC_EXT; +using namespace cocos2d::ui; -class ControllerAxisInput; -class ControllerButtonInput; - -class ControllerThumbstick : public ControllerElement +class CocostudioParserTestMainLayer : public Layer { public: - ControllerAxisInput* getAxisX() const; - ControllerAxisInput* getAxisY() const; + virtual void onEnter(); + void onTouchesBegan(const std::vector& touches, Event *event); - ControllerButtonInput* getButton() const; + void touchEvent(Ref* pSender, Widget::TouchEventType type); -protected: - - friend class Controller; - friend class Gamepad; - - ControllerThumbstick(); - virtual ~ControllerThumbstick(); - - ControllerAxisInput* _axisX; - ControllerAxisInput* _axisY; - - ControllerButtonInput* _button; +private: + Vec2 _beginPos; + Menu* _itemMenu; }; -NS_CC_END +class CocostudioParserTestScene : public TestScene +{ +public: + virtual void onEnter(); + virtual void runThisTest(); + void BackCallback(Ref* pSender); +}; -#endif /* defined(__cocos2d_libs__CCControllerThumbStick__) */ +#endif /* defined(__cocos2d_tests__CocostudioParserTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp new file mode 100644 index 0000000000..689b3e1e4f --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + 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 "CocostudioParserJsonTest.h" +#include "cocostudio/CCSGUIReader.h" +#include "ui/CocosGUI.h" +#include "../CocostudioParserTest.h" +#include "../CustomWidget/CustomImageView.h" +#include "../CustomWidget/CustomImageViewReader.h" +#include "../CustomWidget/CustomParticleWidgetReader.h" +#include "../CustomWidget/CustomParticleWidget.h" + + +USING_NS_CC; +using namespace cocostudio; +using namespace cocos2d::ui; + +// CustomImageLayer +CocostudioParserJsonLayer::CocostudioParserJsonLayer(std::string jsonFile) +{ + _jsonFile = jsonFile; +} + +void CocostudioParserJsonLayer::onEnter() +{ + Layer::onEnter(); + + GUIReader* guiReader = GUIReader::getInstance(); + guiReader->registerTypeAndCallBack("CustomImageView", + &CustomImageView::createInstance, + CustomImageViewReader::getInstance(), + parseselector(CustomImageViewReader::setProperties)); + guiReader->registerTypeAndCallBack("CustomParticleWidget", + &CustomParticleWidget::createInstance, + CustomParticleWidgetReader::getInstance(), + parseselector(CustomParticleWidgetReader::setProperties)); + + Layout* layout = static_cast(guiReader->widgetFromJsonFile(_jsonFile.c_str())); + layout->setScale(0.5); + addChild(layout); +} + + +// CocostudioParserJsonScene +CocostudioParserJsonScene::CocostudioParserJsonScene(std::string jsonFile) +{ + _jsonFile = jsonFile; +} + +void CocostudioParserJsonScene::onEnter() +{ + CCScene::onEnter(); + + auto label = Label::createWithTTF("Back", "fonts/arial.ttf", 20); + //#endif + MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocostudioParserJsonScene::BackCallback, this)); + + Menu* pMenu = Menu::create(pMenuItem, NULL); + + pMenu->setPosition( Vec2::ZERO ); + pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); + + addChild(pMenu, 1); +} + +void CocostudioParserJsonScene::runThisTest() +{ + Layer* pLayer = new CocostudioParserJsonLayer(_jsonFile); + addChild(pLayer); + pLayer->release(); + + CCDirector::getInstance()->replaceScene(this); +} + +void CocostudioParserJsonScene::BackCallback(Ref* pSender) +{ + CocostudioParserTestScene* pScene = new CocostudioParserTestScene(); + pScene->runThisTest(); + pScene->release(); +} \ No newline at end of file diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.h new file mode 100644 index 0000000000..4606d0ada9 --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.h @@ -0,0 +1,53 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + 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 __cocos2d_tests__CocostudioParserJsonTest__ +#define __cocos2d_tests__CocostudioParserJsonTest__ + +#include "cocos2d.h" +#include "../../../testBasic.h" + +class CocostudioParserJsonLayer : public cocos2d::Layer +{ +public: + CocostudioParserJsonLayer(std::string jsonFile); + ~CocostudioParserJsonLayer(){} + virtual void onEnter(); +private: + std::string _jsonFile; +}; + +class CocostudioParserJsonScene : public TestScene +{ +public: + CocostudioParserJsonScene(std::string jsonFile); + ~CocostudioParserJsonScene(){} + virtual void onEnter(); + virtual void runThisTest(); + void BackCallback(cocos2d::Ref* pSender); +private: + std::string _jsonFile; +}; + +#endif /* defined(__cocos2d_tests__CocostudioParserJsonTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp index ab993ab32f..a82f5c9384 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp @@ -122,7 +122,7 @@ void CustomGUITestScene::onEnter() //#endif MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomGUITestScene::BackCallback, this)); - Menu* pMenu = Menu::create(pMenuItem, NULL); + Menu* pMenu = Menu::create(pMenuItem, nullptr); pMenu->setPosition( Vec2::ZERO ); pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp index 0bd735b7b4..c59549a914 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp @@ -40,7 +40,7 @@ void CustomImageScene::onEnter() //#endif MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomImageScene::BackCallback, this)); - Menu* pMenu = Menu::create(pMenuItem, NULL); + Menu* pMenu = Menu::create(pMenuItem, nullptr); pMenu->setPosition( Vec2::ZERO ); pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp index ea7463c809..2898a95f57 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp @@ -54,7 +54,7 @@ void CustomParticleWidgetScene::onEnter() //#endif MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomParticleWidgetScene::BackCallback, this)); - Menu* pMenu = Menu::create(pMenuItem, NULL); + Menu* pMenu = Menu::create(pMenuItem, nullptr); pMenu->setPosition( Vec2::ZERO ); pMenuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp index 7f3e2af5ea..6c392cc8a6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp @@ -32,7 +32,7 @@ CustomImageView* CustomImageView::create() return custom; } CC_SAFE_DELETE(custom); - return NULL; + return nullptr; } bool CustomImageView::init() diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp index d026cba12e..c5067b7a0e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomImageViewReader.cpp @@ -8,7 +8,7 @@ USING_NS_CC_EXT; using namespace cocos2d::ui; using namespace cocostudio; -static CustomImageViewReader* _instanceCustomImageViewReader = NULL; +static CustomImageViewReader* _instanceCustomImageViewReader = nullptr; CustomImageViewReader::CustomImageViewReader() { @@ -34,7 +34,9 @@ void CustomImageViewReader::setProperties(const std::string& classType, cocos2d: CustomImageView* custom = static_cast(widget); const char* StringTest = DICTOOL->getStringValue_json(customOptions, "StringTest"); - custom->setText(StringTest); + if (StringTest) { + custom->setText(StringTest); + } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp index 7e9aacd47c..43ec7bcc2d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidget.cpp @@ -40,7 +40,7 @@ CustomParticleWidget* CustomParticleWidget::create() return custom; } CC_SAFE_DELETE(custom); - return NULL; + return nullptr; } bool CustomParticleWidget::init() @@ -74,8 +74,10 @@ void CustomParticleWidget::setParticlePlist(const char *plist) _emitter->removeFromParent(); _emitter = ParticleSystemQuad::create(plist); } - Node::addChild(_emitter , getLocalZOrder() + 1, -1); - + //Warning!!! don't forget to set the position + addProtectedChild(_emitter , getLocalZOrder() + 1, -1); + this->setParticlePosition(Vec2::ZERO); + _emitterPlist = plist; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidgetReader.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidgetReader.cpp index 1e8c955e3d..09079bdf7a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidgetReader.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomParticleWidgetReader.cpp @@ -25,7 +25,7 @@ CustomParticleWidgetReader::~CustomParticleWidgetReader() } -static CustomParticleWidgetReader* _instanceCustomParticleWidgetReader = NULL; +static CustomParticleWidgetReader* _instanceCustomParticleWidgetReader = nullptr; CustomParticleWidgetReader* CustomParticleWidgetReader::getInstance() { @@ -51,5 +51,6 @@ void CustomParticleWidgetReader::setProperties(const std::string& classType, std::string PlistFilePath = guiReader->getFilePath(); PlistFilePath.append(PlistFile); custom->setParticlePlist(PlistFilePath.c_str()); + } } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp index 99cfc80547..13e7e8b804 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp @@ -3,7 +3,7 @@ #include "CustomReader.h" #include "CustomImageView.h" -static CustomReader* _instanceCustomReader = NULL; +static CustomReader* _instanceCustomReader = nullptr; CustomReader::CustomReader() { diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index 346fb713d4..35c713551b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -42,6 +42,17 @@ bool UIButtonTest::init() // button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest::touchEvent, this)); _uiLayer->addChild(button); + + // Create the imageview + ImageView* imageView = ImageView::create(); + + imageView->setPosition(Vec2(widgetSize.width / 2.0f + 50+ button->getContentSize().width/2, + widgetSize.height / 2.0f)); + imageView->setTag(12); + + _uiLayer->addChild(imageView); + + return true; } @@ -61,7 +72,15 @@ void UIButtonTest::touchEvent(Ref *pSender, Widget::TouchEventType type) break; case Widget::TouchEventType::ENDED: + { _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + ImageView* imageView = (ImageView*)_uiLayer->getChildByTag(12); + imageView->setVisible(false); + imageView->loadTexture("cocosui/ccicon.png"); + imageView->setOpacity(0); + imageView->setVisible(true); + imageView->runAction(Sequence::create(FadeIn::create(0.5),DelayTime::create(1.0),FadeOut::create(0.5), nullptr)); + } break; case Widget::TouchEventType::CANCELED: @@ -111,10 +130,18 @@ bool UIButtonTest_Scale9::init() button->setScale9Enabled(true); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); button->setContentSize(Size(150, 70)); -// button->addTouchEventListener(this, toucheventselector(UIButtonTest_Scale9::touchEvent)); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Scale9::touchEvent, this)); _uiLayer->addChild(button); + // Create the imageview + Button* button2 = Button::create(); + button2->setPosition(Vec2(widgetSize.width / 2.0f + button->getContentSize().width + 20, widgetSize.height / 2.0f)); + button2->setName("normal"); + _uiLayer->addChild(button2); + + Sprite *sprite = Sprite::create("cocosui/animationbuttonnormal.png"); + button2->addChild(sprite); + return true; } return false; @@ -133,7 +160,13 @@ void UIButtonTest_Scale9::touchEvent(Ref *pSender, Widget::TouchEventType type) break; case Widget::TouchEventType::ENDED: + { _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + Button *btn = (Button*)_uiLayer->getChildByName("normal"); + btn->loadTextureNormal("cocosui/animationbuttonnormal.png"); + btn->loadTexturePressed("cocosui/animationbuttonpressed.png"); + btn->runAction(Sequence::create(FadeIn::create(0.5),DelayTime::create(1.0),FadeOut::create(0.5), nullptr)); + } break; case Widget::TouchEventType::CANCELED: @@ -180,8 +213,10 @@ bool UIButtonTest_PressedAction::init() Button* button = Button::create("cocosui/animationbuttonnormal.png", "cocosui/animationbuttonpressed.png"); button->setPressedActionEnabled(true); button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f)); -// button->addTouchEventListener(this, toucheventselector(UIButtonTest_PressedAction::touchEvent)); + button->setColor(Color3B::GREEN); + button->setOpacity(30); button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_PressedAction::touchEvent, this)); + button->setName("button"); _uiLayer->addChild(button); return true; @@ -202,7 +237,11 @@ void UIButtonTest_PressedAction::touchEvent(Ref *pSender, Widget::TouchEventType break; case Widget::TouchEventType::ENDED: + { _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + Button* btn = (Button*)_uiLayer->getChildByName("button"); + btn->loadTextureNormal("cocosui/animationbuttonnormal.png"); + } break; case Widget::TouchEventType::CANCELED: @@ -255,6 +294,16 @@ bool UIButtonTest_Title::init() button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Title::touchEvent, this)); _uiLayer->addChild(button); + + TextBMFont *text = TextBMFont::create("BMFont", "cocosui/bitmapFontTest2.fnt"); + text->setPosition(button->getPosition() + Vec2(button->getContentSize().width/2 + 50,0)); + text->setColor(Color3B::YELLOW); + text->setOpacity(50); + text->setName("text"); + + + _uiLayer->addChild(text); + return true; } return false; @@ -274,7 +323,17 @@ void UIButtonTest_Title::touchEvent(Ref *pSender, Widget::TouchEventType type) break; case Widget::TouchEventType::ENDED: + { _displayValueLabel->setString(String::createWithFormat("Touch Up")->getCString()); + TextBMFont *text = (TextBMFont*)_uiLayer->getChildByName("text"); + text->setFntFile("cocosui/bitmapFontTest2.fnt"); + if (text->getString() == "BMFont") { + text->setString("Hello"); + } + else{ + text->setString("BMFont"); + } + } break; case Widget::TouchEventType::CANCELED: diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp index 468b8a1d61..53a668ecec 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp @@ -16,46 +16,70 @@ UIButtonTest_Editor::~UIButtonTest_Editor() } +void UIButtonTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIButtonTest_Editor::configureGUIScene() +{ + Size screenSize = Director::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + ui::Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* button = static_cast(Helper::seekWidgetByName(root, "Button_123")); + button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent, this)); + + Button* title_button = static_cast(Helper::seekWidgetByName(root, "Button_126")); + title_button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent, this)); + + Button* scale9_button = static_cast(Helper::seekWidgetByName(root, "Button_129")); + scale9_button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent,this)); + +} + bool UIButtonTest_Editor::init() { if (UIScene_Editor::init()) { -// auto _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.json")); - - - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.csb")); - - - + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIButton_Editor/UIButton_Editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + this->configureGUIScene(); - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - Button* button = static_cast(Helper::seekWidgetByName(root, "Button_123")); - button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent, this)); - - Button* title_button = static_cast(Helper::seekWidgetByName(root, "Button_126")); - title_button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent, this)); - - Button* scale9_button = static_cast(Helper::seekWidgetByName(root, "Button_129")); - scale9_button->addTouchEventListener(CC_CALLBACK_2(UIButtonTest_Editor::touchEvent, this)); - - _displayValueLabel = Text::create(); - _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); + _displayValueLabel = ui::Text::create(); + _displayValueLabel->setFontName("Marker Felt"); _displayValueLabel->setFontSize(30); _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vec2(_layout->getContentSize().width / 2, - _layout->getContentSize().height - _displayValueLabel->getContentSize().height * 1.75f)); - _touchGroup->addChild(_displayValueLabel); + _layout->getContentSize().height - _displayValueLabel->getContentSize().height * 1.75f)); + + _touchGroup->addChild(_displayValueLabel,20); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h index 1985dcb907..33f8e5c72e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.h @@ -35,7 +35,9 @@ public: bool init(); void touchEvent(Ref* pSender, Widget::TouchEventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); + protected: UI_SCENE_EDITOR_CREATE_FUNC(UIButtonTest_Editor); Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp index 097cae5079..07594f4ad1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp @@ -16,27 +16,54 @@ UICheckBoxTest_Editor::~UICheckBoxTest_Editor() } +void UICheckBoxTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UICheckBoxTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + CheckBox* checkbox = static_cast(Helper::seekWidgetByName(root, "CheckBox_540")); + checkbox->addEventListener(CC_CALLBACK_2(UICheckBoxTest_Editor::selectedStateEvent, this)); + +} + bool UICheckBoxTest_Editor::init() { if (UIScene_Editor::init()) { - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.csb")); -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_2.json")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UICheckBox_Editor/ui_checkbox_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - CheckBox* checkbox = static_cast(Helper::seekWidgetByName(root, "CheckBox_540")); - checkbox->addEventListener(CC_CALLBACK_2(UICheckBoxTest_Editor::selectedStateEvent, this)); + + this->configureGUIScene(); _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); @@ -44,7 +71,7 @@ bool UICheckBoxTest_Editor::init() _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vec2(_layout->getContentSize().width / 2, _layout->getContentSize().height - _displayValueLabel->getContentSize().height * 1.75f)); - _touchGroup->addChild(_displayValueLabel); + _touchGroup->addChild(_displayValueLabel,20); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h index c9ed1cb988..d2d03b7ce6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.h @@ -34,7 +34,8 @@ public: ~UICheckBoxTest_Editor(); bool init(); void selectedStateEvent(Ref* pSender, CheckBox::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UICheckBoxTest_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp index 030c136b4c..42ffc6e318 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp @@ -302,7 +302,7 @@ bool UIFocusTestNestedLayout1::init() //add HBox into VBox HBox *hbox = HBox::create(); - hbox->setScale(0.8); + hbox->setScale(0.8f); hbox->setTag(101); _verticalLayout->addChild(hbox); @@ -384,7 +384,7 @@ bool UIFocusTestNestedLayout2::init() _horizontalLayout = HBox::create(); _horizontalLayout->setPosition(Vec2(winSize.width/2 - 200, winSize.height - 70)); _uiLayer->addChild(_horizontalLayout); - _horizontalLayout->setScale(0.6); + _horizontalLayout->setScale(0.6f); _horizontalLayout->setFocused(true); _horizontalLayout->setLoopFocus(true); @@ -397,14 +397,14 @@ bool UIFocusTestNestedLayout2::init() w->setAnchorPoint(Vec2(0,1)); w->setTouchEnabled(true); w->setTag(i+count1); - w->setScaleY(2.4); + w->setScaleY(2.4f); w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this)); _horizontalLayout->addChild(w); } //add HBox into VBox VBox *vbox = VBox::create(); - vbox->setScale(0.8); + vbox->setScale(0.8f); vbox->setTag(101); _horizontalLayout->addChild(vbox); @@ -486,7 +486,7 @@ bool UIFocusTestNestedLayout3::init() _verticalLayout = VBox::create(); _verticalLayout->setPosition(Vec2(40, winSize.height - 70)); _uiLayer->addChild(_verticalLayout); - _verticalLayout->setScale(0.8); + _verticalLayout->setScale(0.8f); _verticalLayout->setFocused(true); _verticalLayout->setLoopFocus(true); @@ -602,7 +602,7 @@ bool UIFocusTestListView::init() _listView->setPosition(Vec2(40, 70)); _uiLayer->addChild(_listView); - _listView->setScale(0.8); + _listView->setScale(0.8f); _listView->setFocused(true); _listView->setLoopFocus(true); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp index 06a136ccf7..a0a6f7fa98 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.cpp @@ -4,26 +4,53 @@ // UIImageViewTest_Editor +void UIImageViewTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIImageViewTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + +} bool UIImageViewTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIImageView_Editor/ui_ImageView_editor_1.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h index 195f239fae..37a1604d73 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest_Editor.h @@ -31,7 +31,9 @@ class UIImageViewTest_Editor : public UIScene_Editor { public: bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); + protected: UI_SCENE_EDITOR_CREATE_FUNC(UIImageViewTest_Editor) }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp index 5632895887..a1e24b12c7 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.cpp @@ -13,44 +13,72 @@ UILayoutTest_Editor::UILayoutTest_Editor() UILayoutTest_Editor::~UILayoutTest_Editor() { +} + +void UILayoutTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + + } bool UILayoutTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Editor/ui_layout_editor_1.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); + this->configureGUIScene(); return true; } @@ -71,43 +99,68 @@ UILayoutTest_Color_Editor::~UILayoutTest_Color_Editor() } +void UILayoutTest_Color_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Color_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); +} + bool UILayoutTest_Color_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Color_Editor/ui_layout_color_editor_1.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + this->configureGUIScene(); return true; } @@ -127,43 +180,69 @@ UILayoutTest_Gradient_Editor::~UILayoutTest_Gradient_Editor() } +void UILayoutTest_Gradient_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Gradient_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_Gradient_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Gradient_Color_Editor/ui_layout_gradient_color_editor_1_0.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + this->configureGUIScene(); return true; } @@ -183,43 +262,70 @@ UILayoutTest_BackGroundImage_Editor::~UILayoutTest_BackGroundImage_Editor() } +void UILayoutTest_BackGroundImage_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_BackGroundImage_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_BackGroundImage_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_BackgroundImage_Editor/ui_layout_backgroundimage_editor_1_0_0.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + + this->configureGUIScene(); return true; } @@ -239,43 +345,70 @@ UILayoutTest_BackGroundImage_Scale9_Editor::~UILayoutTest_BackGroundImage_Scale9 } +void UILayoutTest_BackGroundImage_Scale9_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_BackGroundImage_Scale9_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_BackGroundImage_Scale9_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Scale9_BackgroundImage_Editor/ui_layout_scale9_backgroundimage_editor.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + + this->configureGUIScene(); return true; } @@ -295,43 +428,70 @@ UILayoutTest_Layout_Linear_Vertical_Editor::~UILayoutTest_Layout_Linear_Vertical } +void UILayoutTest_Layout_Linear_Vertical_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Layout_Linear_Vertical_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_Layout_Linear_Vertical_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Vertical_Layout_Editor/ui_layout_linear_vertical_layout_editor.json")); + _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); + this->configureGUIScene(); return true; } @@ -351,43 +511,69 @@ UILayoutTest_Layout_Linear_Horizontal_Editor::~UILayoutTest_Layout_Linear_Horizo } +void UILayoutTest_Layout_Linear_Horizontal_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Layout_Linear_Horizontal_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_Layout_Linear_Horizontal_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Linear_Horizontal_Layout_Editor/ui_layout_linear_horizontal_layout_editor.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + + this->configureGUIScene(); return true; } @@ -408,42 +594,68 @@ UILayoutTest_Layout_Relative_Align_Parent_Editor::~UILayoutTest_Layout_Relative_ } +void UILayoutTest_Layout_Relative_Align_Parent_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Layout_Relative_Align_Parent_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_Layout_Relative_Align_Parent_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Parent_Editor/ui_layout_relative_align_parent_editor.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); + this->configureGUIScene(); return true; } @@ -464,43 +676,68 @@ UILayoutTest_Layout_Relative_Location_Editor::~UILayoutTest_Layout_Relative_Loca } +void UILayoutTest_Layout_Relative_Location_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILayoutTest_Layout_Relative_Location_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UILayoutTest_Layout_Relative_Location_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILayout_Editor/UILayout_Relative_Align_Location_Editor/ui_layout_relative_align_location_editor.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.h index 15025f5f99..5b0fb91c4f 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILayoutTest/UILayoutTest_Editor.h @@ -33,7 +33,8 @@ public: UILayoutTest_Editor(); ~UILayoutTest_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Editor) }; @@ -45,7 +46,8 @@ public: UILayoutTest_Color_Editor(); ~UILayoutTest_Color_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Color_Editor) }; @@ -57,7 +59,8 @@ public: UILayoutTest_Gradient_Editor(); ~UILayoutTest_Gradient_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Gradient_Editor) }; @@ -69,7 +72,8 @@ public: UILayoutTest_BackGroundImage_Editor(); ~UILayoutTest_BackGroundImage_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_BackGroundImage_Editor) }; @@ -81,7 +85,8 @@ public: UILayoutTest_BackGroundImage_Scale9_Editor(); ~UILayoutTest_BackGroundImage_Scale9_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_BackGroundImage_Scale9_Editor) }; @@ -92,6 +97,8 @@ class UILayoutTest_Layout_Linear_Vertical_Editor : public UIScene_Editor public: UILayoutTest_Layout_Linear_Vertical_Editor(); ~UILayoutTest_Layout_Linear_Vertical_Editor(); + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); bool init(); protected: @@ -105,7 +112,8 @@ public: UILayoutTest_Layout_Linear_Horizontal_Editor(); ~UILayoutTest_Layout_Linear_Horizontal_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Layout_Linear_Horizontal_Editor) }; @@ -117,7 +125,8 @@ public: UILayoutTest_Layout_Relative_Align_Parent_Editor(); ~UILayoutTest_Layout_Relative_Align_Parent_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Layout_Relative_Align_Parent_Editor) }; @@ -129,7 +138,8 @@ public: UILayoutTest_Layout_Relative_Location_Editor(); ~UILayoutTest_Layout_Relative_Location_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILayoutTest_Layout_Relative_Location_Editor) }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index f10366869d..8de636b9de 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -57,7 +57,7 @@ bool UIListViewTest_Vertical::init() listView->setBounceEnabled(true); listView->setBackGroundImage("cocosui/green_edit.png"); listView->setBackGroundImageScale9Enabled(true); - listView->setSize(Size(240, 130)); + listView->setContentSize(Size(240, 130)); listView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - listView->getContentSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + @@ -74,7 +74,7 @@ bool UIListViewTest_Vertical::init() Layout* default_item = Layout::create(); default_item->setTouchEnabled(true); - default_item->setSize(default_button->getContentSize()); + default_item->setContentSize(default_button->getContentSize()); default_button->setPosition(Vec2(default_item->getContentSize().width / 2.0f, default_item->getContentSize().height / 2.0f)); default_item->addChild(default_button); @@ -106,10 +106,10 @@ bool UIListViewTest_Vertical::init() Button* custom_button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); custom_button->setName("Title Button"); custom_button->setScale9Enabled(true); - custom_button->setSize(default_button->getContentSize()); + custom_button->setContentSize(default_button->getContentSize()); Layout *custom_item = Layout::create(); - custom_item->setSize(custom_button->getContentSize()); + custom_item->setContentSize(custom_button->getContentSize()); custom_button->setPosition(Vec2(custom_item->getContentSize().width / 2.0f, custom_item->getContentSize().height / 2.0f)); custom_item->addChild(custom_button); @@ -123,10 +123,10 @@ bool UIListViewTest_Vertical::init() Button* custom_button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); custom_button->setName("Title Button"); custom_button->setScale9Enabled(true); - custom_button->setSize(default_button->getContentSize()); + custom_button->setContentSize(default_button->getContentSize()); Layout *custom_item = Layout::create(); - custom_item->setSize(custom_button->getContentSize()); + custom_item->setContentSize(custom_button->getContentSize()); custom_button->setPosition(Vec2(custom_item->getContentSize().width / 2.0f, custom_item->getContentSize().height / 2.0f)); custom_item->addChild(custom_button); custom_item->setTag(1); @@ -255,7 +255,7 @@ bool UIListViewTest_Horizontal::init() listView->setBounceEnabled(true); listView->setBackGroundImage("cocosui/green_edit.png"); listView->setBackGroundImageScale9Enabled(true); - listView->setSize(Size(240, 130)); + listView->setContentSize(Size(240, 130)); listView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + (backgroundSize.width - listView->getContentSize().width) / 2.0f, (widgetSize.height - backgroundSize.height) / 2.0f + @@ -270,7 +270,7 @@ bool UIListViewTest_Horizontal::init() Layout *default_item = Layout::create(); default_item->setTouchEnabled(true); - default_item->setSize(default_button->getContentSize()); + default_item->setContentSize(default_button->getContentSize()); default_button->setPosition(Vec2(default_item->getContentSize().width / 2.0f, default_item->getContentSize().height / 2.0f)); default_item->addChild(default_button); @@ -295,10 +295,10 @@ bool UIListViewTest_Horizontal::init() Button* custom_button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); custom_button->setName("Title Button"); custom_button->setScale9Enabled(true); - custom_button->setSize(default_button->getContentSize()); + custom_button->setContentSize(default_button->getContentSize()); Layout* custom_item = Layout::create(); - custom_item->setSize(custom_button->getContentSize()); + custom_item->setContentSize(custom_button->getContentSize()); custom_button->setPosition(Vec2(custom_item->getContentSize().width / 2.0f, custom_item->getContentSize().height / 2.0f)); custom_item->addChild(custom_button); @@ -312,10 +312,10 @@ bool UIListViewTest_Horizontal::init() Button* custom_button = Button::create("cocosui/button.png", "cocosui/buttonHighlighted.png"); custom_button->setName("Title Button"); custom_button->setScale9Enabled(true); - custom_button->setSize(default_button->getContentSize()); + custom_button->setContentSize(default_button->getContentSize()); Layout* custom_item = Layout::create(); - custom_item->setSize(custom_button->getContentSize()); + custom_item->setContentSize(custom_button->getContentSize()); custom_button->setPosition(Vec2(custom_item->getContentSize().width / 2.0f, custom_item->getContentSize().height / 2.0f)); custom_item->addChild(custom_button); diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp index 81ae580b79..af770b4903 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.cpp @@ -15,47 +15,73 @@ UIListViewTest_Vertical_Editor::~UIListViewTest_Vertical_Editor() } +void UIListViewTest_Vertical_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIListViewTest_Vertical_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene,this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + // ListView* listView = static_cast(UIHelper::seekWidgetByName(root, "ListView_1214")); + // CCLOG("listView isBounceEnabled = %d", listView->isBounceEnabled()); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); + + + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback,this)); + _layout->addChild(right_button); + +} + bool UIListViewTest_Vertical_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Vertical_Editor/ui_listview_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene,this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - -// ListView* listView = static_cast(UIHelper::seekWidgetByName(root, "ListView_1214")); -// CCLOG("listView isBounceEnabled = %d", listView->isBounceEnabled()); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); - - - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback,this)); - _layout->addChild(right_button); + this->configureGUIScene(); return true; } @@ -72,6 +98,61 @@ UIListViewTest_Horizontal_Editor::UIListViewTest_Horizontal_Editor() } +void UIListViewTest_Horizontal_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIListViewTest_Horizontal_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene,this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + UIListViewTest_Horizontal_Editor::~UIListViewTest_Horizontal_Editor() { @@ -81,38 +162,10 @@ bool UIListViewTest_Horizontal_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIListView_Editor/UIListView_Horizontal_Editor/ui_listview_horizontal_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene,this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback,this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); + + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.h index 0f5d0e07ef..f8d1efe3e8 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIListViewTest/UIListViewTest_Editor.h @@ -34,7 +34,8 @@ public: ~UIListViewTest_Vertical_Editor(); bool init(); void selectedItemEvent(Ref* pSender, ListView::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIListViewTest_Vertical_Editor) Text* _displayValueLabel; @@ -50,7 +51,8 @@ public: ~UIListViewTest_Horizontal_Editor(); bool init(); void selectedItemEvent(Ref* pSender, ListView::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIListViewTest_Horizontal_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp index f882651fdf..d651621990 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.cpp @@ -6,6 +6,7 @@ // UILoadingBarTest_Editor UILoadingBarTest_Editor::UILoadingBarTest_Editor() +:_count(0) { } @@ -15,34 +16,60 @@ UILoadingBarTest_Editor::~UILoadingBarTest_Editor() } +void UILoadingBarTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.json")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UILoadingBarTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + // back_label->addTouchEventListener(this, toucheventselector(UIScene_Editor::toGUIEditorTestScene)); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + LoadingBar* loadingBar_left_to_right = dynamic_cast(Helper::seekWidgetByName(root, "LoadingBar_856")); + loadingBar_left_to_right->setPercent(0); + + LoadingBar* loadingBar_right_to_left = dynamic_cast(Helper::seekWidgetByName(root, "LoadingBar_857")); + loadingBar_right_to_left->setPercent(0); + +} + bool UILoadingBarTest_Editor::init() { if (UIScene_Editor::init()) { scheduleUpdate(); -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILoadingBar_Editor/ui_loadingbar_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); -// back_label->addTouchEventListener(this, toucheventselector(UIScene_Editor::toGUIEditorTestScene)); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - LoadingBar* loadingBar_left_to_right = dynamic_cast(Helper::seekWidgetByName(root, "LoadingBar_856")); - loadingBar_left_to_right->setPercent(0); - - LoadingBar* loadingBar_right_to_left = dynamic_cast(Helper::seekWidgetByName(root, "LoadingBar_857")); - loadingBar_right_to_left->setPercent(0); - + + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.h index 1cb987c22d..ed7c26d39e 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest_Editor.h @@ -13,7 +13,8 @@ public: bool init(); void update(float delta); void toCocosGUITestScene(Ref* sender, Widget::TouchEventType event); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UILoadingBarTest_Editor) int _count; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index e8ab78b8ce..973d6ba1ef 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -97,3 +97,114 @@ void UIPageViewTest::pageViewEvent(Ref *pSender, PageView::EventType type) break; } } + + +// UIPageViewButtonTest +UIPageViewButtonTest::UIPageViewButtonTest() +: _displayValueLabel(nullptr) +{ + +} + +UIPageViewButtonTest::~UIPageViewButtonTest() +{ +} + +bool UIPageViewButtonTest::init() +{ + if (UIScene::init()) + { + Size widgetSize = _widget->getContentSize(); + + // Add a label in which the dragpanel events will be displayed + _displayValueLabel = Text::create("Move by horizontal direction", "fonts/Marker Felt.ttf", 32); + _displayValueLabel->setAnchorPoint(Vec2(0.5f, -1.0f)); + _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, + widgetSize.height / 2.0f + + _displayValueLabel->getContentSize().height * 1.5)); + _uiLayer->addChild(_displayValueLabel); + + // Add the black background + Text* alert = Text::create("PageView with Buttons", "fonts/Marker Felt.ttf", 30); + alert->setColor(Color3B(159, 168, 176)); + alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 3.075f)); + _uiLayer->addChild(alert); + + Layout* root = static_cast(_uiLayer->getChildByTag(81)); + + Layout* background = dynamic_cast(root->getChildByName("background_Panel")); + + // Create the page view + PageView* pageView = PageView::create(); + pageView->setContentSize(Size(240.0f, 130.0f)); + Size backgroundSize = background->getContentSize(); + pageView->setPosition(Vec2((widgetSize.width - backgroundSize.width) / 2.0f + + (backgroundSize.width - pageView->getContentSize().width) / 2.0f, + (widgetSize.height - backgroundSize.height) / 2.0f + + (backgroundSize.height - pageView->getContentSize().height) / 2.0f)); + + pageView->removeAllPages(); + + int pageCount = 4; + for (int i = 0; i < pageCount; ++i) + { + HBox* outerBox = HBox::create(); + outerBox->setContentSize(Size(240.0f, 130.0f)); + + for (int k = 0; k < 2; ++k) { + VBox* innerBox = VBox::create(); + + for (int j = 0; j < 3; j++) { + Button *btn = Button::create("cocosui/animationbuttonnormal.png", + "cocosui/animationbuttonpressed.png"); + btn->setName(StringUtils::format("button %d", j)); + btn->addTouchEventListener( CC_CALLBACK_2(UIPageViewButtonTest::onButtonClicked, this)); + + innerBox->addChild(btn); + } + + LinearLayoutParameter *parameter = LinearLayoutParameter::create(); + parameter->setMargin(Margin(0,0,100,0)); + innerBox->setLayoutParameter(parameter); + + outerBox->addChild(innerBox); + + } + + pageView->insertPage(outerBox,i); + } + + pageView->removePageAtIndex(0); + + pageView->addEventListener(CC_CALLBACK_2(UIPageViewButtonTest::pageViewEvent, this)); + + _uiLayer->addChild(pageView); + + return true; + } + return false; +} + +void UIPageViewButtonTest::onButtonClicked(Ref* pSender, Widget::TouchEventType type) +{ + Button *btn = (Button*)pSender; + CCLOG("button %s clicked", btn->getName().c_str()); +} + + +void UIPageViewButtonTest::pageViewEvent(Ref *pSender, PageView::EventType type) +{ + switch (type) + { + case PageView::EventType::TURNING: + { + PageView* pageView = dynamic_cast(pSender); + + _displayValueLabel->setString(CCString::createWithFormat("page = %ld", pageView->getCurPageIndex() + 1)->getCString()); + } + break; + + default: + break; + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h index 7bbb1cd59b..114737a291 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.h @@ -41,4 +41,18 @@ protected: Text* _displayValueLabel; }; +class UIPageViewButtonTest : public UIScene +{ +public: + UIPageViewButtonTest(); + ~UIPageViewButtonTest(); + bool init(); + + void pageViewEvent(Ref* pSender, PageView::EventType type); + void onButtonClicked(Ref* pSender, Widget::TouchEventType type); +protected: + UI_SCENE_CREATE_FUNC(UIPageViewButtonTest) + Text* _displayValueLabel; +}; + #endif /* defined(__TestCpp__UIPageViewTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp index 96f6f9e93b..f509bff3f4 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.cpp @@ -16,43 +16,70 @@ UIPageViewTest_Editor::~UIPageViewTest_Editor() } +void UIPageViewTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIPageViewTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UIPageViewTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIPageView_Editor/ui_pageview_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h index ae3beb4eb6..82248d2fdc 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest_Editor.h @@ -35,7 +35,8 @@ public: bool init(); void pageViewEvent(Ref* pSender, PageView::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIPageViewTest_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 507c0d483b..69ad20c90a 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -100,7 +100,8 @@ static const char* s_testArray[] = "UIScrollViewTest_Both", "UIScrollViewTest_ScrollToPercentBothDirection", "UIScrollViewTest_ScrollToPercentBothDirection_Bounce", - "UIPageViewTest,", + "UIPageViewTest", + "UIPageViewButtonTest", "UIListViewTest_Vertical", "UIListViewTest_Horizontal", /* @@ -124,7 +125,7 @@ static const char* s_testArray[] = #endif }; -static UISceneManager *sharedInstance = NULL; +static UISceneManager *sharedInstance = nullptr; UISceneManager::UISceneManager() @@ -139,7 +140,7 @@ UISceneManager::~UISceneManager() UISceneManager * UISceneManager::sharedUISceneManager() { - if (sharedInstance == NULL) + if (sharedInstance == nullptr) { sharedInstance = new UISceneManager(); } @@ -344,7 +345,8 @@ Scene *UISceneManager::currentUIScene() case kUIPageViewTest: return UIPageViewTest::sceneWithTitle(s_testArray[_currentUISceneId]); - + case kUIPageViewButtonTest: + return UIPageViewButtonTest::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIListViewTest_Vertical: return UIListViewTest_Vertical::sceneWithTitle(s_testArray[_currentUISceneId]); @@ -389,5 +391,5 @@ Scene *UISceneManager::currentUIScene() return VideoPlayerTest::sceneWithTitle(s_testArray[_currentUISceneId]); #endif } - return NULL; + return nullptr; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 8afdc9a83c..7201d4422d 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -90,6 +90,7 @@ enum kUIScrollViewTest_ScrollToPercentBothDirection, kUIScrollViewTest_ScrollToPercentBothDirection_Bounce, kUIPageViewTest, + kUIPageViewButtonTest, kUIListViewTest_Vertical, kUIListViewTest_Horizontal, /* diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager_Editor.cpp index fcbc977ebf..38d81fc076 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager_Editor.cpp @@ -48,7 +48,7 @@ static const char* s_testArray[] = "UIScrollViewTest_Both_Editor", }; -static UISceneManager_Editor* sharedInstance = NULL; +static UISceneManager_Editor* sharedInstance = nullptr; UISceneManager_Editor::UISceneManager_Editor() { @@ -62,7 +62,7 @@ UISceneManager_Editor::~UISceneManager_Editor() UISceneManager_Editor* UISceneManager_Editor::sharedUISceneManager_Editor() { - if (sharedInstance == NULL) + if (sharedInstance == nullptr) { sharedInstance = new UISceneManager_Editor(); } @@ -181,5 +181,5 @@ Scene* UISceneManager_Editor::currentUIScene() break; } - return NULL; + return nullptr; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp index 92976538e8..0f9a93c5af 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.cpp @@ -26,12 +26,37 @@ bool UIScene_Editor::init() _touchGroup = Layer::create(); addChild(_touchGroup); + //add switch + MenuItem* pLoadJsonItem = MenuItemFont::create("Switch to Binary Load"); + MenuItem* pLoadBinaryItem = MenuItemFont::create("Switch to Json Load"); + + pLoadJsonItem->setTag(1); + pLoadBinaryItem->setTag(2); + + Vector array;; + array.pushBack(pLoadJsonItem); + array.pushBack(pLoadBinaryItem); + + MenuItemToggle *pToggleItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(UIScene_Editor::switchLoadMethod,this), array); + + pToggleItem->setPosition(Vec2(VisibleRect::right().x - 150, VisibleRect::top().y - 50));; + + Menu* pMenu =Menu::create(pToggleItem, nullptr); + pMenu->setPosition( Vec2::ZERO ); + + addChild(pMenu, 1); + return true; } return false; } +void UIScene_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + //subclass should override this method +} + void UIScene_Editor::previousCallback(Ref* sender, Widget::TouchEventType event) { switch (event) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h index d681787126..d4507fc753 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene_Editor.h @@ -69,7 +69,8 @@ public: CC_SYNTHESIZE_READONLY(Text*, _sceneTitle, SceneTitle) UI_SCENE_EDITOR_CREATE_FUNC(UIScene_Editor); - + virtual void switchLoadMethod(Ref* pSender); + protected: Layer* _touchGroup; Layout* _layout; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp index f782dfe945..f2d4eefdb6 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.cpp @@ -15,43 +15,70 @@ UIScrollViewTest_Vertical_Editor::~UIScrollViewTest_Vertical_Editor() } +void UIScrollViewTest_Vertical_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIScrollViewTest_Vertical_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + +} + bool UIScrollViewTest_Vertical_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Vertical_Editor/ui_scrollview_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + + this->configureGUIScene(); return true; } @@ -69,45 +96,72 @@ UIScrollViewTest_Horizontal_Editor::UIScrollViewTest_Horizontal_Editor() UIScrollViewTest_Horizontal_Editor::~UIScrollViewTest_Horizontal_Editor() { +} + +void UIScrollViewTest_Horizontal_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIScrollViewTest_Horizontal_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); + + } bool UIScrollViewTest_Horizontal_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Horizontal_Editor/ui_scrollview_horizontal_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + this->configureGUIScene(); return true; } @@ -127,43 +181,68 @@ UIScrollViewTest_Both_Editor::~UIScrollViewTest_Both_Editor() } +void UIScrollViewTest_Both_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIScrollViewTest_Both_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + Button* left_button = Button::create(); + left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); + left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, + left_button->getContentSize().height * 0.625)); + left_button->setTouchEnabled(true); + left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); + left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(left_button); + + Button* right_button = Button::create(); + right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); + right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, + right_button->getContentSize().height * 0.625)); + right_button->setTouchEnabled(true); + right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); + right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); + _layout->addChild(right_button); +} + bool UIScrollViewTest_Both_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIScrollView_Editor/UIScrollView_Both_Editor/ui_scrollview_both_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - Button* left_button = Button::create(); - left_button->loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button->setPosition(Vec2(_layout->getContentSize().width / 2 - left_button->getContentSize().width, - left_button->getContentSize().height * 0.625)); - left_button->setTouchEnabled(true); - left_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::previousCallback, this)); - left_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(left_button); - - Button* right_button = Button::create(); - right_button->loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button->setPosition(Vec2(_layout->getContentSize().width / 2 + right_button->getContentSize().width, - right_button->getContentSize().height * 0.625)); - right_button->setTouchEnabled(true); - right_button->setLocalZOrder(_layout->getLocalZOrder() + 1); - right_button->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::nextCallback, this)); - _layout->addChild(right_button); - + this->configureGUIScene(); return true; } @@ -183,6 +262,7 @@ UIScrollViewTest_ScrollToPercentBothDirection_Editor::~UIScrollViewTest_ScrollTo } + bool UIScrollViewTest_ScrollToPercentBothDirection_Editor::init() { if (UIScene_Editor::init()) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.h index 648f97ec5e..627d5df685 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest_Editor.h @@ -33,7 +33,8 @@ public: UIScrollViewTest_Vertical_Editor(); ~UIScrollViewTest_Vertical_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIScrollViewTest_Vertical_Editor) Text* _displayValueLabel; @@ -46,7 +47,8 @@ public: UIScrollViewTest_Horizontal_Editor(); ~UIScrollViewTest_Horizontal_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIScrollViewTest_Horizontal_Editor) Text* _displayValueLabel; @@ -59,7 +61,8 @@ public: UIScrollViewTest_Both_Editor(); ~UIScrollViewTest_Both_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIScrollViewTest_Both_Editor) Text* _displayValueLabel; @@ -72,7 +75,7 @@ public: UIScrollViewTest_ScrollToPercentBothDirection_Editor(); ~UIScrollViewTest_ScrollToPercentBothDirection_Editor(); bool init(); - + protected: UI_SCENE_EDITOR_CREATE_FUNC(UIScrollViewTest_ScrollToPercentBothDirection_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp index 54d2252ecb..b27625bb9b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp @@ -16,32 +16,58 @@ UISliderTest_Editor::~UISliderTest_Editor() } +void UISliderTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UISliderTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + + Slider* slider = static_cast(Helper::seekWidgetByName(root, "Slider_738")); + slider->addEventListener(CC_CALLBACK_2(UISliderTest_Editor::sliderEvent, this)); + + Slider* scale9_slider = static_cast(Helper::seekWidgetByName(root, "Slider_740")); + scale9_slider->addEventListener(CC_CALLBACK_2(UISliderTest_Editor::sliderEvent, this)); +} + bool UISliderTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UISlider_Editor/ui_slider_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - - Slider* slider = static_cast(Helper::seekWidgetByName(root, "Slider_738")); - slider->addEventListener(CC_CALLBACK_2(UISliderTest_Editor::sliderEvent, this)); - - Slider* scale9_slider = static_cast(Helper::seekWidgetByName(root, "Slider_740")); - scale9_slider->addEventListener(CC_CALLBACK_2(UISliderTest_Editor::sliderEvent, this)); - + + this->configureGUIScene(); _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); @@ -49,7 +75,7 @@ bool UISliderTest_Editor::init() _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vec2(_layout->getContentSize().width / 2, _layout->getContentSize().height - _displayValueLabel->getContentSize().height * 1.75f)); - _touchGroup->addChild(_displayValueLabel); + _touchGroup->addChild(_displayValueLabel, 20); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.h index 3637d2212e..ff7dc3ec40 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.h @@ -12,7 +12,9 @@ public: ~UISliderTest_Editor(); bool init(); void sliderEvent(Ref* pSender, Slider::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); + protected: UI_SCENE_EDITOR_CREATE_FUNC(UISliderTest_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp index ed418ac7d7..bade2452e9 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.cpp @@ -3,26 +3,51 @@ #include "UITextAtlasTest_Editor.h" // UITextAtlasTest_Editor +void UITextAtlasTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UITextAtlasTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); +} bool UITextAtlasTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelAtlas_Editor/ui_labelatlas_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - + + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.h index a061b28d1c..e0a170acec 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest_Editor.h @@ -31,7 +31,8 @@ class UITextAtlasTest_Editor : public UIScene_Editor { public: bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UITextAtlasTest_Editor) }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp index dc7eff0ed9..788f994a02 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.cpp @@ -4,26 +4,51 @@ // UITextBMFontTest_Editor +void UITextBMFontTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UITextBMFontTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); +} bool UITextBMFontTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabelBMFont_Editor/ui_labelbmfont_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h index 765d0966a3..8ff7eccdab 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest_Editor.h @@ -31,7 +31,8 @@ class UITextBMFontTest_Editor : public UIScene_Editor { public: bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UITextBMFontTest_Editor) }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp index b340b57a9a..8fb8f98623 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp @@ -16,33 +16,60 @@ UITextFieldTest_Editor::~UITextFieldTest_Editor() } +void UITextFieldTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UITextFieldTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + TextField* textField_normal = static_cast(Helper::seekWidgetByName(root, "TextField_1109")); + textField_normal->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); + + TextField* textField_max_character = static_cast(Helper::seekWidgetByName(root, "TextField_1110")); + textField_max_character->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); + + TextField* textField_password = static_cast(Helper::seekWidgetByName(root, "TextField_1107")); + textField_password->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); +} + bool UITextFieldTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UITextField_Editor/ui_textfield_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - TextField* textField_normal = static_cast(Helper::seekWidgetByName(root, "TextField_1109")); - textField_normal->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); - - TextField* textField_max_character = static_cast(Helper::seekWidgetByName(root, "TextField_1110")); - textField_max_character->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); - - TextField* textField_password = static_cast(Helper::seekWidgetByName(root, "TextField_1107")); - textField_password->addEventListener(CC_CALLBACK_2(UITextFieldTest_Editor::textFieldEvent, this)); + + this->configureGUIScene(); _displayValueLabel = Text::create(); _displayValueLabel->setFontName("fonts/Marker Felt.ttf"); @@ -50,7 +77,7 @@ bool UITextFieldTest_Editor::init() _displayValueLabel->setString("No event"); _displayValueLabel->setPosition(Vec2(_layout->getContentSize().width / 2, _layout->getContentSize().height - _displayValueLabel->getContentSize().height * 1.75f)); - _touchGroup->addChild(_displayValueLabel); + _touchGroup->addChild(_displayValueLabel, 20); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.h index 38b1f8306f..1621d68d10 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.h @@ -34,7 +34,8 @@ public: ~UITextFieldTest_Editor(); bool init(); void textFieldEvent(Ref* pSender, TextField::EventType type); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UITextFieldTest_Editor) Text* _displayValueLabel; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp index 97b45c4936..f80c4c6f8b 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.cpp @@ -7,25 +7,51 @@ // UITextTest_Editor using namespace ui; +void UITextTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UITextTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + +} + bool UITextTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UILabel_Editor/ui_label_editor_1.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h index 69bf1bdcbb..54c83d2315 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextTest/UITextTest_Editor.h @@ -31,7 +31,8 @@ class UITextTest_Editor : public UIScene_Editor { public: bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UITextTest_Editor) }; diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp index 6f5276a3a1..313cedbc84 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.cpp @@ -15,35 +15,63 @@ UIWidgetAddNodeTest_Editor::~UIWidgetAddNodeTest_Editor() } +void UIWidgetAddNodeTest_Editor::switchLoadMethod(cocos2d::Ref *pSender) +{ + MenuItemToggle *item = (MenuItemToggle*)pSender; + + if (item->getSelectedIndex() == 0){ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.json")); + + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + }else{ + _layout->removeFromParentAndCleanup(true); + + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.csb")); + _touchGroup->addChild(_layout); + + this->configureGUIScene(); + } +} + +void UIWidgetAddNodeTest_Editor::configureGUIScene() +{ + Size screenSize = CCDirector::getInstance()->getWinSize(); + Size rootSize = _layout->getContentSize(); + _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, + (screenSize.height - rootSize.height) / 2)); + + Layout* root = static_cast(_layout->getChildByName("root_Panel")); + + Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); + back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); + + _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); + + + // Create the ui widget + Widget* widget = Widget::create(); + widget->setPosition(Vec2(rootSize.width / 2.0f, rootSize.height / 2.0f)); + widget->setLocalZOrder(_layout->getLocalZOrder() + 1); + _layout->addChild(widget); + + Sprite* sprite = Sprite::create("cocosui/ccicon.png"); + widget->addChild(sprite); + + +} + + bool UIWidgetAddNodeTest_Editor::init() { if (UIScene_Editor::init()) { -// _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.json")); - _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromBinaryFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.csb")); + _layout = static_cast(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("cocosui/UIEditorTest/UIWidgetAddNode_Editor/ui_widget_add_node_editor.json")); _touchGroup->addChild(_layout); - Size screenSize = CCDirector::getInstance()->getWinSize(); - Size rootSize = _layout->getContentSize(); - _touchGroup->setPosition(Vec2((screenSize.width - rootSize.width) / 2, - (screenSize.height - rootSize.height) / 2)); - - Layout* root = static_cast(_layout->getChildByName("root_Panel")); - - Text* back_label = static_cast(Helper::seekWidgetByName(root, "back")); - back_label->addTouchEventListener(CC_CALLBACK_2(UIScene_Editor::toGUIEditorTestScene, this)); - - _sceneTitle = static_cast(Helper::seekWidgetByName(root, "UItest")); - - - // Create the ui widget - Widget* widget = Widget::create(); - widget->setPosition(Vec2(rootSize.width / 2.0f, rootSize.height / 2.0f)); - widget->setLocalZOrder(_layout->getLocalZOrder() + 1); - _layout->addChild(widget); - - Sprite* sprite = Sprite::create("cocosui/ccicon.png"); - widget->addChild(sprite); - + this->configureGUIScene(); return true; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.h index d50be1d6d8..11d4c36097 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest_Editor.h @@ -33,7 +33,8 @@ public: UIWidgetAddNodeTest_Editor(); ~UIWidgetAddNodeTest_Editor(); bool init(); - + virtual void switchLoadMethod(Ref* pSender); + void configureGUIScene(); protected: UI_SCENE_EDITOR_CREATE_FUNC(UIWidgetAddNodeTest_Editor) }; diff --git a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp index 333a0c0f8b..e2b4704a86 100644 --- a/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp +++ b/tests/cpp-tests/Classes/ZwoptexTest/ZwoptexTest.cpp @@ -16,7 +16,7 @@ Layer* createZwoptexLayer(int nIndex) case 0: return new ZwoptexGenericTest(); } - return NULL; + return nullptr; } Layer* nextZwoptexTest() diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index 9eb2ea5447..b11d648d94 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -126,7 +126,7 @@ TestController::TestController() { // add close menu auto closeItem = MenuItemImage::create(s_pathClose, s_pathClose, CC_CALLBACK_1(TestController::closeCallback, this) ); - auto menu =Menu::create(closeItem, NULL); + auto menu =Menu::create(closeItem, nullptr); menu->setPosition( Vec2::ZERO ); closeItem->setPosition(Vec2( VisibleRect::right().x - 30, VisibleRect::top().y - 30)); @@ -533,7 +533,7 @@ void TestController::autorun() If socket(2) (or connect(2)) fails, we (close the socket and) try the next address. */ - for (rp = result; rp != NULL; rp = rp->ai_next) { + for (rp = result; rp != nullptr; rp = rp->ai_next) { sfd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (sfd == -1) @@ -549,7 +549,7 @@ void TestController::autorun() #endif } - if (rp == NULL) { /* No address succeeded */ + if (rp == nullptr) { /* No address succeeded */ CCLOG("autotest: could not connect!"); return; } diff --git a/tests/cpp-tests/Classes/testBasic.cpp b/tests/cpp-tests/Classes/testBasic.cpp index 9c0ea38104..e60f288055 100644 --- a/tests/cpp-tests/Classes/testBasic.cpp +++ b/tests/cpp-tests/Classes/testBasic.cpp @@ -41,7 +41,7 @@ void TestScene::onEnter() auto label = Label::createWithTTF(ttfConfig,"MainMenu"); auto menuItem = MenuItemLabel::create(label, testScene_callback ); - auto menu = Menu::create(menuItem, NULL); + auto menu = Menu::create(menuItem, nullptr); menu->setPosition( Vec2::ZERO ); menuItem->setPosition( Vec2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) ); diff --git a/tests/cpp-tests/Resources/Sprite3DTest/checkboard.png b/tests/cpp-tests/Resources/Sprite3DTest/checkboard.png deleted file mode 100644 index c7dc08d458..0000000000 Binary files a/tests/cpp-tests/Resources/Sprite3DTest/checkboard.png and /dev/null differ diff --git a/tests/cpp-tests/Resources/Sprite3DTest/cube_anim.c3t b/tests/cpp-tests/Resources/Sprite3DTest/cube_anim.c3t deleted file mode 100644 index d455d956f0..0000000000 --- a/tests/cpp-tests/Resources/Sprite3DTest/cube_anim.c3t +++ /dev/null @@ -1,162 +0,0 @@ -{ - "version": "1.2", - "file_type": "c3t", - "mesh_data": [ - { - "version": "1.2", - "mesh_vertex_attribute": [ - { - "size":3, - "type":"GL_FLOAT", - "vertex_attribute":"VERTEX_ATTRIB_POSITION" - }, - { - "size":3, - "type":"GL_FLOAT", - "vertex_attribute":"VERTEX_ATTRIB_NORMAL" - }, - { - "size":2, - "type":"GL_FLOAT", - "vertex_attribute":"VERTEX_ATTRIB_TEX_COORD" - }, - { - "size":4, - "type":"GL_FLOAT", - "vertex_attribute":"VERTEX_ATTRIB_BLEND_WEIGHT" - }, - { - "size":4, - "type":"GL_FLOAT", - "vertex_attribute":"VERTEX_ATTRIB_BLEND_INDEX" - } - ], - "body":[ - { - "vertices": [ - 0.000000, -2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.582997, 0.456003, 0.500033, 0.499967, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, -2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.582997, 0.168971, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 0.000000, 2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.827052, 0.456003, 0.500111, 0.499889, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, 2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.827052, 0.168971, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 0.000000, -2.259414, 2.259414, 0.000000, -1.000000, 0.000000, 0.253258, 0.705932, 0.500033, 0.499967, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, -2.259414, 2.259414, 0.000000, -1.000000, 0.000000, 0.253258, 0.418900, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, -2.259414, -2.259414, 0.000000, -1.000000, 0.000000, 0.497313, 0.418900, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 0.000000, -2.259414, -2.259414, 0.000000, -1.000000, 0.000000, 0.497313, 0.705932, 0.500033, 0.499967, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, 2.259414, 2.259414, -1.000000, 0.000000, 0.000000, 0.753117, 0.748774, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, -2.259414, -2.259414, -1.000000, 0.000000, 0.000000, 0.997172, 0.992829, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, -2.259414, 2.259414, -1.000000, 0.000000, 0.000000, 0.753117, 0.992829, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, 2.259414, -2.259414, -1.000000, 0.000000, 0.000000, 0.997172, 0.748774, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 5.314565, -2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.582997, 0.743034, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, -2.259414, 0.000000, 0.000000, -1.000000, 0.827052, 0.743034, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, -2.259414, 2.259414, 0.000000, -1.000000, 0.000000, 0.253258, 0.992964, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, -2.259414, -2.259414, 0.000000, -1.000000, 0.000000, 0.497313, 0.992964, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, 2.259414, 1.000000, 0.000000, 0.000000, 0.503187, 0.992829, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, -2.259414, 2.259414, 1.000000, 0.000000, 0.000000, 0.503187, 0.748774, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, -2.259414, -2.259414, 1.000000, 0.000000, 0.000000, 0.747243, 0.748774, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, -2.259414, 1.000000, 0.000000, 0.000000, 0.747243, 0.992829, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 0.000000, 2.259414, 2.259414, 0.000000, 1.000000, 0.000000, 0.003328, 0.705932, 0.500111, 0.499889, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, 2.259414, -2.259414, 0.000000, 1.000000, 0.000000, 0.247384, 0.992964, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, 2.259414, 2.259414, 0.000000, 1.000000, 0.000000, 0.003328, 0.992964, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 0.000000, 2.259414, -2.259414, 0.000000, 1.000000, 0.000000, 0.247384, 0.705932, 0.500111, 0.499889, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, 2.259414, 0.000000, 1.000000, 0.000000, 0.003328, 0.418900, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, -2.259414, 0.000000, 1.000000, 0.000000, 0.247384, 0.418900, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 0.000000, 2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.290226, 0.413161, 0.500111, 0.499889, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - -5.314565, 2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.003194, 0.413161, 0.932199, 0.067801, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - -5.314565, -2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.003194, 0.169105, 0.933581, 0.066419, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, - 0.000000, -2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.290226, 0.169105, 0.500033, 0.499967, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, 2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.577257, 0.413161, 0.938571, 0.061429, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, - 5.314565, -2.259414, 2.259414, 0.000000, 0.000000, 1.000000, 0.577257, 0.169105, 0.932057, 0.067943, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000 - ], - "vertex_size": 512, - "indices": [ - 0, 1, 2, 1, 3, 2, 4, 5, 6, 4, 6, 7, - 8, 9, 10, 9, 8, 11, 12, 0, 13, 0, 2, 13, - 14, 4, 7, 14, 7, 15, 16, 17, 18, 16, 18, 19, - 20, 21, 22, 21, 20, 23, 24, 23, 20, 23, 24, 25, - 26, 27, 28, 26, 28, 29, 30, 26, 29, 30, 29, 31 - ], - "index_number": 60 - } - ] - } - ], - "material_data": [ - { - "file_name": "Sprite3DTest/checkboard.png" - } - ], - "skin_data": [ - { - "id": "cubeanim:cube", - "bind_shape": [ 0.393701, 0.000000, 0.000000, 0.000000, 0.000000, 0.393701, 0.000000, 0.000000, 0.000000, -0.000000, 0.393701, 0.000000, 0.100748, 0.000000, -0.457948, 1.000000], - "bones": [ - { - "node": "bone1", - "bind_pos": [ 0.999989, 0.004613, 0.000000, 0.000000, -0.004613, 0.999989, 0.000000, 0.000000, -0.000000, -0.000000, 1.000000, 0.000000, -0.036861, 0.049203, 0.000000, 1.000000] - }, - { - "node": "bone", - "bind_pos": [ 0.999958, 0.009184, 0.000000, 0.000000, -0.009184, 0.999958, 0.000000, 0.000000, -0.000000, -0.000000, 1.000000, 0.000000, -5.393930, -0.000000, -0.000000, 1.000000] - } - ] - }, - { - "id": "root", - "children": [ - { - "id": "bone", - "children": [ - { - "id": "bone1", - "children": [ - { - "id": "eff" - } - ] - } - ] - } - ] - } - ], - "animation_data": [ - { - "id": "Take 001", - "bones": [ - { - "id": "bone1", - "keyframes": [ - { - "rotation":[ - { - "keytime": 0.000000, - "value": [ 0.000000, -0.000000, -0.002285, 0.999997] - }, - { - "keytime": 0.333332, - "value": [ 0.000000, -0.000000, -0.002285, 0.999997] - }, - { - "keytime": 0.666664, - "value": [ 0.000000, -0.000000, 0.089457, 0.995991] - }, - { - "keytime": 0.800000, - "value": [ 0.000000, -0.000000, 0.184131, 0.982902] - }, - { - "keytime": 0.933328, - "value": [ 0.000000, -0.000000, 0.274421, 0.961610] - }, - { - "keytime": 1.000000, - "value": [ 0.000000, -0.000000, 0.362349, 0.932043] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index 6b28e94848..c307f62357 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit 6b28e948482ca7ed44c31daf3fef2e42ad6b59fb +Subproject commit c307f62357e42d2e7e671f4741f855dc8a5fde3a diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index 6e59447926..b842c9b028 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -187,6 +187,8 @@ + + @@ -370,6 +372,8 @@ + + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 399fe8f162..3404238b21 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -849,6 +849,12 @@ Classes\TileMapTest + + Classes\UITest\CocostudioGUISceneTest + + + Classes\UITest\CocostudioGUISceneTest + @@ -1568,5 +1574,11 @@ Classes\TileMapTest + + Classes\UITest\CocostudioGUISceneTest + + + Classes\UITest\CocostudioGUISceneTest + \ No newline at end of file diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index f81bb0d720..f360d9d55e 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -233,6 +233,8 @@ + + @@ -431,6 +433,8 @@ + + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index 7f73aa616c..7cc4e29a0a 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -849,6 +849,12 @@ Classes\TileMapTest + + Classes\UITest\CocosStudioGUITest + + + Classes\UITest\CocosStudioGUITest + @@ -1572,6 +1578,12 @@ Classes\TileMapTest + + Classes\UITest\CocosStudioGUITest + + + Classes\UITest\CocosStudioGUITest + diff --git a/tests/game-controller-test/Classes/AppDelegate.cpp b/tests/game-controller-test/Classes/AppDelegate.cpp index ae7ef0a2cf..6bd1bb104f 100644 --- a/tests/game-controller-test/Classes/AppDelegate.cpp +++ b/tests/game-controller-test/Classes/AppDelegate.cpp @@ -18,23 +18,16 @@ AppDelegate::~AppDelegate() } bool AppDelegate::applicationDidFinishLaunching() { - // initialize director auto director = Director::getInstance(); auto glview = director->getOpenGLView(); if(!glview) { - glview = GLView::create("Cpp Empty Test"); + glview = GLView::create("Game Controller Test"); director->setOpenGLView(glview); } director->setOpenGLView(glview); - // Set the design resolution -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - // a bug in DirectX 11 level9-x on the device prevents ResolutionPolicy::NO_BORDER from working correctly glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::SHOW_ALL); -#else - glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER); -#endif Size frameSize = glview->getFrameSize(); @@ -53,33 +46,19 @@ bool AppDelegate::applicationDidFinishLaunching() { director->setContentScaleFactor(MIN(largeResource.size.height/designResolutionSize.height, largeResource.size.width/designResolutionSize.width)); } // if the frame's height is larger than the height of small resource size, select medium resource. - else if (frameSize.height > smallResource.size.height) + else { searchPath.push_back(mediumResource.directory); director->setContentScaleFactor(MIN(mediumResource.size.height/designResolutionSize.height, mediumResource.size.width/designResolutionSize.width)); } - // if the frame's height is smaller than the height of medium resource size, select small resource. - else - { - searchPath.push_back(smallResource.directory); - - director->setContentScaleFactor(MIN(smallResource.size.height/designResolutionSize.height, smallResource.size.width/designResolutionSize.width)); - } - // set searching path FileUtils::getInstance()->setSearchPaths(searchPath); - - // turn on display FPS - director->setDisplayStats(true); - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); + auto scene = Scene::create(); + GameControllerTest *gameLayer = GameControllerTest::create(); + scene->addChild(gameLayer); - // create a scene. it's an autorelease object - auto scene = GameControllerTest::scene(); - - // run director->runWithScene(scene); return true; @@ -88,15 +67,9 @@ bool AppDelegate::applicationDidFinishLaunching() { // This function will be called when the app is inactive. When comes a phone call,it's be invoked too void AppDelegate::applicationDidEnterBackground() { Director::getInstance()->stopAnimation(); - - // if you use SimpleAudioEngine, it must be pause - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { Director::getInstance()->startAnimation(); - - // if you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); } diff --git a/tests/game-controller-test/Classes/AppMacros.h b/tests/game-controller-test/Classes/AppMacros.h index 417da9a190..41d6963a16 100644 --- a/tests/game-controller-test/Classes/AppMacros.h +++ b/tests/game-controller-test/Classes/AppMacros.h @@ -23,32 +23,16 @@ [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources. */ -#define DESIGN_RESOLUTION_480X320 0 -#define DESIGN_RESOLUTION_1024X768 1 -#define DESIGN_RESOLUTION_2048X1536 2 - -/* If you want to switch design resolution, change next line */ -#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_480X320 - typedef struct tagResource { cocos2d::Size size; char directory[100]; }Resource; -static Resource smallResource = { cocos2d::Size(480, 320), "iphone" }; -static Resource mediumResource = { cocos2d::Size(1024, 768), "ipad" }; -static Resource largeResource = { cocos2d::Size(2048, 1536), "ipadhd" }; +static Resource mediumResource = { cocos2d::Size(960, 540), "ipad" }; +static Resource largeResource = { cocos2d::Size(1920, 1080), "ipadhd" }; -#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320) -static cocos2d::Size designResolutionSize = cocos2d::Size(480, 320); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768) -static cocos2d::Size designResolutionSize = cocos2d::Size(1024, 768); -#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536) -static cocos2d::Size designResolutionSize = cocos2d::Size(2048, 1536); -#else -#error unknown target design resolution! -#endif +static cocos2d::Size designResolutionSize = cocos2d::Size(1920, 1080); // The font size 24 is designed for small resolution, so we should change it to fit for current design resolution #define TITLE_FONT_SIZE (cocos2d::Director::getInstance()->getOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24) diff --git a/tests/game-controller-test/Classes/GameControllerTest.cpp b/tests/game-controller-test/Classes/GameControllerTest.cpp index 820a4ec5fc..ef27469315 100644 --- a/tests/game-controller-test/Classes/GameControllerTest.cpp +++ b/tests/game-controller-test/Classes/GameControllerTest.cpp @@ -1,252 +1,437 @@ #include "GameControllerTest.h" #include "AppMacros.h" -#include "ui/CocosGUI.h" USING_NS_CC; - -Scene* GameControllerTest::scene() -{ - auto scene = Scene::create(); - GameControllerTest *layer = GameControllerTest::create(); - scene->addChild(layer); - - return scene; -} - GameControllerTest::~GameControllerTest() { Controller::stopDiscoveryController(); } -bool GameControllerTest::init() +void GameControllerTest::registerControllerListener() { - if ( !Layer::init() ) - { - return false; - } - - auto visibleSize = Director::getInstance()->getVisibleSize(); - auto origin = Director::getInstance()->getVisibleOrigin(); - - auto tmpPos = Vec2(visibleSize / 2) + origin; - _actor = Sprite::create("CloseNormal.png"); - _actor->setPosition(tmpPos); - this->addChild(_actor,10); - - tmpPos.y -= 35; - _statusLabel = Label::createWithTTF("status", "fonts/Marker Felt.ttf", 40); - _statusLabel->setPosition(tmpPos); - this->addChild(_statusLabel, 0, 100); - - tmpPos.y += 65; - _leftTriggerLabel = Label::createWithTTF("left trigger", "fonts/Marker Felt.ttf", 40); - _leftTriggerLabel->setPosition(tmpPos); - this->addChild(_leftTriggerLabel, 0, 100); - - tmpPos.y += 40; - _rightTriggerLabel = Label::createWithTTF("right trigger", "fonts/Marker Felt.ttf", 40); - _rightTriggerLabel->setPosition(tmpPos); - this->addChild(_rightTriggerLabel, 0, 100); - _listener = EventListenerController::create(); - _listener->onConnected = [=](Controller* controller, Event* event){ - _player1 = controller; - _statusLabel->setString("controller connected!"); - }; - _listener->onDisconnected = [=](Controller* controller, Event* event){ - _player1 = nullptr; - _statusLabel->setString("controller disconnected!"); - }; + _listener->onConnected = CC_CALLBACK_2(GameControllerTest::onConnectController,this); + _listener->onDisconnected = CC_CALLBACK_2(GameControllerTest::onDisconnectedController,this); + _listener->onKeyDown = CC_CALLBACK_3(GameControllerTest::onKeyDown, this); + _listener->onKeyUp = CC_CALLBACK_3(GameControllerTest::onKeyUp, this); + _listener->onAxisEvent = CC_CALLBACK_3(GameControllerTest::onAxisEvent, this); - _listener->onButtonPressed = CC_CALLBACK_3(GameControllerTest::onButtonPressed, this); - _listener->onButtonReleased = CC_CALLBACK_3(GameControllerTest::onButtonReleased, this); - _listener->onAxisValueChanged = CC_CALLBACK_3(GameControllerTest::onAxisValueChanged, this); - _eventDispatcher->addEventListenerWithSceneGraphPriority(_listener, this); Controller::startDiscoveryController(); + + //get game pad status in polling mode + //scheduleUpdate(); +} + +void GameControllerTest::onConnectController(Controller* controller, Event* event) +{ + if (controller == nullptr || controller == _firstHolder.controller || controller == _secondHolder.controller) + { + return; + } +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + //receive back key + controller->receiveExternalKeyEvent(4,true); + //receive menu key + controller->receiveExternalKeyEvent(82,true); +#endif + + char deviceInfo[50]; + sprintf(deviceInfo,"%s id:%d",controller->getDeviceName().c_str(), controller->getDeviceId()); + + if (_firstHolder.controller == nullptr && _secondHolder.controller == nullptr) + { + if (_firstHolder._holderNode) + { + _firstHolder.controller = controller; + _firstHolder._deviceLabel->setString(deviceInfo); + } + else + { + _secondHolder.controller = controller; + _secondHolder._deviceLabel->setString(deviceInfo); + } + } + else if(_secondHolder.controller == nullptr) + { + _secondHolder.controller = controller; + if (_secondHolder._holderNode == nullptr) + { + createControllerSprite(_secondHolder); + + _firstHolder._holderNode->runAction(ScaleTo::create(0.3f,0.5f,0.5f)); + _firstHolder._holderNode->runAction(MoveTo::create(0.3f,Vec2(_visibleQuarterX, _visibleCentreY))); + + _secondHolder._holderNode->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _secondHolder._holderNode->setScale(0.1f); + _secondHolder._holderNode->runAction(ScaleTo::create(0.3f,0.5f,0.5f)); + _secondHolder._holderNode->setPosition(Vec2(_visibleThreeQuarterX, _visibleCentreY)); + this->addChild(_secondHolder._holderNode); + } + + _secondHolder._deviceLabel->setString(deviceInfo); + } + else + { + _firstHolder.controller = controller; + if (_firstHolder._holderNode == nullptr) + { + createControllerSprite(_firstHolder); + + _secondHolder._holderNode->runAction(ScaleTo::create(0.3f,0.5f,0.5f)); + _secondHolder._holderNode->runAction(MoveTo::create(0.3f,Vec2(_visibleQuarterX, _visibleCentreY))); + + _firstHolder._holderNode->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _firstHolder._holderNode->setScale(0.1f); + _firstHolder._holderNode->runAction(ScaleTo::create(0.3f,0.5f,0.5f)); + _firstHolder._holderNode->setPosition(Vec2(_visibleThreeQuarterX, _visibleCentreY)); + this->addChild(_firstHolder._holderNode); + } + + _firstHolder._deviceLabel->setString(deviceInfo); + } +} + +void GameControllerTest::onDisconnectedController(Controller* controller, Event* event) +{ + log("onDisconnectedController:%d",controller->getDeviceId()); + if (_firstHolder.controller == controller) + { + _firstHolder.controller = nullptr; + + if (_secondHolder.controller != nullptr) + { + _firstHolder._holderNode->runAction(MoveBy::create(0.3f,Vec2(0,_visibleSize.height))); + + _secondHolder._holderNode->runAction(MoveTo::create(0.3f,Vec2(_visibleCentreX,_visibleCentreY) )); + _secondHolder._holderNode->runAction(ScaleTo::create(0.3f,1.0f,1.0f)); + } + else + { + resetControllerHolderState(_firstHolder); + } + } + else if (_secondHolder.controller == controller) + { + _secondHolder.controller = nullptr; + + if (_firstHolder.controller != nullptr) + { + _secondHolder._holderNode->runAction(MoveBy::create(0.3f,Vec2(0,_visibleSize.height))); + + _firstHolder._holderNode->runAction(MoveTo::create(0.3f,Vec2(_visibleCentreX,_visibleCentreY) )); + _firstHolder._holderNode->runAction(ScaleTo::create(0.3f,1.0f,1.0f)); + } + else + { + resetControllerHolderState(_secondHolder); + } + } +} + +void GameControllerTest::resetControllerHolderState(ControllerHolder& holder) +{ + holder._buttonA->setColor(Color3B::WHITE); + holder._buttonB->setColor(Color3B::WHITE); + holder._buttonX->setColor(Color3B::WHITE); + holder._buttonY->setColor(Color3B::WHITE); + holder._dpadUp->setColor(Color3B::WHITE); + holder._dpadDown->setColor(Color3B::WHITE); + holder._dpadLeft->setColor(Color3B::WHITE); + holder._dpadRight->setColor(Color3B::WHITE); + holder._buttonL1->setColor(Color3B::WHITE); + holder._buttonR1->setColor(Color3B::WHITE); + + holder._leftJoystick->setPosition(Vec2(238,460)); + holder._rightJoystick->setPosition(Vec2(606,293)); + holder._deviceLabel->setString("Disconnected"); +} + +void GameControllerTest::showButtonState(cocos2d::Controller *controller, int keyCode, bool isPressed) +{ + onConnectController(controller,nullptr); + ControllerHolder* holder = nullptr; + if (controller == _firstHolder.controller) + holder = &_firstHolder; + else if(controller == _secondHolder.controller) + holder = &_secondHolder; + else + return; + + if (isPressed) + { + switch (keyCode) + { + case Controller::Key::BUTTON_A: + holder->_buttonA->setColor(Color3B(250,103,93)); + break; + case Controller::Key::BUTTON_B: + holder->_buttonB->setColor(Color3B(92,214,183)); + break; + case Controller::Key::BUTTON_X: + holder->_buttonX->setColor(Color3B(96,113,192)); + break; + case Controller::Key::BUTTON_Y: + holder->_buttonY->setColor(Color3B(199,222,118)); + break; + case Controller::Key::BUTTON_DPAD_UP: + holder->_dpadUp->setColor(Color3B(0,115,158)); + break; + case Controller::Key::BUTTON_DPAD_DOWN: + holder->_dpadDown->setColor(Color3B(0,115,158)); + break; + case Controller::Key::BUTTON_DPAD_LEFT: + holder->_dpadLeft->setColor(Color3B(170,216,0)); + break; + case Controller::Key::BUTTON_DPAD_RIGHT: + holder->_dpadRight->setColor(Color3B(170,216,0)); + break; + case Controller::Key::BUTTON_LEFT_SHOULDER: + holder->_buttonL1->setColor(Color3B(19,231,238)); + break; + case Controller::Key::BUTTON_RIGHT_SHOULDER: + holder->_buttonR1->setColor(Color3B(19,231,238)); + break; + default: + { + char ketStatus[30]; + sprintf(ketStatus,"Key Down:%d",keyCode); + holder->_externalKeyLabel->setString(ketStatus); + break; + } + } + } + else + { + switch (keyCode) + { + case Controller::Key::BUTTON_A: + holder->_buttonA->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_B: + holder->_buttonB->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_X: + holder->_buttonX->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_Y: + holder->_buttonY->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_DPAD_UP: + holder->_dpadUp->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_DPAD_DOWN: + holder->_dpadDown->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_DPAD_LEFT: + holder->_dpadLeft->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_DPAD_RIGHT: + holder->_dpadRight->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_LEFT_SHOULDER: + holder->_buttonL1->setColor(Color3B::WHITE); + break; + case Controller::Key::BUTTON_RIGHT_SHOULDER: + holder->_buttonR1->setColor(Color3B::WHITE); + break; + default: + { + char ketStatus[30]; + sprintf(ketStatus,"Key Up:%d",keyCode); + holder->_externalKeyLabel->setString(ketStatus); + break; + } + } + } +} + +void GameControllerTest::onKeyDown(cocos2d::Controller *controller, int keyCode, cocos2d::Event *event) +{ + showButtonState(controller, keyCode, true); +} + +void GameControllerTest::onKeyUp(cocos2d::Controller *controller, int keyCode, cocos2d::Event *event) +{ + showButtonState(controller, keyCode, false); +} + +void GameControllerTest::onAxisEvent(cocos2d::Controller* controller, int keyCode, cocos2d::Event* event) +{ + ControllerHolder* holder = nullptr; + if (controller == _firstHolder.controller) + holder = &_firstHolder; + else if(controller == _secondHolder.controller) + holder = &_secondHolder; + else + return; + + const auto& ketStatus = controller->getKeyStatus(keyCode); + switch (keyCode) + { + case Controller::Key::JOYSTICK_LEFT_X: + holder->_leftJoystick->setPositionX(238 + ketStatus.value * 24); + break; + case Controller::Key::JOYSTICK_LEFT_Y: + holder->_leftJoystick->setPositionY(460 - ketStatus.value * 24); + break; + case Controller::Key::JOYSTICK_RIGHT_X: + holder->_rightJoystick->setPositionX(606 + ketStatus.value * 24); + break; + case Controller::Key::JOYSTICK_RIGHT_Y: + holder->_rightJoystick->setPositionY(293 - ketStatus.value * 24); + break; + case Controller::Key::AXIS_LEFT_TRIGGER: + holder->_buttonL2->setOpacity(200 * controller->getKeyStatus(keyCode).value); + break; + case Controller::Key::AXIS_RIGHT_TRIGGER: + holder->_buttonR2->setOpacity(200 * controller->getKeyStatus(keyCode).value); + break; + default: + break; + } +} + +bool GameControllerTest::init() +{ + if ( !Layer::init() ) + return false; + + _currControllerCount = 0; + + _visibleSize = Director::getInstance()->getVisibleSize(); + _visibleOrigin = Director::getInstance()->getVisibleOrigin(); + + + auto tmpPos = Vec2(_visibleSize / 2) + _visibleOrigin; + + _visibleCentreX = _visibleOrigin.x + _visibleSize.width / 2; + _visibleCentreY = _visibleOrigin.y + _visibleSize.height / 2; + _visibleQuarterX = _visibleOrigin.x + _visibleSize.width / 4; + _visibleThreeQuarterX = _visibleOrigin.x + _visibleSize.width * 0.75f; + + _firstHolder.controller = nullptr; + _secondHolder.controller = nullptr; + + createControllerSprite(_firstHolder); + _firstHolder._holderNode->setAnchorPoint(Vec2::ANCHOR_MIDDLE); + _firstHolder._holderNode->setPosition(tmpPos); + this->addChild(_firstHolder._holderNode); + auto closeItem = MenuItemImage::create("CloseNormal.png", "CloseSelected.png", CC_CALLBACK_1(GameControllerTest::menuCloseCallback, this)); - closeItem->setPosition(origin + visibleSize - closeItem->getContentSize() / 2); - + closeItem->setPosition(_visibleOrigin + _visibleSize - closeItem->getContentSize() / 2); + auto menu = Menu::create(closeItem,nullptr); menu->setPosition(Vec2::ZERO); this->addChild(menu); - - //get game pad status in polling mode - scheduleUpdate(); + + registerControllerListener(); return true; } -void GameControllerTest::onButtonPressed(cocos2d::Controller *controller, cocos2d::ControllerButtonInput *button, cocos2d::Event *event) +void GameControllerTest::createControllerSprite(ControllerHolder& holder) { - if (controller == nullptr) - { - return; - } - _player1 = controller; + holder._holderNode = Node::create(); + holder._holderNode->setContentSize(Size(998,1000)); - auto gamePad = controller->getGamepad(); + auto controllerBg1 = Sprite::create("controller-1.png"); + controllerBg1->setPosition(Vec2::ZERO); + controllerBg1->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); + holder._holderNode->addChild(controllerBg1); - if (button == gamePad->getButtonA()) - { - _statusLabel->setString("button A pressed!"); - } + auto controllerBg2 = Sprite::create("controller-2.png"); + controllerBg2->setPosition(Vec2(499,1000)); + controllerBg2->setAnchorPoint(Vec2::ANCHOR_MIDDLE_TOP); + holder._holderNode->addChild(controllerBg2); - if (button == gamePad->getButtonB()) - { - _statusLabel->setString("button B pressed!"); - } + holder._leftJoystick = Sprite::create("joystick.png"); + holder._leftJoystick->setPosition(Vec2(238,460)); + holder._holderNode->addChild(holder._leftJoystick); - if (button == gamePad->getButtonX()) - { - _statusLabel->setString("button X pressed!"); - } + holder._rightJoystick = Sprite::create("joystick.png"); + holder._rightJoystick->setPosition(Vec2(606,293)); + holder._holderNode->addChild(holder._rightJoystick); - if (button == gamePad->getButtonY()) - { - _statusLabel->setString("button Y pressed!"); - } + holder._deviceLabel = Label::createWithTTF("Disconnected","fonts/Marker Felt.ttf",36); + holder._deviceLabel->setPosition(Vec2(499,650)); + holder._deviceLabel->setTextColor(Color4B::RED); + holder._holderNode->addChild(holder._deviceLabel); - if (button == gamePad->getDirectionPad()->getUp()) - { - _statusLabel->setString("Dpad up pressed!"); - } + holder._externalKeyLabel = Label::createWithTTF("Key event","fonts/Marker Felt.ttf",36); + holder._externalKeyLabel->setPosition(Vec2(499,500)); + holder._externalKeyLabel->setTextColor(Color4B::RED); + holder._holderNode->addChild(holder._externalKeyLabel); + //----------------------------------------------------------------- + auto dPadTexture = Director::getInstance()->getTextureCache()->addImage("dPad.png"); - if (button == gamePad->getDirectionPad()->getDown()) - { - _statusLabel->setString("Dpad down pressed!"); - } + auto dPadCenter = Sprite::createWithTexture(dPadTexture,Rect(60,60,68,68)); + dPadCenter->setPosition(Vec2(371,294)); + holder._holderNode->addChild(dPadCenter); - if (button == gamePad->getDirectionPad()->getLeft()) - { - _statusLabel->setString("Dpad left pressed!"); - } + holder._dpadLeft = Sprite::createWithTexture(dPadTexture,Rect(0,60,60,60)); + holder._dpadLeft->setPosition(Vec2(371 - 64,296)); + holder._holderNode->addChild(holder._dpadLeft); - if (button == gamePad->getDirectionPad()->getRight()) - { - _statusLabel->setString("Dpad right pressed!"); - } + holder._dpadRight = Sprite::createWithTexture(dPadTexture,Rect(128,60,60,60)); + holder._dpadRight->setPosition(Vec2(371 + 64,296)); + holder._holderNode->addChild(holder._dpadRight); - if (button == gamePad->getLeftShoulder()) - { - _statusLabel->setString("Left shoulder pressed!"); - } + holder._dpadUp = Sprite::createWithTexture(dPadTexture,Rect(60,0,60,60)); + holder._dpadUp->setPosition(Vec2(369,294 + 64)); + holder._holderNode->addChild(holder._dpadUp); - if (button == gamePad->getRightShoulder()) - { - _statusLabel->setString("Right shoulder pressed!"); - } -} + holder._dpadDown = Sprite::createWithTexture(dPadTexture,Rect(60,128,60,60)); + holder._dpadDown->setPosition(Vec2(369,294 - 64)); + holder._holderNode->addChild(holder._dpadDown); + //----------------------------------------------------------------- + holder._buttonL1 = Sprite::create("L1.png"); + holder._buttonL1->setPosition(Vec2(290,792)); + holder._holderNode->addChild(holder._buttonL1); -void GameControllerTest::onButtonReleased(cocos2d::Controller *controller, cocos2d::ControllerButtonInput *button, cocos2d::Event *event) -{ - if (controller == nullptr) - { - return; - } - _player1 = controller; + holder._buttonR1 = Sprite::create("R1.png"); + holder._buttonR1->setPosition(Vec2(998 - 290,792)); + holder._holderNode->addChild(holder._buttonR1); - auto gamePad = controller->getGamepad(); + auto buttonL2 = Sprite::create("L2.png"); + buttonL2->setPosition(Vec2(220,910)); + holder._holderNode->addChild(buttonL2); - if (button == gamePad->getButtonA()) - { - _statusLabel->setString("button A released!"); - } + auto buttonR2 = Sprite::create("R2.png"); + buttonR2->setPosition(Vec2(998-220,910)); + holder._holderNode->addChild(buttonR2); - if (button == gamePad->getButtonB()) - { - _statusLabel->setString("button B released!"); - } + holder._buttonL2 = Sprite::create("L2.png"); + holder._buttonL2->setOpacity(0); + holder._buttonL2->setColor(Color3B::RED); + holder._buttonL2->setPosition(Vec2(220,910)); + holder._holderNode->addChild(holder._buttonL2); - if (button == gamePad->getButtonX()) - { - _statusLabel->setString("button X released!"); - } + holder._buttonR2 = Sprite::create("R2.png"); + holder._buttonR2->setOpacity(0); + holder._buttonR2->setColor(Color3B::RED); + holder._buttonR2->setPosition(Vec2(998-220,910)); + holder._holderNode->addChild(holder._buttonR2); + //----------------------------------------------------------------- + holder._buttonX = Sprite::create("X.png"); + holder._buttonX->setPosition(Vec2(750 - 70,460)); + holder._holderNode->addChild(holder._buttonX); - if (button == gamePad->getButtonY()) - { - _statusLabel->setString("button Y released!"); - } + holder._buttonY = Sprite::create("Y.png"); + holder._buttonY->setPosition(Vec2(750,460 + 70)); + holder._holderNode->addChild(holder._buttonY); - if (button == gamePad->getDirectionPad()->getUp()) - { - _statusLabel->setString("Dpad up released!"); - } + holder._buttonA = Sprite::create("A.png"); + holder._buttonA->setPosition(Vec2(750,460 - 70)); + holder._holderNode->addChild(holder._buttonA); - if (button == gamePad->getDirectionPad()->getDown()) - { - _statusLabel->setString("Dpad down released!"); - } - - if (button == gamePad->getDirectionPad()->getLeft()) - { - _statusLabel->setString("Dpad left released!"); - } - - if (button == gamePad->getDirectionPad()->getRight()) - { - _statusLabel->setString("Dpad right released!"); - } - - if (button == gamePad->getLeftShoulder()) - { - _statusLabel->setString("Left shoulder released!"); - } - - if (button == gamePad->getRightShoulder()) - { - _statusLabel->setString("Right shoulder released!"); - } -} - -void GameControllerTest::onAxisValueChanged(cocos2d::Controller* controller, cocos2d::ControllerAxisInput* axis, cocos2d::Event* event) -{ - if (controller == nullptr) - { - return; - } - _player1 = controller; - - auto moveDelta = axis->getValue(); - Vec2 newPos = _actor->getPosition(); - auto gamePad = controller->getGamepad(); - - if (axis == gamePad->getLeftThumbstick()->getAxisX() || axis == gamePad->getRightThumbstick()->getAxisX()) - { - newPos.x += moveDelta; - } - else if (axis == gamePad->getLeftThumbstick()->getAxisY() || axis == gamePad->getRightThumbstick()->getAxisY()) - { - newPos.y -= moveDelta; - } - _actor->setPosition(newPos); -} - -void GameControllerTest::update(float dt) -{ - if (_player1 && _player1->isConnected()) - { - Vec2 newPos = _actor->getPosition(); - auto gamePad = _player1->getGamepad(); - - newPos.x += gamePad->getLeftThumbstick()->getAxisX()->getValue(); - newPos.y -= gamePad->getLeftThumbstick()->getAxisY()->getValue(); - - newPos.x += gamePad->getRightThumbstick()->getAxisX()->getValue(); - newPos.y -= gamePad->getRightThumbstick()->getAxisY()->getValue(); - - _actor->setPosition(newPos); - - char triggerStatus[50]; - sprintf(triggerStatus,"left trigger:%f",gamePad->getLeftTrigger()->getValue()); - _leftTriggerLabel->setString(triggerStatus); - sprintf(triggerStatus,"right trigger:%f",gamePad->getRightTrigger()->getValue()); - _rightTriggerLabel->setString(triggerStatus); - } + holder._buttonB = Sprite::create("B.png"); + holder._buttonB->setPosition(Vec2(750 + 70,460)); + holder._holderNode->addChild(holder._buttonB); } void GameControllerTest::menuCloseCallback(Ref* sender) diff --git a/tests/game-controller-test/Classes/GameControllerTest.h b/tests/game-controller-test/Classes/GameControllerTest.h index 98e2fdb55e..ff94d71f28 100644 --- a/tests/game-controller-test/Classes/GameControllerTest.h +++ b/tests/game-controller-test/Classes/GameControllerTest.h @@ -4,32 +4,76 @@ #include "cocos2d.h" #include "base/CCGameController.h" +USING_NS_CC; + class GameControllerTest : public cocos2d::Layer { public: virtual ~GameControllerTest(); - virtual bool init(); - - static cocos2d::Scene* scene(); - - // a selector callback - void menuCloseCallback(Ref* sender); - - // implement the "static node()" method manually CREATE_FUNC(GameControllerTest); - void update(float dt); - void onButtonPressed(cocos2d::Controller* controller, cocos2d::ControllerButtonInput* button, cocos2d::Event* event); - void onButtonReleased(cocos2d::Controller* controller, cocos2d::ControllerButtonInput* button, cocos2d::Event* event); - void onAxisValueChanged(cocos2d::Controller* controller, cocos2d::ControllerAxisInput* axis, cocos2d::Event* event); + virtual bool init(); + + void onKeyDown(cocos2d::Controller* controller, int keyCode, cocos2d::Event* event); + void onKeyUp(cocos2d::Controller* controller, int keyCode, cocos2d::Event* event); + void onAxisEvent(cocos2d::Controller* controller, int keyCode, cocos2d::Event* event); + + void menuCloseCallback(Ref* sender); + private: - cocos2d::Controller* _player1; - cocos2d::Sprite* _actor; - cocos2d::Label* _statusLabel; - cocos2d::Label* _leftTriggerLabel; - cocos2d::Label* _rightTriggerLabel; + float _visibleCentreX; + float _visibleCentreY; + float _visibleQuarterX; + float _visibleThreeQuarterX; + + int _currControllerCount; + + typedef struct controllerHolder + { + cocos2d::Controller *controller; + + cocos2d::Node* _holderNode; + + cocos2d::Sprite* _leftJoystick; + cocos2d::Sprite* _rightJoystick; + + cocos2d::Sprite* _dpadLeft; + cocos2d::Sprite* _dpadRight; + cocos2d::Sprite* _dpadUp; + cocos2d::Sprite* _dpadDown; + + cocos2d::Sprite* _buttonX; + cocos2d::Sprite* _buttonY; + cocos2d::Sprite* _buttonA; + cocos2d::Sprite* _buttonB; + + cocos2d::Sprite* _buttonL1; + cocos2d::Sprite* _buttonR1; + cocos2d::Sprite* _buttonL2; + cocos2d::Sprite* _buttonR2; + + cocos2d::Label* _deviceLabel; + cocos2d::Label* _externalKeyLabel; + }ControllerHolder; + + ControllerHolder _firstHolder; + ControllerHolder _secondHolder; + cocos2d::EventListenerController* _listener; + + cocos2d::Size _visibleSize; + cocos2d::Vec2 _visibleOrigin; + + void registerControllerListener(); + void showButtonState(cocos2d::Controller *controller, int keyCode, bool isPressed); + + void createControllerSprite(ControllerHolder& holder); + + void onConnectController(Controller* controller, Event* event); + void onDisconnectedController(Controller* controller, Event* event); + + void resetControllerHolderState(ControllerHolder& holder); }; #endif // __GAMECONTROLLER_TEST_H__ diff --git a/tests/game-controller-test/Resources/ipad/A.png b/tests/game-controller-test/Resources/ipad/A.png new file mode 100644 index 0000000000..fa35c7cd02 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/A.png differ diff --git a/tests/game-controller-test/Resources/ipad/B.png b/tests/game-controller-test/Resources/ipad/B.png new file mode 100644 index 0000000000..5f14c27bb7 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/B.png differ diff --git a/tests/game-controller-test/Resources/ipad/L1.png b/tests/game-controller-test/Resources/ipad/L1.png new file mode 100644 index 0000000000..a59e0c74d7 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/L1.png differ diff --git a/tests/game-controller-test/Resources/ipad/L2.png b/tests/game-controller-test/Resources/ipad/L2.png new file mode 100644 index 0000000000..526d727617 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/L2.png differ diff --git a/tests/game-controller-test/Resources/ipad/R1.png b/tests/game-controller-test/Resources/ipad/R1.png new file mode 100644 index 0000000000..028abf6363 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/R1.png differ diff --git a/tests/game-controller-test/Resources/ipad/R2.png b/tests/game-controller-test/Resources/ipad/R2.png new file mode 100644 index 0000000000..10109019b2 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/R2.png differ diff --git a/tests/game-controller-test/Resources/ipad/X.png b/tests/game-controller-test/Resources/ipad/X.png new file mode 100644 index 0000000000..38b3a03ec4 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/X.png differ diff --git a/tests/game-controller-test/Resources/ipad/Y.png b/tests/game-controller-test/Resources/ipad/Y.png new file mode 100644 index 0000000000..180d80a39e Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/Y.png differ diff --git a/tests/game-controller-test/Resources/ipad/controller-1.png b/tests/game-controller-test/Resources/ipad/controller-1.png new file mode 100644 index 0000000000..347b8f4f31 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/controller-1.png differ diff --git a/tests/game-controller-test/Resources/ipad/controller-2.png b/tests/game-controller-test/Resources/ipad/controller-2.png new file mode 100644 index 0000000000..5116523c5e Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/controller-2.png differ diff --git a/tests/game-controller-test/Resources/ipad/dPad.png b/tests/game-controller-test/Resources/ipad/dPad.png new file mode 100644 index 0000000000..79963b8565 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/dPad.png differ diff --git a/tests/game-controller-test/Resources/ipad/dpad-key.png b/tests/game-controller-test/Resources/ipad/dpad-key.png new file mode 100644 index 0000000000..9000a25eed Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/dpad-key.png differ diff --git a/tests/game-controller-test/Resources/ipad/joystick.png b/tests/game-controller-test/Resources/ipad/joystick.png new file mode 100644 index 0000000000..801f68c254 Binary files /dev/null and b/tests/game-controller-test/Resources/ipad/joystick.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/A.png b/tests/game-controller-test/Resources/ipadhd/A.png new file mode 100644 index 0000000000..d5fb7b2928 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/A.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/B.png b/tests/game-controller-test/Resources/ipadhd/B.png new file mode 100644 index 0000000000..ccb1bf07ba Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/B.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/L1.png b/tests/game-controller-test/Resources/ipadhd/L1.png new file mode 100644 index 0000000000..1280cf85d0 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/L1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/L2.png b/tests/game-controller-test/Resources/ipadhd/L2.png new file mode 100644 index 0000000000..85d52f2c8b Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/L2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/R1.png b/tests/game-controller-test/Resources/ipadhd/R1.png new file mode 100644 index 0000000000..59e71ccb64 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/R1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/R2.png b/tests/game-controller-test/Resources/ipadhd/R2.png new file mode 100644 index 0000000000..6d5d31ad7f Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/R2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/X.png b/tests/game-controller-test/Resources/ipadhd/X.png new file mode 100644 index 0000000000..b78718c237 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/X.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/Y.png b/tests/game-controller-test/Resources/ipadhd/Y.png new file mode 100644 index 0000000000..34e6d6db46 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/Y.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/controller-1.png b/tests/game-controller-test/Resources/ipadhd/controller-1.png new file mode 100644 index 0000000000..f005ea25a8 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/controller-1.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/controller-2.png b/tests/game-controller-test/Resources/ipadhd/controller-2.png new file mode 100644 index 0000000000..2926750b3c Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/controller-2.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/dPad.png b/tests/game-controller-test/Resources/ipadhd/dPad.png new file mode 100644 index 0000000000..26860c3714 Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/dPad.png differ diff --git a/tests/game-controller-test/Resources/ipadhd/joystick.png b/tests/game-controller-test/Resources/ipadhd/joystick.png new file mode 100644 index 0000000000..4baec700ee Binary files /dev/null and b/tests/game-controller-test/Resources/ipadhd/joystick.png differ diff --git a/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java b/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java index c4a4b68f7d..4aa184e14c 100644 --- a/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java +++ b/tests/game-controller-test/proj.android/src/org/cocos2dx/game_controller_test/AppActivity.java @@ -37,8 +37,8 @@ public class AppActivity extends GameControllerActivity { //The standard controller,without doing anything special. e.g: Amazon Fire TV //Manually specify an adapter. - //this.connectController(DRIVERTYPE_NIBIRU); - //this.connectController(DRIVERTYPE_MOGA); - //this.connectController(DRIVERTYPE_OUYA); + this.connectController(DRIVERTYPE_NIBIRU); + this.connectController(DRIVERTYPE_MOGA); + this.connectController(DRIVERTYPE_OUYA); } } diff --git a/tests/lua-empty-test/project/Classes/AppDelegate.cpp b/tests/lua-empty-test/project/Classes/AppDelegate.cpp index ce16e51490..8b650561ab 100644 --- a/tests/lua-empty-test/project/Classes/AppDelegate.cpp +++ b/tests/lua-empty-test/project/Classes/AppDelegate.cpp @@ -22,24 +22,6 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { - // initialize director - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if(!glview) { - glview = GLView::create("Lua Empty Test"); - director->setOpenGLView(glview); - } - - director->setOpenGLView(glview); - - glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER); - - // turn on display FPS - director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - // register lua engine LuaEngine* engine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); diff --git a/tests/lua-empty-test/src/hello.lua b/tests/lua-empty-test/src/hello.lua index df80dd04da..d9ab1b2a8d 100644 --- a/tests/lua-empty-test/src/hello.lua +++ b/tests/lua-empty-test/src/hello.lua @@ -14,11 +14,32 @@ function __G__TRACKBACK__(msg) cclog("----------------------------------------") end +local function initGLView() + local director = cc.Director:getInstance() + local glView = director:getOpenGLView() + if nil == glView then + glView = cc.GLView:create("Lua Empty Test") + director:setOpenGLView(glView) + end + + director:setOpenGLView(glView) + + glView:setDesignResolutionSize(480, 320, cc.ResolutionPolicy.NO_BORDER) + + --turn on display FPS + director:setDisplayStats(true) + + --set FPS. the default value is 1.0/60 if you don't call this + director:setAnimationInterval(1.0 / 60) +end + local function main() -- avoid memory leak collectgarbage("setpause", 100) collectgarbage("setstepmul", 5000) + initGLView() + --support debug,when used on ios7.1 64bit,these codes should be commented local targetPlatform = cc.Application:getInstance():getTargetPlatform() if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or @@ -58,7 +79,7 @@ local function main() ]]-- local animation = cc.Animation:createWithSpriteFrames({frame0,frame1}, 0.5) - local animate = cc.Animate:create(animation); + local animate = cc.Animate:create(animation) spriteDog:runAction(cc.RepeatForever:create(animate)) -- moving dog at every frame @@ -101,7 +122,7 @@ local function main() local frameCrop = cc.SpriteFrame:create("res/crop.png", cc.rect(0, 0, 105, 95)) for i = 0, 3 do for j = 0, 1 do - local spriteCrop = cc.Sprite:createWithSpriteFrame(frameCrop); + local spriteCrop = cc.Sprite:createWithSpriteFrame(frameCrop) spriteCrop:setPosition(10 + 200 + j * 180 - i % 2 * 90, 30 + 10 + i * 95 / 2) layerFarm:addChild(spriteCrop) end diff --git a/tests/lua-game-controller-test/.cocos-project.json b/tests/lua-game-controller-test/.cocos-project.json new file mode 100644 index 0000000000..570b02f99b --- /dev/null +++ b/tests/lua-game-controller-test/.cocos-project.json @@ -0,0 +1,12 @@ +{ + "ios_cfg": { + "project_path": "../../build", + "project_file": "cocos2d_tests.xcodeproj", + "target_name": "lua-game-controller-test iOS" + }, + "project_type": "lua", + "has_native": true, + "android_cfg": { + "project_path": "project/proj.android" + } +} diff --git a/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp b/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp new file mode 100644 index 0000000000..ca92bd541c --- /dev/null +++ b/tests/lua-game-controller-test/project/Classes/AppDelegate.cpp @@ -0,0 +1,59 @@ +#include "cocos2d.h" +#include "AppDelegate.h" +#include "audio/include/SimpleAudioEngine.h" +#include "base/CCScriptSupport.h" +#include "CCLuaEngine.h" +#include "scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.hpp" +#include "scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.hpp" + +USING_NS_CC; +using namespace CocosDenshion; + +AppDelegate::AppDelegate() +{ + // fixed me + //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF); +} + +AppDelegate::~AppDelegate() +{ + // end simple audio engine here, or it may crashed on win32 + SimpleAudioEngine::getInstance()->end(); + //CCScriptEngineManager::destroyInstance(); +} + +bool AppDelegate::applicationDidFinishLaunching() +{ + LuaEngine* engine = LuaEngine::getInstance(); + ScriptEngineManager::getInstance()->setScriptEngine(engine); + LuaStack* stack = engine->getLuaStack(); + lua_State* L = stack->getLuaState(); + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID ||CC_TARGET_PLATFORM == CC_PLATFORM_IOS ) + lua_getglobal(L, "_G"); + if (lua_istable(L,-1))//stack:...,_G, + { + register_all_cocos2dx_controller(L); + register_all_cocos2dx_controller_manual(L); + } + lua_pop(L, 1);//statck:... +#endif + + engine->executeString("require 'src/main.lua'"); + + return true; +} + +// This function will be called when the app is inactive. When comes a phone call,it's be invoked too +void AppDelegate::applicationDidEnterBackground() +{ + Director::getInstance()->stopAnimation(); + SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); +} + +// this function will be called when the app is active again +void AppDelegate::applicationWillEnterForeground() +{ + Director::getInstance()->startAnimation(); + SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); +} diff --git a/tests/lua-game-controller-test/project/Classes/AppDelegate.h b/tests/lua-game-controller-test/project/Classes/AppDelegate.h new file mode 100644 index 0000000000..b708f4bdca --- /dev/null +++ b/tests/lua-game-controller-test/project/Classes/AppDelegate.h @@ -0,0 +1,38 @@ +#ifndef _APP_DELEGATE_H_ +#define _APP_DELEGATE_H_ + +#include "CCApplication.h" + +/** +@brief The cocos2d Application. + +The reason for implement as private inheritance is to hide some interface call by Director. +*/ +class AppDelegate : private cocos2d::Application +{ +public: + AppDelegate(); + virtual ~AppDelegate(); + + /** + @brief Implement Director and Scene init code here. + @return true Initialize success, app continue. + @return false Initialize failed, app terminate. + */ + virtual bool applicationDidFinishLaunching(); + + /** + @brief The function be called when the application enter background + @param the pointer of the application + */ + virtual void applicationDidEnterBackground(); + + /** + @brief The function be called when the application enter foreground + @param the pointer of the application + */ + virtual void applicationWillEnterForeground(); +}; + +#endif // _APP_DELEGATE_H_ + diff --git a/tests/lua-game-controller-test/project/proj.android/.classpath b/tests/lua-game-controller-test/project/proj.android/.classpath new file mode 100644 index 0000000000..51769745b2 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/lua-game-controller-test/project/proj.android/.project b/tests/lua-game-controller-test/project/proj.android/.project new file mode 100644 index 0000000000..e9471a8678 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/.project @@ -0,0 +1,43 @@ + + + LuaGameControllerTest + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/tests/lua-game-controller-test/project/proj.android/AndroidManifest.xml b/tests/lua-game-controller-test/project/proj.android/AndroidManifest.xml new file mode 100644 index 0000000000..6d44373625 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/lua-game-controller-test/project/proj.android/ant.properties b/tests/lua-game-controller-test/project/proj.android/ant.properties new file mode 100644 index 0000000000..b0971e891e --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/ant.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked into Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/tests/lua-game-controller-test/project/proj.android/build-cfg.json b/tests/lua-game-controller-test/project/proj.android/build-cfg.json new file mode 100644 index 0000000000..3c8431066f --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/build-cfg.json @@ -0,0 +1,35 @@ +{ + "ndk_module_path" :[ + "../../../..", + "../../../../cocos", + "../../../../external" + ], + "copy_resources": [ + { + "from": "../../src", + "to": "src" + }, + { + "from": "../../res", + "to": "res" + }, + { + "from": "../../../../cocos/scripting/lua-bindings/script", + "to": "" + }, + { + "from": "../../../../external/lua/luasocket", + "to": "", + "include": [ + "*.lua" + ] + }, + { + "from": "../../../game-controller-test/Resources", + "to": "res", + "exclude": [ + "*.gz" + ] + } + ] +} diff --git a/tests/lua-game-controller-test/project/proj.android/build.xml b/tests/lua-game-controller-test/project/proj.android/build.xml new file mode 100644 index 0000000000..365cbd97bc --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/build.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/lua-game-controller-test/project/proj.android/jni/Android.mk b/tests/lua-game-controller-test/project/proj.android/jni/Android.mk new file mode 100644 index 0000000000..005ca87198 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/jni/Android.mk @@ -0,0 +1,25 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := lua_game_controller_test_shared + +LOCAL_MODULE_FILENAME := liblua_game_controller + +LOCAL_SRC_FILES := main.cpp \ + ../../Classes/AppDelegate.cpp \ + ../../../../../cocos/scripting/lua-bindings/auto/lua_cocos2dx_controller_auto.cpp \ + ../../../../../cocos/scripting/lua-bindings/manual/lua_cocos2dx_controller_manual.cpp \ + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ + $(LOCAL_PATH)/../../../../../external/lua/tolua \ + $(LOCAL_PATH)/../../../../../cocos/scripting/lua-bindings/auto \ + $(LOCAL_PATH)/../../../../../cocos/scripting/lua-bindings/manual \ + $(LOCAL_PATH)/../../../../../cocos/base + +LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static + + +include $(BUILD_SHARED_LIBRARY) + +$(call import-module,scripting/lua-bindings) diff --git a/tests/lua-game-controller-test/project/proj.android/jni/Application.mk b/tests/lua-game-controller-test/project/proj.android/jni/Application.mk new file mode 100644 index 0000000000..362124d303 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/jni/Application.mk @@ -0,0 +1,15 @@ +APP_STL := c++_static +NDK_TOOLCHAIN_VERSION=clang + +APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char +APP_LDFLAGS := -latomic + + +APP_DEBUG := $(strip $(NDK_DEBUG)) +ifeq ($(APP_DEBUG),1) + APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 + APP_OPTIM := debug +else + APP_CPPFLAGS += -DNDEBUG + APP_OPTIM := release +endif diff --git a/tests/lua-game-controller-test/project/proj.android/jni/main.cpp b/tests/lua-game-controller-test/project/proj.android/jni/main.cpp new file mode 100644 index 0000000000..5199d12ab4 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/jni/main.cpp @@ -0,0 +1,15 @@ +#include "AppDelegate.h" +#include "cocos2d.h" +#include "platform/android/jni/JniHelper.h" +#include +#include + +#define LOG_TAG "main" +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) + +using namespace cocos2d; + +void cocos_android_app_init (JNIEnv* env, jobject thiz) { + LOGD("cocos_android_app_init"); + AppDelegate *pAppDelegate = new AppDelegate(); +} diff --git a/tests/lua-game-controller-test/project/proj.android/proguard-project.txt b/tests/lua-game-controller-test/project/proj.android/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/tests/lua-game-controller-test/project/proj.android/project.properties b/tests/lua-game-controller-test/project/proj.android/project.properties new file mode 100644 index 0000000000..73aaa86542 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/project.properties @@ -0,0 +1,13 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-16 + +android.library.reference.1=../../../../cocos/platform/android/ControllerManualAdapter diff --git a/tests/lua-game-controller-test/project/proj.android/res/drawable-hdpi/icon.png b/tests/lua-game-controller-test/project/proj.android/res/drawable-hdpi/icon.png new file mode 100644 index 0000000000..8aa4767c2f Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android/res/drawable-hdpi/icon.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/res/drawable-ldpi/icon.png b/tests/lua-game-controller-test/project/proj.android/res/drawable-ldpi/icon.png new file mode 100644 index 0000000000..17ce11a085 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android/res/drawable-ldpi/icon.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/res/drawable-mdpi/icon.png b/tests/lua-game-controller-test/project/proj.android/res/drawable-mdpi/icon.png new file mode 100644 index 0000000000..3780aac46c Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.android/res/drawable-mdpi/icon.png differ diff --git a/tests/lua-game-controller-test/project/proj.android/res/values/strings.xml b/tests/lua-game-controller-test/project/proj.android/res/values/strings.xml new file mode 100644 index 0000000000..1bc7340a07 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/res/values/strings.xml @@ -0,0 +1,4 @@ + + + LuaGameControllerTest + diff --git a/tests/lua-game-controller-test/project/proj.android/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java b/tests/lua-game-controller-test/project/proj.android/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java new file mode 100644 index 0000000000..475cb39a5b --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.android/src/org/cocos2dx/LuaGameControllerTest/AppActivity.java @@ -0,0 +1,20 @@ +package org.cocos2dx.LuaGameControllerTest; + +import org.cocos2dx.lib.GameControllerActivity; + +import android.os.Bundle; + +public class AppActivity extends GameControllerActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //The standard controller,without doing anything special. e.g: Amazon Fire TV + + //Manually specify an adapter. + this.connectController(DRIVERTYPE_NIBIRU); + //this.connectController(DRIVERTYPE_MOGA); + //this.connectController(DRIVERTYPE_OUYA); + } +} diff --git a/cocos/base/CCControllerAxisInput.cpp b/tests/lua-game-controller-test/project/proj.ios/AppController.h similarity index 75% rename from cocos/base/CCControllerAxisInput.cpp rename to tests/lua-game-controller-test/project/proj.ios/AppController.h index e2d7865d46..3d51064ca0 100644 --- a/cocos/base/CCControllerAxisInput.cpp +++ b/tests/lua-game-controller-test/project/proj.ios/AppController.h @@ -1,6 +1,5 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2010 cocos2d-x.org http://www.cocos2d-x.org @@ -23,30 +22,12 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCControllerAxisInput.h" +@class RootViewController; -NS_CC_BEGIN - -ControllerAxisInput::ControllerAxisInput() -: _value(0.0f) -{ - +@interface AppController : NSObject { + UIWindow *window; + RootViewController *viewController; } -ControllerAxisInput::~ControllerAxisInput() -{ - -} +@end -float ControllerAxisInput::getValue() const -{ - return _value; -} - -void ControllerAxisInput::setValue(float value) -{ - _value = value; -} - - -NS_CC_END \ No newline at end of file diff --git a/tests/lua-game-controller-test/project/proj.ios/AppController.mm b/tests/lua-game-controller-test/project/proj.ios/AppController.mm new file mode 100644 index 0000000000..9f38038aed --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.ios/AppController.mm @@ -0,0 +1,139 @@ +/**************************************************************************** + 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. + ****************************************************************************/ +#import +#import "AppController.h" +#import "cocos2d.h" +#import "CCEAGLView.h" +#import "AppDelegate.h" + +#import "RootViewController.h" + +@implementation AppController + +#pragma mark - +#pragma mark Application lifecycle + +// cocos2d application instance +static AppDelegate s_sharedApplication; + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + // Override point for customization after application launch. + + // Add the view controller's view to the window and display. + window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; + CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] + pixelFormat: kEAGLColorFormatRGBA8 + depthFormat: GL_DEPTH_COMPONENT16 + preserveBackbuffer: NO + sharegroup: nil + multiSampling: NO + numberOfSamples: 0 ]; + + // Use RootViewController manage CCEAGLView + viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; + viewController.wantsFullScreenLayout = YES; + viewController.view = eaglView; + + // Set RootViewController to window + if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) + { + // warning: addSubView doesn't work on iOS6 + [window addSubview: viewController.view]; + } + else + { + // use this method on ios6 + [window setRootViewController:viewController]; + } + + [window makeKeyAndVisible]; + + [[UIApplication sharedApplication] setStatusBarHidden: YES]; + + // IMPORTANT: Setting the GLView should be done after creating the RootViewController + cocos2d::GLView *glview = cocos2d::GLView::createWithEAGLView(eaglView); + cocos2d::Director::getInstance()->setOpenGLView(glview); + + cocos2d::Application *app = cocos2d::Application::getInstance(); + app->run(); + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + /* + Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + */ + cocos2d::Director::getInstance()->pause(); +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + /* + Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + */ + cocos2d::Director::getInstance()->resume(); +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + /* + Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + If your application supports background execution, called instead of applicationWillTerminate: when the user quits. + */ + cocos2d::Application::getInstance()->applicationDidEnterBackground(); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + /* + Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. + */ + cocos2d::Application::getInstance()->applicationWillEnterForeground(); +} + +- (void)applicationWillTerminate:(UIApplication *)application { + /* + Called when the application is about to terminate. + See also applicationDidEnterBackground:. + */ +} + + +#pragma mark - +#pragma mark Memory management + +- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { + /* + Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. + */ +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png b/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png new file mode 100644 index 0000000000..66c6d1cead Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Default-568h@2x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default.png b/tests/lua-game-controller-test/project/proj.ios/Default.png new file mode 100644 index 0000000000..dcb80725de Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Default.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Default@2x.png b/tests/lua-game-controller-test/project/proj.ios/Default@2x.png new file mode 100644 index 0000000000..84689888a1 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Default@2x.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/HelloLua_Prefix.pch b/tests/lua-game-controller-test/project/proj.ios/HelloLua_Prefix.pch new file mode 100644 index 0000000000..b4311a0a3d --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.ios/HelloLua_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'HelloLua' target in the 'HelloLua' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-114.png b/tests/lua-game-controller-test/project/proj.ios/Icon-114.png new file mode 100644 index 0000000000..c3807861ad Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-114.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-120.png b/tests/lua-game-controller-test/project/proj.ios/Icon-120.png new file mode 100644 index 0000000000..a5b49ccbb1 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-120.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-144.png b/tests/lua-game-controller-test/project/proj.ios/Icon-144.png new file mode 100644 index 0000000000..1526615c02 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-144.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-152.png b/tests/lua-game-controller-test/project/proj.ios/Icon-152.png new file mode 100644 index 0000000000..8aa82506d0 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-152.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-57.png b/tests/lua-game-controller-test/project/proj.ios/Icon-57.png new file mode 100644 index 0000000000..4fcc6fddff Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-57.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-72.png b/tests/lua-game-controller-test/project/proj.ios/Icon-72.png new file mode 100644 index 0000000000..2c573c8df4 Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-72.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Icon-76.png b/tests/lua-game-controller-test/project/proj.ios/Icon-76.png new file mode 100644 index 0000000000..8a1fa1850c Binary files /dev/null and b/tests/lua-game-controller-test/project/proj.ios/Icon-76.png differ diff --git a/tests/lua-game-controller-test/project/proj.ios/Info.plist b/tests/lua-game-controller-test/project/proj.ios/Info.plist new file mode 100644 index 0000000000..12ee63ab86 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.ios/Info.plist @@ -0,0 +1,61 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon-57.png + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + + Icon.png + Icon-57.png + Icon-114.png + Icon-72.png + Icon-144.png + + UIPrerenderedIcon + + + + CFBundleIdentifier + org.cocos2dx.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIPrerenderedIcon + + UIRequiredDeviceCapabilities + + accelerometer + + opengles-1 + + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/cocos/base/CCControllerElement.cpp b/tests/lua-game-controller-test/project/proj.ios/RootViewController.h similarity index 66% rename from cocos/base/CCControllerElement.cpp rename to tests/lua-game-controller-test/project/proj.ios/RootViewController.h index fd480bfa7a..11dfc4bf88 100644 --- a/cocos/base/CCControllerElement.cpp +++ b/tests/lua-game-controller-test/project/proj.ios/RootViewController.h @@ -1,6 +1,6 @@ /**************************************************************************** - Copyright (c) 2014 cocos2d-x.org - Copyright (c) 2014 Chukong Technologies Inc. + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada http://www.cocos2d-x.org @@ -23,41 +23,11 @@ THE SOFTWARE. ****************************************************************************/ -#include "CCControllerElement.h" +#import -NS_CC_BEGIN -ControllerElement::ControllerElement() -: _isAnalog(false) -, _collection(nullptr) -{ - +@interface RootViewController : UIViewController { + } - -ControllerElement::~ControllerElement() -{ - -} - -bool ControllerElement::isAnalog() const -{ - return _isAnalog; -} - -void ControllerElement::setAnalog(bool isAnalog) -{ - _isAnalog = isAnalog; -} - -ControllerElement* ControllerElement::getCollection() -{ - return _collection; -} - -void ControllerElement::setCollection(ControllerElement* collection) -{ - _collection = collection; -} - - -NS_CC_END \ No newline at end of file +- (BOOL)prefersStatusBarHidden; +@end diff --git a/tests/lua-game-controller-test/project/proj.ios/RootViewController.mm b/tests/lua-game-controller-test/project/proj.ios/RootViewController.mm new file mode 100644 index 0000000000..a00da00584 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.ios/RootViewController.mm @@ -0,0 +1,96 @@ +/**************************************************************************** + Copyright (c) 2010-2011 cocos2d-x.org + Copyright (c) 2010 Ricardo Quesada + + 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. + ****************************************************************************/ + +#import "RootViewController.h" + + +@implementation RootViewController + +/* + // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + // Custom initialization + } + return self; +} +*/ + +/* +// Implement loadView to create a view hierarchy programmatically, without using a nib. +- (void)loadView { +} +*/ + +/* +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. +- (void)viewDidLoad { + [super viewDidLoad]; +} + +*/ +// Override to allow orientations other than the default portrait orientation. +// This method is deprecated on ios6 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return UIInterfaceOrientationIsLandscape( interfaceOrientation ); +} + +// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead +- (NSUInteger) supportedInterfaceOrientations{ +#ifdef __IPHONE_6_0 + return UIInterfaceOrientationMaskAllButUpsideDown; +#endif +} + +- (BOOL) shouldAutorotate { + return YES; +} + +//fix not hide status on ios7 +- (BOOL)prefersStatusBarHidden +{ + return YES; +} + +- (void)didReceiveMemoryWarning { + // Releases the view if it doesn't have a superview. + [super didReceiveMemoryWarning]; + + // Release any cached data, images, etc that aren't in use. +} + +- (void)viewDidUnload { + [super viewDidUnload]; + // Release any retained subviews of the main view. + // e.g. self.myOutlet = nil; +} + + +- (void)dealloc { + [super dealloc]; +} + + +@end diff --git a/tests/lua-game-controller-test/project/proj.ios/main.m b/tests/lua-game-controller-test/project/proj.ios/main.m new file mode 100644 index 0000000000..27ca9796f7 --- /dev/null +++ b/tests/lua-game-controller-test/project/proj.ios/main.m @@ -0,0 +1,16 @@ +// +// main.m +// HelloLua +// +// Created by Walzer on 11-6-15. +// Copyright __MyCompanyName__ 2011. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); + [pool release]; + return retVal; +} diff --git a/tests/lua-game-controller-test/res/.gitignore b/tests/lua-game-controller-test/res/.gitignore new file mode 100644 index 0000000000..1d65afe366 --- /dev/null +++ b/tests/lua-game-controller-test/res/.gitignore @@ -0,0 +1,2 @@ +#Do now ignore Marmalade icf files +!*.icf diff --git a/tests/lua-game-controller-test/src/GameControllerTest.lua b/tests/lua-game-controller-test/src/GameControllerTest.lua new file mode 100644 index 0000000000..ca87a39bef --- /dev/null +++ b/tests/lua-game-controller-test/src/GameControllerTest.lua @@ -0,0 +1,403 @@ + +local ControllerHolder = class("ControllerHolder") + +function ControllerHolder:ctor() + self.controller = nil + self._holderNode = nil + + self._leftJoystick = nil + self._rightJoystick = nil + + self._dpadLeft = nil + self._dpadRight = nil + self._dpadUp = nil + self._dpadDown = nil + + self._buttonX = nil + self._buttonY = nil + self._buttonA = nil + self._buttonB = nil + + self._buttonL1 = nil + self._buttonR1 = nil + self._buttonL2 = nil + self._buttonR2 = nil + + self.deviceLabel = nil + self.externalKeyLabel = nil +end + + +local GameControllerTest = class("GameControllerTest", function() + return cc.Layer:create() +end) + +function GameControllerTest:ctor() + self:init() +end + +function GameControllerTest:createControllerSprite(holder) + + holder._holderNode = cc.Node:create() + holder._holderNode:setContentSize(cc.size(998,1000)) + + local controllerBg1 = cc.Sprite:create("controller-1.png") + controllerBg1:setPosition(cc.p(0, 0)) + controllerBg1:setAnchorPoint(cc.p(0, 0)) + holder._holderNode:addChild(controllerBg1) + + local controllerBg2 = cc.Sprite:create("controller-2.png") + controllerBg2:setPosition(cc.p(499,1000)) + controllerBg2:setAnchorPoint(cc.p(0.5, 1.0)) + holder._holderNode:addChild(controllerBg2) + + holder._leftJoystick = cc.Sprite:create("joystick.png") + holder._leftJoystick:setPosition(cc.p(238,460)) + holder._holderNode:addChild(holder._leftJoystick) + + holder._rightJoystick = cc.Sprite:create("joystick.png") + holder._rightJoystick:setPosition(cc.p(606,293)) + holder._holderNode:addChild(holder._rightJoystick) + + holder._deviceLabel = cc.Label:createWithTTF("Disconnected","fonts/Marker Felt.ttf",36) + holder._deviceLabel:setPosition(cc.p(499,650)) + holder._deviceLabel:setTextColor(cc.c4b(255, 0, 0, 255)) + holder._holderNode:addChild(holder._deviceLabel) + + holder._externalKeyLabel = cc.Label:createWithTTF("Key event","fonts/Marker Felt.ttf",36) + holder._externalKeyLabel:setPosition(cc.p(499,500)) + holder._externalKeyLabel:setTextColor(cc.c4b(255, 0, 0, 255)) + holder._holderNode:addChild(holder._externalKeyLabel) + ------------------------------------------------------------------- + local dPadTexture = cc.Director:getInstance():getTextureCache():addImage("dPad.png") + + local dPadCenter = cc.Sprite:createWithTexture(dPadTexture,cc.rect(60,60,68,68)) + dPadCenter:setPosition(cc.p(371,294)) + holder._holderNode:addChild(dPadCenter) + + holder._dpadLeft = cc.Sprite:createWithTexture(dPadTexture,cc.rect(0,60,60,60)) + holder._dpadLeft:setPosition(cc.p(371 - 64,296)) + holder._holderNode:addChild(holder._dpadLeft) + + holder._dpadRight = cc.Sprite:createWithTexture(dPadTexture,cc.rect(128,60,60,60)) + holder._dpadRight:setPosition(cc.p(371 + 64,296)) + holder._holderNode:addChild(holder._dpadRight) + + holder._dpadUp = cc.Sprite:createWithTexture(dPadTexture,cc.rect(60,0,60,60)) + holder._dpadUp:setPosition(cc.p(369,294 + 64)) + holder._holderNode:addChild(holder._dpadUp) + + holder._dpadDown = cc.Sprite:createWithTexture(dPadTexture,cc.rect(60,128,60,60)) + holder._dpadDown:setPosition(cc.p(369,294 - 64)) + holder._holderNode:addChild(holder._dpadDown) + ------------------------------------------------------------------- + holder._buttonL1 = cc.Sprite:create("L1.png") + holder._buttonL1:setPosition(cc.p(290,792)) + holder._holderNode:addChild(holder._buttonL1) + + holder._buttonR1 = cc.Sprite:create("R1.png") + holder._buttonR1:setPosition(cc.p(998 - 290,792)) + holder._holderNode:addChild(holder._buttonR1) + + local buttonL2 = cc.Sprite:create("L2.png") + buttonL2:setPosition(cc.p(220,910)) + holder._holderNode:addChild(buttonL2) + + local buttonR2 = cc.Sprite:create("R2.png") + buttonR2:setPosition(cc.p(998-220,910)) + holder._holderNode:addChild(buttonR2) + + holder._buttonL2 = cc.Sprite:create("L2.png") + holder._buttonL2:setOpacity(0) + holder._buttonL2:setColor(cc.c3b(255,0,0)) + holder._buttonL2:setPosition(cc.p(220,910)) + holder._holderNode:addChild(holder._buttonL2) + + holder._buttonR2 = cc.Sprite:create("R2.png") + holder._buttonR2:setOpacity(0) + holder._buttonR2:setColor(cc.c3b(255,0,0)) + holder._buttonR2:setPosition(cc.p(998-220,910)) + holder._holderNode:addChild(holder._buttonR2) + ------------------------------------------------------------------- + holder._buttonX = cc.Sprite:create("X.png") + holder._buttonX:setPosition(cc.p(750 - 70,460)) + holder._holderNode:addChild(holder._buttonX) + + holder._buttonY = cc.Sprite:create("Y.png") + holder._buttonY:setPosition(cc.p(750,460 + 70)) + holder._holderNode:addChild(holder._buttonY) + + holder._buttonA = cc.Sprite:create("A.png") + holder._buttonA:setPosition(cc.p(750,460 - 70)) + holder._holderNode:addChild(holder._buttonA) + + holder._buttonB = cc.Sprite:create("B.png") + holder._buttonB:setPosition(cc.p(750 + 70,460)) + holder._holderNode:addChild(holder._buttonB) +end + +function GameControllerTest:registerControllerListener() + + local function resetControllerHolderState(holder) + holder._buttonA:setColor(cc.c3b(255, 255, 255)) + holder._buttonB:setColor(cc.c3b(255, 255, 255)) + holder._buttonX:setColor(cc.c3b(255, 255, 255)) + holder._buttonY:setColor(cc.c3b(255, 255, 255)) + holder._dpadUp:setColor(cc.c3b(255, 255, 255)) + holder._dpadDown:setColor(cc.c3b(255, 255, 255)) + holder._dpadLeft:setColor(cc.c3b(255, 255, 255)) + holder._dpadRight:setColor(cc.c3b(255, 255, 255)) + holder._buttonL1:setColor(cc.c3b(255, 255, 255)) + holder._buttonR1:setColor(cc.c3b(255, 255, 255)) + + holder._leftJoystick:setPosition(cc.p(238,460)) + holder._rightJoystick:setPosition(cc.p(606,293)) + holder._deviceLabel:setString("Disconnected") + end + + local function onConnectController(controller, event) + if controller == nil or controller == self._firstHolder.controller or controller == self._secondHolder.controller then + return + end + + local targetPlatform = cc.Application:getInstance():getTargetPlatform() + if targetPlatform == cc.PLATFORM_OS_ANDROID then + --do sth + -- //receive back key + -- controller:receiveExternalKeyEvent(4,true) + -- //receive menu key + -- controller:receiveExternalKeyEvent(82,true) + end + + local deviceInfo = string.format("%s id:%d", controller:getDeviceName(), controller:getDeviceId()) + print(deviceInfo) + + + if self._firstHolder.controller == nil and self._secondHolder.controller == nil then + if self._firstHolder._holderNode then + self._firstHolder.controller = controller + self._firstHolder._deviceLabel:setString(deviceInfo) + else + self._secondHolder.controller = controller + self._secondHolder._deviceLabel:setString(deviceInfo) + end + elseif self._secondHolder.controller == nil then + self._secondHolder.controller = controller + if self._secondHolder._holderNode == nil then + createControllerSprite(self._secondHolder) + + self._firstHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 0.5, 0.5)) + self._firstHolder._holderNode:runAction(cc.MoveTo:create(0.3,cc.p(self._visibleQuarterX, self_visibleCentreY))) + + self._secondHolder._holderNode:setAnchorPoint(cc.p(0.5, 0.5)) + self._secondHolder._holderNode:setScale(0.1) + self._secondHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 0.5, 0.5)) + self._secondHolder._holderNode:setPosition(cc.p(self._visibleThreeQuarterX, self._visibleCentreY)) + self:addChild(self._secondHolder._holderNode) + end + + self._secondHolder._deviceLabel:setString(deviceInfo) + else + self._firstHolder.controller = controller + if self._firstHolder._holderNode == nil then + createControllerSprite(self._firstHolder) + + self._secondHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 0.5, 0.5)) + self._secondHolder._holderNode:runAction(cc.MoveTo:create(0.3, cc.p(self._visibleQuarterX, self._visibleCentreY))) + + self._firstHolder._holderNode:setAnchorPoint(cc.p(0.5, 0.5)) + self._firstHolder._holderNode:setScale(0.1) + self._firstHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 0.5,0.5)) + self._firstHolder._holderNode:setPosition(cc.p(self._visibleThreeQuarterX, self._visibleCentreY)) + self:addChild(self._firstHolder._holderNode) + end + + self._firstHolder._deviceLabel:setString(deviceInfo) + end + end + + local function onDisconnectedController(controller, event) + print("onDisconnectedController:",controller:getDeviceId()) + if self._firstHolder.controller == controller then + self._firstHolder.controller = nil + + if self._secondHolder.controller ~= nil then + self._firstHolder._holderNode:runAction(cc.MoveBy:create(0.3,cc.p(0,self._visibleSize.height))) + + self._secondHolder._holderNode:runAction(cc.MoveTo:create(0.3, cc.p(self._visibleCentreX, self._visibleCentreY) )) + self._secondHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 1.0,1.0)) + else + resetControllerHolderState(self._firstHolder) + end + elseif self._secondHolder.controller == controller then + self._secondHolder.controller = nil + + if self._firstHolder.controller ~= nil then + self._secondHolder._holderNode:runAction(cc.MoveBy:create(0.3, cc.p(0, self._visibleSize.height))) + + self._firstHolder._holderNode:runAction(cc.MoveTo:create(0.3, cc.p(self._visibleCentreX, self._visibleCentreY))) + self._firstHolder._holderNode:runAction(cc.ScaleTo:create(0.3, 1.0,1.0)) + else + resetControllerHolderState(self._secondHolder) + end + end + end + + local function showButtonState(controller, keyCode, isPressed) + onConnectController(controller, nil) + local holder = nil + + if controller == self._firstHolder.controller then + holder = self._firstHolder + elseif controller == self._secondHolder.controller then + holder = self._secondHolder + else + return + end + + if isPressed then + if keyCode == cc.ControllerKey.BUTTON_A then + holder._buttonA:setColor(cc.c3b(250,103,93)) + elseif keyCode == cc.ControllerKey.BUTTON_B then + holder._buttonB:setColor(cc.c3b(92,214,183)) + elseif keyCode == cc.ControllerKey.BUTTON_X then + holder._buttonX:setColor(cc.c3b(96,113,192)) + elseif keyCode == cc.ControllerKey.BUTTON_Y then + holder._buttonY:setColor(cc.c3b(199,222,118)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_UP then + holder._dpadUp:setColor(cc.c3b(0,115,158)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_DOWN then + holder._dpadDown:setColor(cc.c3b(0,115,158)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_LEFT then + holder._dpadLeft:setColor(cc.c3b(170,216,0)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_RIGHT then + holder._dpadRight:setColor(cc.c3b(170,216,0)) + elseif keyCode == cc.ControllerKey.BUTTON_LEFT_SHOULDER then + holder._buttonL1:setColor(cc.c3b(19,231,238)) + elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then + holder._buttonR1:setColor(cc.c3b(19,231,238)) + else + local ketStatus = string.format("Key Down:%d",keyCode) + holder._externalKeyLabel:setString(ketStatus) + end + else + if keyCode == cc.ControllerKey.BUTTON_A then + holder._buttonA:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_B then + holder._buttonB:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_X then + holder._buttonX:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_Y then + holder._buttonY:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_UP then + holder._dpadUp:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_DOWN then + holder._dpadDown:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_LEFT then + holder._dpadLeft:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_DPAD_RIGHT then + holder._dpadRight:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_LEFT_SHOULDER then + holder._buttonL1:setColor(cc.c3b(250,255,255)) + elseif keyCode == cc.ControllerKey.BUTTON_RIGHT_SHOULDER then + holder._buttonR1:setColor(cc.c3b(250,255,255)) + else + local ketStatus = string.format("Key Up:%d",keyCode) + holder._externalKeyLabel:setString(ketStatus) + end + + end + end + + local function onKeyDown(controller, keyCode, event) + showButtonState(controller, keyCode, true) + end + + local function onKeyUp(controller, keyCode, event) + showButtonState(controller, keyCode, false) + end + + local function onAxisEvent(controller, keyCode, event) + local holder = nil + + if controller == self._firstHolder.controller then + holder = self._firstHolder + elseif controller == self._secondHolder.controller then + holder = self._secondHolder + else + return + end + + local ketStatus = controller:getKeyStatus(keyCode) + if keyCode == cc.ControllerKey.JOYSTICK_LEFT_X then + holder._leftJoystick:setPositionX(238 + ketStatus.value * 24) + elseif keyCode == cc.ControllerKey.JOYSTICK_LEFT_Y then + holder._leftJoystick:setPositionY(460 - ketStatus.value * 24) + elseif keyCode == cc.ControllerKey.JOYSTICK_RIGHT_X then + holder._rightJoystick:setPositionX(606 + ketStatus.value * 24) + elseif keyCode == cc.ControllerKey.JOYSTICK_RIGHT_Y then + holder._rightJoystick:setPositionY(293 - ketStatus.value * 24) + elseif keyCode == cc.ControllerKey.AXIS_LEFT_TRIGGER then + holder._buttonL2:setOpacity(200 * controller:getKeyStatus(keyCode).value) + elseif keyCode == cc.ControllerKey.AXIS_RIGHT_TRIGGER then + holder._buttonR2:setOpacity(200 * controller:getKeyStatus(keyCode).value) + else + --do nothing + end + end + + -- body + self._listener = cc.EventListenerController:create() + self._listener:registerScriptHandler(onConnectController, cc.Handler.EVENT_CONTROLLER_CONNECTED) + self._listener:registerScriptHandler(onDisconnectedController, cc.Handler.EVENT_CONTROLLER_DISCONNECTED) + + self._listener:registerScriptHandler(onKeyDown, cc.Handler.EVENT_CONTROLLER_KEYDOWN) + self._listener:registerScriptHandler(onKeyUp, cc.Handler.EVENT_CONTROLLER_KEYUP) + self._listener:registerScriptHandler(onAxisEvent, cc.Handler.EVENT_CONTROLLER_AXIS) + + local eventDispatcher = self:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(self._listener, self) + + cc.Controller:startDiscoveryController() +end + + + +function GameControllerTest:init() + self._currControllerCount = 0 + self._visibleSize = cc.Director:getInstance():getVisibleSize() + self._visibleOrigin = cc.Director:getInstance():getVisibleOrigin() + + local tmpPos = cc.p(self._visibleSize.width / 2 + self._visibleOrigin.x, self._visibleSize.height / 2 + self._visibleOrigin.y) + + self._visibleCentreX = self._visibleOrigin.x + self._visibleSize.width / 2 + self._visibleCentreY = self._visibleOrigin.y + self._visibleSize.height / 2 + self._visibleQuarterX = self._visibleOrigin.x + self._visibleSize.width / 4 + self._visibleThreeQuarterX = self._visibleOrigin.x + self._visibleSize.width * 0.75 + + self._firstHolder = ControllerHolder.new() + self._secondHolder = ControllerHolder.new() + self._firstHolder.controller = nil + self._secondHolder.controller = nil + + self:createControllerSprite(self._firstHolder) + self._firstHolder._holderNode:setAnchorPoint(cc.p(0.5, 0.5)) + self._firstHolder._holderNode:setPosition(tmpPos) + self:addChild(self._firstHolder._holderNode) + + self:registerControllerListener() + + -- local function menuCloseCallback(tag, sender) + + -- end + -- local closeItem = cc.MenuItemImage:create("CloseNormal.png", "CloseSelected.png") + -- closeItem:setPosition(cc.p(self._visibleOrigin.x + self._visibleSize.width - closeItem:getContentSize().width / 2, self._visibleOrigin.y + self._visibleSize.height - closeItem:getContentSize().height / 2)) + + -- local menu = cc.Menu:create() + -- menu:addChild(closeItem) + + +end + + +return GameControllerTest \ No newline at end of file diff --git a/tests/lua-game-controller-test/src/main.lua b/tests/lua-game-controller-test/src/main.lua new file mode 100644 index 0000000000..cdc55801c3 --- /dev/null +++ b/tests/lua-game-controller-test/src/main.lua @@ -0,0 +1,60 @@ +require("Cocos2d") +require("Cocos2dConstants") + +collectgarbage("setpause", 100) +collectgarbage("setstepmul", 5000) + +local mediumResource = +{ + size = cc.size(960, 540), + directory = "ipad", +} + +local largeResource = +{ + size = cc.size(1920, 1080), + directory = "ipadhd", +} + +local director = cc.Director:getInstance() +local glView = director:getOpenGLView() +if nil == glView then + glView = cc.GLView:create("Game Controller Test") + director:setOpenGLView(glView) +end + +director:setOpenGLView(glView) + +local designResolutionSize = cc.size(1920, 1080) + +glView:setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, cc.ResolutionPolicy.SHOW_ALL) + +local frameSize = glView:getFrameSize() + +local targetPlatform = cc.Application:getInstance():getTargetPlatform() +local resPrefix = "" +if targetPlatform == cc.PLATFORM_OS_ANDROID then + resPrefix = "res/" +end + +local fileUtils = cc.FileUtils:getInstance() +local searchPaths = fileUtils:getSearchPaths() + +table.insert(searchPaths, 1, resPrefix) +if frameSize.height > mediumResource.size.height then + table.insert(searchPaths, 1, resPrefix..largeResource.directory) + cc.Director:getInstance():setContentScaleFactor(math.min(largeResource.size.height/designResolutionSize.height, largeResource.size.width/designResolutionSize.width)) +else + table.insert(searchPaths, 1, resPrefix..mediumResource.directory) + cc.Director:getInstance():setContentScaleFactor(math.min(mediumResource.size.height/designResolutionSize.height, mediumResource.size.width/designResolutionSize.width)) +end + +fileUtils:setSearchPaths(searchPaths) + +local scene = cc.Scene:create() +scene:addChild(require("src/GameControllerTest").new()) +if cc.Director:getInstance():getRunningScene() then + cc.Director:getInstance():replaceScene(scene) +else + cc.Director:getInstance():runWithScene(scene) +end \ No newline at end of file diff --git a/tests/lua-tests/project/Classes/AppDelegate.cpp b/tests/lua-tests/project/Classes/AppDelegate.cpp index 3bad5648b8..ce312026d4 100644 --- a/tests/lua-tests/project/Classes/AppDelegate.cpp +++ b/tests/lua-tests/project/Classes/AppDelegate.cpp @@ -19,31 +19,6 @@ AppDelegate::~AppDelegate() bool AppDelegate::applicationDidFinishLaunching() { - auto director = Director::getInstance(); - auto glview = director->getOpenGLView(); - if(!glview) { - glview = GLView::createWithRect("Lua Tests", Rect(0,0,900,640)); - director->setOpenGLView(glview); - } - - // turn on display FPS - director->setDisplayStats(true); - - // set FPS. the default value is 1.0/60 if you don't call this - director->setAnimationInterval(1.0 / 60); - - auto screenSize = glview->getFrameSize(); - - auto designSize = Size(480, 320); - - if (screenSize.height > 320) - { - auto resourceSize = Size(960, 640); - director->setContentScaleFactor(resourceSize.height/designSize.height); - } - - glview->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::FIXED_HEIGHT); - // register lua engine LuaEngine* pEngine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(pEngine); diff --git a/tests/lua-tests/src/CaptureScreenTest/CaptureScreenTest.lua b/tests/lua-tests/src/CaptureScreenTest/CaptureScreenTest.lua new file mode 100644 index 0000000000..37d39ddc3a --- /dev/null +++ b/tests/lua-tests/src/CaptureScreenTest/CaptureScreenTest.lua @@ -0,0 +1,75 @@ +local winSize = cc.Director:getInstance():getWinSize() +local kTagSprite = 1 +local childTag = 119 + +local function createLayer() + local layer = cc.Layer:create() + local filename = "" + + local title = cc.Label:createWithTTF("New Renderer", "fonts/arial.ttf", 36) + title:setColor(cc.c3b(255,255,0)) + layer:addChild(title, 1, 10000) + title:setPosition( cc.p(VisibleRect:center().x, VisibleRect:top().y - 30)) + + local subTitle = cc.Label:createWithTTF("Capture screen test, press the menu items to capture the screen", "fonts/arial.ttf", 12) + subTitle:setColor(cc.c3b(255,255,0)) + layer:addChild(subTitle, 1, 10001) + subTitle:setPosition( cc.p(VisibleRect:center().x, VisibleRect:top().y - 60) ) + + local left = cc.p(winSize.width / 4, winSize.height / 2) + local right = cc.p(winSize.width / 4 * 3, winSize.height / 2) + + local sp1 = cc.Sprite:create("Images/grossini.png") + sp1:setPosition(left) + local move1 = cc.MoveBy:create(1, cc.p(winSize.width/2, 0)) + local seq1 = cc.RepeatForever:create(cc.Sequence:create(move1, move1:reverse())) + layer:addChild(sp1) + sp1:runAction(seq1) + local sp2 = cc.Sprite:create("Images/grossinis_sister1.png") + sp2:setPosition(right) + local move2 = cc.MoveBy:create(1, cc.p(-winSize.width/2, 0)) + local seq2 = cc.RepeatForever:create(cc.Sequence:create(move2, move2:reverse())) + layer:addChild(sp2) + sp2:runAction(seq2) + + local function afterCaptured(succeed, outputFile) + if succeed then + local sp = cc.Sprite:create(outputFile) + layer:addChild(sp, 0, childTag) + sp:setPosition(winSize.width / 2, winSize.height / 2) + sp:setScale(0.25) + fileName = outputFile + else + cclog("Capture screen failed.") + end + end + + local function onCaptured(tag, sender) + cc.Director:getInstance():getTextureCache():removeTextureForKey(fileName) + layer:removeChildByTag(childTag) + fileName = "CaptureScreenTest.png" + cc.utils:captureScreen(afterCaptured, fileName) + end + + local ttfConfig = {} + ttfConfig.fontFilePath = "fonts/arial.ttf" + ttfConfig.fontSize = 24 + local label1 = cc.Label:createWithTTF(ttfConfig, "capture all", cc.TEXT_ALIGNMENT_CENTER, winSize.width) + local mi1 = cc.MenuItemLabel:create(label1) + mi1:registerScriptTapHandler(onCaptured) + local menu = cc.Menu:create(mi1) + layer:addChild(menu) + menu:setPosition(winSize.width / 2, winSize.height / 4) + + return layer +end + +-------------------------------- +-- CaptureScreen +-------------------------------- +function CaptureScreenTestMain() + local scene = cc.Scene:create() + scene:addChild(createLayer()) + scene:addChild(CreateBackMenuItem()) + return scene +end diff --git a/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua b/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua index fdecbdfdab..22cf4fad6a 100644 --- a/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua +++ b/tests/lua-tests/src/ExtensionTest/ExtensionTest.lua @@ -1,5 +1,6 @@ require "src/ExtensionTest/CocosBuilderTest" require "src/ExtensionTest/WebProxyTest" +require "src/ExtensionTest/SceneEditorTest" local LINE_SPACE = 40 local kItemTagBasic = 1000 @@ -13,7 +14,8 @@ local ExtensionTestEnum = TEST_EDITBOX = 4, TEST_TABLEVIEW = 5, TEST_SCROLLVIEW = 6, - TEST_MAX_COUNT = 7, + TEST_STUDIOSCENE = 7, + TEST_MAX_COUNT = 8, } local testsName = @@ -25,6 +27,7 @@ local testsName = "EditBoxTest", "TableViewTest", "ScrollViewTest", + "CocoStudioSceneTest", } @@ -1187,6 +1190,7 @@ local CreateExtensionsTestTable = runEditBoxTest, runTableViewTest, runScrollViewTest, + runStudioSceneTest, } @@ -1267,7 +1271,7 @@ local function ExtensionsMainLayer() local listener = cc.EventListenerTouchAllAtOnce:create() listener:registerScriptHandler(onTouchesBegan,cc.Handler.EVENT_TOUCHES_BEGAN ) - listener:registerScriptHandler(onTouchesMoved,cc.Handler.EVENT_TOUCH_MOVED ) + listener:registerScriptHandler(onTouchesMoved,cc.Handler.EVENT_TOUCHES_MOVED ) local eventDispatcher = layer:getEventDispatcher() eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer) diff --git a/tests/lua-tests/src/ExtensionTest/SceneEditorTest.lua b/tests/lua-tests/src/ExtensionTest/SceneEditorTest.lua new file mode 100644 index 0000000000..625db70527 --- /dev/null +++ b/tests/lua-tests/src/ExtensionTest/SceneEditorTest.lua @@ -0,0 +1,270 @@ +require "CCBReaderLoad" + +function SceneEditorTestLayer(filename) + + local layer = cc.Layer:create() + local isCsbLoad = false; + local loadtypeStr = {"change to load \nwith binary file","change to load \nwith json file"} + local loadtypelb = cc.Label:createWithSystemFont(loadtypeStr[1], "Arial", 12); + local filePath = filename + layer.rootNode = nil + function layer:defaultPlay()end + + local loadFileChangeHelper = function(filename) + if filename ~= nil then + if isCsbLoad then + return filename .. ".csb" + else + return filename .. ".json" + end + end + + return filename + end + + local changeLoadTypeCallback = function(sender) + isCsbLoad = not isCsbLoad + loadtypelb:setString(loadtypeStr[isCsbLoad == false and 1 or 2]) + local file = loadFileChangeHelper(filePath) + + if layer.rootNode ~= nil then + layer:removeChild(layer.rootNode) + layer.rootNode = SceneReader:getInstance():createNodeWithSceneFile(file) + layer:addChild(layer.rootNode, 0, 1) + layer:defaultPlay() + end + end + + function layer:enter() + layer.rootNode = SceneReader:getInstance():createNodeWithSceneFile(loadFileChangeHelper(filePath)) + layer:addChild(layer.rootNode, 0, 1) + layer:defaultPlay() + end + + function layer:exit() + ccs.ArmatureDataManager:destroyInstance() + ccs.SceneReader:destroyInstance() + ccs.ActionManagerEx:destroyInstance() + ccs.GUIReader:destroyInstance() + end + + local function onNodeEvent(event) + if "enter" == event then + layer:enter() + elseif "exit" == event then + layer:exit() + end + end + layer:registerScriptHandler(onNodeEvent) + + local itemlb = cc.MenuItemLabel:create(loadtypelb) + itemlb:registerScriptTapHandler(changeLoadTypeCallback) + local loadtypemenu = cc.Menu:create(itemlb) + loadtypemenu:setPosition(cc.p(VisibleRect:rightTop().x -50,VisibleRect:rightTop().y -20)); + layer:addChild(loadtypemenu,100); + + Helper.initWithLayer(layer) + Helper.titleLabel:setString("SceneReader Test LoadSceneEditorFile") + return layer +end + +function LoadSceneEdtiorFileTest() + local layer = SceneEditorTestLayer("scenetest/LoadSceneEdtiorFileTest/FishJoy2") + Helper.titleLabel:setString("loadSceneEdtiorFile Test") + + return layer +end + +function SpriteComponentTest() + local layer = SceneEditorTestLayer("scenetest/SpriteComponentTest/SpriteComponentTest") + Helper.titleLabel:setString("Sprite Component Test") + + function layer:defaultPlay() + layer.rootNode:getChildByTag(10003):getComponent("CCSprite"):getNode():runAction(cc.Blink:create(2, 10)); + layer.rootNode:getChildByTag(10004):getComponent("CCSprite"):getNode():runAction(cc.Blink:create(2, 5)); + end + + return layer +end + +function ArmatureComponentTest() + local layer = SceneEditorTestLayer("scenetest/ArmatureComponentTest/ArmatureComponentTest") + Helper.titleLabel:setString("Armature Component Test") + + function layer:defaultPlay() + layer.rootNode:getChildByTag(10007):getComponent("CCArmature"):getNode():runAction(cc.MoveBy:create(10.0, cc.p(-1000.0, 0))) + layer.rootNode:getChildByTag(10008):getComponent("CCArmature"):getNode():runAction(cc.MoveBy:create(10.0, cc.p(-1000.0, 0))) + end + + return layer +end + +function UIComponentTest() + local layer = SceneEditorTestLayer("scenetest/UIComponentTest/UIComponentTest") + Helper.titleLabel:setString("UI Component Test") + + local function touchEvent(sender,eventType) + if eventType == ccui.TouchEventType.began then + layer.rootNode:getChildByTag(10010):getComponent("CCArmature"):getNode():runAction(cc.MoveBy:create(10.0, cc.p(-1000.0, 0))) + layer.rootNode:getChildByTag(10011):getComponent("CCArmature"):getNode():runAction(cc.MoveBy:create(10.0, cc.p(-1000.0, 0))) + end + end + + function layer:defaultPlay() + local render = layer.rootNode:getChildByTag(10025):getComponent("GUIComponent") + local widget = render:getNode() + local button = widget:getChildByName("Button_156") + button:addTouchEventListener(touchEvent) + end + + return layer +end + +function TmxMapComponentTest() + local layer = SceneEditorTestLayer("scenetest/TmxMapComponentTest/TmxMapComponentTest") + Helper.titleLabel:setString("TmxMap Component Test") + + function layer:defaultPlay() + local render = layer.rootNode:getChildByTag(10015):getComponent("CCTMXTiledMap") + + local skewTo = cc.SkewTo:create(2, 0, 2); + local rotateTo = cc.RotateTo:create(2, 61); + local scaleTo = cc.ScaleTo:create(2, -0.44, 0.47); + local scaleBack = cc.ScaleTo:create(2, 1, 1); + local rotateBack = cc.RotateTo:create(2, 0); + local skewBack = cc.SkewTo:create(2, 0, 0); + render:getNode():runAction(cc.Sequence:create(skewTo, skewBack)); + render:getNode():runAction(cc.Sequence:create(rotateTo, rotateBack)); + render:getNode():runAction(cc.Sequence:create(scaleTo, scaleBack)); + end + + return layer +end + +function ParticleComponentTest() + local layer = SceneEditorTestLayer("scenetest/ParticleComponentTest/ParticleComponentTest") + Helper.titleLabel:setString("Particle Component Test") + + function layer:defaultPlay() + local render = layer.rootNode:getChildByTag(10020):getComponent("CCParticleSystemQuad") + + local action = cc.JumpBy:create(5, cc.p(-500,0), 50, 4); + render:getNode():runAction(cc.Sequence:create(action, action:reverse())) + end + + return layer +end + +function EffectComponentTest() + local layer = SceneEditorTestLayer("scenetest/EffectComponentTest/EffectComponentTest") + Helper.titleLabel:setString("Effect Component Test") + + local animationEvent = function(armature,movementType,movementID) + if movementType == ccs.MovementEventType.loopComplete then + if movementID == "Fire" then + layer.rootNode:getChildByTag(10015):getComponent("CCComAudio"):playEffect() + end + end + end + + function layer:defaultPlay() + local render = layer.rootNode:getChildByTag(10015):getComponent("CCArmature") + + render:getNode():getAnimation():setMovementEventCallFunc(animationEvent); + end + + return layer +end + +function BackgroundComponentTest() + local layer = SceneEditorTestLayer("scenetest/BackgroundComponentTest/BackgroundComponentTest") + Helper.titleLabel:setString("Background Component Test") + + function layer:defaultPlay() + layer.rootNode:getComponent("CCBackgroundAudio"):playBackgroundMusic(); + end + + return layer +end + +function AttributeComponentTest() + local layer = SceneEditorTestLayer("scenetest/AttributeComponentTest/AttributeComponentTest") + Helper.titleLabel:setString("Attribute Component Test") + + function layer:defaultPlay() + local attribute = layer.rootNode:getChildByTag(10015):getComponent("CCComAttribute") + cclog("Name: " .. attribute:getString("name") .. ", HP: " .. attribute:getFloat("maxHP") .. ", MP: " .. attribute:getFloat("maxMP")) + end + + return layer +end + +function TriggerTest() + local layer = SceneEditorTestLayer("scenetest/TriggerTest/TriggerTest") + Helper.titleLabel:setString("Trigger Test") + + local function onTouchBegan(touch, event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHBEGAN) + end + local function onTouchMoved(touch, event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHMOVED) + end + local function onTouchEnded(touch, event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHENDED) + end + local function onTouchCancelled(touch, event) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_TOUCHCANCELLED) + end + + + local touchListener = cc.EventListenerTouchOneByOne:create() + touchListener:setSwallowTouches(true) + touchListener:registerScriptHandler(onTouchBegan, cc.Handler.EVENT_TOUCH_BEGAN) + touchListener:registerScriptHandler(onTouchMoved, cc.Handler.EVENT_TOUCH_MOVED) + touchListener:registerScriptHandler(onTouchEnded, cc.Handler.EVENT_TOUCH_ENDED) + touchListener:registerScriptHandler(onTouchCancelled, cc.Handler.EVENT_TOUCH_CANCELLED) + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithFixedPriority(touchListener, 1) + + + local function gameLogic(dt) + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_UPDATESCENE) + end + + local layerExit = layer.exit + function layer:exit() + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_LEAVESCENE) + layer:unschedule(gameLogic) + eventDispatcher:removeEventListener(touchListener) + layerExit(layer) + end + + schedule(layer,gameLogic) + + function layer:defaultPlay() + ccs.sendTriggerEvent(triggerEventDef.TRIGGEREVENT_ENTERSCENE); + end + + return layer +end + +function runStudioSceneTest() + local scene = cc.Scene:create() + + Helper.createFunctionTable = { + LoadSceneEdtiorFileTest, + SpriteComponentTest, + ArmatureComponentTest, + UIComponentTest, + TmxMapComponentTest, + ParticleComponentTest, + EffectComponentTest, + BackgroundComponentTest, + AttributeComponentTest, + TriggerTest, + } + + scene:addChild(Helper.createFunctionTable[1]()) + scene:addChild(CreateBackMenuItem()) + return scene +end diff --git a/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua b/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua new file mode 100644 index 0000000000..9af3d41c98 --- /dev/null +++ b/tests/lua-tests/src/FastTiledMapTest/FastTiledMapTest.lua @@ -0,0 +1,1185 @@ +local size = cc.Director:getInstance():getWinSize() +local scheduler = cc.Director:getInstance():getScheduler() + +local kTagTileMap = 1 + + +local function createTileDemoLayer(title, subtitle) + local layer = cc.Layer:create() + Helper.initWithLayer(layer) + local titleStr = title == nil and "No title" or title + local subTitleStr = subtitle == nil and "drag the screen" or subtitle + Helper.titleLabel:setString(titleStr) + Helper.subtitleLabel:setString(subTitleStr) + + local function onTouchesMoved(touches, event ) + local diff = touches[1]:getDelta() + local node = layer:getChildByTag(kTagTileMap) + local currentPosX, currentPosY= node:getPosition() + node:setPosition(cc.p(currentPosX + diff.x, currentPosY + diff.y)) + end + + local listener = cc.EventListenerTouchAllAtOnce:create() + listener:registerScriptHandler(onTouchesMoved,cc.Handler.EVENT_TOUCHES_MOVED ) + local eventDispatcher = layer:getEventDispatcher() + eventDispatcher:addEventListenerWithSceneGraphPriority(listener, layer) + + return layer +end +-------------------------------------------------------------------- +-- +-- TileMapTest +-- +-------------------------------------------------------------------- +local function TileMapTest() + local layer = createTileDemoLayer("TileMapAtlas") + + local map = cc.TileMapAtlas:create(s_TilesPng, s_LevelMapTga, 16, 16) + -- Convert it to "alias" (GL_LINEAR filtering) + map:getTexture():setAntiAliasTexParameters() + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + -- If you are not going to use the Map, you can free it now + -- NEW since v0.7 + map:releaseMap() + + layer:addChild(map, 0, kTagTileMap) + + map:setAnchorPoint( cc.p(0, 0.5) ) + + local scale = cc.ScaleBy:create(4, 0.8) + local scaleBack = scale:reverse() + + local seq = cc.Sequence:create(scale, scaleBack) + + map:runAction(cc.RepeatForever:create(seq)) + + return layer +end + +-------------------------------------------------------------------- +-- +-- TileMapEditTest +-- +-------------------------------------------------------------------- +local function TileMapEditTest() + local layer = createTileDemoLayer("Editable TileMapAtlas") + local map = cc.TileMapAtlas:create(s_TilesPng, s_LevelMapTga, 16, 16) + -- Create an Aliased Atlas + map:getTexture():setAliasTexParameters() + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + -- If you are not going to use the Map, you can free it now + -- [tilemap releaseMap) + -- And if you are going to use, it you can access the data with: + local function updateMap(dt) + + -- IMPORTANT + -- The only limitation is that you cannot change an empty, or assign an empty tile to a tile + -- The value 0 not rendered so don't assign or change a tile with value 0 + + local tilemap = layer:getChildByTag(kTagTileMap) + + -- + -- For example you can iterate over all the tiles + -- using this code, but try to avoid the iteration + -- over all your tiles in every frame. It's very expensive + -- for(int x=0 x < tilemap.tgaInfo:width x++) + -- for(int y=0 y < tilemap.tgaInfo:height y++) + -- Color3B c =[tilemap getTileAt:local Make(x,y)) + -- if( c.r != 0 ) + -- --------cclog("%d,%d = %d", x,y,c.r) + -- end + -- end + -- end + + -- NEW since v0.7 + local c = tilemap:getTileAt(cc.p(13,21)) + c.r = c.r + 1 + c.r = c.r % 50 + + if( c.r==0) then + c.r=1 + end + -- NEW since v0.7 + tilemap:setTile(c, cc.p(13,21) ) + end + + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + schedulerEntry = scheduler:scheduleScriptFunc(updateMap, 0.2, false) + elseif event == "exit" then + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + layer:registerScriptHandler(onNodeEvent) + + layer:addChild(map, 0, kTagTileMap) + + map:setAnchorPoint( cc.p(0, 0) ) + map:setPosition( cc.p(-20,-200) ) + + return layer +end + + +-------------------------------------------------------------------- +-- +-- TMXOrthoTest +-- +-------------------------------------------------------------------- +local function TMXOrthoTest() + local layer = createTileDemoLayer("TMX Orthogonal test") + -- + -- Test orthogonal with 3d camera and anti-alias textures + -- + -- it should not flicker. No artifacts should appear + -- + --local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + --addChild(color, -1) + + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test2.tmx") + layer:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local scale = cc.ScaleBy:create(10, 0.1) + local back = scale:reverse() + local seq = cc.Sequence:create(scale, back) + local repeatAction = cc.RepeatForever:create(seq) + map:runAction(repeatAction) + + local function onNodeEvent(event) + if event == "enter" then + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION3_D ) + elseif event == "exit" then + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION_DEFAULT ) + end + end + + layer:registerScriptHandler(onNodeEvent) + + + return layer +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoTest2 +-- +-------------------------------------------------------------------- +local function TMXOrthoTest2() + local layer = createTileDemoLayer("TMX Ortho test2") + + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test1.tmx") + layer:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + map:runAction( cc.ScaleBy:create(2, 0.5) ) + return layer +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoTest3 +-- +-------------------------------------------------------------------- +local function TMXOrthoTest3() + local layer = createTileDemoLayer("TMX anchorPoint test") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test3.tmx") + layer:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + map:setScale(0.2) + map:setAnchorPoint( cc.p(0.5, 0.5) ) + return layer +end + + +-------------------------------------------------------------------- +-- +-- TMXOrthoTest4 +-- +-------------------------------------------------------------------- +local function TMXOrthoTest4() + local ret = createTileDemoLayer("TMX width/height test") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test4.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s1 = map:getContentSize() + cclog("ContentSize: %f, %f", s1.width,s1.height) + + map:setAnchorPoint(cc.p(0, 0)) + + local layer = map:getLayer("Layer 0") + local s = layer:getLayerSize() + + local sprite = layer:getTileAt(cc.p(0,0)) + sprite:setScale(2) + sprite = layer:getTileAt(cc.p(s.width-1,0)) + sprite:setScale(2) + sprite = layer:getTileAt(cc.p(0,s.height-1)) + sprite:setScale(2) + sprite = layer:getTileAt(cc.p(s.width-1,s.height-1)) + sprite:setScale(2) + + local schedulerEntry = nil + + local function removeSprite(dt) + scheduler:unscheduleScriptEntry(schedulerEntry) + schedulerEntry = nil + local map = ret:getChildByTag(kTagTileMap) + local layer0 = map:getLayer("Layer 0") + local s = layer0:getLayerSize() + + local sprite = layer0:getTileAt(cc.p(s.width-1,0)) + layer0:removeChild(sprite, true) + local sprite2 = layer0:getTileAt(cc.p(s.width-1, s.height - 1)) + local sprite3 = layer0:getTileAt(cc.p(2, s.height - 1)) + layer0:removeChild(sprite3, true) + layer0:removeChild(sprite2, true) + end + + + local function onNodeEvent(event) + if event == "enter" then + schedulerEntry = scheduler:scheduleScriptFunc(removeSprite, 2, false) + elseif event == "exit" and schedulerEntry ~= nil then + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + ret:registerScriptHandler(onNodeEvent) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXReadWriteTest +-- +-------------------------------------------------------------------- +local SID_UPDATECOL = 100 +local SID_REPAINTWITHGID = 101 +local SID_REMOVETILES = 102 + +local function TMXReadWriteTest() + local ret = createTileDemoLayer("TMX Read/Write test") + local m_gid = 0 + local m_gid2 = 0 + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test2.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + + local layer = map:getLayer("Layer 0") + map:setScale( 1 ) + + local tile0 = layer:getTileAt(cc.p(1,63)) + local tile1 = layer:getTileAt(cc.p(2,63)) + local tile2 = layer:getTileAt(cc.p(3,62))--cc.p(1,62)) + local tile3 = layer:getTileAt(cc.p(2,62)) + tile0:setAnchorPoint( cc.p(0.5, 0.5) ) + tile1:setAnchorPoint( cc.p(0.5, 0.5) ) + tile2:setAnchorPoint( cc.p(0.5, 0.5) ) + tile3:setAnchorPoint( cc.p(0.5, 0.5) ) + + local move = cc.MoveBy:create(0.5, cc.p(0,160)) + local rotate = cc.RotateBy:create(2, 360) + local scale = cc.ScaleBy:create(2, 5) + local opacity = cc.FadeOut:create(2) + local fadein = cc.FadeIn:create(2) + local scaleback = cc.ScaleTo:create(1, 1) + + local function removeSprite(sender) + --------cclog("removing tile: %x", sender) + local node = sender + if nil == node then + print("Errro node is nil") + end + local p = node:getParent() + + if p ~= nil then + p:removeChild(node, true) + end + ----------cclog("atlas quantity: %d", p:textureAtlas():totalQuads()) + end + + local finish = cc.CallFunc:create(removeSprite) + local seq0 = cc.Sequence:create(move, rotate, scale, opacity, fadein, scaleback, finish) + local seq1 = seq0:clone() + local seq2 = seq0:clone() + local seq3 = seq0:clone() + + tile0:runAction(seq0) + tile1:runAction(seq1) + tile2:runAction(seq2) + tile3:runAction(seq3) + + + m_gid = layer:getTileGIDAt(cc.p(0,63)) + --------cclog("Tile GID at:(0,63) is: %d", m_gid) + local updateColScheduler = nil + local repainWithGIDScheduler = nil + local removeTilesScheduler = nil + + local function updateCol(dt) + + local map = ret:getChildByTag(kTagTileMap) + local layer = map:getChildByTag(0) + + --------cclog("++++atlas quantity: %d", layer:textureAtlas():getTotalQuads()) + --------cclog("++++children: %d", layer:getChildren():count() ) + + + local s = layer:getLayerSize() + local y = 0 + for y=0, s.height-1, 1 do + layer:setTileGID(m_gid2, cc.p(3, y)) + end + + m_gid2 = (m_gid2 + 1) % 80 + end + + local function repaintWithGID(dt) + -- unschedule:_cmd) + local map = ret:getChildByTag(kTagTileMap) + local layer = map:getChildByTag(0) + + local s = layer:getLayerSize() + local x = 0 + for x=0, s.width-1, 1 do + local y = s.height-1 + local tmpgid = layer:getTileGIDAt( cc.p(x, y) ) + layer:setTileGID(tmpgid+1, cc.p(x, y)) + end + end + + local function removeTiles(dt) + scheduler:unscheduleScriptEntry(removeTilesScheduler) + removeTilesScheduler = nil + local map = ret:getChildByTag(kTagTileMap) + local layer = map:getChildByTag(0) + local s = layer:getLayerSize() + local y = 0 + for y=0, s.height-1, 1 do + layer:removeTileAt( cc.p(5.0, y) ) + end + end + + local function onNodeEvent(event) + if event == "enter" then + updateColScheduler = scheduler:scheduleScriptFunc(updateCol, 2, false) + repainWithGIDScheduler = scheduler:scheduleScriptFunc(repaintWithGID, 2.05, false) + removeTilesScheduler = scheduler:scheduleScriptFunc(removeTiles, 1.0, false) + elseif event == "exit" then + if updateColScheduler ~= nil then + scheduler:unscheduleScriptEntry(updateColScheduler) + end + + if repainWithGIDScheduler ~= nil then + scheduler:unscheduleScriptEntry(repainWithGIDScheduler) + end + + if removeTilesScheduler ~= nil then + scheduler:unscheduleScriptEntry(removeTilesScheduler) + end + + end + end + + ret:registerScriptHandler(onNodeEvent) + --------cclog("++++atlas quantity: %d", layer:textureAtlas():getTotalQuads()) + --------cclog("++++children: %d", layer:getChildren():count() ) + + m_gid2 = 0 + return ret +end + + +-------------------------------------------------------------------- +-- +-- TMXHexTest +-- +-------------------------------------------------------------------- +local function TMXHexTest() + local ret = createTileDemoLayer("TMX Hex tes") + local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + ret:addChild(color, -1) + + local map = cc.TMXTiledMap:create("TileMaps/hexa-test.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoTest +-- +-------------------------------------------------------------------- +local function TMXIsoTest() + local ret = createTileDemoLayer("TMX Isometric test 0") + local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + ret:addChild(color, -1) + + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test.tmx") + ret:addChild(map, 0, kTagTileMap) + + -- move map to the center of the screen + local ms = map:getMapSize() + local ts = map:getTileSize() + map:runAction( cc.MoveTo:create(1.0, cc.p( -ms.width * ts.width/2, -ms.height * ts.height/2 )) ) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoTest1 +-- +-------------------------------------------------------------------- +local function TMXIsoTest1() + local ret = createTileDemoLayer("TMX Isometric test + anchorPoint") + local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + ret:addChild(color, -1) + + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test1.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + map:setAnchorPoint(cc.p(0.5, 0.5)) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoTest2 +-- +-------------------------------------------------------------------- +local function TMXIsoTest2() + local ret = createTileDemoLayer("TMX Isometric test 2") + local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + ret:addChild(color, -1) + + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test2.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + -- move map to the center of the screen + local ms = map:getMapSize() + local ts = map:getTileSize() + map:runAction( cc.MoveTo:create(1.0, cc.p( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXUncompressedTest +-- +-------------------------------------------------------------------- +local function TMXUncompressedTest() + local ret = createTileDemoLayer("TMX Uncompressed test") + local color = cc.LayerColor:create( cc.c4b(64,64,64,255) ) + ret:addChild(color, -1) + + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test2-uncompressed.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + -- move map to the center of the screen + local ms = map:getMapSize() + local ts = map:getTileSize() + map:runAction(cc.MoveTo:create(1.0, cc.p( -ms.width * ts.width/2, -ms.height * ts.height/2 ) )) + + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXTilesetTest +-- +-------------------------------------------------------------------- +local function TMXTilesetTest() + local ret = createTileDemoLayer("TMX Tileset test") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test5.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoObjectsTest +-- +-------------------------------------------------------------------- +local function TMXOrthoObjectsTest() + local ret = createTileDemoLayer("TMX Ortho object test", "You should see a white box around the 3 platforms") + local map = cc.FastTMXTiledMap:create("TileMaps/ortho-objects.tmx") + ret:addChild(map, -1, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + --------cclog("---: Iterating over all the group objets") + local group = map:getObjectGroup("Object Group 1") + local objects = group:getObjects() + + local dict = nil + local i = 0 + local len = table.getn(objects) + + for i = 0, len-1, 1 do + dict = objects[i + 1] + + if dict == nil then + break + end + --------cclog("object: %x", dict) + end + + --------cclog("---: Fetching 1 object by name") + -- local platform = group:objectNamed("platform") + --------cclog("platform: %x", platform) + return ret +end + +local function draw() + + local map = tolua.cast(getChildByTag(kTagTileMap), "cc.TMXTiledMap") + local group = map:getObjectGroup("Object Group 1") + + local objects = group:getObjects() + local dict = nil + local i = 0 + local len = table.getn(objects) + for i = 0, len-1, 1 do + dict = objects[i + 1] + + if dict == nil then + break + end + + local key = "x" + local x = dict["x"] + key = "y" + local y = dict["y"]--dynamic_cast(dict:objectForKey("y")):getNumber() + key = "width" + local width = dict["width"]--dynamic_cast(dict:objectForKey("width")):getNumber() + key = "height" + local height = dict["height"]--dynamic_cast(dict:objectForKey("height")):getNumber() + + glLineWidth(3) + + cc.DrawPrimitives.drawLine( cc.p(x, y), cc.p((x+width), y) ) + cc.DrawPrimitives.drawLine( cc.p((x+width), y), cc.p((x+width), (y+height)) ) + cc.DrawPrimitives.drawLine( cc.p((x+width), (y+height)), cc.p(x, (y+height)) ) + cc.DrawPrimitives.drawLine( cc.p(x, (y+height)), cc.p(x, y) ) + + glLineWidth(1) + end +end + +-------------------------------------------------------------------- +-- +-- TMXIsoObjectsTest +-- +-------------------------------------------------------------------- + +local function TMXIsoObjectsTest() + local ret = createTileDemoLayer("TMX Iso object test", "You need to parse them manually. See bug #810") + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test-objectgroup.tmx") + ret:addChild(map, -1, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local group = map:getObjectGroup("Object Group 1") + + --UxMutableArray* objects = group:objects() + local objects = group:getObjects() + --UxMutableDictionary* dict + local dict = nil + local i = 0 + local len = table.getn(objects) + for i = 0, len-1, 1 do + -- dict = tolua.cast(objects[i + 1], "cc.Dictionary") + + -- if dict == nil then + -- break + -- end + --------cclog("object: %x", dict) + end + return ret +end + +local function draw() + + local map = tolua.cast(getChildByTag(kTagTileMap), "cc.TMXTiledMap") + local group = map:getObjectGroup("Object Group 1") + + local objects = group:getObjects() + local dict = nil + local i = 0 + local len = table.getn(objects) + for i = 0, len-1, 1 do + dict = tolua.cast(objects[i + 1], "cc.Dictionary") + + if dict == nil then + break + end + + local key = "x" + local x = (tolua.cast(dict:objectForKey(key), "cc.String")):intValue()--dynamic_cast(dict:objectForKey("x")):getNumber() + key = "y" + local y = (tolua.cast(dict:objectForKey(key), "cc.String")):intValue()--dynamic_cast(dict:objectForKey("y")):getNumber() + key = "width" + local width = (tolua.cast(dict:objectForKey(key), "cc.String")):intValue()--dynamic_cast(dict:objectForKey("width")):getNumber() + key = "height" + local height = (tolua.cast(dict:objectForKey(key), "cc.String")):intValue()--dynamic_cast(dict:objectForKey("height")):getNumber() + + glLineWidth(3) + + cc.DrawPrimitives.drawLine( cc.p(x,y), cc.p(x+width,y) ) + cc.DrawPrimitives.drawLine( cc.p(x+width,y), cc.p(x+width,y+height) ) + cc.DrawPrimitives.drawLine( cc.p(x+width,y+height), cc.p(x,y+height) ) + cc.DrawPrimitives.drawLine( cc.p(x,y+height), cc.p(x,y) ) + + glLineWidth(1) + end +end + +-------------------------------------------------------------------- +-- +-- TMXResizeTest +-- +-------------------------------------------------------------------- + +local function TMXResizeTest() + local ret = createTileDemoLayer("TMX resize test", "Should not crash. Testing issue #740") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test5.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local layer = map:getLayer("Layer 0") + local ls = layer:getLayerSize() + local x = 0 + local y = 0 + for y = 0, ls.height-1, 1 do + for x = 0, ls.width-1, 1 do + layer:setTileGID(1, cc.p( x, y ) ) + end + end + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoZorder +-- +-------------------------------------------------------------------- +local function TMXIsoZorder() + local m_tamara = nil + local ret = createTileDemoLayer("TMX Iso Zorder", "Sprite should hide behind the trees") + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test-zorder.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + map:setPosition(cc.p(-s.width/2,0)) + + m_tamara = cc.Sprite:create(s_pPathSister1) + map:addChild(m_tamara, table.getn(map:getChildren())) + m_tamara:retain() + local mapWidth = map:getMapSize().width * map:getTileSize().width + m_tamara:setPosition(CC_POINT_PIXELS_TO_POINTS(cc.p( mapWidth/2,0))) + m_tamara:setAnchorPoint(cc.p(0.5,0)) + + local move = cc.MoveBy:create(10, cc.p(300,250)) + local back = move:reverse() + local seq = cc.Sequence:create(move, back) + m_tamara:runAction( cc.RepeatForever:create(seq) ) + + local function repositionSprite(dt) + local p = cc.p(m_tamara:getPosition()) + p = CC_POINT_POINTS_TO_PIXELS(p) + local map = ret:getChildByTag(kTagTileMap) + + -- there are only 4 layers. (grass and 3 trees layers) + -- if tamara < 48, z=4 + -- if tamara < 96, z=3 + -- if tamara < 144,z=2 + + local newZ = 4 - (p.y / 48) + newZ = math.max(newZ,0) + + map:reorderChild(m_tamara, newZ) + end + + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + schedulerEntry = scheduler:scheduleScriptFunc(repositionSprite, 0, false) + elseif event == "exit" then + if m_tamara ~= nil then + m_tamara:release() + end + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + ret:registerScriptHandler(onNodeEvent) + + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoZorder +-- +-------------------------------------------------------------------- +local function TMXOrthoZorder() + local m_tamara = nil + local ret = createTileDemoLayer("TMX Ortho Zorder", "Sprite should hide behind the trees") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test-zorder.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + m_tamara = cc.Sprite:create(s_pPathSister1) + map:addChild(m_tamara, table.getn(map:getChildren())) + m_tamara:retain() + m_tamara:setAnchorPoint(cc.p(0.5,0)) + + + local move = cc.MoveBy:create(10, cc.p(400,450)) + local back = move:reverse() + local seq = cc.Sequence:create(move, back) + m_tamara:runAction( cc.RepeatForever:create(seq)) + + local function repositionSprite(dt) + local p = cc.p(m_tamara:getPosition()) + p = CC_POINT_POINTS_TO_PIXELS(p) + local map = ret:getChildByTag(kTagTileMap) + + -- there are only 4 layers. (grass and 3 trees layers) + -- if tamara < 81, z=4 + -- if tamara < 162, z=3 + -- if tamara < 243,z=2 + + -- -10: customization for this particular sample + local newZ = 4 - ( (p.y-10) / 81) + newZ = math.max(newZ,0) + map:reorderChild(m_tamara, newZ) + end + + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + schedulerEntry = scheduler:scheduleScriptFunc(repositionSprite, 0, false) + elseif event == "exit" then + if m_tamara ~= nil then + m_tamara:release() + end + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + ret:registerScriptHandler(onNodeEvent) + + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoVertexZ +-- +-------------------------------------------------------------------- +local function TMXIsoVertexZ() + local m_tamara = nil + local ret = createTileDemoLayer("TMX Iso VertexZ", "Sprite should hide behind the trees") + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test-vertexz.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + map:setPosition( cc.p(-s.width/2,0) ) + cclog("ContentSize: %f, %f", s.width,s.height) + + -- because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you + -- can use any cc.Sprite and it will work OK. + local layer = map:getLayer("Trees") + m_tamara = layer:getTileAt( cc.p(29,29) ) + m_tamara:retain() + + local move = cc.MoveBy:create(10, cc.pMul( cc.p(300,250), 1/CC_CONTENT_SCALE_FACTOR() ) ) + local back = move:reverse() + local seq = cc.Sequence:create(move, back) + m_tamara:runAction( cc.RepeatForever:create(seq) ) + local function repositionSprite(dt) + + -- tile height is 64x32 + -- map size: 30x30 + local p = cc.p(m_tamara:getPosition()) + p = CC_POINT_POINTS_TO_PIXELS(p) + local newZ = -(p.y+32) /16 + m_tamara:setPositionZ( newZ ) + end + + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + -- TIP: 2d projection should be used + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION2_D ) + schedulerEntry = scheduler:scheduleScriptFunc(repositionSprite, 0, false) + elseif event == "exit" then + -- At exit use any other projection. + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION_DEFAULT ) + if m_tamara ~= nil then + m_tamara:release() + end + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + ret:registerScriptHandler(onNodeEvent) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoVertexZ +-- +-------------------------------------------------------------------- +local function TMXOrthoVertexZ() + local m_tamara = nil + local ret = createTileDemoLayer("TMX Ortho vertexZ", "Sprite should hide behind the trees") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test-vertexz.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + -- because I'm lazy, I'm reusing a tile as an sprite, but since this method uses vertexZ, you + -- can use any cc.Sprite and it will work OK. + local layer = map:getLayer("trees") + m_tamara = layer:getTileAt(cc.p(0,11)) + cclog("vertexZ:"..m_tamara:getPositionZ()) + m_tamara:retain() + + local move = cc.MoveBy:create(10, cc.pMul( cc.p(400,450), 1/CC_CONTENT_SCALE_FACTOR())) + local back = move:reverse() + local seq = cc.Sequence:create(move, back) + m_tamara:runAction( cc.RepeatForever:create(seq)) + + local function repositionSprite(dt) + -- tile height is 101x81 + -- map size: 12x12 + local p = cc.p(m_tamara:getPosition()) + p = CC_POINT_POINTS_TO_PIXELS(p) + m_tamara:setPositionZ( -( (p.y+81) /81) ) + end + + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + -- TIP: 2d projection should be used + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION2_D ) + schedulerEntry = scheduler:scheduleScriptFunc(repositionSprite, 0, false) + elseif event == "exit" then + -- At exit use any other projection. + cc.Director:getInstance():setProjection(cc.DIRECTOR_PROJECTION_DEFAULT ) + if m_tamara ~= nil then + m_tamara:release() + end + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + + ret:registerScriptHandler(onNodeEvent) + + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXIsoMoveLayer +-- +-------------------------------------------------------------------- +local function TMXIsoMoveLayer() + local ret = createTileDemoLayer("TMX Iso Move Layer", "Trees should be horizontally aligned") + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test-movelayer.tmx") + ret:addChild(map, 0, kTagTileMap) + + map:setPosition(cc.p(-700,-50)) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + return ret +end + + +-------------------------------------------------------------------- +-- +-- TMXOrthoMoveLayer +-- +-------------------------------------------------------------------- +local function TMXOrthoMoveLayer() + local ret = createTileDemoLayer("TMX Ortho Move Layer", "Trees should be horizontally aligned") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test-movelayer.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXTilePropertyTest +-- +-------------------------------------------------------------------- + +local function TMXTilePropertyTest() + local ret = createTileDemoLayer("TMX Tile Property Test", "In the console you should see tile properties") + local map = cc.TMXTiledMap:create("TileMaps/ortho-tile-property.tmx") + ret:addChild(map ,0 ,kTagTileMap) + local i = 0 + for i=1, 20, 1 do + cclog("GID:%i, Properties:", i)--, map:getPropertiesForGID(i)) + end + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoFlipTest +-- +-------------------------------------------------------------------- + +local function TMXOrthoFlipTest() + local ret = createTileDemoLayer("TMX tile flip test") + local map = cc.FastTMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local action = cc.ScaleBy:create(2, 0.5) + map:runAction(action) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoFlipRunTimeTest +-- +-------------------------------------------------------------------- + +local function TMXOrthoFlipRunTimeTest() + local ret = createTileDemoLayer("TMX tile flip run time test", "in 2 sec bottom left tiles will flip") + local map = cc.FastTMXTiledMap:create("TileMaps/ortho-rotation-test.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local action = cc.ScaleBy:create(2, 0.5) + map:runAction(action) + local function flipIt(dt) + + -- local map = tolua.cast(ret:getChildByTag(kTagTileMap), "TMXTiledMap") + -- local layer = map:getLayer("Layer 0") + + -- --blue diamond + -- local tileCoord = cc.p(1,10) + -- local flags = 0 + -- local GID = layer:getTileGIDAt(tileCoord, (ccTMXTileFlags*)&flags) + -- -- Vertical + -- if( flags & kcc.TMXTileVerticalFlag ) + -- flags &= ~kcc.TMXTileVerticalFlag + -- else + -- flags |= kcc.TMXTileVerticalFlag + -- layer:setTileGID(GID ,tileCoord, (ccTMXTileFlags)flags) + + + -- tileCoord = cc.p(1,8) + -- GID = layer:getTileGIDAt(tileCoord, (ccTMXTileFlags*)&flags) + -- -- Vertical + -- if( flags & kcc.TMXTileVerticalFlag ) + -- flags &= ~kcc.TMXTileVerticalFlag + -- else + -- flags |= kcc.TMXTileVerticalFlag + -- layer:setTileGID(GID ,tileCoord, (ccTMXTileFlags)flags) + + + -- tileCoord = cc.p(2,8) + -- GID = layer:getTileGIDAt(tileCoord, (ccTMXTileFlags*)&flags) + -- -- Horizontal + -- if( flags & kcc.TMXTileHorizontalFlag ) + -- flags &= ~kcc.TMXTileHorizontalFlag + -- else + -- flags |= kcc.TMXTileHorizontalFlag + -- layer:setTileGID(GID, tileCoord, (ccTMXTileFlags)flags) + end + local schedulerEntry = nil + local function onNodeEvent(event) + if event == "enter" then + schedulerEntry = scheduler:scheduleScriptFunc(flipIt, 1.0, false) + elseif event == "exit" then + scheduler:unscheduleScriptEntry(schedulerEntry) + end + end + return ret +end + + +-------------------------------------------------------------------- +-- +-- TMXOrthoFromXMLTest +-- +-------------------------------------------------------------------- + +local function TMXOrthoFromXMLTest() + local ret = createTileDemoLayer("TMX created from XML test") + local resources = "TileMaps" -- partial paths are OK as resource paths. + local file = resources.."/orthogonal-test1.tmx" + + local str = cc.FileUtils:getInstance():getStringFromFile(file) + -- cc.ASSERT(str != NULL, "Unable to open file") + if (str == nil) then + cclog("Unable to open file") + end + + local map = cc.FastTMXTiledMap:createWithXML(str ,resources) + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + local action = cc.ScaleBy:create(2, 0.5) + map:runAction(action) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXOrthoXMLFormatTest +-- +-------------------------------------------------------------------- + +local function TMXOrthoXMLFormatTest() + local ret = createTileDemoLayer("you should see blue, green and yellow in console.") + + local map = cc.FastTMXTiledMap:create("TileMaps/xml-test.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s = map:getContentSize() + cclog("ContentSize: %f, %f", s.width,s.height) + + for i = 24, 26 do + cclog("GID:%d, Properties:%s", i, map:getPropertiesForGID(i)["name"]) + end + + local action = cc.ScaleBy:create(2, 0.5) + map:runAction(action) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXBug987 +-- +-------------------------------------------------------------------- +local function TMXBug987() + local ret = createTileDemoLayer("TMX Bug 987", "You should see an square") + local map = cc.FastTMXTiledMap:create("TileMaps/orthogonal-test6.tmx") + ret:addChild(map, 0, kTagTileMap) + + local s1 = map:getContentSize() + cclog("ContentSize: %f, %f", s1.width,s1.height) + + map:setAnchorPoint(cc.p(0, 0)) + local layer = map:getLayer("Tile Layer 1") + layer:setTileGID(3, cc.p(2,2)) + return ret +end + +-------------------------------------------------------------------- +-- +-- TMXBug787 +-- +-------------------------------------------------------------------- +local function TMXBug787() + local ret = createTileDemoLayer("TMX Bug 787", "You should see a map") + local map = cc.FastTMXTiledMap:create("TileMaps/iso-test-bug787.tmx") + ret:addChild(map, 0, kTagTileMap) + map:setScale(0.25) + return ret +end + +function FastTiledMapTestMain() + cclog("FastTiledMapTestMain") + Helper.index = 1 + cc.Director:getInstance():setDepthTest(true) + local scene = cc.Scene:create() + + Helper.createFunctionTable = { + TMXIsoZorder, + TMXOrthoZorder, + TMXIsoVertexZ, + TMXOrthoVertexZ, + TMXOrthoTest, + TMXOrthoTest2, + TMXOrthoTest3, + TMXOrthoTest4, + TMXIsoTest, + TMXIsoTest1, + TMXIsoTest2, + TMXUncompressedTest, + -- TMXHexTest, + TMXReadWriteTest, + TMXTilesetTest, + TMXOrthoObjectsTest, + TMXIsoObjectsTest, + TMXResizeTest, + TMXIsoMoveLayer, + TMXOrthoMoveLayer, + TMXOrthoFlipTest, + TMXOrthoFlipRunTimeTest, + TMXOrthoFromXMLTest, + TMXOrthoXMLFormatTest, + -- TileMapTest, + -- TileMapEditTest, + TMXBug987, + TMXBug787, + -- TMXGIDObjectsTestNew, + } + scene:addChild(TMXIsoZorder()) + scene:addChild(CreateBackMenuItem()) + return scene +end diff --git a/tests/lua-tests/src/VideoPlayerTest/VideoPlayerTest.lua b/tests/lua-tests/src/VideoPlayerTest/VideoPlayerTest.lua new file mode 100644 index 0000000000..022745d079 --- /dev/null +++ b/tests/lua-tests/src/VideoPlayerTest/VideoPlayerTest.lua @@ -0,0 +1,148 @@ +require("experimentalConstants") + + +local visibleRect = cc.Director:getInstance():getOpenGLView():getVisibleRect() +local centerPos = cc.p(visibleRect.x + visibleRect.width / 2,visibleRect.y + visibleRect.height /2) + +local function VideoPlayerTest() + local layer = cc.Layer:create() --createTestLayer("VideoPlayerTest", "") + titleLabel = cc.Label:createWithTTF("VideoPlayerTest", s_arialPath, 28) + titleLabel:setAnchorPoint(cc.p(0.5, 0.5)) + layer:addChild(titleLabel, 1) + + cc.MenuItemFont:setFontSize(16) + + widget = ccs.GUIReader:getInstance():widgetFromJsonFile("cocosui/UITest/UITest.json") + layer:addChild(widget) + + local videoStateLabel = cc.Label:createWithSystemFont("IDLE","Arial",16) + videoStateLabel:setAnchorPoint(cc.p(1, 0.5)) + videoStateLabel:setPosition(cc.p(visibleRect.x + visibleRect.width - 10,visibleRect.y + 200)) + layer:addChild(videoStateLabel) + + local function onVideoEventCallback(sener, eventType) + if eventType == ccexprimental.VideoPlayerEvent.PLAYING then + videoStateLabel:setString("PLAYING") + elseif eventType == ccexprimental.VideoPlayerEvent.PAUSED then + videoStateLabel:setString("PAUSED") + elseif eventType == ccexprimental.VideoPlayerEvent.STOPPED then + videoStateLabel:setString("STOPPED") + elseif eventType == ccexprimental.VideoPlayerEvent.COMPLETED then + videoStateLabel:setString("COMPLETED") + end + end + local widgetSize = widget:getContentSize() + local videoPlayer = ccexprimental.VideoPlayer:create() + videoPlayer:setPosition(centerPos) + videoPlayer:setAnchorPoint(cc.p(0.5, 0.5)) + videoPlayer:setContentSize(cc.size(widgetSize.width * 0.4,widgetSize.height * 0.4)) + videoPlayer:addEventListener(onVideoEventCallback) + layer:addChild(videoPlayer) + + local screenSize = cc.Director:getInstance():getWinSize() + local rootSize = widget:getContentSize() + layer:setPosition(cc.p((screenSize.width - rootSize.width) / 2,(screenSize.height - rootSize.height) / 2)) + + local function menuFullScreenCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:setFullScreenEnabled(not videoPlayer:isFullScreenEnabled()) + end + end + local fullSwitch = cc.MenuItemFont:create("FullScreenSwitch") + fullSwitch:setAnchorPoint(cc.p(0.0, 0.0)) + fullSwitch:setPosition(cc.p(visibleRect.x + 10,visibleRect.y + 50)) + fullSwitch:registerScriptTapHandler(menuFullScreenCallback) + + local function menuPauseCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:pause() + end + end + local pauseItem = cc.MenuItemFont:create("Pause") + pauseItem:setAnchorPoint(cc.p(0.0, 0.0)) + pauseItem:setPosition(cc.p(visibleRect.x + 10,visibleRect.y + 100)) + pauseItem:registerScriptTapHandler(menuPauseCallback) + + local function menuResumeCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:resume() + end + end + local resumeItem = cc.MenuItemFont:create("Resume") + resumeItem:setAnchorPoint(cc.p(0.0, 0.0)) + resumeItem:setPosition(cc.p(visibleRect.x + 10,visibleRect.y + 150)) + resumeItem:registerScriptTapHandler(menuResumeCallback) + + local function menuStopCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:stop() + end + end + local stopItem = cc.MenuItemFont:create("Stop") + stopItem:setAnchorPoint(cc.p(0.0, 0.0)) + stopItem:setPosition(cc.p(visibleRect.x + 10,visibleRect.y + 200)) + stopItem:registerScriptTapHandler(menuStopCallback) + + local function menuHintCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:setVisible(not videoPlayer:isVisible()) + end + end + local hintItem = cc.MenuItemFont:create("Hint") + hintItem:setAnchorPoint(cc.p(0.0, 0.0)) + hintItem:setPosition(cc.p(visibleRect.x + 10,visibleRect.y + 250)) + hintItem:registerScriptTapHandler(menuHintCallback) + + ------------------------------------------------------------ + local function menuResourceVideoCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:setFileName("res/cocosvideo.mp4") + videoPlayer:play() + end + end + + local resourceVideo = cc.MenuItemFont:create("Play resource video") + resourceVideo:setAnchorPoint(cc.p(1, 0.5)) + resourceVideo:setPosition(cc.p(visibleRect.x + visibleRect.width - 10,visibleRect.y + 50)) + resourceVideo:registerScriptTapHandler(menuResourceVideoCallback) + + local function menuOnlineVideoCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:setURL("http://video001.smgbb.cn/gslb/program/FDN/FDN1190949/HLSVodService.m3u8?_mdCode=6065719&_cdnCode=B2B_XL_TEST&_type=0&_rCode=TerOut_18865&_userId=020341000456068&_categoryCode=SMG_HUAYU&_categoryPath=SMG_1002,SMG_HUAYU,&_adPositionId=01001000&_adCategorySource=0&_flag=.m3u8&_enCode=m3u8&taskID=ysh_ps_002-ott_1397459105893_020341000456068&_client=103&_cms=ctv&_CDNToken=76C043FD4969501754DC19E54EC8DC2C") + videoPlayer:play() + end + end + local onlineVideo = cc.MenuItemFont:create("Play online video") + onlineVideo:setAnchorPoint(cc.p(1, 0.5)) + onlineVideo:setPosition(cc.p(visibleRect.x + visibleRect.width - 10,visibleRect.y + 100)) + onlineVideo:registerScriptTapHandler(menuOnlineVideoCallback) + + local function menuRatioCallback(tag, sender) + if nil ~= videoPlayer then + videoPlayer:setKeepAspectRatioEnabled(not videoPlayer:isKeepAspectRatioEnabled()) + end + end + local ratioSwitch = cc.MenuItemFont:create("KeepRatioSwitch") + ratioSwitch:setAnchorPoint(cc.p(1, 0.5)) + ratioSwitch:setPosition(cc.p(visibleRect.x + visibleRect.width - 10,visibleRect.y + 150)) + ratioSwitch:registerScriptTapHandler(menuRatioCallback) + + local menu = cc.Menu:create(fullSwitch, pauseItem, resumeItem, stopItem, hintItem, resourceVideo, onlineVideo, ratioSwitch) + menu:setPosition(cc.p(0.0, 0.0)) + layer:addChild(menu) + + return layer +end + + + +function VideoPlayerTestMain() + Helper.index = 1 + local scene = cc.Scene:create() + Helper.createFunctionTable = { + VideoPlayerTest + } + scene:addChild(VideoPlayerTest()) + scene:addChild(CreateBackMenuItem()) + return scene +end \ No newline at end of file diff --git a/tests/lua-tests/src/controller.lua b/tests/lua-tests/src/controller.lua index 02aa9ca067..1e89841d68 100644 --- a/tests/lua-tests/src/controller.lua +++ b/tests/lua-tests/src/controller.lua @@ -6,25 +6,31 @@ collectgarbage("setstepmul", 5000) ---------------- -- run +local director = cc.Director:getInstance() +local glView = director:getOpenGLView() +if nil == glView then + glView = cc.GLView:createWithRect("Lua Tests", cc.rect(0,0,900,640)) + director:setOpenGLView(glView) +end -local glView = cc.Director:getInstance():getOpenGLView() +--turn on display FPS +director:setDisplayStats(true) + +--set FPS. the default value is 1.0/60 if you don't call this +director:setAnimationInterval(1.0 / 60) local screenSize = glView:getFrameSize() + local designSize = {width = 480, height = 320} -local fileUtils = cc.FileUtils:getInstance() - - -local targetPlatform = cc.Application:getInstance():getTargetPlatform() - -local dd = glView:getDesignResolutionSize() if screenSize.height > 320 then local resourceSize = {width = 960, height = 640} - local rate = resourceSize.height/screenSize.height - cc.Director:getInstance():setContentScaleFactor(resourceSize.height/designSize.height); + cc.Director:getInstance():setContentScaleFactor(resourceSize.height/designSize.height) end -glView:setDesignResolutionSize(designSize.width, designSize.height, 3); - + +glView:setDesignResolutionSize(designSize.width, designSize.height, cc.ResolutionPolicy.FIXED_HEIGHT) + +local fileUtils = cc.FileUtils:getInstance() local function addSearchPath(resPrefix, height) local searchPaths = fileUtils:getSearchPaths() table.insert(searchPaths, 1, resPrefix) diff --git a/tests/lua-tests/src/mainMenu.lua b/tests/lua-tests/src/mainMenu.lua index ce3f86c60c..7aea67ebbb 100644 --- a/tests/lua-tests/src/mainMenu.lua +++ b/tests/lua-tests/src/mainMenu.lua @@ -53,6 +53,9 @@ require "src/ZwoptexTest/ZwoptexTest" require "src/LuaBridgeTest/LuaBridgeTest" require "src/XMLHttpRequestTest/XMLHttpRequestTest" require "src/PhysicsTest/PhysicsTest" +require "src/CaptureScreenTest/CaptureScreenTest" +require "src/VideoPlayerTest/VideoPlayerTest" +require "src/FastTiledMapTest/FastTiledMapTest" local LINE_SPACE = 40 @@ -72,6 +75,7 @@ local _allTests = { { isSupported = false, name = "Box2dTestBed" , create_func= Box2dTestBedMain }, { isSupported = true, name = "BugsTest" , create_func= BugsTestMain }, { isSupported = true, name = "ByteCodeEncryptTest" , create_func= ByteCodeEncryptTestMain }, + { isSupported = true, name = "CaptureScreenTest" , create_func = CaptureScreenTestMain }, { isSupported = false, name = "ChipmunkAccelTouchTest" , create_func= ChipmunkAccelTouchTestMain }, { isSupported = true, name = "ClickAndMoveTest" , create_func = ClickAndMoveTest }, { isSupported = true, name = "CocosDenshionTest" , create_func = CocosDenshionTestMain }, @@ -82,6 +86,7 @@ local _allTests = { { isSupported = true, name = "EffectsTest" , create_func = EffectsTest }, { isSupported = true, name = "EffectAdvancedTest" , create_func = EffectAdvancedTestMain }, { isSupported = true, name = "ExtensionsTest" , create_func= ExtensionsTestMain }, + { isSupported = true, name = "FastTiledMapTest" , create_func = FastTiledMapTestMain}, { isSupported = true, name = "FontTest" , create_func = FontTestMain }, { isSupported = true, name = "IntervalTest" , create_func = IntervalTestMain }, { isSupported = true, name = "KeypadTest" , create_func= KeypadTestMain }, @@ -114,6 +119,7 @@ local _allTests = { { isSupported = true, name = "TouchesTest" , create_func = TouchesTest }, { isSupported = true, name = "TransitionsTest" , create_func = TransitionsTest }, { isSupported = true, name = "UserDefaultTest" , create_func= UserDefaultTestMain }, + { isSupported = true, name = "VideoPlayerTest" , create_func= VideoPlayerTestMain }, { isSupported = true, name = "XMLHttpRequestTest" , create_func = XMLHttpRequestTestMain }, { isSupported = true, name = "ZwoptexTest" , create_func = ZwoptexTestMain } } @@ -169,6 +175,13 @@ function CreateTestMenu() if not obj.isSupported then testMenuItem:setEnabled(false) end + + if obj.name == "VideoPlayerTest" then + if cc.PLATFORM_OS_IPHONE ~= targetPlatform and cc.PLATFORM_OS_ANDROID ~= targetPlatform then + testMenuItem:setEnabled(false) + end + end + testMenuItem:registerScriptTapHandler(menuCallback) testMenuItem:setPosition(cc.p(s.width / 2, (s.height - (index) * LINE_SPACE))) MainMenu:addChild(testMenuItem, index + 10000, index + 10000) diff --git a/tools/bindings-generator b/tools/bindings-generator index 0c16c3107b..132282d67a 160000 --- a/tools/bindings-generator +++ b/tools/bindings-generator @@ -1 +1 @@ -Subproject commit 0c16c3107b5c8b54e7414d7e984e21c3f242f33c +Subproject commit 132282d67aff8da7113f4a00596aac75e7b4528d diff --git a/tools/cocos2d-console b/tools/cocos2d-console index f0ff6e6eb0..ce3e25bcd2 160000 --- a/tools/cocos2d-console +++ b/tools/cocos2d-console @@ -1 +1 @@ -Subproject commit f0ff6e6eb0c28a1733f086e554bb4fadb91e1cfc +Subproject commit ce3e25bcd273eaacd516d179587997ce8f62df70 diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 81750a9172..7828472fc1 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAu # 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*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* .*TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component ProtectedNode Console Mesh GLProgramCache GLProgramState # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -35,7 +35,7 @@ classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* M # will apply to all class names. This is a convenience wildcard to be able to skip similar named # functions from all classes. -skip = Node::[setGLServerState description getUserObject .*UserData getGLServerState .*schedule getPosition$ setContentSize setAnchorPoint], +skip = Node::[setGLServerState description getUserObject .*UserData getGLServerState .*schedule getPosition$ setContentSize setAnchorPoint enumerateChildren], Sprite::[getQuad getBlendFunc ^setPosition$ setBlendFunc], SpriteBatchNode::[getBlendFunc setBlendFunc getDescendants], MotionStreak::[getBlendFunc setBlendFunc draw update], @@ -129,7 +129,10 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Mesh::[create], Sprite3D::[getSkin], Animation3D::[getBoneCurveByName], - Animation3DCache::[*] + Animation3DCache::[*], + Sprite3DMaterialCache::[*], + Bone3D::[*], + FastTMXLayer::[(g|s)etTiles getTileGIDAt] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], diff --git a/tools/tolua/cocos2dx_controller.ini b/tools/tolua/cocos2dx_controller.ini new file mode 100644 index 0000000000..d80733b677 --- /dev/null +++ b/tools/tolua/cocos2dx_controller.ini @@ -0,0 +1,61 @@ +[cocos2dx_controller] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_controller + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = cc + +macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +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/cocos -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/platform/android +cocos_flags = -DANDROID + +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/cocos/base/CCGameController.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*$". +classes = Controller EventController EventListenerController + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = Controller::[getAllController getKeyStatus] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/cocos2dx_experimental_video.ini b/tools/tolua/cocos2dx_experimental_video.ini new file mode 100644 index 0000000000..80bf9a254a --- /dev/null +++ b/tools/tolua/cocos2dx_experimental_video.ini @@ -0,0 +1,62 @@ +[cocos2dx_experimental_video] +# the prefix to be added to the generated functions. You might or might not use this in your own +# templates +prefix = cocos2dx_experimental_video + +# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`) +# all classes will be embedded in that namespace +target_namespace = ccexprimental + +macro_judgement = #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include +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/cocos -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/cocos/platform/android + +cocos_flags = -DANDROID + +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/cocos/ui/UIVideoPlayer.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*$". +classes = VideoPlayer + +# what should we skip? in the format ClassName::[function function] +# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also +# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just +# add a single "*" as functions. See bellow for several examples. A special class name is "*", which +# will apply to all class names. This is a convenience wildcard to be able to skip similar named +# functions from all classes. + +skip = VideoPlayer::[addEventListener] + +rename_functions = + +rename_classes = + +# for all class names, should we remove something when registering in the target VM? +remove_prefix = + +# classes for which there will be no "parent" lookup +classes_have_no_parents = + +# base classes which will be skipped when their sub-classes found them. +base_classes_to_skip = + +# classes that create no constructor +# Set is special and we will use a hand-written constructor +abstract_classes = + +# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. +script_control_cpp = no + diff --git a/tools/tolua/cocos2dx_physics.ini b/tools/tolua/cocos2dx_physics.ini index 6911e254cb..dca3e11f6f 100644 --- a/tools/tolua/cocos2dx_physics.ini +++ b/tools/tolua/cocos2dx_physics.ini @@ -7,6 +7,8 @@ prefix = cocos2dx_physics # all classes will be embedded in that namespace target_namespace = cc +macro_judgement = #if CC_USE_PHYSICS + android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include android_flags = -D_SIZE_T_DEFINED_ diff --git a/tools/tolua/genbindings.py b/tools/tolua/genbindings.py index 6e8b59c35d..1c72481ff5 100755 --- a/tools/tolua/genbindings.py +++ b/tools/tolua/genbindings.py @@ -132,6 +132,8 @@ def main(): 'cocos2dx_studio.ini' : ('cocos2dx_studio', 'lua_cocos2dx_studio_auto'), \ 'cocos2dx_spine.ini' : ('cocos2dx_spine', 'lua_cocos2dx_spine_auto'), \ 'cocos2dx_physics.ini' : ('cocos2dx_physics', 'lua_cocos2dx_physics_auto'), \ + 'cocos2dx_experimental_video.ini' : ('cocos2dx_experimental_video', 'lua_cocos2dx_experimental_video_auto'), \ + 'cocos2dx_controller.ini' : ('cocos2dx_controller', 'lua_cocos2dx_controller_auto'), \ } target = 'lua' generator_py = '%s/generator.py' % cxx_generator_root