Creation is change

- Indirect instancers mark pages as changed when instances are added
This commit is contained in:
Jozufozu 2024-09-20 19:14:50 -07:00
parent 5b6463b8f1
commit 90e088aedc
2 changed files with 6 additions and 5 deletions

View File

@ -94,7 +94,7 @@ public abstract class AbstractInstancer<I extends Instance> implements Instancer
private void addLocked(I instance, InstanceHandleImpl<I> 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<I extends Instance> implements Instancer
if (index < 0 || index >= instanceCount()) {
return;
}
setIndexChanged(index);
}
protected void setIndexChanged(int index) {
changed.set(index);
}

View File

@ -37,10 +37,7 @@ public class IndirectInstancer<I extends Instance> extends AbstractInstancer<I>
}
@Override
public void notifyDirty(int index) {
if (index < 0 || index >= instanceCount()) {
return;
}
public void setIndexChanged(int index) {
changedPages.set(ObjectStorage.objectIndex2PageIndex(index));
}