Skip to content

Commit cfbcf71

Browse files
committed
Bump image from 0.21.3 to 0.22.3. Closes #238
1 parent 3f5f02d commit cfbcf71

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

Cargo.lock

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ serde = "1.0.104"
3030
serde_json = "1.0.44"
3131
flate2 = { version = "1.0.13", features = ["rust_backend"], default-features = false }
3232
zip = { version = "0.5.3", features = ["deflate"], default-features = false }
33-
image = "0.21.3"
33+
image = "0.22.3"
3434
rand = "0.6.5"
3535
rand_xorshift = "0.1.1"
3636
hex = "0.4.0"

src/model/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,9 @@ fn calculate_biome(snapshot: &world::Snapshot, x: i32, z: i32, img: &image::Dyna
933933

934934
let col = img.get_pixel(ix as u32, iy as u32);
935935
let col = bi.process_color(col);
936-
r += col.data[0] as u32;
937-
g += col.data[1] as u32;
938-
b += col.data[2] as u32;
936+
r += col.0[0] as u32;
937+
g += col.0[1] as u32;
938+
b += col.0[2] as u32;
939939
count += 1;
940940
}
941941
}

src/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ impl TextureManager {
942942
for x in bl.0 .. (bl.0 + bl.2) {
943943
for y in bl.1 .. (bl.1 + bl.3) {
944944
let mut col = img.get_pixel(x, y);
945-
col.data[3] = 255;
945+
col.0[3] = 255;
946946
img.put_pixel(x, y, col);
947947
}
948948
}

src/render/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl UIState {
273273
let mut start = true;
274274
'x_loop: for x in 0..sw {
275275
for y in 0..sh {
276-
let a = img.get_pixel(cx + x, cy + y).data[3];
276+
let a = img.get_pixel(cx + x, cy + y).0[3];
277277
if start && a != 0 {
278278
self.font_character_info[i as usize].0 = x as i32;
279279
start = false;

src/world/biome.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ impl Biome {
3030

3131
pub fn process_color(self, col: Rgba<u8>) -> Rgba<u8> {
3232
if self.id == ROOFED_FOREST.id || self.id == ROOFED_FOREST_MOUNTAINS.id {
33-
Rgba {
34-
data: [
35-
((col.data[0] as u32 + 0x28) / 2) as u8,
36-
((col.data[1] as u32 + 0x34) / 2) as u8,
37-
((col.data[2] as u32 + 0x0A) / 2) as u8,
33+
Rgba (
34+
[
35+
((col.0[0] as u32 + 0x28) / 2) as u8,
36+
((col.0[1] as u32 + 0x34) / 2) as u8,
37+
((col.0[2] as u32 + 0x0A) / 2) as u8,
3838
255
3939
]
40-
}
40+
)
4141
} else {
4242
col
4343
}

0 commit comments

Comments
 (0)