From db4587d3ec64b7e28691b43f9d9701939eed94d1 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 3 Jun 2025 20:00:18 +0200 Subject: update rust toolchain and rust dependencies. `map_many_mut` and `trait_upcasting` was stabilized. --- pixel-client/src/config.rs | 2 +- pixel-client/src/game.rs | 2 +- pixel-client/src/main.rs | 6 +++--- pixel-client/src/menu/background.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'pixel-client/src') diff --git a/pixel-client/src/config.rs b/pixel-client/src/config.rs index 4d50ae10..96028deb 100644 --- a/pixel-client/src/config.rs +++ b/pixel-client/src/config.rs @@ -30,7 +30,7 @@ pub struct Config { impl Config { pub fn path() -> Result { - Ok(xdg::BaseDirectories::with_prefix("pixelcurry")?.place_config_file("config.toml")?) + Ok(xdg::BaseDirectories::with_prefix("pixelcurry").place_config_file("config.toml")?) } pub fn load() -> Result { let path = Self::path()?; diff --git a/pixel-client/src/game.rs b/pixel-client/src/game.rs index cfac7082..e299cf09 100644 --- a/pixel-client/src/game.rs +++ b/pixel-client/src/game.rs @@ -204,7 +204,7 @@ impl Game { self.players_spatial_index.all(|p1, pos1| { self.players_spatial_index.query(pos1, 2., |p2, _pos2| { if p1 != p2 { - if let [Some(a), Some(b)] = self.players.get_many_mut([&p1, &p2]) { + if let [Some(a), Some(b)] = self.players.get_disjoint_mut([&p1, &p2]) { a.movement.collide(&mut b.movement, dt) } } diff --git a/pixel-client/src/main.rs b/pixel-client/src/main.rs index 1dd34e72..15c08632 100644 --- a/pixel-client/src/main.rs +++ b/pixel-client/src/main.rs @@ -15,27 +15,27 @@ along with this program. If not, see . */ -#![feature(map_many_mut, path_add_extension, iterator_try_collect)] +#![feature(path_add_extension, iterator_try_collect)] use anyhow::{anyhow, Result}; use clap::{Parser, Subcommand}; use config::Config; use game::Game; use hurrycurry_client_lib::network::sync::Network; use hurrycurry_protocol::glam::Vec2; -use strings::set_language; use menu::{ingame::IngameMenu, main::MainMenu}; use profiler::ProfilerOverlay; use render::Renderer; use sdl2::{event::Event, keyboard::KeyboardState, mouse::MouseState, pixels::Color}; use std::time::{Duration, Instant}; +use strings::set_language; pub mod config; pub mod game; pub mod helper; -pub mod strings; pub mod menu; pub mod profiler; pub mod render; +pub mod strings; pub mod tilemap; pub mod ui; diff --git a/pixel-client/src/menu/background.rs b/pixel-client/src/menu/background.rs index 84ec3f34..13cb041d 100644 --- a/pixel-client/src/menu/background.rs +++ b/pixel-client/src/menu/background.rs @@ -23,7 +23,7 @@ use hurrycurry_protocol::{ glam::{IVec2, Vec2}, TileIndex, }; -use rand::{random, seq::IndexedRandom, thread_rng}; +use rand::{random, rng, seq::IndexedRandom}; pub struct MenuBackground { background: Vec2, @@ -54,7 +54,7 @@ impl MenuBackground { let p = Vec2::new(x as f32, y as f32); let w = (-p.length() * 0.15).exp(); let k = ((random::() * w) * BUCKETS.len() as f32) as usize; - if let Some(ti) = BUCKETS[k.min(BUCKETS.len())].choose(&mut thread_rng()) { + if let Some(ti) = BUCKETS[k.min(BUCKETS.len())].choose(&mut rng()) { map.set(IVec2::new(x, y), Some(TileIndex(*ti)), [None; 4]) } } -- cgit v1.2.3-70-g09d2