Split up BlockInfo type

By storing block types and depth values separately, the processed world
data can be compressed better, decreasing data size by ~10%.
This commit is contained in:
Matthias Schiffer 2023-05-06 00:44:00 +02:00
parent 0b392d7a3a
commit 31eb92864c
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
4 changed files with 45 additions and 43 deletions

View file

@ -1,14 +1,18 @@
use std::path::{Path, PathBuf};
use minedmap::{types::*, world};
use serde::{Deserialize, Serialize};
use minedmap::{types::*, world::layer};
pub type RegionCoords = (i32, i32);
pub type ProcessedRegion = ChunkArray<
Option<(
Box<world::layer::BlockInfoArray>,
Box<world::layer::BiomeArray>,
)>,
>;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProcessedChunk {
pub blocks: Box<layer::BlockArray>,
pub biomes: Box<layer::BiomeArray>,
pub depths: Box<layer::DepthArray>,
}
pub type ProcessedRegion = ChunkArray<Option<ProcessedChunk>>;
pub struct Config {
pub region_dir: PathBuf,