Commit Graph

13711 Commits

Author SHA1 Message Date
minggo 62d20a9825
Add clear request and responses method to httpclient (#19598)
* Added functionality to clear pending responses and requests in the http client

* Responses and Requests now are processed in similar way

* Fix for clearing the http requests

* Added tests for HttpClient::clearResponseAndRequestQueue
2019-04-10 18:33:55 -07:00
minggo c3a0205652
ReFix bug: PremultipliedAlpha is not working for png (#19597) 2019-04-10 18:33:26 -07:00
minggo ffcf627c13
Ui video player new style looping input options 2019-04-10 18:33:05 -07:00
minggo 5c29e0066f
Add Android P cutout area support (#19595)
* Add Android P cutout area support
Related #19285

* coding style fix

* Update AppActivity.java

Fix android build

* suppress lint new api errors
2019-04-10 18:32:27 -07:00
minggo f7f0c48cae
Checking, does the touch is within the height of the line, not the height of the sprite? (#19394) (#19594) 2019-04-10 18:32:09 -07:00
minggo 1f7c0c9408
If path to file is tool long crash is possible. (#19593)
* If path to file is tool long crash is possible.

If path to file is tool long crash is possible, because of chart buffer overflow.

* Incorrect replacement. Using iterator is better.

* Style fix

* Correct naming
2019-04-10 18:31:50 -07:00
minggo 0a9e66a16c
Font atlas texture initialization delayed (#19592) 2019-04-10 18:31:29 -07:00
CocosRobot 01b9863723 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19599) 2019-04-10 18:30:29 -07:00
minggo aa8fffa2bf
Only send the ON_PERCENTAGE_CHANGED if and only if the percentage value has actually changed. (#19556) (#19589) 2019-04-10 01:54:07 -07:00
minggo bc1483dca7
Fix memory leak if invoking Texture2D::setAlphaTexture many times. (#19590) 2019-04-10 01:53:29 -07:00
minggo 195dc704e3
[Android] fix FileUtils::listFiles with path 'assets/' 2019-04-10 00:09:30 -07:00
minggo 408f6cf9da
Ability to change title position (#19587) 2019-04-09 23:21:07 -07:00
minggo 86a9e0c1b8
Fix bug: can't play video in obbfile. (#19476) (#19586)
* Fix bug: can't play video in obbfile.

* Change check order.
2019-04-09 22:38:32 -07:00
coulsonwang 5944857936 [MaterialSystemTest] When depth testing is disabled, writes to the depth buffer are also disabled. No need to do depth test in such case. (#19582) 2019-04-08 18:56:05 -07:00
Arnold 3bf5e84926 [bugfix] cpp-test small bugs (#19574) 2019-04-04 01:13:17 -07:00
Arnold fe14fcd4de [bugfix] fix test case crash (#19573)
* fix depthstencil buffer format

* fix crash
2019-04-03 18:41:17 -07:00
Arnold 9a56e6923f [bugfix] motionstreak & DrawNode3D on GL (#19564) 2019-04-03 02:27:15 -07:00
coulsonwang 4f81cd7356 [BugFix] EVENT_PROJECTION_CHANGED means trigger an event when projection type is changed instead of when projection matrix is changed. (#19568) 2019-04-02 18:30:49 -07:00
Arnold 6452d5faec [bugfix] enable depth test for all commands in 3d queue (#19565)
* save states

* save bits

* include deque

* remove 2d default states

* remove unsused flags
2019-04-02 00:47:55 -07:00
Arnold d6614cc0da [bugfix] fix label effects (#19554) 2019-04-01 23:56:29 -07:00
Arnold 45183919e9 [windows] use PostMessage to replace SendMessage (#19567)
* make async

* use post message
2019-04-01 23:41:38 -07:00
coulsonwang 688592b175 [Feature] fix mipmap issues (#19519) 2019-04-01 19:20:30 -07:00
coulsonwang bb60c173a1 add a flag to determine if need depth/stencil attachment 2019-04-01 19:05:53 -07:00
coulsonwang 147c564492 Feature/fix capture node (#19560)
* [Feature] fix capture multi-node

* [Feature] remove unused code
2019-03-28 19:32:13 -07:00
coulsonwang 15b8014c0b [BugFix] set layout (#19558) 2019-03-27 18:22:28 -07:00
coulsonwang d92ae4b478 [Feature] CaptureScreen works (#19547) 2019-03-27 18:09:26 -07:00
Arnold 6c4c80d977
set terrain winding to CW (#19549) 2019-03-27 13:59:10 +08:00
CocosRobot d453af8fe5 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19550) 2019-03-25 23:12:59 -07:00
Arnold aa54a6c576 enable shader tests (#19546) 2019-03-25 22:45:03 -07:00
coulsonwang 39c6359ec0 remove poll events in application loop 2019-03-25 20:01:32 -07:00
coulsonwang 4f63cc5459 [Feature] fix CaptureNode (#19539) 2019-03-24 19:23:55 -07:00
CocosRobot 6f05e57761 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19544) 2019-03-24 19:19:01 -07:00
minggo 6067d62341
adapt ClippingNodeTest (#19528) 2019-03-24 19:08:49 -07:00
Arnold 3a1b6f28b6 fix default FrontFace & Skybox DepthFunc (#19540) 2019-03-24 19:08:04 -07:00
CocosRobot b88f8e5062 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19535) 2019-03-20 14:44:46 +08:00
Arnold e1675ae67b Enable navmesh (#19530)
* enable flags

* impl debug draw

* run tests

* remove comments

* fix mac compile error

* review fix
2019-03-20 14:34:35 +08:00
minggo 63fdb2adf1
Merge pull request #19532 from PatriceJiang/fix_todos
remove todos
2019-03-20 14:34:03 +08:00
Arnold 6e063330e0
remove todos 2019-03-20 09:45:09 +08:00
CocosRobot#Set 9b567b2261 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically 2019-03-20 01:41:18 +00:00
patricejiang de13d1b240
fix confliction 2019-03-19 10:44:44 +08:00
patricejiang 82bbeb9b87
merge metal-support 2019-03-19 10:30:15 +08:00
minggo cb9cf672a1
Merge pull request #19517 from PatriceJiang/3d-material-test-cases
Enable material system test cases
2019-03-19 09:46:46 +08:00
minggo 8452b55b82
Merge pull request #19513 from Mee-gu/feature/AddDeviceInfo
Feature/add device info
2019-03-19 09:24:18 +08:00
coulsonwang 0825386827 fix compile error 2019-03-18 16:08:25 +08:00
Arnold 98fa7af850
fix linux compile error 2019-03-18 14:54:35 +08:00
patricejiang 926e49caf6
fix luabindings 2019-03-18 11:36:32 +08:00
patricejiang 811b66b51e
fix doc of ProgramState::AutoBindingResolver 2019-03-18 10:31:56 +08:00
patricejiang bfd390af35
auto generate luabindings 2019-03-18 10:30:11 +08:00
Arnold be579d1c4c
add doc 2019-03-18 09:41:14 +08:00
Arnold e211fd4e61
fix index 2019-03-18 09:35:36 +08:00
Arnold 40304860e6
Apply suggestions from code review 2019-03-18 09:33:43 +08:00
Arnold 5146fa3c93
Update cocos/renderer/backend/Types.cpp 2019-03-15 17:28:57 +08:00
Arnold e46e286a18
fix hash function 2019-03-15 17:19:04 +08:00
Arnold 4b5121c70b
Update cocos/renderer/backend/Types.cpp 2019-03-15 17:10:31 +08:00
Arnold c8324db21e
move compiletimedefinations to a sperate func 2019-03-15 16:43:46 +08:00
Arnold e77edfddf5
Update cocos/renderer/CCCustomCommand.h 2019-03-15 15:44:43 +08:00
Arnold c1ba0d866b
remove comments 2019-03-15 15:09:39 +08:00
Arnold e3385e0e58
revert binding 2019-03-15 14:51:33 +08:00
patricejiang 7280457fbb
add callback uniform to metal 2019-03-15 14:44:28 +08:00
patricejiang 9f55e8ee7b
fix macosx compile error 2019-03-15 14:44:28 +08:00
Arnold d75c2f3c5e
add uniform callback 2019-03-15 14:44:28 +08:00
Arnold c35c4e2347
fix ccpass 2019-03-15 14:41:59 +08:00
Arnold 069800b98c
enable test case 2019-03-15 14:41:59 +08:00
coulsonwang 3a3924f76f [Feature] fix CI test fail 2019-03-15 11:13:40 +08:00
CocosRobot#Set 16b2649ba2 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically 2019-03-15 02:48:36 +00:00
minggo 629eebd031
Merge pull request #19498 from PatriceJiang/texture_setTexParams
Texture2D::TexParams fields use backend enum types
2019-03-15 10:43:52 +08:00
coulsonwang ca93a8ba7d [Feature] fix indentation 2019-03-14 16:13:38 +08:00
coulsonwang ff6141559d [Feature] add file 2019-03-14 15:59:51 +08:00
coulsonwang b2387f13de [Feature] add DeviceInfo for querying implementation limits. 2019-03-14 15:58:55 +08:00
Arnold 7fcdf544e7
Update cocos/renderer/backend/Types.h 2019-03-14 11:00:21 +08:00
Arnold de77133821
Update cocos/renderer/CCTexture2D.cpp 2019-03-14 10:59:37 +08:00
minggo 2be80438a6
Merge pull request #19510 from Mee-gu/feature/UpdateTerrain
[Feature] add dummy texture for metal when lightMap is nullptr
2019-03-14 10:52:01 +08:00
minggo 63fde51dc8
Merge pull request #19508 from Mee-gu/feature/UpdateParticle3D
[BugFix] fix particle3D
2019-03-13 18:01:25 +08:00
minggo b91d6171c7
Merge pull request #19488 from Mee-gu/feature/UniformAlignment
[Feature] fix uniform filled in metal
2019-03-13 17:32:35 +08:00
coulsonwang df3637538a [Feature] add dummy texture for metal when lightMap is nullptr 2019-03-13 16:05:02 +08:00
minggo f5380f8efe
Merge pull request #19506 from minggo/rectangleclipping
ClippingRectangleNode works
2019-03-13 15:50:31 +08:00
Arnold 620027c54a
fix comments 2019-03-13 15:42:12 +08:00
Arnold eb771312f5
fix lua compile 2019-03-13 15:34:32 +08:00
minggo 7bae208166
Merge pull request #19505 from minggo/fix-todo
Fix todo
2019-03-13 15:24:49 +08:00
coulsonwang 8e6416bf87 [BugFix] fix particle3D 2019-03-13 15:12:36 +08:00
Arnold fb29eefda6
add setVertexLayout interface 2019-03-13 15:06:30 +08:00
minggo 1d9bde0520 ClippingRectangleNode works 2019-03-13 14:27:47 +08:00
minggo 7ebea45168 fix some todo 2019-03-13 14:11:40 +08:00
minggo 2795427a38 fix todo in CCGrid.cpp 2019-03-13 11:25:46 +08:00
Arnold 1d0107c087
alias backend::SamplerDescriptor 2019-03-13 10:54:26 +08:00
CocosRobot#Set 0ee2dc8c78 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically 2019-03-13 02:14:20 +00:00
coulsonwang 5d5eaf4be1 [feature] fix android compile error 2019-03-13 10:10:15 +08:00
patricejiang 53975ee428
fix android error 2019-03-13 09:56:29 +08:00
coulsonwang a8e54b9b53 [Feature] update attribute setting 2019-03-12 21:05:03 +08:00
Arnold fb87eec3f5
remove texture2d::setSamplerDescriptor 2019-03-12 18:59:12 +08:00
Arnold 70b9031714
fix wrapping 2019-03-12 17:03:01 +08:00
patricejiang 58c40c1cc6
fix android compile error 2019-03-12 16:53:28 +08:00
Arnold 62c6eae7c3
change Texture2D::TexParams fields type 2019-03-12 16:53:28 +08:00
Arnold 475b6e63a5 [bugfix] ClippingNode & CameraBackgroundBrush render order (#19496)
* add groupcommand as a barrier to reorder clipping node renderring

* add comments
2019-03-12 15:41:32 +08:00
coulsonwang d4375db34f [Feature] use glslopt_basic_type 2019-03-12 15:35:42 +08:00
coulsonwang 605975bfa0 [Feature] use references and rename the structure to a more meaningful name 2019-03-12 14:18:16 +08:00
coulsonwang c17d361e50 [Feature] float3 etc in Metal has both sizeof and alignment same as float4, need convert to correct laytout 2019-03-12 11:10:57 +08:00
Arnold a384e38e16 [bugfix] GL vertex attribute layout incorrect (#19484)
* collect OpenGL enum convertion methods

* add testcase for lots of nots

* fix andorid compile error

* move more function to UtilsGL

* use shared pointer

* naming stuff

* move VertexLayouts to CommandBuffer

* fix android compile error

* fix android headers

* add comment

* add comment, fix
2019-03-12 10:37:52 +08:00
coulsonwang 7c6a01affb [Feature] fix uniform filled in metal 2019-03-11 20:52:23 +08:00
Arnold 64f3f1d356 ProgressTimer cache uniforms (#19482)
* cache uniform

* release fix

* reorder vertex attributes
2019-03-11 10:15:33 +08:00
coulsonwang c5c6fa3396 Feature/update sprite3 d test (#19475)
* [BugFix] fix crashed test in metal

* [Feature] add comments

* [Feature] modify ways to get max_vertex_attribute

* [Feature] make it crashed in debug mode
2019-03-08 18:48:12 +08:00
minggo 4854f1c3e7
make travis work (#19478)
* make travis work

* don't compile ios as needing team id
2019-03-08 15:24:47 +08:00
Arnold 0f1e70ac8b [bugfix] add mesh command callbacks (#19477) 2019-03-08 11:06:03 +08:00
minggo e63c4d1ba6
make lua binding work (#19474) 2019-03-07 18:29:06 +08:00
Arnold 8caade49e6 [3d] add meshcommand (#19472) 2019-03-07 17:30:11 +08:00
coulsonwang e69e7e0b30 [Feature] support cubeMapping in metal (#19469) 2019-03-07 11:08:12 +08:00
Arnold f7496948fd [3d] support particle3d (#19464)
* first commit

* fix matrix

* remove used comments

* fix compile error on mac

* self review fix 1

* litte refactor

* use reference:
2019-03-06 17:03:16 +08:00
coulsonwang 776ab98e0b [BugFix] fix fill UnifromBuffer issues (#19462) 2019-03-05 11:19:52 +08:00
coulsonwang c18564cc44 fix depth/stencil validation failed in iPhoneX (#19458) 2019-03-04 15:09:34 +08:00
Arnold 3a55fa3dd6 [3d] add CameraBackgroundBrush (#19454) 2019-03-04 09:14:45 +08:00
Arnold b4f2ed0376 [3d] Sprite3DTest enable test cases (#19447) 2019-02-28 15:20:23 +08:00
minggo a6be522601
make hello lua work 2019-02-28 11:17:05 +08:00
Arnold 7fd82997ef [3d] terrain impl & test case (#19442) 2019-02-27 17:16:25 +08:00
coulsonwang f4170ea89a [Feature] set default scissor rectangle for metal when scissor test disabled (#19441) 2019-02-27 15:02:28 +08:00
coulsonwang cba56e5da7 Feature/save image issue (#19435) 2019-02-27 11:29:20 +08:00
minggo 301b6c5028
skeleton node adaption (#19434) 2019-02-26 14:57:12 +08:00
minggo 1e7a6f7fcf
Issue19416 (#19427)
* use more meaningful names

* remove unneeded types
2019-02-22 14:06:26 +08:00
minggo 2ed60f72cf
Remove gl codes (#19415) 2019-02-20 17:07:31 +08:00
Arnold edf3687af5 [3d] add motionstreak3d (#19414) 2019-02-20 16:56:35 +08:00
minggo 06d7e4eda7
remove CCGLProgram related files (#19408)
* remove CCGLProgram related files

* remove CCGLProgram related header files
2019-02-19 16:06:17 +08:00
Arnold bfc98c6f21 [3d] add billboard (#19407) 2019-02-19 14:56:21 +08:00
minggo 480d964039
removed duplicated shaders (#19406) 2019-02-19 11:57:13 +08:00
Arnold fd1d5d2dd7 [3D] texture cubemap GL & skybox (#19401) 2019-02-19 10:15:24 +08:00
Arnold 512a5f12c1 fix compile error (#19403) 2019-02-18 14:54:12 +08:00
coulsonwang fecac0c02c fix memory leak (#19402) 2019-02-18 13:42:11 +08:00
Arnold 483e96147f [3D] ccpass restore renderer states (#19396)
* save matrix

* save more states
2019-02-15 17:39:02 +08:00
Arnold 8be2a2053f
sync 3d support code (#19392)
* Sprite3D
* DrawNode3D
* active more Sprite3DTest
2019-02-15 14:30:10 +08:00
coulsonwang 193e37a0e0 [BugFix] fix FBO memory issues (#19387) 2019-02-13 10:13:46 +08:00
coulsonwang 6c0e80c954 [Feature] fix android compile error (#19380) 2019-02-13 09:10:22 +08:00
minggo 37b3d04f8d
some fix for gl backend (#19379) 2019-01-31 18:04:30 +08:00
Arnold 5ddf2b7d45
fix android include headers (#19376) 2019-01-31 17:17:14 +08:00
coulsonwang 3d0da9a7ac [Feature] caching render pipeline (#19375)
* [Feature] caching render pipeline

* [BugFix] release render pipeline
2019-01-31 16:31:09 +08:00
coulsonwang 03bb089bfe [Feature] remove unnecessary alloc (#19373) 2019-01-30 23:21:32 +08:00
coulsonwang 64dd7d381f [Feature] fix memory leaks on ClippingNode (#19371) 2019-01-30 18:14:25 +08:00
minggo c78a109bdd
Performance improve (#19370)
* don't set mvp projection every frame

* pretify codes
2019-01-30 17:54:48 +08:00
coulsonwang 2eef8cdbb9 [Feature] Cache RenderCommandEncoder (#19367)
cache render pipeline to improve performance
2019-01-30 14:14:15 +08:00
Arnold fe497933f8 3d support: some test cases works
* hack to make sprite3d test work

* support cull face

* support setting front face winding

* convert depth compare function type

* clean codes

* remove usage of glprogramstate

* pass needed information to Material::draw()

* add 3d textures

* enable animation

* 3D: compile on windows  (#179)

* exclude source files from extensions/

* enable assets and 3D

* run on windows

* update comments

* use std::vector instead of raw pointer void *

* compile on mac

* revert cmake

* fix bufferdata

* add todos

* remove dirty flag from uniform buffer

* argument type const &

* enable more tests

* update shader

* save: failed to compile

* pass compilation

* fix type convert

* save stage

* save stage 2

* remove VertexData & IndexBuffer & VertexBuffer

* comment out _meshCommand

* comment bindPredefinedVertexAttribs()

* fix xcode project file

* simple refactor

* remove unused files

* revert sprite3d testcase position

* revert change

* remove ProgramGL::bindPredefinedVertexAttribs()

* add header <string>

* fix uniform size
2019-01-30 09:35:17 +08:00
coulsonwang fd4589fd68 [BugFix] update drawing information (#19355) 2019-01-25 09:51:40 +08:00
minggo d88fe68bd1
Memory leak (#19358) 2019-01-25 09:20:07 +08:00
coulsonwang 66b0139e39 [BugFix] set the correct depthStencil state (#19356) 2019-01-24 18:31:51 +08:00
minggo 2d0fc63ac6
fix bug when dynamic buffer stop updating data(#19351)
* fix warnings

* fix bug when dynamic buffer stop updating data
2019-01-24 15:56:59 +08:00
coulsonwang 28a453e49d update ui_Grag.frag (#19344)
* update ui_Grag.frag

* [Feature] fix indent
2019-01-23 17:54:24 +08:00
coulsonwang f54f5075e6 [BugFix] enable BlendState (#19342)
* [BugFix] enable BlendState

* [Feature] remove virtual and set it as a protected function
2019-01-23 17:48:17 +08:00
coulsonwang 27724aa4c5 [BugFix] set the correct bufferSize for unifromInfo (#19343) 2019-01-23 17:42:58 +08:00
leda 4f0ef25c6f sync cmake changes into metal-support (#19335)
* sync #19327

* sync #19329
2019-01-23 09:55:55 +08:00
coulsonwang 5c3a6d0ddb [BugFix] clear AttributeInfo vector since vertex layout info may change for different scenarios (#19330) 2019-01-22 10:50:36 +08:00
minggo 8d9bd925c9
metal support for cocos2d-x (#19305)
* remove deprecated files

* remove some deprecated codes

* remove more deprecated codes

* remove ui deprecated codes

* remove more deprecated codes

* remove deprecated codes in ccmenuitem

* remove more deprecated codes in ui

* remove more deprecated codes in ui

* remove more deprecated codes in ui

* remove more deprecated codes

* remove more deprecated codes

* remove more deprecated codes

* remove vr related codes and ignore some modules

* remove allocator

* remove some config

* 【Feature】add back-end project file

* [Feature] add back-end file

* add pipeline descriptor and shader cache

* [Feature] support sprite for backend

* [Feature] remove unneeded code

* [Feature] according to es2.0 spec, you must use clamp-to-edge as  texture wrap mode, and no mipmapping for non-power-of-two texture

* [Feature] set texture wrap mode to clamp-to-edge, and no mipmapping for non-power-of-two texture

* [Feature] remove macro define to .cpp file

* [Feature] add log info

* [Feature] add PipelineDescriptor for TriangleCommand

* [Feature] add PipelineDescriptor object as member of TriangleCommand

* [Feature] add getPipelineDescriptor method

* add renderbackend

* complete pipeline descriptor

* [Feature] add viewport in RenderCommand

* set viewport when rendrering

* [Feature] occur error when using RendererBackend, to be fixed.

* a workaround to fix black screen on macOS 10.14 (#19090)

* add rendererbackend init function

* fix typo

* [Feature] modify testFile

* [BugFix] modify shader path

* [Feature] set default viewport

* fix projection

* [Feature] modify log info

* [BugFix] change viewport data type to int

* [BugFix] add BindGroup to PipelienDescriptor

* [BugFix] change a_position to vec3 in sprite.vert

* [BugFix] set vertexLayout according to V3F_C4B_T2F structure

* [Feature] revert a_position to vec4

* [Feature] renderer should not use gl codes directly

* [Feature] it's better not use default value parameter

* fix depth test setting

* rendererbackend -> renderer

* clear color and depth at begin

* add metal backend

* metal support normalized attribute

* simplify codes

* update external

* add render pass desctriptor in pipeline descriptor

* fix warnings

* fix crash and memeory leak

* refactor Texture2D

* put pipeline descriptor into render command

* simplify codes

* [Feature] update Sprite

* fix crash when closing app

* [Feature] update SpriteBatchNode and TextureAtlas

* support render texture(not finish)

* [Feature] remove unused code

* make tests work on mac

* fix download-deps path error

* make tests work on iOS

* [Feature] support ttf under normal label effect

* refactor triangle command processing

* let renderer handle more common commands

* refactor backend

* make render texture work

* [Feature] refactor backend for GL

* [Feature]Renaming to make it easy to understand

* [Feature] change warp mode to CLAMP_TO_EDGE

* fix ghost

* simplify visit render queue logic

* support progress timer without rial mode

* support partcile system

* Feature/update label (#149)

* [BugFix] fix compile error

* [Feature] support outline effect in ios

* [Feature] add shader file

* [BugFix] fix begin and end RenderPass

* [Feature] update CustomCommand

* [Feature] revert project.pbxproj

* [Feature] simplify codes

* [BugFix] pack AI88 to RGBA8888 only when outline enable

* [Feature] support shadow effect in Label

* [Feature] support BMFont

* [Feature] support glow effect

* [Feature] simplify shader files

* LabelAtlas work

* handle blend function correctly

* support tile map

* don't share buffer in metal

* alloc buffer size as needed

* support more tilemap

* Merge branch 'minggo/metal-support' into feature/updateLabel

* minggo/metal-support:
  support tile map
  handle blend function correctly
  LabelAtlas work
  Feature/update label (#149)
  support partcile system

# Conflicts:
#	cocos/2d/CCLabel.cpp
#	cocos/2d/CCSprite.cpp
#	cocos/2d/CCSpriteBatchNode.cpp
#	cocos/renderer/CCQuadCommand.cpp
#	cocos/renderer/CCQuadCommand.h

* render texture work without saving file

* use global viewport

* grid3d works

* remove grabber

* tiled3d works

* [BugFix] fix label bug

* [Feature] add updateSubData for buffer

* [Feature] remove setVertexCount

* support depth test

* add callback command

* [Feature] add UITest

* [Feature] update UITest

* [Feature] remove unneeded codes

* fix custom command issue

* fix layer color blend issue

* [BugFix] fix iOS compile error

* [Feature] remove unneeded codes

* [Feature] fix updateVertexBuffer

* layerradial works

* add draw test back

* fix batch issue

* fix compiling error

* [BugFix] support ETC1

* [BugFix] get the correct pipelineDescriptor

* [BugFix]  skip draw when backendTexture nullptr

* clipping node support

* [Feature] add shader files

* fix stencil issue in metal

* [Feature] update UILayoutTest

* [BugFix] skip drawing when vertexCount is zero

* refactor renderer

* add set global z order for stencil manager commands

* fix warnings caused by type

* remove viewport in render command

* [Feature] fix warnings caused by type

* [BugFix] clear vertexCount and indexCount for CustomComand when needed

* [Feature] update clear for CustomCommand

* ios use metal

* fix viewport issue

* fix LayerColorGradient crash

* [cmake] transport to android and windows (#160)

* save point 1

* compile on windows

* run on android

* revert useless change

* android set CC_ENABLE_CACHE_TEXTURE_DATA to 1

* add initGlew

* fix android crash

* add TODO new-renderer

* review update

* revert onGLFWWindowPosCallback

* fix android compiling error

* Impl progress radial (#162)

* progresstimer add radial impl

* default drawType to element

* dec invoke times of createVertexBuffer (#163)

* support depth/stencil format for gl backend

* simplify progress timer codes

* support motionstreak, effect is wrong

* fix motionstreak issue

* [Feature] update Scissor Test (#161)

* [Feature] update Scissor Test

* [Feature] update ScissorTest

* [Feature] rename function

* [Feature] get constant reference if needed

* [Feature] show render status (#164)

* improve performance

* fix depth state

* fill error that triangle vertex/index number bigger than buffer

* fix compiline error in release mode

* fix buffer conflict between CPU and GPU on iOS/macOS

* Renderer refactor (#165)

* use one vertes/index buffer with opengl

* fix error on windows

* custom command support index format config

* CCLayer: compact vertex data structure

* update comment

* fix doc

* support fast tilemap

* pass index format instead

* fix some wrong effect

* fix render texture error

* fix texture per-element size

* fix texture format error

* BlendFunc type refactor, GLenum -> backend::BlendFactor  (#167)

* BlendFunc use backend::BlendFactor as inner field

* update comments

* use int to replace GLenum

* update xcode project fiel

* rename to GLBlendConst

* add ccConstants.h

* update xcode project file

* update copyright

* remove primitive command

* remove CCPrimitive.cpp/.h

* remove deprecated files

* remove unneeded files

* remove multiple view support

* remove multiple view support

* remove the usage of frame buffer in camera

* director don't use frame buffer

* remove FrameBuffer

* remove BatchCommand

* add some api reference

* add physics2d back

* fix crash when close app on mac

* improve render texture

* fix rendertexture issue

* fix rendertexture issue

* simplify codes

* CMake support for mac & ios (#169)

* update cmake

* fix compile error

* update 3rd libs version

* remove CCThread.h/.cpp

* remove ccthread

* use audio engine to implement simple audio engine

* remove unneeded codes

* remove deprecated codes

* remove winrt macro

* remove CC_USE_WIC

* set partcile blend function in more elegant way

* remove unneeded codes

* remove unneeded codes

* cmake works on windows

* update project setting

* improve performance

* GLFloat -> float

* sync v3 cmake improvements into metal-support (#172)

* pick: modern cmake, compile definitions improvement (#19139)

* modern cmake, use target_compile_definitions partly

* simplify macro define, remove USE_*

* modern cmake, macro define

* add physics 2d macro define into ccConfig.h

* remove USE_CHIPMUNK macro in build.gradle

* remove CocosSelectModule.cmake

* shrink useless define

* simplify compile options config, re-add if necessary

* update external for tmp CI test

* un-quote target_compile_options value

* add "-g" parameter only when debug mode

* keep single build type when generator Xcode & VS projecy

* update external for tmp CI tes

* add static_cast<char>(-1), fix -Wc++11-narrowing

* simplify win32 compile define

* not modify code, only improve compile options

# Conflicts:
#	.gitignore
#	cmake/Modules/CocosConfigDepend.cmake
#	cocos/CMakeLists.txt
#	external/config.json
#	tests/cpp-tests/CMakeLists.txt

* modern cmake, improve cmake_compiler_flags (#19145)

* cmake_compiler_flags

* Fix typo

* Fix typo2

* Remove chanages from Android.mk

*  correct lua template cmake build (#19149)

* don't add -Wno-deprecated into jsb target

* correct lua template cmake build

* fix win32 lua template compile error

* prevent cmake in-source-build friendly (#19151)

* pick: Copy resources to "Resources/" on win32 like in linux configuration

* add "/Z7" for cpp-tests on windows

* [cmake] fix iOS xcode property setting failed (#19208)

* fix iOS xcode property setting failed

* use search_depend_libs_recursive at dlls collect

* fix typo

* [cmake] add find_host_library into iOS toolchain file (#19230)

* pick: [lua android] use luajit & template cmake update (#19239)

* increase cmake stability ,  remove tests/CMakeLists.txt (#19261)

* cmake win32 Precompiled header (#19273)

* Precompiled header

* Fix

* Precompiled header for cocos

* Precompiled header jscocos2d

* Fix for COCOS2D_DEBUG is always 1 on Android (#19291)

Related #19289

* little build fix, tests cpp-tests works on mac

* sync v3 build related codes into metal-support (#173)

* strict initialization for std::array

* remove proj.win32 project configs

* modern cmake, cmake_cleanup_remove_unused_variables (#19146)

* Switch travis CI to xenial (#19207)

* Switch travis CI to xenial

* Remove language: android

* Set language: cpp

* Fix java problem

* Update sdkmanager

* Fix sdkmanger

* next sdkmanager fix

* Remove xenial from android

* revert to sdk-tools-{system}-3859397

* Remove linux cmake install

* Update before-install.sh

* Update .travis.yml

* Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (#19212)

* Simplify install-deps-linux.sh

* Cleanup

* pick: install ninja

* update cocos2d-console submodule

* for metal-support alpha release, we only test cpp

* add HelloCpp into project(Cocos2d-x) for tmp test

* update extenal metal-support-4

* update uniform setting

* [Feature] update BindGroup

* [Feature] empty-test

* [Feature] cpp-test

* [Feature] fix GL compiler error

* [Feature] fix GL crash

* [Feature] empty-test

* [Feature] cpp-tests

* [feature] improve frameRate

* [feature] fix opengl compile error

* [feature] fix opengl compile error

* [BugFix] fix compute maxLocation error

* [Feature] update setting unifrom

* [Feature] fix namespace

* [Feature] remove unneeded code

* [Bugfix] fix project file

* [Feature] update review

* [texture2d] impl texture format support  (#175)

* texture update

* update

* update texture

* commit

* compile on windows

* ddd

* rename

* rename methods

* no crash

* save gl

* save

* save

* rename

* move out pixel format convert functions

* metal crash

* update

* update android

* support gles compressed texture format

* support more compress format

* add more conversion methods

* ss

* save

* update conversion methods

* add PVRTC format support

* reformat

* add marco linux

* fix GL marcro

* pvrtc supported only by ios 8.0+

* remove unused cmake

* revert change

* refactor Texture2D::initWithData

* fix conversion log

* refactor Texture2D::initWithData

* remove some OpenGL constants for PVRTC

* add todo

* fix typo

* AutoTest works on mac/iOS by disable part cases, sync v3 bug fix (#174)

* review cpp-tests, and fix part issues on start auto test

* sync png format fix: Node:Particle3D abnormal texture effects #19204

* fix cpp-tests SpritePolygon crash, wrong png format (#19170)

* fix wrong png convert format from sRGB to Gray

* erase plist index if all frames was erased

* test_A8.png have I8 format, fix it

* [CCSpriteCache] allow re-add plist & add testcase (#19175)

* allow re-add plist & add testcase

* remove comments/rename method/update testcase

* fix isSpriteFramesWithFileLoaded & add testcase

* remove used variable

* remove unused variable

* fix double free issues when js/lua-tests exit on iOS (#19236)

* disable part cases, AutoTest works without crash on mac

* update cocos2dx files json, to test cocos new next

* fix spritecache plist parsing issue (#19269)

* [linux] Fix FileUtils::getContents with folder (#19157)

* fix FileUtils::getContents on linux/mac

* use stat.st_mode

* simplify

* [CCFileUtils] win32 getFileSize (#19176)

* win32 getFileSize

* fix stat

* [cpp test-Android]20:FileUtils/2 change title (#19197)

* sync #19200

* sync #19231

* [android lua] improve performance of lua loader (#19234)

* [lua] improve performance of lua loader

* remove cache fix

* Revert "fix spritecache plist parsing issue (#19269)"

This reverts commit f3a85ece4307a7b90816c34489d1ed2c8fd11baf.

* remove win32 project files ref in template.json

* add metal framework lnk ref into cpp template

* test on iOS, and disable part cases

* alBufferData instead of alBufferDataStatic for small audio file on Apple (#19227)

* changes AudioCache to use alBufferData instead of alBufferDataStatic

(also makes test 19 faster to trigger openal bugs faster)

The original problem: CrashIfClientProvidedBogusAudioBufferList
https://github.com/cocos2d/cocos2d-x/issues/18948
is not happening anymore, but there's still a not very frequent issue
that makes OpenAL crash with a call stack like this.
AudioCache::readDataTask > alBufferData > CleanUpDeadBufferList

It happes more frequently when the device is "cold", which means after
half an hour of not using the device (locked).

I could not find the actual source code for iOS OpenAL, so I used the
macOS versions:
https://opensource.apple.com/source/OpenAL/OpenAL-48.7/Source/OpenAL/oalImp.cpp.auto.html

They seem to use CAGuard.h to make sure the dead buffer list
has no threading issues. I'm worried because the CAGuard code I found
has macos and win32 define but no iOS, so I'm not sure. I guess the
iOS version is different and has the guard.

I could not find a place in the code that's unprotected by the locks
except the InitializeBufferMap() which should not be called more than
once from cocos, and there's a workaround in AudioEngine-impl for it.

I reduced the occurence of the CleanUpDeadBufferList crash by moving
the guard in ~AudioCache to cover the alDeleteBuffers call.

* remove hack method "setTimeout" on audio

* AutoTest works on iOS

* support set ios deployment target for root project

* enable all texture2d cases, since Jiang have fixed

* add CCTextureUtils to xcode project file (#176)

* add leak cases for SpriteFrameCache (#177)

* re-add SpriteFrameCache cases

* update template file json

* Update SpriteFrameCacheTest.cpp

* fix compiling error
2019-01-18 15:08:25 +08:00
minggo fb53420b54
reduce cleanning clear buffer times (#19131) 2018-10-24 16:00:33 +08:00
Arnold 6da19d5eaf cache PhysicsJoint* attributes before PhysicsWorld update (#19108)
* use cache

* add unlikely

* fix pbxproj file

* remove unused methods
2018-10-19 18:11:50 +08:00
pyrosphere 411bd0934e Fix project warnings (#19126)
- Update cocos2d_libs Xcode project and turn on recommended warnings
- Fix `int` string formatting using "%zd" instead of "%d"
- Fix loop over reference to avoid object copy
2018-10-19 18:09:31 +08:00
Arnold d63f554bf2 CCLabel: fix fontName attribute (#19095)
* add  method for FontAtlas

* break empty font

* reduce string constrution
2018-10-18 09:00:23 +08:00
Arnold 7770234367 SpriteFrameCache: keep plist filenames when trying to remove sprite (#19083) 2018-10-16 17:06:21 +08:00
CocosRobot d1e6b8ace9 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19123) 2018-10-16 17:01:07 +08:00
Arnold 19c9e922eb cocos2d::JniHelper::* long type convert error (#19101)
* fix type

* remove redundant
2018-10-16 17:00:33 +08:00
Tai-Yuan Kuo 05ae5f7e83 Replace binary_funciton for C++17 Support (#19117) 2018-10-16 16:51:54 +08:00
Arnold b70a6a6def [physics] add pre/post callback in `update()` (#19118)
* add physics update pre/post callback

* update space

* run before simulation
2018-10-16 16:37:51 +08:00
leda 48cce75be4
remove un-elegant prebuilt feature in cmake (#19109)
* remove unclearly cmake prebuilt feature

* reduce useless code

* add project info print
2018-10-12 12:36:17 +08:00
Arnold 1ceb222c7f concat path error (#19075)
when trying to remove dir `test0`, the function will build a pattern
like `"test0*.*"` rather than `test0/*.*`
2018-10-08 11:51:36 +08:00
Arnold 11339c4545 CCConsole: remove fd from _read_set when it is closed by client. (#19066)
* CCConsole: remove fd from _read_set when it is closed by client.

* simplify code

* remove comment
2018-10-08 11:50:28 +08:00
Arnold c61e45103c LUA: cc.downloader binding (#19078) 2018-10-08 10:42:24 +08:00
CocosRobot a59519a4ef [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19082) 2018-09-28 23:38:04 -07:00
gestern 085ae2603f Fix several bugs with button's title (#19073)
* Fix several bugs with button's title:
(a)when using setTitleLabel() the button didn't resolve the corresponded parameters;
(b)bug with measurement accuracy (ignores the fractional part) of the system font and ttf-fonts sizes;
(c)bug with the size of the button title (by default) did not match the value size of the label's typeface;
(d)removes high coupling the typeface parameters of button because it already contains the used label

* Hotfix to call parent `Widget::init()`
2018-09-28 23:26:58 -07:00
dingdekai ebc32043ea [android] fix crash when point JNIEnv is a nullptr in getStringUTFCharsJNI func. (#19079) 2018-09-28 22:58:06 -07:00
leda 98120fb9d8
refactor cmake on use libs (#19054)
* link external build by modern cmake

* use "--whole-archive" for part android spec

* update travis

* update CI, add cmake tests on win32
2018-09-24 20:16:04 -07:00
CocosRobot a504c54a05 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19068) 2018-09-21 10:03:47 +08:00
Arnold 6ea37d4c9d [linux] CCFileUtils::isFileExistInternal should reject a folder (#19062)
* accept regular file only

* simplify code
2018-09-21 10:02:19 +08:00
AIGRIND a6530a5aca Correct last delta time (#18898)
If next delta time was zeroed (via setNextDeltaTimeZero) the last update time was not corrected.
2018-09-20 18:03:30 +08:00
Billy O'Neal 6a52b3ff4a Add missing <functional> header which the standard requires and will be necessary to use std::function in VS2019. (#18989) 2018-09-20 17:49:15 +08:00
Arnold b170daf9d8 fix wrong parameter (#19060) 2018-09-20 15:19:10 +08:00
Arnold 53bed4fda3 DrawNode add isolate flag (#19056)
* add isolate flag

* add comment for DrawNode::visit

* add modifier: const/virtual

* update comment & change initializer
2018-09-20 15:18:03 +08:00
Arnold f8ed20e4b3 Android: CCFileUtils listFiles impl (#19044) 2018-09-19 18:05:16 +08:00
ggggamer 7d840ac6e1 CameraBackgroundDepthBrush should handle opengl recreate event. (#19037) 2018-09-18 09:14:27 +08:00
CocosRobot 16126f2571 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19052) 2018-09-17 12:33:20 +08:00
leda e0210bd870
shorten the android build path, reduce long path error (#19045)
* remove import-add-path

* add module path into gradle

* modify PROP_BUILD_TYPE to ndk-build for tmp test

* import-module uv into ndk-build scripts

* part lib rename in Android.mk

* fix build path error on Lua&JS test project

* shorten all libs name, except external libs related

* "_static" suffix isn't necessary, since all internal build is static

* little catch

* re-change to cmake as default build type

* add both build type into Travis for android

* update external libs name

* fix gradlew cmd error

* update external config
2018-09-17 11:54:39 +08:00
Arnold f352225f14 CCFileUtils: improve thread safety (use single recursive_mutex) (#19046)
* CCFileUtils: add const modifier

* mac: add const

* android: add const

* use recursive_mutex

* win: add const modifier

* mac: revert

* android: add const

* rename __guard__ to mutexGuard
2018-09-17 10:47:41 +08:00
Arnold 3cad2a85d4 remove assert (#19047) 2018-09-17 10:21:43 +08:00
CocosRobot 2c37cc5ac6 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#19048) 2018-09-15 19:46:48 +08:00
gestern 368684d13d Android: Adds supporting edge screens (#19043)
* Android: Adds supporting edge screens

* Update CCGLViewImpl-android.h

* getSafeAreaRect(): Specifying indentation

Specifying indentation if the scale factor is different for grid
2018-09-15 16:45:22 +08:00
Arnold d9b2e0519d cocos2d::Data: prevent use after free. (#19034) 2018-09-14 14:36:47 +08:00
minggo 7dcee2bcf9
Remove ccglstatecache (#19013) 2018-09-11 14:39:30 +08:00
verketh 482c9eb8ca add image format check for Image::saveToFile in CCImage-ios.mm (#18986)
IOS保存灰度图崩溃
2018-09-10 16:35:31 +08:00
WangHe 3c8c5139c1 add error check for AVAudioSession setActive. (#19000) 2018-09-10 16:23:40 +08:00
Guilherme Gibertoni 6fb631e68e fix background music may resumes even though the application is on the background (#19005)
If the device is locked or sleeps
Then the application that was running on foreground will be dismissed and trigger a onWindowsFocusChanged(true) event while the game is already on background
2018-09-10 16:06:43 +08:00
ggggamer cf56f96a14 ClassLoader.loadClass use 'Binary names'. (#19011) 2018-09-10 15:06:19 +08:00
ggggamer f91ef9deee Fix some EVENT_RENDERER_RECREATED problem. (#19023)
* fix EVENT_RENDERER_RECREATED problem

* macro

* Event listener should add only once.
2018-09-10 15:04:35 +08:00
CHP 6a442192d4 Fix uninitialized variables problems found by drmemory (#19028) 2018-09-10 11:23:14 +08:00
TankorSmash 768ba5b6af add another xbox 360 configuration (#19032)
This is more a standard wired 360 controller.
2018-09-10 09:52:41 +08:00
Arnold 8d75c07dcb Upgrade dep libs (#19015)
* add libuv
* recompile libwebsocket 2.4.2 with libuv enabled
2018-09-06 16:07:25 +08:00
Arnold f99c81c336 https downloader timeout on win/mac (#18935) 2018-08-31 10:12:04 +08:00
Jeff Wang 925b727bb1 replace setColor with setTextColor for RichElementText (#18985) 2018-08-17 11:52:16 +08:00
CocosRobot e946c11eb3 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18982) 2018-08-07 11:24:27 +08:00
Jeff Wang 3948e5eece refine EditBox: add support for pressed and disabled image (#18965)
* refine EditBox add support for pressed and disabled image

* add test case

* fix compile error

* fix compatibility

* fix compile warning

* fix test cases

* remove CC_DEPRECATED_ATTRIBUTE mark
2018-08-07 09:29:51 +08:00
tyfkda aacec550c9 Fix out of range access in Label (#18789)
Out of range occurred in some condition
when using `Label` with its `getLetter()` member function.

`Label::recordPlaceholderInfo()` member function is called for
new line (\n) letter in `Label::multilineTextWrap()`,
but the function doesn't set `_lettersInfo[letterIndex].lineIndex`.

But `lineIndex` is used in `Label::updateLabelLetters()`
even if letter is new line.

This change checks `letterInfo.valid` to avoid
accessing `_linesOffsetX[letterInfo.lineIndex]`
for invalid (i.e. `NewLine`) letter.
2018-08-06 14:27:47 +08:00
saumyamukul dfa0360d99 Fix memory leaks (#18564) 2018-08-06 14:17:08 +08:00
ggggamer cddcf545db Node::draw and Node::visit use wrong arg type. (#18970)
Should we use `FLAGS_TRANSFORM_DIRTY` here?
2018-08-06 13:46:31 +08:00
raphael10241024 bad8091e99 fix bug:when download's http request didn't return Content-Length header, downloader will return a negative progress value (#18806) 2018-08-06 13:37:34 +08:00
panzhihao 5693097fce Keep the same performer of CCDownloader #18871 2018-08-06 12:38:14 +08:00
Jimmy Yin 4a3263d294 Lua: Optimize http header setting code (#18904) 2018-08-06 12:37:25 +08:00
Sylvain L. Kamdem d41820b14b Update UIAbstractCheckButton.cpp (#18858)
This factory method to create a checkbox instance was not working (UICheckBox.cpp:79):
CheckBox* CheckBox::create(const std::string& backGround,
                           const std::string& cross,
                           TextureResType texType)
Because the program tries to load missing textures. I just added some exit conditions to avoid it.
2018-08-06 11:46:19 +08:00
Riyachang c8c5fc74f7 Fix: LabelLetter::isVisible always returns false (#18975) 2018-08-06 10:09:48 +08:00
Arnold fc09d1af05 disable auto URI encode in AsyncHttp client, fix #18949 (#18957) 2018-07-23 21:32:52 +08:00
CHP 2bab501cac Update android build tools to 27.0.3 (#18952)
* Update gradle and android gradle plugin

* Update android build tools to 27.0.3
2018-07-22 13:58:58 +08:00
Arnold 81b1e904cd SocketIO#emit/send support multiple parameters (#18944) 2018-07-18 13:41:12 +08:00
Umair Javed ec1fc92e37 Added initialisation checks in pcm audio service (#18934) 2018-07-13 16:24:36 +08:00
leda 8d4ee80ac1
add test case for issue #18597(audio crash on iOS), and fix (#18865)
* use atomic_bool type for _isRotateThreadExited

* add test case for issues 18597

* fix test case error

* add data race comments, fix lock usage error

* add comments for audioplayer

* fix typo in comments

* revert wrong changes

* update test case, keep reproduce

* add alSourceUnqueueBuffers before stop

* improve UnqueueBuffers

* detail test case to show side effect

* remove unused comments

* add comments for AudioPlayer change

* correct a audio log level

* change log level from W to VV

* update time step, add play state check

* remove record time of UnqueueBuffers
2018-07-11 09:36:57 +08:00
Koveshnikov Peter e27f33a74b Issue18909 Widget::getAncestorWidget fix (#18913) 2018-07-10 23:02:37 +08:00
newnon df4d8e75f6 Fix websocket memory zereoing (#18643) 2018-07-10 22:57:05 +08:00
leda b26e1bb086
correct #18768, add check for unsafe strcpy() (#18885)
* add check for unsafe strcpy()

add check for unsafe strcpy()

* complying with required coding style

substitute tab with 4 spaces

* NULL -> nullptr
2018-06-08 17:52:50 +08:00
Valera 702fc83974 Fix include guard in CCEventListenerMouse.h (#18872)
* Fix include guard in CCEventListenerMouse.h

* Remove extra new line
2018-06-08 17:13:38 +08:00
rh101 fd7f7ba085 Fix for Label and UIRichEdit text trailing space trimming (#18876)
* [UIRichText.cpp] Allow user to select if they want to trim trailing spaces for a RichElementText. Also fixed crash if estimatedIdx is less than 0 in certain conditions.
[UIRichText.h] New flag added for enabling trailing space trimming.
[CCLabelTextFormatter.cpp] Only trim trailing whitespace if lines are being split. This will trim all whitespace up to the next non-whitespace token in a line.

* Fix for oversized sprites that need to be offset by X and Y to be aligned correctly in the UIRichText

* Revert "Fix for oversized sprites that need to be offset by X and Y to be aligned correctly in the UIRichText"

This reverts commit fc5492e878a982ff748488bf1de4ffa88a3d4755.

* [UIRichText] Reverted changes made for trimming since they are no longer required. The changes made to CCLabelTextFormatter.cpp fixed all the current issues.

* Added test cases from #18869

* Removed the forced trailing space clipping since it is not required here, and causing side-effects.

* Removed comment that no longer applies to that section of code
2018-06-08 17:06:29 +08:00
Jo Huang 5d7e58a2a1 Fix iOS editbox EndAction wrong when single line mode. (UITextField) (#18870) 2018-06-01 11:11:21 +08:00
CocosRobot 8988f999f6 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18868) 2018-05-30 21:54:47 +08:00
CocosRobot 1b5f08f528 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18866) 2018-05-30 20:56:51 +08:00
Stewart Imel c84c5761a1 fix typos and grammar in comments (#18853) 2018-05-30 20:41:59 +08:00
Vasily Fomin eb87dec447 Fix misleading comment text in CCMenu.h (#18855) 2018-05-30 20:39:23 +08:00
Ricardo Petrére dfdaf9ed61 cc.PI2 was only present in html5 release, added it into JSB (#18860)
[JavaScript] cc.PI2 was only present in html5 release, added it into JSB
2018-05-30 20:36:21 +08:00
ggggamer 59c854a159 Avoid duplicate find action when founded. (#18863) 2018-05-30 20:33:53 +08:00
pyrosphere d1661a7e85 Fix ZipUtils include headers order (#18857)
An old hack that changed the default order of included headers in ZipUtils causes issues when compiling cocos2d for Android 64-bit, throwing errors of missing `fgetpos` and `fsetpos` functions.
2018-05-29 22:57:15 +08:00
panzhihao cc145cb852 be safe to handle operator= (#18850)
* 等号赋值函数,先判断this是否不等于other再做赋值

1、CCData那个会闪退
2、CCGLProgramState那个会造成_value.tex.texture泄漏

* replace TAB to  4 SPACE
2018-05-25 09:58:11 +08:00
leda a44e208975
fix cmake android prebuilt libcpufeatures path error (#18847)
* add cpufeatures lib output path

* added audio header
2018-05-25 09:56:19 +08:00
CocosRobot 2b80503972 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18844) 2018-05-23 11:32:42 +08:00
Valera 0519685f72 Add methods to change window icons on windows and linux (#18833)
* Add GLViewImpl::setIcon and GLViewImpl::setDefaultIcon for windows and linux

* Include CCImage.h only if required

* Fix empty icon image

* Fix windows build

* [skip ci] Replace `{ return; }` with `{}`

* Add icon test to cpp-empty-test

* [skip ci] Replace TABs with spaces, add comments

* Chnage requested things, fix formatting

* Fix define

* Fix ios build
2018-05-23 09:29:49 +08:00
newnon b940d7dcdb Аdded the ability not to stop sound & music on game start in android and changed default behaviour to not stop (#18640) 2018-05-15 14:30:05 +08:00
Peter Siegmund bac694dc55 fix reorder warning (#18819) 2018-05-14 10:34:56 +08:00
leda 4675ee79cd correct iOS project config when using CMake `-GXcode` generate (3.17 round 2 test) (#18808)
* ARCH_DIR only useful for search linux prebuilt libs

* add iOS app target ONLY_ACTIVE_ARCH property

* set Xcode property for application, include all depend target

* fix bugs-editbox-win32 crash

* improve EditBox-align test case

* typo error

* update cocos-console submodule

* VS RelWithDebInfo build use release folder external libs
2018-05-11 15:09:09 +08:00
leda 391f30a3f3 beauty cmake format, reduce duplicate defines (#18799)
* reduce cmake module duplicate

* make module use more clear, correct cmake style

* keep default physics option

* delete the modules distributed with cmake

* unify the cmake files format

* use AndroidNdkModules at cmake sys modules

* add cmake comments for win

* update cocos2dx files list, manually
2018-05-02 15:33:01 +08:00
leda a5c52607d5 check test cases and fix small bugs before 3.17 release (#18786)
* update edit box H alignment case

* improve label no-break-space test case

* fix label test cases bug

* add GetterSetter define for the placeHolder of TextField

* fix event condition bugs on ParticleTest.lua
2018-04-25 09:50:53 +08:00
François Perrad 2991a18fae CMake: avoid unsafe header path when cross-compiling (#18782) 2018-04-23 09:04:45 +08:00
leda ed0288f22d replace ptr_fun with lambda, avoid compile error (#18783)
* update trim func, avoid compile error using c++17

* resume wrong deleted
2018-04-20 18:04:19 +08:00
CocosRobot 68adbb08ec [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18779) 2018-04-20 17:50:34 +08:00
leda fbad734633 Revert "fix issue that render texture will have wrong effect if using with global z order (#18629)" (#18777)
This reverts commit 38864456bf.
2018-04-19 09:37:05 +08:00
leda bed8c0ac77 add bullet include dir to cocos mk (#18774) 2018-04-19 09:27:15 +08:00
leda 8ada72aa5c update web Spine to 3.6.39 2018-04-19 09:26:37 +08:00
Jordi Vilalta Prat 712b093b27 Don't count spaces at the end of line as part of the line width (#18751) 2018-04-04 11:53:16 +08:00
sp-andres-barrera d66af06112 Support for non-breaking characters in label (#18753)
* Added non-breaking character check function

* Check for non-breaking characters in words when formatting label text

* Added nbsp again as space character (removed in previous PR https://github.com/cocos2d/cocos2d-x/pull/18147)
2018-04-02 10:27:26 +08:00
halx99 6317e35f01 Fix issue #18724 (#18741)
see issue: https://github.com/cocos2d/cocos2d-x/issues/18724
2018-03-20 10:13:33 +08:00
leda 86ea3a8aee cmake add collect headers list, unify the logic of source add (#18722)
* fix mistake for ios lua template

* auto select headers depend on sources

* change cmake "cocos_build_app" from macro to function

* fix cmake dll repeat copy

* update travis srcipt

* add header list for cocos lib

* add header list in cmake files

* re-add include dir Classes

* improve template cpp var name

* remove func get_headers_by_sources

* cmake add simulator header list

* make source and header collect more clear

* improve macos app pkg

* improve ios pkg, run failed

* revert the ios pak logic, keep older

* expand var APP_BIN_DIR scope

* fix use sqlite3 error on linux

* fix win32 compile error

* remove multi-add mistake

* try to fix python install issue on travis

* fix js-tests build on android

* uninstall old python in travis

* add travis  python print info

* fix command ll to ls -l

* remove useless link

* PYTHON_BIN adapt homebrew python
2018-03-14 13:51:29 +08:00
Dimon4eg d32f33056f Fix no-break space size (#18661)
* fix warnings

* added test

* fix warning

* fix no-break space size

* Correct code
2018-03-13 09:40:24 +08:00
Jordi Vilalta Prat 239b63e207 Fix infinite loop when counting text lines on Android (#18710)
In some situations, breakText() can return 0, which leads to an infinite
loop. In that case we just increase the index so the measuring doesn't
get stuck.
2018-03-09 10:01:17 +08:00
deyongzhong c087be314c ^fix crash when the error msg is too long (#18715) 2018-03-08 15:33:14 +08:00
CocosRobot e5d4a54bff [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18718) 2018-03-08 15:32:40 +08:00
gestern 84be684e38 Adds support for executing sequential commands separated by a delimiter (#18686) 2018-03-08 10:51:21 +08:00
AIGRIND 607507d97e Get ValueMap by reference (#18684)
* Get value map by reference

* Get ValueMap by constant reference
2018-03-08 10:49:29 +08:00
leda 50ecf00115 cmake support win32 ,and support generate&use prebuilt libs (#18683)
* fix win32 prebuilt error, and set cmake as default android native build

* cpp-template support msvc

* add msvc version check

* add -D_USRLUASTATIC, fix lua lib cmake compile error

* fix cpp-empty-test res copy dir, add function needed

* improve msvc res copy

* refactor cmake copy dll logic

* fix cpp-tests compile error

* refactor copy dll temp

* refactor win32 exe using dlls

* js-project compile support cmake using msvc

* improve res mark for win32

* update the way of lua project res mark

* add D_USRLUASTATIC for lua project

* unify RELEASE Release to Release, add CMAKE_CONFIGURATION_TYPES

* improve VS shows targets, add folder

* improve mac/ios res mark

* reduce useless comments

* unify cpp src include variable

* refactor cpp test project  package logic

* improve pkg app logic

* start support prebuilt libs for cpp project using cmake

* improve prebuilt libs generate

* expand js/lua support prebuilt libs on mac

* adapt IDE generate libs path

* start do prebuilt for android

* improve the way of using external libs for prebuilt

* prebuilt libs support cpp-empty-test on android studio

* cpp-tests prebuilt libs, and remove useless

* start to improve libs using, to adapt prebuilt

* improve cpp tests prebuilt on android

* prebuilt support lua & js test on android

* prebuilt support cpp&js template

* rename prebuilt variabl, detail androd config

* finish android support prebuilt using cmake

* fix cmake script run in windows error

* reduce variable name length

* improve the way of win32 use dlls to adapt prebuilt

* loosen pick js/lua engine lib condition

* self review and start check linux build

* unify compile option location

* strict copy dlls condition

* improve libs link order

* start redo the way of copy dlls

* unify dlls copy logic

* fix linux res copy error

* update cmake copy file path in linux

* make prebuilt dir if needed, and divide Debug and Release dir

* cmake win32 divide Debug and Release dir well

* comment Lua Template project, for the unfinished lua simulator support

* add simulator cmake file

* start support simulator

* simulator support cmake build on macOS

* fix simulator compile error on win32

* add simulator prebuilt support

* improve mark cocos app macro

* improve cmake template project format

* improve cmake app files format

* fix format improve mistake

* detail cmake readme

* improve readme, useless comments

* add game.rc to template project

* check travis openssl version

* try update travis openssl

* upgrade travis openssl

* change openssl link

* change to upgrade openssl

* re install python with upgrade openssl

* add comment for macro and func, improve variable name
2018-03-08 09:47:57 +08:00
Dimon4eg 74daac0751 Support Belarusian language (#18658)
* Support Belarusian language

* Fixed code duplication - moved language convertion code to ccUtils

* added Belarusian language for all platforms

* Fix ios/mac build errors
2018-02-11 09:19:47 +08:00
TankorSmash 7e0a0435ac Fix warning for converting int to float (#18672)
Could use a static_cast but it doesn't seem to be the style
2018-02-08 09:26:22 +08:00
leeda edee97278f V3 android cmake support, add mac/ios support (#18646)
* CMake build improvements

* android cmake support

* Enable proguard for cocos2d

* examples & test cmake support

* add android build type param to gradle.properties file

* less warnings

* update all android configs to recomended settings

* fix network cmake error

* fix js-tests cmake error

* android build config, add cmake

* android build config, add cmake

* add lua share lib

* android lua cmake build fix

* fix

* luajit test

* run fail, still

* fix js-warning

* correct lua main include

* lua test project cmake support android

* try to add lua-template cmake support

* lua template fix

* js_tests support cmake on android

* js-tests improve

* cmake support js-template

* test to realise prebuild

* cmake improve, no feature

* improve templates cmake

* refactor cmake struct

* correct cpp-tests cmake

* cpp-templates cmake improve

* typo fix

* cmake struct refator

* change default option

* adapt new project struct

* uniform cmake test style

* add_dependencies to support make -j

* little struct improve

* little fix

* adapt cmake bin dir

* little improve about cmake version

* change build all tests condition

* add source_group for Xcode

* add mark source files

* add more mark source code

* add template project to test

* add macos info.plist template

* add pak macos for all project

* lua test icon fix

* not consider lua project for now

* modify pak method

* add another ios toolchain

* add ios system library

* update ios toolchain, and reduce ios compile errors

* reduce error

* make ios engine lib compile pass

* cpp-empty-test ios bundle

* cpp-tests ios support

* js-tests ios support

* templates project support ios

* fix the way of lua-tests package

* try to fix lua-template on macOS

* comment lua-template sim file

* improve display on xcode

* update cmake readme

* check android compile again

* fix android compile error

* fix linux cmake res error

* update deps version, for cmake

* fix lua_template linux compile error

* close android cmake support for now

* review template android share library name

* change PROP_BUILD_TOOLS_VERSION version to 27.0.1

* change android compile version

* make `PROP_APP_PLATFORM` back, add comments for android native build

* Revert "make `PROP_APP_PLATFORM` back, add comments for android native build"

This reverts commit 272ddc19886891b9502cde070753a870c0fdb588.
2018-02-08 09:24:33 +08:00
Dimon4eg b3285edb56 Speed up windows build (#18662)
* added precompiled headers

* Configure Visual Studio projects to use precompiled headers
2018-01-29 16:36:38 +08:00
leeda 18a6d8241d update Copyright. might need manual fix later (#18659)
* Copyright use python script updated. might be fix by manual later

* Revert "Copyright use python script updated. might be fix by manual later"

This reverts commit 49e99418e4da1fd02afda448ddeb16210f5e8c71.

* re modify copyright, consider utf-8-sig encoding

* another situation, add Copyright before  "Permission is hereby granted"

* Revert "another situation, add Copyright before  "Permission is hereby granted""

This reverts commit ee82591d32353c7ce2e146fe51ef447433b47571.

* another situation, add Copyright before Permission is hereby granted

* change "Copyright (c) 2016-2016 Chukong Technologies Inc." to " Copyright (c) 2016 Chukong Technologies Inc."

* script modify copyright, consider is cocos copyright or not

* change "Copyright (c) 2017 Chukong Technologies Inc." to "Copyright (c) 2016 Chukong Technologies Inc."

* manual fix, not fix audio related

* change "2016-2016" to "2016"
2018-01-29 16:25:32 +08:00
Jeff Wang e0b5034982 Update CCConsole.cpp (#18649) 2018-01-22 09:23:45 +08:00
minggo e88a05e49a
Fix RenderTexture DepthAndStencil issue on Android (#18648)
* Fixing issue where Stencil and Depths buffers would not function for a render texture if you backgrounded an application, and then resumed.

* Fixing typo: bufffer -> buffer
2018-01-21 19:07:49 +08:00
newnon 2ff42bb38e V3 static analize fixes (#18638)
* fix different problems founded by static analize

* fix bad render assert

* Fix misprint

* reverted calloc in CCScheduler
2018-01-19 13:40:41 +08:00
CocosRobot 4a23e754b2 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18647) 2018-01-19 09:28:46 +08:00
newnon 5d006192aa V3 multisampling support (#18632)
* Multisampling support

* fix opengl initialization with multisampling

* fix merge conflict

* reverted default attributes
2018-01-19 09:28:22 +08:00
monkey256 5ddf8fb596 Fix a crash bug when the UserDefault.xml file is empty. (#18626)
* Fix a crash bug when the UserDefault.xml file is empty.

* Fix a crash bug when play multiple timeline animations.

* Fix a crash bug when loading .plist files.

* Fix code style.
2018-01-19 09:25:58 +08:00
newnon 7e27c250b1 android emulator stensil fix (#18637)
* android emulator stensil fix

* Android emulator fix changed to comment
2018-01-19 09:24:53 +08:00
newnon 58077edc00 Add blend function to Text (#18631) 2018-01-19 09:19:36 +08:00
CocosRobot 63767d5550 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18642) 2018-01-18 17:47:46 +08:00
newnon 2861135cb5 fix nbsp (#18147) 2018-01-18 16:50:50 +08:00
minggo 38864456bf
fix issue that render texture will have wrong effect if using with global z order (#18629) 2018-01-18 14:28:40 +08:00
newnon 881e5d12c7 add one more android return buttons (#18636) 2018-01-18 09:42:28 +08:00
James Chen 2bb2e9f24a Reverts Node::cleanup changes in PR #17836 which is merged in v3.16. (#18565)
* Reverts Node::cleanup changes in PR #17836.

Reason please review the bug report: https://github.com/cocos2d/cocos2d-x/issues/18104

* Adds comment for reverting code in Node::cleanup.
2018-01-17 11:09:23 +08:00
minggo 7058b7ce8a
[ci skip]make codes more readable (#18627) 2018-01-16 15:30:11 +08:00
James Chen b2ecbca549 fix JSB Memory leaks and crashes (#18577)
* [game] Uses global compartment.

* fixed cocostudio bug.

* Fixes Memory leak for JSB.

* Memory leak in ActionsTest.js

* js_callfunc binding check whether jsThis is valid.

* Fixes potential crash in DownloadDelegator .

* CCLOG -> CCLOGINFO for garbage collect callback.

* jsb_c_proxy_s is a struct which contains a JS::Heap<> cpp object. Need to use `new`/`delete` to manage its memory.

* The functionality of JS controls C++ object's lifecycle isn't stable enough, please don't enable it now. Make an error if user enables it.

* Compilation error fixes.

* Removes unused JSAutoCompartment since we use JS_EnterCompartment/JS_LeaveCompartment now.
2018-01-10 14:39:45 +08:00
leeda 8f1459b8ef fix spine crash (#18582) 2018-01-10 14:34:24 +08:00
Vladyslav Kaplun 4f386a4d26 18572 PR amends & override warning fix (#18580) 2018-01-09 09:26:15 +08:00
Ryan B 457de1cce1 Android Emulator Blank Screen 0x501 and 0x502 Problem Bugfix Update (#18606) 2018-01-03 17:15:00 +08:00
minggo c36c9824d9
Revert "fix keyback bug after opened a page (#18153)" (#18601)
This reverts commit 6d50a844d4.
2018-01-02 10:38:02 +08:00
Sevellion 6d50a844d4 fix keyback bug after opened a page (#18153)
bug happen when:
1.implement keyback in a scene
2.implement webview in that scene and load a default URL
3.click any link and wait for it to load
4.press key back, the implemented keyback will not be called
2018-01-02 10:37:38 +08:00
Tiago Martines 2c025d8048 Fix actions with zero duration on NDK 16. (#18596) 2018-01-02 10:35:54 +08:00
Ruud Arentsen ea22822875 Added support for BMFont in TextField (#18587)
* Added support for BMFont in TextField

* Added cursor support for BMFont in TextFieldTTF
Made BMFont detection case insensitive and a bit more fool proof

* Added TextField::createWithBMFont, so that the font size is determined internally.

* Revert "Added TextField::createWithBMFont, so that the font size is determined internally."

This reverts commit 46b4e72ba44979b012ffa52bb78ea0a8493f7869.

* fix BMFont Cursor scale

* remove error add subproject
2017-12-29 11:24:02 +08:00
Peter Siegmund bbdd289a62 Fix gradlew build (#18592)
* fixed ProGuard rule file

* add missing VIBRATE permission

* move permission to correct position in AndroidManifest.xml
2017-12-27 09:36:11 +08:00
Jeff Wang 01ee30a023 improvements for EditBox-win32 (#18579)
* improvements for EditBox-win32

* add test case

* Update UIEditBoxImpl-win32.cpp
2017-12-22 09:14:27 +08:00
CocosRobot 48c55e5891 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18573) 2017-12-20 10:18:55 +08:00
sbrednikhin f0a28d261b Partial cursor support for text field with system font (#18555)
* Partial cursor support for text field with system font

Enables cursor support without cursor blinking an zero with of cursor symbol. In case of system font usage magical "/b" symbol won't be used, also update won't be scheduled.

* Update CCTextFieldTTF.cpp
2017-12-19 08:56:30 +08:00
Vladyslav Kaplun 4c0361e184 Fix cocos2d::EditBox padding (#18572) 2017-12-18 11:23:36 +08:00
AIGRIND 45992aa80e ScrollView API to stop overall scroll (#18552)
* ScrollView API to stop overall scroll

* ScrollView API to stop overall scroll

* ScrollView API to stop overall scroll

Cancel current touch handling after stopScroll() is called

* New test for scrolling stop in UIScrollView

* New test for scrolling stop in UIScrollView
2017-12-14 13:38:03 +08:00
sbrednikhin 9f15e34257 Avoid of type overflow while list size calculation. (#17697)
If _items container is empty `(length - 1) * _itemsMargin` will be large positive value.
Using `size_t` causes type overflow and large positive sizes.
Using int will cause negative size values.
Direct check looks like the best way.
2017-12-14 11:32:34 +08:00
James Chen a664e6d5b3 Fixes missing return value of onWavClose function. (#18544) 2017-12-12 17:50:57 +08:00
James Chen 89781a44df Fixes ResizableBufferAdapter<Data>::resize doesn't consider the situation of new size which is lower than old size. (#18553) 2017-12-12 17:49:11 +08:00
Jeff Wang 7916beb314 fix : win32 system label has wrong scale factor (#18520)
* Update UIEditBoxImpl-win32.cpp

* Fix a fixme
2017-12-08 18:18:04 +08:00
Greg Rynkowski 78f2d9940a Fix typo in the SkeletonAnimation::createWithFile (#18542) 2017-12-08 17:23:08 +08:00
James Chen f77f724caa fixed #18538: TrianglesCommand hashing technique doesn't take padding into account (#18543)
* fixed #18538: TrianglesCommand hashing technique doesn't take padding into account

* sizeof fix
2017-12-08 16:05:58 +08:00
CocosRobot fe69b07e75 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18540) 2017-12-07 13:45:26 +08:00
James Chen 907b6fda75 Uses NDK r16 to generate js/lua binding code (#18536) 2017-12-07 13:34:12 +08:00
CocosRobot 190e1239bf [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18535) 2017-12-05 18:04:27 +08:00
James Chen d21af3b981 Some fixes after using ndk r16 clang to build android projects (#18531)
* [android] Fixes warning in UrlAudioPlayer.cpp and CCUserDefault-android.cpp

* Don't write 'using namespace std;' in header files.

* Uses std::unordered_map instead of std::map for Particle3D module.

* Updates external/config.json to v3-deps-141

* Continue to replace `gnustl_static` to `c++_static` for templates and test projects.

* Updates CCConsole.h/.cpp to resolve the following issue on Android:

jni/../../../../../cocos/base/CCConsole.cpp:321:28:   required from here
/Users/james/Software/android/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/utility:506:63: error: incomplete type 'std::__ndk1::is_move_assignable<cocos2d::Console::Command>' used in nested name specifier
                         is_move_assignable<first_type>::value &&
                                                               ^
make: *** [obj/local/arm64-v8a/objs-debug/cocos2dx_internal_static/base/CCConsole.o] Error 1

* Fixes a memory leak while addCommand and other minor changes.

* Updates tolua/cocos2dx.ini, don't bind Console::Command

* Adds CC_DLL for Console::Command

* Reverts tolua/cocos2dx.ini and ignore Console::[add Command addSubCommand getSubCommand delSubCommand].

* Ignores Console::getCommand.
2017-12-05 13:35:16 +08:00
Yannick Berthier 1b2a48bd2a Fixed memory leak when using TTF labels (#18505)
* Fixed memory leak when using TTF labels

* FIX : Fixed memory leak in updateContent instead of dealloc
2017-12-04 09:02:13 +08:00
homolumo 878557814f fix build bug in CCLuaJavaBridge.h (#18524) 2017-12-01 09:47:02 +08:00
crazyhappygame 0ff92d3bbd Win10 remove disabled warnings (#18527) 2017-12-01 08:57:49 +08:00
will 966483be30 fix memory leak in FontFreeType::create (#18503) 2017-11-30 16:45:48 +08:00
jjinglover 5f8fde8669 fix keyBoard bug when input chinese on winrt platform (#18516) 2017-11-29 09:21:06 +08:00
CocosRobot 187a6639e9 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18522) 2017-11-29 09:19:23 +08:00
drelaptop 7dee719a94
add an empty create method for UICCTextField (#18518)
fix Issues 18403
* add an empty UICCTextField::create() method

* make normal comment

* code style change

* refinement changed code
2017-11-28 16:42:14 +08:00
Priority10 b9b3640d45 Update CCGLView.cpp (#18508) 2017-11-28 09:30:41 +08:00
crazyhappygame 03066ff47d Windows 10 update compiler to Visual Studio 10 PlatformToolset v141 (#18511) 2017-11-27 17:10:52 +08:00
mschoi17 9eb7e3242e Add comments for Cocos2dxSound.java (#18512)
Add comments for Cocos2dxSound.java
2017-11-27 17:10:07 +08:00
mschoi17 7e4b71a1fd Add comments for cddandroidAndroidJavaEngine.h (#18513)
Add comments for cddandroidAndroidJavaEngine.h
2017-11-27 17:09:17 +08:00
minggo 289668015d
fix warnings (#18499) 2017-11-24 10:41:37 +08:00
CocosRobot 3ffc1e8644 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18494) 2017-11-23 16:06:18 +08:00
Jonathon Walz e890cfa6be Fix endian detection on Android (#18480)
When compiling for Android, the preprocessor defines for byte order are
are not included in the sys/param.h chain. By including sys/endian.h we
we can ensure that the necessary macros are included.

It is especially important that endian-ness is correctly detected as the
node render order uses this information to sort #16262. Without this
fix, nodes will be rendered in the incorrect order on 64-bit Android
devices (on 32-bit, a different algorithm is used that is not
sensitive to byte order).
2017-11-23 09:36:30 +08:00
Priority10 602b9e51f2 Tiny comment fix in ccConfig.h (#18483) 2017-11-23 09:35:41 +08:00
James Chen 14bca227e8 fixed #18474: Provides an interface for getting SafeArea (#18489)
* fixed #18474: Provides an interface for getting SafeArea

* Adds getSafeAreaRect test demo in cpp-empty-test.

* @available(iOS 11.0, *) isn't supported in Xcode8. So we use the old way.
2017-11-23 09:34:23 +08:00
Mozart Louis bb479e4f6d Android Studio 3.0 + Switching to libc++ (c++_static) + Simplify PROP_* values + Adding default Proguard Config for cocos (#18470)
* Updated android build process to use c++_static

* Comment out org.gradle.jvmargs

* Updated all project in test directory

* Update C++ Template

* Update js and lua projects

* Update Proguard + Lower minSdkVersion to 14

* Added All PROP_* values + updated build.gradle

* Updated versions
2017-11-23 09:08:50 +08:00
Vadim Malckin a88ad87731 Bug in mp3reader.cpp (#18476)
* Bug in mp3reader.cpp

This directive  #include <string.h> is used for memset(b, c, l).
Without it the attemt to install .apk (ex. cocos run . -p android --android-studio) is creshed.
Found in the downloaded from http://cocos2d-x.org/download version cocos2d-x-3.16

* #include <string.h> added to avoid crash

The directive #include <string.h> is used for memset(b, c, l).
Without it the attempt to install .apk (ex. cocos run . -p android --android-studio) is crashed.
Found in the downloaded from http://cocos2d-x.org/download version cocos2d-x-3.16:

Here part of log:

In file included from C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorGlobalNewDelete.cpp:27:0:
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h: In constructor 'cocos2d::allocator::AllocatorStrategyGlobalSmallBlock::AllocatorStrategyGlobalSmallBlock()':
C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h:96:75: error: 'memset' was not declared in this scope
             memset(_smallBlockAllocators, 0, sizeof(_smallBlockAllocators));
                                                                           ^
make: *** [C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/cocos2dx_internal_static/base/allocator/CCAllocatorGlobalNewDelete.o] Error 1
make: *** Waiting for unfinished jobs....

:TestAndroidGame2:externalNativeBuildDebug (Thread[Task worker for ':',5,main]) completed. Took 16.425 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':TestAndroidGame2:externalNativeBuildDebug'.
> Build command failed.
  Error while executing process F:\android-ndk-r16\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-21 NDK_OUT=C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Vadim\Documents\Cocos2d\TestAndroidGame2\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\debug\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-26 NDK_MODULE_PATH=C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x;C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos;C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/external -j4 NDK_DEBUG=1 C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/libcocos2djs.so}
  [x86] Compile++      : audioengine_static <= mp3reader.cpp
  [x86] Compile++      : cocos2dx_internal_static <= CCAllocatorGlobalNewDelete.cpp
  In file included from C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorGlobalNewDelete.cpp:27:0:
  C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h: In constructor 'cocos2d::allocator::AllocatorStrategyGlobalSmallBlock::AllocatorStrategyGlobalSmallBlock()':
  C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/cocos2d-x/cocos/./base/allocator/CCAllocatorStrategyGlobalSmallBlock.h:96:75: error: 'memset' was not declared in this scope
               memset(_smallBlockAllocators, 0, sizeof(_smallBlockAllocators));
                                                                             ^
  make: *** [C:/Users/Vadim/Documents/Cocos2d/TestAndroidGame2/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/cocos2dx_internal_static/base/allocator/CCAllocatorGlobalNewDelete.o] Error 1
  make: *** Waiting for unfinished jobs....
2017-11-21 16:16:25 +08:00
mschoi17 86f5d4cff8 fix comments for JniHelper.h (#18481)
update #18477
2017-11-21 11:36:10 +08:00
Milos Jakovljevic ff8d2cc20f Fixing crash in Allocator if there are no allocated pages (#12908) 2017-11-21 10:56:29 +08:00
Jason Xu a8b6e33d9c Unregister spine event lua event handler should set listener to null. (#12845) 2017-11-21 10:55:55 +08:00
mschoi17 fd8658e22f Add Comments for JniHelper.h (#18477)
* Add Comments for JniHelper.h

* Update JniHelper.h
2017-11-20 10:41:56 +08:00
Jeff Wang bceb242ebd no message (#18460) 2017-11-10 15:05:21 +08:00
protito ed647fbe79 Added missing #include statement (#18452) 2017-11-09 10:04:45 +08:00
halx99 9b8fbf708d Fix cocos2d::log va_list re-use bug (#18426) 2017-11-08 14:07:59 +08:00
halx99 a35c3200a8 Improve StringUtils::format implementation. (#18425) 2017-11-08 14:05:03 +08:00
Jeff Wang b7bb03a061 RichText improvements (#18447)
* RichText improvements

* add support for continuous \n

* update UIRichText.cpp

* fix issue out of bounds

* Update UIRichText.cpp

* replace defaultHeights with lineHeights

* Update UIRichText.cpp
2017-11-08 13:59:57 +08:00
Jeff Wang 540980ab24 Update UIWebViewImpl-ios.mm (#18448) 2017-11-07 09:18:33 +08:00
James Chen db11024924 Reverts add search path logic in PR #17435 . (#18419)
If the last search path is _defaultResRootPath, addSearchPath(path) should not force that the last path is still default resource root path.
I made this mistake and broke the compatibiliy, since I thought resource root path definitely is low priority while search in most case. However, I should not make this assumption.

Anyway, dear developers, thanks for all of you review cocos2d-x source code. I accept any suggestion, any blame. I think everyone makes mistake more or less.
The key point is that `PLEASE DON'T MAKE THE SAME MISTAKE SECOND TIME, THIRD TIME`.
So please don't blame our developers who makes mistakes. We need to work together with all our developers to make our engine better and better.

And in fact, I never think that I deal with cocos2d-x source code as my 'own branch' although I contributed lots of code to it. I didn't push any code to repo directly since I sent Pull Requests. Every one could review code and comment in pull request. We encourage more communication with our developers in github or the forum. You could say GOOD , BAD or SHIT, but please do your best to respect every developer who made a contribution.

Thanks all of you. Good luck!
2017-11-06 10:41:01 +08:00
Dimon4eg 527dfd4579 Fix 60 fps for android (#18445) 2017-11-06 10:30:52 +08:00
Shura L ce5f37c7f5 set texture anti-alias by deault in RenderTexture (#18442)
fix issue #12459
2017-11-06 10:28:36 +08:00
Jeff Wang 0051c21be6 fix typos (#18444) 2017-11-06 10:28:11 +08:00
minggo 19bd8e3835
Spine update (#18438)
* update spine runtime and resource license

* apply patch to fix crash

* fix python path
2017-11-03 13:44:13 +08:00
minggo 1d356a160a
remove vs2013 libs (#18439) 2017-11-03 10:53:14 +08:00
Nikita 28b1953411 Revert #18327 (#18436) 2017-11-03 10:02:50 +08:00
minggo 56baabfe50
update glfw to 3.2.1 (#18434) 2017-11-02 15:25:12 +08:00
minggo 8e2ad2fd12
Editbox init member variable (#18432)
* initialize _adjustHeight

* remove unneeded void
2017-11-02 13:57:11 +08:00
CocosRobot d42098e2c4 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18431) 2017-11-02 11:17:04 +08:00
minggo cfaa77be28
Update spine (#18427) 2017-11-02 09:06:13 +08:00
Felippe Durán d651298d3e Fix bug of returning UNKNOWN event for return type key SEARCH/SEND in EditBox for Android and SEARCH for iOS. (#18192) 2017-11-01 17:33:31 +08:00
minggo b53eb25200
use prebuilt version of Box2D (#18422) 2017-10-31 14:31:23 +08:00
minggo 496de07633 don't have to set NDK_MODULE_PATH manually 2017-10-26 13:40:27 +08:00
sbrednikhin 6cd2c0c340 Fix for issue #18409 (#18410)
Remove unnecessary PLTE chunk from png.
2017-10-26 11:39:50 +08:00
minggo 33135d0d14 remove unneeded log (#18406) 2017-10-26 10:12:53 +08:00
Vladyslav Kaplun 0f9a9c55d1 Fix status check in AudioDecoder.mm (#18374) 2017-10-25 10:48:45 +08:00
Greg Rynkowski 76ba85adfb Make cocos' Android.mk self containing (#18392) (#18393)
PROBLEM
-------

cocos makefile is not self-containing.

From the perspective of a developer that link his target with
`cocos2dx_static` library, it should specify in his `Android.mk` only
a path to a makefile that defines that module, by

a) using `import-add-path` and `import-module`

    $(call import-add-path, <path-to-cocos-root>)
    $(call import-module, cocos)

  or ...

b) using directly an `include` command

    include <path-to-cocos-root>/cocos/Android.mk

Unfortunately the current configuration of cocos' Android.mk doesn't
specify (using `import-add-path`) locations of modules that it uses.
In result, every dev that uses cocos to create Android app has to
populate NDK_MODULE_PATH at his Android.mk files by adding two lines:

    $(call import-add-path, <path-to-cocos-root>/cocos)
    $(call import-add-path, <path-to-cocos-root>/external)

Those lines have to be placed at cocos/Android.mk file.

The current configuration of build script breaks a good practice of
hiding internal details from clients of library or component. In fact
the script exposes internal dependencies and require from a dev to make
them out.

---

SOLUTION

This commit adds corresponding `import-add-path` commands to Android.mk
files.

---

HOW TO TEST

1. Create cocos2d-x app.

2. Import in your Android.mk file a `cocos` module using one of
aforementioned approaches.

3. The app should compile without a error message like the one below:

    Android NDK: jni/../../cocos2d/cocos/Android.mk: Cannot find module with tag 'freetype2/prebuilt/android' in import path
    Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?

Issue: https://github.com/cocos2d/cocos2d-x/issues/18392
2017-10-24 09:20:54 +08:00
CocosRobot bf67850710 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18397) 2017-10-23 11:58:20 +08:00
SBJoker f0be714c0d Fix for Non-TTF Label Shadow, it makes it follow label opacity (#18324) 2017-10-23 11:57:43 +08:00
Vladyslav Kaplun 9e3cc37a0c Remove autorelease mark from UIWebViewWrapper and manage memory manually (#18391) 2017-10-23 11:40:52 +08:00
Nikita 4726fa3b3d Corrected bugs with cursor in TextField (#18371)
* No need to update password text in ccui TextFiled, because it's handled in TextFiledTTF

* Do not update visual state of Label if placeholder set when keyboard is attached
2017-10-23 11:37:07 +08:00
crazyhappygame d06c082bf2 Fix Windows 10 compilation (#18394) 2017-10-23 11:18:14 +08:00
CocosRobot 79b97e9992 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18385) 2017-10-20 10:06:21 +08:00
pyrosphere 09d73ae238 Fix accelerometer on android when screen is rotated on reverse landscape or reverse portrait. (#18317) 2017-10-20 10:05:07 +08:00
okamura d13d55c23f Fix CameraBackgroundColorBrush cannot use alpha (#18281) 2017-10-20 09:43:45 +08:00
Vladimir Perminov 19ea797593 Fix crash TextFieldTTF::setCursorFromPoint (#18159)
A similar problem of
https://github.com/cocos2d/cocos2d-x/issues/15926
2017-10-16 22:58:51 -05:00
Jeff Wang 40ec511f48 improvements for StringUtils::StringUTF8 (#18356)
* 1. add 'const'
2. add range support for 'getAsCharSequence'

* remove default arguments

* use another variable to make it more clear

* rename isAnsi-> isASCII
2017-10-16 22:03:32 -05:00
minggo 25c240391c fix crash (#18375) 2017-10-16 22:01:59 -05:00
xiaoyur347 617009f1cf fix CCTextureCache addImageAsync race condition (#18366) 2017-10-16 00:58:29 -05:00
Jeff Wang 6e535f40e3 fix memory leak (#18351)
fix memory leak in `UserDefault::deleteValueForKey` when `key` not found
2017-10-15 21:56:41 -05:00
Saber Haj Rabiee 37d05d3ca0 wrong code committed, forgot to put :: operator. (#18372) 2017-10-15 21:37:01 -05:00
Greg Rynkowski d32233d787 Fix "Possible misuse of comma operator here" (#18350) 2017-10-12 23:00:04 -05:00
minggo 10acb5a045 update version (#18367) 2017-10-12 22:58:43 -05:00
Jeff Wang 2132e48cd2 fix Memory Leak: ObjectFactory destroyInstance (#18352)
`ObjectFactory destroyInstance` function not called
2017-10-12 22:55:37 -05:00
halx99 809cfe3558 [ci skip]Fix endian detection macro. (#18354) 2017-10-10 09:01:19 +08:00
Knox 0d37220beb [ci skip]EditBox::setText() may crash on some Android devices 2017-09-28 10:59:03 +08:00
Knox 78a167fec1 [ci skip]when keyboard is popup, engine should not continue to handle touch events 2017-09-28 10:25:25 +08:00
minggo f2db054edb [ci skip]fix android violation (#18309) 2017-09-25 09:28:03 +08:00
halx99 e5d19429b8 [ci skip]Make the sort behavior is same on 32bit and 64bit (#18301)
* Make the sort behavior is same on 32bit and 64bit

* Update CCNode.h

* Update CCNode.cpp

* Update ccMacros.h

* Use std::int32_t to for zOrder

* Update CCNode.cpp
2017-09-25 09:27:33 +08:00
James Chen b633260020 Should use setTextColor for editbox placeholder. (#18311) 2017-09-22 16:06:13 +08:00
Jeff Wang bd59575468 fix #18296 (#18299)
fix #18296
2017-09-22 11:56:51 +08:00
minggo a1ef303f47 Merge pull request #18294 from minggo/sync-v316
Sync v316
2017-09-21 11:07:20 +08:00
Thorbjørn Lindeijer 7350aeca8c TMX: Added support for reading the object.rotation attribute (#11540)
Introduced with Tiled 0.10, this attribute stores the rotation of an
object in degrees clockwise.

Closes bjorn/tiled#921
2017-09-20 14:31:15 +08:00
minggo b275a3e2f0 fix conflict 2017-09-20 09:11:35 +08:00
minggo 66471154b0 do not compile unneeded file (#18290) 2017-09-20 09:05:27 +08:00
mogemimi a5374d0411 Fix minor typos (#18289) 2017-09-20 09:05:00 +08:00
yycmmc edd81d3528 use error macro to replace constant value 1410L (#18264) 2017-09-19 10:05:46 +08:00
minggo bb21a206a9 update vertex buffer to update color (#18283) 2017-09-19 09:41:10 +08:00
minggo 99f5fbb63f Fix VAO in CameraBackgroundBrush (#18278) (#18279) 2017-09-18 15:47:50 +08:00
pyrosphere 80c9292969 Fix VAO in CameraBackgroundBrush (#18278) 2017-09-18 10:50:00 +08:00
minggo 36f7f3c37e Merge branch 'v3.16' of github.com:cocos2d/cocos2d-x into syn-v316 2017-09-13 11:18:39 +08:00
James Chen 2fbb6fe32a [ci skip][lua] Bug fix in xhr:getResponseHeader("xxx") and better coding particle. (#18252)
* [lua] Bug fix in xhr:getResponseHeader("xxx") and better coding particle.

* More const auto &.
2017-09-13 10:54:35 +08:00
pandamicro 1929265a7c [ci skip] Fix web engine issues for 3.16 QA (#18251)
* Fix web test case issue in UIListView

* imgLoader callback use texture instead of image

* Update web ref
2017-09-11 21:03:22 -05:00
James Chen 6318324f4d [android] Fixes Cocos2dxActivity is re-created which causes crash if launching app first time and re-opening from icon (#18247) 2017-09-12 09:38:54 +08:00
CocosRobot 46e70d3c71 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18236) 2017-09-08 10:49:17 +08:00
James Chen ddb3c49eec Workaround for getting AL_STOPPTED state after alSourcePlay(sourceId). (#18228) 2017-09-08 09:29:39 +08:00
minggo ce1c207aee add LayerMultiplex::switch(int ,bool) (#18224) 2017-09-08 09:28:57 +08:00
CocosRobot 5d2c3f5d43 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18234) 2017-09-08 09:28:16 +08:00
halx99 557a6c0bf4 Add sourcePosition compatible support. (#18230) 2017-09-07 17:16:46 +08:00
minggo aca7c86739 set default search path to the path the same as .exe file (#18226) 2017-09-07 11:22:00 +08:00
minggo e161b613a4 make jnihelper thread safe (#18189) 2017-09-06 15:07:01 +08:00
minggo c89e35e22a Merge pull request #18216 from cocos2d/v3.16
V3.16
2017-09-06 14:59:36 +08:00
James Chen 7a65363208 Changes JS version to 3.16. (#18210) 2017-09-06 09:10:14 +08:00
James Chen 1fed9ae33b [ci skip]fix android AudioEngine Crash (#18124) (#18209)
* *fix android AudioEngine Crash

switch to background when sound effect is about to end, it's maybe crashed when switch to foreground again

* use "emplace" instead of "insert"
2017-09-01 11:30:10 +08:00
zoxin 7cd828119d [ci skip]fix android AudioEngine Crash (#18124)
* *fix android AudioEngine Crash

switch to background when sound effect is about to end, it's maybe crashed when switch to foreground again

* use "emplace" instead of "insert"
2017-09-01 10:16:04 +08:00
Valera 03635ecc4a Improved Cocos2dxLuaLoader.cpp (#18171)
* Improved Cocos2dxLuaLoader.cpp

* Added testcase for new LuaLoader
2017-08-25 09:32:02 +08:00
jett_yu d11674fd9c [ci skip]implementation conversion lua table to ObjC Dictionary (#18134) 2017-08-24 14:17:21 +08:00
James Chen 1360c2860a Fixes compilation errors for android audio module while building with x86 arch. (#18150)
* Fixes compilation errors for android audio module while building with x86 arch.

* Update bitops.h
2017-08-22 15:13:08 +08:00
Dmitry 6e013b5a8a fixed GLViewImpl::getMonitorSize() for desktop platforms (#18141) 2017-08-22 14:06:53 +08:00
CocosRobot b274322961 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18183) 2017-08-22 10:06:38 +08:00
newnon 9815ccba62 Fix android problem (#18142) 2017-08-22 09:52:28 +08:00
newnon 70ea1fc4d1 fix for ios audio engine (#18146) 2017-08-22 09:46:15 +08:00
newnon a8026b0136 fix android problem with 24 bit depth buffer on some devices (#18148) 2017-08-22 09:43:07 +08:00
newnon 04b2dbbcdb Blend function for UIImageView (#18149) 2017-08-22 09:40:37 +08:00
pyrosphere 0bebd83f6b Fix alpha blending during the animation of TransitionCrossFade. (#18175) 2017-08-22 09:33:37 +08:00
James Chen 8adf780a3c fixed #17989: touch stops responding on android devices. (#18165)
It's caused by `FileUtils::getContents` is invoked in different threads and we use EventDispatcher::dispatchCustomEvent in `FileUtilsAndroid::getContents` to send an event to EngineDataManager.
Since EngineDataManager class is only for internal use and EventDispatcher isn't thread-safe, we make `EngineDataManager::onBeforeReadFile` public and invoke it `FileUtilsAndroid::getContents`.
2017-08-21 23:28:59 +08:00
minggo a6a5426986 [ci skip]update version and readme (#18169) 2017-08-17 14:34:22 +08:00
newnon afbf26ea3c fix FontAtlas crash on some Android devices (#18145) 2017-08-17 00:06:01 +08:00
newnon 9f98e4cf83 less warnings (#18144) 2017-08-14 22:31:31 +08:00
Tyler Dauch a7d7aaa368 Update AudioCache.h (#18136) 2017-08-10 17:40:24 +08:00
CocosRobot 1fa0f3d237 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18129) 2017-08-07 17:01:27 +08:00
minggo 5a3244511a use correct selector to fix crash (#18132) 2017-08-07 17:00:35 +08:00
Joel Besada efe95fd899 [ci skip]Add Chipmunk JS binding for segmentQuery (#18107) 2017-08-07 11:57:45 +08:00
ggggamer dc9abcc669 FontAtlas::prepareLetterDefinitions's memory leak. (#18114) 2017-08-07 11:13:56 +08:00
bulzipke b5d871d53c Hide virtual button by user control. (#18100)
* Hide virtual button by user control.
It want a lot of people, including me.

http://discuss.cocos2d-x.org/t/solved-android-navigation-bar/31760/3
http://discuss.cocos2d-x.org/t/android-cocos2d-v3-12-about-virtual-button/30811/5
http://joyplot.com/documents/2016/09/27/cocos2d-x-navigation-bar/
http://falstar.hateblo.jp/entry/2016/07/10/180112

* I also added the lua/js template.
Thank you for your work :)
2017-08-07 11:12:26 +08:00
minggo 4be6eb5325 correct usage of reference count of LabelAtlas (#18117) 2017-07-31 09:05:55 +08:00
minggo b9cd599657 fix crash because of error offset (#18108) 2017-07-28 09:09:41 +08:00
CocosRobot db79a5ea6f [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18102) 2017-07-26 17:03:19 +08:00
kepler-5 12fc75790b Fix pageview iterator invalidation (#18091)
* allow setting and getting of pageview indicator opacity. fix some documentation comments

* don't draw the indicator the selected indicator is currently overlapping

* add a tweaked opacity to one of the test cases

* remove unused variable

* convert tabs to whitespace

* change constexpr to static const

* fix iterator invalidation when adding or removing pages from the pageview
2017-07-25 20:11:02 +08:00
minggo b77c29f750 make RichText supports img tag with Sprite Frame name (#18087) 2017-07-24 10:35:52 +08:00
Felippe Durán 681e9aa752 Fix polygon sprite bug of resetting flip and color information in setSpriteFrame. (#18085) 2017-07-19 11:08:12 +08:00
minggo cdac595a68 fix iOS deltatime (#18084)
* fix ios delta time when resumes from background

* remove debug codes
2017-07-18 14:01:53 +08:00
Felippe Durán 78818ca275 Fix AudioEngine thread concurrency crash between myAlSourceNotificationCallback and _play2d iterating over _audioPlayers. (#18083) 2017-07-18 11:12:20 +08:00
minggo a6773f408a fix crash if there are more than 10 touches (#18082) 2017-07-18 09:47:12 +08:00
CocosRobot 54586d06a4 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18081) 2017-07-17 16:51:50 +08:00
kepler-5 d42d969b46 Allow customizing opacity of PageView indicator nodes (#18059)
* allow setting and getting of pageview indicator opacity. fix some documentation comments

* don't draw the indicator the selected indicator is currently overlapping

* add a tweaked opacity to one of the test cases

* remove unused variable

* convert tabs to whitespace

* change constexpr to static const
2017-07-17 15:55:43 +08:00
子龙山人 0b99ba35f2 Fix ui slice issue (#18065)
* add tests to reproduce sprite slice issue

* fix scale9sprite change texture losing slice info

* fix tilemap crash issue
2017-07-17 15:52:01 +08:00
minggo 7da188734d use VAO/VBO to improve performance (#18066) 2017-07-17 15:16:42 +08:00
Wilson E. Alvarez bdfb71b05b Moved GLFWEventHandler to its corresponding header (#18063) 2017-07-13 17:34:28 +08:00
Wilson E. Alvarez 717bd1c248 Fixed typo. Added comments about GLFW 3.3 controller support. (#18064) 2017-07-13 17:29:54 +08:00
minggo 78e2bf5f93 do not use custom EGLContextFactory (#18062)
it will crash on some devices
2017-07-13 17:21:25 +08:00
CocosRobot 17f2a12a28 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18061) 2017-07-13 11:13:38 +08:00
kepler-5 876e4222a9 More useful events and getters in UIScrollView (#18054)
* add begin and end events to UIScrollView

* add new state to copySpecialProperties

* functions to find what percent scrolled in a scrollview we are
2017-07-13 10:35:29 +08:00
James Chen f4bf68610c fixed #18055: [android] urlConnection.getResponseCode may trigger exception which needs to be handled. (#18056) 2017-07-13 09:53:54 +08:00
minggo 2fbbdef58d do not initialize VBO with big size for performance issue on some Android devices (#18060) 2017-07-13 09:52:07 +08:00
CocosRobot 81d70adece [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18052) 2017-07-12 09:50:15 +08:00
halx99 18f173e3e6 Fixed vsnprintf compatibility with vc12 and vc14 (#18040)
* Fixed vsnprintf compatibility with vc12 and vc14

see reference: https://github.com/halx99/cocos2d-x/pull/30

* Update CCConsole.cpp

* Add comment.
2017-07-10 10:30:49 +08:00
Wilson E. Alvarez 5dd81e758a Add controller support for Linux and Win32 (#17990)
* Add controller support for Linux and Win32

* Fix iOS and Mac linker issue

* Fixed documentation. Removed unnecessary whitespace.
2017-07-10 10:30:04 +08:00
Ole Herman Schumacher Elgesem 1c55ad104d Use cocos2d::Rect to avoid ambiguity (#18048)
Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
2017-07-10 10:29:30 +08:00
minggo e7c69e253a fix invalid dt at start on iOS release mode (#18041) 2017-07-10 10:06:25 +08:00
Tiago Martines 74a6fd3293 Do not define VERY_VERY_VERBOSE_LOGGING by default. (#18036) 2017-07-06 14:57:02 +08:00
halx99 78e0cbfc5f Use CurrentDirectory as defaultSearchRoot on Win32 (#18017)
Default, CurrentDirectory equals to ExeDir, but it's more  flexible, and will not break compatible.
2017-07-06 10:24:18 +08:00
CocosRobot#Set 012e9982d8 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically 2017-07-05 01:32:25 +00:00
kepler-5 d3eb857482 horizontal alignment support in RichText (#18027)
* horizontal alignment support in RichText

* split lambda into separate function

* tweak shadow test's content size so horizontal aligment doesn't give the illusion of behaving incorrectly

* fix alignment when the last char of a line is whitespace

* fix errors from merge

* fix bug in setting of size of image elements. scaling was applied effectively twice.

* removed debugging code. whoops
2017-07-05 09:25:12 +08:00
kepler-5 c8fc2dc3ef arithmetic operators for Color4F (#18028)
* arithmetic operators for Color4F

* remove template functions
2017-07-05 09:05:03 +08:00
halx99 f2e9785132 Export cocos2d::utils::findChild to lua-bindings (#18013) 2017-07-04 14:37:44 +08:00
kepler-5 bbe84f8d7a Remove unnecessary dynamic allocation (#18014)
* don't dynamically allocate PointArray's internal vector. take advantage of move semantics where possible.

* don't dynamically allocate RichText's _elementRenders vectors
2017-07-04 14:31:29 +08:00
afpro fec74ac549 CCImage.cpp misuse CC_USE_PNG (#18015) 2017-07-04 14:17:17 +08:00
minggo 6d9bd1bf65 fix stats of seconds per frame on iOS (#18025) 2017-07-04 13:38:03 +08:00
CocosRobot e7a2708812 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#18021) 2017-07-03 15:21:55 +08:00
minggo 84ccbde845 Sequence issue (#18009)
* fix SequenceWithFinalInstant test issue

* fix the issue that sequence will not finish for ever
2017-07-03 09:15:53 +08:00
halx99 795538ad9f Fix sourcePosition bug for ParticleSystem. (#18002) 2017-06-30 09:20:43 +08:00
Wu Zheng 41ef696019 luaoc static function return type fix (#17956)
* update remote repo

* Revert "update remote repo"

This reverts commit c92200d0ac4203c32048ea902e92535dcb4d0935.

* returnType BOOL

* luaoc return type encode
2017-06-26 14:04:55 +08:00
Wilson E. Alvarez eb85f190bd Add CCGLProgramStateCache header to cocos2d.h (#17976) 2017-06-26 13:53:17 +08:00
Wilson E. Alvarez 90af809b89 No need to get the Configuration and Director instances more than once in CCRenderer.cpp (#17978) 2017-06-26 13:52:49 +08:00
minggo 3208120ff9 fix warnings (#17971) 2017-06-23 17:47:20 +08:00
minggo 61839e7a5b fix warnings (#17970) 2017-06-23 17:46:37 +08:00
minggo 4ce443bac2 use prebuilt version of bullet (#17950)
* use prebuilt bullet

* prebuilt bullet work ok on linux

* update search path

* update search path

* fix compiling issue for lua/jsb projects

* prebuilt bullet work on windows

* update 3rd party lib version

* add bullet search path

* fix script bindings issue

* fix scripting binding
2017-06-21 13:39:38 +08:00
Wilson E. Alvarez 61815f57c0 Fixed Director memory leak (#17952) 2017-06-21 09:45:53 +08:00
Wilson E. Alvarez 0f75d3ac5a Added missing header for NDK v15 (#17943) 2017-06-20 09:04:51 +08:00
James Chen 567fa5b0a7 fixed #17800: [iOS] Streaming audio (normally a background music) maybe cut and may not be looped. (#17947)
* fixed #17800: [iOS] Streaming audio (normally a background music) may be cut and may not be looped.

* Updates including.
2017-06-20 09:04:04 +08:00
Wilson E. Alvarez a23924c95b Use const reference where possible. Dropped unnecessary namespace specifier (#17941) 2017-06-20 09:03:35 +08:00
Y-way 7894c5c4a3 Setting new texture for Sprite will reset the program state that is changed (#17938)
In my project:
1.set default texture.
2.set mine shader program
3.set new texture.

then, the sprite will reset my shader program.
2017-06-20 09:02:58 +08:00
Y-way e6210874dd Processing Lua file(UTF8+BOM) that is encrypted will crash,when free the buffer pointer that is changed pointer address. (#17937) 2017-06-20 09:02:40 +08:00
minggo 3e912ffee3 add a macro to stip fps related data and functions (#17934) 2017-06-20 09:02:13 +08:00
CocosRobot 78d5a809c8 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17933) 2017-06-20 09:01:57 +08:00
shintaro.tanikawa f9c8bd4bc1 Add padding options to ListView (#17587)
* Add options to ListView for setting padding

* Add 'setPadding' method test cases.
2017-06-15 14:56:54 +08:00
minggo f79a138c2b revert updating flatbuffers (#17930)
* revert updating flatbuffers

* update external version
2017-06-15 13:42:50 +08:00
minggo 48c44d6a1a remove "system" usage (#17921)
* remove "system" usage
"system" is removed in iOS 11

* android uses old method
2017-06-15 11:07:08 +08:00
James Chen 5620e30f32 fixed #17922: [android] AudioEngine may crash while audio's over and stop state is triggered at the same time. (#17923)
* fixed #17922: [android] AudioEngine may crash while audio's over and stop state is triggered at the same time.
The Pull Request #17748 didn't resolve the issue since _track->getPrevState will be wrong while in scheduler callback. We need to capture it in lambda.
My Pull Request also merges PR #17716 to make filePath captured by lambda.

* Adds missing log tag in AudioEngine-inl.cpp
2017-06-13 17:44:04 +08:00
minggo 5c9ac37f50 initialize callback functions (#17918) 2017-06-12 10:43:45 +08:00
minggo 2b3baf4517 fix precision issue (#17908)
* fix precision issue

* fix shader error on mac
2017-06-12 08:57:40 +08:00
CocosRobot 992ac34a2d [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17913) 2017-06-09 09:54:03 +08:00
minggo f263a43336 Spawn issue (#17911)
* fix isDone() in spawn

* remove unneeded void keyword
2017-06-08 17:07:43 +08:00
James Chen 845e177885 Uses better configuration for huawei optimization and remove rapidjson dependence in EngineDataManager (#17909)
* Uses better configuration for huawei optimization (#17838)

* Uses better configuration for huawei optimization

* Updates jar file and uncomment fps controlling code

* Sync code from 2.x
2017-06-08 17:06:46 +08:00
CocosRobot 7230593be0 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17910) 2017-06-08 17:06:05 +08:00
minggo 61386b0a40 fix the issue the sequence action will not be invoked (#17906)
* fix the issue the sequence action will not be invoked

* add comment

* update _done in update() function
2017-06-08 14:52:36 +08:00
Satoshi 84463dbab4 fix CCLabel line height is reset (#17902) (#17903) 2017-06-07 16:56:02 +08:00
CocosRobot 12db177f5c [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17905) 2017-06-07 16:54:36 +08:00
Undume 72ad341d24 Webview opacity and background transparency (#17831)
* Added three new methods for UiWebView. SetOpacityWebView(float), getOpacityWebView(), setBackgroundTransparent() in IOS

* Implemented methods for UiWebView. SetOpacityWebView(float), getOpacityWebView(). They only work using android sdk +11.

* New methods not implemented for Tizen.

* Added new button for testing the opacity in the cocos2d-x test application.

* Added setBackgroundTransparent to android, and his UI-Test.

* Added setBackgroundTransparent to android, and his UI-Test.

* Added keyword const to the getters.

* Android sdk reflection. +11sdk for chaging the opacity.

* Reflection used for the webview.setLayerType, webview.setAlpha, webview.getAlpha

* Unified exceptions.
2017-06-07 16:12:32 +08:00
CocosRobot 421bd16cb7 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17904) 2017-06-07 13:44:00 +08:00
minggo c7899de857 only create gles 2 context (#17901) 2017-06-07 13:34:07 +08:00
minggo 4ca29ac1cf Merge v3.15.1 (#17897)
* remove APP_SHORT_COMMANDS setting (#17722)

some developers report it will cause error on Windows though i can not reproduce it. It is strange, the setting is used to resolve command length limitation on Windows.

* Particle font size should be a const value (#17676)

* Particle font size should be a const value

* Minor fix: CCStencilStateManager.hpp -> CCStencilStateManager.h in xcode project.

* JSB SocketIO.connect supports to pass a CA cert file (#17736)

* JSB SocketIO.connect supports to pass a CA cert file

* The second parameter of SocketIO.connect function is probably a `option` object. JSB just ignores it.

* The optimization for huawei. (#17832)

* The optimization for huawei.

* setAnimationInterval fix for all platforms.

* disable debug

* include fix.

* Uses better configuration for huawei optimization (#17838)

* Uses better configuration for huawei optimization

* Updates jar file and uncomment fps controlling code

* [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17840)

* update release not and version (#17845)

* [android] Removes an unused variable sRegistered in Cocos2dxActvity.java. (#17861)

* Updates jar to resolve warning while packaging APK file. (#17863)

* update release date (#17870)

* fix compiling error
2017-06-05 13:37:50 +08:00
minggo 8fcf0d7fd9 fix gradle setting (#17896) 2017-06-05 11:35:48 +08:00
Wilson E. Alvarez 41cafe836e Calling PhysicsWorld::setDebugDrawMask(false) will no longer crash when DebugDrawMask was already set to false (#17875) 2017-06-05 10:56:52 +08:00
Tyler Dauch 01714514fa Update CCNode.cpp (#17890) 2017-06-05 10:39:25 +08:00
saumyamukul 0a69031db3 [Windows]Fix edit box spacing and alignment (#17807)
* Fix windows edit box crash, spacing, and alignment

Signed-off-by: saumya.mukul <saumya.mukul@mx.com>

* Cleanup

* Reset file attributes
2017-05-31 08:57:11 +08:00
newnon 639737286f before draw event (#17669) 2017-05-26 11:09:24 +08:00
Nick Dong afcffc7b3a Handle auto layout with scaled widget (#17822)
* handle auto layout with scaled widget

* add test for UILayout for Scaled Widget

* add test for UILayout - Scaled Widget - JS
2017-05-26 10:09:57 +08:00
hellobody 92e713bb1c fix to problem with updating APK in Google Play keeping old OBB (#17689)
* fix to problem with updating APK in Google Play keeping OBB from previous version

This patch fixes the problem when we are unable to keep OBB from previous version when we are uploading new .apk to Google Play.
It was discussed here:
http://discuss.cocos2d-x.org/t/problem-with-updating-apk-in-google-play-keeping-obb-from-previous-version-because-versioncode-changes/36039

* check for null pointer added

Found an issue which could lead to a crash because of null pointer exception.
If pathToOBB doesn't exist then File.list will return null which will cause fileNames array be null.
Now it is fixed.
2017-05-26 09:37:29 +08:00
dadi 3eadc05d36 Fix iskindof (#17785)
* Fix iskindof logic error

* fix iskindof

* No need to deal metatables in function iskindof_
2017-05-23 16:13:37 +08:00
CocosRobot dd880eedf7 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17857) 2017-05-23 10:17:48 +08:00
minggo 69da862f12 fix action running times for instant actions (#17849) 2017-05-23 08:46:44 +08:00
minggo 013d8525ca make fps stable on iOS (#17852) 2017-05-23 08:46:13 +08:00
CocosRobot a857ebe831 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17848) 2017-05-22 16:47:08 +08:00
minggo 54962ee509 LayerRadialGradient works on mac and iOS (#17826)
* LayerRadialGradient works on mac and iOS

* fix radius

* finish LayerRadialGradient and add test case

* use local coordinate in shader

* adjust function attributes

* implement getCenter()

* add some comments
2017-05-22 13:42:00 +08:00
David DeSimone 2f3a7df55a Fixing serious XMLHTTP leak when CC_ENABLE_GC_FOR_NATIVE_OBJECTS enabled (#17844)
* Fixing issue where XMLHttpRequests would not have their destructor fire if CC_ENABLE_GC_FOR_NATIVE_OBJECTS was set. This was due to mismanagement of JSHeap object tracing.

* Removing unused variables in js_add_object_root.
2017-05-22 13:40:07 +08:00
James Chen 474491a5d6 Call 'update' method in 'stop/stopAll' to cleanup immediately (#17846) 2017-05-22 11:12:17 +08:00
Atsumu Ono 85529eaa56 Add const keyword to Node::isScheduled (#17841) 2017-05-22 09:25:18 +08:00
Carlos Madrazo 5a52189821 small BillBoard optimizations (#17825)
* small BillBoard optimizations

-Quick return in visit if it is not visible and has no children.  
-Comment out getNodeToWorldTransform because it is death code (doesn't do anything)

* remove unused rotationQuaternion
2017-05-22 08:59:55 +08:00
Carlos Madrazo a24b40ac47 Allow visit Sprite without camera for render to texture (#17824)
* Allow visit sprite without camera for render to texture

A fix to allow render to texture like this 
'''
        Director::getInstance()->setProjection(Director::Projection::_2D);
        m_renderTarget->beginWithClear(1, 0, 0, 0.2, m_depthClear, 0);
        m_sprite->visit(Director::getInstance()->getRenderer(), Mat4::IDENTITY, 0);
        m_renderTarget->end();
        Director::getInstance()->setProjection(Director::Projection::_3D);
'''

* NULL -> nullptr
2017-05-22 08:58:42 +08:00
Atsumu Ono 08467be5a8 Add const keyward to Node::isScheduled and Scheduler::isScheduled (#17833) 2017-05-19 17:24:05 +08:00
James Chen 95baff7086 fixed #17835: pauseEventListenersForTarget doesn't work correctly while in dispatching event (#17836)
* add test.

* fixed #17835: pauseEventListenersForTarget doesn't work correctly while in dispatching event

* remove a unneeded check
2017-05-19 14:03:51 +08:00
CocosRobot 1bfbf35026 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17830) 2017-05-19 09:41:55 +08:00
Vladimir Perminov 52b35acf95 [Win32,WinRT] Fix listFiles and listFilesRecursively use unicode. (#17813)
* [Win32,WinRT] Fix listFiles and listFilesRecursively use unicode.

1. Incorrect convertation to unicode
if (length != fullpath.size()) correct only ASCII char.
2. For convert unicode exist api, to avoid errors.
3. Equal first char on '.' - error
Need check full name file on "." and "..", otherwise exclude file and
folder begin '.'

Now not use macro UNICODE, for easy use unicode convert api(Otherwise,
you need to connect different versions WinRT and Win32).

* Fix minggo remark.

* Move to specific platform section.
2017-05-18 09:18:18 +08:00
子龙山人 48f6d1c0e5 Refactoring editbox and system label on win32 platform (#17828)
* refactoring windows editbox

* refactoring win32 system label

* fix jenkins ci issue

* remove unneeded function call
2017-05-17 16:20:21 +08:00
Vladimir Perminov 4fccfb2102 [Win32] Fix AudioDecoder fopen unicode. (#17815)
If use fopen to need convert utf8 string FileUtils::getSuitableFOpen.
ov_fopen and mpg123_open use fopen.
2017-05-16 09:45:33 +08:00
André Sousa 9ed89680bb Set camera type accordingly in Camera's init methods (#17809) 2017-05-16 09:17:15 +08:00
Vladimir Perminov 6753c6e98b [WinRT] Fix removeDirectory unicode. (#17812)
CCFileUtilsWinRT::removeDirectory need ut8 string.
temp is wstring(unicode).
2017-05-15 17:10:36 +08:00
子龙山人 9c2782f80a Merge pull request #17786 from AIGRIND-LLC/patch-1
Fix issue #15926
2017-05-15 11:37:21 +08:00
minggo c23330e528 webview supports https in jsb (#17805) 2017-05-11 10:25:43 +08:00
子龙山人 71bb11804d Merge pull request #17802 from zilongshanren/fixAndroidDisplayIssue
fix editbox invisible on some Android devices
2017-05-11 09:52:48 +08:00
Joshua Meng cc21ff32bf Issue #16188: Fix lua-script Sprite:playAnimationOnce(animation, args) blink bug (#17583) 2017-05-10 17:37:38 +08:00
zilongshanren 7695269e44 fix invisible issue 2017-05-10 17:32:58 +08:00