Skip to content

Commit

Permalink
Creation is change
Browse files Browse the repository at this point in the history
- Indirect instancers mark pages as changed when instances are added
  • Loading branch information
Jozufozu committed Sep 21, 2024
1 parent 5b6463b commit 90e088a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void stealInstance(@Nullable I instance) {
private void addLocked(I instance, InstanceHandleImpl<I> handle) {
instances.add(instance);
handles.add(handle);
changed.set(handle.index);
setIndexChanged(handle.index);
}

public int instanceCount() {
Expand All @@ -105,6 +105,10 @@ public void notifyDirty(int index) {
if (index < 0 || index >= instanceCount()) {
return;
}
setIndexChanged(index);
}

protected void setIndexChanged(int index) {
changed.set(index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ public IndirectInstancer(InstancerKey<I> key, Supplier<AbstractInstancer<I>> rec
}

@Override
public void notifyDirty(int index) {
if (index < 0 || index >= instanceCount()) {
return;
}
public void setIndexChanged(int index) {
changedPages.set(ObjectStorage.objectIndex2PageIndex(index));
}

Expand Down

0 comments on commit 90e088a

Please sign in to comment.