2011-09-19 14:47:17 +08:00
|
|
|
1. Generating the lua<-->C bindings with tolua++
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-03-09 02:45:35 +08:00
|
|
|
Build scripts for windows (build.bat) and unix (build.sh) are provided
|
|
|
|
to generate the relevant files after modifying the .pkg files. These
|
|
|
|
scripts basically run the following command:
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-03-09 02:45:35 +08:00
|
|
|
tolua++.exe -L basic.lua -o LuaCocos2d.cpp Cocos2d.pkg
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-03-09 02:45:35 +08:00
|
|
|
This will generate the bindings file and patch it with come cocos2dx
|
|
|
|
specific modifications.
|
|
|
|
|
|
|
|
On POSIX systems you can also just run "make" to build the bindings
|
|
|
|
if/when you change .pkg files.
|
2011-06-24 21:03:33 +08:00
|
|
|
|
2011-09-19 14:47:17 +08:00
|
|
|
2. Writing .pkg files
|
2011-06-24 21:03:33 +08:00
|
|
|
|
2011-09-19 14:47:17 +08:00
|
|
|
1) enum keeps the same
|
|
|
|
2) remove CC_DLL for the class defines, pay attention to multi inherites
|
|
|
|
3) remove inline keyword for declaration and implementation
|
|
|
|
4) remove public protect and private
|
|
|
|
5) remove the decalration of class member variable
|
|
|
|
6) keep static keyword
|
2013-03-09 02:45:35 +08:00
|
|
|
7) remove memeber functions that declared as private or protected
|