mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-16 03:19:07 +02:00
core/common: separate FileMetaVersion for different outputs
This commit is contained in:
parent
4574c06f5d
commit
fa15a4e6e5
4 changed files with 21 additions and 11 deletions
|
@ -70,8 +70,12 @@ impl<'a> TileMipmapper<'a> {
|
|||
/// Tile width/height
|
||||
const N: u32 = (BLOCKS_PER_CHUNK * CHUNKS_PER_REGION) as u32;
|
||||
|
||||
let version = match kind {
|
||||
TileKind::Map => REGION_FILE_META_VERSION,
|
||||
TileKind::Lightmap => LIGHTMAP_FILE_META_VERSION,
|
||||
};
|
||||
let output_path = self.config.tile_path(kind, level, coords);
|
||||
let output_timestamp = fs::read_timestamp(&output_path, FILE_META_VERSION);
|
||||
let output_timestamp = fs::read_timestamp(&output_path, version);
|
||||
|
||||
let sources: Vec<_> = [(0, 0), (0, 1), (1, 0), (1, 1)]
|
||||
.into_iter()
|
||||
|
@ -145,7 +149,7 @@ impl<'a> TileMipmapper<'a> {
|
|||
);
|
||||
}
|
||||
|
||||
fs::create_with_timestamp(&output_path, FILE_META_VERSION, input_timestamp, |file| {
|
||||
fs::create_with_timestamp(&output_path, version, input_timestamp, |file| {
|
||||
image
|
||||
.write_to(file, image::ImageFormat::Png)
|
||||
.context("Failed to save image")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue