From 4bf022b28b6c7c35ff61d16459a0bbb558b87ff5 Mon Sep 17 00:00:00 2001 From: Sven Nilsen Date: Fri, 6 Dec 2019 18:17:09 +0100 Subject: [PATCH] Updated "tiled" dependencies Closes https://github.com/PistonDevelopers/piston-examples/issues/451 --- tiled/Cargo.toml | 6 +++--- tiled/src/main.rs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tiled/Cargo.toml b/tiled/Cargo.toml index 799f6cb..357c5a3 100644 --- a/tiled/Cargo.toml +++ b/tiled/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" [dependencies] find_folder = "0.3.0" -piston = "0.33.0" -piston_window = "0.70.0" -tiled = "0.7.2" +piston = "0.49.0" +piston_window = "0.105.0" +tiled = "0.8.1" diff --git a/tiled/src/main.rs b/tiled/src/main.rs index 99f10a6..a23c479 100644 --- a/tiled/src/main.rs +++ b/tiled/src/main.rs @@ -17,7 +17,7 @@ fn main() { let opengl = OpenGL::V3_2; let mut window: PistonWindow = WindowSettings::new("piston: tiled", [600, 600]) .exit_on_esc(true) - .opengl(opengl) + .graphics_api(opengl) .build() .unwrap(); @@ -25,9 +25,10 @@ fn main() { let tile_width = tileset.tile_width; let tile_height = tileset.tile_height; + let ref mut texture_context = window.create_texture_context(); let tilesheet = assets.join(&tileset.images[0].source); let tilesheet = Texture::from_path( - &mut window.factory, + texture_context, &tilesheet, Flip::None, &TextureSettings::new(), @@ -38,7 +39,7 @@ fn main() { let image = Image::new(); while let Some(e) = window.next() { - window.draw_2d(&e, |c, g| { + window.draw_2d(&e, |c, g, _| { clear([0.5; 4], g); for (y, row) in layer.tiles.iter().enumerate().clone() {