diff options
feat: More feature=32k
-rw-r--r-- | src/main.rs | 4 | ||||
-rw-r--r-- | src/render.rs | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 0925bd4..edd7f87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use std::time::{Duration, SystemTime}; use sdl2::{event::Event, keyboard::Keycode}; -#[cfg(not(feature = "notimeout"))] +#[cfg(all(not(feature = "notimeout"), not(feature = "32k")))] const TIMEOUT_DEATH: f64 = render::JUST_DVD + 20.0; pub fn main() { @@ -39,7 +39,7 @@ pub fn main() { .expect("Time went back between frames"); let time = f64::from(time.as_millis() as u32) / 1000.0; - #[cfg(not(feature = "notimeout"))] + #[cfg(all(not(feature = "notimeout"), not(feature = "32k")))] if time > TIMEOUT_DEATH { break 'running; } diff --git a/src/render.rs b/src/render.rs index be8adbc..298b7ed 100644 --- a/src/render.rs +++ b/src/render.rs @@ -30,7 +30,9 @@ pub const START_UWUSPACE: f64 = 0.0; pub const START_BOUNCE: f64 = 0.5; pub const START_SIN: f64 = 1.5; pub const START_COMETOCOSIN: f64 = 2.5; +#[cfg(not(feature = "32k"))] pub const SCENE_GREETINGS: f64 = 32.0; +#[cfg(not(feature = "32k"))] pub const JUST_DVD: f64 = SCENE_GREETINGS + 28.0; pub const PRINT_TIME: bool = true; @@ -55,9 +57,13 @@ pub fn render( canvas.set_draw_color(Color::RGB(12, 12, 12)); canvas.clear(); + #[cfg(not(feature = "32k"))] let is_dvd = time_seconds < SCENE_GREETINGS || time_seconds >= JUST_DVD; + #[cfg(feature = "32k")] + let is_dvd = true; if is_dvd { + #[cfg(not(feature = "32k"))] let time_seconds = if time_seconds >= JUST_DVD { time_seconds - JUST_DVD + 15.0 } else { @@ -111,9 +117,17 @@ pub fn render( } } - if time_seconds >= JUST_DVD { + #[cfg(not(feature = "32k"))] + let no_other_rendering = time_seconds >= JUST_DVD; + #[cfg(feature = "32k")] + let no_other_rendering = false; + #[cfg(not(feature = "32k"))] + let is_greetings_scene = time_seconds >= SCENE_GREETINGS; + #[cfg(feature = "32k")] + let is_greetings_scene = false; + if no_other_rendering { // - } else if time_seconds >= SCENE_GREETINGS { + } else if is_greetings_scene { #[cfg(not(feature = "32k"))] { let time_seconds = time_seconds - SCENE_GREETINGS; |