Show the timer
| 984 | |
| 985 | // Show the timer |
| 986 | void 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 | //////////////////////////////////////////////////////////////////////////////////////// |
| 1012 | void t_dirty_rect::fill(ddgr_color col) { |
nothing calls this directly
no test coverage detected