mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
Undo invalidate back to delete
- Makes more sense given how the method is used.
This commit is contained in:
parent
055ac161d8
commit
791c2ddf5c
6 changed files with 26 additions and 6 deletions
|
@ -11,8 +11,18 @@ import net.minecraft.client.Camera;
|
|||
import net.minecraft.core.Vec3i;
|
||||
|
||||
public interface Engine extends InstancerProvider {
|
||||
/**
|
||||
* Create a plan that will be executed every frame.
|
||||
* @return A new plan.
|
||||
*/
|
||||
Plan<RenderContext> createFramePlan();
|
||||
|
||||
/**
|
||||
* Render all instances necessary for the given stage.
|
||||
* @param executor The task executor running the frame plan.
|
||||
* @param context The render context for this frame.
|
||||
* @param stage The stage to render.
|
||||
*/
|
||||
void renderStage(TaskExecutor executor, RenderContext context, RenderStage stage);
|
||||
|
||||
void renderCrumblingInstance(TaskExecutor taskExecutor, RenderContext context, Instance instance, int progress);
|
||||
|
@ -25,7 +35,15 @@ public interface Engine extends InstancerProvider {
|
|||
*/
|
||||
boolean updateRenderOrigin(Camera camera);
|
||||
|
||||
/**
|
||||
* @return The current render origin.
|
||||
*/
|
||||
Vec3i renderOrigin();
|
||||
|
||||
void invalidate();
|
||||
/**
|
||||
* Free all resources associated with this engine.
|
||||
* <br>
|
||||
* This engine will not be used again after this method is called.
|
||||
*/
|
||||
void delete();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,9 @@ import com.jozufozu.flywheel.api.model.Model;
|
|||
|
||||
public interface InstancerProvider {
|
||||
/**
|
||||
* Get an instancer for the given instance type, model, and render stage. Calling this method twice with the same arguments will return the same instancer.
|
||||
* Get an instancer for the given instance type, model, and render stage.
|
||||
* <br>
|
||||
* Calling this method twice with the same arguments will return the same instancer.
|
||||
*
|
||||
* @return An instancer for the given instance type, model, and render stage.
|
||||
*/
|
||||
|
|
|
@ -104,7 +104,7 @@ public class BatchingEngine extends AbstractEngine implements SimplyComposedPlan
|
|||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
public void delete() {
|
||||
instancers.clear();
|
||||
|
||||
meshPools.values()
|
||||
|
|
|
@ -90,7 +90,7 @@ public class IndirectEngine extends AbstractEngine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
public void delete() {
|
||||
drawManager.invalidate();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ public class InstancingEngine extends AbstractEngine {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
public void delete() {
|
||||
drawManager.invalidate();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -249,6 +249,6 @@ public class VisualizationManagerImpl implements VisualizationManager {
|
|||
blockEntities.invalidate();
|
||||
entities.invalidate();
|
||||
effects.invalidate();
|
||||
engine.invalidate();
|
||||
engine.delete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue