mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-28 16:06:28 +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;
|
import net.minecraft.core.Vec3i;
|
||||||
|
|
||||||
public interface Engine extends InstancerProvider {
|
public interface Engine extends InstancerProvider {
|
||||||
|
/**
|
||||||
|
* Create a plan that will be executed every frame.
|
||||||
|
* @return A new plan.
|
||||||
|
*/
|
||||||
Plan<RenderContext> createFramePlan();
|
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 renderStage(TaskExecutor executor, RenderContext context, RenderStage stage);
|
||||||
|
|
||||||
void renderCrumblingInstance(TaskExecutor taskExecutor, RenderContext context, Instance instance, int progress);
|
void renderCrumblingInstance(TaskExecutor taskExecutor, RenderContext context, Instance instance, int progress);
|
||||||
|
@ -25,7 +35,15 @@ public interface Engine extends InstancerProvider {
|
||||||
*/
|
*/
|
||||||
boolean updateRenderOrigin(Camera camera);
|
boolean updateRenderOrigin(Camera camera);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The current render origin.
|
||||||
|
*/
|
||||||
Vec3i renderOrigin();
|
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 {
|
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.
|
* @return An instancer for the given instance type, model, and render stage.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class BatchingEngine extends AbstractEngine implements SimplyComposedPlan
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidate() {
|
public void delete() {
|
||||||
instancers.clear();
|
instancers.clear();
|
||||||
|
|
||||||
meshPools.values()
|
meshPools.values()
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class IndirectEngine extends AbstractEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidate() {
|
public void delete() {
|
||||||
drawManager.invalidate();
|
drawManager.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class InstancingEngine extends AbstractEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invalidate() {
|
public void delete() {
|
||||||
drawManager.invalidate();
|
drawManager.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,6 +249,6 @@ public class VisualizationManagerImpl implements VisualizationManager {
|
||||||
blockEntities.invalidate();
|
blockEntities.invalidate();
|
||||||
entities.invalidate();
|
entities.invalidate();
|
||||||
effects.invalidate();
|
effects.invalidate();
|
||||||
engine.invalidate();
|
engine.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue