MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RenderHUDTimer

Function RenderHUDTimer

Descent3/huddisplay.cpp:986–1009  ·  view source on GitHub ↗

Show the timer

Source from the content-addressed store, hash-verified

984
985// Show the timer
986void RenderHUDTimer(tHUDItem *item) {
987 float time;
988 int min, secs;
989 char buf[100];
990
991 time = Osiris_TimerTimeRemaining(item->data.timer_handle);
992
993 // If no more time, kill item
994 if (time < 0) {
995 item->stat = 0;
996 return;
997 }
998
999 // round up
1000 time = ceil(time);
1001
1002 min = time / 60;
1003 secs = time - (60 * min);
1004
1005 snprintf(buf, sizeof(buf), "T-%d:%02d", min, secs);
1006
1007 int h = grfont_GetHeight(HUD_FONT);
1008 RenderHUDTextFlagsNoFormat(HUDTEXT_CENTERED, item->color, HUD_ALPHA, 0, 0, h * 4, buf);
1009}
1010
1011////////////////////////////////////////////////////////////////////////////////////////
1012void t_dirty_rect::fill(ddgr_color col) {

Callers

nothing calls this directly

Calls 3

grfont_GetHeightFunction · 0.85

Tested by

no test coverage detected