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