mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
Use zstd compression level 9
This commit is contained in:
parent
30a41dc2a5
commit
6d12d5c048
1 changed files with 7 additions and 2 deletions
|
|
@ -46,6 +46,8 @@ pub struct World {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const COMP_LEVEL: i32 = 9;
|
||||||
|
|
||||||
impl World {
|
impl World {
|
||||||
pub fn new(spawn_point: WorldPos, name: &str) -> Self {
|
pub fn new(spawn_point: WorldPos, name: &str) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -81,7 +83,10 @@ impl World {
|
||||||
let mut f = File::create(®_file_name).unwrap();
|
let mut f = File::create(®_file_name).unwrap();
|
||||||
// Write an empty existence bitset
|
// Write an empty existence bitset
|
||||||
f.write_all(&[0; 8]).unwrap();
|
f.write_all(&[0; 8]).unwrap();
|
||||||
log::info!("{:?}", f.write_all(&zstd::encode_all(&[][..], 0).unwrap()));
|
log::info!(
|
||||||
|
"{:?}",
|
||||||
|
f.write_all(&zstd::encode_all(&[][..], COMP_LEVEL).unwrap())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let mut f = OpenOptions::new()
|
let mut f = OpenOptions::new()
|
||||||
.read(true)
|
.read(true)
|
||||||
|
|
@ -114,7 +119,7 @@ impl World {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
log::info!(
|
log::info!(
|
||||||
"{:?}",
|
"{:?}",
|
||||||
f.write_all(&zstd::encode_all(&decomp[..], 0).unwrap())
|
f.write_all(&zstd::encode_all(&decomp[..], COMP_LEVEL).unwrap())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue