Replace `vec2s` with `points`

This commit is contained in:
samuele3hu 2014-04-29 14:39:19 +08:00
parent 84c1f9281e
commit ae488e5afa
5 changed files with 20 additions and 20 deletions

View File

@ -1059,7 +1059,7 @@ bool luaval_to_dictionary(lua_State* L,int lo, __Dictionary** outValue)
return ok;
}
bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **vec2s, int *numPoints)
bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **points, int *numPoints)
{
if (NULL == L)
return false;
@ -1108,7 +1108,7 @@ bool luaval_to_array_of_vector2(lua_State* L,int lo,cocos2d::Vector2 **vec2s, in
}
*numPoints = (int)len;
*vec2s = array;
*points = array;
}
}
return ok;
@ -1611,7 +1611,7 @@ bool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret)
return ok;
}
void vector2s_to_luaval(lua_State* L,const cocos2d::Vector2* vec2s, int count)
void vector2_array_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count)
{
if (NULL == L)
return;
@ -1619,7 +1619,7 @@ void vector2s_to_luaval(lua_State* L,const cocos2d::Vector2* vec2s, int count)
for (int i = 1; i <= count; ++i)
{
lua_pushnumber(L, i);
vector2_to_luaval(L, vec2s[i-1]);
vector2_to_luaval(L, points[i-1]);
lua_rawset(L, -3);
}
}
@ -1720,7 +1720,7 @@ void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data)
lua_newtable(L); /* L: table */
lua_pushstring(L, "points");
vector2s_to_luaval(L, data->points, data->count);
vector2_array_to_luaval(L, data->points, data->count);
lua_rawset(L, -3);
lua_pushstring(L, "normal");

View File

@ -72,7 +72,7 @@ extern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outVa
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_vector2(lua_State* L,int lo,cocos2d::Vector2 **vec2s, 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);
@ -87,9 +87,9 @@ CC_DEPRECATED_ATTRIBUTE static inline bool luaval_to_kmMat4(lua_State* L, int lo
{
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 **vec2s, int *numPoints)
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, vec2s, numPoints);
return luaval_to_array_of_vector2(L, lo, points, numPoints);
}
@ -234,7 +234,7 @@ bool luaval_to_object(lua_State* L, int lo, const char* type, T** ret)
// from native
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 vector2s_to_luaval(lua_State* L,const cocos2d::Vector2* vec2s, 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);
@ -254,9 +254,9 @@ CC_DEPRECATED_ATTRIBUTE static inline void point_to_luaval(lua_State* L,const co
vector2_to_luaval(L, pt);
}
CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vector2* vec2s, int count)
CC_DEPRECATED_ATTRIBUTE static inline void points_to_luaval(lua_State* L,const cocos2d::Vector2* points, int count)
{
vector2s_to_luaval(L, vec2s, count);
vector2_array_to_luaval(L, points, count);
}
template <class T>

View File

@ -1 +1 @@
4c2032afb137794b21c6d86f4863711dc87cafd5
8691f7305315a37ee7e7563c19d10ea5eacf15c0

View File

@ -1 +1 @@
d0822b6a75abfc606b157f3e6160bd6af79d653f
d69918a19fbb23604827b6a99526d3231f6a3497

View File

@ -699,7 +699,7 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1);
vector2s_to_luaval(tolua_S, arg0, arg1);
vector2_array_to_luaval(tolua_S, arg0, arg1);
CC_SAFE_FREE(arg0);
return 0;
@ -721,7 +721,7 @@ int lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)
return 0;
}
cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2);
vector2s_to_luaval(tolua_S, arg0, arg1);
vector2_array_to_luaval(tolua_S, arg0, arg1);
CC_SAFE_FREE(arg0);
return 0;
}
@ -805,7 +805,7 @@ int lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S)
{
cocos2d::Vector2 arg0[4];
cobj->getPoints(arg0);
vector2s_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);
@ -848,7 +848,7 @@ int lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S)
int count = cobj->getPointsCount();
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
vector2s_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1089,7 +1089,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S)
int count = cobj->getPointsCount();
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
vector2s_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1133,7 +1133,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S)
int count = cobj->getPointsCount();
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
vector2s_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}
@ -1177,7 +1177,7 @@ int lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S)
int count = cobj->getPointsCount();
cocos2d::Vector2* arg0 = new cocos2d::Vector2[count];
cobj->getPoints(arg0);
vector2s_to_luaval(tolua_S, arg0, count);
vector2_array_to_luaval(tolua_S, arg0, count);
CC_SAFE_FREE(arg0);
return 0;
}