Skip to content

Commit

Permalink
remove argument --frame-rate
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Dec 21, 2023
1 parent ea17cc9 commit 56b9db7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
11 changes: 0 additions & 11 deletions triton-tui/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use clap::Parser;
use crate::utils::version;

const DEFAULT_PROGRAM_PATH: &str = "./program.tasm";
const DEFAULT_FRAME_RATE: f64 = 32.0;

#[derive(Debug, Clone, PartialEq, Parser)]
#[command(author, version = version(), about)]
Expand All @@ -24,15 +23,6 @@ pub(crate) struct Args {
#[arg(short, long, value_name = "PATH")]
/// Path to JSON file containing all non-determinism
pub non_determinism: Option<String>,

#[arg(
short,
long,
value_name = "FLOAT",
default_value_t = DEFAULT_FRAME_RATE
)]
/// Frame rate, i.e. number of frames per second
pub frame_rate: f64,
}

impl Default for Args {
Expand All @@ -41,7 +31,6 @@ impl Default for Args {
program: DEFAULT_PROGRAM_PATH.into(),
input: None,
non_determinism: None,
frame_rate: DEFAULT_FRAME_RATE,
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions triton-tui/src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub(crate) fn io() -> IO {
}

const DEFAULT_TICK_RATE: f64 = 1.0;
const DEFAULT_FRAME_RATE: f64 = 32.0;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub(crate) enum Event {
Expand Down Expand Up @@ -67,7 +68,7 @@ impl Tui {
}

let tick_rate = DEFAULT_TICK_RATE;
let frame_rate = Args::default().frame_rate;
let frame_rate = DEFAULT_FRAME_RATE;
let terminal = Terminal::new(Backend::new(io()))?;
let (event_tx, event_rx) = unbounded_channel();
let cancellation_token = CancellationToken::new();
Expand All @@ -85,8 +86,8 @@ impl Tui {
})
}

pub fn apply_args(&mut self, args: &Args) -> &mut Self {
self.frame_rate(args.frame_rate);
pub fn apply_args(&mut self, _: &Args) -> &mut Self {
self.frame_rate(DEFAULT_FRAME_RATE);
self.mouse(true);
self.paste(true);
self
Expand Down

0 comments on commit 56b9db7

Please sign in to comment.