Commit Graph

160 Commits

Author SHA1 Message Date
halx99 16e3d66a66 Update lua bindings 2021-08-14 13:22:03 +08:00
halx99 7ee1785858 Improve Lua RTTI performance [ci build] 2021-06-18 12:23:10 +08:00
halx99 b6378332eb Fix for luabinding generator [ci build] 2021-06-18 11:31:07 +08:00
halx99 877de444e4 tolua mutli search paths support 2020-11-02 16:37:18 +08:00
halx99 c563bc295f Sync folder for binding generator config 2020-11-01 20:18:50 +08:00
halx99 919d48d68e Finish cpp and lua template to use env var 'COCOS2DX_ROOT' to avoid copy whole engine source when new project. 2020-10-19 18:33:10 +08:00
minggo 6b1e55f419
Remove experimental namespace (#20229) 2019-10-23 14:58:31 +08:00
Arnold 888cd9b159 fix lua (#19888) 2019-07-02 09:29:20 +08:00
coulsonwang 22e8a651d2 Feature/lua render texture test (#19827)
* fix render texture test in lua

* remove unnecessary code

* fix CI compile error
2019-06-18 22:45:14 -07:00
Arnold 401ce1ee1c
run genbinding 2019-05-06 09:43:40 +08:00
Arnold 98d5f37a30 fix lua-tests errors (#19646)
* enable test case

* save

* generate enum classes

* save

* autobindg backend interface

* safe

* fix typos

* fix setUniform

* enable draw primitives and fast tmx tiled map

* save all

* update

* fix compile error on mac

* fix locations

* fix locations

* deduce vertexlayout

* clean

* compile on mac

* fix resource path

* save

* update bindings-generator

* remove unused code

* rename ccbackend to ccb

* remove todo
2019-05-05 00:26:34 -07:00
minggo e63c4d1ba6
make lua binding work (#19474) 2019-03-07 18:29:06 +08:00
James Chen 907b6fda75 Uses NDK r16 to generate js/lua binding code (#18536) 2017-12-07 13:34:12 +08:00
James Chen d21af3b981 Some fixes after using ndk r16 clang to build android projects (#18531)
* [android] Fixes warning in UrlAudioPlayer.cpp and CCUserDefault-android.cpp

* Don't write 'using namespace std;' in header files.

* Uses std::unordered_map instead of std::map for Particle3D module.

* Updates external/config.json to v3-deps-141

* Continue to replace `gnustl_static` to `c++_static` for templates and test projects.

* Updates CCConsole.h/.cpp to resolve the following issue on Android:

jni/../../../../../cocos/base/CCConsole.cpp:321:28:   required from here
/Users/james/Software/android/android-sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/utility:506:63: error: incomplete type 'std::__ndk1::is_move_assignable<cocos2d::Console::Command>' used in nested name specifier
                         is_move_assignable<first_type>::value &&
                                                               ^
make: *** [obj/local/arm64-v8a/objs-debug/cocos2dx_internal_static/base/CCConsole.o] Error 1

* Fixes a memory leak while addCommand and other minor changes.

* Updates tolua/cocos2dx.ini, don't bind Console::Command

* Adds CC_DLL for Console::Command

* Reverts tolua/cocos2dx.ini and ignore Console::[add Command addSubCommand getSubCommand delSubCommand].

* Ignores Console::getCommand.
2017-12-05 13:35:16 +08:00
xbpiao 4e92bcad19 [tolua]Lua bindings-generator support android-ndk-r9d android-ndk-r10d android-ndk-r10e (win32 support android-ndk-r9d android-ndk-r10d android-ndk-r10e android-ndk-r11c android-ndk-r13b android-ndk-r14b) (#17820)
* [tolua]Lua bindings-generator support android-ndk-r9d android-ndk-r10d android-ndk-r10e
(win32 support  android-ndk-r9d android-ndk-r10d android-ndk-r10e android-ndk-r11c android-ndk-r13b android-ndk-r14b)

* [tojs]Javascript bindings-generator support android-ndk-r9d android-ndk-r10d android-ndk-r10e (win32 support android-ndk-r9d android-ndk-r10d android-ndk-r10e android-ndk-r11c android-ndk-r13b android-ndk-r14b)
2017-05-17 17:10:27 +08:00
David DeSimone ca0a7f313e Changing AsyncTaskPool/Scheduler to better leverage move semantics (#17727)
* 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.
2017-05-08 13:39:17 +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
halx99 a2adfaf7df #Improve node sort performance for 64-bit by std::sort + long long (_localZOrder) (#16262)
* #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
2016-07-31 22:44:24 +08:00
MagicXrEv 8e6ca57f4f lua binding : Rename end() to endToLua(). 2016-06-14 23:35:17 +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
yangxiao 1b3cb97b71 fix script binding 2015-12-01 23:05:47 +08:00
Joachim Grill 9a0ea79b61 remove set/get/hasPolygonInfo methods from js / lua api; fixed C++11 issue 2015-09-30 15:20:53 +02:00
pandamicro 7b85211cfe Remove ScriptComponent
Because windows platform can't successfully compile in previous architecture
2015-09-27 22:18:59 +08:00
pandamicro 2a3526a3fd Fix lua project 2015-09-26 19:43:36 +08:00
pandamicro ddb636a022 Add ScriptComponent and ComponentJS 2015-09-26 19:43:36 +08:00
pandamicro 7e2b8c71a7 Improve lua script component 2015-09-26 19:43:35 +08:00
minggo 26632ec69a linjia demo finish 2015-09-26 19:43:35 +08:00
WenhaiLin a3f363735e Refine lua/js binding tool 2015-09-19 00:08:15 +08:00
WenhaiLin a17a702cd1 Refine components to improve performance 2015-09-18 14:34:02 +08:00
Ricardo Quesada d2e8cf53be don't generate bindings for `getCocos2dThreadId` 2015-08-13 11:18:51 -07:00
pandamicro 3c2e66e425 Merge branch 'v3.7.1' of https://github.com/cocos2d/cocos2d-x into v3
# Conflicts:
#	.travis.yml
#	build/cocos2d_js_tests.xcodeproj/project.pbxproj
#	build/cocos2d_tests.xcodeproj/project.pbxproj
#	cocos/2d/CCFont.h
#	cocos/2d/CCFontAtlas.cpp
#	cocos/2d/CCFontAtlas.h
#	cocos/2d/CCFontFreeType.cpp
#	cocos/2d/CCFontFreeType.h
#	cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.Windows/libcocos2d_8_1.Windows.vcxproj
#	cocos/2d/libcocos2d_8_1/libcocos2d_8_1/libcocos2d_8_1.WindowsPhone/libcocos2d_8_1.WindowsPhone.vcxproj
#	cocos/2d/libcocos2d_win10/libcocos2d.vcxproj
#	cocos/cocos2d.cpp
#	cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp
#	cocos/scripting/js-bindings/auto/jsb_cocos2dx_studio_auto.cpp
#	templates/cpp-template-default/proj.ios_mac/HelloCpp.xcodeproj/project.pbxproj
#	templates/js-template-default/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj
#	templates/js-template-runtime/frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj
#	templates/lua-template-default/frameworks/runtime-src/proj.ios_mac/HelloLua.xcodeproj/project.pbxproj
#	tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp
#	tests/cpp-tests/Classes/LabelTest/LabelTestNew.h
#	tools/bindings-generator
#	tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj/project.pbxproj
#	tools/travis-scripts/generate-bindings.sh
#	tools/travis-scripts/generate-cocosfiles.sh
#	tools/travis-scripts/travis_mac.yml
2015-08-02 22:28:27 +08:00
dualface 4c7e4c654a update cocos2dx.ini for luabinding 2015-07-26 17:16:50 +08:00
pandamicro 15bb633adb Revert "add lua-binding of EventDispacher::dispatchCustomEvent()" 2015-07-12 20:19:52 +08:00
pandamicro 0d9da2f500 Merge pull request #12773 from minggo/bind-missing-function
add lua-binding of EventDispacher::dispatchCustomEvent()
2015-07-11 17:17:32 +08:00
minggo 3911e1d696 add lua-binding of EventDispacher::dispatchCustomEvent() 2015-07-10 10:29:21 +08:00
jianglong0156 13d00d129d fix the jsb and lua ini error, ignore writeDataToFile 2015-07-07 14:54:31 +08:00
samuele3hu ef1bccd926 Fix the error skip function error for Sprite. 2015-06-18 12:03:30 +08:00
WuHao 27d0f51e9b Merge branch 'v3' of https://github.com/cocos2d/cocos2d-x into fix_spritepolygon
Conflicts:
	build/cocos2d_libs.xcodeproj/project.pbxproj
	build/cocos2d_tests.xcodeproj/project.pbxproj
	cocos/2d/libcocos2d.vcxproj.filters
	tools/cocos2d-console
	web
2015-06-15 16:13:36 +08:00
samuele3hu 1b20e463d8 Update the Lua binding about the Polygon and update the test case. 2015-06-11 14:38:38 +08:00
yangxiao c782d63bef add 3d navigation 2015-05-29 16:45:33 +08:00
samuele3hu 9934d73548 issue #12046: Add Lua bindings for material systems and related test cases. 2015-05-27 15:37:59 +08:00
samuele3hu f4b57511b0 Update cocos2dx_3d.ini and cocos2dx.ini for generating Lua bindings code to support CC_CONSTRUCTOR_ACCESS equal to public 2015-04-30 17:18:12 +08:00
samuele3hu 5819159889 Add Lua-bindings for SpritePolygon and related test case 2015-04-28 18:19:57 +08:00
samuele3hu 79c0258449 Remove useless configure for bindings-generator of Lua 2015-03-30 15:48:47 +08:00
samuele3hu 80c2e0c153 Add AsyncLoadSprite3D test case and update the related lua binding 2015-01-28 21:47:52 +08:00
samuele3hu 1d94ae4302 issue #9820:Inconsistent :setBlendFunc(...) function binding for Sprite and LabelBMFont classes 2015-01-14 13:51:09 +08:00
samuele3hu 58d946b578 issue #9796: Extract related physical auto-binding codes to manual-binding to add `CC_USE_PHYSICS` limit 2015-01-05 17:10:25 +08:00
yangxiao de7b70f63e skip Node::set/getRotationQuat 2014-12-25 14:55:43 +08:00
samuele3hu 222f2cbd51 Decrease the package size of lua_empty_test 2014-11-26 21:54:18 +08:00
samuele3hu a62fa8de58 Skip binding nodeWithFlatBuffers of CSLoader for lua 2014-11-24 23:36:44 +08:00