Skip to content

Commit

Permalink
update lua bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Jun 23, 2024
1 parent 09f7402 commit 5b29261
Show file tree
Hide file tree
Showing 36 changed files with 926 additions and 873 deletions.
4 changes: 4 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"diagnostics.disable": ["redundant-return-value", "lowercase-global"],
"workspace.library": ["addons"]
}
1 change: 1 addition & 0 deletions assets/src/cclua/ui/AbsoluteLayout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local class = require "cclua.class"
local Align = require "cclua.ui.Align"
local LayoutBase = require "cclua.ui.LayoutBase"

---@class AbsoluteLayout : LayoutBase
local AbsoluteLayout = class("AbsoluteLayout", LayoutBase)

function AbsoluteLayout:doLayout()
Expand Down
1 change: 1 addition & 0 deletions assets/src/cclua/ui/LayoutBase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local class = require "cclua.class"
local Event = require "cclua.Event"
local layouter = require "cclua.ui.layouter"

---@class LayoutBase
local LayoutBase = class("LayoutBase")

function LayoutBase:ctor()
Expand Down
2 changes: 1 addition & 1 deletion assets/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local window = require "cclua.window"
local runtime = require "cclua.runtime"
local timer = require "cclua.timer"
local Director = require "cc.Director"
local olua = require "olua"
local olua = require "olua.c"

olua.debug(DEBUG)

