minedmap: rename RegionCoords to TileCoords

With mipmapping, coords will not always correspond to regions anymore.
This commit is contained in:
Matthias Schiffer 2023-07-02 15:11:16 +02:00
parent dede21806c
commit 007ce010d4
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 13 additions and 13 deletions

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
use minedmap::{types::*, world::layer};
pub type RegionCoords = (i32, i32);
pub type TileCoords = (i32, i32);
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProcessedChunk {
@ -21,7 +21,7 @@ pub struct Config {
pub map_dir: PathBuf,
}
fn coord_filename(coords: RegionCoords, ext: &str) -> String {
fn coord_filename(coords: TileCoords, ext: &str) -> String {
format!("r.{}.{}.{}", coords.0, coords.1, ext)
}
@ -40,17 +40,17 @@ impl Config {
}
}
pub fn processed_path(&self, coords: RegionCoords) -> PathBuf {
pub fn processed_path(&self, coords: TileCoords) -> PathBuf {
let filename = coord_filename(coords, "bin");
[&self.processed_dir, Path::new(&filename)].iter().collect()
}
pub fn light_path(&self, coords: RegionCoords) -> PathBuf {
pub fn light_path(&self, coords: TileCoords) -> PathBuf {
let filename = coord_filename(coords, "png");
[&self.light_dir, Path::new(&filename)].iter().collect()
}
pub fn map_path(&self, coords: RegionCoords) -> PathBuf {
pub fn map_path(&self, coords: TileCoords) -> PathBuf {
let filename = coord_filename(coords, "png");
[&self.map_dir, Path::new(&filename)].iter().collect()
}