summaryrefslogtreecommitdiffstats
path: root/src/render/Hud.cpp
diff options
context:
space:
mode:
authorXinerki <simasadves@gmail.com>2020-05-21 15:25:46 +0200
committerXinerki <simasadves@gmail.com>2020-05-21 15:25:46 +0200
commit46c6b0d29d218fdbea82a85939c6cef9f56437c6 (patch)
tree286781aec68c1e48c2b82ad2c7c613540db76498 /src/render/Hud.cpp
parentradardisc shadow (diff)
downloadre3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar.gz
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar.bz2
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar.lz
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar.xz
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.tar.zst
re3-46c6b0d29d218fdbea82a85939c6cef9f56437c6.zip
Diffstat (limited to '')
-rw-r--r--src/render/Hud.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 7c33ea5b..a2eed48b 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -1476,6 +1476,28 @@ void CHud::GetRidOfAllHudMessages()
}
}
+void CHud::ReloadTXD()
+{
+ for (int i = 0; i < NUM_HUD_SPRITES; ++i) {
+ Sprites[i].Delete();
+ }
+
+ int HudTXD = CTxdStore::FindTxdSlot("hud");
+ CTxdStore::RemoveTxdSlot(HudTXD);
+
+ debug("Reloading HUD.TXD...\n");
+
+ HudTXD = CTxdStore::AddTxdSlot("hud");
+ CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
+ CTxdStore::AddRef(HudTXD);
+ CTxdStore::PopCurrentTxd();
+ CTxdStore::SetCurrentTxd(HudTXD);
+
+ for (int i = 0; i < NUM_HUD_SPRITES; i++) {
+ Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
+ }
+}
+
void CHud::Initialise()
{
m_Wants_To_Draw_Hud = true;