mirror of https://github.com/axmolengine/axmol.git
Merge pull request #15272 from cocos2d/revert-15245-fix-function-name
Revert "Fix incorrect function name of getTrianglesCount"
This commit is contained in:
commit
86ea337efd
|
@ -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);
|
||||
|
@ -5489,11 +5468,10 @@ bool js_cocos2dx_PolygonInfo_getTriaglesCount(JSContext *cx, uint32_t argc, jsva
|
|||
args.rval().set(jsret);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue