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. 分布式文件系统fastdfs搭建

    https://blog.csdn.net/qq_33009107/article/details/90641940 #Tracker 端口号 22122 启动tracker /etc/init.d/ ...

  2. 【linux】查看linux系统自带的服务启动文件

    =============================================================== 1.查看所有启动文件 systemctl list-unit-files ...

  3. python 双层for循环,在第二层的for循环中的else中的continue,会退出到第一层for循环继续执行

    for a in [1,2,3,4,5]: for b in [1,2,3]: if a == b: print("a = b = %s" % a) break # 退出本次for ...

  4. 左右对齐Justify遇到的坑

    遇到的问题 这两天在开发一个病历的对外展示页面,设计稿上label是左右拉伸对齐的,显示效果如下: 怎么实现这种效果呢? 首先想到的是文字中间加空格,但是这种方式太low了,而且不太容易控制.网上查资 ...

  5. 企业安全之APT攻击防护

    现在针对企业APT[1]攻击越来越多了,企业安全也受到了严重的威胁,由于APT攻击比较隐匿的特性[2],攻击并不能被检测到,所以往往可以在企业内部网络潜伏很长时间. APT的攻击方式多种多样,导致企业 ...

  6. HP服务器重装centeos 6.3红屏错误码 Illegal Opcode

    公司组装一个服务器要装centos 6.3 .出现一个问题 如果自动引导一切正常.如果手动分区重启后就会,红屏错误码 Illegal Opcode. 去网上问度娘各种不靠谱,有时说要 升级BIOS,从 ...

  7. 使用mysql数据库过程中常用的命令

    1.添加用户:GRANT USAGE ON . TO 'user01'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION; 2.列出mysql数 ...

  8. 将qemu使用的设备树dump出来

    像下面的qemu启动命令: sudo qemu-system-aarch64 \ -M virt \ -cpu cortex-a53 \ -smp \ -m 4096M \ -kernel ./lin ...

  9. centos7 下 yum 安装Nginx

    centos7 下 yum 安装和配置 Nginx 添加yum源 Nginx不在默认的yum源中,可以使用epel或者官网的yum源,这里使用官网的yum源 rpm -ivh http://nginx ...

  10. pandas 生成并排放置的条形图和箱线图

    1.代码 import numpy as np import pandas as pd import matplotlib.pyplot as plt # 生成数据,创建 DataFrame np.r ...