Mercurial > mm7
annotate mm7_1.cpp @ 1598:11bb463837b1
_48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus, forgot to commit actor.cpp
author | Grumpy7 |
---|---|
date | Tue, 10 Sep 2013 04:16:54 +0200 |
parents | e668660457dc |
children | 75fafd8ced59 |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1143
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1143
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1143
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1143
diff
changeset
|
4 |
0 | 5 /* This file has been generated by the Hex-Rays decompiler. |
6 Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com> | |
7 | |
8 Detected compiler: Visual C++ | |
9 */ | |
10 | |
11 //#include <defs.h> | |
373 | 12 |
1262 | 13 #include "Texture.h" |
14 #include "mm7_data.h" | |
1016 | 15 #include "VideoPlayer.h" |
16 #include "BSPModel.h" | |
17 #include "Mouse.h" | |
18 | |
19 #include "Vis.h" | |
0 | 20 #include "MM7.h" |
21 #include "Game.h" | |
22 #include "GUIWindow.h" | |
23 #include "Party.h" | |
24 #include "AudioPlayer.h" | |
25 #include "Outdoor.h" | |
26 #include "Overlays.h" | |
27 #include "LOD.h" | |
28 #include "Actor.h" | |
29 #include "Allocator.h" | |
30 #include "Events.h" | |
31 #include "Viewport.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
32 #include "SpriteObject.h" |
0 | 33 #include "ObjectList.h" |
34 #include "Chest.h" | |
35 #include "DecorationList.h" | |
36 #include "stru123.h" | |
37 #include "Time.h" | |
38 #include "IconFrameTable.h" | |
39 #include "TurnEngine.h" | |
189 | 40 #include "texts.h" |
1299 | 41 #include "UI\UIHouses.h" |
1078 | 42 #include "stru367.h" |
0 | 43 |
44 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); | |
45 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
46 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
47 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
48 | |
791 | 49 |
50 //----- (004A1780) mm6_chinese--------------------------------------------- | |
1556 | 51 __int64 fixpoint_div(int a1, int a2) |
791 | 52 { |
53 return ((__int64)a1 << 16) / a2; | |
54 } | |
55 | |
1556 | 56 __int64 fixpoint_mul(int a1, int a2) |
871 | 57 { |
58 return (((__int64)a1 << 16) * a2) >> 16; | |
59 } | |
60 | |
1459 | 61 |
62 //----- (0042EBBE) -------------------------------------------------------- | |
762 | 63 //----- (004453C0) mm6----------------------------------------------------- |
64 //----- (004A1760) mm6_chinese--------------------------------------------- | |
1556 | 65 __int64 fixpoint_sub0(int a1, int a2) |
762 | 66 { |
871 | 67 return ((__int64)a1 * (__int64)a2) >> 16; |
762 | 68 } |
69 | |
1556 | 70 __int64 fixpoint_dot(int x1, int x2, int y1, int y2, int z1, int z2) |
1544 | 71 { |
72 return fixpoint_sub0(x1, x2) + | |
73 fixpoint_sub0(y1, y2) + | |
74 fixpoint_sub0(z1, z2); | |
75 } | |
76 | |
0 | 77 //----- (0041D20D) -------------------------------------------------------- |
1006 | 78 void __fastcall sub_41D20D_buff_remaining_time_string( int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2 ) |
79 { | |
0 | 80 unsigned int v4; // edi@1 |
81 unsigned int v5; // esi@1 | |
82 unsigned int v6; // ebp@1 | |
83 unsigned int v7; // ebx@1 | |
84 signed __int64 v8; // ST34_8@1 | |
85 signed __int64 v9; // kr00_8@1 | |
86 char *v10; // eax@2 | |
87 char *v11; // eax@7 | |
88 char *v12; // eax@13 | |
89 char *v13; // eax@19 | |
90 int uY; // [sp+0h] [bp-20h]@1 | |
91 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
92 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
93 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
94 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
95 | |
96 a1 = edx0; | |
97 uY = ecx0; | |
98 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
99 v5 = (signed __int64)((double)a3 * 0.234375); | |
100 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
101 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
102 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
103 v19 = (unsigned int)v8 / 0x18; | |
104 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
105 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
106 v9 = v8 % 24; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
107 strcpy(pTmpBuf.data(), "\r020"); |
0 | 108 if ( (unsigned int)v8 / 0x18 ) |
109 { | |
110 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
111 if ( v19 <= 1 ) | |
112 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
113 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v19, v10); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
114 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 115 } |
116 if ( v9 ) | |
117 { | |
118 if ( v9 <= 1 ) | |
119 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
120 else | |
121 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
122 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v9, v11); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
123 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 124 } |
125 if ( v17 && !v19 ) | |
126 { | |
127 if ( v17 <= 1 ) | |
128 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
129 else | |
130 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
131 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v17, v12); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
132 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 133 } |
134 if ( v18 && !v9 ) | |
135 { | |
136 if ( v18 <= 1 ) | |
137 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
138 else | |
139 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
140 sprintfex(pTmpBuf2.data(), "%d %s ", (int)v18, v13); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
141 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 142 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1195
diff
changeset
|
143 a1->DrawText(a2, 32, uY, 0, pTmpBuf.data(), 0, 0, 0); |
0 | 144 } |
145 | |
146 //----- (004226C2) -------------------------------------------------------- | |
265 | 147 bool PauseGameDrawing() |
0 | 148 { |
265 | 149 if ( pCurrentScreen != SCREEN_GAME |
151 | 150 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
151 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
152 { | |
153 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 154 return pVideoPlayer->pSmackerMovie != 0; |
151 | 155 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 156 return true; |
157 } | |
158 return false; | |
0 | 159 } |
160 // 4E28F8: using guessed type int pCurrentScreen; | |
161 | |
162 //----- (004226EF) -------------------------------------------------------- | |
373 | 163 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 164 { |
165 unsigned int v3; // eax@7 | |
166 unsigned __int16 v4; // dx@7 | |
167 unsigned __int16 v5; // cx@7 | |
168 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
169 | |
373 | 170 |
983 | 171 extern void set_default_ui_skin(); |
172 set_default_ui_skin(); | |
173 | |
373 | 174 if (align == PartyAlignment_Evil) |
175 { | |
0 | 176 if ( bReplace ) |
177 { | |
178 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
179 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
180 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
181 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
182 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
183 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
1507 | 184 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-c", 2); |
185 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-C", 2); | |
0 | 186 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); |
187 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
188 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 189 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
190 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
191 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
192 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
995 | 193 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); |
319 | 194 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
195 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
196 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
197 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
569 | 198 |
199 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
200 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
201 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
202 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
203 | |
0 | 204 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
569 | 205 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); |
0 | 206 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); |
569 | 207 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); |
208 | |
526 | 209 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); |
0 | 210 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
984 | 211 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2); |
0 | 212 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
213 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
214 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
215 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
216 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
217 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
218 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
219 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
220 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
221 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
222 } | |
223 else | |
224 { | |
225 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
226 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
227 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
228 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
229 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
230 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
1507 | 231 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); |
232 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
0 | 233 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); |
234 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
235 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 236 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
237 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 238 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 239 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
995 | 240 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 241 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
242 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
243 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
244 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
526 | 245 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
569 | 246 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); |
247 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
248 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
249 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
0 | 250 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); |
984 | 251 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); |
0 | 252 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
253 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
254 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
255 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
256 } | |
949 | 257 v3 = TargetColor(0xC8u, 0, 0); |
0 | 258 v4 = 0; |
259 v6 = 0; | |
260 v5 = 10; | |
261 } | |
373 | 262 else if (align == PartyAlignment_Neutral) |
0 | 263 { |
264 if ( bReplace ) | |
265 { | |
266 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
267 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
268 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
269 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
270 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
271 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
1507 | 272 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-a", 2); |
273 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-a", 2); | |
0 | 274 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); |
275 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
276 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 277 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
278 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
279 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
280 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
995 | 281 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); |
319 | 282 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
283 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
284 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
285 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
569 | 286 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); |
287 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
288 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
289 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
0 | 290 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
291 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
292 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
293 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 294 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); |
0 | 295 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
984 | 296 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2); |
0 | 297 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
298 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
299 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
300 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
301 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
302 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
303 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
304 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
305 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
306 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
307 } | |
308 else | |
309 { | |
310 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
311 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
312 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
313 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
314 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
315 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
1507 | 316 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); |
317 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
0 | 318 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); |
319 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
320 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 321 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
322 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
995 | 323 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 324 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
325 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
326 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
327 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 328 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 329 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
526 | 330 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
569 | 331 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); |
332 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
333 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
334 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
0 | 335 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); |
984 | 336 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); |
0 | 337 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
338 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
339 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
340 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
341 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
342 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
343 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
344 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
345 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
346 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
347 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
348 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
349 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
948 | 350 pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE); |
0 | 351 |
352 } | |
949 | 353 v3 = TargetColor(0xAu, 0, 0); |
0 | 354 v4 = 214; |
355 v5 = 230; | |
356 v6 = 193; | |
357 } | |
373 | 358 else if (align == PartyAlignment_Good) |
0 | 359 { |
360 if ( bReplace ) | |
361 { | |
362 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
363 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
364 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
365 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
366 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
367 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
1507 | 368 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-b", 2); |
369 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-B", 2); | |
0 | 370 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); |
371 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
372 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 373 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
374 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
375 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
376 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
995 | 377 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); |
319 | 378 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
379 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
380 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
381 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
569 | 382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); |
383 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
0 | 386 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); |
387 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
388 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
389 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); |
0 | 391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
984 | 392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2); |
0 | 393 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
394 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
395 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
396 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
397 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
399 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
400 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
401 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
402 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
403 } | |
949 | 404 v3 = TargetColor(0, 0, 0xC8u); |
0 | 405 v5 = 255; |
406 v4 = 225; | |
407 v6 = 255; | |
408 } | |
1545 | 409 else Error("Invalid alignment type: %u", align); |
373 | 410 |
0 | 411 uGameUIFontMain = v3; |
949 | 412 uGameUIFontShadow = TargetColor(v5, v4, v6); |
0 | 413 } |
414 | |
1038 | 415 |
416 | |
0 | 417 //----- (00424CD7) -------------------------------------------------------- |
1414 | 418 int sr_424CD7(unsigned int num_vertices) |
0 | 419 { |
1414 | 420 //unsigned int v1; // edx@1 |
0 | 421 signed int v2; // edi@1 |
422 char *v3; // esi@4 | |
423 char *v4; // ecx@4 | |
1414 | 424 //unsigned int v5; // eax@4 |
0 | 425 char *v6; // edx@4 |
426 double v7; // st6@10 | |
427 double v8; // st5@10 | |
428 double v9; // st6@11 | |
429 unsigned __int8 v10; // c2@15 | |
430 unsigned __int8 v11; // c3@15 | |
431 RenderVertexSoft *v12; // edi@22 | |
432 char *v13; // eax@22 | |
433 double v14; // st6@22 | |
1414 | 434 //signed int result; // eax@24 |
435 //unsigned int v16; // [sp+8h] [bp-28h]@4 | |
0 | 436 bool v17; // [sp+Ch] [bp-24h]@6 |
437 char *v18; // [sp+10h] [bp-20h]@4 | |
438 char *v19; // [sp+14h] [bp-1Ch]@4 | |
1414 | 439 //signed int v20; // [sp+18h] [bp-18h]@1 |
0 | 440 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 |
441 char *v22; // [sp+20h] [bp-10h]@4 | |
442 char *v23; // [sp+24h] [bp-Ch]@4 | |
443 char *v24; // [sp+28h] [bp-8h]@4 | |
444 char *v25; // [sp+2Ch] [bp-4h]@4 | |
1414 | 445 |
446 if (!num_vertices) | |
447 return 0; | |
0 | 448 |
1414 | 449 //v1 = uVertexID; |
450 memcpy(&array_50AC10[num_vertices], array_50AC10, sizeof(array_50AC10[0])); | |
0 | 451 v2 = 0; |
1414 | 452 //v20 = 0; |
0 | 453 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) |
454 v2 = 1; | |
455 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
456 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
1414 | 457 //v5 = v1; |
168 | 458 v23 = (char *)&array_507D30[0]._rhw; |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
459 v21 = array_507D30; |
0 | 460 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; |
461 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
462 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
463 v24 = (char *)&array_507D30[0].v; | |
464 v25 = (char *)&array_507D30[0].u; | |
465 v6 = (char *)&array_50AC10[0].v; | |
1414 | 466 //v16 = v1; |
467 | |
468 int out_num_vertices = 0; | |
469 for (int i = 0; i < num_vertices; ++i) | |
0 | 470 { |
471 v17 = *((float *)v6 + 5) >= 8.0; | |
472 if ( v2 != v17 ) | |
473 { | |
474 if ( v17 ) | |
475 { | |
476 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
477 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
478 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
479 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
480 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
481 } | |
482 else | |
483 { | |
484 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
485 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
486 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
487 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
488 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
489 } | |
490 *(float *)v24 = v8; | |
491 *(float *)v22 = 8.0; | |
492 *(int *)v23 = 0x3E000000u; | |
493 if ( v2 ) | |
494 { | |
495 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
496 { | |
497 v10 = 0; | |
498 v11 = *(float *)v3 == *((float *)v6 - 5); | |
1426 | 499 if ( v11 | v10 ) |
500 goto LABEL_21; | |
501 } | |
0 | 502 } |
503 else | |
504 { | |
505 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
506 { | |
507 v10 = 0; | |
508 v11 = *(float *)v3 == *((float *)v6 + 7); | |
1426 | 509 if ( v11 | v10 ) |
510 goto LABEL_21; | |
0 | 511 } |
512 } | |
1426 | 513 ++v21; |
514 v22 += 48; | |
515 v24 += 48; | |
516 v25 += 48; | |
517 v4 += 48; | |
518 v3 += 48; | |
519 ++out_num_vertices; | |
520 v23 += 48; | |
521 v19 = v4; | |
522 v18 = v3; | |
0 | 523 } |
1426 | 524 LABEL_21: |
0 | 525 if ( v17 ) |
526 { | |
527 v12 = v21; | |
528 v13 = v23; | |
529 v19 += 48; | |
530 v18 += 48; | |
531 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
1414 | 532 ++out_num_vertices; |
0 | 533 v25 += 48; |
534 v24 += 48; | |
535 v22 += 48; | |
536 ++v21; | |
537 v23 += 48; | |
538 memcpy(v12, v6 + 8, 0x30u); | |
539 v4 = v19; | |
540 v3 = v18; | |
541 *(float *)v13 = v14; | |
542 } | |
543 v2 = v17; | |
544 v6 += 48; | |
545 } | |
1414 | 546 |
547 return out_num_vertices >= 3 ? out_num_vertices : 0; | |
0 | 548 } |