From 4c3dd08845a29516ee7923a84ff1419c29c1b3c5 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sun, 23 Feb 2003 12:33:52 +0000 Subject: [PATCH] - Applied patch from Steven Winston for a console clock. --- src/cl_scrn.c | 5 +++-- src/console.c | 59 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/cl_scrn.c b/src/cl_scrn.c index 142e20c..1719108 100644 --- a/src/cl_scrn.c +++ b/src/cl_scrn.c @@ -1375,8 +1375,9 @@ void SCR_UpdateScreen (void) SCR_DrawNet (); SCR_CheckDrawCenterString (); - // FPS counter hack - // http://www.quakesrc.org/?Page=tutorials&What=./tutorials/Quake2/misc/fps.txt + /* FPS counter hack + * http://www.quakesrc.org/?Page=tutorials&What=./tutorials/Quake2/misc/fps.txt + */ if (cl_drawfps->value) { char s[8]; diff --git a/src/console.c b/src/console.c index 477b881..0d81464 100644 --- a/src/console.c +++ b/src/console.c @@ -1,23 +1,25 @@ -/* -Copyright (C) 1997-2001 Id Software, Inc. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -// console.c +/* $Id$ + * + * console display + * + * Copyright (C) 1997-2001 Id Software, Inc. + * Copyright (c) 2002,2003 The Quakeforge Project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -25,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "client.h" - console_t con; cvar_t *con_notifytime; @@ -581,6 +582,12 @@ void Con_DrawConsole (float frac) char version[64]; char dlbar[1024]; + /* added for console clock */ + time_t time_of_day; + char timebuf[26], *tmpbuf; + time_of_day = time (NULL); + tmpbuf = ctime( &time_of_day) ; + lines = viddef.height * frac; if (lines <= 0) return; @@ -593,9 +600,13 @@ void Con_DrawConsole (float frac) SCR_AddDirtyPoint (0,0); SCR_AddDirtyPoint (viddef.width-1,lines-1); - Com_sprintf (version, sizeof(version), "v%s", VERSION); - for (x=0 ; x<5 ; x++) - re.DrawChar (viddef.width-44+x*8, lines-12, 128 + version[x] ); + Com_sprintf(version, sizeof(version), "v%s", VERSION); + for (x = 0; x < 5; x++) + re.DrawChar(viddef.width-44+x*8, lines-12, 128 + version[x]); + /* console clock */ + Com_sprintf(timebuf, sizeof(timebuf), "%s", timebuf); + for (x = 0; x < 24; ++x) + re.DrawChar(viddef.width-153+x*8, lines-25, 128 + tmpbuf[x]); // draw the text con.vislines = lines;