* Changing CCAsyncTaskPool and CCScheduler to better leverage move semantics, to avoid several lambda copy constructor calls. Chaning call sites in the cocos engine to better leverage move semantics.
* Editing binding generator to not generate bindings for AsyncTaskPool::enqueue. Bindings were not previously generated for this function due to it's type signature involving a template parameter.
* Adding missing std::move call in AsyncTaskPool to skip a copy constructor call.
* fix reschedule issue
* correct code formatting
* Fix isScheduled
* improve a bit performance of executing functions in cocos thread
* added test to verify reschedule issue
* re-init timer in schedule if timer exists and alive
* Added function for calculating md5 hash from Data.
getFileMD5Hash now use getDataMD5Hash.
For example, AssetsManagerEx VerifyCallback.
Get Data from file, check equal size, if equal to get md5 hash.
* Data::isNull check size equal 0
* Build on linux and android.
* 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.
* 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.
* [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
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.
* 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
* 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.
* 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
* Fixing issue where Scheduler::unscheduleAll() would not unschedule functions scheduled with Scheduler::performFunctionInCocosThread.
* Removing clear of _functionsToPerform from unscheduleAll, based on code review feedback. Adding a function removeAllFunctionsToBePerfomedInCocosThread, which will remove all pending functions scheduled with performFunctionOnCocosThread.
* Adding test case for Scheduler::removeAllFunctionsToBePerformedInCocosThread
* Adding proper cleanup code to Scheduler test for SchedulerRemoveAllFunctionsToBePerformedInCocosThread
* initialize Director::_invalid on first init
* fix: Setting the GLView should be done after creating the RootViewController
* restore 2016 copyright on templates/cpp-template-default/proj.ios_mac/ios/AppController
* remove old iOS js and lua templates
* copy actual iOS templates from cpp to js and lua
* 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
* 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.
* Support MultiView matrix array
Support MultiView matrix array and add new interface in GLProgram to
support shader header definitions.
* support getMatrixStackSize
* optimize code
* remove indents
* rename resetMatrixStack(unsigned int stackCount)
* Add document to interfaces
* Supplement document of render interface
* 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
* 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
Adds Director::isValid()
removes DisplayLinkDirector()
removes virtual functions from Director()
Director is no longer an abstract class
github issue #14276
* fix the return value when return null in java
fix the return value when return null in java
* fix getStringUTFCharsJNI
fix getStringUTFCharsJNI when srcjStr is null
* remove a word
remove a word added by mistake
* make a indention
line 233 utf8Str
* #improve node sort performance by std::sort + unsigned long long (_localZOrder)
* Use bit field for make _localZOrder storage more clearly.
* #Comment _localZOrder members for meaningful.
* fix issues
* #use explicit bits integer of localZOrder storage
* #Fix compile error, add include <cstdint> to CCNode.h
* use the optimization for 64bit and no optimization solution for 32bit
* Use the optimization for 64bit and no optimization solution for 32bit
* #Improve node sort performance 64-bit by std::sort + long long (_localZOrder)
* fix issues
* test case
* Revert "test case"
This reverts commit 85471d07a433f2b7f0265c3b7dd483fcc28e3e2f.
* fix issues
* use lambda, and any other sort issues.
* skip sotNodes
* fix compile error
* fix compile issue
* 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.
use reverse Camera iterator when traversing events (of course).
but somehow setAdditionalTransform() breaks
setNodeToParentTransform(). And since setAdditionalTransform is not
needed, we just don't use it.
Github issue #15909
use reverse Camera iterator when traversing events (of course).
but somehow `setAdditionalTransform()` breaks
`setNodeToParentTransform()`. And since `setAdditionalTransform` is not
needed, we just don't use it.
Github issue #15909
1) Reverts changes in #15443, the behavor of LuaEngine::handleCommonEvent should not be changed. empty eventName should be supported, otherwise it will break compatiblity.
2) Null pointer check in CommonScriptData initialization
3) No error callback in lua (fixed#15904)
* 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
- 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).
* Add captureNode for cocos2d::utils
Add captureNode for cocos2d::utils and fix CC_DLL syntax.
* Add test case for utils::captureNode
Add test case for utils::captureNode.
* Store captured image to disk with RGB.
* Trigger jenkins check
* Add searchNode for cocos2d::utils
Add searchNode for cocos2d::utils
* fix compile error on win32_bak
* convert line terminates to unix sytle.
* Rename searchNode to findChild, and etc.
* fix compile error.
* 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.
* Remove unnecessary memory copy in FileUtils::getFileData()
* Add Data::takeBuffer() to simplify FileUtils::getFileData() and CCFreeTypeFont::loadFont().
* 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.
The order of integer arithmetic is important, the original code fail to
calculate the length correctly, e.g. inLength 20 for base64Encode should
output 28, not 30. It is fixed and simplified with this commit.