53a0f24600
treewide: update to bincode 2
...
Consistently use bincode's Encode/Decode to avoid issues with
incompatible serde features. Support for storing some temporary files as
JSON is removed.
The size of the "processed" directory is reduced by ~8% with the new
default encoding of bincode 2. Performance is more or less unaffected.
2025-03-13 21:50:50 +01:00
a10151a4f3
resource, world: implement fallback to plains for unknown biomes
...
Closes #63
2025-02-11 23:00:21 +01:00
4933d8e15f
treewide: clippy fixes
...
Fix all clippy warnings as of Rust 1.83.0.
2024-12-17 00:24:56 +01:00
8814dcff89
resource: split BlockType in Copy and !Copy parts
...
Preparation for actually adding !Copy fields to BlockType.
Only the Copy parts are added to the processed data, avoiding .clone()
for the most part.
2024-01-10 22:56:29 +01:00
05a8056cbf
Add documentation comments for all items
2023-08-20 11:21:29 +02:00
7d231b92ea
Format let-else blocks
...
Use nightly rustfmt to format let-else.
2023-08-05 10:46:47 +02:00
fb712cd2f5
Store per-region biome list in IndexSet
...
Index into the biome list instead of duplicating the biome data for each
coordinate. This reduces the size of the processed data and speeds up
encoding/decoding.
2023-08-03 23:07:16 +02:00
42cb342749
world/layer: avoid iproduct-based iterator in inner loop
...
iproduct iterators are fairly slow. As the iterator implementation is
now unused, it is removed as well.
2023-05-10 00:48:53 +02:00
31eb92864c
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%.
2023-05-06 00:52:40 +02:00
0b392d7a3a
world/layer: move more top_layer() logic into LayerEntry::fill()
2023-05-06 00:33:34 +02:00
0437ec70b6
world/layer: introduce LayerEntry struct
2023-05-06 00:33:13 +02:00
2d5eec13c2
world/layer: move Option into BlockInfo struct
...
Preparation for top_layer() cleanup.
2023-05-05 23:29:57 +02:00
263fc6d6ce
world/layer: remove unused y coordinate from BlockInfo
2023-05-05 23:15:34 +02:00
924ee01f91
world/layer: introduce LayerData struct to fix clippy type complexity warning
2023-05-05 23:08:39 +02:00
e912f60ba3
world/layer: add biome data to returned layer
2023-04-09 22:56:02 +02:00
0d2c99dacf
world/chunk: include biomes in section iterator item
2023-04-08 21:20:00 +02:00
bcec704d27
main: add height-based color modification
...
Modify terrain color depending on the height to give a sense of
elevation.
2023-03-04 21:45:59 +01:00
116e7e5fb6
world/layer: collect block light data with top layer
2023-03-04 20:36:05 +01:00
4fd316f3fc
world/layer: return None from top_layer() for empty chunks
...
Allow ignoring these chunks for the light map as well.
2023-03-04 20:33:10 +01:00
51602d5fc1
world/chunk: add block light to section iterator items
2023-03-04 17:38:56 +01:00
47dc3795a3
world: introduce SectionIterItem struct
2023-03-04 16:57:59 +01:00
26555f1745
src/world/layer: make BlockInfo fields public
...
There were left private by accident.
2023-03-03 20:36:09 +01:00
1d4c7a86ff
world/layer: replace iproduct!() with nested loops
...
iproduct!() is slow for more than 2 parameters.
2023-03-02 01:00:55 +01:00
5c82b80924
world/section: replace block_id_at() method with block_at()
...
Directly return a BlockType, preparing for early lookup of palettes.
2023-03-02 00:31:34 +01:00
4c2fd6c1a9
resource: rename BlockTypeMap to BlockTypes
...
The block_types() function it turned into a Default implementation.
2023-03-01 23:59:27 +01:00
cbbc6d8f35
resource: make BlockTypeMap return BlockType without reference
2023-03-01 21:58:29 +01:00
f47b38b2ca
world/layer: return boxed BlockInfoArray from top_layer()
...
Avoid copying around large structures, and allow creating
arrays of BlockInfoArrays without overflowing the stack.
2023-02-27 19:17:17 +01:00
551056803d
Add Serialize/Deserialize impls to various types
...
We want to be able to store this data to disk temporarily.
2023-02-26 00:46:50 +01:00
f48aa877d2
world: implement top_layer function
...
Implement one of the core functions of MinedMap: finding the topmost
visible block at each coordinate.
2023-02-18 11:51:24 +01:00