Merge pull request #6502 from samuele3hu/dev_compile_error

Add some deprecated functions and replace the Point related to Vector2
This commit is contained in:
James Chen 2014-04-29 14:54:42 +08:00
commit 8c045da2c0
6 changed files with 122 additions and 180 deletions

View File

@ -493,7 +493,7 @@ int LuaEngine::handleTouchEvent(void* data)
Touch* touch = touchScriptData->touch;
if (NULL != touch) {
const Point pt = Director::getInstance()->convertToGL(touch->getLocationInView());
const cocos2d::Vector2 pt = Director::getInstance()->convertToGL(touch->getLocationInView());
_stack->pushFloat(pt.x);
_stack->pushFloat(pt.y);
ret = _stack->executeFunctionByHandler(handler, 3);
@ -546,7 +546,7 @@ int LuaEngine::handleTouchesEvent(void* data)
int i = 1;
for (auto& touch : touchesScriptData->touches)
{
Point pt = pDirector->convertToGL(touch->getLocationInView());
cocos2d::Vector2 pt = pDirector->convertToGL(touch->getLocationInView());
lua_pushnumber(L, pt.x);
lua_rawseti(L, -2, i++);
lua_pushnumber(L, pt.y);

View File

@ -271,38 +271,6 @@ bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue)
return ok;
}
bool luaval_to_point(lua_State* L,int lo,Point* outValue)
{
if (NULL == L || NULL == outValue)
return false;
bool ok = true;
tolua_Error tolua_err;
if (!tolua_istable(L, lo, 0, &tolua_err) )
{
#if COCOS2D_DEBUG >=1
luaval_to_native_err(L,"#ferror:",&tolua_err);
#endif
ok = false;
}
if (ok)
{
lua_pushstring(L, "x");
lua_gettable(L, lo);
outValue->x = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
lua_pushstring(L, "y");
lua_gettable(L, lo);
outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);
lua_pop(L, 1);
}
return ok;
}
bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue)
{
if (nullptr == L || nullptr == outValue)
@ -849,44 +817,6 @@ bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue )
return ok;
}
bool luaval_to_kmMat4(lua_State* L, int lo, kmMat4* outValue )
{
if (nullptr == L || nullptr == outValue)
return false;
bool ok = true;
tolua_Error tolua_err;
if (!tolua_istable(L, lo, 0, &tolua_err) )
{
#if COCOS2D_DEBUG >=1
luaval_to_native_err(L,"#ferror:",&tolua_err);
ok = false;
#endif
}
if (ok)
{
size_t len = lua_objlen(L, lo);
for (int i = 0; i < len; i++)
{
lua_pushnumber(L,i + 1);
lua_gettable(L,lo);
if (tolua_isnumber(L, -1, 0, &tolua_err))
{
outValue->m[i] = tolua_tonumber(L, -1, 0);
}
else
{
outValue->m[i] = 0;
}
lua_pop(L, 1);
}
}
return ok;
}
bool luaval_to_matrix(lua_State* L, int lo, cocos2d::math::Matrix* outValue )
{
if (nullptr == L || nullptr == outValue)
@ -1129,7 +1059,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue)
return ok;
}
bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints)
bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints)
{
if (NULL == L)
return false;
@ -1137,7 +1067,7 @@ bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints
bool ok = true;
tolua_Error tolua_err;
if (!tolua_istable(L, lo, 0, &tolua_err) )
{
#if COCOS2D_DEBUG >=1
@ -1151,7 +1081,7 @@ bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints
size_t len = lua_objlen(L, lo);
if (len > 0)
{
Point* array = (Point*)malloc(sizeof(Point) * len);
cocos2d::Vector2* array = (cocos2d::Vector2*)malloc(sizeof(cocos2d::Vector2) * len);
if (NULL == array)
return false;
for (uint32_t i = 0; i < len; ++i)
@ -1167,7 +1097,7 @@ bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints
free(array);
return false;
}
ok &= luaval_to_point(L, lua_gettop(L), &array[i]);
ok &= luaval_to_vector2(L, lua_gettop(L), &array[i]);
if (!ok)
{
lua_pop(L, 1);
@ -1681,7 +1611,7 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret)
return ok;
}
void points_to_luaval(lua_State* L,const Point* pt, int count)
void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count)
{
if (NULL == L)
return;
@ -1689,24 +1619,11 @@ void points_to_luaval(lua_State* L,const Point* pt, int count)
for (int i = 1; i <= count; ++i)
{
lua_pushnumber(L, i);
point_to_luaval(L, pt[i-1]);
vector2_to_luaval(L, points[i-1]);
lua_rawset(L, -3);
}
}
void point_to_luaval(lua_State* L,const Point& pt)
{
if (NULL == L)
return;
lua_newtable(L); /* L: table */
lua_pushstring(L, "x"); /* L: table key */
lua_pushnumber(L, (lua_Number) pt.x); /* L: table key value*/
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "y"); /* L: table key */
lua_pushnumber(L, (lua_Number) pt.y); /* L: table key value*/
lua_rawset(L, -3); /* table[key] = value, L: table */
}
void vector2_to_luaval(lua_State* L,const cocos2d::Vector2& vec2)
{
if (NULL == L)
@ -1775,19 +1692,19 @@ void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info)
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "start"); /* L: table key */
point_to_luaval(L, info.start);
vector2_to_luaval(L, info.start);
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "ended"); /* L: table key */
point_to_luaval(L, info.end);
vector2_to_luaval(L, info.end);
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "contact"); /* L: table key */
point_to_luaval(L, info.contact);
vector2_to_luaval(L, info.contact);
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "normal"); /* L: table key */
point_to_luaval(L, info.normal);
vector2_to_luaval(L, info.normal);
lua_rawset(L, -3); /* table[key] = value, L: table */
lua_pushstring(L, "fraction"); /* L: table key */
@ -1803,11 +1720,11 @@ void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data)
lua_newtable(L); /* L: table */
lua_pushstring(L, "points");
points_to_luaval(L, data->points, data->count);
vector2_array_to_luaval(L, data->points, data->count);
lua_rawset(L, -3);
lua_pushstring(L, "normal");
point_to_luaval(L, data->normal);
vector2_to_luaval(L, data->normal);
lua_rawset(L, -3);
lua_pushstring(L, "POINT_MAX");

