apply Misty's clock patch part 2

This commit is contained in:
Bill Currie 2000-12-05 03:22:35 +00:00
parent b5ff8b5c6c
commit 19a1e03f5d
2 changed files with 26 additions and 1 deletions

View file

@ -491,7 +491,7 @@ void SCR_DrawTime (void)
/* now actually print it to the screen directly below where show_fps is */
sprintf(st, "%s", local_time);
x = vid.width - strlen(st) * 8 - 8;
y = vid.height - sb_lines - 0;
y = vid.height - sb_lines - 16;
Draw_String8 (x, y, st);
}

View file

@ -511,6 +511,30 @@ void SCR_DrawFPS (void)
Draw_String8 (x, y, st);
}
/* Misty: I like to see the time */
void SCR_DrawTime (void)
{
extern cvar_t *show_time;
int x, y;
char st[80];
char local_time[120];
time_t systime;
if (!show_time->int_val)
return;
/* actually find the time and set systime to it*/
time(&systime);
/* now set local_time to 24 hour time using hours:minutes format */
strftime(local_time, sizeof(local_time), "%k:%M", localtime(&systime));
/* now actually print it to the screen directly below where show_fps is
*/
sprintf(st, "%s", local_time);
x = vid.width - strlen(st) * 8 - 8;
y = vid.height - sb_lines - 16;
Draw_String8 (x, y, st);
}
/*
==============
DrawPause
@ -1086,6 +1110,7 @@ void SCR_UpdateScreen (void)
SCR_DrawTurtle ();
SCR_DrawPause ();
SCR_DrawFPS ();
SCR_DrawTime ();
SCR_CheckDrawCenterString ();
Sbar_Draw ();
SCR_DrawConsole ();