~saiko/game

c08ba37459dc9584863a6b7a0c02b77accb02527 — 2xsaiko 7 months ago 9b72bf1
Actually use the fps_limit cvar
1 files changed, 2 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +2 -2
@@ 156,7 156,7 @@ fn start_game(env: Environment) -> ! {
      .with_cvar("string_test", ConVar::of_string("yeah"))
      .with_command("quit", box command(move |_, _, _| { running.store(false, Ordering::Relaxed); }))
      .with_help_text("quit", "quit the game")
      .with_cvar("fps_limit", ConVar::of_int(120, Some(1), None))
      .with_cvar("fps_limit", ConVar::of_int(120, Some(0), None))
      .with_cvar("debug_info", ConVar::of_bool(false))
      .with_help_text("debug_info", "whether to show debug info like fps and player position")
      .with_command("ui_col_border", {


@@ 370,7 370,7 @@ impl Game<'_> {
  }

  fn cycle(&mut self, limit: bool) {
    self.fps.end_frame(if limit { 120 } else { 0 });
    self.fps.end_frame(if limit { self.ce.get_cvar("fps_limit").unwrap().get_int_value().unwrap() as u64 } else { 0 });
    self.draw();

//    let center = LogicalPosition::new(self.window.scaled_width as f64 / 2.0, self.window.scaled_height as f64 / 2.0);