HUD fixes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6757 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2012-02-13 18:35:15 +00:00
parent aa10c09bd3
commit 16c4b28914
+6 -2
View File
@@ -347,6 +347,7 @@ struct hudmessages : consolebuffer<hudline>
void render()
{
if(!conlines.length()) return;
glPushMatrix();
glLoadIdentity();
glOrtho(0, VIRTW*0.9f, VIRTH*0.9f, 0, -1, 1);
int dispmillis = arenaintermission ? 6000 : 3000;
@@ -356,6 +357,7 @@ struct hudmessages : consolebuffer<hudline>
int tw = text_width(c.line);
draw_text(c.line, int(tw > VIRTW*0.9f ? 0 : (VIRTW*0.9f-tw)/2), int(((VIRTH*0.9f)/4*3)+FONTH*i+pow((totalmillis-c.millis)/(float)dispmillis, 4)*VIRTH*0.9f/4.0f));
}
glPopMatrix();
}
};
@@ -932,9 +934,11 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
if(showspeed)
{
glLoadIdentity();
glPushMatrix();
glScalef(2, 2, 1);
draw_textf("v %.2f", VIRTW/2, VIRTH*0.85f, sqrtf(p->vel.x*p->vel.x + p->vel.y*p->vel.y));
glOrtho(0, VIRTW, VIRTH, 0, -1, 1);
glScalef(0.8, 0.8, 1);
draw_textf("Speed: %.2f", VIRTW/2, VIRTH, sqrtf(p->vel.x*p->vel.x + p->vel.y*p->vel.y));
glPopMatrix();
}