Commit Graph

12216 Commits

Author SHA1 Message Date
Ricardo Quesada cc947737dd Merge pull request #16160 from ricardoquesada/issue_16139
fix: display FPS again on GLFW platforms
2016-07-19 19:19:31 -07:00
minggo 66e29ba82d Merge pull request #16151 from mogemimi/fix-function-spelling
Fix spelling for `getPolygonCenter` function
2016-07-20 09:56:51 +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
mogemimi 5bd2d74078 Fix spelling for `getPolygonCenter` function 2016-07-19 08:24:22 +09:00
mogemimi 60dbbde3eb Fix misspelled enum: POLYGEN -> POLYGON 2016-07-18 19:10:07 +09:00
CocosRobot cbcbeb96b3 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-18 06:20:59 +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
yalab ef21e44d9c Fixed to use cocosstudio LoadingBarReader with TexturePacker. 2016-07-17 16:30:17 +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 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
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 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
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
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
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
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
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
Tyler Kopf 5ecd016a9e fix leak in Data on move assignment 2016-07-11 15:33:51 -07:00
CocosRobot 3aeefd911e [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-11 07:54:54 +00:00
minggo 3d5789ee77 Merge pull request #16077 from mogemimi/fix-documentation-comments
Fix documentation when compile with -Wdocumentation and Clang
2016-07-11 15:49:28 +08:00
minggo 9c7d44ccd7 Merge pull request #16080 from minggo/use-std_abs
use std::abs instead
2016-07-11 12:02:10 +08:00
minggo 2ca1760b78 Merge pull request #16079 from minggo/use-std_srand
use std::srand() instead
2016-07-11 12:01:38 +08:00
minggo 3dc167a9f9 use std::abs instead 2016-07-11 12:01:09 +08:00
minggo a146f3eec7 use std::srand() instead 2016-07-11 11:17:28 +08: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 c267167d07 Merge pull request #16069 from minggo/ndkr12b-issue
fix compiling and linking error with ndk r12b
2016-07-08 17:01:09 +08:00
minggo 4e125d84a4 fix compiling and linking error with ndk r12b 2016-07-08 15:29:35 +08: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
CocosRobot 8fe92fbd4b [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-07 19:04:04 +00:00
Ricardo Quesada 891fe706da Merge pull request #16057 from ricardoquesada/issue_12226
test: add test case for Github issue #12226
2016-07-07 08:34:30 -07:00
minggo 836acff6d0 Merge pull request #16060 from minggo/merge-v312
Merge v312
2016-07-07 18:29:28 +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
Ricardo Quesada 6d5a94e569 test: add test case for Github issue #12226
Adds test case for Github issue #12226
2016-07-06 16:37:15 -07:00
mogemimi 6ce7f3c0e9 Avoid overhead of casting float to double 2016-07-07 01:38:27 +09:00
minggo 8d6acd9ffe Merge pull request #16050 from pandamicro/v3.12
[ci skip]Update JS versions
2016-07-06 17:04:42 +08:00
pandamicro ccb30cefc7 Update JS versions 2016-07-06 17:02:53 +08:00
minggo 6248480b3a Merge pull request #16047 from minggo/issue-14071
[ci skip]convert aplpha channel correctly
2016-07-06 15:59:50 +08:00
minggo d0db838b71 convert aplpha channel correctly 2016-07-06 15:49:05 +08:00
minggo 418907d972 Merge pull request #16044 from pandamicro/v3.12
Improve web template and update web ref
2016-07-06 14:47:23 +08:00
pandamicro 305bd95dc2 More secure release in JSB_closeWindow 2016-07-06 13:55:18 +08:00
CocosRobot cf2646b7a2 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-06 02:16:03 +00:00
mogemimi bed4e048b6 Fix various typos 2016-07-06 08:27:39 +09: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
minggo e4aa6d1ef7 Merge pull request #16035 from minggo/issue-16032
remove extra '\'
2016-07-05 14:22:19 +08:00
minggo 0cc8b9fc09 Merge pull request #16031 from MrCapone/fix_GLView
GLView::setFrameSize fixed
2016-07-05 09:54:59 +08:00
minggo 1c9ad5594c remove extra '\' 2016-07-05 09:50:38 +08:00
minggo f666d99192 Merge pull request #16021 from yalab/cocosstudio_with_texturepacker
Fixed to use TexturePacker with cocosstudio.
2016-07-05 09:35:59 +08:00
mogemimi 2650fd1afd Add missing float suffix to avoid -Wdouble-promotion 2016-07-04 23:12:45 +09:00
mr_capone-win7 0e64c2a071 GLView::setFrameSize fixed 2016-07-04 19:48:24 +07:00
minggo b9d6f0d8d6 Merge pull request #16027 from CocosRobot/update_lua_bindings_1467596228
[ci skip][AUTO]: updating luabinding & jsbinding automatically
2016-07-04 11:00:49 +08:00
minggo ca8ff36f2e Merge pull request #16016 from LeeMyoungYeol/v3
Update utils::getTimeInMilliseconds()
2016-07-04 10:55:41 +08:00
CocosRobot 934b2413dc [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-04 01:40:35 +00:00
minggo 8bbeb01be4 Merge pull request #16025 from mogemimi/fix-doc-typo
Fix typos and other mistakes in docs
2016-07-04 09:33:29 +08:00
minggo b380df97c6 Merge pull request #16022 from mogemimi/fix-format-string
Fix format string warning when compiling with Android NDK
2016-07-04 09:31:45 +08:00
mogemimi 2443e09d29 Fix typos and other mistakes in docs 2016-07-04 00:42:10 +09:00
mogemimi 57900112c5 Fix format string warning when compiling with Android NDK 2016-07-03 17:19:17 +09:00
CocosRobot f30a7cf546 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-03 05:14:11 +00:00
yalab 35968a6fc1 Slidebar can load TextureCache on cocosstudio. 2016-07-02 18:45:20 +09:00
yalab c675675de5 Fixed to use TexturePacker with cocosstudio. 2016-07-02 17:31:32 +09:00
Ricardo Quesada f7d65fbe8a Squashed commit of the following:
commit 3a8ccb54b58f01daaa5b17efcd0e1ab4b7ccf914
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Fri Jul 1 11:05:02 2016 -0700

    Add support for Hex tiled maps

    Based on original patch by https://github.com/JustVic
    Original patch:
    https://github.com/cocos2d/cocos2d-x/pull/13288
    fix: tiled hex maps

    Hexagonal TileMaps Support

    fix: odd, even works as expected

    still problems with rendering order

    fix: fixes layer position in Hex

    fix render ordering
2016-07-01 15:51:00 -07: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
이명열 853e083c68 - The result comes across as negative.(device android) 2016-07-01 15:32:43 +09:00
mogemimi 2354df9faf Fix getSubStringOfUTF8String bug 2016-07-01 15:16:35 +09:00
pandamicro d02bdda781 Fix callfunc released with retained data (callback, target, extradata) issue 2016-07-01 10:56:17 +08:00
CocosRobot 94de257115 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-07-01 02:16:32 +00:00
minggo 043d81be1c Merge pull request #16008 from yalab/cocosstudio_with_texturepacker
cocosstudio can manage TexturePacker Image.
2016-07-01 10:10:09 +08:00
halx99 2610ad77cc #15965: remove unused _orderOfArrival (#16009) 2016-07-01 10:09:25 +08:00
yalab c5648db10a cocosstudio can manage TexturePacker Image. 2016-06-30 18:10:08 +09:00
CocosRobot 274a82c7f5 [ci skip][AUTO]: updating luabinding & jsbinding automatically (#16001) 2016-06-29 22:56:13 +08:00
minggo 47442b9d8b Merge pull request #15997 from mogemimi/fix-variable-names
Fix some minor typos in local variable names
2016-06-29 14:24:00 +08:00
CocosRobot ef01ac4465 [ci skip][AUTO]: updating luabinding & jsbinding automatically 2016-06-29 04:47:21 +00:00
Ricardo Quesada b1f93b2679 fix: not leak Toggle items
Github issue: fixes #13351
2016-06-28 20:41:47 -07:00
mogemimi c0f2194961 Fix some minor typos in local variable names 2016-06-29 11:04:11 +09:00
Drakon-Cocos 7302ad979a Can set scroll to item duration in ListView and derived classes (#15964)
* Can set scroll to item duration in ListView and derived classes (e.g. PageView)

* Parameter no more 'const'. Comments
2016-06-29 09:48:03 +08:00
minggo ecf97575ad Revert "Added CCGLViewImpl.h" 2016-06-29 09:45:05 +08:00
minggo feb513c7eb Merge pull request #15982 from mogemimi/fix-typo
Fix typo: destoryMark -> destroyMark
2016-06-29 09:41:59 +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
mogemimi 2060b333ca Fix typo: destoryMark -> destroyMark 2016-06-29 10:04:31 +09:00
minggo 0c290540df Merge pull request #9823 from ericmux/frame-independent-ms
Making CCMotionStreak _maxPoints framerate independent.
2016-06-28 18:29:14 +08:00
minggo bbd837aefa merge v3.12 back to v3 2016-06-28 17:53:50 +08:00