mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-06-04 11:01:20 +00:00
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:
parent
19a1e03f5d
commit
481fe0b9ed
2 changed files with 33 additions and 26 deletions
|
@ -465,11 +465,15 @@ void SCR_DrawFPS (void)
|
||||||
fps_count = 0;
|
fps_count = 0;
|
||||||
lastframetime = t;
|
lastframetime = t;
|
||||||
}
|
}
|
||||||
|
/* Misty: I really do need to read about sprintf a bit. This thing keeps chewing on my foot! */
|
||||||
sprintf(st, "%3d FPS", lastfps);
|
sprintf(st, "%-3d FPS", lastfps);
|
||||||
x = vid.width - strlen(st) * 8 - 8;
|
/* 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;
|
y = vid.height - sb_lines - 8;
|
||||||
Draw_String8 (x, y, st);
|
Draw_String8 (x, y, st);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Misty: I like to see the time */
|
/* 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));
|
strftime(local_time, sizeof(local_time), "%k:%M", 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 = vid.width - strlen(st) * 8 - 8;
|
x = cl_hudswap->int_val ? vid.width - ((strlen (st) * 8) + 8) : 8;
|
||||||
y = vid.height - sb_lines - 16;
|
y = vid.height - sb_lines - 16;
|
||||||
Draw_String8 (x, y, st);
|
Draw_String8 (x, y, st);
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,35 +504,38 @@ void SCR_DrawFPS (void)
|
||||||
fps_count = 0;
|
fps_count = 0;
|
||||||
lastframetime = t;
|
lastframetime = t;
|
||||||
}
|
}
|
||||||
|
/* Misty: I really do need to read about sprintf a bit. This thing keeps chewing on my foot! */
|
||||||
sprintf(st, "%3d FPS", lastfps);
|
sprintf(st, "%-3d FPS", lastfps);
|
||||||
x = vid.width - strlen(st) * 8 - 8;
|
/* 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;
|
y = vid.height - sb_lines - 8;
|
||||||
Draw_String8 (x, y, st);
|
Draw_String8 (x, y, st);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Misty: I like to see the time */
|
/* Misty: I like to see the time */
|
||||||
void SCR_DrawTime (void)
|
void SCR_DrawTime (void)
|
||||||
{
|
{
|
||||||
extern cvar_t *show_time;
|
extern cvar_t *show_time;
|
||||||
int x, y;
|
int x, y;
|
||||||
char st[80];
|
char st[80];
|
||||||
char local_time[120];
|
char local_time[120];
|
||||||
time_t systime;
|
time_t systime;
|
||||||
|
|
||||||
if (!show_time->int_val)
|
if (!show_time->int_val)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* actually find the time and set systime to it*/
|
/* actually find the time and set systime to it*/
|
||||||
time(&systime);
|
time(&systime);
|
||||||
/* 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));
|
||||||
/* 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 = vid.width - strlen(st) * 8 - 8;
|
y = vid.height - sb_lines - 16;
|
||||||
y = vid.height - sb_lines - 16;
|
Draw_String8 (x, y, st);
|
||||||
Draw_String8 (x, y, st);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue