summaryrefslogtreecommitdiff
path: root/src/fpsgame/fps.cpp
diff options
context:
space:
mode:
authorxolatile2025-07-23 22:38:43 +0200
committerxolatile2025-07-23 22:38:43 +0200
commit9618df6c3310853d8c07939b9761734fe9df2e87 (patch)
tree5aeefaf0a7324bb54f4084a45b3e126010def760 /src/fpsgame/fps.cpp
parenta5a051f3356046fcaeaa295272d6859defebb320 (diff)
downloadxolatile-badassbug-9618df6c3310853d8c07939b9761734fe9df2e87.tar.xz
xolatile-badassbug-9618df6c3310853d8c07939b9761734fe9df2e87.tar.zst
Hacked up speedometer and accelerated movement...
Diffstat (limited to 'src/fpsgame/fps.cpp')
-rw-r--r--src/fpsgame/fps.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fpsgame/fps.cpp b/src/fpsgame/fps.cpp
index 377afa3..038fe47 100644
--- a/src/fpsgame/fps.cpp
+++ b/src/fpsgame/fps.cpp
@@ -876,6 +876,8 @@ namespace game
void drawhudicons(fpsent *d)
{
+ int speedforreal = (int) (sqrtf(d->vel.squaredlen()) + /*speedmodifier*/ + 1.0f);
+
pushhudmatrix();
hudmatrix.scale(2, 2, 1);
flushhudmatrix();
@@ -887,6 +889,8 @@ namespace game
{
if(d->armour) draw_textf("%d", (HICON_X + HICON_STEP + HICON_SIZE + HICON_SPACE)/2, HICON_TEXTY/2, d->armour);
draw_textf("%d", (HICON_X + 2*HICON_STEP + HICON_SIZE + HICON_SPACE)/2, HICON_TEXTY/2, d->ammo[d->gunselect]);
+ //~draw_textf("%d", (HICON_X + 2*HICON_STEP + HICON_SIZE + HICON_SPACE)/2+800, HICON_TEXTY/2, (int) (100.0f+speedmodifier));
+ draw_textf("%d", (HICON_X + 2*HICON_STEP + HICON_SIZE + HICON_SPACE)/2+400, HICON_TEXTY/2, speedforreal);
}
pophudmatrix();
@@ -981,7 +985,7 @@ namespace game
flushhudmatrix();
defformatstring(label, "%d", p->ammo[gun]);
- int tw, th, moved, movew = 0, moveh = 0; text_bounds(label, tw, th);
+ int tw, th; text_bounds(label, tw, th);
vec2 textdrawpos = vec2(-tw, -th).div(2);
float ammoratio = (float)p->ammo[gun] / itemstats[gun-GUN_SG].add;
bvec color = bvec::hexcolor(p->ammo[gun] == 0 || ammoratio >= 1.0f ? 0xFFFFFF : (ammoratio >= 0.5f ? 0xFFC040 : 0xFF0000));