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