Misty's hudswap/fps/time patch to put the fps/time on the opposite side of the

screen to the hud.
This commit is contained in:
Bill Currie 2000-12-05 04:21:47 +00:00
parent 19a1e03f5d
commit 481fe0b9ed
2 changed files with 33 additions and 26 deletions

View file

@ -465,11 +465,15 @@ void SCR_DrawFPS (void)
fps_count = 0;
lastframetime = t;
}
sprintf(st, "%3d FPS", lastfps);
x = vid.width - strlen(st) * 8 - 8;
/* Misty: I really do need to read about sprintf a bit. This thing keeps chewing on my foot! */
sprintf(st, "%-3d FPS", lastfps);
/* Misty: New trick! (for me) the ? makes this work like a if then else - IE: if
cl_hudswap->int_val is not null, do first case, else (else is a : here) do second case.
Deek taught me this trick */
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
y = vid.height - sb_lines - 8;
Draw_String8 (x, y, st);
}
/* Misty: I like to see the time */
@ -490,7 +494,7 @@ void SCR_DrawTime (void)
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;
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
y = vid.height - sb_lines - 16;
Draw_String8 (x, y, st);
}

View file

@ -504,35 +504,38 @@ void SCR_DrawFPS (void)
fps_count = 0;
lastframetime = t;
}
sprintf(st, "%3d FPS", lastfps);
x = vid.width - strlen(st) * 8 - 8;
/* Misty: I really do need to read about sprintf a bit. This thing keeps chewing on my foot! */
sprintf(st, "%-3d FPS", lastfps);
/* Misty: New trick! (for me) the ? makes this work like a if then else - IE: if
cl_hudswap->int_val is not null, do first case, else (else is a : here) do second case.
Deek taught me this trick */
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
y = vid.height - sb_lines - 8;
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);
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 = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
y = vid.height - sb_lines - 16;
Draw_String8 (x, y, st);
}
/*