Commit Graph

89 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 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 19ab61b252 refine TODO & FIXME flag (#1450)
* change TODO to REFINE

* change REFINE:cjh to REFINE

* change FIXME to IDEA

* improve format
2018-08-10 12:52:00 +08:00
minggo 5f1d13d3eb Terminate app elegant (#1448)
* remove native finish, improve exitApplicationJNI

* destruct application when app.end called on iOS

* exit app elegantly
2018-08-08 17:28:29 +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
minggo 5a06e1da7a send complete message when touch outside editbox (#1279) 2018-06-01 17:44:19 +08:00
minggo fbeb6dd200 Editbox ios support (#1278) 2018-06-01 14:12:03 +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
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 64c4caa896 fillRectWithColor returns directly if getting an error. 2018-04-19 11:18:04 +08:00
James Chen c1a0786234 remove unused comments, register gl functions inside __gl variable. 2018-04-14 20:53:00 +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 0f4535fb93 [ios] Fix CanvasRenderingContext2D. 2018-04-09 13:55:48 +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 8dc0f35714 [ios] Fixes bugs about multisampling and GL_DEPTCH_STENCIL_ATTACHMENT (#1175)
* [ios] Fixes bugs about multisampling.

* [ios] Should use opengl es2

* Fixes compilation issues in DeviceGraphics after switching back to opengles2.

* glFramebufferRenderbuffer GL_DEPTH_STENCIL_ATTACHMENT fix in webgl binding.

* Comment some code of invoking opengles3.0 methods in gfx/Texture2D.cpp.
2018-03-30 17:44:08 +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
minggo f4e3f9e8f6 adapt h5 (#1170) 2018-03-28 09:47:05 +08:00
James Chen 5d0f97697e Fixed some webgl binding issues. (#1168)
* Fixes wrong conversion, lots of opengl should pass in `float` but we passed `int` value.

* [ios] Initialize Application should be in firstStart: method.

* Implements unpackFlipY for GL_RGBA & GL_RGB format texture.

* FIxed some webgl binding issues.
2018-03-26 18:23:20 +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
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 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 77ebc9ae12 ios ctx.fillRect fix. 2018-03-12 16:12: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
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
minggo aebdc1c77f fix compiling isssue of link template on iOS, Mac and Android (#1139) 2018-03-07 17:06:15 +08:00
James Chen 9038e57c64 don't init canvas in c++ code, initialize innerWidth,innerHeight instead. 2018-03-07 10:02:08 +08:00
James Chen 88123dbb7b Updates opengl binding and module fix. 2018-03-05 11:00:02 +08:00