Commit Graph

12701 Commits

Author SHA1 Message Date
James Chen 2b3087ffc5 Fixes ConsoleUploadFile test could not work on android. (#17607)
* Should not use fread to read file from assets, uses FileUtils::getDataFromFile instead.
* Client socket should not be closed immediatelly after ::send. Otherwise, sever may will receive “Connection reset by peer - Errno 104” error on some platforms. It could be 100% reproduced on Android.
2017-03-29 14:23:33 +08:00
CocosRobot 31c0e27b4b [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17606) 2017-03-29 14:23:15 +08:00
James Chen 1eea499466 fixed #17603: Connection error in Console uploadFile test. (#17604)
* fixed #17603: Connection error in Console uploadFile test.

* tab -> spaces

* tab -> spaces

* tab -> spaces
2017-03-29 09:17:37 +08:00
pandamicro d25cd8ddf4 [ci skip] Fix QA issues (#17596)
* Fix RenderTexture#clear API inconsistency

* Improve js-tests desktop page

* Fix issues in js test cases
2017-03-27 18:03:20 +08:00
James Chen 6217d8c5ca fixed #17591: [ios, mac, win32] Audio could not be played in the callback of AudioEngine::setFinishedCallback (#17593)
* Moves the implementation of AudioEngine::AudioInfo to cpp file.

* fixed #17591: [ios, mac, win32] Audio could not be played in the callback of AudioEngine::setFinishedCallback

* fixed #17591: Adds test case.
2017-03-27 17:28:39 +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
James Chen ab9104f3ce Updates templates for switching AudioEngine in AppDelegate.cpp. (#17555) 2017-03-22 11:19:25 +08:00
CocosRobot 95921836ca [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17549) 2017-03-20 09:39:41 +08:00
minggo b5a1360a17 revert #17437 (#17545)
* revert #17437

* fix resource path
2017-03-20 09:28:12 +08:00
minggo 8f66d5465a [ci skip]Update version (#17525)
* update version

* update readme

* update english release note

* add some information
2017-03-16 14:14:43 +08:00
pandamicro 0e0987d337 Support notify progression in XMLHTTPRequest (#17509)
* Support notify progression in XMLHTTPRequest

* Fix indent

* Fix issues

* fix issue
2017-03-16 14:09:51 +08:00
rh101 27935acd64 VS and XCode project files have non-existent file references (#17512)
* [libcocos2d.vcxproj, libcocos2d.vcxproj.filters] Removed entries for non-existent files that were causing "Build is out of date" issues in Visual Studio
[project.pbxproj] Removed entries for non-existent file

* [libcocos2d.vcxproj.filters] Renamed CCStencilStateManager.h extension to .hpp.

* [libcocos2d.vcxproj, libcocos2d.vcxproj.filters] Removed entry for file CCDownloaderImpl.h which does not exist.

* Changed extension of CCStencilStateManager.hpp to .h
2017-03-16 13:54:50 +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
James Chen 1f8eb3b7f5 fixed #17494: Adds setTimeout to wrap NSTimer since ‘timerWithTimeInterval:repeats:block’ is only available from iOS 10, macOS 10.12. (#17518)
* fixed #17494: Adds setTimeout to wrap NSTimer since ‘timerWithTimeInterval:repeats:block’ is only available from iOS 10, macOS 10.12.

* Sets _timeoutCallback to nullptr if onTimeoutCallback is called.
2017-03-16 11:04:36 +08:00
pyrosphere e3bff6452d Support for the tvOS micro gamepad as a CCController (#17517)
* Fixes cocos2d build for tvOS.

* Support for the tvOS micro gamepad as a CCController.
2017-03-16 10:33:36 +08:00
pandamicro 75383bdcde Jsb improvements (#17513)
* Cleanup ScriptingCore code

* Add jsb.ENABLE_GC_FOR_NATIVE_OBJECTS to indicate the memory model

* Use incremental GC

* Improve ScriptingCore::executeFunctionWithOwner performance

* Support ScriptingCore::executeGlobalFunction

* Reuse js objects for get_or_create_weak_jsobject reduce memory usage

* Fix sequence / spawn js object lost issue

* Improve wrappers with cppOwner system
2017-03-16 09:42:16 +08:00
James Chen 8c542d711d issue #17503: Avoid crash if initializing audio fails. (#17505)
* issue #17503: Avoid crash if initializing audio fails.

* Corrects logic of checking the return value of decodeMP3.
2017-03-15 16:46:19 +08:00
CocosRobot 87b4d7d54d [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17507) 2017-03-15 16:23:50 +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
James Chen 16e1bf47ac fixed #17494: [iOS] CrashIfClientProvidedBogusAudioBufferList (#17500) 2017-03-15 13:50:56 +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
James Chen b842202541 fixed #17395: OpenAL A003 error if doing AL invocation before alcMakeContextCurrent(s_ALContext); (#17492)
Pause director if Audio Session is still in interrupted state, resume director in interrupted ended.
2017-03-14 13:56:12 +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 1dccd7b85b fixed #17395: AudioEngine alSourcePlay error code:a003 in lua-tests. (#17485) 2017-03-13 11:37:23 +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 5c0c6d2e1e More powerful Uri class, adds unit test for Uri class. Refactors some code in SocketIO & Websocket. (#17472)
* More powerful Uri class, adds unit test for Uri class. Refactores some code in SocketIO & Websocket.

* Adds missing header file stdint.h

* Exports Uri class

* Uri belongs to network group

* Updates the location of group comment

* Removes an unused include.

* Updates Uri comment.
2017-03-09 10:14:39 +08:00
mogemimi 98d2236914 Prevent signed/unsigned mismatch (#17468) 2017-03-08 14:32:23 +08:00
minggo 9335986c73 fix the issue that onEnterTransitionDidFinish() is not invoked at first scene change (#17466)
refer to https://github.com/cocos2d/cocos2d-x/issues/17442 for detail information
2017-03-08 14:26:58 +08:00
Owen.Cai 7aa74fa994 csbload error bug (#17465)
* csbload error bug

* csbload error bug

* csbload error bug
2017-03-08 10:14:38 +08:00
Alanmars 0cde5c6fc1 *Fix: GLThread and other threads access sDownloaderMap in a thread-unsafe way, which will result in crash in some occasion on Android. (#16326) 2017-03-07 17:00:52 +08:00
James Chen 1c0e56efef fixed #17416: Wrong default port of SocketIO connection. (#17459)
Supports SSL connection for SocketIO.
Avoid memory corruption while disconnecting SocketIO, _ws->close() has to be at the end of ‘SIOClientImpl::disconnect()’.
2017-03-07 15:49:38 +08:00
James Chen fc0ad058a5 fixed #17427: lws_parse_url has wrong behavior, it parses ’ws://domain.com/abc/d’ to ‘path: abc/d’ rather than ‘path: /adb/d’. (#17455)
* fixed #17427: lws_parse_url have wrong behavior, it parses ’ws://domain.com/abc/d’ to ‘path: abc/d’ rather than ‘path: /adb/d’.
Adds Uri class and parses Url to scheme, host, port, path in engine side.

* Moves Uri implementation to Uri.cpp, adds getter functions.

* Updates win32 project.

* Updates win10 project.

* Adds include header for atoi error on android.

* Updates tizen project configuration.
2017-03-07 13:35:59 +08:00
CocosRobot fb730b5395 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17456) 2017-03-07 11:29:17 +08:00
j-jorge 67d16bee98 Prevent unexpected calls to unscheduled selector in long updates. (#17431)
If the delta time dt passed to cocos2d::Timer::update(float) is longer than the
interval of the timer, then the timer will be triggered several times even if
the selector is unscheduled during the call.

This commit adds a flag in cocos2d::Timer stop the update loop if the selector
has been unscheduled.
2017-03-07 11:16:30 +08:00
CocosRobot e08cbc1c39 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17453) 2017-03-07 09:45:23 +08:00
Bin Zhang b7f8dacd7c Solve the error logic in spine runtime. (#17448)
Sync the runtime to the state of this commit (both js & cpp runtime):
3ced1e1daf
2017-03-07 09:36:42 +08:00
j-jorge 6cd7314497 cocos2d::Sequence::isDone() checks that the last action is actually done. (#17437) 2017-03-07 09:36:09 +08:00
James Chen ce2f4e892f Websocket bug fix after PR#17440 was merged. (#17450)
* Websocket bug fix after PR#17440 was merged.

* typo fix
2017-03-07 09:35:14 +08:00
CocosRobot b32c84f8c2 [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17449) 2017-03-06 18:28:58 +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
Tiffanyx 69d92bbe49 fixed #17433: [webSocket ] webSocket random crash in win32 (#17440) 2017-03-06 14:18:58 +08:00
Dale Stammen 13a438dbfd win10 uwp fix for new Mouse events (#17434) 2017-03-03 12:40:32 +08:00
CocosRobot 7dbfc85a8f [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (#17430) 2017-03-02 16:08:53 +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
James Chen eca39ba7aa fixed #17413: [Android] AudioEngine::play2d may still wait 2 seconds if preload is too fast. (#17414) 2017-02-27 15:11:39 +08:00
James Chen c86d7b0d2f fixed #17397: Updates CMakeList.txt for win32 audio module (#17401) 2017-02-23 16:13:26 +08:00
James Chen 619e012d9b [WebSocket] Adds support for getting url and server selected protocol (#17381)
* [WebSocket] Adds support for getting url and server selected protocol

* Adds const keyword for getter methods, and make LOGE also works in release mode.
2017-02-20 09:44:20 +08:00