summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Hud.cpp22
-rw-r--r--src/render/Hud.h1
2 files changed, 23 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;
diff --git a/src/render/Hud.h b/src/render/Hud.h
index bae19ee4..3f4b218e 100644
--- a/src/render/Hud.h
+++ b/src/render/Hud.h
@@ -124,6 +124,7 @@ public:
static void Draw();
static void DrawAfterFade();
static void GetRidOfAllHudMessages();
+ static void ReloadTXD();
static void Initialise();
static void ReInitialise();
static void SetBigMessage(wchar *message, int16 style);