From 90e088aedc69ddeffb6a7127eabc6c3cf92f85c3 Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Fri, 20 Sep 2024 19:14:50 -0700 Subject: [PATCH] Creation is change - Indirect instancers mark pages as changed when instances are added --- .../flywheel/backend/engine/AbstractInstancer.java | 6 +++++- .../flywheel/backend/engine/indirect/IndirectInstancer.java | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/src/backend/java/dev/engine_room/flywheel/backend/engine/AbstractInstancer.java b/common/src/backend/java/dev/engine_room/flywheel/backend/engine/AbstractInstancer.java index 8938fe080..717e3640d 100644 --- a/common/src/backend/java/dev/engine_room/flywheel/backend/engine/AbstractInstancer.java +++ b/common/src/backend/java/dev/engine_room/flywheel/backend/engine/AbstractInstancer.java @@ -94,7 +94,7 @@ public abstract class AbstractInstancer implements Instancer private void addLocked(I instance, InstanceHandleImpl handle) { instances.add(instance); handles.add(handle); - changed.set(handle.index); + setIndexChanged(handle.index); } public int instanceCount() { @@ -105,6 +105,10 @@ public abstract class AbstractInstancer implements Instancer if (index < 0 || index >= instanceCount()) { return; } + setIndexChanged(index); + } + + protected void setIndexChanged(int index) { changed.set(index); } diff --git a/common/src/backend/java/dev/engine_room/flywheel/backend/engine/indirect/IndirectInstancer.java b/common/src/backend/java/dev/engine_room/flywheel/backend/engine/indirect/IndirectInstancer.java index 26ada98bb..1f1f7005e 100644 --- a/common/src/backend/java/dev/engine_room/flywheel/backend/engine/indirect/IndirectInstancer.java +++ b/common/src/backend/java/dev/engine_room/flywheel/backend/engine/indirect/IndirectInstancer.java @@ -37,10 +37,7 @@ public class IndirectInstancer extends AbstractInstancer } @Override - public void notifyDirty(int index) { - if (index < 0 || index >= instanceCount()) { - return; - } + public void setIndexChanged(int index) { changedPages.set(ObjectStorage.objectIndex2PageIndex(index)); }