From a09799f7828b3ba8149a015e795e0ad39af769dd Mon Sep 17 00:00:00 2001 From: timelessnesses Date: Sun, 31 Dec 2023 12:19:35 +0700 Subject: [PATCH] yeah --- Cargo.lock | 14 +++++++------- Cargo.toml | 2 +- config.json | 2 +- src/main.rs | 3 ++- src/snow.rs | 12 ++++++------ 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e27649..4bd9724 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -349,12 +349,6 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pkg-config" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -464,7 +458,7 @@ checksum = "26bcacfdd45d539fb5785049feb0038a63931aa896c7763a2a12e125ec58bd29" dependencies = [ "cfg-if", "libc", - "pkg-config", + "vcpkg", "version-compare", ] @@ -540,6 +534,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version-compare" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 147cf6a..c2a5e1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ chrono = "0.4.31" chrono-tz = "0.8.4" clap = { version = "4.4.11", features = ["derive"] } rand = "0.8.5" -sdl2 = { version = "0.36.0", features = ["use-pkgconfig", "ttf"], default-features = false } +sdl2 = { version = "0.36.0", features = ["use-vcpkg", "ttf", "static-link"], default-features = false } serde_json = "1.0.108" slicestring = "0.3.3" diff --git a/config.json b/config.json index ce0323a..2dbf200 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "am_pm": false, + "am_pm": true, "clocks": [ "local", "America/Argentina/Buenos_Aires", diff --git a/src/main.rs b/src/main.rs index 6ac93dd..eb1a866 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +// #![windows_subsystem = "windows"] use chrono_tz; use clap::{self, Parser}; use clock::Clock; @@ -448,7 +449,7 @@ fn create_surfaces<'a>( surface_width, surface_height, ); - let s = snow::SnowParticles::new(20, &mut surface); + let s = snow::SnowParticles::new(100, &mut surface); x.push((surface_rect, surface, s)); // println!("{:?}", surface_rect) } diff --git a/src/snow.rs b/src/snow.rs index f0f4c5c..5e9b1dc 100644 --- a/src/snow.rs +++ b/src/snow.rs @@ -17,11 +17,11 @@ impl Snowflake { pub fn new(w: i32, h: i32, size: i32) -> Self { let mut rng = rand::thread_rng(); return Snowflake { - x: rng.gen_range(0..w), - y: 0, - speed: rng.gen_range(1..5), + x: rng.gen_range(0..w+10), + y: -2, + speed: rng.gen_range(1..4), window_height: h, - window_width: w, + window_width: w + 10, size, }; } @@ -30,9 +30,9 @@ impl Snowflake { self.y += self.speed; let mut rng = rand::thread_rng(); if self.y > self.window_height { - self.y = 0; + self.y = -2; self.x = rng.gen_range(0..self.window_width); - self.speed = rng.gen_range(1..3); + self.speed = rng.gen_range(1..4); } }