Use proper fps in voxygen graphics settings tab

This commit is contained in:
Imbris 2020-09-19 02:40:47 -04:00
parent f22ee945ec
commit b31df2f34e

View File

@ -566,7 +566,6 @@ pub struct Hud {
tab_complete: Option<String>, tab_complete: Option<String>,
pulse: f32, pulse: f32,
velocity: f32, velocity: f32,
fps: f32,
voxygen_i18n: std::sync::Arc<VoxygenLocalization>, voxygen_i18n: std::sync::Arc<VoxygenLocalization>,
slot_manager: slots::SlotManager, slot_manager: slots::SlotManager,
hotbar: hotbar::State, hotbar: hotbar::State,
@ -662,7 +661,6 @@ impl Hud {
force_chat_cursor: None, force_chat_cursor: None,
tab_complete: None, tab_complete: None,
pulse: 0.0, pulse: 0.0,
fps: 0.0,
velocity: 0.0, velocity: 0.0,
voxygen_i18n, voxygen_i18n,
slot_manager, slot_manager,
@ -695,9 +693,7 @@ impl Hud {
// pulse time for pulsating elements // pulse time for pulsating elements
self.pulse = self.pulse + dt.as_secs_f32(); self.pulse = self.pulse + dt.as_secs_f32();
// FPS // FPS
// TODO Get actual FPS from session.rs instead of TPS from the client as they let fps = global_state.clock.get_tps();
// may be different in the future
self.fps = 1.0 / client.state().get_delta_time();
let version = format!( let version = format!(
"{}-{}", "{}-{}",
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
@ -1872,7 +1868,7 @@ impl Hud {
&self.imgs, &self.imgs,
&self.fonts, &self.fonts,
&self.voxygen_i18n, &self.voxygen_i18n,
self.fps, fps as f32,
) )
.set(self.ids.settings_window, ui_widgets) .set(self.ids.settings_window, ui_widgets)
{ {