ed422be451
TODO.md: update
...
- fastnbt decode doesn't really appear in profiles, so optimizing it
using borrowed types is moot
- What does appear prominently in the profile though is top_layer() and
block_at()
2023-03-04 11:39:47 +01:00
56573640fd
world/section: prefer slice references to Vec and fastnbt types
...
Makes the code a bit nicer and saves repeated deref calls into fastnbt.
2023-03-04 00:36:58 +01:00
a4b726992a
io/storage: compress/decompress data in bulk
...
The bulk API is signifiantly faster than the stream API.
2023-03-03 20:58:35 +01:00
fa04e3e94a
main: actually render tiles
2023-03-03 20:41:08 +01:00
26555f1745
src/world/layer: make BlockInfo fields public
...
There were left private by accident.
2023-03-03 20:36:09 +01:00
e6e1f55fe9
Use zlib-ng backend for flate2 by default
...
Still allow disabling the feature to avoid the cmake dependency.
2023-03-03 20:00:03 +01:00
d5406851b4
main: load processed regions from render_tile()
2023-03-03 19:45:24 +01:00
89f35024b7
main: introduce ProcessedRegion type alias
2023-03-03 19:45:00 +01:00
e0467de080
main: rename save_region() argument from region to coords
...
For consistency.
2023-03-03 19:22:45 +01:00
657d8af8a7
io/storage: add read() function
2023-03-03 19:20:56 +01:00
dda81546de
main: add map_path() method to Config struct
2023-03-03 19:13:15 +01:00
51a0e178b1
main: do not rebuild region filename from coords
2023-03-03 19:06:54 +01:00
2ccb282f6f
main: rename Paths to Config
2023-03-03 19:02:55 +01:00
ec09afcf15
main: fully print error messages
2023-03-02 01:23:24 +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
ed5fb9a6cf
resource: remove LEGACY_BLOCK_TYPES reexport
...
As the array is only used internally now, we can also remove the
"minecraft:" prefix from the entries.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2023-03-02 00:41:39 +01:00
04bc3e5d53
world/section: perform palette lookups early
...
Look up block types for all palette entries once during section
construction, rather than on block_at(), reducing the number of HashMap
lookups by ~1000.
2023-03-02 00:37:25 +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
f2ab424590
world: store BlockTypes in section types
...
Prepare for sections returning BlockType data directly instead of block IDs.
2023-03-02 00:24:59 +01:00
89af4aaee2
resource: extend BlockTypes with legacy block type data
...
Allow to directly map from id/data values to BlockType.
2023-03-02 00:24:56 +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
95e4e45974
resource: remove "minecraft:" prefix from hash keys
...
Shorter keys mean less data to hash.
2023-03-01 22:03:09 +01:00
483cdf48c8
resource: update block_types with Minecraft 1.19.2 data
...
An older Minecraft version had been used to generate the data for the
Rust rewrite by accident.
2023-03-01 22:01:30 +01:00
cbbc6d8f35
resource: make BlockTypeMap return BlockType without reference
2023-03-01 21:58:29 +01:00
0673c89bd8
main: add stub tile renderer struct
...
This only prints messages so far.
2023-03-01 21:45:38 +01:00
73b13c1afb
main: move path handling to separate struct
2023-03-01 21:02:24 +01:00
c5ca1d9821
main: pass region_dir to RegionProcessor::new(), consume when processing
2023-03-01 19:27:09 +01:00
a2ba7e4738
main: build processed_dir path outside of RegionProcessor::new()
2023-03-01 19:17:50 +01:00
ea604b88f2
main: rename regiondir variable to region_dir
...
For consistency with other _dir variables.
2023-03-01 19:17:04 +01:00
ca6afa0cf9
main: return list of region coordinates from process_region_dir()
2023-03-01 19:16:09 +01:00
194715ad09
main: store processed region data
2023-03-01 00:13:06 +01:00
e02a1fc0c9
main: collect processed chunks in array
2023-03-01 00:11:42 +01:00
18cecb947e
main: factor out process_chunk() method
2023-03-01 00:09:11 +01:00
d77dcce778
main: print message when processing region
2023-03-01 00:06:48 +01:00
447a9482fe
main: create output directory for processed data files
2023-03-01 00:02:23 +01:00
04ab8c321f
main: fix formatting
...
rustfmt still doesn't handle let-else...
2023-03-01 00:00:40 +01:00
b68f04496c
main: introduce RegionCoords type alias
2023-02-28 23:57:48 +01:00
768ab13205
main: rename savedir argument to input_dir
2023-02-28 23:54:21 +01:00
21fd3a42ca
io: add storage helper
...
Use bincode+zstd to serialize data structures for temporary storage.
2023-02-28 21:59:45 +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
fd0c9fbf1b
main: improve process_region() error handling
2023-02-26 01:11:59 +01:00
b2d849081d
io/region: allow stopping foreach_chunk early
...
Errors returned from the callback stop the loop early.
2023-02-26 01:01:37 +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
2d0f2fb865
main: iterate over regions of a Minecraft save dir
2023-02-25 17:46:00 +01:00
f3a6711458
Update dependencies
2023-02-25 13:30:58 +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
2530a557a9
types: fix dangling doc reference
2023-02-18 11:08:45 +01:00
decb5c67a6
world/section: to not use u128 type
...
Getting the block index for unaligned blocks can be done just fine with
only u64.
2023-02-18 10:57:11 +01:00
3ef48783b7
types: introduce LayerBlockArray
...
A LayerBlockArray is a generic array of data stored for each block of a
chunk layer. It provides the same methods as a ChunkArray.
2023-02-15 00:49:07 +01:00
789a4002c7
types: add Clone + Debug to ChunkArray iterators
...
Added for consistency with LayerBlockArray.
2023-02-15 00:48:30 +01:00