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