Merge pull request #15272 from cocos2d/revert-15245-fix-function-name

Revert "Fix incorrect function name of getTrianglesCount"
This commit is contained in:
zilongshanren 2016-03-17 16:38:25 +08:00
commit 86ea337efd
3 changed files with 3 additions and 26 deletions

View File

@ -5453,27 +5453,6 @@ bool js_cocos2dx_PolygonInfo_getArea(JSContext *cx, uint32_t argc, jsval *vp)
JS_ReportError(cx, "js_cocos2dx_PolygonInfo_getArea : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_PolygonInfo_getTrianglesCount(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
JS::RootedObject obj(cx, args.thisv().toObjectOrNull());
js_proxy_t *proxy = jsb_get_js_proxy(obj);
cocos2d::PolygonInfo* cobj = (cocos2d::PolygonInfo *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, false, "js_cocos2dx_PolygonInfo_getTrianglesCount : Invalid Native Object");
if (argc == 0)
{
const unsigned int ret = cobj->getTrianglesCount();
jsval jsret = JSVAL_NULL;
jsret = uint32_to_jsval(cx, ret);
args.rval().set(jsret);
return true;
}
JS_ReportError(cx, "js_cocos2dx_PolygonInfo_getTrianglesCount : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
// TODO: The "getTriaglesCount" function is deprecated in favor of "getTrianglesCount".
bool js_cocos2dx_PolygonInfo_getTriaglesCount(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -5493,7 +5472,6 @@ bool js_cocos2dx_PolygonInfo_getTriaglesCount(JSContext *cx, uint32_t argc, jsva
JS_ReportError(cx, "js_cocos2dx_PolygonInfo_getTriaglesCount : wrong number of arguments: %d, was expecting %d", argc, 0);
return false;
}
bool js_cocos2dx_PolygonInfo_getVertCount(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
@ -5652,7 +5630,6 @@ void js_register_cocos2dx_PolygonInfo(JSContext *cx, JS::HandleObject global)
static JSFunctionSpec funcs[] =
{
JS_FN("getArea", js_cocos2dx_PolygonInfo_getArea, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTrianglesCount", js_cocos2dx_PolygonInfo_getTrianglesCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getTriaglesCount", js_cocos2dx_PolygonInfo_getTriaglesCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FN("getVertCount", js_cocos2dx_PolygonInfo_getVertCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),
JS_FS_END

View File

@ -429,7 +429,7 @@ var SpritePolygonPerformanceTestDynamic = SpritePolygonPerformance.extend({
},
initIncrementStats: function () {
this._incVert = this._polygons.getVertCount();
this._incTri = this._polygons.getTrianglesCount();
this._incTri = this._polygons.getTriaglesCount();
this._incPix = this._polygons.getArea();
},
makeSprite: function () {

View File

@ -690,7 +690,7 @@ end
function SpritePolygonPerformanceTestDynamic:initIncrementStats()
self._incVert = self._info:getVertCount()
self._incTri = self._info:getTrianglesCount()
self._incTri = self._info:getTriaglesCount()
self._incPix = self._info:getArea()
end