From 2e99712cc8b467a236a8be57e6e43c888ba602e9 Mon Sep 17 00:00:00 2001 From: Matthew Collins Date: Sun, 14 May 2017 10:04:34 +0100 Subject: [PATCH] Update rust-sdl to fix a bug (Fixes #69) --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- src/main.rs | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe211e8..5a48fff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,7 +13,7 @@ dependencies = [ "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "sdl2 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sdl2 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "steven_blocks 0.0.1", @@ -493,20 +493,20 @@ dependencies = [ [[package]] name = "sdl2" -version = "0.16.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "sdl2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sdl2-sys 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sdl2-sys" -version = "0.8.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -744,8 +744,8 @@ dependencies = [ "checksum rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e501871917624668fe601ad12a730450414f9b0b64722a898b040ce3ae1b0fa" "checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -"checksum sdl2 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7f18f5878c752274f527804bdd6698c38d9b20317a0a56db77d84032498941e" -"checksum sdl2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "48bd067cbfaa00649afd649add954e8221af03815e2e261fab6caf274d77c4d1" +"checksum sdl2 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63066036ad426250ac56d23e38fd05063b38b661556acd596f4046cc92d98415" +"checksum sdl2-sys 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b48638b7882759f3421038fcd38ad5f1ea19b119d80c99f1601933004629e34d" "checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1b0e0732aa8ec4267f61815a396a942ba3525062e3bd5520aa8419927cfc0a92" "checksum serde_json 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b22e8a0554f31cb0f501e027de07b253553b308124f61c57598b9678dba35c0b" diff --git a/Cargo.toml b/Cargo.toml index b47895a..9bb309c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ authors = [ "Thinkofdeath " ] opt-level = 1 [dependencies] -sdl2 = "0.16.1" +sdl2 = "0.30.0" byteorder = "0.5.0" hyper = "0.8.0" serde = "0.7.0" diff --git a/src/main.rs b/src/main.rs index 3ad617d..46345c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,7 +292,7 @@ fn handle_window_event(window: &sdl2::video::Window, event: sdl2::event::Event) { use sdl2::event::Event; use sdl2::keyboard::Keycode; - use sdl2::mouse::Mouse; + use sdl2::mouse::MouseButton; use std::f64::consts::PI; let mouse = window.subsystem().sdl().mouse(); @@ -326,7 +326,7 @@ fn handle_window_event(window: &sdl2::video::Window, ui_container.hover_at(game, x as f64, y as f64, width as f64, height as f64); } } - Event::MouseButtonUp{mouse_btn: Mouse::Left, x, y, ..} => { + Event::MouseButtonUp{mouse_btn: MouseButton::Left, x, y, ..} => { let (width, height) = window.size(); if game.server.is_connected() && !game.focused && !game.screen_sys.is_current_closable() { @@ -343,7 +343,7 @@ fn handle_window_event(window: &sdl2::video::Window, ui_container.click_at(game, x as f64, y as f64, width as f64, height as f64); } } - Event::MouseButtonDown{mouse_btn: Mouse::Right, ..} => { + Event::MouseButtonDown{mouse_btn: MouseButton::Right, ..} => { if game.focused { game.server.on_right_click(&mut game.renderer); }