Expand Down
1 change: 1 addition & 0 deletions cocos-lua.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"631", // Line is too long
],
"editor.snippetSuggestions": "bottom",
"Lua.workspace.library": ["tools/lua-bindings/olua/addons"],
"files.associations": {
"*.manifest": "json",
"*.jsfl": "javascript",
Expand Down
26 changes: 13 additions & 13 deletions frameworks/cclua/src/lua-bindings/lua_cocos2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28446,11 +28446,11 @@ static int _cocos2d_ParallaxNode_addChild$1(lua_State *L)
olua_check_object(L, 4, &arg3, "cc.Vec2");
olua_check_object(L, 5, &arg4, "cc.Vec2");

// void addChild(@addref(chilren |) cocos2d::Node *child, int z, const cocos2d::Vec2 &parallaxRatio, const cocos2d::Vec2 &positionOffset)
// void addChild(@addref(children |) cocos2d::Node *child, int z, const cocos2d::Vec2 &parallaxRatio, const cocos2d::Vec2 &positionOffset)
self->addChild(arg1, arg2, arg3, arg4);

// insert code after call
olua_addref(L, 1, "chilren", 2, OLUA_REF_MULTI);
olua_addref(L, 1, "children", 2, OLUA_REF_MULTI);

olua_endinvoke(L);

Expand All @@ -28471,11 +28471,11 @@ static int _cocos2d_ParallaxNode_addChild$2(lua_State *L)
olua_check_integer(L, 3, &arg2);
olua_check_integer(L, 4, &arg3);

// @using void addChild(@addref(chilren |) cocos2d::Node *child, int zOrder, int tag)
// @using void addChild(@addref(children |) cocos2d::Node *child, int zOrder, int tag)
self->addChild(arg1, arg2, arg3);

// insert code after call
olua_addref(L, 1, "chilren", 2, OLUA_REF_MULTI);
olua_addref(L, 1, "children", 2, OLUA_REF_MULTI);

olua_endinvoke(L);

Expand All @@ -28496,11 +28496,11 @@ static int _cocos2d_ParallaxNode_addChild$3(lua_State *L)
olua_check_integer(L, 3, &arg2);
olua_check_string(L, 4, &arg3);

// @using void addChild(@addref(chilren |) cocos2d::Node *child, int zOrder, const std::string &name)
// @using void addChild(@addref(children |) cocos2d::Node *child, int zOrder, const std::string &name)
self->addChild(arg1, arg2, arg3);

// insert code after call
olua_addref(L, 1, "chilren", 2, OLUA_REF_MULTI);
olua_addref(L, 1, "children", 2, OLUA_REF_MULTI);

olua_endinvoke(L);

Expand Down Expand Up @@ -28571,19 +28571,19 @@ static int _cocos2d_ParallaxNode_addChild(lua_State *L)

if (num_args == 3) {
if ((olua_is_object(L, 2, "cc.Node")) && (olua_is_integer(L, 3)) && (olua_is_integer(L, 4))) {
// @using void addChild(@addref(chilren |) cocos2d::Node *child, int zOrder, int tag)
// @using void addChild(@addref(children |) cocos2d::Node *child, int zOrder, int tag)
return _cocos2d_ParallaxNode_addChild$2(L);
}

// if ((olua_is_object(L, 2, "cc.Node")) && (olua_is_integer(L, 3)) && (olua_is_string(L, 4))) {
// @using void addChild(@addref(chilren |) cocos2d::Node *child, int zOrder, const std::string &name)
// @using void addChild(@addref(children |) cocos2d::Node *child, int zOrder, const std::string &name)
return _cocos2d_ParallaxNode_addChild$3(L);
// }
}

if (num_args == 4) {
// if ((olua_is_object(L, 2, "cc.Node")) && (olua_is_integer(L, 3)) && (olua_is_object(L, 4, "cc.Vec2")) && (olua_is_object(L, 5, "cc.Vec2"))) {
// void addChild(@addref(chilren |) cocos2d::Node *child, int z, const cocos2d::Vec2 &parallaxRatio, const cocos2d::Vec2 &positionOffset)
// void addChild(@addref(children |) cocos2d::Node *child, int z, const cocos2d::Vec2 &parallaxRatio, const cocos2d::Vec2 &positionOffset)
return _cocos2d_ParallaxNode_addChild$1(L);
// }
}
Expand Down Expand Up @@ -50038,7 +50038,7 @@ static int _cocos2d_TMXLayer_getTiles(lua_State *L)

// uint32_t *getTiles()
uint32_t *ret = self->getTiles();
int num_ret = olua_push_pointer(L, ret, "olua.uint32_t");
int num_ret = olua_push_pointer(L, ret, "olua.uint32");

olua_endinvoke(L);

Expand Down Expand Up @@ -50297,7 +50297,7 @@ static int _cocos2d_TMXLayer_setTiles(lua_State *L)
uint32_t *arg1 = nullptr; /** tiles */

olua_to_object(L, 1, &self, "cc.TMXLayer");
olua_check_pointer(L, 2, &arg1, "olua.uint32_t");
olua_check_pointer(L, 2, &arg1, "olua.uint32");

// void setTiles(uint32_t *tiles)
self->setTiles(arg1);
Expand Down Expand Up @@ -52354,7 +52354,7 @@ static int _cocos2d_FastTMXLayer_getTiles(lua_State *L)

// const uint32_t *getTiles()
const uint32_t *ret = self->getTiles();
int num_ret = olua_push_pointer(L, ret, "olua.uint32_t");
int num_ret = olua_push_pointer(L, ret, "olua.uint32");

olua_endinvoke(L);

Expand Down Expand Up @@ -52574,7 +52574,7 @@ static int _cocos2d_FastTMXLayer_setTiles(lua_State *L)
uint32_t *arg1 = nullptr; /** tiles */

olua_to_object(L, 1, &self, "cc.FastTMXLayer");
olua_check_pointer(L, 2, &arg1, "olua.uint32_t");
olua_check_pointer(L, 2, &arg1, "olua.uint32");

// void setTiles(uint32_t *tiles)
self->setTiles(arg1);
Expand Down
8 changes: 4 additions & 4 deletions frameworks/cclua/src/lua-bindings/lua_cocos2d_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2887,7 +2887,7 @@ static int _cocos2d_backend_Texture2DBackend_updateCompressedData(lua_State *L)
std::size_t arg5 = 0; /** level */

olua_to_object(L, 1, &self, "ccb.Texture2DBackend");
olua_check_pointer(L, 2, &arg1, "olua.uint8_t");
olua_check_pointer(L, 2, &arg1, "olua.uint8");
olua_check_integer(L, 3, &arg2);
olua_check_integer(L, 4, &arg3);
olua_check_integer(L, 5, &arg4);
Expand Down Expand Up @@ -2921,7 +2921,7 @@ static int _cocos2d_backend_Texture2DBackend_updateCompressedSubData(lua_State *
olua_check_integer(L, 5, &arg4);
olua_check_integer(L, 6, &arg5);
olua_check_integer(L, 7, &arg6);
olua_check_pointer(L, 8, &arg7, "olua.uint8_t");
olua_check_pointer(L, 8, &arg7, "olua.uint8");

// void updateCompressedSubData(std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t dataLen, std::size_t level, uint8_t *data)
self->updateCompressedSubData(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
Expand All @@ -2942,7 +2942,7 @@ static int _cocos2d_backend_Texture2DBackend_updateData(lua_State *L)
std::size_t arg4 = 0; /** level */

olua_to_object(L, 1, &self, "ccb.Texture2DBackend");
olua_check_pointer(L, 2, &arg1, "olua.uint8_t");
olua_check_pointer(L, 2, &arg1, "olua.uint8");
olua_check_integer(L, 3, &arg2);
olua_check_integer(L, 4, &arg3);
olua_check_integer(L, 5, &arg4);
Expand Down Expand Up @@ -2973,7 +2973,7 @@ static int _cocos2d_backend_Texture2DBackend_updateSubData(lua_State *L)
olua_check_integer(L, 4, &arg3);
olua_check_integer(L, 5, &arg4);
olua_check_integer(L, 6, &arg5);
olua_check_pointer(L, 7, &arg6, "olua.uint8_t");
olua_check_pointer(L, 7, &arg6, "olua.uint8");

// void updateSubData(std::size_t xoffset, std::size_t yoffset, std::size_t width, std::size_t height, std::size_t level, uint8_t *data)
self->updateSubData(arg1, arg2, arg3, arg4, arg5, arg6);
Expand Down
16 changes: 8 additions & 8 deletions frameworks/cclua/src/lua-bindings/lua_dragonbones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11751,7 +11751,7 @@ static int _dragonBones_DragonBonesData_get_frameArray(lua_State *L)

// const int16_t *frameArray
const int16_t *ret = self->frameArray;
int num_ret = olua_push_pointer(L, ret, "olua.int16_t");
int num_ret = olua_push_pointer(L, ret, "olua.int16");

olua_endinvoke(L);

Expand All @@ -11766,7 +11766,7 @@ static int _dragonBones_DragonBonesData_set_frameArray(lua_State *L)
int16_t *arg1 = nullptr; /** frameArray */

olua_to_object(L, 1, &self, "db.DragonBonesData");
olua_check_pointer(L, 2, &arg1, "olua.int16_t");
olua_check_pointer(L, 2, &arg1, "olua.int16");

// const int16_t *frameArray
self->frameArray = arg1;
Expand Down Expand Up @@ -11860,7 +11860,7 @@ static int _dragonBones_DragonBonesData_get_frameIntArray(lua_State *L)

// const int16_t *frameIntArray
const int16_t *ret = self->frameIntArray;
int num_ret = olua_push_pointer(L, ret, "olua.int16_t");
int num_ret = olua_push_pointer(L, ret, "olua.int16");

olua_endinvoke(L);

Expand All @@ -11875,7 +11875,7 @@ static int _dragonBones_DragonBonesData_set_frameIntArray(lua_State *L)
int16_t *arg1 = nullptr; /** frameIntArray */

olua_to_object(L, 1, &self, "db.DragonBonesData");
olua_check_pointer(L, 2, &arg1, "olua.int16_t");
olua_check_pointer(L, 2, &arg1, "olua.int16");

// const int16_t *frameIntArray
self->frameIntArray = arg1;
Expand Down Expand Up @@ -11930,7 +11930,7 @@ static int _dragonBones_DragonBonesData_get_intArray(lua_State *L)

// const int16_t *intArray
const int16_t *ret = self->intArray;
int num_ret = olua_push_pointer(L, ret, "olua.int16_t");
int num_ret = olua_push_pointer(L, ret, "olua.int16");

olua_endinvoke(L);

Expand All @@ -11945,7 +11945,7 @@ static int _dragonBones_DragonBonesData_set_intArray(lua_State *L)
int16_t *arg1 = nullptr; /** intArray */

olua_to_object(L, 1, &self, "db.DragonBonesData");
olua_check_pointer(L, 2, &arg1, "olua.int16_t");
olua_check_pointer(L, 2, &arg1, "olua.int16");

// const int16_t *intArray
self->intArray = arg1;
Expand Down Expand Up @@ -12000,7 +12000,7 @@ static int _dragonBones_DragonBonesData_get_timelineArray(lua_State *L)

// const uint16_t *timelineArray
const uint16_t *ret = self->timelineArray;
int num_ret = olua_push_pointer(L, ret, "olua.uint16_t");
int num_ret = olua_push_pointer(L, ret, "olua.uint16");

olua_endinvoke(L);

Expand All @@ -12015,7 +12015,7 @@ static int _dragonBones_DragonBonesData_set_timelineArray(lua_State *L)
uint16_t *arg1 = nullptr; /** timelineArray */

olua_to_object(L, 1, &self, "db.DragonBonesData");
olua_check_pointer(L, 2, &arg1, "olua.uint16_t");
olua_check_pointer(L, 2, &arg1, "olua.uint16");

// const uint16_t *timelineArray
self->timelineArray = arg1;
Expand Down
Loading

0 comments on commit 5b29261

Please sign in to comment.