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-08-15 22:51:37 +00:00
|
|
|
if (src.renderMask !== src.renderFlags || (src.cameraFilter > 0 && (src.cameraFilter & camera._id)))
|
2017-02-06 16:20:45 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-02-23 03:54:54 +00:00
|
|
|
var list = src.getRenderList();
|
|
|
|
|
2017-02-06 16:20:45 +00:00
|
|
|
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;
|