mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1759 from dumganhar/gles20
fixed #1614: DrawNodeTest crashes on JSB.
This commit is contained in:
commit
5b23475451
|
@ -1 +1 @@
|
|||
Subproject commit 2e932705a10756255a226e5faa18891a8ec9d0d0
|
||||
Subproject commit 02729f24fb4a56fa83e9d16b20de8fb6ad7f516e
|
|
@ -2196,23 +2196,32 @@ JSBool js_cocos2dx_CCDrawNode_drawPolygon(JSContext *cx, uint32_t argc, jsval *v
|
|||
if ( argc == 4) {
|
||||
jsval *argvp = JS_ARGV(cx,vp);
|
||||
JSBool ok = JS_TRUE;
|
||||
JSObject *argArray; ccColor4F argFillColor; double argWidth; ccColor4F argBorderColor;
|
||||
JSObject *argArray = NULL;
|
||||
ccColor4F argFillColor = ccc4f(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
double argWidth = 0.0;
|
||||
ccColor4F argBorderColor = ccc4f(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
// Points
|
||||
ok &= JS_ValueToObject(cx, *argvp++, &argArray);
|
||||
if( ! (argArray && JS_IsArrayObject(cx, argArray) ) )
|
||||
{
|
||||
JS_ReportError(cx, "Vertex should be anArray object");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSObject *tmp_arg;
|
||||
ok &= JS_ValueToObject( cx, *argvp++, &tmp_arg );
|
||||
argFillColor = *(ccColor4F*)JS_GetArrayBufferViewData( tmp_arg, cx );
|
||||
// Color 4F
|
||||
argFillColor = jsval_to_cccolor4f(cx, *argvp++);
|
||||
|
||||
// Width
|
||||
ok &= JS_ValueToNumber( cx, *argvp++, &argWidth );
|
||||
|
||||
ok &= JS_ValueToObject( cx, *argvp++, &tmp_arg );
|
||||
argBorderColor = *(ccColor4F*)JS_GetArrayBufferViewData( tmp_arg, cx );
|
||||
// Color Border (4F)
|
||||
argBorderColor = jsval_to_cccolor4f(cx, *argvp++);
|
||||
|
||||
if( ! ok )
|
||||
{
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
{
|
||||
uint32_t l;
|
||||
|
|
Loading…
Reference in New Issue