Mercurial > mm7
comparison Actor.cpp @ 994:3431f6abc786
GameUI clean
author | Nomad |
---|---|
date | Tue, 14 May 2013 12:35:06 +0200 |
parents | c8a0f6d89c70 |
children | 9e823ad5eaa6 c45d51b3f4f4 |
comparison
equal
deleted
inserted
replaced
993:ada1ed5f44a1 | 994:3431f6abc786 |
---|---|
31 | 31 |
32 Actor pActors[500]; | 32 Actor pActors[500]; |
33 int uNumActors; | 33 int uNumActors; |
34 | 34 |
35 stru319 stru_50C198; // idb | 35 stru319 stru_50C198; // idb |
36 | |
37 | |
38 | |
39 | |
40 //----- (0041AF52) -------------------------------------------------------- | |
41 void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) | |
42 { | |
43 unsigned int v2; // eax@1 | |
44 GUIWindow *v3; // edi@1 | |
45 unsigned int v4; // esi@1 | |
46 signed int v5; // ebx@4 | |
47 double v6; // st7@5 | |
48 unsigned int v7; // eax@6 | |
49 unsigned int v8; // ebx@10 | |
50 unsigned int v9; // [sp+14h] [bp-Ch]@4 | |
51 unsigned int v10; // [sp+1Ch] [bp-4h]@4 | |
52 | |
53 v2 = a1->pMonsterInfo.uHP; | |
54 v3 = a2; | |
55 v4 = 25; | |
56 if ( (signed int)v2 > 25 ) | |
57 { | |
58 v4 = 200; | |
59 if ( (signed int)v2 < 200 ) | |
60 v4 = a1->pMonsterInfo.uHP; | |
61 } | |
62 v5 = a1->sCurrentHP; | |
63 v10 = v4; | |
64 v9 = uTextureID_mhp_grn; | |
65 if ( v5 < (signed int)v2 ) | |
66 { | |
67 v6 = (double)(signed int)v2; | |
68 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); | |
69 if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) | |
70 { | |
71 v7 = uTextureID_mhp_red; | |
72 v9 = v7; | |
73 } | |
74 else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) | |
75 { | |
76 v7 = uTextureID_mhp_yel; | |
77 v9 = v7; | |
78 } | |
79 } | |
80 v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; | |
81 | |
82 pRenderer->SetTextureClipRect(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); | |
83 pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd)); | |
84 pRenderer->SetTextureClipRect(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); | |
85 pRenderer->DrawTextureIndexed(v8, v3->uFrameY + 34, pIcons_LOD->GetTexture(v9)); | |
86 | |
87 pRenderer->ResetTextureClipRect(); | |
88 pRenderer->DrawTextureIndexed(v8 - 5, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl)); | |
89 pRenderer->DrawTextureIndexed(v8 + v4, v3->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr)); | |
90 } | |
36 | 91 |
37 //----- (00448A40) -------------------------------------------------------- | 92 //----- (00448A40) -------------------------------------------------------- |
38 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) | 93 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) |
39 { | 94 { |
40 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) | 95 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) |