View File

@ -58,7 +58,9 @@ extern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue);
extern bool luaval_to_long(lua_State* L,int lo, long* outValue);
extern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue);
extern bool luaval_to_point(lua_State* L,int lo,Point* outValue);
extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue);
extern bool luaval_to_vector3(lua_State* L,int lo,cocos2d::Vector3* outValue);
extern bool luaval_to_size(lua_State* L,int lo,Size* outValue);
extern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue);
extern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue);
@ -67,16 +69,30 @@ extern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue);
extern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue);
extern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue);
extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue );
extern bool luaval_to_kmMat4(lua_State* L, int lo, kmMat4* outValue );
extern bool luaval_to_matrix(lua_State* L, int lo, cocos2d::math::Matrix* outValue );
extern bool luaval_to_array(lua_State* L,int lo, __Array** outValue);
extern bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue);
extern bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints);
extern bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints);
extern bool luavals_variadic_to_array(lua_State* L,int argc, __Array** ret);
extern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret);
extern bool luaval_to_vector2(lua_State* L,int lo,cocos2d::Vector2* outValue);
extern bool luaval_to_vector3(lua_State* L,int lo,cocos2d::Vector3* outValue);
CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_point(lua_State* L,int lo,cocos2d::Vector2* outValue)
{
return luaval_to_vector2(L, lo, outValue);
}
CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo, cocos2d::math::Matrix* outValue )
{
return luaval_to_matrix(L, lo, outValue);
}
CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_array_of_Point(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints)
{
return luaval_to_array_of_vector2(L, lo, points, numPoints);
}
template <class T>
bool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector<T>* ret)
{
@ -216,10 +232,9 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret)
// from native
extern void point_to_luaval(lua_State* L,const Point& pt);
extern void vector2_to_luaval(lua_State* L,const cocos2d::Vector2& vec2);
extern void vector3_to_luaval(lua_State* L,const cocos2d::Vector3& vec3);
extern void points_to_luaval(lua_State* L,const Point* pt, int count);
extern void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count);
extern void size_to_luaval(lua_State* L,const Size& sz);
extern void rect_to_luaval(lua_State* L,const Rect& rt);
extern void color3b_to_luaval(lua_State* L,const Color3B& cc);
@ -234,6 +249,16 @@ extern void array_to_luaval(lua_State* L, __Array* inValue);
extern void dictionary_to_luaval(lua_State* L, __Dictionary* dict);
extern void matrix_to_luaval(lua_State* L, const cocos2d::math::Matrix& mat);
CC_DEPRECATED_ATTRIBUTE static inline void point_to_luaval(lua_State* L,const cocos2d::Vector2& pt)
{
vector2_to_luaval(L, pt);
}
CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count)
{
vector2_array_to_luaval(L, points, count);
}
template <class T>
void ccvector_to_luaval(lua_State* L,const cocos2d::Vector<T>& inValue)
{

View File

@ -1 +1 @@
99a3c7f58f194a51a2b30ae5434d8ad7ce92fb5a
8691f7305315a37ee7e7563c19d10ea5eacf15c0

View File

@ -1 +1 @@
c6021dd4f0d5fbfab61453c2a5f045f4f789a18d
d69918a19fbb23604827b6a99526d3231f6a3497

View File

@ -162,8 +162,8 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S)
if (argc == 3)
{
std::function<bool (cocos2d::PhysicsWorld &, const cocos2d::PhysicsRayCastInfo &, void *)> arg0;
cocos2d::Point arg1;
cocos2d::Point arg2;
cocos2d::Vector2 arg1;
cocos2d::Vector2 arg2;
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
do {
arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool
@ -174,8 +174,8 @@ int lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S)
};
} while(0);
ok &= luaval_to_point(tolua_S, 3, &arg1);
ok &= luaval_to_point(tolua_S, 4, &arg2);
ok &= luaval_to_vector2(tolua_S, 3, &arg1);
ok &= luaval_to_vector2(tolua_S, 4, &arg2);
if(!ok)
return 0;
cobj->rayCast(arg0, arg1, arg2, nullptr);
@ -278,7 +278,7 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S)
if (argc == 2)
{
std::function<bool (cocos2d::PhysicsWorld &, cocos2d::PhysicsShape &, void *)> arg0;
cocos2d::Point arg1;
cocos2d::Vector2 arg1;
LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);
do {
arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool
@ -290,7 +290,7 @@ int lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S)
assert(false);
} while(0)
;
ok &= luaval_to_point(tolua_S, 3, &arg1);
ok &= luaval_to_vector2(tolua_S, 3, &arg1);
if(!ok)
return 0;
cobj->queryPoint(arg0, arg1, nullptr);
@ -325,10 +325,10 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0 = nullptr;
cocos2d::Vector2* arg0 = nullptr;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -355,11 +355,11 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -388,17 +388,17 @@ int lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
cocos2d::Point arg3;
cocos2d::Vector2 arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
ok &= luaval_to_point(tolua_S, 4, &arg3);
ok &= luaval_to_vector2(tolua_S, 4, &arg3);
if(!ok)
{
CC_SAFE_FREE(arg0);
@ -446,10 +446,10 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -476,11 +476,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -508,12 +508,12 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
cocos2d::PhysicsMaterial arg2;
double arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -566,10 +566,10 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -596,11 +596,11 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -628,12 +628,12 @@ int lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1;
cocos2d::PhysicsMaterial arg2;
double arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -686,10 +686,10 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -699,29 +699,29 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1);
points_to_luaval(tolua_S, arg0, arg1);
vector2_array_to_luaval(tolua_S, arg0, arg1);
CC_SAFE_FREE(arg0);
return 0;
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::Point arg2;
cocos2d::Vector2 arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
ok &= luaval_to_point(tolua_S, 3, &arg2);
ok &= luaval_to_vector2(tolua_S, 3, &arg2);
if(!ok)
{
CC_SAFE_FREE(arg0);
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2);
points_to_luaval(tolua_S, arg0, arg1);
vector2_array_to_luaval(tolua_S, arg0, arg1);
CC_SAFE_FREE(arg0);
return 0;
}
@ -751,10 +751,10 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -763,9 +763,9 @@ int lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S)
CC_SAFE_FREE(arg0);
return 0;
}
cocos2d::Point ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1);
cocos2d::Vector2 ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1);
CC_SAFE_FREE(arg0);
point_to_luaval(tolua_S, ret);
vector2_to_luaval(tolua_S, ret);
return 1;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "getPolyonCenter",argc, 2);
@ -803,9 +803,9 @@ int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S)
argc = lua_gettop(tolua_S)-1;
if (argc == 0)
{
cocos2d::Point arg0[4];
cocos2d::Vector2 arg0[4];
cobj->getPoints(arg0);
points_to_luaval(tolua_S, arg0, 4);
vector2_array_to_luaval(tolua_S, arg0, 4);
return 0;
}
CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "getPoints",argc, 1);
@ -846,9 +846,9 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S)
if (argc == 0)
{
int count = cobj->getPointsCount();
cocos2d::Point* arg0 = new cocos2d::Point[count];
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
points_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -880,10 +880,10 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -900,11 +900,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -921,17 +921,17 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
cocos2d::Point arg3;
cocos2d::Vector2 arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
ok &= luaval_to_physics_material(tolua_S, 3, &arg2);
ok &= luaval_to_point(tolua_S, 4, &arg3);
ok &= luaval_to_vector2(tolua_S, 4, &arg3);
if(!ok)
{
CC_SAFE_FREE(arg0);
@ -967,10 +967,10 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1010,11 +1010,11 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S)
if (argc == 2)
{
double arg0;
cocos2d::Point* arg1;
cocos2d::Vector2* arg1;
int arg2 = 0;
ok &= luaval_to_number(tolua_S, 2,&arg0);
do {
ok = luaval_to_array_of_Point(tolua_S, 3, &arg1, &arg2);
ok = luaval_to_array_of_vector2(tolua_S, 3, &arg1, &arg2);
if (nullptr == arg1){
LUA_PRECONDITION( arg1, "Invalid Native Object");
}} while (0);
@ -1031,16 +1031,16 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S)
if (argc == 2)
{
double arg0;
cocos2d::Point* arg1;
cocos2d::Vector2* arg1;
int arg2 = 0;
cocos2d::Point arg3;
cocos2d::Vector2 arg3;
ok &= luaval_to_number(tolua_S, 2,&arg0);
do {
ok = luaval_to_array_of_Point(tolua_S, 3, &arg1, &arg2);
ok = luaval_to_array_of_vector2(tolua_S, 3, &arg1, &arg2);
if (nullptr == arg1){
LUA_PRECONDITION( arg1, "Invalid Native Object");
}} while (0);
ok &= luaval_to_point(tolua_S, 4, &arg3);
ok &= luaval_to_vector2(tolua_S, 4, &arg3);
if(!ok)
{
CC_SAFE_FREE(arg1);
@ -1087,9 +1087,9 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S)
if (argc == 0)
{
int count = cobj->getPointsCount();
cocos2d::Point* arg0 = new cocos2d::Point[count];
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
points_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1131,9 +1131,9 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S)
if (argc == 0)
{
int count = cobj->getPointsCount();
cocos2d::Point* arg0 = new cocos2d::Point[count];
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
points_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1175,9 +1175,9 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S)
if (argc == 0)
{
int count = cobj->getPointsCount();
cocos2d::Point* arg0 = new cocos2d::Point[count];
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
points_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1313,10 +1313,10 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1332,11 +1332,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1353,12 +1353,12 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
double arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1400,10 +1400,10 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S)
if (argc == 1)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1419,11 +1419,11 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S)
}
if (argc == 2)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);
@ -1440,12 +1440,12 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S)
}
if (argc == 3)
{
cocos2d::Point* arg0;
cocos2d::Vector2* arg0;
int arg1 = 0;
cocos2d::PhysicsMaterial arg2;
double arg3;
do {
ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);
ok = luaval_to_array_of_vector2(tolua_S, 2, &arg0, &arg1);
if (nullptr == arg0){
LUA_PRECONDITION( arg0, "Invalid Native Object");
}} while (0);