Browse Source

bug[#1584]: fixed an fps issue on maps with many hiders

tags/v0.8.1^2
Shaun 3 years ago
parent
commit
1ac9c4b581
1 changed files with 14 additions and 8 deletions
  1. +14
    -8
      src/client/js/rendering/renderer.js

+ 14
- 8
src/client/js/rendering/renderer.js View File

@@ -486,10 +486,13 @@ define([
rendered.spliceWhere(s => s === sprite);
}

newHidden.push({
x: i,
y: j
});
if (cell.visible) {
cell.visible = false;
newHidden.push({
x: i,
y: j
});
}

const hasFake = cell.some(c => c[0] === '-');
if (hasFake) {
@@ -510,10 +513,13 @@ define([
rendered.spliceWhere(s => s === sprite);
}

newVisible.push({
x: i,
y: j
});
if (!cell.visible) {
cell.visible = true;
newVisible.push({
x: i,
y: j
});
}

const hasNonFake = cell.some(c => c[0] !== '-');
if (hasNonFake) {


Loading…
Cancel
Save