mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-07 16:26:14 +00:00
Performance
This commit is contained in:
@@ -99,22 +99,19 @@ public class IrisEngine extends BlockPopulator implements Engine
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(int x, int z, Hunk<BlockData> vblocks, Hunk<BlockData> postblocks, Hunk<Biome> vbiomes) {
|
||||
public void generate(int x, int z, Hunk<BlockData> vblocks, Hunk<Biome> vbiomes) {
|
||||
try
|
||||
{
|
||||
boolean structures = postblocks != null;
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
Hunk<BlockData> blocks = vblocks.synchronize().listen((xx,y,zz,t) -> catchBlockUpdates(x+xx,y+getMinHeight(),z+zz, t));
|
||||
Hunk<BlockData> pblocks = structures ? postblocks.synchronize().listen((xx,y,zz,t) -> catchBlockUpdates(x+xx,y+getMinHeight(),z+zz, t)) : null;
|
||||
Hunk<BlockData> fringe = structures ? Hunk.fringe(blocks, pblocks) : null;
|
||||
getFramework().getEngineParallax().generateParallaxArea(x>>4, z>>4);
|
||||
getFramework().getBiomeActuator().actuate(x, z, vbiomes);
|
||||
getFramework().getTerrainActuator().actuate(x, z, blocks);
|
||||
getFramework().getCaveModifier().modify(x, z, blocks);
|
||||
getFramework().getRavineModifier().modify(x, z, blocks);
|
||||
getFramework().getPostModifier().modify(x, z, blocks);
|
||||
getFramework().getDecorantActuator().actuate(x, z, structures ? fringe : blocks);
|
||||
getFramework().getEngineParallax().insertParallax(x, z, structures ? fringe : blocks);
|
||||
getFramework().getDecorantActuator().actuate(x, z, blocks);
|
||||
getFramework().getEngineParallax().insertParallax(x, z, blocks);
|
||||
getFramework().getDepositModifier().modify(x, z, blocks);
|
||||
getMetrics().getTotal().put(p.getMilliseconds());
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||
if(engines.length == 1 && !getEngine(0).getTarget().isInverted())
|
||||
{
|
||||
engines[0].generate(x, z, blocks, postblocks, biomes);
|
||||
engines[0].generate(x, z, blocks, biomes);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -229,28 +229,16 @@ public class IrisEngineCompound implements EngineCompound {
|
||||
int doffset = offset;
|
||||
int height = engine.getTarget().getHeight();
|
||||
Hunk<BlockData> cblock = Hunk.newArrayHunk(16, height, 16);
|
||||
Hunk<BlockData> cpblock = structures ? Hunk.newArrayHunk(16, height, 16) : null;
|
||||
Hunk<Biome> cbiome = Hunk.newArrayHunk(16, height, 16);
|
||||
|
||||
if(engine.getTarget().isInverted())
|
||||
{
|
||||
cblock = cblock.invertY();
|
||||
cbiome = cbiome.invertY();
|
||||
|
||||
if(structures)
|
||||
{
|
||||
cpblock = cpblock.invertY();
|
||||
}
|
||||
}
|
||||
|
||||
engine.generate(x, z, cblock, cpblock, cbiome);
|
||||
engine.generate(x, z, cblock, cbiome);
|
||||
blocks.insert(0, doffset, 0, cblock);
|
||||
|
||||
if(structures)
|
||||
{
|
||||
postblocks.insert(0, doffset, 0, cpblock);
|
||||
}
|
||||
|
||||
biomes.insert(0, doffset, 0, cbiome);
|
||||
offset += height;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user