mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Framework remove parallax
This commit is contained in:
parent
832bad1fee
commit
252d289a8d
@ -24,6 +24,7 @@ import com.volmit.iris.core.gui.components.Renderer;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.IrisComplex;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.engine.mantle.EngineMantle;
|
||||
import com.volmit.iris.engine.object.basic.IrisColor;
|
||||
import com.volmit.iris.engine.object.basic.IrisPosition;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
@ -80,9 +81,9 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
|
||||
void printMetrics(CommandSender sender);
|
||||
|
||||
void recycle();
|
||||
EngineMantle getMantle();
|
||||
|
||||
EngineParallaxManager getEngineParallax();
|
||||
void recycle();
|
||||
|
||||
EngineActuator<BlockData> getTerrainActuator();
|
||||
|
||||
@ -143,13 +144,13 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
EngineMetrics getMetrics();
|
||||
|
||||
default void save() {
|
||||
getParallax().saveAll();
|
||||
getMantle().save();
|
||||
getWorldManager().onSave();
|
||||
saveEngineData();
|
||||
}
|
||||
|
||||
default void saveNow() {
|
||||
getParallax().saveAllNOW();
|
||||
getMantle().saveAllNow();
|
||||
saveEngineData();
|
||||
}
|
||||
|
||||
@ -171,10 +172,6 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
return getTarget().getDimension();
|
||||
}
|
||||
|
||||
default ParallaxAccess getParallax() {
|
||||
return getTarget().getParallaxWorld();
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
default Color draw(double x, double z) {
|
||||
IrisRegion region = getRegion((int) x, (int) z);
|
||||
@ -196,11 +193,6 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
return getComplex().getRegionStream().get(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
default ParallaxAccess getParallaxAccess() {
|
||||
return getParallax();
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
@Override
|
||||
default IrisBiome getCaveBiome(int x, int z) {
|
||||
@ -232,6 +224,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
}
|
||||
|
||||
if (B.isUpdatable(data)) {
|
||||
// TODO: BLOCK UPDATES
|
||||
getParallax().updateBlock(x, y, z);
|
||||
getParallax().getMetaRW(x >> 4, z >> 4).setUpdates(true);
|
||||
}
|
||||
@ -246,6 +239,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
@Override
|
||||
default void updateChunk(Chunk c) {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
// TODO: Mantle block updates
|
||||
if (getParallax().getMetaR(c.getX(), c.getZ()).isUpdates()) {
|
||||
Hunk<Boolean> b = getParallax().getUpdatesR(c.getX(), c.getZ());
|
||||
|
||||
@ -423,7 +417,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
}
|
||||
|
||||
default void clean() {
|
||||
burst().lazy(() -> getParallax().cleanup());
|
||||
burst().lazy(() -> getMantle().trim());
|
||||
}
|
||||
|
||||
@BlockCoordinates
|
||||
|
@ -22,21 +22,15 @@ import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.core.project.loader.IrisData;
|
||||
import com.volmit.iris.engine.object.common.IrisWorld;
|
||||
import com.volmit.iris.engine.object.dimensional.IrisDimension;
|
||||
import com.volmit.iris.engine.parallax.ParallaxWorld;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@Data
|
||||
public class EngineTarget {
|
||||
private final MultiBurst parallaxBurster;
|
||||
private final MultiBurst burster;
|
||||
private final IrisDimension dimension;
|
||||
private IrisWorld world;
|
||||
private final IrisData data;
|
||||
private final ParallaxWorld parallaxWorld;
|
||||
|
||||
public EngineTarget(IrisWorld world, IrisDimension dimension, IrisData data) {
|
||||
this.world = world;
|
||||
@ -45,9 +39,6 @@ public class EngineTarget {
|
||||
this.burster = new MultiBurst("Iris Engine " + dimension.getName(),
|
||||
IrisSettings.get().getConcurrency().getEngineThreadPriority(),
|
||||
IrisSettings.getThreadCount(IrisSettings.get().getConcurrency().getEngineThreadCount()));
|
||||
this.parallaxBurster = new MultiBurst("Iris Parallax Engine " + dimension.getName(), 3, 4);
|
||||
this.parallaxWorld = new ParallaxWorld(parallaxBurster, 256, new File(world.worldFolder(),
|
||||
"iris/" + dimension.getLoadKey() + "/parallax"));
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
@ -56,7 +47,6 @@ public class EngineTarget {
|
||||
}
|
||||
|
||||
public void close() {
|
||||
parallaxBurster.shutdownLater();
|
||||
burster.shutdownLater();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user