From 16c4b28914f2820a374cce9e2f095563742460f3 Mon Sep 17 00:00:00 2001 From: sireus Date: Mon, 13 Feb 2012 18:35:15 +0000 Subject: [PATCH] HUD fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6757 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/renderhud.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index ecd8f9ac..abc52887 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -347,6 +347,7 @@ struct hudmessages : consolebuffer 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 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(); }