From ccd503105e47fe265c0d32bc4f77be97b1e42da1 Mon Sep 17 00:00:00 2001 From: Joshua Kwan Date: Tue, 10 Feb 2004 21:19:49 +0000 Subject: [PATCH] Removed some worthless input cruft git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@228 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- Changelog | 1 + ttyplay.c | 24 ++---------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Changelog b/Changelog index f254830..d8dfaf6 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ 1.5 (???) * Allow user to change his or her email address in the console. + * Remove some useless cruft in ttywait() [ttyplay.c] 1.4 (2004/02/03) * Major cleanups - remove most uses of strcpy() and strcat() diff --git a/ttyplay.c b/ttyplay.c index b07cdc4..888b6ba 100644 --- a/ttyplay.c +++ b/ttyplay.c @@ -84,32 +84,12 @@ double ttywait (struct timeval prev, struct timeval cur, double speed) { struct timeval diff = timeval_diff (prev, cur); - fd_set readfs; assert (speed != 0); diff = timeval_div (diff, speed); - FD_SET (STDIN_FILENO, &readfs); - select (1, &readfs, NULL, NULL, &diff); /* skip if a user hits any key */ - if (FD_ISSET (0, &readfs)) - { /* a user hits a character? */ - char c; - read (STDIN_FILENO, &c, 1); /* drain the character */ - switch (c) - { - case '+': - case 'f': - speed *= 2; - break; - case '-': - case 's': - speed /= 2; - break; - case '1': - speed = 1.0; - break; - } - } + select (1, NULL, NULL, NULL, &diff); /* skip if a user hits any key */ + return speed; } -- 2.47.3