Commit Graph

13104 Commits

Author SHA1 Message Date
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