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. mongodb数据库环境配置

    数据是每一前端人员必定接触的一样,所有的数据都是后端来编写,如果自己想练习项目,却没有数据,而是写一些假数据,去编写,或者通过json-server搭建一个数据,今天我们就通过MongoDB来搭建一个 ...

  2. 使用 Python 获取 Windows 聚焦图片

    Windows 聚焦图片会定期更新,拿来做壁纸不错,它的目录是: %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw ...

  3. 深入理解 Kubernetes 资源限制:CPU

    原文地址:https://www.yangcs.net/posts/understanding-resource-limits-in-kubernetes-cpu-time/ 在关于 Kubernet ...

  4. python机器学习简介

    目录 一:学习机器学习原因和能够解决的问题 二:为什么选择python作为机器学习的语言 三:机器学习常用库简介 四:机器学习流程   机器学习是一门多领域交叉学科,涉及概率论.统计学.逼近论.凸分析 ...

  5. Python【day 8】文件

    一.文件操作 open(文件路径,mode='模式',encoding='utf-8')模式:r w a rb wb ab r+ w+ a+ r+b w+b a+b常用的:r w ab表示字节,处理费 ...

  6. Oracle 11.2.0.4打补丁

    所需补丁及高版本opatch 上传后将p6880880_112000_Linux-x86-64.zip解压覆盖$ORACLE_HOME/OPatch目录即可 [oracle@localhost OPa ...

  7. The field file exceeds its maximum permitted size of 1048576 bytes.

    问题原因:Spring Boot内置tomcat限制了请求文件的大小 下面是修改方法:根据自己的Spring Boot版本 2.0之后版本的修改方式 在主配置文件 application.proper ...

  8. Odoo报表的report标签和报表格式定义

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10826329.html 一:Report标签     report标签可用于定义一条报表记录.属性有: 1) ...

  9. linux环境安装配置nginx

    安装依赖 yum install gcc yum install pcre-devel yum install zlib zlib-devel yum install openssl openssl- ...

  10. AI-数据标注

    目录 素材标注工具 标注可能存在的问题 标注注意事项 如何提高素材标注质量     算力和数据是影响深度学习的两个关键因素.在算力满足的情况下,为了达到更好的效果,我们就需要提供海量优质素材数据给神经 ...