diff Actor.cpp @ 994:3431f6abc786

GameUI clean
author Nomad
date Tue, 14 May 2013 12:35:06 +0200
parents c8a0f6d89c70
children 9e823ad5eaa6 c45d51b3f4f4
line wrap: on
line diff
--- a/Actor.cpp	Mon May 13 22:51:58 2013 +0100
+++ b/Actor.cpp	Tue May 14 12:35:06 2013 +0200
@@ -34,6 +34,61 @@
 
 stru319 stru_50C198; // idb
 
+
+
+
+//----- (0041AF52) --------------------------------------------------------
+void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2)
+{
+  unsigned int v2; // eax@1
+  GUIWindow *v3; // edi@1
+  unsigned int v4; // esi@1
+  signed int v5; // ebx@4
+  double v6; // st7@5
+  unsigned int v7; // eax@6
+  unsigned int v8; // ebx@10
+  unsigned int v9; // [sp+14h] [bp-Ch]@4
+  unsigned int v10; // [sp+1Ch] [bp-4h]@4
+
+  v2 = a1->pMonsterInfo.uHP;
+  v3 = a2;
+  v4 = 25;
+  if ( (signed int)v2 > 25 )
+  {
+    v4 = 200;
+    if ( (signed int)v2 < 200 )
+      v4 = a1->pMonsterInfo.uHP;
+  }
+  v5 = a1->sCurrentHP;
+  v10 = v4;
+  v9 = uTextureID_mhp_grn;
+  if ( v5 < (signed int)v2 )
+  {
+    v6 = (double)(signed int)v2;
+    v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP);
+    if ( v5 <= (signed int)(signed __int64)(0.34 * v6) )
+    {
+      v7 = uTextureID_mhp_red;
+      v9 = v7;
+    }
+    else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) )
+    {
+      v7 = uTextureID_mhp_yel;
+      v9 = v7;
+    }
+  }
+  v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2;
+
+  pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52);
+  pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
+  pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52);
+  pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9));
+
+  pRenderer->ResetTextureClipRect();
+  pRenderer->DrawTextureIndexed(v8 - 5, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
+  pRenderer->DrawTextureIndexed(v8 + v4, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
+}
+
 //----- (00448A40) --------------------------------------------------------
 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
 {