Commit Graph

120 Commits

Author SHA1 Message Date
James Chen 442c149053 Implements Application::restart and some fixes. (#1253)
* Implements Application::restart.

* SAFE_DEC_REF should reset pointer to nullptr.

* Class::cleanup should be after of JSGlobalContextRelease.

* WebGLObject needs to be released if ScriptEngine is in cleanup process.

* Fixes memory leak in JSB_glGetActiveAttrib
2018-05-21 18:46:12 +08:00
James Chen 391e6e536e Supports text stroke for macOS, iOS and Android. (#1250)
* Supports stroke for mac.

* Supports text stroke for ios.

* Supports text stroke for android.

* typo fix in CanvasRenderingContext2DImpl.java.
2018-05-21 11:38:05 +08:00
minggo 8a76997242 adapt mac resolution (#1248) 2018-05-18 11:57:12 +08:00
minggo 4a13d0e15e Downsample (#1245)
* support render texture

* use texture unit 0

* add functions to set device pixel ratio

* add ccDeleteBuffers again

* fix according comments
2018-05-17 14:05:05 +08:00
James Chen 07cc734c8c setAnimationInterval -> setPreferredFramesPerSecond and binds setPreferredFramesPerSeconds. (#1244)
* setAnimationInterval -> setPreferredFramesPerSecond.

* Binds setPreferredFramesPerSeconds.

* typo fix in CCApplication-win32.cpp
2018-05-16 18:06:26 +08:00
James Chen 58361e1b2d Avoid to create canvas buffer twice. (#1242)
* Avoid to create canvas buffer twice.

* Remove unused condition code in Cocos2dxActivity.java
2018-05-15 11:00:52 +08:00
Vincent Yang 0bb96987e7 [bug] android nativeFinish don't release some object. (#1241) 2018-05-14 18:06:15 +08:00
James Chen 727a4911d4 [runtime] Adds jsb.openURL, __getOSVersion, __getCurrentLanguage interfaces. (#1238) 2018-05-11 16:03:17 +08:00
Vincent Yang bdb941eb4a [bug] some jni methods don't declare JNICALL modifier. (#1236) 2018-05-11 10:44:41 +08:00
Vincent Yang 4042dc6a87 [bug] CCFileUtils can't read apk's assets when apk isn't default resource root. (#1235) 2018-05-11 09:46:09 +08:00
James Chen 53ffc817ee Fixes JNI memory leak in CanvasRenderingContext2DImpl::fillData (#1230)
* Fixes JNI memory leak in CanvasRenderingContext2DImpl::fillData

* typo fix.
2018-05-08 10:56:48 +08:00
James Chen 2e71076053 Display whether GL opt mode is enabled. (#1217) 2018-04-26 16:49:02 +08:00
James Chen 57f8268e14 Display whether GL Opt mode is enabled! (#1216) 2018-04-26 16:46:40 +08:00
James Chen ae5c569345 Adds jsb.openDebugView interface, supports to display JSB invocation count. (#1214)
* Adds jsb.openDebugView interface, supports to display JSB invocation count.

* Removes unused log in JniImp.cpp.

* Removes unused log in Cocos2dxRenderer.java
2018-04-26 15:59:20 +08:00
James Chen ad94db2c71 Binds getFramebufferAttachmentParameter and fix memory issues in uniform[1234]v. (#1204)
* Binds getFramebufferAttachmentParameter and fix memory issues in uniform[1234]v.

* FPS uses integer.

* revert.

* Removes unused import package.
2018-04-20 17:25:10 +08:00
James Chen f944be8574 Adds DebugView support. (#1203) 2018-04-20 14:53:16 +08:00
James Chen a1321302b4 Rename __gl to __ccgl to avoid conflict. Memory issue fixes in JSB_glGetProgramInfoLog and JSB_glGetShaderInfoLog (#1201)
* Revert "Removes FPS display code in Cocos2dxRenderer.java."

This reverts commit 71984ef41c.

* Rename __gl to __ccgl to avoid conflict.

* memory issue fixes in JSB_glGetProgramInfoLog and JSB_glGetShaderInfoLog

* Adds FIXME for FPS display in Cocos2dxRenderer.java.
2018-04-20 10:35:33 +08:00
James Chen 71984ef41c Removes FPS display code in Cocos2dxRenderer.java. 2018-04-19 13:55:37 +08:00
James Chen 2794f40efa Merge branch 'runtime' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/platform/android/jni/JniImp.cpp
2018-04-19 13:50:34 +08:00
Vincent Yang 425033df4b Add nativeFinish JNI for destruct game script env. (#1197)
Add nativeFinish JNI for destruct game script env.
2018-04-17 11:38:59 +08:00
James Chen 58310293f2 more cache fix. 2018-04-14 15:59:18 +08:00
James Chen 22c9dd2b5a FPS output., file:// scheme check. glTexSubImage2D binding fix. 2018-04-12 14:57:34 +08:00
James Chen b6a3153435 [android] Fix CanvasRenderingContext2D. Call fillData after recreateBuffer. System Font is displayed correctly on Android now. 2018-04-09 13:56:40 +08:00
James Chen 4397330777 [runtime, android] Fix local reference table overflow error problem in CCCanvasRenderingContext2D-android.cpp. (#1180) 2018-04-03 14:34:48 +08:00
James Chen 0bd5c94c84 updates buildTooVersion to 27.0.3. Uses implementation instead of compile. (#1177) 2018-03-31 20:26:17 +08:00
James Chen 3c1da2db6c alphabetic textBaseline support. (#1173) 2018-03-29 16:24:36 +08:00
James Chen 73eb73c690 [android] textAlign supports 'middle'. recreate buffer in the constructor of CanvasRenderingContext2D. (#1172)
* [android] textAlign supports 'middle'. recreate buffer in the constructor of CanvasRenderingContext2D.

* bug fix in CanvasRenderingContext2DImpl.java

* java version 1.8
2018-03-29 15:50:38 +08:00
James Chen c341d94d1a Adds missing function implementation. (#1161) 2018-03-22 16:16:10 +08:00
James Chen febfbe67df Custom TTF font is supported for Android too. (#1155) 2018-03-20 15:49:25 +08:00
James Chen d1abdf6065 Adds Cocos2dxRenderer.setOnGameEngineInitialziedListener. (#1152) 2018-03-17 11:49:27 +08:00
James Chen bf1b4f7124 [runtime] Audio works. (#1151) 2018-03-17 11:22:56 +08:00
James Chen 9b2aaf1cd0 getImageInfo is async method now. Clear autoreleasepool at the end of frame. (#1150) 2018-03-17 09:48:32 +08:00
James Chen 5122d14e24 [runtime] CocosRenderer.nativeInit supports to pass a default resource path. (#1149)
* FileUtils::setDefaultResourcePath fix.

* CocosRenderer.nativeInit supports to pass a default resource path.
2018-03-16 11:00:19 +08:00
James Chen c3602eb1e3 [runtime] Android testcase works. (#1148)
* Adds jsb_run_script_module for CommonJS module, reverts original `require`.

* Uses window.gameTick for sending tick event.

* Removes unused scripts.

* Android testcase works.
2018-03-15 18:12:38 +08:00
James Chen 2c3a86f7b1 [new-renderer] Label on android works. (#1146)
* Android HelloWorld without label works.

* Label on android works.
2018-03-14 21:19:51 +08:00
James Chen f0a79242d7 Android compile ok. (#1145)
* Android compile ok.

* Fixes for Android build .
2018-03-14 10:28:03 +08:00
minggo 0d483a9b07 add back network (#1141)
* add back network

* add network back on windows
2018-03-09 16:20:48 +08:00
minggo c4c24c9d54 windows works with new renderer (#1137) 2018-03-07 14:31:46 +08:00
minggo aa3d6f0cde remove unneed files (#1135) 2018-02-28 17:24:34 +08:00
minggo cd0e15cd7f refactor android with new renderer (#1133) 2018-02-28 14:55:33 +08:00
minggo 802e48080e New renderer (#1097)
* build work on mac

* build ok on iOS

* fix compiling error on android

* fix android link error
2018-02-08 10:40:29 +08:00
Jare Guo d9bd3d763c update license (#1089)
* updating license

* update license
2018-02-01 15:20:01 +08:00
James Chen 69798998db Adds cc.sys.getBatteryLevel & cc.sys.getNetworkType APIs (#1071)
* Adds cc.Device.getBatteryLevel interface.

* Adds CCReachability.h/.cpp

* Adds CCReachability.h/.cpp

* Reachability supports macOS either.

* Adds cc.Device.getNetworkStatus interface.

* Removed debug log.

* cc.Device.NetworkStatus -> cc.Device.NetworkType

* API to sys namespace

* Update CCDevice-win32.cpp
2018-01-29 17:37:15 +08:00
Knox 7c81e99b67 add Volume and Mute to CCVideoPlayer for fireball/issues/6811 (#1056)
* add Volume and Mute to CCVideoPlayer for fireball/issues/6811

* refine code
2018-01-16 10:49:00 +08:00
James Chen 0cfbfd08f7 Kill process if Cocos2dxActivity.onDestroy is invoked to resolve crash if app goes to background for a long time and Activity is recycled by system. (#1027) 2017-12-12 11:10:51 +08:00
James Chen 44813f4166 Sync PR: cocos2d-x #18299: JNI ERROR (app bug): local reference table overflow (max=512) (#1024)
* Sync PR:  cocos2d-x #18299: JNI ERROR (app bug): local reference table overflow (max=512)

* Fixes potential memory leak if can't find class by jsb.reflection.callStaticMethod.
2017-12-08 18:25:04 +08:00
James Chen 2b463b2b84 Updates libcocosanalytics.jar 2017-11-07 16:05:22 +08:00
James Chen 6a8106c5f3 Updates Cocos Analytics relevant code.
Adds missing onPause, onResume, onDestroy invocation.
Disabled local debug by default.
Uses AnySDK channel ID in APK or IPA file if channel ID isn't found.
2017-11-03 15:19:03 +08:00
James Chen 2c793ac5ba Android Studio 3.0 Support.
Depends on https://github.com/cocos-creator/cocos2d-console/pull/49
2017-10-30 11:28:34 +08:00
James Chen 873cb81a27 Adds missing file CAAgentWrapper.java (#933) 2017-10-26 10:05:08 +08:00