Преглед изворни кода

renderers are now destroyed at the right time if offscreen

tags/v0.1.4^2
Shaun пре 7 година
родитељ
комит
0b563bc493
1 измењених фајлова са 16 додато и 1 уклоњено
  1. +16
    -1
      src/client/js/rendering/particles.js

+ 16
- 1
src/client/js/rendering/particles.js Прегледај датотеку

@@ -38,13 +38,23 @@ define([
},

update: function() {
var renderer = this.r;
var now = Date.now();

var emitters = this.emitters;
var eLen = emitters.length;
for (var i = 0; i < eLen; i++) {
var e = emitters[i];
var destroy = ((!e.emit) && (e.particleCount == 0));

var visible = null;
var destroy = !e.emit;
if (destroy) {
if (e.particleCount > 0) {
visible = renderer.isVisible(e.spawnPos.x, e.spawnPos.y);
if (visible)
destroy = false;
}
}

if (destroy) {
emitters.splice(i, 1);
@@ -56,6 +66,11 @@ define([
continue;
}

if (visible === null)
visible = renderer.isVisible(e.spawnPos.x, e.spawnPos.y);
if (!visible)
continue;

var r = e.update((now - this.lastTick) * 0.001);
r.forEach(function(rr) {
if (e.blendMode == 'overlay')


Loading…
Откажи
Сачувај