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