SV_TIMEUP now sends gamemillis, gamelimit - client can draw a hud-clock

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5709 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-10-04 20:40:39 +00:00
parent 31c87b3b2a
commit 711e076df0
2 changed files with 28 additions and 6 deletions
+20
View File
@@ -682,6 +682,7 @@ void drawscores()
glPopAttrib();
}
VARP(clockdisplay,0,0,2);
VARP(dbgpos,0,0,1);
void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater)
{
@@ -842,6 +843,25 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
draw_text(c_val, VIRTW*2 - ( text_width(c_val) + FONTH ), VIRTH*2 - 3*FONTH/2);
}
}
if(!intermission && clockdisplay!=0)
{
string gtime;
int cssec = (gametimecurrent+(lastmillis-lastgametimeupdate))/1000;
int gtsec = cssec%60;
int gtmin = cssec/60;
if(clockdisplay==1)
{
int gtmax = gametimemaximum/60000;
gtmin = gtmax - gtmin;
if(gtsec!=0)
{
gtmin -= 1;
gtsec = 60 - gtsec;
}
}
formatstring(gtime)("%02d:%02d", gtmin, gtsec);
draw_text(gtime, (2*VIRTW - text_width(gtime))/2, 2);
}
if(hidevote < 2 && multiplayer(false))
{