Commit Graph

5040 Commits

Author SHA1 Message Date
minggo 7dcee2bcf9
Remove ccglstatecache (#19013) 2018-09-11 14:39:30 +08:00
ggggamer cf56f96a14 ClassLoader.loadClass use 'Binary names'. (#19011) 2018-09-10 15:06:19 +08:00
CHP 6a442192d4 Fix uninitialized variables problems found by drmemory (#19028) 2018-09-10 11:23:14 +08:00
CHP 548f50b92b Fix auto test (#19029)
* Fix auto test

* Add atomic include
2018-09-10 10:21:11 +08:00
Arnold eb920949a2 Add websocket latency test (#19018)
* compile on windows

* update android.mk, add WebSocketDelayTest.cpp

* update xcode project

* mac: fix printf format argument %llf

* update cmake
2018-09-07 09:11:04 +08:00
leda 80279cbf21 mark cocos2dx activity as "singleTask" (#19010) 2018-09-04 13:57:44 +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
CHP 4797732518 change PROP_BUILD_TYPE from ndk-build to CMake (#18953)
* Update gradle and android gradle plugin

* PROP_BUILD_TYPE=cmake
2018-07-22 15:28:17 +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
CHP 01f5b19ebf Update gradle and android gradle plugin (#18951) 2018-07-22 13:47:21 +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
Valera d1597a0e3e Fix iCCP profile using mogrify (#18908) 2018-06-29 11:14:13 +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
leda 1ea57fe42a
let app resource path visible when executing "cmake .." on win32 (#18839) 2018-05-23 11:23:16 +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
leda 9ccc271591 add download multi task test case (#18795)
* add network test case

* improve download task

* Trigger CI
2018-05-17 09:10:51 +08:00
leda e74e07bde4 refactor cmake copy res, fix #18813 (#18816)
* refactor cmake cocos copy res function

* refactor cmake dll copy from add_custom_command to configure_file
2018-05-17 09:07:17 +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 f5e35cfe4f check android Gradle config for release mode (#18804)
* update getCocosCommandPath function

* fix typo error in proguard-rules

* update gradle judge OperatingSystem API

* keep default ndk-build
2018-05-11 15:07:19 +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
leda 9275dda539 adjust android / linux build config for cocos CLI (#18780)
* make android native build default mode clear

* update android native build comment

* temp change sub-module, need change before merge

* change tests project cmake file dir

* change PROP_BUILD_TYPE to PROP_BUILD_TYPE

* change var name for build.gradle

* modify others 3 tests project config

* make compile_sdk_version same as target_sdk_version

* update sdk version in CI config script

* update sub-module to cocos2d

* let the cmake build of template  project more clear

* update cocos-console submodule
2018-04-24 13:46:20 +08:00
leda 8ada72aa5c update web Spine to 3.6.39 2018-04-19 09:26:37 +08:00
leda 383c5afa6b Fix sqlite link error,CMake support iOS app Icon (#18746)
* make pack iOS app on Device easier

* fix sqlite link error

* fix app no Icon on iOS when CMake generate Xcode project

* remove useless info.plist source add

* rollback default iOS platform to device

* update cmake readme for ios build

* change android default build to ndk-build, not cmake
2018-04-03 11:18:22 +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
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
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
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
leeda cf1049fcaf add folder ref for Xcode, unify code style (#18617) 2018-01-10 17:18:08 +08:00
Dimon4eg 3d63730c06 Add test wrap unicode text (#18570)
* fix LabelFNTMultiLineAlignment test

* Added test for unicode text wrap
2018-01-10 17:01:19 +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
Vladyslav Kaplun 4f386a4d26 18572 PR amends & override warning fix (#18580) 2018-01-09 09:26:15 +08:00
Peter Siegmund 6164456840 fixed proguard-rules.pro for Android tests (#18594) 2018-01-02 10:31:58 +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
leeda ca46b062fd spine res name update, because files name changed before (#18586) 2017-12-26 09:10:24 +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
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
TheLonelyShepherd e127c353f6 bugfix (#18547) 2017-12-12 17:50:22 +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
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
minggo 5151dfd6f9
Remove ant projects (#18532)
* remove proj.android

* remove ant building and rename proj.android-studio to proj.android

* not pass --android-studio
2017-12-04 18:00:45 +08:00
minggo 9c67dcab9d
remove proj.android (#18529) 2017-12-04 11:26:43 +08:00
minggo a7a61e6a83
travis build android studio projects (#18515) 2017-12-01 17:29:34 +08:00
Sun 685a5441c0 Modified annotations (#18521)
Only some of sentences are start with capitalize the first letter of them. So it's not  regular.
2017-11-29 09:20:15 +08:00
crazyhappygame 03066ff47d Windows 10 update compiler to Visual Studio 10 PlatformToolset v141 (#18511) 2017-11-27 17:10:52 +08:00
James Chen b191318e15 Auto hide home indicator for iPhoneX. (#18514) 2017-11-27 17:08:34 +08:00