From f53dfb5c7b9cdb328ee9835073d0a4ec0d59b845 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 7 May 2010 20:01:40 +0000 Subject: [PATCH] Minor optimization in watching menu. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@558 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- Changelog | 3 +++ dgamelaunch.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 1f7ced5..5359e4f 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +1.5.2 (2010/xx/xx) + * Output some identifying information into the ttyrecs. + 1.5.1 (2010/05/02) * Allow sorting the watching-menu by any column. * Show number of people watching each game. diff --git a/dgamelaunch.c b/dgamelaunch.c index e8ab8cf..cc5b764 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -636,6 +636,8 @@ inprogressmenu (int gameid) int di; + time_t ctime; + struct dg_watchcols { int dat; int sortmode; @@ -706,6 +708,8 @@ inprogressmenu (int gameid) shm_sem_wait(shm_dg_data); + (void) time(&ctime); + for (i = 0; i < max_height; i++) { if (i + offset >= len) @@ -722,10 +726,8 @@ inprogressmenu (int gameid) games[i + offset]->ws_col, games[i + offset]->ws_row); { - time_t ctime; long secs, mins, hours; - (void) time(&ctime); secs = (ctime - games[i + offset]->idle_time); hours = (secs / 3600); secs -= (hours * 3600);