From 754ebf34cbb6280ef77421e1ca54d35d727dc6f7 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 18 Nov 2023 17:37:57 +0100 Subject: debug and better search --- flowy/src/main.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'flowy/src/main.rs') diff --git a/flowy/src/main.rs b/flowy/src/main.rs index 6620ed8..8529f2c 100644 --- a/flowy/src/main.rs +++ b/flowy/src/main.rs @@ -5,7 +5,8 @@ use log::{debug, info}; use motion::{dec::MotionDecoder, enc::MotionEncoder, CommonBuffers, Params}; use pollster::FutureExt; use std::{ - io::{stdin, stdout, Read, Write}, + io::{stdin, stdout, ErrorKind, Read, Write}, + process::exit, time::Instant, }; use wgpu::{ @@ -86,9 +87,16 @@ fn main() { debug: fparams.debug == 2, preview: fparams.debug > 0, }; - eprintln!("{params:?} {rp:?}"); + debug!("{params:?} {rp:?}"); debug!("read"); - stdin().read_exact(&mut buffer).unwrap(); + match stdin().read_exact(&mut buffer) { + Ok(_) => (), + Err(e) if e.kind() == ErrorKind::UnexpectedEof => { + break; + } + Err(e) => Err(e).unwrap(), + } + framework.next_frame_manual(); debug!("upload"); @@ -120,4 +128,6 @@ fn main() { stdout().write_all(&buffer).unwrap(); i += 1; } + eprintln!("done"); + exit(0); } -- cgit v1.2.3-70-g09d2