Skip to content

Commit

Permalink
update olua
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Oct 26, 2023
1 parent b44b2a9 commit c9508f2
Show file tree
Hide file tree
Showing 19 changed files with 936 additions and 785 deletions.
2 changes: 1 addition & 1 deletion frameworks/3rd/png/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
)
if(${PNG_ARM_NEON} STREQUAL "on")
add_definitions(-DPNG_ARM_NEON_OPT=2)
elseif(${PNG_ARM_NEON} STREQUAL "check")
elseif(${PNG_ARM_NEON} STREQUAL "check" AND NOT APPLE)
add_definitions(-DPNG_ARM_NEON_CHECK_SUPPORTED)
endif()
else()
Expand Down
8 changes: 4 additions & 4 deletions frameworks/cclua/src/cclua/cclua-extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ olua_Return NodeExtend::__index(lua_State *L)
cocos2d::Node *child = self->getChildByName(olua_tostring(L, 2));
if (child) {
olua_pushobj<cocos2d::Node>(L, child);
olua_addref(L, 1, "children", -1, OLUA_FLAG_MULTIPLE);
olua_addref(L, 1, "children", -1, OLUA_REF_MULTI);
return 1;
}
}
Expand Down Expand Up @@ -587,15 +587,15 @@ olua_Return SkeletonDataExtend::create(lua_State *L, const char *skel_path, cons
olua_setvariable(L, -3);

lua_pushstring(L, ".skel.texture_loader");
olua_newrawobj(L, texture_loader);
olua_newrawobj(L, texture_loader, 0);
olua_setvariable(L, -3);

lua_pushstring(L, ".skel.attachment_loader");
olua_newrawobj(L, attachment_loader);
olua_newrawobj(L, attachment_loader, 0);
olua_setvariable(L, -3);

lua_pushstring(L, ".skel.atlas");
olua_newrawobj(L, atlas);
olua_newrawobj(L, atlas, 0);
olua_setvariable(L, -3);

return 1;
Expand Down
2 changes: 1 addition & 1 deletion frameworks/cclua/src/cclua/olua-2dx.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void olua_postnew(lua_State *L, T *obj)
if (std::is_base_of<cocos2d::Ref, T>::value) {
((cocos2d::Ref *)obj)->autorelease();
} else if (olua_getrawobj(L, obj)) {
olua_setownership(L, -1, OLUA_OWNERSHIP_VM);
olua_setobjflag(L, -1, OLUA_FLAG_IN_HEAP);
lua_pop(L, 1);
}
}
Expand Down
10 changes: 5 additions & 5 deletions frameworks/cclua/src/lua-bindings/lua_box2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3583,7 +3583,7 @@ static int _box2d_DebugNode_create(lua_State *L)
int num_ret = olua_push_object(L, ret, "b2.DebugNode");

// insert code after call
olua_addref(L, -1, "world", 1, OLUA_FLAG_SINGLE);
olua_addref(L, -1, "world", 1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -16401,7 +16401,7 @@ static int _b2World_SetContactFilter(lua_State *L)
self->SetContactFilter(arg1);

// insert code after call
olua_addref(L, 1, "contactfilter", 2, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "contactfilter", 2, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -16422,7 +16422,7 @@ static int _b2World_SetContactListener(lua_State *L)
self->SetContactListener(arg1);

// insert code after call
olua_addref(L, 1, "contactlistener", 2, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "contactlistener", 2, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -16461,7 +16461,7 @@ static int _b2World_SetDebugDraw(lua_State *L)
self->SetDebugDraw(arg1);

// insert code after call
olua_addref(L, 1, "debugdraw", 2, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "debugdraw", 2, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -16482,7 +16482,7 @@ static int _b2World_SetDestructionListener(lua_State *L)
self->SetDestructionListener(arg1);

// insert code after call
olua_addref(L, 1, "destructionlistener", 2, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "destructionlistener", 2, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down
24 changes: 12 additions & 12 deletions frameworks/cclua/src/lua-bindings/lua_cclua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ static int _cclua_runtime_getActionManager(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.ActionManager");

// insert code after call
olua_addref(L, ref_store, "actionmanager", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "actionmanager", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -1020,7 +1020,7 @@ static int _cclua_runtime_getEventDispatcher(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.EventDispatcher");

// insert code after call
olua_addref(L, ref_store, "eventdispatcher", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "eventdispatcher", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -1039,7 +1039,7 @@ static int _cclua_runtime_getFileUtils(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.FileUtils");

// insert code after call
olua_addref(L, ref_store, "fileutils", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "fileutils", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -1192,7 +1192,7 @@ static int _cclua_runtime_getProgramCache(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.GLProgramCache");

// insert code after call
olua_addref(L, ref_store, "programcache", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "programcache", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -1211,7 +1211,7 @@ static int _cclua_runtime_getRunningScene(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.Scene");

// insert code after call
olua_addref(L, ref_store, "scenes", -1, OLUA_FLAG_MULTIPLE);
olua_addref(L, ref_store, "scenes", -1, OLUA_REF_MULTI);

olua_endinvoke(L);

Expand Down Expand Up @@ -1243,7 +1243,7 @@ static int _cclua_runtime_getScheduler(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.Scheduler");

// insert code after call
olua_addref(L, ref_store, "scheduler", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "scheduler", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -1262,7 +1262,7 @@ static int _cclua_runtime_getSpriteFrameCache(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.SpriteFrameCache");

// insert code after call
olua_addref(L, ref_store, "spriteframecache", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "spriteframecache", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand All @@ -1281,7 +1281,7 @@ static int _cclua_runtime_getTextureCache(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.TextureCache");

// insert code after call
olua_addref(L, ref_store, "texturecache", -1, OLUA_FLAG_SINGLE);
olua_addref(L, ref_store, "texturecache", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -1619,7 +1619,7 @@ static int _cclua_runtime_pushScene(lua_State *L)
cclua::runtime::pushScene(arg1);

// insert code after call
olua_addref(L, ref_store, "scenes", 1, OLUA_FLAG_MULTIPLE);
olua_addref(L, ref_store, "scenes", 1, OLUA_REF_MULTI);

olua_endinvoke(L);

Expand All @@ -1642,7 +1642,7 @@ static int _cclua_runtime_replaceScene(lua_State *L)
cclua::runtime::replaceScene(arg1);

// insert code after call
olua_addref(L, ref_store, "scenes", 1, OLUA_FLAG_MULTIPLE);
olua_addref(L, ref_store, "scenes", 1, OLUA_REF_MULTI);
olua_endcmpref(L, ref_store, "scenes");

olua_endinvoke(L);
Expand Down Expand Up @@ -3780,7 +3780,7 @@ static int _cclua_Container_getFilter(lua_State *L)
int num_ret = olua_push_object(L, ret, "cc.Node");

// insert code after call
olua_addref(L, 1, "filter", -1, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "filter", -1, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down Expand Up @@ -3817,7 +3817,7 @@ static int _cclua_Container_setFilter(lua_State *L)
self->setFilter(arg1);

// insert code after call
olua_addref(L, 1, "filter", 2, OLUA_FLAG_SINGLE);
olua_addref(L, 1, "filter", 2, OLUA_REF_ALONE);

olua_endinvoke(L);

Expand Down
Loading

0 comments on commit c9508f2

Please sign in to comment.