mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-12 09:59:05 +02:00
minedmap: separate collection for region list from preprocessing
Preparation for parallel processing, as well as a fix for regions missing from later steps when the initial processing failed (rather than using the processed data from a previous run).
This commit is contained in:
parent
d5ac38ed9b
commit
c1260a63b5
3 changed files with 44 additions and 41 deletions
|
@ -10,7 +10,7 @@ use std::path::PathBuf;
|
|||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
|
||||
use common::{Config, TileCoords};
|
||||
use common::Config;
|
||||
use metadata_writer::MetadataWriter;
|
||||
use region_processor::RegionProcessor;
|
||||
use tile_mipmapper::TileMipmapper;
|
||||
|
@ -28,11 +28,7 @@ fn main() -> Result<()> {
|
|||
let args = Args::parse();
|
||||
let config = Config::new(args);
|
||||
|
||||
let mut regions = RegionProcessor::new(&config).run()?;
|
||||
|
||||
// Sort regions in a zig-zag pattern to optimize cache usage
|
||||
regions.sort_unstable_by_key(|&TileCoords { x, z }| (x, if x % 2 == 0 { z } else { -z }));
|
||||
|
||||
let regions = RegionProcessor::new(&config).run()?;
|
||||
TileRenderer::new(&config).run(®ions)?;
|
||||
let tiles = TileMipmapper::new(&config).run(®ions)?;
|
||||
MetadataWriter::new(&config).run(tiles)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue