Commit Graph

35340 Commits

Author SHA1 Message Date
James Chen ddb25ca563 Uses std::chrono::steay_clock for calculating dt. 2016-07-20 12:43:40 +08:00
minggo b5de8ba0ea Merge pull request #16145 from CocosRobot/update_cocosfiles_1468822622
[AUTO][ci skip]: updating cocos2dx_files.json
2016-07-18 15:01:10 +08:00
minggo 9943c8316f Merge pull request #16146 from CocosRobot/update_lua_bindings_1468822691
[ci skip][AUTO]: updating luabinding & jsbinding automatically
2016-07-18 15:00:50 +08:00
CocosRobot cbcbeb96b3 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-18 06:20:59 +00:00
CocosRobot 9c35dedb75 [AUTO][ci skip]: updating cocos2dx_files.json 2016-07-18 06:17:04 +00:00
minggo 04ebd952a0 Merge pull request #16137 from yalab/cocosstudio_with_texturepacker
Fixed to use cocosstudio LoadingBarReader with TexturePacker.
2016-07-18 14:14:49 +08: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 06dcb2f183 Merge pull request #16133 from mogemimi/fix-documentation-typos
Fix typos in documentation comments
2016-07-18 10:18:44 +08:00
minggo 1f5d162d70 Merge pull request #16136 from mogemimi/fix-doxygen-config
Fix minor typo in Doxygen configs
2016-07-18 10:17:50 +08:00
yalab ef21e44d9c Fixed to use cocosstudio LoadingBarReader with TexturePacker. 2016-07-17 16:30:17 +09:00
mogemimi b8e483bdd1 Fix minor typo in Doxygen configs 2016-07-17 05:07:59 +09:00
mogemimi d931c62649 Fix typos in documentation comments 2016-07-16 04:18:40 +09: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
minggo 38b3ab6853 Merge pull request #16114 from mogemimi/use-fstat-instead
Use fstat instead of fseek and ftell for performance and portability
2016-07-15 15:39:22 +08:00
Ricardo Quesada 9166c28e75 Merge pull request #16101 from mtak-/glprogram_buffer_overflow_fix
fix buffer over-read in CCGLProgram.cpp in memcmp call (Address Sanitizer...
2016-07-14 17:12:17 -07:00
Ricardo Quesada f8841beeee Merge pull request #16119 from moljac024/v3
Fix browserVersion detection
2016-07-14 16:58:33 -07:00
Ricardo Quesada 2998ed23f8 Merge pull request #16121 from ricardoquesada/issue_16105_squashed
Fixes issue #16105
2016-07-14 12:59:40 -07:00
Ricardo Quesada 1563d14447 Squashed commit of the following:
commit c8349caeca6ff5ebacf497eaa986e71d5f1c2c0d
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Thu Jul 14 11:19:50 2016 -0700

    fix: works with odd sized maps

commit da4cf8bc19c9cdab148d60e03a25ee9cc4292b66
Author: zhangbin <zhangbin@cocos2d-x.org>
Date:   Wed Jul 13 13:45:57 2016 +0800

    Add test case.
2016-07-14 11:21:24 -07:00
minggo 774108bbc3 Merge pull request #16120 from minggo/update-webengine
[ci skip]update web engine to v3.12
2016-07-14 16:00:43 +08:00
minggo 1bb1e9b792 update web engine to v3.12 2016-07-14 16:00:37 +08:00
Bojan Matić 727138b800 Fix browserVersion detection
Due to typo, the code meant for browser versions below 6.2 would
never run.
2016-07-14 08:24:12 +02:00
halx99 9e80526251 #Use std::string reference instead of char* for utils::findChild (#16117)
* #Optimize, Use std::string reference instead of char* for utils::findChild

* Check Node::INVALID_TAG

* revert submodules
2016-07-14 13:52:30 +08:00
minggo 125b0601c3 Merge pull request #16091 from mtak-/data_clear_on_move
fix leak in Data on move assignment
2016-07-14 11:40:19 +08:00
mogemimi 8b05476d45 Use fstat instead of fseek and ftell for performance and portability 2016-07-14 01:18:44 +09:00
minggo 9b081f388a Merge pull request #16093 from zilongshanren/improve-android-build-scripts
make -n args works
2016-07-13 16:34:06 +08:00
minggo 261f1ef780 Merge pull request #16094 from stevetranby/patch-1
Match parent's camera mask when adding child.
2016-07-13 16:33:17 +08:00
minggo c5c846f6e1 Merge pull request #16107 from cezheng/fix/EaseExponentialOut_clone_crash
fix crash in EaseExponentialOut::clone()
2016-07-13 16:32:48 +08:00
minggo bed7458de8 Merge pull request #16108 from mogemimi/add-missing-override
Add missing override keyword
2016-07-13 16:32:23 +08:00
minggo 71d02538f6 Merge pull request #16106 from CocosRobot/update_cocosfiles_1468384735
[AUTO][ci skip]: updating cocos2dx_files.json
2016-07-13 14:11:16 +08:00
mogemimi 98cc48bc62 Add missing override keyword 2016-07-13 15:03:53 +09:00
Ce Zheng cf18857206 fix crash in EaseExponentialOut::clone() 2016-07-13 14:28:04 +09:00
CocosRobot eea229c101 [AUTO][ci skip]: updating cocos2dx_files.json 2016-07-13 04:38:56 +00:00
Ricardo Quesada 1824b21cb7 Merge pull request #16090 from ricardoquesada/issue_15566
fixes issue #15566
2016-07-12 21:36:52 -07:00
minggo 8561e5f868 Merge pull request #16089 from mogemimi/avoid-double-promotion
Use std::abs to avoid overhead of casting float to double
2016-07-13 12:01:20 +08: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
minggo 147fe4336c Merge pull request #16104 from natural-law/v3
Solve the error in command gen-templates & gen-simulator.
2016-07-13 09:45:29 +08:00
zhangbin f4accbdf3e Solve the error in command gen-templates & gen-simulator. 2016-07-13 09:42:05 +08:00
minggo a9862f26fa Merge pull request #16096 from coderwj/v3
Fix a bug, in lua can't get the "backClicked" but a nil
2016-07-13 09:34:17 +08:00
minggo 434448a445 Merge pull request #16099 from mogemimi/bump-simulator-version
Bump simulator version number to 3.12
2016-07-13 09:32:53 +08:00
Tyler Kopf 15c6788783 fix buffer overflow in CCGLProgram.cpp in memcmp call (Address Sanitizer spots it easily)
- previously the flow went memcmp, if that != 0, do a bounds check, etc
- now do a bounds check, if destSize >= srcSize, do memcmp, etc
2016-07-12 11:10:16 -07:00
mogemimi b9c78ac41c Use std::abs to avoid overhead of casting float to double 2016-07-13 00:55:11 +09:00
mogemimi 905bd36e32 Bump simulator version number to 3.12 2016-07-13 00:41:27 +09:00
coderwj c9ad76e56a Fix a bug, in lua can't get the "backClicked" but a nil
in lua, I registerScriptKeypadHandler,when debug on Andriod, after clicking back button, I didn't get "backClicked",but a nil 
I see that in CHANGELOG:
cocos2d-x-3.1  May.24 2014
    [FIX]           EventKeyboard::KeyCode: key code for back button changed from KEY_BACKSPACE to KEY_ESCAPE
so,I fix it , and get the right "backClicked"
2016-07-12 17:37:33 +08:00
zhangbin 4408f28480 Solve the error in simulator project.
Remove unused files.
2016-07-12 17:33:43 +08:00
halx99 c0e0931838 fix, replace std::sort by std::stable_sort (#16092)
* fix, replace std::sort by std::stable_sort
2016-07-12 13:46:38 +08:00
Steve Tranby f162ffe2ae Match parent's camera mask when adding child. 2016-07-12 00:07:41 -05:00
minggo 9f09349fa9 Merge pull request #16084 from CocosRobot/update_lua_bindings_1468223553
[ci skip][AUTO]: updating luabinding & jsbinding automatically
2016-07-12 11:28:52 +08:00
zilongshanren 67fde8e91b make -n args works 2016-07-12 10:29:04 +08:00