2016-12-07 02:28:22 +00:00
|
|
|
|
|
|
|
var ImageWebGLRenderer = function (renderer, src, interpolationPercentage)
|
|
|
|
{
|
|
|
|
var frame = src.frame;
|
|
|
|
var alpha = src.color.worldAlpha * 255 << 24;
|
|
|
|
|
|
|
|
// Skip rendering?
|
|
|
|
|
|
|
|
if (src.skipRender || !src.visible || alpha === 0 || !frame.cutWidth || !frame.cutHeight)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-16 22:43:46 +00:00
|
|
|
var verts = src.transform.getVertexData(interpolationPercentage, renderer);
|
2016-12-07 02:28:22 +00:00
|
|
|
var index = src.frame.source.glTextureIndex;
|
|
|
|
var tint = src.color._glTint;
|
|
|
|
var bg = src.color._glBg;
|
|
|
|
|
|
|
|
renderer.batch.add(frame.source, src.blendMode, verts, frame.uvs, index, alpha, tint, bg);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ImageWebGLRenderer;
|