Commit Graph

1413 Commits

Author SHA1 Message Date
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
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
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
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
Jeff Wang bd59575468 fix #18296 (#18299)
fix #18296
2017-09-22 11:56:51 +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
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 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
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
Dmitry 6e013b5a8a fixed GLViewImpl::getMonitorSize() for desktop platforms (#18141) 2017-08-22 14:06:53 +08:00
newnon 9815ccba62 Fix android problem (#18142) 2017-08-22 09:52:28 +08:00
newnon a8026b0136 fix android problem with 24 bit depth buffer on some devices (#18148) 2017-08-22 09:43:07 +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
newnon 9f98e4cf83 less warnings (#18144) 2017-08-14 22:31:31 +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 cdac595a68 fix iOS deltatime (#18084)
* fix ios delta time when resumes from background

* remove debug codes
2017-07-18 14:01:53 +08:00
minggo a6773f408a fix crash if there are more than 10 touches (#18082) 2017-07-18 09:47:12 +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
minggo 78e2bf5f93 do not use custom EGLContextFactory (#18062)
it will crash on some devices
2017-07-13 17:21:25 +08:00
minggo e7c69e253a fix invalid dt at start on iOS release mode (#18041) 2017-07-10 10:06:25 +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
afpro fec74ac549 CCImage.cpp misuse CC_USE_PNG (#18015) 2017-07-04 14:17:17 +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 0f75d3ac5a Added missing header for NDK v15 (#17943) 2017-06-20 09:04:51 +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 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
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
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
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
minggo 013d8525ca make fps stable on iOS (#17852) 2017-05-23 08:46:13 +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
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 6753c6e98b [WinRT] Fix removeDirectory unicode. (#17812)
CCFileUtilsWinRT::removeDirectory need ut8 string.
temp is wstring(unicode).
2017-05-15 17:10:36 +08:00
zilongshanren 7695269e44 fix invisible issue 2017-05-10 17:32:58 +08:00
zilongshanren ad614a2952 remove unused variable declare 2017-05-10 16:54:09 +08:00
zilongshanren c609aec95d fix editbox invisible on some Android devices 2017-05-10 15:51:29 +08:00
子龙山人 6e718caa29 Merge pull request #17796 from mxenabled/saumya/android_edit_box_fixes
[Android] Fix edit box font size and alignment
2017-05-10 15:24:16 +08:00
Saumya Mukul 96ae677bb9 Missed padding for default vertical alignment 2017-05-09 09:38:01 -06:00
Saumya Mukul 11a43c0d91 Fixup 2017-05-09 09:36:16 -06:00
Saumya Mukul e24a8f1f8e Fix alignment flags 2017-05-08 16:55:44 -06:00
Saumya Mukul 662b98933c Fix edit box font size and padding 2017-05-08 16:30:46 -06:00
zilongshanren ae8e83b021 fix editbox textChanged call times on Android platform 2017-05-05 11:23:22 +08:00
minggo 6dcaa9fe3a do not use ES3 context if using multi sample (#17778)
multi sample in ES3 needs to use GLES3 function
2017-05-04 16:25:35 +08:00
子龙山人 55b14cbde5 Fix android edit box duplicated text (#17775)
* fix editbox textChanged event called after fragment loaded

* fix editbox duplicatd text when change text in textChanged callback

* revert changes of placeholder modification
2017-05-04 15:04:47 +08:00
Eric Zhong 59f9c35f34 fix downloader will not be conitnue (#17761)
if already has started six data task, then start 7th task will suspend, it will not be run
2017-05-03 10:57:42 +08:00
Aaron Baumbach 58b8e77d74 Moved CC_SYNTHESIZE and CC_PROPERTY macros onto a single line (#17765)
This permits comments to be visible in tooltips for the variable and it's associated accessor functions

e.g.
//The health of the entity, when this reaches zero the entity is dead
CC_SYNTHESIZE(float, m_health, Health)

Previously the above comment would only be displayed in the tooltip for the member variable
2017-05-03 10:12:31 +08:00
子龙山人 1f1f1d8f1a fix ios label shrink overflow clamp letters issue (#17737) 2017-04-25 09:04:00 +08:00
David DeSimone 246406bda1 Adding additional async functions to FileUtils (#17634)
* Adding async functions for FileUtils::listFiles and FileUtils::listFilesRecursively.

* Updating CCFileUtils::listFiles and CCFileUtils::listFilesRecursively to not expose their async version to
the JS and Lua scripting layers, due to a bug in the binding generator code.

* Updating comments in CCFileUtils.h to prevent improper JS bindings to be generated.

* Editing the cocos2dx.ini files, to prevent bindings for listFilesRecursivelyAsync and listFilesAsync to be generated.
2017-04-19 09:14:06 +08:00
James Chen 57170200dd fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming (#17686)
* fixed #17685: [android] Audio in game couldn't be mute while a ring or a call is coming

* Updates comments in AudioEngine-inl.cpp and removes extra empty line in javaactivity-android.cpp

* Puts audio focus relative code to another java file named Cocos2dxAudioFocusManager.java
Renames setAudioFocusLost to setAudioFocus.

* Renames JNI function.

* Register audio focus in onResume and unregister it in onPause.
2017-04-13 10:44:08 +08:00
James Chen 56ae741124 fixed #17665: [android] Crash while launching on the devices only support OpenGL ES 2. (#17671)
* fixed #17665: [android] Crash while launching on the devices only support OpenGL ES 2.
Fixes that egl.eglCreateContext may return non-null but EGL10.EGL_NO_CONTEXT value.
It will cause create a EGL env with a EGL_NO_CONTEXT egl context which will cause crash.

* Don’t link with libGLESv1_CM.so
2017-04-10 11:49:33 +08:00
Andrey 1c697796ea Fixed FileUtils::getFileSize() on android platform (#17632) 2017-04-10 10:16:21 +08:00
Steve Tranby e3e00906e3 Fix can't open URLs that have '&' character. (#17633)
See discussion: http://discuss.cocos2d-x.org/t/small-fix-for-application-openurl-linux/35993
2017-04-10 10:15:29 +08:00
minggo ea8ffa3c1c Merge pull request #17630 from minggo/merge-v315
Merge v315
2017-04-05 15:42:53 +08:00
James Chen acc97516d8 Sensor timestamp fix, tizen uses micro-seconds as timestamp unit. (#17629) 2017-04-01 17:20:48 +08:00
minggo 9ed5127edc synchronize v3.15 2017-04-01 17:16:45 +08:00
James Chen a924e29c2c Adds libmd5-rfc third-party library for calculating MD5 since the functions in <openssl/md5.h> aren’t exported in win10, plus <openssl/md5.h> seems to be private header. (#17625)
* Adds libmd5-rfc library since the functions in <openssl/md5.h> aren’t exported in win10, plus <openssl/md5.h> seems to be private header.

* Adds libmd5-rfc library for win32 and win10.

* Removes json/msinttypes folder from xcode since it’s only needed for win32 | win10.
2017-04-01 11:43:17 +08:00
blackcruiser 1b46096b15 unify sensor timestamp units in Android / iOS / Tizen (#17532) 2017-03-23 10:04:18 +08:00
James Chen 85ded40a98 fixed #17497: Win32 performance is bad. (#17556)
* fixed #17497: Win32 performance is bad.
The 'Sleep(1)' in FPS controlling code isn't precise enough. Windows sets timer precision from 1ms to 15ms, we need to set the precision to the highest one (1ms). Although it's still not enough, we need to make some tricks in the FPS controlling code, that is, don't sleep if the interval is equal or less than 1 millisecond.

* Untabify code.
2017-03-22 15:03:00 +08:00
minggo b0179340be Gles3 support (#17537)
* ios supports gles 3.0

* android supports gles 3
2017-03-21 09:41:55 +08:00
Tyler Dauch 39f264d5c3 Update Cocos2dxDownloader.java (#17528) 2017-03-17 10:47:39 +08:00
mogemimi 8be22ce55c Fix typos in comments and strings (#17534) 2017-03-17 10:44:38 +08:00
pandamicro 68fc0dbfa9 Add utils::getMD5Hash (#17520)
* Add FileUtils::getMD5Hash

* Improve name
2017-03-16 13:47:45 +08:00
blackcruiser e8c752126d fix an Accelerometer second to microsecond convertion error in Android platform (#17519)
1 second = 1000000 microsecond
2017-03-16 12:00:58 +08:00
pandamicro 0eec73ba43 Bindings fix and assets manger ex fix (#17115)
* Fix custom event being discard during event emission

* Fix tilemap black line issue

* Fix auto bindings config

* Adapt websocket to new memory model

* Improve cocos2d_specifics code stability

* Fix issue with get_or_create_js_object function

* Improve memory usage in function wrapper invocation

* Use JS Function bind to avoid memory tracking issues

* Support size parameter to collect total byte size before update process

* Fix download resuming issue on Android

* Remove temporary assets when temporary manifest is invalid or out of date

* Use version compare handle to compare manifests versions

* Support max concurrent tasks setting & download verify callback

* Add Manifest::Asset conversion

* Avoid crash caused by wrappers

* Sync implementation of tested and published AssetsManagerEx from Cocos Creator

* Fix linux compilation issues
2017-03-15 16:09:02 +08:00
pyrosphere 18d2cdbc75 Fixes cocos2d build for tvOS. (#17498) 2017-03-15 10:01:38 +08:00
minggo 7d3b9de866 update gradle version and build tool version (#17496) 2017-03-14 18:13:47 +08:00
Bin Zhang 769f7830f0 Improve the AndroidStudio configurations of tests & templates (#17495)
* Improve the AndroidStudio configuration of test projects to fit the new implementation of cocos compile.

* Improve the AndroidStudio configuration of templates to fit the new implementation of cocos compile.
2017-03-14 13:41:28 +08:00
James Chen 90403fc632 Fixes memory issues catched by Xcode Analyze Tool. (#17489) 2017-03-14 11:09:31 +08:00
James Chen 47694b0b28 fixed #17474: [Android] It may trigger ConcurrentModificationException in Cocos2dxSound.java. (#17479) 2017-03-09 18:11:28 +08:00
James Chen bdcacd0031 Some fixes for search paths: (#17435)
* Some fixes for search paths:
1. Adds ‘_originalSearchPaths’ variable, ’getSearchPaths’ returns the original values set by ‘setSearchPaths’  or ‘addSearchPath’.
2. Adds a getter function ‘getDefaultResourceRootPath’.
3. ‘setDefaultResourceRootPath’ should also update search paths and remove file path cache internally.
4. ‘setSearchPaths’  supports to pass self (_originalSearchPath), could be used in ‘setDefaultResourceRootPath’ to update the final ’_searchPathArray’ for searching full path.
5. ‘addSearchPath’ fix, the default resource root path should be the last element in ‘_searchPathArray’.

* Checks whether the parameter ‘searchResolutionOrder’ passed in is the same as ‘_searchResolutionsOrderArray’.

* Don’t break the compatibility, add a new method called ‘FileUtils::getOriginalSearchPaths’.
2017-03-06 16:59:43 +08:00
Dale Stammen 13a438dbfd win10 uwp fix for new Mouse events (#17434) 2017-03-03 12:40:32 +08:00
radman0x c442275c8e 17357: Better encapsulate the definition of mouse buttons (#17358)
* 17357: Better encapsulate the definition of mouse buttons

Move definition of buttons from a list of #define's to an enum class and
make appropriate updates for successful compilation.

* 17357: Better encapsulate the definition of mouse buttons

Updates from code review:
* Removed changes to automatically generated files
* Removed std::ostream& convenience operator

* 17357: Fix mouse tests
2017-03-02 13:39:33 +08:00
CocosRobot d07794052f Update license to 2017 (#17362)
* Typo: CopyRight -> Copyright

* Copyright update: chukong-inc.com -> Chukong Technologies Inc.

* [js files] Copyright update: 2014 -> 2014-2017

* [cpp files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2015 -> 2015-2017

* [js files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2016 -> 2016-2017

* Copyright update: 2013 -> 2013-2017

* Copyright update: 201?-201? -> 201?-2017

* License year fixes.

* Liscene year fix in CCRay.cpp

* Updates license years in CCGLProgramState.h & CCGLProgramStateCache.h
2017-02-14 14:36:57 +08:00
Wilson E. Alvarez b672b94edc Removed unnecessary assignments (#17328) 2017-02-09 10:57:01 +08:00
minggo 92704517bc remove unneeded assignment (#17320) 2017-02-08 13:58:11 +08:00
mogemimi 9820748184 Fix variable shadowing warnings (#17282) 2017-02-06 15:15:16 +08:00
Wilson E. Alvarez ca28af0113 Fixed variable order in initializer lists (#17274) 2017-02-04 10:33:58 +08:00
j-jorge c616d6d9ff Compilation fix (#17209)
* Fix various compilation issues.

Mostly errors on field initialization order but also missing files
in CMakeLists and missing include directives.

* Fix compilations issues with GCC 6.2

* Fix gitignore libs/ entry to not ignore the Android external libraries.
2017-02-04 09:46:32 +08:00
mogemimi 323838242f Fix implicit conversion warning (#17242) 2017-01-23 09:24:36 +08:00
James Chen b1f2a056b2 Refactor WebSocket to support SSL (wss) (#17172)
* Refactors WebSocket:
1. Supports wss protocol
2. Uses only one libwebsockets context, multiple wsi instances to avoid multi-thread issues
3. Uses lws_create_vhost to create multiple virtual host, different protocols works

* Adds openssl include path to xcode project configuration.

* mac doesn’t depend on curl

* ca file path should be full path.

* More bug fixes like which in https://github.com/cocos2d/cocos2d-x/pull/6986

* Remove curl dependence for mac

* Updates Andorid.mk

* [win32] Adds wss support for win32, and updates openssl, libcurl, libwebsockets libraries.

* Updates external/config.json to 118.

* [win32] Updates cocos/2d/libcocos2d.vcxproj to fix compilation error while building in release mode.

* Linux support websocket ssl connection.

* Updates external/config.json

* Updates install-deps-linux.sh

* Adds dependence of binutils, print ld version

* Updates travis scripts.

* Updates travis scripts.

* Updates travis script, don’t output log while extracting.

* update before-install.sh

* updates before-install.sh

* updates before-install.sh

* don’t output log for installing software.

* Updates config.json to 120.
2017-01-19 13:55:14 +08:00
David DeSimone c258b03f13 Adding async version of common CCFileUtil functions. This will allow engine users to interact with the file system, without blocking the main thread and disrupting rendering. (#17140) 2017-01-13 10:05:46 +08:00
minggo 9d3d869c9d make webview can clean cached data (#17130)
* make webview can clean cached data

* add implementatoin
2017-01-10 11:30:11 +08:00
子龙山人 8e21738634 fix text input auto correction type (#17085) 2017-01-04 12:00:18 +08:00
minggo f63fad3e27 Merge branch 'v3.14' into merge-v314 2017-01-04 09:49:22 +08:00
pandamicro a715e3169f Sync issue fixes from creator (#17041)
* Add EventDispatcher#hasEventListener (sync from creator)

* Fix function wrapper using js object during its gc

* Support more system languages

* Direct log/error for better understanding problems & add sys.now

* Synchronize Editbox APIs

* Synchronize Scheduler.PRIORITY_NON_SYSTEM const

* Upgrade web engine

* Upgrade test cases

* Manually bind EventDispatcher::addCustomEventListener to avoid memory issue

* Manual bind EventListeners’ create to avoid memory issue

* Fix compilation issue when COCOS_DEBUG = 2

* Unify function name of Texture2D::releaseTexture

* Fix compilation issues and update web & bindings-generator

* Fix lua compilation issue

* Use %ld instead of %zd

* Separate FinalizeHook for ref objects and non ref objects

* Fix spine TrackEntry recursive conversion issue by using getter

* Fix crash during Wrappers deallocation (possible to have leak)

* Increase default JS heap to 32 mb

* Update engine version

* Add change log of web engine

* Improve cc.formatStr

* Fix chipmunk crash issues when using setDefaultCollisionHandler

* Add change log for JSB and update web engine ref
2016-12-21 13:39:34 +08:00
James Chen c0291afad7 Merge branch 'v3.14' into merge-v3.14 2016-12-14 17:03:58 +08:00
James Chen a2603d70ef [android] Catches ‘NumberFormatException’ while invoking Integer.parseInt. (#16988)
* [android] Catches ‘NumberFormatException’  while invoking Integer.parseInt.

* [android] Catches ‘NullPointerException’ while converting Integer to int in Cocos2dxActivity.hideVirtualButton.
2016-12-12 11:44:31 +08:00
minggo 3db39a27ea Vibrate test (#16966)
* only show vibrate test on iOS and Android device

* vibrate no matter it is silient or not
2016-12-07 11:12:38 +08:00
子龙山人 1b0a6c2c5c Sync editbox improvement from cocos creator (#16965)
* sync the changes from creator

* fix editbox vertical alignment

* improve android editbox multiline text vertical alignment
2016-12-07 09:21:17 +08:00
Dmitry 964b65e44e Linux Application::openURL return fixed (#16903) 2016-11-28 10:41:36 +08:00
minggo ba321e3ecc fix opengl context conflict when multiple contexts coexist (#16904) 2016-11-28 09:59:04 +08:00
minggo 7556b60103 check VAO with correct way (#16901) 2016-11-25 09:33:20 +08:00
Wilson E. Alvarez 3056269531 Various small performance tweaks (#16881)
* These variables can be accessed by reference

* Assign values in initialization list

* _range can also be in initialization list

* Prefixed ++ and added 'auto' to loops

Also removed extra whitespace

* Prefixed ++/--, and changed for-loop implementation to use 'auto' on some loops
2016-11-22 09:54:04 +08:00
yahont 0c664ebc99 some warnings fixed: unused variables, signed-unsigned comparison (#16878) 2016-11-21 15:03:41 +08:00
Wilson E. Alvarez 0d0dd05287 The return statement is not used in some cases (#16874) 2016-11-21 09:33:06 +08:00
Adrien de Sentenac 460c68125f Use resolved file name (through dictionary lookup) in font atlas creation (#16797)
* Use resolved file name (through dictionary lookup) in font atlas creation, to prevent creating multiple atlases for the same file.
Add font tests with and without font name replacement (through dictionary lookup).

* Fix cpp-tests xcode and cmake project

* Additional fix for cmake project
2016-11-18 09:23:44 +08:00
pyrosphere 663bb4d7ed No CC_UNUSED_PARAM (#16812)
* Added -Wno-unused-parameter and removed all uses of the CC_UNUSED_PARAM macro

* Commented unused parameter names in .cpp files which previously used CC_UNUSED_PARAM

* Reverted -Wno-unused-param flag.
Moved deprecated touch methods definitions to .cpp file.
Commented more unused parameter names.

* Fixed some errors and warnings caused by the previous commit.

* Commented remaining unused parameter names in .cpp files.

* Fixed unused parameter warnings in headers.

* Fixed some more unused parameter warnings.

* Fixed some more unused parameters warnings.

* Fixed mistake in previous commit, missing ComAudioReader:: in method. Other warnings.

* Fixed build errors.

* Added missing file to CMakeLists
2016-11-16 09:48:37 +08:00
pyrosphere ae48e0bf69 Android setMultipleTouchEnabled (#16830)
* Added method to switch between single and multitouch on Android.

* Moved variable definitions to the beginning of the class. Handle single touch for ACTION_MOVE and ACTION_CANCEL.

* Cleaner code by using if/else instead of break
2016-11-16 09:41:07 +08:00
Josh Bodily c3c6681b9e Add Horizontal Text Alignment to UIEditBox (#16772)
* Add Horizontal Text Alignment to UIEditBox

* Fix compile error

* Fix win32 compile
2016-11-09 10:38:00 +08:00
yahont e9b39a99e2 cocos2dInternal cleaned of some warnings (#16818)
* cocos2dInternal cleaned of some warnings: unused parameters and signed-unsigned comparisons

* -Werror removed

* tab fixed

* indent fixed

* more warnings fixed
2016-11-09 10:34:50 +08:00
Ce Zheng 4b3525f7a8 use STL emplace when possible (#16815)
* replaced some unordered_map::insert(std::make_pair(foo, bar)) with unordered_map::emplace(foo, bar)
* replaced some vector::push_back(std::make_pair(foo, bar)) with vector::emplace_back(foo, bar)

The old way will construct a std::pair first then call move constructor
when putting it into the container, while using emplace will construct
the pair in-place in the container. Also, the emplace way is shorter &
more concise.
2016-11-08 11:50:00 +08:00
Josh Bodily 9f31a1e43c Add reason for edit end to UIEditBoxDelegate (#16771)
* Add reason for edit end to UIEditBoxDelegate

* Adds "NEXT" action button for iOS and Android for easier form
* navigation

* Fix compile error
2016-11-03 14:02:53 +08:00
pyrosphere 1667a5c444 Toggle between windowed/fullscreen on desktop (#16762)
* GLViewImpl methods for desktop window management - toggle between fullscreen/windowed

* Window management tests (mac)

* Added window management tests to Win32 and Linux

* Added const keyword. Removed platform macros.
2016-10-31 14:02:02 +08:00
Wilson E. Alvarez c0e1e91373 Performance tweak: Use range-based for-loops and allocate std::vector size() and *end() on the stack where favorable. (#16716)
* Use range-based for-loops and allocate std::vector size(), end(), cend(), rend(), crend() on the stack where favorable.

Other minor trivial changes were applied.

* Fixed Android compilation error

* Fixed windows-universal compilation error
2016-10-27 15:10:24 +08:00
mogemimi fe52c5fa0a Fix typos in comments and strings (#16708) 2016-10-17 10:12:54 +08:00
QingliWang 7c1f88423b Fix bug when app paused the music is still resumed to play after interruption completed. (#16679)
* Support audio interruption and resume callback when change earphone status.

* Refactor keyevent callback and add makecurrent for compatible with different binary.

* Enable Tizen indicator.

* Remove the unnecessary evasobject in the window and refactor the function for glview mode.

* Fix the compatible issue between Tizen 2.3 and 2.4.

* Fix the wrong directory of script resources for HellLua template project.

* Create performance-test project for Tizen platform.
2016-10-12 15:48:27 +08:00
Wilson E. Alvarez cdee1e11de Performance tweak: use range-based for-loops instead of iterator-based for-loops. (#16642)
* Use ++ prefix instead for non-primitive data types in CCAutoPolygon.cpp

* Use ++ prefix instead for non-primitive data types in SimpleAudioEngine.cpp

* Use ++ prefix instead for non-primitive data types in CCNodeLoaderLibrary.cpp

* Use ++ prefix instead for non-primitive data types in CCActionManagerEx.cpp

* Use ++ prefix instead for non-primitive data types in CCDataReaderHelper.cpp

* Use ++ prefix instead for non-primitive data types in HttpClient-android.cpp

* Use ++ prefix instead for non-primitive data types in CCDevice-linux.cpp

* Use ++ prefix instead for non-primitive data types in ScriptingCore.cpp

* Switched implementation to range-based for loops

* Added readability, fixed loop in CCDataReaderHelper.cpp

Thanks to Dimon4eg for the code review.
2016-10-11 10:59:44 -07:00
zilongshanren 5b109854c3 fix mac system font creation with NSFont 2016-10-08 14:34:55 +08:00
Dmitry 771a69709f fix for #16589 (#16636) 2016-10-04 22:26:40 -07:00
minggo 5785c3fcdd use SharedPreferences.apply() instead (#16632) 2016-09-30 14:58:30 +08:00
mogemimi 8b703a8d12 Fix implicit conversion warning (#16598)
* Fix implicit conversion warning

* Change SAXParser::textHandler parameter type from int to size_t
2016-09-26 14:49:47 +08:00
Steve Tranby b22efc9115 Features: add events for window resize, focus, and unfocus (#16578)
* add events for window resize, focus, and unfocus

* fix typo
2016-09-20 20:32:33 -07:00
minggo 84a102edf8 merge v3.13.1 back to v3 2016-09-15 10:08:28 +08:00
mogemimi afe8b05da8 Remove semicolons before method bodies (#16566) 2016-09-14 10:44:00 -07:00
Jun Hyeon, Nam 4342aabe28 remove unnecessary comments (#16572) 2016-09-14 10:42:25 -07:00
minggo 3075108f1c get sdk version from java (#16546) 2016-09-12 09:49:39 +08:00
mogemimi 2b9ac2c950 Remove redundant semicolons (#16558) 2016-09-12 09:45:34 +08:00
mogemimi eca7b2392d Remove unnecessary inline keywords (#16562) 2016-09-12 09:44:21 +08:00
minggo 569681f6bd use api level 13 (#16538) 2016-09-07 14:50:03 +08:00
Ricardo Quesada 282959cc0f fix: uses correct design resolution (#16534)
fixes github issue #16485
2016-09-07 12:01:40 +08:00
Peter Siegmund 9449e687af fixed compile error for android-studio build (with-controller) (#16529) 2016-09-07 12:01:11 +08:00
Ricardo Quesada 2d1048bd00 fix: uses default designResolution if not set previosly (#16533)
fixes github issue #16485
and re fixes github issue #16003
2016-09-07 11:11:52 +08:00
Allen Lee 7c298bdcd7 misspelling check on cocos directory (#16522)
Misspelling fix on some comments,
cocos/editor-support/cocostudio/CSParseBinary_generated.h
fix misspelling postion -> position
2016-09-06 10:14:14 +08:00
minggo db21e5f349 [ci skip]Travis enable pull request (#16494)
* refactor travis and build pull request

* delete unneeded file
2016-09-01 16:25:47 +08:00
Renato Almeida 1c40d5e16d Fix MessageBox inverted params on Android (#16484) 2016-09-01 16:10:02 +08:00
子龙山人 0b1f61b8ce fix possible crash of label shrinked (#16456) 2016-08-29 15:23:01 +08:00
minggo df3b33cd59 Merge pull request #16457 from minggo/merge-v3.13
Update rapid json to version 1.1.0.
2016-08-29 15:22:01 +08:00
minggo 04fd2b16b2 merge v3.13 back to v3 2016-08-29 11:57:13 +08:00
mogemimi 86563af08a Add missing override keywords 2016-08-28 23:45:15 +09:00
halx99 5bc3659a33 #Improve XML parse performance with rapidxml pure SAX parser (#16419)
* Update CCSAXParser.cpp

* #Improve XML parse performance with rapidxml pure SAX parser without compatible break.

* put rapidxml to external

* Update deps
2016-08-24 16:37:03 -07:00
Michael Kösel c339266556 [UserDefault-android] Return defaultValue parameter instead of some default value (#16416)
* Return defaultValue parameter instead of some default value

* Remove unnecessary semicolon
2016-08-24 18:07:17 +08:00
Adrien de Sentenac 3c60398c09 Fix size/position calculations for Linux system fonts. (#16328) 2016-08-23 12:01:43 +08:00
minggo 1b3ff00cef fix compiling error (#16420) 2016-08-23 11:05:01 +08:00
pandamicro f0be4f3069 Merge part of Cocos2d-x-lite (#16380)
* Update js auto binding settings with new ndk version

* Remove unnecessary property from Ref

* Merge part of Cocos2d-x-lite :
1. Improve network bindings
2. Use nullptr instead of NULL
3. Remove usage of some deprecated APIs
4. Add some defensive code and cleanup

* Fix spine track entry circle referencing issue

* cocos2d/cocos2d-x#16327: Fix global object leak issue in JSB

* Improve ScriptingCore::evalString, old implementation have been deprecated in Spidermonkey

* Update JS versions

* Add docs for web v3.13

* Improve ScriptingCore

* Manual merge cocos2d/cocos2d-x#16383 by DavidDeSimone

* Fix auto bindings configurations

* Update web ref
2016-08-19 16:28:47 +08:00
Ricardo Quesada 3ecaa71944 fix: validates director before layout in iOS (#16394)
Adds Director::isValid()
removes DisplayLinkDirector()
removes virtual functions from Director()
Director is no longer an abstract class

github issue #14276
2016-08-18 18:13:15 -07:00
minggo 3ce4134ab3 use java reflection to avoid API level dependent, use app-abi 10 (#16371)
* use java reflection to avoid API level dependent, use app-abi 10

* add license header
2016-08-17 13:55:26 +08:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
minggo 03723da032 implement bsd_sinal for compiling or Android 21+ (#16292) 2016-08-02 16:52:15 +08:00
Dred95 d68f105da4 Fix openURL ubuntu error (#16283) 2016-08-01 11:51:05 +08:00
mogemimi c03dd85c3f Remove redundant includes (#16285) 2016-08-01 10:22:35 +08:00
QingliWang bbfd2d334c Some bug-fix and quality assurance for Tizen support. (#16281)
* Support audio interruption and resume callback when change earphone status.

* Refactor keyevent callback and add makecurrent for compatible with different binary.

* Enable Tizen indicator.

* Remove the unnecessary evasobject in the window and refactor the function for glview mode.

* Fix the compatible issue between Tizen 2.3 and 2.4.

* Fix the wrong directory of script resources for HellLua template project.

* Create performance-test project for Tizen platform.
2016-07-31 22:32:59 +08:00
Vladimir Perminov 817ab329f2 Win32 MessageBox correct show utf8 and LuaLog convert utf8 by common unicode api. (#16249)
* Win32 MessageBox correct show utf8

Support MessageBox utf8 string
based on pr #16234

* LuaLog convert utf8 by common unicode api.

* Add CCStdC.h
2016-07-29 09:36:39 +08:00
Vladimir Perminov 09aa7d9cf4 Win32 move unicode utils global. (#16234)
* Win32 move unicode utils global.

It need for easy converting utf-8 string in all code.
And use it api in user code also WinRT version.

* Move to CCUtils-win32

Also in WinRT version.

* Copyright
2016-07-28 09:57:29 +08:00
Ricardo Quesada 47e6b0cf3d Merge pull request #16237 from ricardoquesada/issue_16220
Compile on macOS 10.10 and lower
2016-07-27 13:30:59 -07:00
Ricardo Quesada 9dcc1f8193 Compile on macOS 10.10 and lower 2016-07-27 07:44:00 -07:00
Ce Zheng 9903d31031 fix CCImage premultipliedAlpha for ETC format
translucent part of ETC format textures are rendered too bright due to
the fact that v3.12 sets PremultipliedAlpha to true by default. This
commit sets default value of _hasPremultipliedAlpha = false, deletes
unnecessary `_hasPremultipliedAlpha = false` code in multiple places,
making ETC format's _hasPremultipliedAlpha false while keeping other
formats unchanged.
2016-07-26 19:17:10 +09:00
mogemimi 093ef3a14f Fix typos in variable names 2016-07-26 04:06:01 +09:00
minggo cc14a06800 Issue 14206 (#16201)
* don't trigger applicationWillEnterForeground at first time to be the same as iOS

* rename first to firstTime
2016-07-25 14:25:48 +08:00
mogemimi 15030ad4c3 Fix typos in log messages 2016-07-25 02:53:22 +09:00
minggo a97906a280 Merge pull request #16184 from minggo/issue-16161
Issue 16161
2016-07-22 13:51:54 +08:00
minggo 8419cc2662 Merge pull request #16183 from SaxonDruce/android-willplaymusic
Implement willPlayBackgroundMusic() on Android
2016-07-22 10:57:26 +08:00
minggo fcd02f109e Merge pull request #16189 from mogemimi/fix-docs-typo
Fix typos in documentation and comments
2016-07-22 10:55:05 +08:00
Ricardo Quesada 1a834ebdbf fix: FPS appears again
Sets default glviewport() when the GLView::updateDesignResolutionSize()
is called

github issue #16139
2016-07-21 15:12:57 -07:00
mogemimi 94d4971ddc Fix typos in documentation and comments 2016-07-22 02:05:19 +09:00
Saxon Druce de091cd3d9 Implement willPlayBackgroundMusic() on Android, to return false if there is other music already playing in another app. 2016-07-21 14:29:13 +08:00
minggo 26dd7b2698 remove curl link for Android 2016-07-21 11:56:56 +08:00
Ricardo Quesada 5f0c0163b3 fix: display FPS again on GLFW platforms
Apparently GLFW stop emitting some events that creation time.
2016-07-19 18:26:14 -07:00
James Chen 15ef80e27d [big refactoring] Audio latency fix for Android. Support to preload effects on Android now. (#15875)
* Audio latency fix for Android. Support preload effects on Android now.

Squashed commits:
[b6d80fe] log fix
[a0a918e] Fixes assetFd didn't be released while PcmData is returned from cache.
[4b956ba] Potential crash fix for PcmAudioPlayer while pause / resume.
[398ab8c] Updates LOG_TAG position in AudioEngine-inl.cpp
[e3634e7] include stdlib.h for posix_memalign
[9004074] fixes setVolume logical error.
[c96df46] Don't use another thread for mixing, enqueue is in a seperated thread, therefore doing mixing in another thread will waste more time.
[0a4c1a8] Adds setLoop, setVolume, setPostion support for Track
[c35fb20] Fixed include.
[cdd9d32] Do mixing by ourself. (TO BE POLISHED)
[6447025] µ -> u since µ could not be shown on some android devices.
[97be0c6] Don't send a silence clip.
[c1607ed] Make linter.py happy.
[0898b54] Puts enqueue & SetPlayState in PcmAudioPlayer::play to thread pool.
[b79fc01] Adds getDuration, getPosition support for PcmAudioPlayer
[80fa2ab] minor fix of the code position of resetting state to State::INITIALIZED
[d9c62f1] underrun fix for PcmAudioPlayer.
[9c2212a] UrlAudioPlayer, playOverMutex should be static, and should be used in update method.
[1519d2e] static variables
[19da936] _pcmAudioPlayer Null pointer check in AudioPlayerProvider.
[e6b0d14] Updates audio performance test.
[fc01dd4] Registers foreground & background event in AudioEngine-inl.cpp(android), the callback should invoke `provider`'s pause & resume method.
[e00a886] TBD: Pause & resume support for PcmAudioPlayerPool.
Since OpenSLES audio resources are expensive and device shared, we should delete all unused PcmAudioPlayers in pool while pause and re-create them while resume.
But this commit isn't finished yet, I don't find a better way to register pause&resume event in AudioEngine module.
[9e42ea3] Interleave mono audio to stereo audio. PcmAudioPlayerPool only contains PcmAudioPlayers with 2 channels.
[3f18d05] Adds a strategy for checking small size of different file formats.
[753ff49] Adds performance test for AudioEngine.
[09d3045] Releases an extra PcmAudioPlayer for UrlAudioPlayer while allocating PcmAudioPlayer fails.
[9dd4477] Using std::move for PcmData move constructor & move assignment.
[6ca3bcb] some fixes:
1) new -> new (std::nothrow)
2) break if allocate PcmAudioPlayer fails
3) renames 'initForPlayPcmData' to 'init'
4) PcmAudioPlayer destructor deadlock if 'init' failed
[54675b6] include path fix.
[a1903ca] More refactorings.
[19b9498] Makes linter.py happy. :)
[923c530] Fixes:
1) Avoid getFileInfo to be invoked twice
2) A critical bug fix for UrlAudioPlayer and adds detailed comments
3) __clang__ compiler option fix for AudioResamplerSinc.cpp.
[5ec4faf] minor fix.
[faaa0f3] output a log in the destructor of UrlAudioPlayer.
[9c20355] NewAudioEngineTest,TestControll crash fix.
[f114464] fixes an unused import.
[1dc5dab] Better algorithm for allocating PcmAudioPlayer.
[331a213] minor fix.
[e54084a] null -> nullptr
[f9a0389] Support uncache.
[89a364f] Removes unused update, and TODO uncache functionality.
[1732bf9] Supports AudioEngineImpl::setFinishCallback for android.
[43d1596] UrlAudioPlayer::stop fix.
[e2ee941] Test case fix in NewAudioEngineTest/AudioIssue11143Test
[5c5ba01] More fixes for making cpp-tests/New Audio Engine Test happy.
[8b554a3] Adds log while remove player from map.
[ed71322] If original file is larger than 30k bytes, consider it's a large audio file.
[fb1845a] Updates project.properties
[6f3839f] minor log output fix in AudioEngine-inl.cpp
[c68bc6c] Don't resample if the sample rate of the decoded pcm data matchs the device's.
[43ca45f] PcmAudioPlayers also need to be removed while they play over, but should not be deleted since their lifecycle is managed by PcmAudioPlayerPool.
[f5e63c9] Audio latency fix for Android. Support preload effects on Android now.

* Supports to loading audio files asynchronously.

* Crash fix for stop audio right after play2d.

* Minor fix for logic in AudioMixerController.cpp

* Adds missing files (CCThreadPool.h/.cpp).

* Minor fix for including.

* Minor fix for missing include <functional> in Track.h

* update license information in audio.h

* Don't use std::future/std::promise anymore since ndk counldn't support it well in armeabi arch.

* isSmallFile postion updated, fixes large audio file goto the checking logic of cache.

* std::atomic<int> isn't supported by ndk-r10e while compiling with `armeabi` arch, using a int with a mutex instead.

* fixes __isnanf & posix_memalign doesn't exist on low api (<=16) devices.

* namespace updated: cocos2d -> cocos2d::experimental

* Removes commented code in AudioMixerController.h/.cpp

* Removes unused code again, and fixes a memory leak of `Track` instance.

* Oops, namespace changed.

* Only outputs log in debug mode.

* Uses ALOGV for outputing logs in AudioEngine-inl.cpp

* const PcmData& ->  PcmData for Track

* Fixes a protential crash in NewAudioEngineTest

* Adds `COCOS` prefix in header #ifndef COCOS_BALABALA #define COCOS_BALABALA

* Uses _ prefix for cocos code style instead of `m` prefix.

* Deletes AudioResamplerSinc related files.

* Bug fix from @minggo's reply on github.

* Don't need to invoke pause after in UrlAudioPlayer::prepare.

* Updates ThreadPool class, uses enum class and adds const keyword.
2016-07-18 10:22:40 +08:00
minggo 1544b8eed0 Merge pull request #16127 from mogemimi/add-missing-fclose
Add missing fclose() to fix a possible bug caused by PR #16114
2016-07-15 18:32:33 +08:00
minggo 8b289d2385 fix bug that virtual button is not hidden after keyboard dismissed
* fix compiling error with --android-studio

* hide virtual button after keyboard dismiss

* remove unneeded log
2016-07-15 18:25:48 +08:00
mogemimi 07d0b4412f Add missing fclose() to fix a possible bug caused by PR #16114 2016-07-15 17:04:14 +09:00
mogemimi 8b05476d45 Use fstat instead of fseek and ftell for performance and portability 2016-07-14 01:18:44 +09:00
Ricardo Quesada 1824b21cb7 Merge pull request #16090 from ricardoquesada/issue_15566
fixes issue #15566
2016-07-12 21:36:52 -07:00
Ricardo Quesada 05a772115e fixes issue #15566
lua and javascript for arm64 is not compiled

version 103

uses JPEG 9b for android

using armeabi

uses Lua, and not LuaJIT for Android ARM64
2016-07-12 19:03:53 -07:00
mogemimi b9c78ac41c Use std::abs to avoid overhead of casting float to double 2016-07-13 00:55:11 +09:00
mogemimi 7531c5156b Fix documentation when compile with -Wdocumentation and Clang 2016-07-10 17:38:32 +09:00
Ricardo Quesada 995868c62e fix: Text::create() does not crash on mac/ios
...on invalid unicode.

fixes issue #16073
2016-07-08 16:59:44 -07:00
minggo 8d8c295ff0 Merge pull request #16062 from minggo/fileutils-issue
fix bug that FileUtils::removeDirectory() can not work on all platforms except iOS and Mac
2016-07-08 14:54:25 +08:00
minggo 4511b35b51 fix bug that FileUitls::removeDirectory() can not work on all platforms except iOS and Mac 2016-07-07 17:43:19 +08:00
minggo 734d857ced Merge branch 'v3.12' into merge-v312 2016-07-07 15:13:21 +08:00
minggo 2f1e14dcde fix compiling error 2016-07-05 14:28:30 +08:00
minggo 4c2efb1319 don't read file content if it is empty 2016-07-05 14:27:28 +08:00
minggo 33d1eb4455 don't invoke front() if container is empty 2016-07-05 14:27:11 +08:00
mr_capone-win7 0e64c2a071 GLView::setFrameSize fixed 2016-07-04 19:48:24 +07:00
mogemimi 2443e09d29 Fix typos and other mistakes in docs 2016-07-04 00:42:10 +09:00
minggo c1949be617 Merge pull request #16017 from minggo/issue-15978
don't search APK if the path is absolute
2016-07-01 17:21:37 +08:00
minggo 12442521b2 don't search APK if the path is absolute 2016-07-01 15:42:02 +08:00
minggo ecf97575ad Revert "Added CCGLViewImpl.h" 2016-06-29 09:45:05 +08:00
minggo 076e0b488b Merge pull request #15980 from minggo/merge-v312
Merge v312
2016-06-29 09:41:30 +08:00
kuzy000 8598003b55 Added CCGLViewImpl.h (#10501)
* Added CCGLViewImpl.h for more consistency

* fixed indentation
2016-06-29 09:36:13 +08:00
minggo bbd837aefa merge v3.12 back to v3 2016-06-28 17:53:50 +08:00
mogemimi bc51528301 Fix typo in FileUtils::Status enum 2016-06-25 12:58:55 +09:00
Ricardo Quesada 0872cccd67 fix: collection of vr fixes (#15948)
* fix: collection of vr fixes

* Node::additionalTransform() and Node::setNodeToParentTransform() can be used at the same time
* Node allocs _additionalTransform in runtime taking 60 bytes lees for 99% of the nodes
* Node calculates the transform faster when an additionalTransform is being used
* VR works when the camera is being moved manually with setNodeToParentTransform
* VR has its own tests
* VR can be disabled and works as expected

* doc: documentation for the new fix

* fix: restore submodule web

* fix: compile and link on iOS

* fix conflicts
2016-06-24 16:55:28 +08:00
Ricardo Quesada 69d2ac1786 fix: collection of vr fixes (#15947)
* fix: collection of vr fixes

Node: additionalTransform() has its own dirty variable
VR: disabling VR works as expected
VR: works with camera3d test
VR: iOS Tracking works even if it doesn't have any input

fix: setNodeToParentTransform() and setAdditionalTransfrom() work...

...at the same time.
Also, this PR makes the size of Node smaller. `_additionalTransform` is
no longer an inline object.
Instead, it is allocated on demand making 99% of the Nodes smaller by 60
bytes.

fix: compile in windows

* doc: documentation for this fix
2016-06-24 10:03:38 +08:00
minggo dbc083b924 Merge pull request #15939 from halx99/patch-2
Optimize, remove unnecessory truncate.
2016-06-24 09:54:57 +08:00
minggo 1042b18999 Merge pull request #15936 from mogemimi/use-nullptr-instead
Use nullptr instead of 0 or NULL whenever possible
2016-06-24 09:54:15 +08:00
zilongshanren 459b7f30c6 refactoring Android editbox setVisible API
fix set visible issue of android editbox

fix android lower case multiline

revert unkown changes
2016-06-23 18:18:39 +08:00
halx99 cd93612746 Optimize, remove unnecessory truncate. 2016-06-23 16:01:05 +08:00
minggo 08898db883 Merge pull request #15831 from j-jorge/premultiplied-alpha-config
Add a config option to enable or disable the premultiplied alpha code.
2016-06-23 13:57:41 +08:00
mogemimi cbc0612306 Use nullptr instead of 0 or NULL 2016-06-23 12:39:23 +09:00
子龙山人 bac1870d16 fix android editbox custom font file (#15924)
* fix android editbox custom font file

* simplify get real font name on Android
2016-06-23 11:26:32 +08:00
minggo 324931a242 Merge pull request #15919 from zilongshanren/fix-android-system-fontname
fix system font creation on Android platform
2016-06-22 18:10:13 +08:00
zilongshanren 783dfb3f14 fix system font name on Android ttf creation 2016-06-22 16:54:01 +08:00
minggo 9fd190d283 Merge pull request #15916 from dumganhar/fix/AssetsManager
fix AssetsManager could not work after Pull Request #13893 was merged.
2016-06-22 15:25:18 +08:00
James Chen 8e19db7d26 fix AssetsManager could not work after Pull Request #13893 was merged. 2016-06-22 14:31:26 +08:00
mogemimi a3bc979452 Fix typos in documentation and comments 2016-06-22 11:22:05 +09:00
minggo 6b9c76fd93 should use full path to check directory 2016-06-22 10:19:35 +08:00
Julien Jorge 6fb3946c51 Add a config option to enable or disable the premultiplied alpha code. 2016-06-20 18:05:11 +02:00
Ce Zheng 84db1ac294 fix downloader build issue for Android API 23
fixes #15823
2016-06-17 22:32:49 +09:00
minggo 6778ebf451 Merge pull request #15853 from ricardoquesada/vr_squashed
Squashed commit of the following:
2016-06-17 10:15:20 +08:00
minggo 9b210e00d7 Merge pull request #15837 from geemedia/cmake-improvements
Various CMake improvements
2016-06-16 14:53:10 +08:00
minggo d66b686bd8 Merge pull request #15816 from yalab/valuemap_reject_none
Fixed to fail FileUtils::writeValueMapToFile on iOS.
2016-06-16 14:20:46 +08:00
Ricardo Quesada 180c2f1e9a Squashed commit of the following:
VR support for cocos2d-x

commit 087aff0aec24b81418fa2678ce0cae2d4c1e2e01
Merge: b32d329 fc44d0d
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 11:26:33 2016 -0700

    Merge branch 'v3' into vr

commit b32d329f9331a4f9bbbbf946b88b31db7559934d
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 11:25:27 2016 -0700

    fix: dont' include oculus files

commit 816928c6a8782984830aa92de5bed038c1306cdc
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 10:57:26 2016 -0700

    fix: missing guard in header

commit 2abd4eb5a1fc961c2cbae9b00809b5e6409740db
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 10:43:49 2016 -0700

    removed VR engines... should be part of package manager

commit 583179755d1c66c02e898297230d0f882e629b98
Merge: 12f4f71 b6d6bb0
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 10:42:37 2016 -0700

    Merge branch 'vr' of github.com:ricardoquesada/cocos2d-x into vr

commit 12f4f71aca4fa15231976a7727faf40648d62313
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Jun 15 10:42:12 2016 -0700

    fix: new VR API... easier to enable/disable different VR renderers

commit b6d6bb087f54cbd272fbfb9e1cf1cd6bba776ffa
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 14 20:48:04 2016 -0700

    fix: compiles and runs on win10

commit e73aa8902118377abbd2192c757104c4531d2a9e
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 14 20:27:06 2016 -0700

    fix: vr works again

commit 5615e276507edf8602f043f3130204a89dbaba69
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 14 18:55:18 2016 -0700

    fix: compiles on windows

commit 494061ee4da8fbc5616f83efb64b2c0c3932778e
Merge: 284910b fd3b6d4
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 14 17:13:47 2016 -0700

    Merge branch 'v3' into vr

commit 284910b204ee0dd76d949ea8f2b2f6b1b72e533f
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 14 17:12:25 2016 -0700

    android vr: better performance

commit aa8328e8029143dd7c6c724f38915f0fb3b64abe
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jun 13 16:10:14 2016 -0700

    fix: low pass filter in accel and magnet

commit f6d9b622abff5abb95ad60fa7139f3ce1ec9caab
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jun 13 15:43:00 2016 -0700

    fix: removes debugging info

commit 2004f0ce5605dad70ff8656a058073181346f083
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jun 13 14:54:32 2016 -0700

    fix: kind of works on android! yeah!

commit d6dcb6a3410fda053f0d6fbc00af817a13a86d3b
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jun 10 09:44:53 2016 -0700

    logging

commit 7e5d6ad52d39642c111e7b690173338af4e94092
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 7 22:53:07 2016 -0300

    android head tracking

    compiles, doesn't work yet... how to debug java code?

commit cbf5f6482aa0ae002a7dc40045ef3ffdbe192e26
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 7 19:45:41 2016 -0300

    reading sensor from android

    not compiling yet

commit 6ee0a3c2c43f8e8a603bfce9fddb0cce5ce79415
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Jun 7 11:45:06 2016 -0300

    compiles on android... finally

commit fb728da756ca7ee94b316c113e2239a77d9f4b53
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jun 6 18:15:12 2016 -0300

    fix: compile vr android files only on android

commit 90db6daef382d142bb60207d2b16936dd66ee245
Merge: 2e56f03 cc936af
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon Jun 6 12:15:56 2016 -0300

    Merge pull request #11 from songchengjiang/riq_vr

    daydream VR platform supporting

commit cc936afac44518a00b90ec3133aaac5d00f0b91f
Author: songchengjiang <moses_jc@sina.com>
Date:   Mon Jun 6 10:38:27 2016 +0800

    remove VR 3rdparty dependence

commit 5f7a1a9c80f84cc915763ad6f52ffc524dd59309
Author: songchengjiang <moses_jc@sina.com>
Date:   Mon Jun 6 10:34:37 2016 +0800

    remove VR 3rdparty dependence

commit 3f72ecde2a259357a137bec1e99e731a2e78df84
Author: songchengjiang <moses_jc@sina.com>
Date:   Mon Jun 6 10:28:43 2016 +0800

    remove VR 3rdparty dependence

commit 2e56f032d1daced1b66b984acacc6f5007f5ecc3
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jun 3 10:45:44 2016 -0300

    fix: started android support

commit 1910c9c488ee4315110081b60438aa1b7c1011f2
Author: songchengjiang <moses_jc@sina.com>
Date:   Thu Jun 2 15:58:34 2016 +0800

    add CCVRGvrRenderer and CCVRGvrHeadTracker framework

commit 96200eedea9234287153d71b4f198077cc49389a
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 31 13:07:44 2016 -0300

    fix: little fixes

commit a2eb8114b2969beca83762ba829c8cb809b1615a
Merge: 20a74e0 5fddebc
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 31 12:12:59 2016 -0300

    Merge pull request #10 from songchengjiang/riq_vr

    bugs fixed

commit 5fddebcae997db9e1a4108413d73b0d057a61e83
Author: songchengjiang <moses_jc@sina.com>
Date:   Fri May 27 15:57:30 2016 +0800

    parameter corrected

commit 925aad012ae513ebeeec682b003123a3c543759f
Merge: 9b5e02f 20a74e0
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Fri May 27 15:46:13 2016 +0800

    Merge branch 'vr' of https://github.com/ricardoquesada/cocos2d-x into riq_vr

    Conflicts:
    	cocos/2d/CCScene.cpp

commit 9b5e02fa7c9fcdd15cfea99769560ed30b976e9e
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Fri May 27 14:36:31 2016 +0800

    fixed ProjectionMatrix error on oculus platform
    fixed ScrollView error on oculus platform

commit 3c63ead1943d1cf8aa3c0fd722a4b3834db323b1
Author: songchengjiang <moses_jc@sina.com>
Date:   Fri May 27 10:51:46 2016 +0800

    bugs fixed

    mobile VR platforms:
    fixed ProjectionMatrix  error
    fixed culling error of ScrollView

commit 20a74e064708e6bf9d15cc5551d1f86af9d24010
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri May 20 09:22:45 2016 -0300

    fix: setAdditionalTransform support reference

commit 8341df82a02683b8e4ae02654e90617a2e5ced6d
Merge: 83751de 469d38d
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed May 18 07:38:49 2016 -0700

    Merge pull request #8 from songchengjiang/riq_vr

    Finished VR integration of SKDs based on VRProtocol

commit 469d38d778cd5f947098a08d8fd14ca6f32b0502
Author: songchengjiang <moses_jc@sina.com>
Date:   Wed May 18 15:32:32 2016 +0800

    fix bug of deepoon's headtracking

commit 83751deac133910c24321ddaddff93bf736de884
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 17 09:41:17 2016 -0700

    fix: Scene inverts the eye matrix

commit 41ae41969a71fd5b07396faac78e777c4afbe5c4
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 17 06:54:34 2016 -0700

    fix: inversed matrix for camera

commit 049dee721356a47b19f5e51a0face6a5a1647095
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Tue May 17 15:51:57 2016 +0800

    add headtracker of oculus

commit 3f6478352a4baebc684105156389655edbac7e6f
Author: songchengjiang <moses_jc@sina.com>
Date:   Tue May 17 14:22:56 2016 +0800

    add headtracker of SKDs

    gearvr/deepoon/cardboard

commit 59df985b72adf0dbb5a4c66c80ae7299b16ae909
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon May 16 22:12:23 2016 -0700

    fix: head tracker works

commit 306c59da0175708c96b5757f5f27afd6a6592fe3
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon May 16 17:55:43 2016 -0700

    fix: adds missing methods to `VRIHeadTracker`

commit 91100b8a86d78801fbcd08e99427d6a6363ad69b
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Mon May 16 14:17:21 2016 +0800

    Rename Oculus's files

commit 01ef6215de936a8d8bb15f9ec195cb81b2b4b18f
Author: songchengjiang <moses_jc@sina.com>
Date:   Mon May 16 11:41:56 2016 +0800

    Rename files based on riq's changes

commit 734efbb045064d24df095c5b8fc604ef2aab1dea
Merge: 91449c9 769a883
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Mon May 16 09:57:57 2016 +0800

    Merge branch 'riq_vr' of https://github.com/songchengjiang/cocos2d-x into riq_vr

    Conflicts:
    	build/cocos2d_libs.xcodeproj/project.pbxproj
    	cocos/vr/CCVRGeneric.cpp
    	cocos/vr/CCVRGenericHeadTracker.h

commit 91449c9d23e357549cb1aeae6d1454274def1aab
Merge: d3e4550 a33faaf
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Mon May 16 09:54:44 2016 +0800

    Merge branch 'vr' of https://github.com/ricardoquesada/cocos2d-x into riq_vr

    Conflicts:
    	build/cocos2d_libs.xcodeproj/project.pbxproj
    	cocos/platform/CCGLView.cpp

commit a33faafa1a2b6cffdc32d87f3c1c321f46f94789
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat May 14 00:57:54 2016 -0700

    fix: adds head tracker

commit ea348cf72d3e54dc3864571bff1405909dbb65c9
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri May 13 18:40:32 2016 -0700

    fix: removes red background

commit 113c7debe9a35fc142183a9012cac40063e17efe
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri May 13 18:39:31 2016 -0700

    fix: centers image

commit 769a883c93f4f7c6191462626845f01d6f8596fe
Author: songchengjiang <moses_jc@sina.com>
Date:   Fri May 13 20:36:19 2016 +0800

    Merge branch 'vr' of https://github.com/ricardoquesada/cocos2d-x into riq_vr

commit d3e45501cd2cada87735390a407fbd44e61cd84e
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Fri May 13 17:52:46 2016 +0800

    update win32 project for VR

commit ba0fdb8b8e1efaf8fdf88e044e701fb5bedb4839
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu May 12 23:21:50 2016 -0700

    fix: no hardcoded values

    code is simpler, fixed a few bugs

commit b30596cdae4cdcf39d960a39661a79200b27c7a8
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu May 12 21:50:18 2016 -0700

    fix: simplified distortion

commit 37b184f084e7b50bac9a5a3c59a87f8f03440b53
Author: songchengjiang <songcheng.jiang@chukong-inc.com>
Date:   Fri May 13 09:39:34 2016 +0800

    finished VR rendering of Oculus

commit f7d74cd0a2479541c0546d0ec41fe4f867405fcc
Author: songchengjiang <moses_jc@sina.com>
Date:   Thu May 12 10:00:43 2016 +0800

    Finished GearVR and Deepoon VR rendering integration

commit 776fb4fd7420f1c14403eb476df1e9716362f1e5
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed May 11 16:56:57 2016 -0700

    fix: distortion working... with too many hardcoded values

    time to "un-hardcode" the values

commit 0584773cca88c5b3dee72821830841f617cfb21c
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 10 19:49:07 2016 -0700

    feat: distortion WIP

commit 9b5ef01776eaa617dd4677c3824e50c1f9da41c6
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue May 10 15:49:17 2016 -0700

    fix: simpler

    one texture that holds both left and right eye

commit bfff504c499c253a0c36b342e6b5bcb0edf4fed7
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Mon May 9 10:50:43 2016 -0700

    fix: Camera code is cleaner

commit fcf730bc2afc6c4552787273577e1942088c2e42
Author: songchengjiang <moses_jc@sina.com>
Date:   Mon May 9 16:43:58 2016 +0800

    support cardboard VR rendering

commit f88b834b70fbfb28db0c8442e68984c61192d7cc
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri May 6 21:16:10 2016 -0700

    fix: proj fixes. works ok in any resolution

commit f980a616837b0f259d9564e622c78e0f4869ed53
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri May 6 19:08:47 2016 -0700

    fix: renders ok in any device

commit 4799ad32ea38ddd217e80e868c3d9021c03e88ce
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu Apr 28 16:46:30 2016 -0700

    fix: renders something

    fix: passing camera to scene

    adds a way to return user camera

    fix: stereo rendering works

    fix: viewport left is correct

    fix: scissor is not needed...

    fix: works!

    fix: minor fixes

    fix: new approach... almost working

    fix: camera is moved

    whitespace fixes

    fix: whitespaces

    fix: new line

commit c137a53aba227cf2e2a1809b55cb9b3da25d432b
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Wed Apr 27 18:56:41 2016 -0700

    fix: VR refactor... still WIP

commit 16fde77d71b8309e982bf6fa4f4ee0acea5fc0d1
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Tue Apr 26 22:21:21 2016 -0700

    feat: VR, initial commit
2016-06-15 11:33:25 -07:00
Dale Stammen 53321e401a updated to support Windows 10 UWP x64 builds 2016-06-15 08:50:04 -07:00
minggo fc44d0deed Merge pull request #15850 from minggo/hide-virtual-button
[ci skip]hide virtual button correctly
2016-06-15 18:38:59 +08:00
minggo 7bf13f34cd hide virtual button correctly 2016-06-15 18:33:52 +08:00
minggo 8c9019b128 Merge pull request #15848 from minggo/hide-virtual-button
[ci skip]hide virtual button if has focus
2016-06-15 18:20:53 +08:00
minggo d94dc7edc0 hide virtual button if has focus 2016-06-15 18:19:06 +08:00
minggo 3807a2f678 Merge pull request #15847 from minggo/hide-virtual-button
[ci skip]hide virtual button by default
2016-06-15 18:08:00 +08:00
minggo a8c6011f66 use android sdk 19 2016-06-15 18:06:53 +08:00
minggo 8634773be3 hide virtual button by default 2016-06-15 17:55:26 +08:00
minggo d7b495c3d1 Merge pull request #15838 from MagicXrEv/rename-end-functions
lua binding : Rename end() to endToLua().
2016-06-15 16:24:34 +08:00
mogemimi a348cbda8b Move StringUtils functions from deprecated header file to ccUTF8.h (#15835)
* Move StringUtils functions outside of deprecated header

* Replace deprecated headers with 'base/ccUTF8.h'
2016-06-15 15:01:26 +08:00
子龙山人 51f4deee01 Add system label overflow (#15827)
* Add system font overflow

1. currently only iOS, Mac and Android platform are supported

add mac label overflow shrink

modify system font overflow test

fix warning and possible memory leaks

add ios system label overflow support

add iOS system font overflow support

fix iOS system font overflow

fix Mac System font overflow

add android system font clamp

add Android system font shrink

cleanup iOS shrink related code

fix Android system font clamp

add core text to project template

fix iOS tests project

fix mac and iOS shrink

improve iOS and Mac clamp feature

fix header file include path

* modify the comments, make it more clearer
2016-06-15 10:43:15 +08:00
MagicXrEv 8e6ca57f4f lua binding : Rename end() to endToLua(). 2016-06-14 23:35:17 +08:00
Adrien de Sentenac dac9be5016 Various CMake improvements
- Added c++_shared (LLVM) to Android toolchain options. Fixed AndroidNdkGdb.cmake.
- Fixed includes when not using prebuilt libs. Added option to use sources in external when not using prebuilt libs.
- Added option in CMake to be able build Box2D without using it as physics library in cocos2d-x (similar to what is done in the Visual Studio solution).
2016-06-14 10:20:57 -04:00
yalab 598be0840c Fixed to fail FileUtils::writeValueMapToFile on iOS. 2016-06-10 14:53:11 +09:00
mogemimi 07e0c1cbf9 Fix typo in method name: 'destory' -> 'destroy' 2016-06-09 09:25:06 +09:00
minggo 93d87ad19e android supports LOWERCASE_ALL_CHARACTERS 2016-06-07 12:41:22 +08:00
minggo 9322ecc937 Merge pull request #15768 from minggo/issue-15738
add a new create method to create resizable window
2016-06-03 09:28:40 +08:00
minggo 75227a5c0e [desktop]fix the bug the depth test is disabled when application size changed 2016-06-02 16:18:31 +08:00
minggo 7243b00cad add a new create method to create resizable window 2016-06-02 15:48:16 +08:00
mogemimi a4a357db69 Remove unnecessary sinf, cosf, tanf and sqrtf macros 2016-05-31 02:39:40 +09:00
mogemimi c647a95656 Fix C4267 and C4309 warnings when compiling for Windows 10 UWP 2016-05-29 14:43:28 +09:00
minggo 74fe77a367 Merge pull request #15737 from yalab/slicent_warning_android_clang
It mute warning on android clang.
2016-05-27 16:46:50 +08:00
yalab 3ea46c617f It mute warning on android clang. 2016-05-27 15:39:33 +09:00
mogemimi fc6c612c4c Remove duplicate header includes 2016-05-26 23:25:44 +09:00
zilongshanren 13003d9a78 Merge pull request #15727 from dumganhar/editbox-fix
Make sure closeKeyboard run on UI thread
2016-05-26 18:08:03 +08:00
zilongshanren 517cb9e437 Merge pull request #15729 from dumganhar/editbox-fix-2
fixed java.lang.IndexOutOfBoundsException while invoking toString on GL thread.
2016-05-26 17:24:09 +08:00
James Chen d42b99b10b fixed java.lang.IndexOutOfBoundsException while invoking toString on GL thread. 2016-05-26 15:49:57 +08:00
James Chen cf883b5c0f UI thread check. 2016-05-26 12:02:23 +08:00
James Chen a472ab2931 Make sure closeKeyboard run on UI thread 2016-05-26 11:57:57 +08:00
James Chen 5321a2fc7a Removes unused package import for Cocos2dxSound.java. 2016-05-26 11:15:44 +08:00
James Chen 1285954cd9 Try catch IllegalStateException in Cocos2dxMusic.java. 2016-05-26 10:25:45 +08:00
Shulepov 758425cfd5 Refactor CCFileUtils-apple to remove code duplication (#15645)
* Refactor CCFileUtils-apple to remove code duplication of conversion from CCValue to NSObject and vise versa

* CCFileUtilsApple: rename helper functions
2016-05-23 18:26:19 +08:00
halx99 86d148c24c change if (fontName.c_str()) to if(!fontName.empty())
fix warnning, change if (fontName.c_str()) to if(!fontName.empty()), The first expression's value always true.
2016-05-20 23:10:28 +08:00
Greg Rynkowski 21fc67b358 Enable WebView's local storage on Android
Problem:
cocos2d::experimental::ui::WebView' local storage wasn't working on
Android. On iOS worked fine.

Solution:
Enable local storage of android.webkit.WebView in Android.

References:
https://developer.android.com/reference/android/webkit/WebSettings.html
http://stackoverflow.com/questions/5899087/android-webview-localstorage
2016-05-19 14:43:35 +01:00
minggo c6034787e4 Merge pull request #15664 from mogemimi/replace-ccassert-macro
Replace CCAssert macros with CCASSERT
2016-05-18 11:57:18 +08:00
minggo a54251b854 Merge pull request #15659 from mogemimi/use-const-reference
Use const references whenever possible
2016-05-18 11:55:55 +08:00
mogemimi 320ec027f7 Replace CCAssert macros with CCASSERT 2016-05-18 01:49:35 +09:00
minggo 3e396fedab Merge pull request #15617 from pandamicro/v3
Some modifications merged from Creator
2016-05-17 13:43:41 +08:00
mogemimi 948f64631f Use const references whenever possible 2016-05-17 13:17:56 +09:00
pandamicro c96bd9a4df Resolve local reference leak and function order 2016-05-17 12:06:28 +08:00
mogemimi 16878a53b1 Suppress MSVC warning C4800 2016-05-13 11:44:17 +09:00
pandamicro 6b59dc24c7 Add Image::setPNGPremultipliedAlphaEnabled 2016-05-11 16:36:21 +08:00
pandamicro 1cbbde5d8b Fix android LocalStorage return null for empty string value 2016-05-11 11:57:54 +08:00
minggo f4a7ba836c Merge pull request #15599 from Naruto/feature/fix_build_error_using_fileutils-apple
fix build failed using FileUtilsApple on Application code.
2016-05-10 12:07:16 +08:00
Naruto TAKAHASHI 79b9a191d0 declare explicitly FileUtilsApple destructor 2016-05-09 21:50:52 +09:00
minggo d086965683 Merge pull request #15598 from minggo/android-package-name
[ci skip]set correct package name
2016-05-09 18:17:28 +08:00
minggo 2a712a0c3b set correct package name 2016-05-09 18:14:53 +08:00
Steve Tranby 7c1e60f0b7 Prevent memory leak: force drain on autoreleased `data`. 2016-05-05 08:00:28 -06:00
minggo 9218329968 Merge pull request #15569 from minggo/issue-15522
Fix compile error isnan -> std::isnan
2016-05-05 11:36:24 +08:00
minggo e2c38ed87f make std::isnan work for winrt 2016-05-05 10:29:31 +08:00
mogemimi 2df9afbe71 Fix typos in documentation and comments 2016-05-05 08:05:20 +09:00
minggo a5602cc732 merge v3.11 back to v3 2016-05-04 16:02:23 +08:00
minggo 6260c67941 Merge pull request #15549 from minggo/issue_15525
use std::atof() instead
2016-05-04 09:38:42 +08:00
Adrien de Sentenac 1a76c9ea3b Add OBB (zip) support (#15515)
* Add OBB support.
OBB must be a zip file with audio and video files stored uncompressed.

* Use introspection to be able to build with Android API level 10.
Using the new audio engine to play sounds from the OBB will only work with API level 12 (Android 3.1) or above.
2016-05-04 09:21:35 +08:00
pandamicro 3d6bddd2c7 Merge pull request #15465 from cezheng/fix/several_network_bugs
[BugFixes]Several serious bug fixes related to network/asset_manager
2016-05-03 17:37:32 +08:00
minggo 1bf56d5a78 use std::atof() instead 2016-05-03 15:50:06 +08:00
Zhe Wang a640f007ef Fix doxygen format mistakes in enum class Platform
An user reported this error in the forum http://forum.cocos.com/t/api-document/36199/2
I noticed that our doxygen was written in wrong format.
2016-04-30 15:20:24 +08:00
Xpol Wan f111583214 Refactor FileUtils::getFileData() and CCFreeTypeFont::loadFont().
* Remove unnecessary memory copy in FileUtils::getFileData()
* Add Data::takeBuffer() to simplify FileUtils::getFileData() and CCFreeTypeFont::loadFont().
2016-04-29 09:31:09 +08:00
zilongshanren 482788c933 Add tizen support (#15518)
* add Tizen Support

* fix linter error

* fix tizen audio engine lua bindings config
2016-04-28 09:49:55 +08:00
minggo fc5e537327 Merge pull request #15508 from xpol/remove-use-of-getFileData
Remove last internal use of deprecated `FileUtils::getFileData()`.
2016-04-27 09:38:30 +08:00
Xpol Wan bd3c3a7c3d remove default value for size argument. 2016-04-26 14:54:20 +08:00
minggo 2319860d38 remove unsupport flags 2016-04-26 14:08:23 +08:00
Xpol Wan 3f8910d80c Remove last internal use of deprecated `FileUtils::getFileData()`. 2016-04-26 13:57:53 +08:00
xpol 43a94c0693 Add FileUtils::getContents(). (#15479)
* Add FileUtils::getContents().

* skip FileUtils::getContents() in binding generator config.

* use FileUtils::getContents in CCDataReaderHelper.

* obey the cocos2d-x coding style.

* Explicit constructor.

* More docs.

* More tests.

* Move FileError to FileUtils::Error.

* Fixes wrong buffer size for reading into string and vector.

* Update tests.

* Add note on padding for output buffers.

* FileUtils: implements old methods by using `getContents()`.

methods are:

* FileUtils::getDataFromFile()
* FileUtils::getStringFromFile()
* FileUtils::getFileData()

and follow Android methods are now just calls FileUtils' ones.

* FileUtilsAndroid::getDataFromFile()
* FileUtilsAndroid::getStringFromFile()
* FileUtilsAndroid::getFileData()

* Fixes build error.

* FileUtils::getFileData: Return the size of data.

* Remove old methods form FileUtilsAndroid they are now done in FileUtils.

* Fixes for win32 code.

* Fixes build error in test and add more test.

* Better error message.

* Make template type name more readable.

* Update comments.

* Move internal functions to anonymous namespace.

* Refactor FileUtils test.

* Fix warning about compare signed and unsigned.

* Win32 and WinRT does not use text mode.

That is we don't need simulate convert CRLF to LF.

* Fixes for Win32 and WinRT.

* Update for Win32 and WinRT.

* Win32: return FileUtils:Error::TooLarge when file is large than 2^32-1.
* Win32: remove checkFileName() which has no effect at all.
* WinRT: add FileUtilsWinRT::getContents() using ::CreateFile2.
* WinRT: add override keyword for FileUtilsWinRT::getFileSize().

* Update for coding styles.

* More error strings.

* check read and malloc return codes.

* rename FileUtils::Error to FileUtils::Status.

* Fixes for WinRT, use GetFileInformationByHandleEx to get file size.

* Fixes build error for winrt and cleanup FileUtils::Status.

* Try to fix the build error on Linux.

Status must defined in some header, so move FileUtils.h up.

* Remove support of text mode on WinRT (it is the last platform support text mode).
2016-04-26 13:37:22 +08:00
Josh Bodily 614c3c47d7 Josh/winrt inplace editbox (#15473)
* WinRT in-place edit box

* Fix static analysis errors
2016-04-25 11:17:09 +08:00
minggo 6459c92ee7 Merge pull request #13950 from Almax27/patch-4
Added CC_PROPERTY const qualifier
2016-04-21 14:56:01 +08:00
Ce Zheng d848292860 make android downloader taskQueue thread
My previous fixes for the android downloader in #14530 are not thread
safe, this commit fixes the problem
2016-04-20 13:42:00 +09:00
minggo 095f404738 Merge pull request #14735 from linguofeng/patch-2
CCFileUtils-apple.mm Grammatical errors
2016-04-20 11:00:38 +08:00
minggo e16d016c46 Merge pull request #15452 from 1scaR1/fix_osx_sandbox
Implement createDirectory for apple platform.
2016-04-20 10:26:45 +08:00
Julien Jorge a3f28a18df Uniformize image support macro usage.
All images format implementation but WIC test the value of a CC_USE_<FORMAT>
preprocessor macro to verify if the implementation must be available or not.
WIC support is checked against the definition of the macro only,
independently of its value, thus making the implementation available even
if CC_USE_WIC = 0.

This commit makes the tests of the CC_USE_WIC macro identical to the tests
of the other similar image format macros.
2016-04-19 14:15:43 +02:00
Бесшапошников Никита a3717b6907 Add error logging of incorrect directory creating. 2016-04-19 10:17:31 +03:00
minggo 5c567c54b4 Merge pull request #15198 from perminovVS/v3-dev-wrong-log-detect-image-type
Wrong log message if use tga image
2016-04-19 11:00:55 +08:00
minggo f3fd111200 Merge pull request #14944 from mxenabled/josh/export_wicimageloader
Export WICImageLoader form DLL
2016-04-18 18:33:39 +08:00
Бесшапошников Никита e555ed5b9e Implement createDirectory for apple platform. 2016-04-18 12:52:20 +03:00
xiaofeng11 061fc2f287 Fix on win32 platform if cpp-tests' windows been minisized, after window restore, content size is wrong. (#15236) 2016-04-18 17:15:56 +08:00
minggo 6cc80f28fc Merge pull request #15096 from fnz/volume_control
Set music volume control as default
2016-04-18 16:48:55 +08:00
xpol 1e70fb5eb5 Remove include of cocos2d.h (#15435) 2016-04-18 15:09:21 +08:00
xpol 3780064a82 Allow inherit form platform fileutils (#15304)
* Allow inherit form FileUtilsLinux, FileUtilsWin32 and FileUtilsWinRT.

* Removed objc from CCFileUtils-apple.h

define FILEUTILS_APPLE_ENABLE_OBJC to enable FileUtilsApple:setBundle() for compatibility.

* Smart pointers heal us all.

* Add config macro in ccConfig.h and prefix with CC_.

* enabled by default.
* use #if rather than #ifndef.

* Do not deprecate setBundle.
2016-04-14 11:59:24 +08:00
minggo d8764ab730 Merge pull request #15200 from perminovVS/v3-dev-wic-image-loader-bad-hresult
WICImageLoader incorrect use S_FALSE constant
2016-04-07 17:31:15 +08:00
minggo 43a70f0a92 Merge pull request #15342 from xpol/allow-easy-decrypt-plist-files
Allow plist and other ValueMap files be (easy) decrypted.
2016-04-07 11:02:20 +08:00
Xpol Wan cd1c26ecd1 Allow plist and other ValueMap files be (easy) decrypted.
The origin implementation of `FileUtilsApple::getValueMapFromFile()` reads the contents of file and parse it by calling one Apple API.
This make it harder to decrypt user encrypted plist files.

This commit use the `FileUtils::getDataFromFile()` to get read file data first then use `getValueMapFromData()`
to parse it into a ValueMap. Where `FileUtils::getDataFromFile()` can be overwrite by user's decoding file utils (say `DecodingFileUtils`).

I know that user's `DecodingFileUtils` can also overwrite `getValueMapFromFile`, but this pr make the author of `DecodingFileUtils` less suffering.
2016-03-29 21:39:16 +08:00
mogemimi 44080a04d8 Fix typos in comments and strings 2016-03-29 10:52:17 +09:00
Dale Stammen ee05081f3a fixed include paths 2016-03-23 12:14:12 -07:00
Xpol Wan a225130010 Fixes windows universal build. 2016-03-22 18:51:58 +08:00
Xpol Wan 71f0537734 Merge commit '43db5c052d3a8605ebfd9dc2acc23e26129c4265' into remove-uncessary-search-paths 2016-03-22 16:07:02 +08:00
Xpol Wan e7864cdb89 Removed unnecessary search paths. 2016-03-22 16:04:12 +08:00
zilongshanren 400e77808c Revert "UIEditBox attachWithIME, detachWithIME make working" 2016-03-22 14:18:39 +08:00