Search in sources :

Example 1 with TeraDenseArray8Bit

use of org.terasology.world.chunks.blockdata.TeraDenseArray8Bit in project Terasology by MovingBlocks.

the class ChunkImpl method prepareForReactivation.

@Override
public void prepareForReactivation() {
    if (disposed) {
        disposed = false;
        sunlightData = new TeraDenseArray8Bit(ChunkConstants.SIZE_X, ChunkConstants.SIZE_Y, ChunkConstants.SIZE_Z);
        sunlightRegenData = new TeraDenseArray8Bit(ChunkConstants.SIZE_X, ChunkConstants.SIZE_Y, ChunkConstants.SIZE_Z);
        lightData = new TeraDenseArray8Bit(ChunkConstants.SIZE_X, ChunkConstants.SIZE_Y, ChunkConstants.SIZE_Z);
    }
}
Also used : TeraDenseArray8Bit(org.terasology.world.chunks.blockdata.TeraDenseArray8Bit)

Example 2 with TeraDenseArray8Bit

use of org.terasology.world.chunks.blockdata.TeraDenseArray8Bit in project Terasology by MovingBlocks.

the class TeraArraysBenchmark method main.

public static void main(String[] args) {
    final List<Benchmark> benchmarks = new LinkedList<>();
    benchmarks.add(new BenchmarkTeraArraySerializeObject(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToBuffer(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToByteString(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToStreamViaByteArray(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    benchmarks.add(new BenchmarkTeraArraySerializeToStreamViaChannel(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayDeserializeFromBuffer(new TeraDenseArray8Bit.SerializationHandler(), new TeraDenseArray8Bit(16, 256, 16)));
    // 
    // 
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraDenseArray4Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraSparseArray8Bit(16, 256, 16, INFLATED_8_BIT, DEFLATED_8_BIT)));
    // benchmarks.add(new BenchmarkTeraArrayRead(new TeraSparseArray4Bit(16, 256, 16, INFLATED_4_BIT, DEFLATED_4_BIT)));
    // 
    // 
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraDenseArray8Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraDenseArray4Bit(16, 256, 16)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraSparseArray8Bit(16, 256, 16, INFLATED_8_BIT, DEFLATED_8_BIT)));
    // benchmarks.add(new BenchmarkTeraArrayWrite(new TeraSparseArray4Bit(16, 256, 16, INFLATED_4_BIT, DEFLATED_4_BIT)));
    Benchmarks.execute(benchmarks, new PrintToConsoleCallback());
}
Also used : PrintToConsoleCallback(org.terasology.benchmark.PrintToConsoleCallback) Benchmark(org.terasology.benchmark.Benchmark) TeraDenseArray8Bit(org.terasology.world.chunks.blockdata.TeraDenseArray8Bit) LinkedList(java.util.LinkedList)

Aggregations

TeraDenseArray8Bit (org.terasology.world.chunks.blockdata.TeraDenseArray8Bit)2 LinkedList (java.util.LinkedList)1 Benchmark (org.terasology.benchmark.Benchmark)1 PrintToConsoleCallback (org.terasology.benchmark.PrintToConsoleCallback)1