|
|
@@ -170,7 +170,7 @@ template<> void* tolua_tourho3dpodvector<unsigned>(lua_State* L, int narg, void*
|
|
|
return &result;
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<int>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<int>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
const PODVector<int>& vector = *((const PODVector<int>*)data);
|
|
|
lua_newtable(L);
|
|
|
@@ -183,46 +183,38 @@ template<> int tolua_pushurho3dpodvector<int>(lua_State* L, void* data, const ch
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<IntVector2>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<unsigned>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<IntVector2>& vector = *((const PODVector<IntVector2>*)data);
|
|
|
+ const PODVector<unsigned>& vector = *((const PODVector<unsigned>*)data);
|
|
|
lua_newtable(L);
|
|
|
for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
{
|
|
|
- void* tolua_obj = Mtolua_new((IntVector2)(vector[i]));
|
|
|
- tolua_pushusertype(L,tolua_obj,"IntVector2");
|
|
|
- tolua_register_gc(L,lua_gettop(L));
|
|
|
-
|
|
|
+ lua_pushinteger(L, vector[i]);
|
|
|
lua_rawseti(L, -2, i + 1);
|
|
|
}
|
|
|
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<OctreeQueryResult>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<UIElement*>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<OctreeQueryResult>& vector = *((const PODVector<OctreeQueryResult>*)data);
|
|
|
+ const PODVector<UIElement*>& vector = *((const PODVector<UIElement*>*)data);
|
|
|
lua_newtable(L);
|
|
|
for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
{
|
|
|
- void* tolua_obj = Mtolua_new((OctreeQueryResult)(vector[i]));
|
|
|
- tolua_pushusertype(L,tolua_obj,"OctreeQueryResult");
|
|
|
- tolua_register_gc(L,lua_gettop(L));
|
|
|
-
|
|
|
+ tolua_pushusertype(L, vector[i], "UIElement");
|
|
|
lua_rawseti(L, -2, i + 1);
|
|
|
}
|
|
|
-
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<PhysicsRaycastResult>(lua_State* L, void* data, const char* type)
|
|
|
+template<typename T> int tolua_pushurho3dpodvectorusertype(lua_State* L, const PODVector<T>& vector, const char* typeName)
|
|
|
{
|
|
|
- const PODVector<PhysicsRaycastResult>& vector = *((const PODVector<PhysicsRaycastResult>*)data);
|
|
|
lua_newtable(L);
|
|
|
for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
{
|
|
|
- void* tolua_obj = Mtolua_new((PhysicsRaycastResult)(vector[i]));
|
|
|
- tolua_pushusertype(L,tolua_obj,"PhysicsRaycastResult");
|
|
|
+ void* tolua_obj = Mtolua_new((T)(vector[i]));
|
|
|
+ tolua_pushusertype(L, tolua_obj, typeName);
|
|
|
tolua_register_gc(L,lua_gettop(L));
|
|
|
|
|
|
lua_rawseti(L, -2, i + 1);
|
|
|
@@ -231,73 +223,27 @@ template<> int tolua_pushurho3dpodvector<PhysicsRaycastResult>(lua_State* L, voi
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<RayQueryResult>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<Vector3>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<RayQueryResult>& vector = *((const PODVector<RayQueryResult>*)data);
|
|
|
- lua_newtable(L);
|
|
|
- for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
- {
|
|
|
- void* tolua_obj = Mtolua_new((RayQueryResult)(vector[i]));
|
|
|
- tolua_pushusertype(L,tolua_obj,"RayQueryResult");
|
|
|
- tolua_register_gc(L,lua_gettop(L));
|
|
|
-
|
|
|
- lua_rawseti(L, -2, i + 1);
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
+ return tolua_pushurho3dpodvectorusertype(L, *((const PODVector<Vector3>*)data), "Vector3");
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<UIElement*>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<IntVector2>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<UIElement*>& vector = *((const PODVector<UIElement*>*)data);
|
|
|
- lua_newtable(L);
|
|
|
- for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
- {
|
|
|
- tolua_pushusertype(L, vector[i], "UIElement");
|
|
|
- lua_rawseti(L, -2, i + 1);
|
|
|
- }
|
|
|
- return 1;
|
|
|
+ return tolua_pushurho3dpodvectorusertype(L, *((const PODVector<IntVector2>*)data), "IntVector2");
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<unsigned>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<OctreeQueryResult>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<unsigned>& vector = *((const PODVector<unsigned>*)data);
|
|
|
- lua_newtable(L);
|
|
|
- for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
- {
|
|
|
- lua_pushinteger(L, vector[i]);
|
|
|
- lua_rawseti(L, -2, i + 1);
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
+ return tolua_pushurho3dpodvectorusertype(L, *((const PODVector<OctreeQueryResult>*)data), "OctreeQueryResult");
|
|
|
}
|
|
|
|
|
|
-template<typename T> int PushPODVector(lua_State* L, const PODVector<T>& vector, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<PhysicsRaycastResult>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- lua_newtable(L);
|
|
|
- for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
- {
|
|
|
- void* tolua_obj = Mtolua_new((T)(vector[i]));
|
|
|
- tolua_pushusertype(L, tolua_obj, type);
|
|
|
- tolua_register_gc(L, lua_gettop(L));
|
|
|
- lua_rawseti(L, -2, i + 1);
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
+ return tolua_pushurho3dpodvectorusertype(L, *((const PODVector<PhysicsRaycastResult>*)data), "PhysicsRaycastResult");
|
|
|
}
|
|
|
|
|
|
-template<> int tolua_pushurho3dpodvector<Vector3>(lua_State* L, void* data, const char* type)
|
|
|
+template<> int tolua_pushurho3dpodvector<RayQueryResult>(lua_State* L, void* data, const char* /*type*/)
|
|
|
{
|
|
|
- const PODVector<Vector3>& vector = *((const PODVector<Vector3>*)data);
|
|
|
- lua_newtable(L);
|
|
|
- for (unsigned i = 0; i < vector.Size(); ++i)
|
|
|
- {
|
|
|
- void* tolua_obj = Mtolua_new((Vector3)(vector[i]));
|
|
|
- tolua_pushusertype(L,tolua_obj,"Vector3");
|
|
|
- tolua_register_gc(L,lua_gettop(L));
|
|
|
-
|
|
|
- lua_rawseti(L, -2, i + 1);
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
-}
|
|
|
+ return tolua_pushurho3dpodvectorusertype(L, *((const PODVector<RayQueryResult>*)data), "RayQueryResult");
|
|
|
+}
|