From e26aac4c846bd687d64f342bd67db81482db572f Mon Sep 17 00:00:00 2001 From: jacksonjim Date: Thu, 29 Aug 2013 11:42:34 +0800 Subject: [PATCH] update for StarlingFramework 1.4 rc2 update for StarlingFramework 1.4 rc2 --- .../lighting/core/display/IrregularPolygon.as | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extension/starling/extensions/lighting/core/display/IrregularPolygon.as b/extension/starling/extensions/lighting/core/display/IrregularPolygon.as index e2ce57f..43de604 100644 --- a/extension/starling/extensions/lighting/core/display/IrregularPolygon.as +++ b/extension/starling/extensions/lighting/core/display/IrregularPolygon.as @@ -114,7 +114,10 @@ package starling.extensions.lighting.core.display { support.applyBlendMode(false); context.setProgram(Starling.current.getProgram(PROGRAM_NAME)); context.setVertexBufferAt(0, $vertexBuffer, VertexData.POSITION_OFFSET, Context3DVertexBufferFormat.FLOAT_2); - context.setVertexBufferAt(1, $vertexBuffer, VertexData.COLOR_OFFSET, Context3DVertexBufferFormat.BYTES_4); + // StarlingFramework 1.3 + context.setVertexBufferAt(1, $vertexBuffer, VertexData.COLOR_OFFSET, Context3DVertexBufferFormat.FLOAT_4); + // update for StarlingFramework 1.4 rc1 + //context.setVertexBufferAt(1, $vertexBuffer, VertexData.COLOR_OFFSET, Context3DVertexBufferFormat.BYTES_4); //context.setVertexBufferAt( 0, $vertexBuffer, 0, Context3DVertexBufferFormat.FLOAT_3 ); //va0 is position //context.setVertexBufferAt( 1, $vertexBuffer, 3, Context3DVertexBufferFormat.FLOAT_4 ); //va1 is color context.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, support.mvpMatrix3D, true); @@ -170,7 +173,10 @@ package starling.extensions.lighting.core.display { $indexBuffer.dispose(); $vertexBuffer = context.createVertexBuffer($vertexData.numVertices, VertexData.ELEMENTS_PER_VERTEX); - $vertexBuffer.uploadFromByteArray($vertexData.rawData, 0, 0, $vertexData.numVertices); + // StarlingFramework 1.3 + $vertexBuffer.uploadFromVector($vertexData.rawData, 0, $vertexData.numVertices); + // update for StarlingFramework 1.4 rc1 + //$vertexBuffer.uploadFromByteArray($vertexData.rawData, 0, 0, $vertexData.numVertices); $indexBuffer = context.createIndexBuffer($indexData.length); $indexBuffer.uploadFromVector($indexData, 0, $indexData.length); @@ -218,4 +224,4 @@ package starling.extensions.lighting.core.display { } // } -//===========================================================================^O^ \ No newline at end of file +//===========================================================================^O^