mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-02-08 23:31:56 +00:00
show_time 2 will select 12h clock as opposed to 24h (Misty again)
This commit is contained in:
parent
97f7b9a568
commit
cbf7cd5447
2 changed files with 28 additions and 8 deletions
|
@ -493,13 +493,23 @@ void SCR_DrawTime (void)
|
||||||
char local_time[120];
|
char local_time[120];
|
||||||
time_t systime;
|
time_t systime;
|
||||||
|
|
||||||
if (!show_time->int_val)
|
/* any cvar that can take multiple settings must be able to handle abuse. */
|
||||||
|
if (show_time->int_val <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* actually find the time and set systime to it*/
|
/* actually find the time and set systime to it*/
|
||||||
time(&systime);
|
time(&systime);
|
||||||
|
|
||||||
|
if (show_time->int_val == 1) {
|
||||||
/* now set local_time to 24 hour time using hours:minutes format */
|
/* now set local_time to 24 hour time using hours:minutes format */
|
||||||
strftime(local_time, sizeof(local_time), "%k:%M", localtime(&systime));
|
strftime (local_time, sizeof (local_time), "%k:%M",
|
||||||
|
localtime (&systime));
|
||||||
|
} else if (show_time->int_val >= 2) {
|
||||||
|
/* >= is another abuse protector */
|
||||||
|
strftime (local_time, sizeof (local_time), "%l:%M %P",
|
||||||
|
localtime(&systime));
|
||||||
|
}
|
||||||
|
|
||||||
/* now actually print it to the screen directly below where show_fps is */
|
/* now actually print it to the screen directly below where show_fps is */
|
||||||
sprintf (st, "%s", local_time);
|
sprintf (st, "%s", local_time);
|
||||||
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
|
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
|
||||||
|
|
|
@ -526,13 +526,23 @@ void SCR_DrawTime (void)
|
||||||
char local_time[120];
|
char local_time[120];
|
||||||
time_t systime;
|
time_t systime;
|
||||||
|
|
||||||
if (!show_time->int_val)
|
/* any cvar that can take multiple settings must be able to handle abuse. */
|
||||||
|
if (show_time->int_val <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* actually find the time and set systime to it*/
|
/* actually find the time and set systime to it*/
|
||||||
time(&systime);
|
time(&systime);
|
||||||
|
|
||||||
|
if (show_time->int_val == 1) {
|
||||||
/* now set local_time to 24 hour time using hours:minutes format */
|
/* now set local_time to 24 hour time using hours:minutes format */
|
||||||
strftime(local_time, sizeof(local_time), "%k:%M", localtime(&systime));
|
strftime (local_time, sizeof (local_time), "%k:%M",
|
||||||
|
localtime (&systime));
|
||||||
|
} else if (show_time->int_val >= 2) {
|
||||||
|
/* >= is another cvar abuse protector */
|
||||||
|
strftime (local_time, sizeof (local_time), "%l:%M %P",
|
||||||
|
localtime (&systime));
|
||||||
|
}
|
||||||
|
|
||||||
/* now actually print it to the screen directly below where show_fps is */
|
/* now actually print it to the screen directly below where show_fps is */
|
||||||
sprintf (st, "%s", local_time);
|
sprintf (st, "%s", local_time);
|
||||||
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
|
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
|
||||||
|
|
Loading…
Reference in a new issue