Commit Graph

73 Commits

Author SHA1 Message Date
leda 4ddd2aee0d close audio device properly (#1552) 2018-10-19 17:03:06 +08:00
leda dada2eb244 move "cocos2d::experimental::" to "cocos2d::" on Audio (#1549)
* remove “experimental” in audio dir

* update audio bindings

* fix "{" match error

* no need "experimental" for thread pool

* remove both out-of-date js api files
2018-10-18 13:34:12 +08:00
Arnold 9a1f054471 change field Application::_scheduler to static (#1536)
* make Applicatino::_scheduler static

* fix mac projfile

* keep scheduler permanent

* remove commented code
2018-10-11 11:22:08 +08:00
leda c74745eee4 add "getSafeAreaEdge" interface to get SafeArea edge insets (#1502)
* try to resume iPhone X support

* gen binding code

* only get SafeAreaEdge on native

* add getSafeAreaEdge for others

* update binding-generator
2018-09-10 10:14:23 +08:00
leda 09985f002b adapt to fps in the main loop on mac (#1489) 2018-08-30 12:48:34 +08:00
leda 463e37e4d8 fix no sleep in main loop on mac (#1472) 2018-08-23 16:25:10 +08:00
leda 3873d01bdd fix depend error on application.h (#1458)
* correct event type

* move isDisplayStats Impl from header to source file

* correct header file depend for application-ios

* same header changes on win32
2018-08-16 13:34:36 +08:00
leda 86122c859a close audio device when destruct Application (#1442)
* close audio device when destruct Application

* added android

* correct header include

* remove TODO: destroy DeviceGraphics
2018-08-08 08:55:26 +08:00
minggo b3122ea9e5 add a function to terminate application (#1434) 2018-08-02 10:46:35 +08:00
James Chen cad6cb9971 Uses the same CCCanvasRenderingContext2D for apple platforms (iOS/macOS). (#1281) 2018-06-02 17:52:54 +08:00
James Chen cf7f3770b7 Supports drawing path API and refactor CCCanvasRenderingContext2D for macOS. (#1280)
* Uses CGBitmapContextCreate instead of NSImage for macOS, the CCCanvasRenderingContext2D is similiar as which on iOS now.

* Supports drawing line API.

* Supports drawing line API for Android too.
2018-06-01 22:59:07 +08:00
James Chen 5245664704 Adds Device::getDeviceModel method. (#1276) 2018-05-31 14:13:28 +08:00
James Chen 712173a8de Supports DeviceMotionEvent and removes more unused code. (#1275)
* Binds Device class

* Removes ccFPSImage.c/h

* Updates Android.mk

* Supports DeviceMotionEvent and removes more unused code.

* Uses fprintf to implement SE_LOGD & SE_LOGE .
2018-05-31 14:08:20 +08:00
James Chen 61accc6d11 Fixed the issue that text is probably cut. (#1268) 2018-05-28 11:45:07 +08:00
James Chen 1bb1806099 Supports Compressed Textures. (#1260)
* Updates CCConfiguration.h/.cpp.

* Supports Compressed Textures.

* Constructs Configuration singleton in Application constructor.

* Move Configuration::getInstance after createView.
2018-05-23 19:10:49 +08:00
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
James Chen 727a4911d4 [runtime] Adds jsb.openURL, __getOSVersion, __getCurrentLanguage interfaces. (#1238) 2018-05-11 16:03:17 +08:00
minggo d98484654f Optimize (#1202)
* fix some bugs

* fix binding codes of Texture2D::updateSubImage()
2018-04-20 14:31:52 +08:00
James Chen b34b517435 DeviceGraphics::getInstance fix. 2018-04-19 13:41:08 +08:00
James Chen 1fa4ea0e6f Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/renderer/gfx/IndexBuffer.cpp
#	cocos/renderer/gfx/VertexBuffer.cpp
2018-04-19 11:23:36 +08:00
James Chen 58310293f2 more cache fix. 2018-04-14 15:59:18 +08:00
James Chen 3dfe05f4cc glBindXXX glActiveTexture cache. 2018-04-14 13:43:44 +08:00
James Chen 00675026d9 [mac] Fix CanvasRenderingContext2D. 2018-04-09 13:55:36 +08:00
James Chen ed017b2e01 Merge branch 'runtime' into new-renderer
# Conflicts:
#	cocos/renderer/gfx/Texture2D.cpp
2018-04-03 21:04:15 +08:00
James Chen 3c1da2db6c alphabetic textBaseline support. (#1173) 2018-03-29 16:24:36 +08:00
James Chen a668496b8e Comments initializing DeviceGraphics and textAlign supports middle. (#1171)
* Comments initializing DeviceGraphics since runtime doesn't need renderer stuff temporarily.

* textAlign supports middle.

* reverts.
2018-03-28 21:26:08 +08:00
James Chen 4ee7981630 Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into runtime
# Conflicts:
#	cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm
#	cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp
2018-03-23 15:42:12 +08:00
James Chen 7667b00f87 More WebGL binding fixes. (#1160)
* Less opengl binding files.

* recreateBuffer in CanvasRendereringContext2D constructor.

* gl.bindFrameBuffer(gl.FRAME_BUFFER, null) needs to set to default frame buffer .

* Fixes JSB_glGetActiveUniform use GL_ACTIVE_ATTRIBUTE_MAX_LENGTH to get the max length, we need to use GL_ACTIVE_UNIFORM_MAX_LENGTH instead.

* glBufferSubData supports typedarray with 0 length. Adds more API for CanvasRenderingContext2D.
2018-03-22 16:03:34 +08:00
minggo 610658e5a6 h5 adpator (#1156) 2018-03-21 09:30:05 +08:00
James Chen 1edc19dd3d Custom ttf font works on iOS/macOS (#1154)
* Custom ttf font works.

* Remove unused log.

* better code logic, less if .

* comment debugging code.
2018-03-20 14:51:24 +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 26e8259389 Merge branch 'new-renderer' of git://github.com/cocos-creator/cocos2d-x-lite into new-renderer 2018-03-12 15:34:45 +08:00
James Chen fe91680060 Adds ctx.fillRect interface, JSB_get_arraybufferview_dataptr supports null or undefine converstion. 2018-03-12 15:25:47 +08:00
James Chen f02faf5a15 Updates CanvasRendereringContext2D-ios/mac.mm. 2018-03-12 11:12:24 +08:00
James Chen 3627778a35 Updates canvasrenderingcontext2d-mac.mm 2018-03-11 20:35:54 +08:00
minggo 0d483a9b07 add back network (#1141)
* add back network

* add network back on windows
2018-03-09 16:20:48 +08:00
James Chen 15370e52db ios label works.TODO: outline, bold, underline. 2018-03-09 12:37:57 +08:00
James Chen 1a064feed2 Label color works. 2018-03-08 18:14:46 +08:00
James Chen 4eccfbcba8 Mac font display ok. 2018-03-08 17:38:45 +08:00
James Chen 44fa82d9cc CanvasRenderering obj-c object release fix. 2018-03-08 11:22:44 +08:00
James Chen 48ab875fe2 Adds CCCanvasRenderingContext2D. 2018-03-07 18:44:57 +08:00
James Chen 1cd2166684 continue. 2018-03-06 10:41:10 +08:00
James Chen 88123dbb7b Updates opengl binding and module fix. 2018-03-05 11:00:02 +08:00
minggo aa3d6f0cde remove unneed files (#1135) 2018-02-28 17:24:34 +08:00
minggo 6f54248b7f fix iOS scale issue (#1134) 2018-02-28 16:07:20 +08:00