diff --git a/Cargo.lock b/Cargo.lock index 04069ce..357010e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -883,19 +883,18 @@ dependencies = [ [[package]] name = "image" -version = "0.21.3" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "gif 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "jpeg-decoder 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "png 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tiff 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1407,13 +1406,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "png" -version = "0.14.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "deflate 0.7.20 (registry+https://github.com/rust-lang/crates.io-index)", "inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2072,7 +2071,7 @@ dependencies = [ "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "glutin 0.21.0 (git+https://github.com/iceiix/glutin?rev=1e48d3216ed692596983a7b053caf8c73e6bbf22)", "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.21.3 (registry+https://github.com/rust-lang/crates.io-index)", + "image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2200,7 +2199,7 @@ dependencies = [ [[package]] name = "tiff" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2856,7 +2855,7 @@ dependencies = [ "checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum image 0.21.3 (registry+https://github.com/rust-lang/crates.io-index)" = "35371e467cd7b0b3d1d6013d619203658467df12d61b0ca43cd67b743b1965eb" +"checksum image 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4be8aaefbe7545dc42ae925afb55a0098f226a3fe5ef721872806f44f57826" "checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" "checksum inflate 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" @@ -2916,7 +2915,7 @@ dependencies = [ "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum png 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "63daf481fdd0defa2d1d2be15c674fbfa1b0fd71882c303a91f9a79b3252c359" +"checksum png 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "247cb804bd7fc86d0c2b153d1374265e67945875720136ca8fe451f11c6aed52" "checksum podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "780fb4b6698bbf9cf2444ea5d22411cef2953f0824b98f33cf454ec5615645bd" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" "checksum proc-macro-error 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "53c98547ceaea14eeb26fcadf51dc70d01a2479a7839170eae133721105e4428" @@ -2995,7 +2994,7 @@ dependencies = [ "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum tiff 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4834f28a0330cb9f3f2c87d2649dca723cb33802e2bdcf18da32759fbec7ce" +"checksum tiff 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" diff --git a/Cargo.toml b/Cargo.toml index d5251b4..f10744a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ serde = "1.0.104" serde_json = "1.0.44" flate2 = { version = "1.0.13", features = ["rust_backend"], default-features = false } zip = { version = "0.5.3", features = ["deflate"], default-features = false } -image = "0.21.3" +image = "0.22.3" rand = "0.6.5" rand_xorshift = "0.1.1" hex = "0.4.0" diff --git a/src/model/mod.rs b/src/model/mod.rs index 9bf08c8..67f96e5 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -933,9 +933,9 @@ fn calculate_biome(snapshot: &world::Snapshot, x: i32, z: i32, img: &image::Dyna let col = img.get_pixel(ix as u32, iy as u32); let col = bi.process_color(col); - r += col.data[0] as u32; - g += col.data[1] as u32; - b += col.data[2] as u32; + r += col.0[0] as u32; + g += col.0[1] as u32; + b += col.0[2] as u32; count += 1; } } diff --git a/src/render/mod.rs b/src/render/mod.rs index 57eb9d7..c868c6b 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -942,7 +942,7 @@ impl TextureManager { for x in bl.0 .. (bl.0 + bl.2) { for y in bl.1 .. (bl.1 + bl.3) { let mut col = img.get_pixel(x, y); - col.data[3] = 255; + col.0[3] = 255; img.put_pixel(x, y, col); } } diff --git a/src/render/ui.rs b/src/render/ui.rs index 2c54258..ea1a92d 100644 --- a/src/render/ui.rs +++ b/src/render/ui.rs @@ -273,7 +273,7 @@ impl UIState { let mut start = true; 'x_loop: for x in 0..sw { for y in 0..sh { - let a = img.get_pixel(cx + x, cy + y).data[3]; + let a = img.get_pixel(cx + x, cy + y).0[3]; if start && a != 0 { self.font_character_info[i as usize].0 = x as i32; start = false; diff --git a/src/world/biome.rs b/src/world/biome.rs index e5b0998..9e1c3df 100644 --- a/src/world/biome.rs +++ b/src/world/biome.rs @@ -30,14 +30,14 @@ impl Biome { pub fn process_color(self, col: Rgba) -> Rgba { if self.id == ROOFED_FOREST.id || self.id == ROOFED_FOREST_MOUNTAINS.id { - Rgba { - data: [ - ((col.data[0] as u32 + 0x28) / 2) as u8, - ((col.data[1] as u32 + 0x34) / 2) as u8, - ((col.data[2] as u32 + 0x0A) / 2) as u8, + Rgba ( + [ + ((col.0[0] as u32 + 0x28) / 2) as u8, + ((col.0[1] as u32 + 0x34) / 2) as u8, + ((col.0[2] as u32 + 0x0A) / 2) as u8, 255 ] - } + ) } else { col }