cocos:C++ 导出到lua, cocos2dx_extension.ini修改

[zq] //zq section, 需要和genbindings.py中的配置相同
# the prefix to be added to the generated functions. You might or might not use this in your own
# templates
//前缀,生成的函数lua_zq_ZQPlistManage_getDictFromFile类似于这样,都有zq
prefix = zq # create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)
# all classes will be embedded in that namespace
//namespace, 类似于cc,在lua中都是zq.ZQPlistManage这样
target_namespace = zq // android_headers 头文件配置,保持不变就行了,androidndkdir
// 我们在genbindings.py中config.set('DEFAULT', 'androidndkdir', ndk_root)
// 保存到userconf.ini中
android_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.8/include
android_flags = -D_SIZE_T_DEFINED_ // clang 的clang_headers头文件 和 clang_flags参数
clang_headers = -I%(clangllvmdir)s/lib/clang/%(clang_version)s/include
clang_flags = -nostdinc -x c++ -std=c++11 -U __SSE__ // cocos_headers 头文件目录 和 cocos_flags 参数,
// 同样这里cocosdir的也genbindings.py中保存的
cocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/platform/android -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s/external -I%(cocosdir)s/external/lua/luajit/include -I%(cocosdir)s/external/lua/tolua
cocos_flags = -DANDROID cxxgenerator_headers = // 我们的工程头文件目录
zq_headers = -I%(zqdir)s/libzq -I%(zqdir)s/libzq/libs # extra arguments for clang ,因为tolua是用clang生成的,所以需要配置这些参数
// 给clang
extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(zq_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse
// 需要导出到lua的类的头文件,这里放到了一个头文件中,这个头文件中包含了所有需要导出的
// 类的头文件,当然也可以每个头文件单独写,空格分开
headers = %(zqdir)s/libzq/ZQLibExt.h
// cocos2dx_extension.ini 中的配置
// # what headers to parse
// headers = %(cocosdir)s/extensions/cocos-ext.h
// #include "ExtensionMacros.h"
// #include "GUI/CCControlExtension/CCControlExtensions.h"
// #include "GUI/CCScrollView/CCScrollView.h"
// #include "GUI/CCScrollView/CCTableView.h" # what classes to produce code for. You can use regular expressions here. When testing the regular
# expression, it will be enclosed in "^$", like this: "^Menu*$".
// 导出到lua的C++类,只写需要导出的
classes = ZQLogger ZQFileManage ZQJsonManage ZQPlistManage ZQImageManage DateUtils ZQCustomAction # what should we skip? in the format ClassName::[function function]
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
# regular expressions, they will not be surrounded by "^$". If you want to skip a whole class, just
# add a single "*" as functions. See bellow for several examples. A special class name is "*", which
# will apply to all class names. This is a convenience wildcard to be able to skip similar named
# functions from all classes. //需要跳过的函数,也就是不需要导出到lua中的函数
skip = ZQFileManage::[getDataFromFile],
DateUtils::[date time],
ZQCustomAction::[registerScriptListener unregisterScriptListener] rename_functions = rename_classes = # for all class names, should we remove something when registering in the target VM?
remove_prefix = # classes for which there will be no "parent" lookup
classes_have_no_parents = # base classes which will be skipped when their sub-classes found them.
base_classes_to_skip = ZQLogger # classes that create no constructor
# Set is special and we will use a hand-written constructor
abstract_classes = # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.
script_control_cpp = no

cocos:C++ 导出到lua, cocos2dx_extension.ini修改的更多相关文章

  1. cocos:C++ 导出到lua, genbindings.py修改

    cocos:C++ 导出到lua, genbindings.py修改 1. 准备 把tools目录下的cocos2dx_extension.ini, genbindings.py, userconf. ...

  2. c++对象导出到lua

    转自:http://www.cnblogs.com/ringofthec/archive/2010/10/26/luabindobj.html 虽然有tolua++, luabind等等, 不过自己手 ...

  3. hiredis异步接口封装并导出到Lua

    hiredis异步接口封装并导出到Lua(金庆的专栏 2017.1)hiredis 不支持 Windows, Windows 下使用 wasppdotorg / hiredis-for-windows ...

  4. eclipse.ini 修改默认编码为 UTF-8

    eclipse.ini 修改默认编码为 UTF-8 打开您的eclipse安装目录,找到eclipse.ini文件 打开eclipse.ini文件,在最下面加入一行代码:-Dfile.encoding ...

  5. cocos2d-x中CCEditbox导出到lua

    自从工作后感觉时间较少(每天工作9-22,晚上就不想动了,早上想多睡点),工作中用的是 cocos2d-x.cocos2d-x是一款手机游戏引擎,虽然支持lua,但和love2d相比非纯lua游戏引 ...

  6. cocos studio UI 1.6.0.0 修改导出项目路径

    因为cocos studio UI 1.6.0.0版本没有自动修改默认导出路径的功能,新建项目后默认导出的路径还是上一个项目的,每次导出都要重新设置路径很麻烦.于是考虑是否可以找到默认配置文件,终于还 ...

  7. cocos进阶教程(1)Lua调用自定义C++类和函数的最佳实践

    第一层:纯C环境下,把C函数注册进Lua环境 a.lua 文件 )) a.c 文件 #include <lua.h> #include <lualib.h> #include ...

  8. php.ini修改php上传文件大小限制的方法详解

    打开php.ini,首先找到file_uploads = on ;是否允许通过HTTP上传文件的开关.默认为ON即是开upload_tmp_dir ;文件上传至服务器上存储临时文件的地方,如果没指定就 ...

  9. 学习cocos code ide 的lua编程

    装上了cocos code ide,配了路径之后,建立一个默认lua工程,发现无法调试,报错. 问了别人,在cocos2dconstants.lua的613行插入cc.AsyncTaskPool  = ...

随机推荐

  1. 详解XOR(异或)运算加密

    逻辑运算之中,除了 AND 和 OR,还有一种 XOR 运算,中文称为"异或运算".它的定义是:两个值相同时,返回false,否则返回true.也就是说,XOR可以用来判断两个值是 ...

  2. CSS之flex布局和边框阴影

    flex布局 main axis:主轴:cross axis:交叉轴 容器的子元素自动成为容器成员,成为flex 项目(item) flex容器属性 flex-direction ​ 该属性决定主轴的 ...

  3. 「福利」Java Swing 编写的可视化算法工程,包含树、图和排序

    之前在整理<学习排序算法,结合这个方法太容易理解了>这篇文章时,发现了一个用 Java Swing 编写的可视化算法工程,真心不错!包含了常用数据结构和算法的动态演示,先来张图感受下: 可 ...

  4. 记一个netcore HttpClient的坑

    异常信息 The SSL connection could not be established, see inner exception ---> AuthenticationExceptio ...

  5. .net架构的浅谈

    ,net的架构有以下几种 1.两层架构:UI + 数据层 2.三层架构:UI + 业务层 + 数据层 3.三层 + 接口层 (把相关的业务层抽象成接口,下层来实现接口,中层是依赖) 4.三层 + 接口 ...

  6. javascript(五)表达式

    表达式 (expression) JavaScript中的一个短语, JavaScript解释器会将其计算(evaluate) 出一 个结果.程序中的常量是最简单的一类表达式.变量名也是一种简单的表达 ...

  7. poj3045 Cow Acrobats (思维,贪心)

    题目: poj3045 Cow Acrobats 解析: 贪心题,类似于国王游戏 考虑两个相邻的牛\(i\),\(j\) 设他们上面的牛的重量一共为\(sum\) 把\(i\)放在上面,危险值分别为\ ...

  8. Lucene PriorityQueue & JDK PriorityQueue

    麻蛋,原来是最小堆呀!  数据结构不熟害死人呀! 看来待复习复习数据结构了 在lucene源码中对多个段合并的时候,会先将多个段放到一个PriorityQueue中,不要被这个名字迷惑,这个Prior ...

  9. Oracle 11.2.0.4单实例打补丁

    Oracle 11.2.0.4单实例打PSU,OJVM PSU补丁快速参考 写在前面: ·         1.Oracel打每个补丁的操作有时存在差异,所以不管多熟悉,都应该在打任何补丁之前阅读新补 ...

  10. There is already an open DataReader associated with this Command which must be closed first

    通常出现在嵌套查询数据库(比如在一个qry的遍历时,又进行了数据库查询) 通过在连接字符串中允许MARS可以轻松解决这个问题. 将MultipleActiveResultSets = true添加到连 ...