├── .gitignore ├── CreatorNative.pdf ├── README.md ├── assets ├── Scene.meta ├── Scene │ ├── AudioRecorder.fire │ └── AudioRecorder.fire.meta ├── Script.meta ├── Script │ ├── AudioRecorder.js │ └── AudioRecorder.js.meta ├── Texture.meta └── Texture │ ├── HelloWorld.png │ ├── HelloWorld.png.meta │ ├── home_bg_big.jpg │ ├── home_bg_big.jpg.meta │ ├── singleColor.png │ └── singleColor.png.meta ├── build └── jsb-link │ ├── .cocos-package.json │ ├── .cocos-project.json │ ├── cocos-project-template.json │ ├── frameworks │ └── runtime-src │ │ ├── Classes │ │ ├── AppDelegate.cpp │ │ ├── AppDelegate.h │ │ ├── AudioRecorder.h │ │ ├── AudioRecorder.m │ │ ├── SDKManager.cpp │ │ ├── SDKManager.h │ │ ├── jsb_anysdk_basic_conversions.cpp │ │ ├── jsb_anysdk_basic_conversions.h │ │ ├── jsb_anysdk_protocols_auto.cpp │ │ ├── jsb_anysdk_protocols_auto.hpp │ │ ├── manualanysdkbindings.cpp │ │ └── manualanysdkbindings.hpp │ │ ├── proj.android-studio │ │ ├── .gitignore │ │ ├── app │ │ │ ├── .gitignore │ │ │ ├── AndroidManifest.xml │ │ │ ├── ReflectionSample.iml │ │ │ ├── build.gradle │ │ │ ├── build.xml │ │ │ ├── jni │ │ │ │ ├── Android.mk │ │ │ │ ├── Application.mk │ │ │ │ └── hellojavascript │ │ │ │ │ └── main.cpp │ │ │ ├── libs │ │ │ │ └── libPluginProtocol.jar │ │ │ ├── proguard-project.txt │ │ │ ├── proguard-rules.pro │ │ │ ├── project.properties │ │ │ ├── res │ │ │ │ ├── layout │ │ │ │ │ ├── plugin_ads.xml │ │ │ │ │ └── plugin_login.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap │ │ │ │ │ ├── plugin_btn_close.png │ │ │ │ │ └── plugin_ui_ad.png │ │ │ │ ├── values-en │ │ │ │ │ └── plugin_string.xml │ │ │ │ └── values │ │ │ │ │ ├── plugin_string.xml │ │ │ │ │ └── strings.xml │ │ │ └── src │ │ │ │ └── org │ │ │ │ └── cocos2dx │ │ │ │ └── javascript │ │ │ │ ├── AppActivity.java │ │ │ │ ├── PhotoTaker.java │ │ │ │ └── SDKWrapper.java │ │ ├── build-cfg.json │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── proj.android-studio.iml │ │ └── settings.gradle │ │ ├── proj.android │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ │ └── org.eclipse.jdt.core.prefs │ │ ├── AndroidManifest.xml │ │ ├── README.md │ │ ├── ant.properties │ │ ├── build-cfg.json │ │ ├── build.xml │ │ ├── build_native.py │ │ ├── jni │ │ │ ├── Android.mk │ │ │ ├── Application.mk │ │ │ └── hellojavascript │ │ │ │ └── main.cpp │ │ ├── libs │ │ │ ├── android-async-http-1.4.9.jar │ │ │ ├── com.android.vending.expansion.zipfile.jar │ │ │ ├── httpclient-4.4.1.1.jar │ │ │ └── libPluginProtocol.jar │ │ ├── proguard-project.txt │ │ ├── project.properties │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── icon.png │ │ │ ├── drawable │ │ │ │ ├── plugin_btn_close.png │ │ │ │ └── plugin_ui_ad.png │ │ │ ├── layout │ │ │ │ ├── plugin_ads.xml │ │ │ │ └── plugin_login.xml │ │ │ ├── values-en │ │ │ │ └── plugin_string.xml │ │ │ └── values │ │ │ │ ├── plugin_string.xml │ │ │ │ └── strings.xml │ │ └── src │ │ │ └── org │ │ │ └── cocos2dx │ │ │ ├── javascript │ │ │ ├── AppActivity.java │ │ │ └── SDKWrapper.java │ │ │ └── lib │ │ │ ├── Cocos2dxAccelerometer.java │ │ │ ├── Cocos2dxActivity.java │ │ │ ├── Cocos2dxBitmap.java │ │ │ ├── Cocos2dxDownloader.java │ │ │ ├── Cocos2dxEditBox.java │ │ │ ├── Cocos2dxEditBoxHelper.java │ │ │ ├── Cocos2dxGLSurfaceView.java │ │ │ ├── Cocos2dxHandler.java │ │ │ ├── Cocos2dxHelper.java │ │ │ ├── Cocos2dxHttpURLConnection.java │ │ │ ├── Cocos2dxJavascriptJavaBridge.java │ │ │ ├── Cocos2dxLocalStorage.java │ │ │ ├── Cocos2dxMusic.java │ │ │ ├── Cocos2dxReflectionHelper.java │ │ │ ├── Cocos2dxRenderer.java │ │ │ ├── Cocos2dxSound.java │ │ │ ├── Cocos2dxTextInputWrapper.java │ │ │ ├── Cocos2dxTypefaces.java │ │ │ ├── Cocos2dxVideoHelper.java │ │ │ ├── Cocos2dxVideoView.java │ │ │ ├── Cocos2dxWebView.java │ │ │ ├── Cocos2dxWebViewHelper.java │ │ │ ├── GameControllerAdapter.java │ │ │ ├── GameControllerDelegate.java │ │ │ ├── GameControllerUtils.java │ │ │ └── ResizeLayout.java │ │ ├── proj.ios_mac │ │ ├── ReflectionSample.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ ├── xcshareddata │ │ │ │ │ └── ReflectionSample.xcscmblueprint │ │ │ │ └── xcuserdata │ │ │ │ │ └── panda.xcuserdatad │ │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── xcuserdata │ │ │ │ └── panda.xcuserdatad │ │ │ │ ├── xcdebugger │ │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ │ └── xcschemes │ │ │ │ ├── ReflectionSample-desktop.xcscheme │ │ │ │ ├── ReflectionSample-mobile.xcscheme │ │ │ │ └── xcschememanagement.plist │ │ ├── ios │ │ │ ├── AppController.h │ │ │ ├── AppController.mm │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default.png │ │ │ ├── Default@2x.png │ │ │ ├── Icon-100.png │ │ │ ├── Icon-114.png │ │ │ ├── Icon-120.png │ │ │ ├── Icon-144.png │ │ │ ├── Icon-152.png │ │ │ ├── Icon-29.png │ │ │ ├── Icon-40.png │ │ │ ├── Icon-50.png │ │ │ ├── Icon-57.png │ │ │ ├── Icon-58.png │ │ │ ├── Icon-72.png │ │ │ ├── Icon-76.png │ │ │ ├── Icon-80.png │ │ │ ├── Info.plist │ │ │ ├── Prefix.pch │ │ │ ├── RootViewController.h │ │ │ ├── RootViewController.mm │ │ │ └── main.m │ │ └── mac │ │ │ ├── Icon.icns │ │ │ ├── Info.plist │ │ │ ├── Prefix.pch │ │ │ └── main.cpp │ │ └── proj.win32 │ │ ├── ReflectionSample.vcxproj │ │ ├── ReflectionSample.vcxproj.filters │ │ ├── ReflectionSample.vcxproj.user │ │ ├── build-cfg.json │ │ ├── game.rc │ │ ├── main.cpp │ │ ├── main.h │ │ ├── res │ │ └── game.ico │ │ └── resource.h │ ├── main.js │ ├── project.json │ ├── res │ ├── import │ │ ├── 11 │ │ │ └── 11e2b048-2149-47ad-b174-88d377deddbb.json │ │ ├── 29 │ │ │ └── 29158224-f8dd-4661-a796-1ffab537140e.json │ │ ├── 31 │ │ │ └── 31bc895a-c003-4566-a9f3-2e54ae1c17dc.json │ │ ├── 41 │ │ │ └── 410fb916-8721-4663-bab8-34397391ace7.json │ │ ├── 2d │ │ │ └── 2d2f792f-a40c-49bb-a189-ed176a246e49.json │ │ ├── 8c │ │ │ └── 8cdb44ac-a3f6-449f-b354-7cd48cf84061.json │ │ ├── d0 │ │ │ └── d0c8122a-8540-48c5-bd24-6d93357100fd.json │ │ ├── e9 │ │ │ └── e9ec654c-97a2-4787-9325-e6a10375219a.json │ │ └── f0 │ │ │ └── f0048c10-f03e-4c97-b9d3-3506e1d58952.json │ ├── raw-assets │ │ └── Texture │ │ │ ├── HelloWorld.png │ │ │ ├── home_bg_big.jpg │ │ │ └── singleColor.png │ └── raw-internal │ │ └── image │ │ ├── default_btn_disabled.png │ │ ├── default_btn_normal.png │ │ ├── default_btn_pressed.png │ │ └── default_sprite.png │ └── src │ ├── jsb_anysdk.js │ ├── jsb_anysdk_constants.js │ ├── jsb_polyfill.js │ ├── project.dev.js │ └── settings.js ├── creator.d.ts ├── jsconfig.json ├── project.json ├── settings ├── builder.json ├── builder.panel.json └── project.json ├── template-banner.png └── template.json /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | 9 | #///////////////////////////////////////////////////////////////////////////// 10 | # Logs and databases 11 | #///////////////////////////////////////////////////////////////////////////// 12 | 13 | *.log 14 | *.sql 15 | *.sqlite 16 | 17 | #///////////////////////////////////////////////////////////////////////////// 18 | # files for debugger 19 | #///////////////////////////////////////////////////////////////////////////// 20 | 21 | *.sln 22 | *.csproj 23 | *.pidb 24 | *.unityproj 25 | *.suo 26 | 27 | #///////////////////////////////////////////////////////////////////////////// 28 | # OS generated files 29 | #///////////////////////////////////////////////////////////////////////////// 30 | 31 | .DS_Store 32 | ehthumbs.db 33 | Thumbs.db 34 | 35 | #///////////////////////////////////////////////////////////////////////////// 36 | # exvim files 37 | #///////////////////////////////////////////////////////////////////////////// 38 | 39 | *UnityVS.meta 40 | *.err 41 | *.err.meta 42 | *.exvim 43 | *.exvim.meta 44 | *.vimentry 45 | *.vimentry.meta 46 | *.vimproject 47 | *.vimproject.meta 48 | .vimfiles.*/ 49 | .exvim.*/ 50 | quick_gen_project_*_autogen.bat 51 | quick_gen_project_*_autogen.bat.meta 52 | quick_gen_project_*_autogen.sh 53 | quick_gen_project_*_autogen.sh.meta 54 | .exvim.app 55 | 56 | #///////////////////////////////////////////////////////////////////////////// 57 | # webstorm files 58 | #///////////////////////////////////////////////////////////////////////////// 59 | 60 | .idea/ 61 | *.xcuserstate 62 | 63 | 64 | # Ignore files build by ndk and eclipse 65 | libs/ 66 | bin/ 67 | obj/ 68 | gen/ 69 | assets/ 70 | local.properties 71 | 72 | # Ignore files build by xcode 73 | *.mode*v* 74 | *.pbxuser 75 | *.xcbkptlist 76 | *.xcworkspacedata 77 | *.xcuserstate 78 | *.xccheckout 79 | xcschememanagement.plist 80 | .DS_Store 81 | ._.* 82 | xcuserdata/ 83 | DerivedData/ 84 | -------------------------------------------------------------------------------- /CreatorNative.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/CreatorNative.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hello-world 2 | Hello world new project template. 3 | -------------------------------------------------------------------------------- /assets/Scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Scene/AudioRecorder.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Script/AudioRecorder.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | recordLabel: cc.Label 6 | }, 7 | 8 | onLoad: function () { 9 | if (cc.sys.isNative && cc.sys.OS === cc.sys.OS_IOS) { 10 | jsb.reflection.callStaticMethod('AudioRecorder', 'initRecorder'); 11 | } 12 | }, 13 | 14 | play: function () { 15 | if (cc.sys.isNative && cc.sys.OS === cc.sys.OS_IOS) { 16 | jsb.reflection.callStaticMethod('AudioRecorder', 'playLatest'); 17 | } 18 | }, 19 | 20 | record: function () { 21 | if (cc.sys.isNative && cc.sys.OS === cc.sys.OS_IOS) { 22 | jsb.reflection.callStaticMethod('AudioRecorder', 'record'); 23 | if (jsb.reflection.callStaticMethod('AudioRecorder', 'isRecording')) { 24 | this.recordLabel.string = 'Stop'; 25 | } 26 | else { 27 | this.recordLabel.string = 'Record'; 28 | } 29 | } 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /assets/Script/AudioRecorder.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.2", 3 | "uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a", 4 | "isPlugin": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Texture.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/Texture/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/assets/Texture/HelloWorld.png -------------------------------------------------------------------------------- /assets/Texture/HelloWorld.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "HelloWorld": { 9 | "ver": "1.0.3", 10 | "uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc", 11 | "rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 195, 20 | "height": 270, 21 | "rawWidth": 195, 22 | "rawHeight": 270, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/home_bg_big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/assets/Texture/home_bg_big.jpg -------------------------------------------------------------------------------- /assets/Texture/home_bg_big.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "5d5dab5f-4ad0-47d9-81f7-315d1cd135d8", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "home_bg_big": { 9 | "ver": "1.0.3", 10 | "uuid": "d0c8122a-8540-48c5-bd24-6d93357100fd", 11 | "rawTextureUuid": "5d5dab5f-4ad0-47d9-81f7-315d1cd135d8", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 1136, 20 | "height": 768, 21 | "rawWidth": 1136, 22 | "rawHeight": 768, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /assets/Texture/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/assets/Texture/singleColor.png -------------------------------------------------------------------------------- /assets/Texture/singleColor.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "singleColor": { 9 | "ver": "1.0.3", 10 | "uuid": "410fb916-8721-4663-bab8-34397391ace7", 11 | "rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 2, 20 | "height": 2, 21 | "rawWidth": 2, 22 | "rawHeight": 2, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /build/jsb-link/.cocos-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "anysdk": { 3 | "args": { 4 | "noupdate": 0, 5 | "staging": 1, 6 | "verbose": 1, 7 | "plugin": "~/.cocos/package/plugins/cocospackage-multi_anysdk/", 8 | "skip_patch": 0, 9 | "area": "cn", 10 | "server": "download.anysdk.com/cocospackage/v1/", 11 | "project": "./", 12 | "platform": "android", 13 | "command": "import", 14 | "mode": "debug", 15 | "installer": "~/cocos2d-x-3.10/tools/cocos2d-console/plugins/plugin_package/cocospackage.py", 16 | "config": "config.json" 17 | }, 18 | "name": "cocospackage-multi_anysdk", 19 | "constants": { 20 | "ANDROID_STUDIO_JNI_DIR": "frameworks/runtime-src/proj.android-studio/app/jni/", 21 | "suffix": "JsTutorial", 22 | "COCOS_BACKUP_DIR": "cocospackage-backup-2016-07-11-18-29-08/", 23 | "COCOS_PROJECT_DIR": "./", 24 | "COCOS_2DX_INSTALLATION_VERSION": "3.10.0", 25 | "PLUGIN_PATCH_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/patchs/", 26 | "android_js_sources": [ 27 | "../../Classes/jsb_anysdk_basic_conversions.cpp", 28 | "../../Classes/manualanysdkbindings.cpp", 29 | "../../Classes/jsb_anysdk_protocols_auto.cpp" 30 | ], 31 | "ANDROID_STUDIO_PROJECT_DIR": "frameworks/runtime-src/proj.android-studio/", 32 | "ANDROID_COCOS_PACKAGE_ROOT": "frameworks/cocos2d-x/cocos/platform/android/java/", 33 | "PLUGIN_LUA_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/luabindings/", 34 | "ios_sources": [ 35 | "SDKManager.cpp", 36 | "SDKManager.cpp" 37 | ], 38 | "PLUGIN_JS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/jsbindings/", 39 | "ANDROID_STUDIO_ACTIVITY_NAME": "AppActivity", 40 | "ios_js_sources": [ 41 | "jsb_anysdk_basic_conversions.cpp", 42 | "manualanysdkbindings.cpp", 43 | "jsb_anysdk_protocols_auto.cpp" 44 | ], 45 | "COCOS_PROJECT_HINT": "frameworks/runtime-src/", 46 | "ANDROID_STUDIO_PROPERTIES": "frameworks/runtime-src/proj.android-studio/app/build.gradle", 47 | "COCOS_ENGINE_TYPE": "unknown", 48 | "ANDROID_PROJECT_DIR": "frameworks/runtime-src/proj.android/", 49 | "ANDROID_COCOS_SRC_DIR": "frameworks/cocos2d-x/cocos/platform/android/java/src/org/cocos2dx/lib/", 50 | "COCOS_CLASSES_DIR": "frameworks/runtime-src/Classes/", 51 | "XCODE_PROJECT": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj", 52 | "COCOSPACKAGE_DIR": "~/.cocos/package/", 53 | "ANDROID_STUDIO_ACTIVITY_PATH": "frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/", 54 | "ANDROID_SDK_DIR": "~/sdk/", 55 | "COCOS_2DX_ROOT": "~/cocos2d-x-3.10/", 56 | "PLUGIN_ROOT": "~/.cocos/package/plugins/cocospackage-multi_anysdk/", 57 | "COCOSPACKAGE_PUGIN_NAME": "~/.cocos/package/plugins/cocospackage-multi_anysdk/", 58 | "ANDROID_MANIFEST": "frameworks/runtime-src/proj.android/AndroidManifest.xml", 59 | "ANDROID_STUDIO_MANIFEST": "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml", 60 | "ANDROID_JNI_DIR": "frameworks/runtime-src/proj.android/jni/", 61 | "ANDROID_ACTIVITY_NAME": "AppActivity", 62 | "IOS_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/", 63 | "XCODE_PROJECT_CXX_LIBRARY": "libc++", 64 | "ANDROID_STUDIO_MK": "frameworks/runtime-src/proj.android-studio/app/jni/Android.mk", 65 | "PLUGIN_ANDROID_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/android/", 66 | "XCODE_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/", 67 | "COCOS_PACKAGE_DIR": "~/cocos2d-x-lite/external/package/", 68 | "url": "http://docs.anysdk.com/JsTutorial", 69 | "COCOS_PROJECT_TYPE": "js", 70 | "COCOS_2DX_VERSION": "3.10.0", 71 | "ANDROID_PROPERTIES": "frameworks/runtime-src/proj.android/project.properties", 72 | "PLUGIN_IOS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/ios/", 73 | "ANDROID_ACTIVITY_PATH": "frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/", 74 | "android_sources": [ 75 | "../../Classes/SDKManager.cpp", 76 | "../../Classes/SDKManager.cpp" 77 | ], 78 | "ANDROID_MK": "frameworks/runtime-src/proj.android/jni/Android.mk", 79 | "ANDROID_STUDIO_LIBS_DIR": "frameworks/cocos2d-x/cocos/platform/android/libcocos2dx/libs/", 80 | "ANDROID_LIBS_DIR": "frameworks/cocos2d-x/cocos/platform/android/java/libs/", 81 | "COCOS_RESOURCES_DIR": "res/" 82 | }, 83 | "versions": { 84 | "mini_cocospackage_version": "0.8.0", 85 | "code": "1001", 86 | "show_version": "2.0.1_2.2.1", 87 | "update_content": "2016\u5e747\u670810\u66f4\u65b0 \n 1\u3001\u6846\u67b6\u652f\u6301cocos2d-x-3.9.1 \u5f15\u64ce \n 2\u3001patchs \u6587\u4ef6\u652f\u6301cocos2d-x-3.12" 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /build/jsb-link/.cocos-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine_version": "cocos2d-x-3.13-lite", 3 | "has_native": true, 4 | "project_type": "js", 5 | "projectName": "ReflectionSample", 6 | "packageName": "org.cocos2d.ReflectionSample" 7 | } -------------------------------------------------------------------------------- /build/jsb-link/cocos-project-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "do_default":{ 3 | "exclude_from_template":[ 4 | "frameworks/runtime-src" 5 | ], 6 | "append_dir":[ 7 | { 8 | "from":"extensions/anysdk/", 9 | "to":"", 10 | "include": [ 11 | ".cocos-package.json" 12 | ] 13 | }, 14 | { 15 | "from":"extensions/anysdk/js-bindings/", 16 | "to":"frameworks/runtime-src/Classes", 17 | "include": [ 18 | "*.h", 19 | "*.cpp", 20 | "*.hpp" 21 | ] 22 | } 23 | ] 24 | }, 25 | "do_add_native_support":{ 26 | "append_from_template":{ 27 | "from":"frameworks/runtime-src", 28 | "to":"frameworks/runtime-src", 29 | "exclude":[ 30 | "proj.android/bin", 31 | "proj.android/assets", 32 | "proj.ios_mac/HelloJavascript.xcodeproj/project.xcworkspace", 33 | "proj.ios_mac/HelloJavascript.xcodeproj/xcuserdata", 34 | "proj.win32/Debug.win32", 35 | "proj.win32/Release.win32", 36 | "proj.win32/HelloJavascript.sdf" 37 | ] 38 | }, 39 | "append_dir":[ 40 | { 41 | "from":"cocos/platform/android/java/src", 42 | "to":"frameworks/runtime-src/proj.android/src", 43 | "include": [ 44 | "*.java" 45 | ] 46 | }, 47 | { 48 | "from":"cocos/platform/android/java/libs", 49 | "to":"frameworks/runtime-src/proj.android/libs", 50 | "include": [ 51 | "*.jar" 52 | ] 53 | }, 54 | { 55 | "from":"extensions/anysdk/platform/android", 56 | "to":"frameworks/runtime-src/proj.android", 57 | "exclude": [ 58 | "res/mipmap", 59 | "res/mipmap-layout/" 60 | ] 61 | }, 62 | { 63 | "from":"extensions/anysdk/platform/android", 64 | "to":"frameworks/runtime-src/proj.android-studio/app", 65 | "exclude": [ 66 | "res/drawable", 67 | "res/mipmap-layout/" 68 | ] 69 | }, 70 | { 71 | "from":"extensions/anysdk/platform/android/res/mipmap-layout/", 72 | "to":"frameworks/runtime-src/proj.android-studio/app/res/layout", 73 | "include": [ 74 | "*" 75 | ] 76 | } 77 | ], 78 | "project_rename":{ 79 | "src_project_name":"HelloJavascript", 80 | "files":[ 81 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", 82 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", 83 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", 84 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", 85 | "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj" 86 | ] 87 | }, 88 | "project_replace_project_name":{ 89 | "src_project_name":"HelloJavascript", 90 | "files":[ 91 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj", 92 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.filters", 93 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.vcxproj.user", 94 | "frameworks/runtime-src/proj.win32/PROJECT_NAME.sln", 95 | "frameworks/runtime-src/proj.win32/main.cpp", 96 | "frameworks/runtime-src/proj.android/.project", 97 | "frameworks/runtime-src/proj.android/AndroidManifest.xml", 98 | "frameworks/runtime-src/proj.android/build.xml", 99 | "frameworks/runtime-src/proj.android/res/values/strings.xml", 100 | "frameworks/runtime-src/proj.android-studio/settings.gradle", 101 | "frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml", 102 | "frameworks/runtime-src/proj.ios_mac/ios/main.m", 103 | "frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch", 104 | "frameworks/runtime-src/proj.ios_mac/PROJECT_NAME.xcodeproj/project.pbxproj", 105 | "frameworks/runtime-src/Classes/AppDelegate.cpp" 106 | ] 107 | }, 108 | "project_replace_package_name":{ 109 | "src_package_name":"org.cocos2dx.hellojavascript", 110 | "files":[ 111 | "frameworks/runtime-src/proj.android/AndroidManifest.xml", 112 | "frameworks/runtime-src/proj.android-studio/app/build.gradle", 113 | "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml" 114 | ] 115 | }, 116 | "project_replace_mac_bundleid":{ 117 | "src_bundle_id":"org.cocos2dx.hellojavascript", 118 | "files":[ 119 | "frameworks/runtime-src/proj.ios_mac/mac/Info.plist" 120 | ] 121 | }, 122 | "project_replace_ios_bundleid":{ 123 | "src_bundle_id":"org.cocos2dx.hellojavascript", 124 | "files":[ 125 | "frameworks/runtime-src/proj.ios_mac/ios/Info.plist" 126 | ] 127 | } 128 | } 129 | } 130 | 131 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | 3 | #include "platform/CCGLView.h" 4 | 5 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) 6 | #include "platform/ios/CCGLViewImpl-ios.h" 7 | #endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS 8 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) 9 | #include "platform/android/CCGLViewImpl-android.h" 10 | #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID 11 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) 12 | #include "platform/desktop/CCGLViewImpl-desktop.h" 13 | #endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 14 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) 15 | #include "platform/desktop/CCGLViewImpl-desktop.h" 16 | #endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC 17 | 18 | #include "base/CCDirector.h" 19 | #include "base/CCEventDispatcher.h" 20 | #include "SimpleAudioEngine.h" 21 | 22 | #include "js_module_register.h" 23 | 24 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS 25 | #include "SDKManager.h" 26 | #include "jsb_anysdk_protocols_auto.hpp" 27 | #include "manualanysdkbindings.hpp" 28 | using namespace anysdk::framework; 29 | #endif 30 | 31 | USING_NS_CC; 32 | using namespace CocosDenshion; 33 | 34 | AppDelegate::AppDelegate() 35 | { 36 | } 37 | 38 | AppDelegate::~AppDelegate() 39 | { 40 | ScriptEngineManager::destroyInstance(); 41 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS 42 | SDKManager::getInstance()->purge(); 43 | #endif 44 | } 45 | 46 | void AppDelegate::initGLContextAttrs() 47 | { 48 | GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; 49 | 50 | GLView::setGLContextAttrs(glContextAttrs); 51 | } 52 | 53 | bool AppDelegate::applicationDidFinishLaunching() 54 | { 55 | #if CC_TARGET_PLATFORM == CC_PLATFORM_IOS && PACKAGE_AS 56 | SDKManager::getInstance()->loadAllPlugins(); 57 | #endif 58 | // initialize director 59 | auto director = Director::getInstance(); 60 | auto glview = director->getOpenGLView(); 61 | if(!glview) { 62 | #if(CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) 63 | glview = GLViewImpl::create("ReflectionSample"); 64 | #else 65 | glview = GLViewImpl::createWithRect("ReflectionSample", Rect(0,0,900,640)); 66 | #endif 67 | director->setOpenGLView(glview); 68 | } 69 | 70 | // set FPS. the default value is 1.0/60 if you don't call this 71 | director->setAnimationInterval(1.0 / 60); 72 | 73 | js_module_register(); 74 | 75 | ScriptingCore* sc = ScriptingCore::getInstance(); 76 | #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) && PACKAGE_AS 77 | sc->addRegisterCallback(register_all_anysdk_framework); 78 | sc->addRegisterCallback(register_all_anysdk_manual); 79 | #endif 80 | sc->start(); 81 | sc->runScript("script/jsb_boot.js"); 82 | #if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0) 83 | sc->enableDebugger(); 84 | #endif 85 | ScriptEngineManager::getInstance()->setScriptEngine(sc); 86 | ScriptingCore::getInstance()->runScript("main.js"); 87 | 88 | return true; 89 | } 90 | 91 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 92 | void AppDelegate::applicationDidEnterBackground() 93 | { 94 | auto director = Director::getInstance(); 95 | director->stopAnimation(); 96 | director->getEventDispatcher()->dispatchCustomEvent("game_on_hide"); 97 | SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); 98 | SimpleAudioEngine::getInstance()->pauseAllEffects(); 99 | } 100 | 101 | // this function will be called when the app is active again 102 | void AppDelegate::applicationWillEnterForeground() 103 | { 104 | auto director = Director::getInstance(); 105 | director->startAnimation(); 106 | director->getEventDispatcher()->dispatchCustomEvent("game_on_show"); 107 | SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); 108 | SimpleAudioEngine::getInstance()->resumeAllEffects(); 109 | } 110 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GCTestAppDelegate.h 3 | // GCTest 4 | // 5 | // Created by Rohan Kuruvilla on 06/08/2012. 6 | // Copyright __MyCompanyName__ 2012. All rights reserved. 7 | // 8 | 9 | #ifndef _APP_DELEGATE_H_ 10 | #define _APP_DELEGATE_H_ 11 | 12 | #include "platform/CCApplication.h" 13 | /** 14 | @brief The cocos2d Application. 15 | 16 | The reason for implement as private inheritance is to hide some interface call by Director. 17 | */ 18 | class AppDelegate : private cocos2d::Application 19 | { 20 | public: 21 | AppDelegate(); 22 | virtual ~AppDelegate(); 23 | 24 | void initGLContextAttrs() override; 25 | 26 | /** 27 | @brief Implement Director and Scene init code here. 28 | @return true Initialize success, app continue. 29 | @return false Initialize failed, app terminate. 30 | */ 31 | virtual bool applicationDidFinishLaunching(); 32 | 33 | /** 34 | @brief The function be called when the application enter background 35 | @param the pointer of the application 36 | */ 37 | virtual void applicationDidEnterBackground(); 38 | 39 | /** 40 | @brief The function be called when the application enter foreground 41 | @param the pointer of the application 42 | */ 43 | virtual void applicationWillEnterForeground(); 44 | }; 45 | 46 | #endif // _APP_DELEGATE_H_ 47 | 48 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/AudioRecorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // AudioRecorder.h 3 | // ReflectionSample 4 | // 5 | // Created by panda on 9/26/16. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AudioRecorder : NSObject 13 | 14 | + (void) initRecorder; 15 | + (BOOL) isRecording; 16 | + (void) record; 17 | + (void) playLatest; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/AudioRecorder.m: -------------------------------------------------------------------------------- 1 | // 2 | // AudioRecorder.m 3 | // ReflectionSample 4 | // 5 | // Created by panda on 9/26/16. 6 | // 7 | // 8 | 9 | #import "AudioRecorder.h" 10 | 11 | static bool inited = false; 12 | static AVAudioRecorder *recorder; 13 | static AVAudioPlayer *player; 14 | static AudioRecorder *instance; 15 | 16 | @implementation AudioRecorder 17 | 18 | + (void)initRecorder 19 | { 20 | if (inited) { 21 | return; 22 | } 23 | 24 | instance = [[AudioRecorder alloc] init]; 25 | 26 | // Set the audio file 27 | NSArray *pathComponents = [NSArray arrayWithObjects: 28 | [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], 29 | @"MyAudioMemo.m4a", 30 | nil]; 31 | NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents]; 32 | 33 | // Setup audio session 34 | AVAudioSession *session = [AVAudioSession sharedInstance]; 35 | [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; 36 | 37 | // Define the recorder setting 38 | NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; 39 | 40 | [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey]; 41 | [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; 42 | [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; 43 | 44 | // Initiate and prepare the recorder 45 | recorder = [[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:nil]; 46 | recorder.delegate = instance; 47 | recorder.meteringEnabled = YES; 48 | [recorder prepareToRecord]; 49 | } 50 | 51 | + (void)record 52 | { 53 | // Stop the audio player before recording 54 | if (player.playing) 55 | { 56 | [player stop]; 57 | } 58 | 59 | if (!recorder.recording) 60 | { 61 | AVAudioSession *session = [AVAudioSession sharedInstance]; 62 | [session setActive:YES error:nil]; 63 | 64 | // Start recording 65 | [recorder record]; 66 | } else 67 | { 68 | // Stop recording 69 | [recorder stop]; 70 | 71 | AVAudioSession *session = [AVAudioSession sharedInstance]; 72 | [session setActive:NO error:nil]; 73 | } 74 | } 75 | 76 | + (BOOL) isRecording { 77 | return recorder.recording; 78 | } 79 | 80 | + (void)playLatest 81 | { 82 | if (recorder.recording){ 83 | // Stop recording 84 | [recorder stop]; 85 | AVAudioSession *session = [AVAudioSession sharedInstance]; 86 | [session setActive:NO error:nil]; 87 | } 88 | 89 | player = [[AVAudioPlayer alloc] initWithContentsOfURL:recorder.url error:nil]; 90 | [player setDelegate:instance]; 91 | [player play]; 92 | } 93 | 94 | #pragma mark - AVAudioRecorderDelegate 95 | 96 | - (void) audioRecorderDidFinishRecording:(AVAudioRecorder *)avrecorder successfully:(BOOL)flag{ 97 | 98 | } 99 | 100 | #pragma mark - AVAudioPlayerDelegate 101 | 102 | - (void) audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{ 103 | UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Done" 104 | message: @"Finish playing the recording!" 105 | delegate: nil 106 | cancelButtonTitle:@"OK" 107 | otherButtonTitles:nil]; 108 | [alert show]; 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/SDKManager.cpp: -------------------------------------------------------------------------------- 1 | #include "SDKManager.h" 2 | 3 | using namespace anysdk::framework; 4 | 5 | SDKManager* SDKManager::_pInstance = NULL; 6 | 7 | SDKManager::SDKManager() 8 | { 9 | } 10 | 11 | SDKManager::~SDKManager() 12 | { 13 | _pAgent->unloadAllPlugins(); 14 | } 15 | 16 | SDKManager* SDKManager::getInstance() 17 | { 18 | if (_pInstance == NULL) { 19 | _pInstance = new SDKManager(); 20 | } 21 | return _pInstance; 22 | } 23 | 24 | void SDKManager::purge() 25 | { 26 | if (_pInstance) 27 | { 28 | delete _pInstance; 29 | _pInstance = NULL; 30 | } 31 | } 32 | 33 | void SDKManager::loadAllPlugins() 34 | { 35 | /** 36 | * appKey, appSecret and privateKey are the only three parameters generated 37 | * after the packing tool client finishes creating the game. 38 | * The oauthLoginServer parameter is the API address provided by the game service 39 | * to login verification 40 | */ 41 | std::string oauthLoginServer = "OAUTH_LOGIN_SERVER"; 42 | std::string appKey = "APP_KEY"; 43 | std::string appSecret = "APP_SERCRET"; 44 | std::string privateKey = "PRIVATE_KEY"; 45 | 46 | AgentManager* pAgent = AgentManager::getInstance(); 47 | pAgent->init(appKey,appSecret,privateKey,oauthLoginServer); 48 | 49 | //Initialize plug-ins, including SDKs. 50 | pAgent->loadAllPlugins(); 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/SDKManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __SDK_MANAGER_H__ 2 | #define __SDK_MANAGER_H__ 3 | 4 | #include "AgentManager.h" 5 | using namespace anysdk::framework; 6 | using namespace std; 7 | class SDKManager 8 | { 9 | public: 10 | static SDKManager* getInstance(); 11 | static void purge(); 12 | 13 | void loadAllPlugins(); 14 | 15 | private: 16 | SDKManager(); 17 | virtual ~SDKManager(); 18 | 19 | static SDKManager* _pInstance; 20 | 21 | AgentManager* _pAgent; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/jsb_anysdk_basic_conversions.h: -------------------------------------------------------------------------------- 1 | #ifndef __JS_BASIC_CONVERSIONS_H__ 2 | #define __JS_BASIC_CONVERSIONS_H__ 3 | 4 | #include "jsapi.h" 5 | #include "jsfriendapi.h" 6 | 7 | #include "ProtocolIAP.h" 8 | #include "ProtocolAnalytics.h" 9 | #include "ProtocolAds.h" 10 | #include "ProtocolShare.h" 11 | #include "ProtocolSocial.h" 12 | #include "ProtocolUser.h" 13 | #include "ProtocolREC.h" 14 | 15 | #ifndef CCLOGINFO 16 | #define CCLOGINFO(...) 17 | #endif 18 | 19 | using namespace anysdk::framework; 20 | 21 | namespace anysdk { namespace framework { 22 | 23 | // to native 24 | bool jsval_to_TProductInfo(JSContext *cx, JS::HandleValue v, TProductInfo* ret); 25 | bool jsval_to_TIAPDeveloperInfo(JSContext *cx, JS::HandleValue v, TIAPDeveloperInfo* ret); 26 | bool jsval_to_TAdsDeveloperInfo(JSContext *cx, JS::HandleValue v, TAdsDeveloperInfo* ret); 27 | bool jsval_to_TAdsInfo(JSContext *cx, JS::HandleValue v, TAdsInfo* ret); 28 | bool jsval_to_TShareDeveloperInfo(JSContext *cx, JS::HandleValue v, TShareDeveloperInfo* ret); 29 | bool jsval_to_TShareInfo(JSContext *cx, JS::HandleValue v, TShareInfo* ret); 30 | bool jsval_to_TVideoInfo(JSContext *cx, JS::HandleValue v, TVideoInfo* ret); 31 | bool jsval_to_TSocialDeveloperInfo(JSContext *cx, JS::HandleValue v, TSocialDeveloperInfo* ret); 32 | bool jsval_to_TAchievementInfo(JSContext *cx, JS::HandleValue v, TAchievementInfo* ret); 33 | bool jsval_to_TPaymentInfo(JSContext *cx, JS::HandleValue v, std::map* ret); 34 | bool jsval_to_TUserDeveloperInfo(JSContext *cx, JS::HandleValue v, TUserDeveloperInfo* ret); 35 | bool jsval_to_LogEventParamMap(JSContext *cx, JS::HandleValue v, LogEventParamMap** ret); 36 | bool jsval_to_StringMap(JSContext *cx, JS::HandleValue v, StringMap* ret); 37 | bool jsval_to_FBInfo(JSContext *cx, JS::HandleValue v, StringMap* ret); 38 | bool jsval_array_to_string(JSContext *cx, JS::HandleValue v, std::string* ret); 39 | //bool jsval_to_std_map_string_string(JSContext *cx, JS::HandleValue v, std::map* ret); 40 | // from native 41 | jsval TProductInfo_to_jsval(JSContext *cx, TProductInfo& ret); 42 | //jsval TProductList_to_jsval(JSContext *cx, TProductList ret); 43 | jsval LogEventParamMap_to_jsval(JSContext *cx, LogEventParamMap*& ret); 44 | 45 | } } // namespace anysdk { namespace framework { 46 | 47 | #endif /* __JS_ANYSDK_CONVERSIONS_H__ */ 48 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/Classes/manualanysdkbindings.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __manualanysdkbindings_h__ 2 | #define __manualanysdkbindings_h__ 3 | 4 | #include "jsapi.h" 5 | #include "jsfriendapi.h" 6 | 7 | void register_all_anysdk_manual(JSContext* cx, JS::HandleObject obj); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /jniLibs 3 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "org.cocos2d.ReflectionSample" 9 | minSdkVersion 10 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | sourceSets.main { 16 | java.srcDir "src" 17 | res.srcDir "res" 18 | jniLibs.srcDir "libs" 19 | manifest.srcFile "AndroidManifest.xml" 20 | assets.srcDir "assets" 21 | } 22 | 23 | signingConfigs { 24 | 25 | release { 26 | if (project.hasProperty("RELEASE_STORE_FILE")) { 27 | storeFile file(RELEASE_STORE_FILE) 28 | storePassword RELEASE_STORE_PASSWORD 29 | keyAlias RELEASE_KEY_ALIAS 30 | keyPassword RELEASE_KEY_PASSWORD 31 | } 32 | } 33 | } 34 | 35 | buildTypes { 36 | release { 37 | minifyEnabled false 38 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 39 | if (project.hasProperty("RELEASE_STORE_FILE")) { 40 | signingConfig signingConfigs.release 41 | } 42 | } 43 | } 44 | } 45 | 46 | dependencies { 47 | compile fileTree(dir: 'libs', include: ['*.jar']) 48 | compile project(':libcocos2dx') 49 | } 50 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | 52 | 56 | 57 | 69 | 70 | 71 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := cocos2djs_shared 6 | 7 | LOCAL_MODULE_FILENAME := libcocos2djs 8 | 9 | ifeq ($(USE_ARM_MODE),1) 10 | LOCAL_ARM_MODE := arm 11 | endif 12 | 13 | LOCAL_SRC_FILES := hellojavascript/main.cpp \ 14 | ../../../Classes/AppDelegate.cpp \ 15 | ../../../Classes/SDKManager.cpp \ 16 | ../../../Classes/jsb_anysdk_basic_conversions.cpp \ 17 | ../../../Classes/manualanysdkbindings.cpp \ 18 | ../../../Classes/jsb_anysdk_protocols_auto.cpp 19 | 20 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes 21 | 22 | LOCAL_STATIC_LIBRARIES := cocos2d_js_static 23 | LOCAL_WHOLE_STATIC_LIBRARIES := PluginProtocolStatic 24 | 25 | LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT 26 | 27 | include $(BUILD_SHARED_LIBRARY) 28 | 29 | 30 | $(call import-module, scripting/js-bindings/proj.android) 31 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | 3 | # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices 4 | APP_ABI := armeabi-v7a 5 | 6 | APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS 7 | APP_LDFLAGS := -latomic 8 | 9 | USE_ARM_MODE := 1 10 | 11 | ifeq ($(NDK_DEBUG),1) 12 | APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 13 | APP_OPTIM := debug 14 | else 15 | APP_CPPFLAGS += -DNDEBUG 16 | APP_OPTIM := release 17 | endif 18 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/jni/hellojavascript/main.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "platform/android/jni/JniHelper.h" 4 | #include 5 | #include 6 | #if PACKAGE_AS 7 | #include "PluginJniHelper.h" 8 | #include "SDKManager.h" 9 | #endif 10 | 11 | #define LOG_TAG "main" 12 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 13 | 14 | using namespace cocos2d; 15 | #if PACKAGE_AS 16 | using namespace anysdk::framework; 17 | #endif 18 | 19 | void cocos_android_app_init (JNIEnv* env) { 20 | LOGD("cocos_android_app_init"); 21 | AppDelegate *pAppDelegate = new AppDelegate(); 22 | #if PACKAGE_AS 23 | JavaVM* vm; 24 | env->GetJavaVM(&vm); 25 | PluginJniHelper::setJavaVM(vm); 26 | #endif 27 | } 28 | 29 | extern "C" 30 | { 31 | void Java_org_cocos2dx_javascript_SDKWrapper_nativeLoadAllPlugins(JNIEnv* env, jobject thiz) 32 | { 33 | #if PACKAGE_AS 34 | SDKManager::getInstance()->loadAllPlugins(); 35 | #endif 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/libs/libPluginProtocol.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-10 12 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_ads.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | 14 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/layout/plugin_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 28 | 29 | 39 | 40 | 48 | 49 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_btn_close.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/mipmap/plugin_ui_ad.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/values-en/plugin_string.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account login 4 | Account 5 | Password 6 | Login 7 | Cancel 8 | Do you confirm the payment? 9 | Pay 10 | Rank 11 | Achievement 12 | Platform center 13 | Show toolbar 14 | Hide toolbar 15 | Real-name registration 16 | Anti-addiction query 17 | Exit 18 | Pause the game 19 | Confirm 20 | Switch account 21 | Logout 22 | Submit the role information 23 | Test mode, not for official release! 24 | Just a moment please 25 | Data is communication 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/values/plugin_string.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 账号登陆 4 | 账号 5 | 密码 6 | 登陆 7 | 取消 8 | 是否确认支付? 9 | 支付 10 | 排行榜 11 | 成就榜 12 | 平台中心 13 | 工具栏 14 | 隐藏工具栏 15 | 实名注册 16 | 防沉迷查询 17 | 退出 18 | 暂停游戏 19 | 确认 20 | 切换账号 21 | 登出 22 | 提交角色信息 23 | 测试模式,不能用于渠道发布 24 | 请稍等 25 | 数据通信中... 26 | 27 | 28 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ReflectionSample 4 | 5 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2015 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package org.cocos2dx.javascript; 25 | 26 | import org.cocos2dx.lib.Cocos2dxActivity; 27 | import org.cocos2dx.lib.Cocos2dxGLSurfaceView; 28 | 29 | // For JS and JAVA reflection test, you can delete it if it's your own project 30 | import android.os.Bundle; 31 | import android.app.AlertDialog; 32 | import android.content.DialogInterface; 33 | // ------------------------------------- 34 | import org.cocos2dx.javascript.SDKWrapper; 35 | 36 | import android.content.Context; 37 | import android.content.Intent; 38 | 39 | public class AppActivity extends Cocos2dxActivity { 40 | 41 | private static AppActivity app = null; 42 | 43 | @Override 44 | protected void onCreate(Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | app = this; 47 | SDKWrapper.getInstance().init(this); 48 | } 49 | 50 | @Override 51 | public Cocos2dxGLSurfaceView onCreateView() { 52 | Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); 53 | // TestCpp should create stencil buffer 54 | glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 55 | 56 | SDKWrapper.getInstance().setGLSurfaceView(glSurfaceView); 57 | 58 | return glSurfaceView; 59 | } 60 | 61 | // For JS and JAVA reflection test, you can delete it if it's your own project 62 | public static void showAlertDialog(final String title,final String message) { 63 | // Here be sure to use runOnUiThread 64 | app.runOnUiThread(new Runnable() { 65 | @Override 66 | public void run() { 67 | AlertDialog alertDialog = new AlertDialog.Builder(app).create(); 68 | alertDialog.setTitle(title); 69 | alertDialog.setMessage(message); 70 | alertDialog.show(); 71 | } 72 | }); 73 | } 74 | 75 | @Override 76 | protected void onResume() { 77 | super.onResume(); 78 | SDKWrapper.getInstance().onResume(); 79 | } 80 | 81 | @Override 82 | protected void onPause() { 83 | super.onPause(); 84 | SDKWrapper.getInstance().onPause(); 85 | } 86 | 87 | @Override 88 | protected void onDestroy() { 89 | super.onDestroy(); 90 | SDKWrapper.getInstance().onDestroy(); 91 | } 92 | 93 | @Override 94 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 95 | super.onActivityResult(requestCode, resultCode, data); 96 | SDKWrapper.getInstance().onActivityResult(requestCode, resultCode, data); 97 | } 98 | 99 | @Override 100 | protected void onNewIntent(Intent intent) { 101 | super.onNewIntent(intent); 102 | SDKWrapper.getInstance().onNewIntent(intent); 103 | } 104 | 105 | @Override 106 | protected void onRestart() { 107 | super.onRestart(); 108 | SDKWrapper.getInstance().onRestart(); 109 | } 110 | 111 | @Override 112 | protected void onStop() { 113 | super.onStop(); 114 | SDKWrapper.getInstance().onStop(); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/PhotoTaker.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.javascript; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.graphics.Bitmap; 6 | import android.net.Uri; 7 | import android.os.Environment; 8 | import android.provider.MediaStore; 9 | import android.util.Log; 10 | 11 | import org.cocos2dx.lib.Cocos2dxActivity; 12 | 13 | import java.io.File; 14 | import java.io.IOException; 15 | 16 | /** 17 | * Created by panda on 9/27/16. 18 | */ 19 | 20 | public class PhotoTaker { 21 | private static Bitmap bmScreen; 22 | public static int count = 0; 23 | 24 | public static String getDir () { 25 | final String dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/picFolder/"; 26 | File newdir = new File(dir); 27 | newdir.mkdirs(); 28 | return dir; 29 | } 30 | 31 | public static void capture (String FilePath) { 32 | File newfile = new File(FilePath); 33 | try { 34 | newfile.createNewFile(); 35 | } 36 | catch (IOException e) 37 | { 38 | Log.e("error", "Create file failed"); 39 | } 40 | 41 | Uri outputFileUri = Uri.fromFile(newfile); 42 | 43 | Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); 44 | cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); 45 | 46 | Activity cocosActivity = ((Activity)Cocos2dxActivity.getContext()); 47 | cocosActivity.startActivityForResult(cameraIntent, 0); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/SDKWrapper.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.javascript; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.opengl.GLSurfaceView; 6 | 7 | public class SDKWrapper { 8 | private final static boolean PACKAGE_AS = true; 9 | private static Class mClass = null; 10 | 11 | private static SDKWrapper mInstace = null; 12 | public static SDKWrapper getInstance() { 13 | if (null == mInstace){ 14 | mInstace = new SDKWrapper(); 15 | try { 16 | String fullName = "com.anysdk.framework.PluginWrapper"; 17 | mClass = Class.forName(fullName); 18 | } catch (Exception e) { 19 | e.printStackTrace(); 20 | } 21 | } 22 | return mInstace; 23 | } 24 | 25 | public void init(Context context) { 26 | if (PACKAGE_AS) { 27 | try { 28 | mClass.getMethod("init", Context.class).invoke(mClass, context); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | SDKWrapper.nativeLoadAllPlugins(); 33 | } 34 | 35 | } 36 | 37 | public void setGLSurfaceView(GLSurfaceView view) { 38 | if (PACKAGE_AS) { 39 | try { 40 | mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | } 46 | 47 | public void onResume() { 48 | if (PACKAGE_AS) { 49 | try { 50 | mClass.getMethod("onResume").invoke(mClass); 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | } 56 | 57 | public void onPause() { 58 | if (PACKAGE_AS) { 59 | try { 60 | mClass.getMethod("onPause").invoke(mClass); 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | } 64 | } 65 | } 66 | 67 | public void onDestroy() { 68 | if (PACKAGE_AS) { 69 | try { 70 | mClass.getMethod("onDestroy").invoke(mClass); 71 | } catch (Exception e) { 72 | e.printStackTrace(); 73 | } 74 | } 75 | } 76 | 77 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 78 | if (PACKAGE_AS) { 79 | try { 80 | mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data); 81 | } catch (Exception e) { 82 | e.printStackTrace(); 83 | } 84 | } 85 | } 86 | 87 | public void onNewIntent(Intent intent) { 88 | if (PACKAGE_AS) { 89 | try { 90 | mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent); 91 | } catch (Exception e) { 92 | e.printStackTrace(); 93 | } 94 | } 95 | } 96 | 97 | public void onRestart() { 98 | if (PACKAGE_AS) { 99 | try { 100 | mClass.getMethod("onRestart").invoke(mClass); 101 | } catch (Exception e) { 102 | e.printStackTrace(); 103 | } 104 | } 105 | } 106 | 107 | public void onStop() { 108 | if (PACKAGE_AS) { 109 | try { 110 | mClass.getMethod("onStop").invoke(mClass); 111 | } catch (Exception e) { 112 | e.printStackTrace(); 113 | } 114 | } 115 | } 116 | 117 | private static native void nativeLoadAllPlugins(); 118 | } 119 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "ndk_module_path" :[ 3 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x", 4 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos", 5 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external", 6 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external/android/include", 7 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external/android/spidermonkey" 8 | ], 9 | "copy_resources": [ 10 | { 11 | "from": "../../../src", 12 | "to": "src" 13 | }, 14 | { 15 | "from": "../../../res", 16 | "to": "res" 17 | }, 18 | { 19 | "from": "../../../main.js", 20 | "to": "" 21 | }, 22 | { 23 | "from": "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos/scripting/js-bindings/script", 24 | "to": "script" 25 | }, 26 | { 27 | "from": "../../../project.json", 28 | "to": "" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 26 13:02:56 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/proj.android-studio.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android-studio/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':libcocos2dx' 2 | project(':libcocos2dx').projectDir = new File('/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos/platform/android/libcocos2dx') 3 | include ':ReflectionSample' 4 | project(':ReflectionSample').projectDir = new File(settingsDir, 'app') 5 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ReflectionSample 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 30 | full,incremental, 31 | 32 | 33 | 34 | 35 | 36 | com.android.ide.eclipse.adt.AndroidNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.cdt.core.cnature 39 | org.eclipse.cdt.core.ccnature 40 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 41 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 42 | 43 | 44 | 45 | jsjavabridge 46 | 2 47 | PARENT-2-PROJECT_LOC/js-bindings/bindings/manual/platform/android/java/src 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/README.md: -------------------------------------------------------------------------------- 1 | Reference:[compilation in eclipse](https://github.com/chukong/cocos-docs/blob/master/manual/framework/html5/v3/compilation-in-eclipse/en.md) -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/ant.properties: -------------------------------------------------------------------------------- 1 | aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" 2 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "ndk_module_path" :[ 3 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x", 4 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos", 5 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external", 6 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external/android/include", 7 | "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/external/android/spidermonkey" 8 | ], 9 | "copy_resources": [ 10 | { 11 | "from": "../../../src", 12 | "to": "src" 13 | }, 14 | { 15 | "from": "../../../res", 16 | "to": "res" 17 | }, 18 | { 19 | "from": "../../../main.js", 20 | "to": "" 21 | }, 22 | { 23 | "from": "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos/scripting/js-bindings/script", 24 | "to": "script" 25 | }, 26 | { 27 | "from": "../../../project.json", 28 | "to": "" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 29 | 30 | 31 | 35 | 36 | 37 | 38 | 39 | 40 | 49 | 50 | 51 | 52 | 56 | 57 | 69 | 70 | 71 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := cocos2djs_shared 6 | 7 | LOCAL_MODULE_FILENAME := libcocos2djs 8 | 9 | ifeq ($(USE_ARM_MODE),1) 10 | LOCAL_ARM_MODE := arm 11 | endif 12 | 13 | LOCAL_SRC_FILES := hellojavascript/main.cpp \ 14 | ../../Classes/AppDelegate.cpp \ 15 | ../../Classes/SDKManager.cpp \ 16 | ../../Classes/jsb_anysdk_basic_conversions.cpp \ 17 | ../../Classes/manualanysdkbindings.cpp \ 18 | ../../Classes/jsb_anysdk_protocols_auto.cpp 19 | 20 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes 21 | 22 | LOCAL_STATIC_LIBRARIES := cocos2d_js_static 23 | LOCAL_WHOLE_STATIC_LIBRARIES := PluginProtocolStatic 24 | 25 | LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT 26 | 27 | include $(BUILD_SHARED_LIBRARY) 28 | 29 | 30 | $(call import-module, scripting/js-bindings/proj.android) 31 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | 3 | # Uncomment this line to compile to armeabi-v7a, your application will run faster but support less devices 4 | APP_ABI := armeabi-v7a 5 | 6 | APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCC_ENABLE_BULLET_INTEGRATION=1 -std=c++11 -fsigned-char -DPACKAGE_AS 7 | APP_LDFLAGS := -latomic 8 | 9 | USE_ARM_MODE := 1 10 | 11 | ifeq ($(NDK_DEBUG),1) 12 | APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 13 | APP_OPTIM := debug 14 | else 15 | APP_CPPFLAGS += -DNDEBUG 16 | APP_OPTIM := release 17 | endif 18 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/jni/hellojavascript/main.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "platform/android/jni/JniHelper.h" 4 | #include 5 | #include 6 | #if PACKAGE_AS 7 | #include "PluginJniHelper.h" 8 | #include "SDKManager.h" 9 | #endif 10 | 11 | #define LOG_TAG "main" 12 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 13 | 14 | using namespace cocos2d; 15 | #if PACKAGE_AS 16 | using namespace anysdk::framework; 17 | #endif 18 | 19 | void cocos_android_app_init (JNIEnv* env) { 20 | LOGD("cocos_android_app_init"); 21 | AppDelegate *pAppDelegate = new AppDelegate(); 22 | #if PACKAGE_AS 23 | JavaVM* vm; 24 | env->GetJavaVM(&vm); 25 | PluginJniHelper::setJavaVM(vm); 26 | #endif 27 | } 28 | 29 | extern "C" 30 | { 31 | void Java_org_cocos2dx_javascript_SDKWrapper_nativeLoadAllPlugins(JNIEnv* env, jobject thiz) 32 | { 33 | #if PACKAGE_AS 34 | SDKManager::getInstance()->loadAllPlugins(); 35 | #endif 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/libs/android-async-http-1.4.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/libs/android-async-http-1.4.9.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/libs/com.android.vending.expansion.zipfile.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/libs/com.android.vending.expansion.zipfile.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/libs/httpclient-4.4.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/libs/httpclient-4.4.1.1.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/libs/libPluginProtocol.jar -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-10 12 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/res/drawable/plugin_btn_close.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.android/res/drawable/plugin_ui_ad.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/layout/plugin_ads.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | 14 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/layout/plugin_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 28 | 29 | 39 | 40 | 48 | 49 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/values-en/plugin_string.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account login 4 | Account 5 | Password 6 | Login 7 | Cancel 8 | Do you confirm the payment? 9 | Pay 10 | Rank 11 | Achievement 12 | Platform center 13 | Show toolbar 14 | Hide toolbar 15 | Real-name registration 16 | Anti-addiction query 17 | Exit 18 | Pause the game 19 | Confirm 20 | Switch account 21 | Logout 22 | Submit the role information 23 | Test mode, not for official release! 24 | Just a moment please 25 | Data is communication 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/values/plugin_string.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 账号登陆 4 | 账号 5 | 密码 6 | 登陆 7 | 取消 8 | 是否确认支付? 9 | 支付 10 | 排行榜 11 | 成就榜 12 | 平台中心 13 | 工具栏 14 | 隐藏工具栏 15 | 实名注册 16 | 防沉迷查询 17 | 退出 18 | 暂停游戏 19 | 确认 20 | 切换账号 21 | 登出 22 | 提交角色信息 23 | 测试模式,不能用于渠道发布 24 | 请稍等 25 | 数据通信中... 26 | 27 | 28 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ReflectionSample 4 | 5 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/AppActivity.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2008-2010 Ricardo Quesada 3 | Copyright (c) 2010-2012 cocos2d-x.org 4 | Copyright (c) 2011 Zynga Inc. 5 | Copyright (c) 2013-2014 Chukong Technologies Inc. 6 | 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | package org.cocos2dx.javascript; 28 | 29 | import org.cocos2dx.lib.Cocos2dxActivity; 30 | import org.cocos2dx.lib.Cocos2dxGLSurfaceView; 31 | 32 | // For JS and JAVA reflection test, you can delete it if it's your own project 33 | import android.os.Bundle; 34 | import android.app.AlertDialog; 35 | import android.content.DialogInterface; 36 | // ------------------------------------- 37 | import org.cocos2dx.javascript.SDKWrapper; 38 | 39 | import android.content.Context; 40 | import android.content.Intent; 41 | 42 | public class AppActivity extends Cocos2dxActivity { 43 | 44 | private static AppActivity app = null; 45 | 46 | @Override 47 | protected void onCreate(Bundle savedInstanceState) { 48 | super.onCreate(savedInstanceState); 49 | app = this; 50 | SDKWrapper.getInstance().init(this); 51 | } 52 | 53 | @Override 54 | public Cocos2dxGLSurfaceView onCreateView() { 55 | Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); 56 | // TestCpp should create stencil buffer 57 | glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 58 | 59 | SDKWrapper.getInstance().setGLSurfaceView(glSurfaceView); 60 | 61 | return glSurfaceView; 62 | } 63 | 64 | // For JS and JAVA reflection test, you can delete it if it's your own project 65 | public static void showAlertDialog(final String title,final String message) { 66 | // Here be sure to use runOnUiThread 67 | app.runOnUiThread(new Runnable() { 68 | @Override 69 | public void run() { 70 | AlertDialog alertDialog = new AlertDialog.Builder(app).create(); 71 | alertDialog.setTitle(title); 72 | alertDialog.setMessage(message); 73 | alertDialog.show(); 74 | } 75 | }); 76 | } 77 | 78 | @Override 79 | protected void onResume() { 80 | super.onResume(); 81 | SDKWrapper.getInstance().onResume(); 82 | } 83 | 84 | @Override 85 | protected void onPause() { 86 | super.onPause(); 87 | SDKWrapper.getInstance().onPause(); 88 | } 89 | 90 | @Override 91 | protected void onDestroy() { 92 | super.onDestroy(); 93 | SDKWrapper.getInstance().onDestroy(); 94 | } 95 | 96 | @Override 97 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 98 | super.onActivityResult(requestCode, resultCode, data); 99 | SDKWrapper.getInstance().onActivityResult(requestCode, resultCode, data); 100 | } 101 | 102 | @Override 103 | protected void onNewIntent(Intent intent) { 104 | super.onNewIntent(intent); 105 | SDKWrapper.getInstance().onNewIntent(intent); 106 | } 107 | 108 | @Override 109 | protected void onRestart() { 110 | super.onRestart(); 111 | SDKWrapper.getInstance().onRestart(); 112 | } 113 | 114 | @Override 115 | protected void onStop() { 116 | super.onStop(); 117 | SDKWrapper.getInstance().onStop(); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/SDKWrapper.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.javascript; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.opengl.GLSurfaceView; 6 | 7 | public class SDKWrapper { 8 | private final static boolean PACKAGE_AS = true; 9 | private static Class mClass = null; 10 | 11 | private static SDKWrapper mInstace = null; 12 | public static SDKWrapper getInstance() { 13 | if (null == mInstace){ 14 | mInstace = new SDKWrapper(); 15 | try { 16 | String fullName = "com.anysdk.framework.PluginWrapper"; 17 | mClass = Class.forName(fullName); 18 | } catch (Exception e) { 19 | e.printStackTrace(); 20 | } 21 | } 22 | return mInstace; 23 | } 24 | 25 | public void init(Context context) { 26 | if (PACKAGE_AS) { 27 | try { 28 | mClass.getMethod("init", Context.class).invoke(mClass, context); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | } 32 | SDKWrapper.nativeLoadAllPlugins(); 33 | } 34 | 35 | } 36 | 37 | public void setGLSurfaceView(GLSurfaceView view) { 38 | if (PACKAGE_AS) { 39 | try { 40 | mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view); 41 | } catch (Exception e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | } 46 | 47 | public void onResume() { 48 | if (PACKAGE_AS) { 49 | try { 50 | mClass.getMethod("onResume").invoke(mClass); 51 | } catch (Exception e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | } 56 | 57 | public void onPause() { 58 | if (PACKAGE_AS) { 59 | try { 60 | mClass.getMethod("onPause").invoke(mClass); 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | } 64 | } 65 | } 66 | 67 | public void onDestroy() { 68 | if (PACKAGE_AS) { 69 | try { 70 | mClass.getMethod("onDestroy").invoke(mClass); 71 | } catch (Exception e) { 72 | e.printStackTrace(); 73 | } 74 | } 75 | } 76 | 77 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 78 | if (PACKAGE_AS) { 79 | try { 80 | mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data); 81 | } catch (Exception e) { 82 | e.printStackTrace(); 83 | } 84 | } 85 | } 86 | 87 | public void onNewIntent(Intent intent) { 88 | if (PACKAGE_AS) { 89 | try { 90 | mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent); 91 | } catch (Exception e) { 92 | e.printStackTrace(); 93 | } 94 | } 95 | } 96 | 97 | public void onRestart() { 98 | if (PACKAGE_AS) { 99 | try { 100 | mClass.getMethod("onRestart").invoke(mClass); 101 | } catch (Exception e) { 102 | e.printStackTrace(); 103 | } 104 | } 105 | } 106 | 107 | public void onStop() { 108 | if (PACKAGE_AS) { 109 | try { 110 | mClass.getMethod("onStop").invoke(mClass); 111 | } catch (Exception e) { 112 | e.printStackTrace(); 113 | } 114 | } 115 | } 116 | 117 | private static native void nativeLoadAllPlugins(); 118 | } 119 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxHandler.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | package org.cocos2dx.lib; 27 | 28 | import android.app.AlertDialog; 29 | import android.content.DialogInterface; 30 | import android.os.Handler; 31 | import android.os.Message; 32 | 33 | import java.lang.ref.WeakReference; 34 | 35 | public class Cocos2dxHandler extends Handler { 36 | // =========================================================== 37 | // Constants 38 | // =========================================================== 39 | public final static int HANDLER_SHOW_DIALOG = 1; 40 | 41 | // =========================================================== 42 | // Fields 43 | // =========================================================== 44 | private WeakReference mActivity; 45 | 46 | // =========================================================== 47 | // Constructors 48 | // =========================================================== 49 | public Cocos2dxHandler(Cocos2dxActivity activity) { 50 | this.mActivity = new WeakReference(activity); 51 | } 52 | 53 | // =========================================================== 54 | // Getter & Setter 55 | // =========================================================== 56 | 57 | // =========================================================== 58 | // Methods for/from SuperClass/Interfaces 59 | // =========================================================== 60 | 61 | // =========================================================== 62 | // Methods 63 | // =========================================================== 64 | 65 | public void handleMessage(Message msg) { 66 | switch (msg.what) { 67 | case Cocos2dxHandler.HANDLER_SHOW_DIALOG: 68 | showDialog(msg); 69 | break; 70 | } 71 | } 72 | 73 | private void showDialog(Message msg) { 74 | Cocos2dxActivity theActivity = this.mActivity.get(); 75 | DialogMessage dialogMessage = (DialogMessage)msg.obj; 76 | new AlertDialog.Builder(theActivity) 77 | .setTitle(dialogMessage.title) 78 | .setMessage(dialogMessage.message) 79 | .setPositiveButton("Ok", 80 | new DialogInterface.OnClickListener() { 81 | 82 | @Override 83 | public void onClick(DialogInterface dialog, int which) { 84 | // TODO Auto-generated method stub 85 | 86 | } 87 | }).create().show(); 88 | } 89 | 90 | // =========================================================== 91 | // Inner and Anonymous Classes 92 | // =========================================================== 93 | 94 | public static class DialogMessage { 95 | public String title; 96 | public String message; 97 | 98 | public DialogMessage(String title, String message) { 99 | this.title = title; 100 | this.message = message; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxJavascriptJavaBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014 Chukong Technologies Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | package org.cocos2dx.lib; 24 | 25 | public class Cocos2dxJavascriptJavaBridge { 26 | public static native int evalString(String value); 27 | } 28 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2013-2016 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package org.cocos2dx.lib; 25 | 26 | import android.content.Context; 27 | import android.database.Cursor; 28 | import android.database.sqlite.SQLiteDatabase; 29 | import android.database.sqlite.SQLiteOpenHelper; 30 | import android.util.Log; 31 | 32 | public class Cocos2dxLocalStorage { 33 | 34 | private static final String TAG = "Cocos2dxLocalStorage"; 35 | 36 | private static String DATABASE_NAME = "jsb.sqlite"; 37 | private static String TABLE_NAME = "data"; 38 | private static final int DATABASE_VERSION = 1; 39 | 40 | private static DBOpenHelper mDatabaseOpenHelper = null; 41 | private static SQLiteDatabase mDatabase = null; 42 | /** 43 | * Constructor 44 | * @param context The Context within which to work, used to create the DB 45 | * @return 46 | */ 47 | public static boolean init(String dbName, String tableName) { 48 | if (Cocos2dxActivity.getContext() != null) { 49 | DATABASE_NAME = dbName; 50 | TABLE_NAME = tableName; 51 | mDatabaseOpenHelper = new DBOpenHelper(Cocos2dxActivity.getContext()); 52 | mDatabase = mDatabaseOpenHelper.getWritableDatabase(); 53 | return true; 54 | } 55 | return false; 56 | } 57 | 58 | public static void destroy() { 59 | if (mDatabase != null) { 60 | mDatabase.close(); 61 | } 62 | } 63 | 64 | public static void setItem(String key, String value) { 65 | try { 66 | String sql = "replace into "+TABLE_NAME+"(key,value)values(?,?)"; 67 | mDatabase.execSQL(sql, new Object[] { key, value }); 68 | } catch (Exception e) { 69 | e.printStackTrace(); 70 | } 71 | } 72 | 73 | public static String getItem(String key) { 74 | String ret = null; 75 | try { 76 | String sql = "select value from "+TABLE_NAME+" where key=?"; 77 | Cursor c = mDatabase.rawQuery(sql, new String[]{key}); 78 | while (c.moveToNext()) { 79 | // only return the first value 80 | if (ret != null) 81 | { 82 | Log.e(TAG, "The key contains more than one value."); 83 | break; 84 | } 85 | ret = c.getString(c.getColumnIndex("value")); 86 | } 87 | c.close(); 88 | } catch (Exception e) { 89 | e.printStackTrace(); 90 | } 91 | return ret; 92 | } 93 | 94 | public static void removeItem(String key) { 95 | try { 96 | String sql = "delete from "+TABLE_NAME+" where key=?"; 97 | mDatabase.execSQL(sql, new Object[] {key}); 98 | } catch (Exception e) { 99 | e.printStackTrace(); 100 | } 101 | } 102 | 103 | public static void clear() { 104 | try { 105 | String sql = "delete from "+TABLE_NAME; 106 | mDatabase.execSQL(sql); 107 | } catch (Exception e) { 108 | e.printStackTrace(); 109 | } 110 | } 111 | 112 | /** 113 | * This creates/opens the database. 114 | */ 115 | private static class DBOpenHelper extends SQLiteOpenHelper { 116 | 117 | DBOpenHelper(Context context) { 118 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 119 | } 120 | 121 | @Override 122 | public void onCreate(SQLiteDatabase db) { 123 | db.execSQL("CREATE TABLE IF NOT EXISTS "+TABLE_NAME+"(key TEXT PRIMARY KEY,value TEXT);"); 124 | } 125 | 126 | @Override 127 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 128 | Log.w(TAG, "Upgrading database from version " + oldVersion + " to " 129 | + newVersion + ", which will destroy all old data"); 130 | //db.execSQL("DROP TABLE IF EXISTS " + VIRTUAL_TABLE); 131 | //onCreate(db); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxReflectionHelper.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2016 cocos2d-x.org 3 | Copyright (c) 2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import android.util.Log; 28 | 29 | import java.lang.reflect.InvocationTargetException; 30 | import java.lang.reflect.Method; 31 | 32 | public class Cocos2dxReflectionHelper { 33 | public static T getConstantValue(final Class aClass, final String constantName) { 34 | try { 35 | return (T)aClass.getDeclaredField(constantName).get(null); 36 | } catch (NoSuchFieldException e) { 37 | Log.e("error", "can not find " + constantName + " in " + aClass.getName()); 38 | } 39 | catch (IllegalAccessException e) { 40 | Log.e("error", constantName + " is not accessable"); 41 | } 42 | catch (IllegalArgumentException e) { 43 | Log.e("error", "arguments error when get " + constantName); 44 | } 45 | catch (Exception e) { 46 | Log.e("error", "can not get constant" + constantName); 47 | } 48 | 49 | return null; 50 | } 51 | 52 | public static T invokeInstanceMethod(final Object instance, final String methodName, 53 | final Class[] parameterTypes, final Object[] parameters) { 54 | 55 | final Class aClass = instance.getClass(); 56 | try { 57 | final Method method = aClass.getMethod(methodName, parameterTypes); 58 | return (T)method.invoke(instance, parameters); 59 | } catch (NoSuchMethodException e) { 60 | Log.e("error", "can not find " + methodName + " in " + aClass.getName()); 61 | } 62 | catch (IllegalAccessException e) { 63 | Log.e("error", methodName + " is not accessible"); 64 | } 65 | catch (IllegalArgumentException e) { 66 | Log.e("error", "arguments are error when invoking " + methodName); 67 | } 68 | catch (InvocationTargetException e) { 69 | Log.e("error", "an exception was thrown by the invoked method when invoking " + methodName); 70 | } 71 | 72 | return null; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxTypefaces.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2012 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import android.content.Context; 28 | import android.graphics.Typeface; 29 | 30 | import java.util.HashMap; 31 | 32 | public class Cocos2dxTypefaces { 33 | // =========================================================== 34 | // Constants 35 | // =========================================================== 36 | 37 | // =========================================================== 38 | // Fields 39 | // =========================================================== 40 | 41 | private static final HashMap sTypefaceCache = new HashMap(); 42 | 43 | // =========================================================== 44 | // Constructors 45 | // =========================================================== 46 | 47 | // =========================================================== 48 | // Getter & Setter 49 | // =========================================================== 50 | 51 | // =========================================================== 52 | // Methods for/from SuperClass/Interfaces 53 | // =========================================================== 54 | 55 | // =========================================================== 56 | // Methods 57 | // =========================================================== 58 | 59 | public static synchronized Typeface get(final Context context, final String assetName) { 60 | if (!Cocos2dxTypefaces.sTypefaceCache.containsKey(assetName)) { 61 | Typeface typeface = null; 62 | if (assetName.startsWith("/")) 63 | { 64 | typeface = Typeface.createFromFile(assetName); 65 | } 66 | else 67 | { 68 | typeface = Typeface.createFromAsset(context.getAssets(), assetName); 69 | } 70 | Cocos2dxTypefaces.sTypefaceCache.put(assetName, typeface); 71 | } 72 | 73 | return Cocos2dxTypefaces.sTypefaceCache.get(assetName); 74 | } 75 | 76 | // =========================================================== 77 | // Inner and Anonymous Classes 78 | // =========================================================== 79 | 80 | } 81 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/Cocos2dxWebView.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.lib; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.util.Log; 6 | import android.view.Gravity; 7 | import android.webkit.WebChromeClient; 8 | import android.webkit.WebView; 9 | import android.webkit.WebViewClient; 10 | import android.widget.FrameLayout; 11 | 12 | import java.lang.reflect.Method; 13 | import java.net.URI; 14 | import java.util.concurrent.CountDownLatch; 15 | 16 | class ShouldStartLoadingWorker implements Runnable { 17 | private CountDownLatch mLatch; 18 | private boolean[] mResult; 19 | private final int mViewTag; 20 | private final String mUrlString; 21 | 22 | ShouldStartLoadingWorker(CountDownLatch latch, boolean[] result, int viewTag, String urlString) { 23 | this.mLatch = latch; 24 | this.mResult = result; 25 | this.mViewTag = viewTag; 26 | this.mUrlString = urlString; 27 | } 28 | 29 | @Override 30 | public void run() { 31 | this.mResult[0] = Cocos2dxWebViewHelper._shouldStartLoading(mViewTag, mUrlString); 32 | this.mLatch.countDown(); // notify that result is ready 33 | } 34 | } 35 | 36 | public class Cocos2dxWebView extends WebView { 37 | private static final String TAG = Cocos2dxWebViewHelper.class.getSimpleName(); 38 | 39 | private int mViewTag; 40 | private String mJSScheme; 41 | 42 | public Cocos2dxWebView(Context context) { 43 | this(context, -1); 44 | } 45 | 46 | @SuppressLint("SetJavaScriptEnabled") 47 | public Cocos2dxWebView(Context context, int viewTag) { 48 | super(context); 49 | this.mViewTag = viewTag; 50 | this.mJSScheme = ""; 51 | 52 | this.setFocusable(true); 53 | this.setFocusableInTouchMode(true); 54 | 55 | this.getSettings().setSupportZoom(false); 56 | 57 | this.getSettings().setDomStorageEnabled(true); 58 | this.getSettings().setJavaScriptEnabled(true); 59 | 60 | // `searchBoxJavaBridge_` has big security risk. http://jvn.jp/en/jp/JVN53768697 61 | try { 62 | Method method = this.getClass().getMethod("removeJavascriptInterface", new Class[]{String.class}); 63 | method.invoke(this, "searchBoxJavaBridge_"); 64 | } catch (Exception e) { 65 | Log.d(TAG, "This API level do not support `removeJavascriptInterface`"); 66 | } 67 | 68 | this.setWebViewClient(new Cocos2dxWebViewClient()); 69 | this.setWebChromeClient(new WebChromeClient()); 70 | } 71 | 72 | public void setJavascriptInterfaceScheme(String scheme) { 73 | this.mJSScheme = scheme != null ? scheme : ""; 74 | } 75 | 76 | public void setScalesPageToFit(boolean scalesPageToFit) { 77 | this.getSettings().setSupportZoom(scalesPageToFit); 78 | } 79 | 80 | class Cocos2dxWebViewClient extends WebViewClient { 81 | @Override 82 | public boolean shouldOverrideUrlLoading(WebView view, final String urlString) { 83 | Cocos2dxActivity activity = (Cocos2dxActivity)getContext(); 84 | 85 | try { 86 | URI uri = URI.create(urlString); 87 | if (uri != null && uri.getScheme().equals(mJSScheme)) { 88 | activity.runOnGLThread(new Runnable() { 89 | @Override 90 | public void run() { 91 | Cocos2dxWebViewHelper._onJsCallback(mViewTag, urlString); 92 | } 93 | }); 94 | return true; 95 | } 96 | } catch (Exception e) { 97 | Log.d(TAG, "Failed to create URI from url"); 98 | } 99 | 100 | boolean[] result = new boolean[] { true }; 101 | CountDownLatch latch = new CountDownLatch(1); 102 | 103 | // run worker on cocos thread 104 | activity.runOnGLThread(new ShouldStartLoadingWorker(latch, result, mViewTag, urlString)); 105 | 106 | // wait for result from cocos thread 107 | try { 108 | latch.await(); 109 | } catch (InterruptedException ex) { 110 | Log.d(TAG, "'shouldOverrideUrlLoading' failed"); 111 | } 112 | 113 | return result[0]; 114 | } 115 | 116 | @Override 117 | public void onPageFinished(WebView view, final String url) { 118 | super.onPageFinished(view, url); 119 | Cocos2dxActivity activity = (Cocos2dxActivity)getContext(); 120 | activity.runOnGLThread(new Runnable() { 121 | @Override 122 | public void run() { 123 | Cocos2dxWebViewHelper._didFinishLoading(mViewTag, url); 124 | } 125 | }); 126 | } 127 | 128 | @Override 129 | public void onReceivedError(WebView view, int errorCode, String description, final String failingUrl) { 130 | super.onReceivedError(view, errorCode, description, failingUrl); 131 | Cocos2dxActivity activity = (Cocos2dxActivity)getContext(); 132 | activity.runOnGLThread(new Runnable() { 133 | @Override 134 | public void run() { 135 | Cocos2dxWebViewHelper._didFailLoading(mViewTag, failingUrl); 136 | } 137 | }); 138 | } 139 | } 140 | 141 | public void setWebViewRect(int left, int top, int maxWidth, int maxHeight) { 142 | FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, 143 | FrameLayout.LayoutParams.WRAP_CONTENT); 144 | layoutParams.leftMargin = left; 145 | layoutParams.topMargin = top; 146 | layoutParams.width = maxWidth; 147 | layoutParams.height = maxHeight; 148 | layoutParams.gravity = Gravity.TOP | Gravity.LEFT; 149 | this.setLayoutParams(layoutParams); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/GameControllerAdapter.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import java.util.ArrayList; 28 | 29 | public class GameControllerAdapter { 30 | private static ArrayList sRunnableFrameStartList = null; 31 | 32 | public static void addRunnableToFrameStartList(Runnable runnable) { 33 | if (sRunnableFrameStartList == null) 34 | sRunnableFrameStartList = new ArrayList(); 35 | sRunnableFrameStartList.add(runnable); 36 | } 37 | 38 | public static void removeRunnableFromFrameStartList(Runnable runnable) { 39 | if (sRunnableFrameStartList != null) 40 | sRunnableFrameStartList.remove(runnable); 41 | } 42 | 43 | public static void onDrawFrameStart() { 44 | if (sRunnableFrameStartList != null) 45 | { 46 | int size = sRunnableFrameStartList.size(); 47 | for (int i = 0; i < size; ++i) { 48 | sRunnableFrameStartList.get(i).run(); 49 | } 50 | } 51 | } 52 | 53 | public static void onConnected(final String vendorName, final int controller) 54 | { 55 | Cocos2dxHelper.runOnGLThread(new Runnable() { 56 | 57 | @Override 58 | public void run() { 59 | nativeControllerConnected(vendorName, controller); 60 | } 61 | }); 62 | } 63 | 64 | public static void onDisconnected(final String vendorName, final int controller) 65 | { 66 | Cocos2dxHelper.runOnGLThread(new Runnable() { 67 | 68 | @Override 69 | public void run() { 70 | nativeControllerDisconnected(vendorName, controller); 71 | } 72 | }); 73 | } 74 | 75 | public static void onButtonEvent(final String vendorName, final int controller, final int button, final boolean isPressed, final float value, final boolean isAnalog) 76 | { 77 | Cocos2dxHelper.runOnGLThread(new Runnable() { 78 | 79 | @Override 80 | public void run() { 81 | nativeControllerButtonEvent(vendorName, controller, button, isPressed, value, isAnalog); 82 | } 83 | }); 84 | } 85 | 86 | public static void onAxisEvent(final String vendorName, final int controller, final int axisID, final float value, final boolean isAnalog) 87 | { 88 | Cocos2dxHelper.runOnGLThread(new Runnable() { 89 | 90 | @Override 91 | public void run() { 92 | nativeControllerAxisEvent(vendorName, controller, axisID, value, isAnalog); 93 | } 94 | }); 95 | } 96 | 97 | private static native void nativeControllerConnected(final String vendorName, final int controller); 98 | private static native void nativeControllerDisconnected(final String vendorName, final int controller); 99 | private static native void nativeControllerButtonEvent(final String vendorName, final int controller, final int button, final boolean isPressed, final float value, final boolean isAnalog); 100 | private static native void nativeControllerAxisEvent(final String vendorName, final int controller, final int axisID, final float value, final boolean isAnalog); 101 | } 102 | 103 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/GameControllerDelegate.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import android.content.Context; 28 | import android.view.KeyEvent; 29 | import android.view.MotionEvent; 30 | 31 | public interface GameControllerDelegate { 32 | 33 | static final int KEY_BASE = 1000; 34 | 35 | public static final int THUMBSTICK_LEFT_X = KEY_BASE; 36 | public static final int THUMBSTICK_LEFT_Y = KEY_BASE + 1; 37 | public static final int THUMBSTICK_RIGHT_X = KEY_BASE + 2; 38 | public static final int THUMBSTICK_RIGHT_Y = KEY_BASE + 3; 39 | 40 | public static final int BUTTON_A = KEY_BASE + 4; 41 | public static final int BUTTON_B = KEY_BASE + 5; 42 | public static final int BUTTON_C = KEY_BASE + 6; 43 | public static final int BUTTON_X = KEY_BASE + 7; 44 | public static final int BUTTON_Y = KEY_BASE + 8; 45 | public static final int BUTTON_Z = KEY_BASE + 9; 46 | 47 | public static final int BUTTON_DPAD_UP = KEY_BASE + 10; 48 | public static final int BUTTON_DPAD_DOWN = KEY_BASE + 11; 49 | public static final int BUTTON_DPAD_LEFT = KEY_BASE + 12; 50 | public static final int BUTTON_DPAD_RIGHT = KEY_BASE + 13; 51 | public static final int BUTTON_DPAD_CENTER = KEY_BASE + 14; 52 | 53 | public static final int BUTTON_LEFT_SHOULDER = KEY_BASE + 15; 54 | public static final int BUTTON_RIGHT_SHOULDER = KEY_BASE + 16; 55 | public static final int BUTTON_LEFT_TRIGGER = KEY_BASE + 17; 56 | public static final int BUTTON_RIGHT_TRIGGER = KEY_BASE + 18; 57 | 58 | public static final int BUTTON_LEFT_THUMBSTICK = KEY_BASE + 19; 59 | public static final int BUTTON_RIGHT_THUMBSTICK = KEY_BASE + 20; 60 | 61 | public static final int BUTTON_START = KEY_BASE + 21; 62 | public static final int BUTTON_SELECT = KEY_BASE + 22; 63 | 64 | void onCreate(Context context); 65 | void onPause(); 66 | void onResume(); 67 | void onDestroy(); 68 | 69 | boolean dispatchKeyEvent(KeyEvent event); 70 | boolean dispatchGenericMotionEvent(MotionEvent event); 71 | 72 | void setControllerEventListener(ControllerEventListener listener); 73 | 74 | public interface ControllerEventListener { 75 | void onButtonEvent(String vendorName, int controller, int button, boolean isPressed, float value, boolean isAnalog); 76 | void onAxisEvent(String vendorName, int controller, int axisID, float value, boolean isAnalog); 77 | 78 | void onConnected(String vendorName, int controller); 79 | void onDisconnected(String vendorName, int controller); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/GameControllerUtils.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import java.io.File; 28 | import java.io.FileInputStream; 29 | 30 | public class GameControllerUtils { 31 | 32 | public static void ensureDirectoryExist(String path){ 33 | 34 | File sdkDir = new File(path); 35 | if(!sdkDir.exists()){ 36 | sdkDir.mkdirs(); 37 | } 38 | } 39 | 40 | public static String readJsonFile(String filePath) { 41 | 42 | File file = new File(filePath); 43 | 44 | if (!file.exists()){ 45 | return null; 46 | } 47 | 48 | try { 49 | 50 | FileInputStream is = new FileInputStream(file);; 51 | 52 | int size = is.available(); 53 | byte[] buffer = new byte[size]; 54 | 55 | is.read(buffer); 56 | is.close(); 57 | 58 | String jsonstr = new String(buffer, "UTF-8"); 59 | 60 | return jsonstr; 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | } 64 | 65 | return null; 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/ResizeLayout.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | Copyright (c) 2013-2016 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import android.content.Context; 28 | import android.os.Handler; 29 | import android.util.AttributeSet; 30 | import android.widget.FrameLayout; 31 | 32 | public class ResizeLayout extends FrameLayout { 33 | private boolean mEnableForceDoLayout = false; 34 | 35 | public ResizeLayout(Context context){ 36 | super(context); 37 | } 38 | 39 | public ResizeLayout(Context context, AttributeSet attrs) { 40 | super(context, attrs); 41 | } 42 | 43 | public void setEnableForceDoLayout(boolean flag){ 44 | mEnableForceDoLayout = flag; 45 | } 46 | 47 | @Override 48 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 49 | super.onLayout(changed, l, t, r, b); 50 | if(mEnableForceDoLayout){ 51 | /*This is a hot-fix for some android devices which don't do layout when the main window 52 | * is paned. We refresh the layout in 24 frames per seconds. 53 | * When the editBox is lose focus or when user begin to type, the do layout is disabled. 54 | */ 55 | final Handler handler = new Handler(); 56 | handler.postDelayed(new Runnable() { 57 | @Override 58 | public void run() { 59 | //Do something after 100ms 60 | requestLayout(); 61 | invalidate(); 62 | } 63 | }, 1000 / 24); 64 | 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/project.xcworkspace/xcshareddata/ReflectionSample.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "27583C7DA72E52B2F92F0FCCAE852500FB432E38", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "27583C7DA72E52B2F92F0FCCAE852500FB432E38" : 0, 8 | "DBE07792E917556398B2A921F26C5EDA5610A3F3" : 0, 9 | "5E206BBA8871514A128228288B65DCD84B97B130" : 0 10 | }, 11 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "E279E8CB-A0F5-49BF-8BE4-1B3D0CE4B959", 12 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 13 | "27583C7DA72E52B2F92F0FCCAE852500FB432E38" : "ReflectionSample\/", 14 | "DBE07792E917556398B2A921F26C5EDA5610A3F3" : "..\/fireball\/cocos2d-x", 15 | "5E206BBA8871514A128228288B65DCD84B97B130" : "..\/fireball" 16 | }, 17 | "DVTSourceControlWorkspaceBlueprintNameKey" : "ReflectionSample", 18 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 19 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "build\/jsb-link\/frameworks\/runtime-src\/proj.ios_mac\/ReflectionSample.xcodeproj", 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 21 | { 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/pandamicro\/ReflectionSample.git", 23 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 24 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "27583C7DA72E52B2F92F0FCCAE852500FB432E38" 25 | }, 26 | { 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:cocos-creator\/fireball", 28 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 29 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5E206BBA8871514A128228288B65DCD84B97B130" 30 | }, 31 | { 32 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:cocos-creator\/cocos2d-x-lite.git", 33 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "DBE07792E917556398B2A921F26C5EDA5610A3F3" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/project.xcworkspace/xcuserdata/panda.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/project.xcworkspace/xcuserdata/panda.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/xcuserdata/panda.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/xcuserdata/panda.xcuserdatad/xcschemes/ReflectionSample-desktop.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/xcuserdata/panda.xcuserdatad/xcschemes/ReflectionSample-mobile.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ReflectionSample.xcodeproj/xcuserdata/panda.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ReflectionSample-desktop.xcscheme 8 | 9 | orderHint 10 | 5 11 | 12 | ReflectionSample-mobile.xcscheme 13 | 14 | orderHint 15 | 4 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 509D4A7517EBB24E00697056 21 | 22 | primary 23 | 24 | 25 | A922753C1517C094001B78AA 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/AppController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | Copyright (c) 2013-2014 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | @class RootViewController; 27 | 28 | @interface AppController : NSObject 29 | { 30 | UIWindow *window; 31 | RootViewController *viewController; 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/AppController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | Copyright (c) 2013-2014 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import 27 | #import "cocos2d.h" 28 | 29 | #import "AppController.h" 30 | #import "AppDelegate.h" 31 | #import "RootViewController.h" 32 | #import "platform/ios/CCEAGLView-ios.h" 33 | 34 | @implementation AppController 35 | 36 | #pragma mark - 37 | #pragma mark Application lifecycle 38 | 39 | // cocos2d application instance 40 | static AppDelegate s_sharedApplication; 41 | 42 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 43 | { 44 | 45 | // Override point for customization after application launch. 46 | 47 | // Add the view controller's view to the window and display. 48 | window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; 49 | CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds] 50 | pixelFormat: kEAGLColorFormatRGBA8 51 | depthFormat: GL_DEPTH24_STENCIL8_OES 52 | preserveBackbuffer: NO 53 | sharegroup: nil 54 | multiSampling: NO 55 | numberOfSamples: 0 ]; 56 | 57 | [eaglView setMultipleTouchEnabled:YES]; 58 | 59 | // Use RootViewController manage CCEAGLView 60 | viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; 61 | viewController.wantsFullScreenLayout = YES; 62 | viewController.view = eaglView; 63 | 64 | // Set RootViewController to window 65 | if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0) 66 | { 67 | // warning: addSubView doesn't work on iOS6 68 | [window addSubview: viewController.view]; 69 | } 70 | else 71 | { 72 | // use this method on ios6 73 | [window setRootViewController:viewController]; 74 | } 75 | 76 | [window makeKeyAndVisible]; 77 | 78 | [[UIApplication sharedApplication] setStatusBarHidden: YES]; 79 | 80 | // IMPORTANT: Setting the GLView should be done after creating the RootViewController 81 | cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView(eaglView); 82 | cocos2d::Director::getInstance()->setOpenGLView(glview); 83 | 84 | cocos2d::Application::getInstance()->run(); 85 | return YES; 86 | } 87 | 88 | 89 | - (void)applicationWillResignActive:(UIApplication *)application { 90 | /* 91 | 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. 92 | 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. 93 | */ 94 | cocos2d::Director::getInstance()->pause(); 95 | } 96 | 97 | - (void)applicationDidBecomeActive:(UIApplication *)application { 98 | /* 99 | 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. 100 | */ 101 | cocos2d::Director::getInstance()->resume(); 102 | } 103 | 104 | - (void)applicationDidEnterBackground:(UIApplication *)application { 105 | /* 106 | 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. 107 | If your application supports background execution, called instead of applicationWillTerminate: when the user quits. 108 | */ 109 | cocos2d::Application::getInstance()->applicationDidEnterBackground(); 110 | } 111 | 112 | - (void)applicationWillEnterForeground:(UIApplication *)application { 113 | /* 114 | 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. 115 | */ 116 | cocos2d::Application::getInstance()->applicationWillEnterForeground(); 117 | } 118 | 119 | - (void)applicationWillTerminate:(UIApplication *)application { 120 | /* 121 | Called when the application is about to terminate. 122 | See also applicationDidEnterBackground:. 123 | */ 124 | } 125 | 126 | 127 | #pragma mark - 128 | #pragma mark Memory management 129 | 130 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 131 | /* 132 | Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. 133 | */ 134 | cocos2d::Director::getInstance()->purgeCachedData(); 135 | } 136 | 137 | 138 | - (void)dealloc { 139 | [super dealloc]; 140 | } 141 | 142 | 143 | @end 144 | 145 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default-568h@2x.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Default@2x.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-100.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-114.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-120.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-144.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-152.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-29.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-40.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-50.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-57.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-58.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-72.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-76.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Icon-80.png -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | Icon-72.png 14 | Icon-144.png 15 | Icon-57.png 16 | Icon-114.png 17 | 18 | CFBundleIcons 19 | 20 | CFBundlePrimaryIcon 21 | 22 | CFBundleIconFiles 23 | 24 | Icon-80 25 | Icon-58 26 | Icon-29 27 | Icon-120 28 | Icon-72.png 29 | Icon-57.png 30 | Icon-114.png 31 | Icon-144.png 32 | 33 | UIPrerenderedIcon 34 | 35 | 36 | 37 | CFBundleIcons~ipad 38 | 39 | CFBundlePrimaryIcon 40 | 41 | CFBundleIconFiles 42 | 43 | Icon-58 44 | Icon-29 45 | Icon-80 46 | Icon-40 47 | Icon-100 48 | Icon-50 49 | Icon-152 50 | Icon-76 51 | Icon-120 52 | Icon-72.png 53 | Icon-57.png 54 | Icon-114.png 55 | Icon-144.png 56 | 57 | UIPrerenderedIcon 58 | 59 | 60 | 61 | CFBundleIdentifier 62 | $(PRODUCT_BUNDLE_IDENTIFIER) 63 | CFBundleInfoDictionaryVersion 64 | 6.0 65 | CFBundleName 66 | ${PRODUCT_NAME} 67 | CFBundlePackageType 68 | APPL 69 | CFBundleShortVersionString 70 | 1.0.0 71 | CFBundleSignature 72 | ???? 73 | CFBundleVersion 74 | 1.0 75 | LSRequiresIPhoneOS 76 | 77 | NSAppTransportSecurity 78 | 79 | NSAllowsArbitraryLoads 80 | 81 | 82 | UIPrerenderedIcon 83 | 84 | UIRequiredDeviceCapabilities 85 | 86 | accelerometer 87 | 88 | opengles-1 89 | 90 | 91 | UIRequiresFullScreen 92 | 93 | UIStatusBarHidden 94 | 95 | UISupportedInterfaceOrientations 96 | 97 | UIInterfaceOrientationLandscapeRight 98 | UIInterfaceOrientationLandscapeLeft 99 | 100 | 101 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ReflectionSample' target in the 'ReflectionSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2010 Ricardo Quesada 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import 27 | 28 | 29 | @interface RootViewController : UIViewController { 30 | 31 | } 32 | - (BOOL)prefersStatusBarHidden; 33 | @end 34 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/RootViewController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | Copyright (c) 2010 Ricardo Quesada 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import "RootViewController.h" 27 | #import "cocos2d.h" 28 | #import "platform/ios/CCEAGLView-ios.h" 29 | 30 | @implementation RootViewController 31 | 32 | /* 33 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 34 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 35 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 36 | // Custom initialization 37 | } 38 | return self; 39 | } 40 | */ 41 | 42 | /* 43 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 44 | - (void)loadView { 45 | } 46 | */ 47 | 48 | /* 49 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 50 | - (void)viewDidLoad { 51 | [super viewDidLoad]; 52 | } 53 | 54 | */ 55 | // Override to allow orientations other than the default portrait orientation. 56 | // This method is deprecated on ios6 57 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 58 | return UIInterfaceOrientationIsLandscape( interfaceOrientation ); 59 | } 60 | 61 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead 62 | - (NSUInteger) supportedInterfaceOrientations{ 63 | #ifdef __IPHONE_6_0 64 | return UIInterfaceOrientationMaskAllButUpsideDown; 65 | #endif 66 | } 67 | 68 | - (BOOL) shouldAutorotate { 69 | return YES; 70 | } 71 | 72 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 73 | [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; 74 | 75 | cocos2d::GLView *glview = cocos2d::Director::getInstance()->getOpenGLView(); 76 | if (glview) 77 | { 78 | CCEAGLView *eaglview = (CCEAGLView*)glview->getEAGLView(); 79 | 80 | if (eaglview) 81 | { 82 | CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); 83 | cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); 84 | } 85 | } 86 | } 87 | 88 | //fix not hide status on ios7 89 | - (BOOL)prefersStatusBarHidden 90 | { 91 | return YES; 92 | } 93 | 94 | - (void)didReceiveMemoryWarning { 95 | // Releases the view if it doesn't have a superview. 96 | [super didReceiveMemoryWarning]; 97 | 98 | // Release any cached data, images, etc that aren't in use. 99 | } 100 | 101 | - (void)viewDidUnload { 102 | [super viewDidUnload]; 103 | // Release any retained subviews of the main view. 104 | // e.g. self.myOutlet = nil; 105 | } 106 | 107 | 108 | - (void)dealloc { 109 | [super dealloc]; 110 | } 111 | 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/ios/main.m: -------------------------------------------------------------------------------- 1 | 2 | 3 | #import 4 | 5 | int main(int argc, char *argv[]) { 6 | 7 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 8 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 9 | [pool release]; 10 | return retVal; 11 | } 12 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.ios_mac/mac/Icon.icns -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.games 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSAppTransportSecurity 30 | 31 | NSAllowsArbitraryLoads 32 | 33 | 34 | NSHumanReadableCopyright 35 | Copyright © 2013. All rights reserved. 36 | NSMainNibFile 37 | MainMenu 38 | NSPrincipalClass 39 | NSApplication 40 | 41 | 42 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/mac/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.ios_mac/mac/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #include "AppDelegate.h" 26 | #include "cocos2d.h" 27 | 28 | USING_NS_CC; 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | AppDelegate app; 33 | return Application::getInstance()->run(); 34 | } 35 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/ReflectionSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest 7 | 8 | 9 | {ccb2323b-1cfa-41ea-bcf4-ba5f07309396} 10 | 11 | 12 | {e93a77e1-af1e-4400-87d3-504b62ebdbb0} 13 | 14 | 15 | 16 | 17 | win32 18 | 19 | 20 | Classes 21 | 22 | 23 | 24 | 25 | Classes 26 | 27 | 28 | win32 29 | 30 | 31 | 32 | 33 | 34 | resource 35 | 36 | 37 | 38 | 39 | resource 40 | 41 | 42 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/ReflectionSample.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(OutDir) 5 | WindowsLocalDebugger 6 | 7 | 8 | $(OutDir) 9 | WindowsLocalDebugger 10 | 11 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "copy_resources": [ 3 | { 4 | "from": "../../../src", 5 | "to": "src" 6 | }, 7 | { 8 | "from": "../../../res", 9 | "to": "res" 10 | }, 11 | { 12 | "from": "../../../main.js", 13 | "to": "" 14 | }, 15 | { 16 | "from": "../../../project.json", 17 | "to": "" 18 | }, 19 | { 20 | "from": "/Users/panda/StudyWork/Cocos/fireball/cocos2d-x/cocos/scripting/js-bindings/script", 21 | "to": "script" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/game.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // Chinese (Simplified, PRC) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) 19 | LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED 20 | #pragma code_page(936) 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 2 TEXTINCLUDE 29 | BEGIN 30 | "#include ""afxres.h""\r\n" 31 | "\0" 32 | END 33 | 34 | 3 TEXTINCLUDE 35 | BEGIN 36 | "\r\n" 37 | "\0" 38 | END 39 | 40 | #endif // APSTUDIO_INVOKED 41 | 42 | #endif // Chinese (Simplified, PRC) resources 43 | ///////////////////////////////////////////////////////////////////////////// 44 | 45 | 46 | ///////////////////////////////////////////////////////////////////////////// 47 | // English (United States) resources 48 | 49 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 50 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 51 | #pragma code_page(1252) 52 | 53 | #ifdef APSTUDIO_INVOKED 54 | ///////////////////////////////////////////////////////////////////////////// 55 | // 56 | // TEXTINCLUDE 57 | // 58 | 59 | 1 TEXTINCLUDE 60 | BEGIN 61 | "resource.h\0" 62 | END 63 | 64 | #endif // APSTUDIO_INVOKED 65 | 66 | 67 | ///////////////////////////////////////////////////////////////////////////// 68 | // 69 | // Icon 70 | // 71 | 72 | // Icon with lowest ID value placed first to ensure application icon 73 | // remains consistent on all systems. 74 | GLFW_ICON ICON "res\\game.ico" 75 | 76 | ///////////////////////////////////////////////////////////////////////////// 77 | // 78 | // Version 79 | // 80 | 81 | VS_VERSION_INFO VERSIONINFO 82 | FILEVERSION 1,0,0,1 83 | PRODUCTVERSION 1,0,0,1 84 | FILEFLAGSMASK 0x3fL 85 | #ifdef _DEBUG 86 | FILEFLAGS 0x1L 87 | #else 88 | FILEFLAGS 0x0L 89 | #endif 90 | FILEOS 0x4L 91 | FILETYPE 0x2L 92 | FILESUBTYPE 0x0L 93 | BEGIN 94 | BLOCK "StringFileInfo" 95 | BEGIN 96 | BLOCK "040904B0" 97 | BEGIN 98 | VALUE "FileDescription", "game Module" 99 | VALUE "FileVersion", "1, 0, 0, 1" 100 | VALUE "InternalName", "game" 101 | VALUE "LegalCopyright", "Copyright " 102 | VALUE "OriginalFilename", "game.exe" 103 | VALUE "ProductName", "game Module" 104 | VALUE "ProductVersion", "1, 0, 0, 1" 105 | END 106 | END 107 | BLOCK "VarFileInfo" 108 | BEGIN 109 | VALUE "Translation", 0x409, 1200 110 | END 111 | END 112 | 113 | #endif // English (United States) resources 114 | ///////////////////////////////////////////////////////////////////////////// 115 | 116 | 117 | 118 | #ifndef APSTUDIO_INVOKED 119 | ///////////////////////////////////////////////////////////////////////////// 120 | // 121 | // Generated from the TEXTINCLUDE 3 resource. 122 | // 123 | 124 | 125 | ///////////////////////////////////////////////////////////////////////////// 126 | #endif // not APSTUDIO_INVOKED 127 | 128 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "AppDelegate.h" 3 | 4 | USING_NS_CC; 5 | 6 | // uncomment below line, open debug console 7 | // #define USE_WIN32_CONSOLE 8 | 9 | int APIENTRY _tWinMain(HINSTANCE hInstance, 10 | HINSTANCE hPrevInstance, 11 | LPTSTR lpCmdLine, 12 | int nCmdShow) 13 | { 14 | UNREFERENCED_PARAMETER(hPrevInstance); 15 | UNREFERENCED_PARAMETER(lpCmdLine); 16 | 17 | #ifdef USE_WIN32_CONSOLE 18 | AllocConsole(); 19 | freopen("CONIN$", "r", stdin); 20 | freopen("CONOUT$", "w", stdout); 21 | freopen("CONOUT$", "w", stderr); 22 | #endif 23 | 24 | // create the application instance 25 | AppDelegate app; 26 | int ret = Application::getInstance()->run(); 27 | 28 | #ifdef USE_WIN32_CONSOLE 29 | FreeConsole(); 30 | #endif 31 | 32 | return ret; 33 | } 34 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | // Windows Header Files: 7 | #include 8 | 9 | // C RunTime Header Files 10 | #include "CCStdC.h" 11 | 12 | #endif // __WINMAIN_H__ 13 | -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/res/game.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/frameworks/runtime-src/proj.win32/res/game.ico -------------------------------------------------------------------------------- /build/jsb-link/frameworks/runtime-src/proj.win32/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by game.rc 4 | // 5 | #define IDS_PROJNAME 100 6 | #define IDR_TESTJS 100 7 | 8 | // Next default values for new objects 9 | // 10 | #ifdef APSTUDIO_INVOKED 11 | #ifndef APSTUDIO_READONLY_SYMBOLS 12 | #define _APS_NEXT_RESOURCE_VALUE 204 13 | #define _APS_NEXT_COMMAND_VALUE 32785 14 | #define _APS_NEXT_CONTROL_VALUE 1001 15 | #define _APS_NEXT_SYMED_VALUE 101 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /build/jsb-link/main.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 3 | 'use strict'; 4 | 5 | function boot () { 6 | 7 | var settings = window._CCSettings; 8 | window._CCSettings = undefined; 9 | 10 | if ( !settings.debug ) { 11 | // retrieve minified raw assets 12 | var rawAssets = settings.rawAssets; 13 | var assetTypes = settings.assetTypes; 14 | for (var mount in rawAssets) { 15 | var entries = rawAssets[mount]; 16 | for (var uuid in entries) { 17 | var entry = entries[uuid]; 18 | var type = entry[1]; 19 | if (typeof type === 'number') { 20 | entry[1] = assetTypes[type]; 21 | } 22 | } 23 | } 24 | } 25 | 26 | // init engine 27 | var canvas; 28 | 29 | if (cc.sys.isBrowser) { 30 | canvas = document.getElementById('GameCanvas'); 31 | } 32 | 33 | function setLoadingDisplay () { 34 | // Loading splash scene 35 | var splash = document.getElementById('splash'); 36 | var progressBar = splash.querySelector('.progress-bar span'); 37 | var currentResCount = cc.loader.getResCount(); 38 | cc.loader.onProgress = function (completedCount, totalCount, item) { 39 | var percent = 100 * (completedCount - currentResCount) / (totalCount - currentResCount); 40 | if (progressBar) { 41 | progressBar.style.width = percent.toFixed(2) + '%'; 42 | } 43 | }; 44 | splash.style.display = 'block'; 45 | 46 | cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () { 47 | splash.style.display = 'none'; 48 | }); 49 | } 50 | 51 | var onStart = function () { 52 | cc.view.resizeWithBrowserSize(true); 53 | // UC browser on many android devices have performance issue with retina display 54 | if (cc.sys.os !== cc.sys.OS_ANDROID || cc.sys.browserType !== cc.sys.BROWSER_TYPE_UC) { 55 | cc.view.enableRetina(true); 56 | } 57 | //cc.view.setDesignResolutionSize(settings.designWidth, settings.designHeight, cc.ResolutionPolicy.SHOW_ALL); 58 | 59 | if (cc.sys.isBrowser) { 60 | setLoadingDisplay(); 61 | } 62 | 63 | if (cc.sys.isMobile) { 64 | if (settings.orientation === 'landscape') { 65 | cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); 66 | } 67 | else if (settings.orientation === 'portrait') { 68 | cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); 69 | } 70 | cc.view.enableAutoFullScreen(cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU); 71 | } 72 | 73 | // init assets 74 | cc.AssetLibrary.init({ 75 | libraryPath: 'res/import', 76 | rawAssetsBase: 'res/raw-', 77 | rawAssets: settings.rawAssets, 78 | packedAssets: settings.packedAssets 79 | }); 80 | 81 | var launchScene = settings.launchScene; 82 | 83 | // load scene 84 | if (cc.runtime) { 85 | cc.director.setRuntimeLaunchScene(launchScene); 86 | } 87 | cc.director.loadScene(launchScene, null, 88 | function () { 89 | if (cc.sys.isBrowser) { 90 | // show canvas 91 | canvas.style.visibility = ''; 92 | var div = document.getElementById('GameDiv'); 93 | if (div) { 94 | div.style.backgroundImage = ''; 95 | } 96 | } 97 | 98 | // play game 99 | // cc.game.resume(); 100 | 101 | console.log('Success to load scene: ' + launchScene); 102 | } 103 | ); 104 | }; 105 | 106 | // jsList 107 | var jsList = settings.jsList; 108 | var bundledScript = settings.debug ? 'project.dev.js' : 'project.js'; 109 | if (jsList) { 110 | jsList.push(bundledScript); 111 | } 112 | else { 113 | jsList = [bundledScript]; 114 | } 115 | 116 | // anysdk scripts 117 | if (cc.sys.isNative && cc.sys.isMobile) { 118 | jsList = jsList.concat(['jsb_anysdk.js', 'jsb_anysdk_constants.js']); 119 | } 120 | 121 | jsList = jsList.map(function (x) { return 'src/' + x; }); 122 | 123 | var option = { 124 | //width: width, 125 | //height: height, 126 | id: 'GameCanvas', 127 | scenes: settings.scenes, 128 | debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR, 129 | showFPS: settings.debug, 130 | frameRate: 60, 131 | jsList: jsList, 132 | groupList: settings.groupList, 133 | collisionMatrix: settings.collisionMatrix 134 | }; 135 | 136 | cc.game.run(option, onStart); 137 | } 138 | 139 | if (window.document) { 140 | var splash = document.getElementById('splash'); 141 | splash.style.display = 'block'; 142 | 143 | var cocos2d = document.createElement('script'); 144 | cocos2d.async = true; 145 | cocos2d.src = window._CCSettings.debug ? 'cocos2d-js.js' : 'cocos2d-js-min.js'; 146 | 147 | var engineLoaded = function () { 148 | document.body.removeChild(cocos2d); 149 | cocos2d.removeEventListener('load', engineLoaded, false); 150 | boot(); 151 | }; 152 | cocos2d.addEventListener('load', engineLoaded, false); 153 | document.body.appendChild(cocos2d); 154 | } 155 | else if (window.jsb) { 156 | require('src/settings.js'); 157 | require('src/jsb_polyfill.js'); 158 | 159 | boot(); 160 | } 161 | 162 | })(); 163 | -------------------------------------------------------------------------------- /build/jsb-link/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_type": "javascript", 3 | "debugMode": 1, 4 | "showFPS": true, 5 | "frameRate": 60, 6 | "id": "GameCanvas", 7 | "renderMode": 0, 8 | "jsList": [] 9 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/29/29158224-f8dd-4661-a796-1ffab537140e.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "default_btn_disabled", 5 | "texture": "71561142-4c83-4933-afca-cb7a17f67053", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 40, 10 | 40 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 40, 18 | 40 19 | ], 20 | "capInsets": [ 21 | 4, 22 | 4, 23 | 4, 24 | 8 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/31/31bc895a-c003-4566-a9f3-2e54ae1c17dc.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "HelloWorld", 5 | "texture": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 195, 10 | 270 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 195, 18 | 270 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/41/410fb916-8721-4663-bab8-34397391ace7.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "singleColor", 5 | "texture": "a8027877-d8d6-4645-97a0-52d4a0123dba", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 2, 10 | 2 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 2, 18 | 2 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/8c/8cdb44ac-a3f6-449f-b354-7cd48cf84061.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "default_sprite", 5 | "texture": "6e056173-d285-473c-b206-40a7fff5386e", 6 | "rect": [ 7 | 0, 8 | 2, 9 | 40, 10 | 36 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 40, 18 | 40 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/d0/d0c8122a-8540-48c5-bd24-6d93357100fd.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "home_bg_big", 5 | "texture": "5d5dab5f-4ad0-47d9-81f7-315d1cd135d8", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 1136, 10 | 768 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 1136, 18 | 768 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/e9/e9ec654c-97a2-4787-9325-e6a10375219a.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "default_btn_pressed", 5 | "texture": "b43ff3c2-02bb-4874-81f7-f2dea6970f18", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 40, 10 | 40 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 40, 18 | 40 19 | ], 20 | "capInsets": [ 21 | 3, 22 | 4, 23 | 3, 24 | 4 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /build/jsb-link/res/import/f0/f0048c10-f03e-4c97-b9d3-3506e1d58952.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type__": "cc.SpriteFrame", 3 | "content": { 4 | "name": "default_btn_normal", 5 | "texture": "e851e89b-faa2-4484-bea6-5c01dd9f06e2", 6 | "rect": [ 7 | 0, 8 | 0, 9 | 40, 10 | 40 11 | ], 12 | "offset": [ 13 | 0, 14 | 0 15 | ], 16 | "originalSize": [ 17 | 40, 18 | 40 19 | ], 20 | "capInsets": [ 21 | 3, 22 | 3, 23 | 3, 24 | 7 25 | ] 26 | } 27 | } -------------------------------------------------------------------------------- /build/jsb-link/res/raw-assets/Texture/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-assets/Texture/HelloWorld.png -------------------------------------------------------------------------------- /build/jsb-link/res/raw-assets/Texture/home_bg_big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-assets/Texture/home_bg_big.jpg -------------------------------------------------------------------------------- /build/jsb-link/res/raw-assets/Texture/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-assets/Texture/singleColor.png -------------------------------------------------------------------------------- /build/jsb-link/res/raw-internal/image/default_btn_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-internal/image/default_btn_disabled.png -------------------------------------------------------------------------------- /build/jsb-link/res/raw-internal/image/default_btn_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-internal/image/default_btn_normal.png -------------------------------------------------------------------------------- /build/jsb-link/res/raw-internal/image/default_btn_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-internal/image/default_btn_pressed.png -------------------------------------------------------------------------------- /build/jsb-link/res/raw-internal/image/default_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pandamicro/ReflectionSample/8e3fb34a6d03b9d5a68100912150ec3fa1286a3b/build/jsb-link/res/raw-internal/image/default_sprite.png -------------------------------------------------------------------------------- /build/jsb-link/src/project.dev.js: -------------------------------------------------------------------------------- 1 | require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o