From 70ecefaf3044b4697ab3e1182095947d6dd78dae Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 15 Dec 2021 12:14:57 +0900 Subject: [PATCH] WIP remove yielding in MPDDisplay::update() --- src/display.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/display.rs b/src/display.rs index 0271ec2..bbf7669 100644 --- a/src/display.rs +++ b/src/display.rs @@ -2,7 +2,7 @@ use crate::mpd_handler::MPDHandler; use crate::Opt; use ggez::event::{self, EventHandler}; use ggez::graphics::{self, Color, DrawParam, Drawable, Rect, Text, TextFragment}; -use ggez::timer::{check_update_time, fps, yield_now}; +use ggez::timer::{check_update_time, fps}; use ggez::Context; use ggez::GameError; use std::sync::{Arc, RwLock}; @@ -29,14 +29,8 @@ impl MPDDisplay { impl EventHandler for MPDDisplay { fn update(&mut self, ctx: &mut ggez::Context) -> Result<(), GameError> { - if !check_update_time(ctx, 10) { - yield_now(); - return Ok(()); - } - self.notice_text = Text::new(TextFragment::new(format!("fps is {}", fps(ctx)))); - yield_now(); Ok(()) }