summaryrefslogtreecommitdiff
path: root/pixel-client/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-03 20:00:18 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-03 20:00:18 +0200
commitdb4587d3ec64b7e28691b43f9d9701939eed94d1 (patch)
tree1005017ea4a5d4e287024eaf08f876c7e34bfbdb /pixel-client/src
parent9ee7eef2919feffe4e0695494d4027e8ec011808 (diff)
downloadhurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar
hurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar.bz2
hurrycurry-db4587d3ec64b7e28691b43f9d9701939eed94d1.tar.zst
update rust toolchain and rust dependencies.
`map_many_mut` and `trait_upcasting` was stabilized.
Diffstat (limited to 'pixel-client/src')
-rw-r--r--pixel-client/src/config.rs2
-rw-r--r--pixel-client/src/game.rs2
-rw-r--r--pixel-client/src/main.rs6
-rw-r--r--pixel-client/src/menu/background.rs4
4 files changed, 7 insertions, 7 deletions
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<PathBuf> {
- 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<Self> {
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 <https://www.gnu.org/licenses/>.
*/
-#![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::<f32>() * 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])
}
}