Skip to content

Commit 2af30b0

Browse files
author
Jean Dumoulin
committed
Defers batch destruction until next update
1 parent 26756aa commit 2af30b0

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

package.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
"compression": "^1.7.4",
6363
"esbuild": "^0.25.8",
6464
"eslint": "^9.32.0",
65+
"eslint-config-prettier": "^10.1.8",
6566
"eslint-plugin-html": "^8.1.1",
66-
"eslint-plugin-react-hooks": "^5.2.0",
67-
"eslint-plugin-react-refresh": "^0.4.19",
67+
"eslint-plugin-n": "^17.21.3",
6868
"express": "^5.1.0",
6969
"globals": "^16.0.0",
7070
"globby": "^14.0.0",
@@ -160,15 +160,6 @@
160160
},
161161
"workspaces": [
162162
"packages/engine",
163-
"packages/widgets",
164-
"packages/sandcastle"
165-
],
166-
"overrides": {
167-
"allotment": {
168-
"use-resize-observer": {
169-
"react": "^19.0.0",
170-
"react-dom": "^19.0.0"
171-
}
172-
}
173-
}
174-
}
163+
"packages/widgets"
164+
]
165+
}

packages/engine/Source/DataSources/StaticGeometryColorBatch.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,17 +468,18 @@ function moveItems(batch, items, time) {
468468
}
469469

470470
function updateItems(batch, items, time, isUpdated) {
471-
let length = items.length;
472-
let i;
473-
for (i = length - 1; i >= 0; i--) {
471+
for (let i = items.length - 1; i >= 0; i--) {
474472
const item = items[i];
475473
if (item.updaters.length === 0) {
476474
items.splice(i, 1);
477475
item.destroy();
478476
}
479477
}
480478

481-
return items.every(item => item.update(time));
479+
return items.reduce(
480+
(isUpdated, item) => isUpdated && item.update(time),
481+
isUpdated,
482+
);
482483
}
483484

484485
StaticGeometryColorBatch.prototype.update = function (time) {

packages/engine/Source/DataSources/StaticGeometryPerMaterialBatch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,10 @@ StaticGeometryPerMaterialBatch.prototype.update = function (time) {
435435
}
436436
}
437437

438-
return items.every(item => item.update(time));
438+
return items.reduce(
439+
(isUpdated, item) => isUpdated && item.update(time),
440+
false,
441+
);
439442
};
440443

441444
StaticGeometryPerMaterialBatch.prototype.getBoundingSphere = function (

packages/engine/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,10 @@ StaticGroundPolylinePerMaterialBatch.prototype.update = function (time) {
381381
}
382382
}
383383

384-
return items.every(item => item.update(time));
384+
return items.reduce(
385+
(isUpdated, item) => isUpdated && item.update(time),
386+
false,
387+
);
385388
};
386389

387390
StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function (

0 commit comments

Comments
 (0)