2017-02-06 16:20:45 +00:00
|
|
|
|
2017-02-21 20:05:18 +00:00
|
|
|
var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, camera)
|
2017-02-06 16:20:45 +00:00
|
|
|
{
|
2017-02-22 22:15:50 +00:00
|
|
|
var worldAlpha = 1; //src.color.worldAlpha;
|
2017-02-13 23:57:32 +00:00
|
|
|
var list = src.getRenderList();
|
2017-02-06 16:20:45 +00:00
|
|
|
|
|
|
|
// Skip rendering?
|
|
|
|
|
2017-02-13 23:57:32 +00:00
|
|
|
if (src.skipRender || !src.visible || worldAlpha === 0 || list.length === 0)
|
2017-02-06 16:20:45 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.resetTransform();
|
|
|
|
renderer.setBlendMode(src.blendMode);
|
2017-02-13 23:57:32 +00:00
|
|
|
|
|
|
|
var ca = renderer.currentAlpha;
|
2017-02-06 16:20:45 +00:00
|
|
|
|
|
|
|
// Render bobs
|
2017-02-13 23:57:32 +00:00
|
|
|
for (var i = 0; i < list.length; i++)
|
2017-02-06 16:20:45 +00:00
|
|
|
{
|
2017-02-13 23:57:32 +00:00
|
|
|
var bob = list[i];
|
2017-02-06 16:20:45 +00:00
|
|
|
|
2017-02-13 23:57:32 +00:00
|
|
|
if (ca !== bob.alpha)
|
|
|
|
{
|
|
|
|
ca = renderer.setAlpha(bob.alpha);
|
|
|
|
}
|
2017-02-06 16:20:45 +00:00
|
|
|
|
2017-02-21 20:05:18 +00:00
|
|
|
renderer.blitImage(bob.x, bob.y, bob.frame, camera);
|
2017-02-06 16:20:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = BlitterCanvasRenderer;
|