Skip to content

Commit

Permalink
update olua
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Nov 3, 2023
1 parent f1ba217 commit 09b8559
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tools/lua-bindings/conf/lua-cocos2d-backend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typeconf 'cocos2d::backend::ProgramState'
.exclude 'getVertexUniformBuffer'
.exclude 'getFragmentUniformBuffer'
.func 'getVertexLayout'
.snippet [[
.body [[
{
auto self = olua_toobj<cocos2d::backend::ProgramState>(L, 1);
olua_pushobj<cocos2d::backend::VertexLayout>(L, self->getVertexLayout().get());
Expand Down
8 changes: 4 additions & 4 deletions tools/lua-bindings/conf/lua-cocos2d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typeconf 'cocos2d::Ref'
.exclude 'release'
.exclude 'autorelease'
.func '__gc'
.snippet [[
.body [[
{
return cclua_ccobjgc(L);
}]]
Expand Down Expand Up @@ -111,7 +111,7 @@ typeconf 'cocos2d::Scheduler'
.tag_maker 'makeScheduleCallbackTag("")'
.tag_mode 'startwith'
.func 'scheduleUpdate'
.snippet [[
.body [[
{
if (doScheduleUpdate<cocos2d::Scheduler>(L) ||
doScheduleUpdate<cocos2d::ActionManager>(L) ||
Expand Down Expand Up @@ -165,7 +165,7 @@ typeconf 'cocos2d::EventDispatcher'
doRemoveEventListenersForTarget(L, node, recursive, "listeners");
]]
.func 'addEventListener'
.snippet [[
.body [[
{
lua_settop(L, 2);
olua_pushinteger(L, 1);
Expand Down Expand Up @@ -363,7 +363,7 @@ typeconf 'cocos2d::network::WebSocket::Delegate'

typeconf 'cocos2d::network::WebSocket'
.func 'init'
.snippet [[
.body [[
{
std::vector<std::string> protocols;
auto self = olua_toobj<cocos2d::network::WebSocket>(L, 1);
Expand Down
8 changes: 4 additions & 4 deletions tools/lua-bindings/conf/lua-fairygui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ typeconf 'fairygui::GComponent'
.func 'setMask' .arg1 '@addref(^)'
.prop 'numChildren' .get 'int numChildren()'
.func '__index'
.snippet [[
.body [[
{
if(olua_isuserdata(L, 1)) {
if (olua_isstring(L, 2)) {
Expand All @@ -265,7 +265,7 @@ typeconf 'fairygui::GComponent'
}
}]]
.func 'resolve'
.snippet [[
.body [[
{
auto self = olua_toobj<fairygui::GComponent>(L, 1);
const char *name = olua_checkstring(L, 2);
Expand Down Expand Up @@ -431,7 +431,7 @@ typeconf 'fairygui::PopupMenu'

typeconf 'fairygui::Relations'
.func 'copyFrom'
.snippet [[
.body [[
{
fairygui::Relations *self = olua_toobj<fairygui::Relations>(L, 1);
fairygui::Relations &source = *olua_checkobj<fairygui::Relations>(L, 2);
Expand All @@ -444,7 +444,7 @@ typeconf 'fairygui::RelationItem'
.func 'getTarget' .ret '@addref(^)'
.func 'setTarget' .arg1 '@addref(^)'
.func 'copyFrom'
.snippet [[
.body [[
{
fairygui::RelationItem *self = olua_toobj<fairygui::RelationItem>(L, 1);
fairygui::RelationItem &source = *olua_checkobj<fairygui::RelationItem>(L, 2);
Expand Down
2 changes: 1 addition & 1 deletion tools/lua-bindings/olua

0 comments on commit 09b8559

Please sign in to comment.