Mercurial > mm7
annotate mm7_5.cpp @ 1528:270627b54ed4
Fix Vec3<T>::Normalize_float().
author | yoctozepto |
---|---|
date | Fri, 06 Sep 2013 09:29:17 +0200 |
parents | d023247ae118 |
children | c4ab816fcc5e |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
4 |
303 | 5 #include <assert.h> |
6 | |
1262 | 7 #include "Texture.h" |
8 #include "mm7_data.h" | |
1016 | 9 #include "VideoPlayer.h" |
10 #include "Sprites.h" | |
11 #include "MapInfo.h" | |
12 #include "BSPModel.h" | |
13 #include "OutdoorCamera.h" | |
14 #include "LightmapBuilder.h" | |
15 #include "DecalBuilder.h" | |
16 #include "Mouse.h" | |
17 #include "Keyboard.h" | |
18 #include "GammaControl.h" | |
1263 | 19 #include "mm7_data.h" |
20 #include "FactionTable.h" | |
1016 | 21 #include "Vis.h" |
0 | 22 #include "mm7.h" |
23 #include "Game.h" | |
24 #include "GUIWindow.h" | |
25 #include "GUIFont.h" | |
26 #include "GUIProgressBar.h" | |
27 #include "Party.h" | |
28 #include "AudioPlayer.h" | |
29 #include "Outdoor.h" | |
30 #include "Arcomage.h" | |
31 #include "LOD.h" | |
32 #include "Actor.h" | |
33 #include "Events.h" | |
34 #include "Viewport.h" | |
35 #include "FrameTableInc.h" | |
36 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
37 #include "SpriteObject.h" |
0 | 38 #include "ObjectList.h" |
39 #include "Chest.h" | |
40 #include "PaletteManager.h" | |
41 #include "SaveLoad.h" | |
42 #include "Time.h" | |
43 #include "TurnEngine.h" | |
924 | 44 #include "CastSpellInfo.h" |
0 | 45 #include "stru298.h" |
46 #include "Events2D.h" | |
189 | 47 #include "texts.h" |
0 | 48 #include "Log.h" |
1299 | 49 #include "UI\UIHouses.h" |
1262 | 50 #include "Lights.h" |
51 #include "Lights.h" | |
0 | 52 |
53 //----- (004304E7) -------------------------------------------------------- | |
1458 | 54 void GameUI_MsgProc() |
0 | 55 { |
978 | 56 //signed int v0; // edi@6 |
1025 | 57 //char *v1; // esi@6 |
0 | 58 unsigned int v2; // edx@7 |
59 Actor *pActor; // ecx@13 | |
60 int v4; // ecx@18 | |
199 | 61 //NPCData *pNPCData0; // eax@18 |
62 //int v6; // edx@20 | |
63 //int v7; // ecx@29 | |
916 | 64 //unsigned int v8; // edx@59 |
65 //unsigned int v9; // ecx@60 | |
0 | 66 unsigned int v10; // ecx@73 |
437 | 67 //unsigned int v11; // eax@75 |
0 | 68 unsigned __int8 v12; // sf@75 |
69 unsigned __int8 v13; // of@75 | |
70 int v14; // eax@98 | |
71 unsigned int v15; // eax@102 | |
72 unsigned __int8 v16; // al@104 | |
73 unsigned __int8 v17; // al@105 | |
74 int v18; // eax@106 | |
75 float v19; // ST64_4@121 | |
76 unsigned int v20; // ecx@121 | |
77 float v21; // ST64_4@126 | |
78 float v22; // ST64_4@127 | |
79 unsigned int v23; // ecx@135 | |
80 unsigned int v24; // ecx@149 | |
81 unsigned int v25; // ecx@165 | |
82 GUIWindow *pWindow; // eax@204 | |
83 unsigned int v27; // edx@204 | |
84 unsigned int v28; // ecx@204 | |
85 GUIWindow *pWindow2; // ecx@248 | |
978 | 86 //int v30; // edx@258 |
87 //const char *v31; // ecx@262 | |
0 | 88 signed int v32; // eax@269 |
89 unsigned int v33; // eax@277 | |
90 unsigned __int8 v34; // al@279 | |
91 unsigned __int8 v35; // al@280 | |
1000 | 92 //GUIWindow *pWindow3; // ecx@332 |
0 | 93 int v37; // eax@341 |
94 int v38; // eax@358 | |
95 SHORT v39; // ax@365 | |
910 | 96 //signed int v40; // eax@365 |
0 | 97 char *v41; // eax@380 |
98 int v42; // eax@396 | |
99 POINT *pPoint; // eax@397 | |
100 signed int v44; // eax@398 | |
101 int v45; // edx@398 | |
102 signed int v46; // ecx@398 | |
103 char v47; // zf@399 | |
104 char v48; // zf@405 | |
105 BLVFace *pBLVFace; // ecx@410 | |
106 ODMFace *pODMFace; // ecx@412 | |
1000 | 107 CastSpellInfo *pSpellInfo; // ecx@415 |
0 | 108 void *v52; // eax@424 |
109 __int16 v53; // ax@431 | |
110 int v54; // eax@432 | |
111 int v55; // ecx@432 | |
112 int v56; // edx@432 | |
113 int v57; // eax@432 | |
114 Player *pPlayer; // edx@442 | |
1430 | 115 unsigned int pMapNum; // eax@445 |
0 | 116 signed int v60; // ST64_4@459 |
1430 | 117 //NPCData *pNPCData2; // eax@467 |
118 //unsigned __int64 v62; // kr00_8@467 | |
0 | 119 __int16 v63; // dx@479 |
120 unsigned int v64; // eax@486 | |
121 int v65; // ecx@486 | |
122 int v66; // eax@488 | |
123 char *v67; // eax@489 | |
124 __int16 v68; // dx@498 | |
125 char *v69; // eax@512 | |
126 int v70; // eax@525 | |
127 int v71; // edi@527 | |
128 NPCData *pNPCData3; // esi@527 | |
129 char *v73; // ecx@533 | |
130 signed int v74; // edi@535 | |
131 int v75; // eax@535 | |
132 int v76; // esi@535 | |
133 int v77; // eax@537 | |
134 Player *pPlayer2; // ecx@549 | |
916 | 135 //int v79; // ecx@550 |
136 //unsigned int v80; // edx@550 | |
0 | 137 signed int v81; // eax@552 |
138 POINT *pPoint2; // eax@553 | |
139 signed int v83; // ecx@554 | |
140 signed int v84; // ecx@554 | |
141 GUIButton *pButton; // eax@578 | |
142 unsigned int v86; // eax@583 | |
143 const char *v87; // ecx@595 | |
144 const char *v88; // ecx@596 | |
916 | 145 //unsigned int v89; // eax@598 |
0 | 146 unsigned int v90; // eax@602 |
147 int v91; // edx@605 | |
148 int v92; // eax@605 | |
149 int v93; // edx@605 | |
150 int pPlayerNum; // edx@611 | |
151 int v95; // eax@611 | |
916 | 152 //const char *v96; // ecx@621 |
0 | 153 unsigned int v97; // eax@624 |
154 int v98; // eax@636 | |
155 unsigned __int8 v99; // al@643 | |
156 Player *pPlayer3; // eax@648 | |
157 int v101; // ecx@648 | |
158 int v102; // edx@652 | |
159 int v103; // eax@671 | |
160 Player *pPlayer4; // ecx@718 | |
161 int v105; // eax@718 | |
162 Player *pPlayer5; // ST78_4@758 | |
163 unsigned int v107; // eax@758 | |
164 unsigned int v108; // eax@758 | |
165 unsigned int v115; // eax@764 | |
166 int v116; // eax@776 | |
167 POINT *pPoint3; // eax@777 | |
168 unsigned int v118; // eax@785 | |
169 unsigned int v119; // ecx@786 | |
170 unsigned int v120; // [sp-28h] [bp-624h]@86 | |
171 unsigned int v121; // [sp-28h] [bp-624h]@711 | |
172 unsigned int v122; // [sp-24h] [bp-620h]@86 | |
173 unsigned int v123; // [sp-24h] [bp-620h]@711 | |
174 unsigned int v124; // [sp-20h] [bp-61Ch]@86 | |
175 unsigned int v125; // [sp-20h] [bp-61Ch]@711 | |
176 unsigned int v126; // [sp-1Ch] [bp-618h]@86 | |
177 int v127; // [sp-1Ch] [bp-618h]@107 | |
178 unsigned int v128; // [sp-1Ch] [bp-618h]@711 | |
179 int v129; // [sp-18h] [bp-614h]@86 | |
916 | 180 //signed int v130; // [sp-18h] [bp-614h]@107 |
0 | 181 int v131; // [sp-14h] [bp-610h]@86 |
916 | 182 //unsigned int v132; // [sp-14h] [bp-610h]@107 |
183 //unsigned int v133; // [sp-10h] [bp-60Ch]@60 | |
0 | 184 unsigned int v134; // [sp-10h] [bp-60Ch]@86 |
916 | 185 //signed int v135; // [sp-10h] [bp-60Ch]@107 |
0 | 186 unsigned int v136; // [sp-10h] [bp-60Ch]@121 |
916 | 187 //unsigned int v137; // [sp-Ch] [bp-608h]@60 |
0 | 188 unsigned int v138; // [sp-Ch] [bp-608h]@86 |
916 | 189 //signed int v139; // [sp-Ch] [bp-608h]@107 |
0 | 190 unsigned int v140; // [sp-Ch] [bp-608h]@121 |
191 enum WindowType pWindowType; // [sp-8h] [bp-604h]@56 | |
916 | 192 //enum WindowType pWindowType1; // [sp-8h] [bp-604h]@60 |
0 | 193 unsigned __int8 v143; // [sp-8h] [bp-604h]@86 |
916 | 194 //int v144; // [sp-8h] [bp-604h]@107 |
0 | 195 enum WindowType pWindowType2; // [sp-8h] [bp-604h]@121 |
916 | 196 //const char *v146; // [sp-8h] [bp-604h]@449 |
197 //unsigned int v147; // [sp-8h] [bp-604h]@550 | |
710 | 198 //int v148; // [sp-4h] [bp-600h]@56 |
0 | 199 GUIButton *pButton2; // [sp-4h] [bp-600h]@59 |
200 const char *v150; // [sp-4h] [bp-600h]@86 | |
916 | 201 //unsigned int v151; // [sp-4h] [bp-600h]@107 |
0 | 202 int v152; // [sp-4h] [bp-600h]@121 |
203 int v153; // [sp-4h] [bp-600h]@135 | |
961 | 204 //int v154; // [sp-4h] [bp-600h]@149 |
0 | 205 int v155; // [sp-4h] [bp-600h]@165 |
206 int v156; // [sp-4h] [bp-600h]@204 | |
916 | 207 //const char *v157; // [sp-4h] [bp-600h]@444 |
1430 | 208 //unsigned int v158; // [sp-4h] [bp-600h]@449 |
916 | 209 //__int16 v159; // [sp-4h] [bp-600h]@550 |
0 | 210 int v160; // [sp-4h] [bp-600h]@599 |
211 const char *v161; // [sp-4h] [bp-600h]@637 | |
710 | 212 //int v162; // [sp+0h] [bp-5FCh]@56 |
916 | 213 //int v163; // [sp+0h] [bp-5FCh]@59 |
0 | 214 Texture *pTexture; // [sp+0h] [bp-5FCh]@86 |
916 | 215 //int v165; // [sp+0h] [bp-5FCh]@107 |
0 | 216 int v166; // [sp+0h] [bp-5FCh]@121 |
217 int v167; // [sp+0h] [bp-5FCh]@135 | |
978 | 218 //int v168; // [sp+0h] [bp-5FCh]@149 |
0 | 219 int v169; // [sp+0h] [bp-5FCh]@165 |
220 int v170; // [sp+0h] [bp-5FCh]@204 | |
978 | 221 //signed int v171; // [sp+0h] [bp-5FCh]@259 |
0 | 222 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287 |
223 char *v173; // [sp+0h] [bp-5FCh]@444 | |
224 char *v174; // [sp+0h] [bp-5FCh]@449 | |
916 | 225 //int v175; // [sp+0h] [bp-5FCh]@550 |
0 | 226 int v176; // [sp+0h] [bp-5FCh]@599 |
227 const char *v177; // [sp+0h] [bp-5FCh]@629 | |
228 char *v178; // [sp+0h] [bp-5FCh]@637 | |
229 int v179; // [sp+4h] [bp-5F8h]@0 | |
199 | 230 //signed int _this; // [sp+14h] [bp-5E8h]@22 |
0 | 231 signed int thisa; // [sp+14h] [bp-5E8h]@251 |
232 signed int thisb; // [sp+14h] [bp-5E8h]@272 | |
233 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 | |
234 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 | |
1430 | 235 char *pMapName; // [sp+14h] [bp-5E8h]@445 |
0 | 236 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 |
237 int thisg; // [sp+14h] [bp-5E8h]@467 | |
238 int thish; // [sp+14h] [bp-5E8h]@528 | |
239 signed int thisi; // [sp+14h] [bp-5E8h]@535 | |
240 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604 | |
241 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641 | |
242 int thisl; // [sp+14h] [bp-5E8h]@648 | |
243 int uMessageParam; // [sp+18h] [bp-5E4h]@7 | |
244 int uAction; // [sp+1Ch] [bp-5E0h]@18 | |
245 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23 | |
246 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18 | |
247 char v197; // [sp+2Bh] [bp-5D1h]@101 | |
248 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7 | |
249 unsigned int v199; // [sp+30h] [bp-5CCh]@7 | |
250 char *v200; // [sp+34h] [bp-5C8h]@518 | |
251 POINT v201; // [sp+38h] [bp-5C4h]@553 | |
252 POINT v202; // [sp+40h] [bp-5BCh]@141 | |
253 POINT a2; // [sp+48h] [bp-5B4h]@127 | |
254 POINT v204; // [sp+50h] [bp-5ACh]@777 | |
255 POINT v205; // [sp+58h] [bp-5A4h]@171 | |
256 POINT v206; // [sp+60h] [bp-59Ch]@553 | |
257 POINT v207; // [sp+68h] [bp-594h]@155 | |
258 POINT v208; // [sp+70h] [bp-58Ch]@397 | |
259 POINT v209; // [sp+78h] [bp-584h]@777 | |
260 POINT v210; // [sp+80h] [bp-57Ch]@397 | |
261 POINT v211; // [sp+88h] [bp-574h]@704 | |
1430 | 262 //__int64 v212; // [sp+90h] [bp-56Ch]@467 |
783 | 263 int v213; // [sp+98h] [bp-564h]@385 |
264 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380 | |
265 char pOut[32]; // [sp+BCh] [bp-540h]@370 | |
0 | 266 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524 |
267 int v217[9]; // [sp+158h] [bp-4A4h]@652 | |
268 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524 | |
269 char a1[64]; // [sp+1F8h] [bp-404h]@467 | |
270 char Str2[128]; // [sp+238h] [bp-3C4h]@527 | |
271 Actor actor; // [sp+2B8h] [bp-344h]@4 | |
272 | |
273 dword_50CDC8 = 0; | |
274 if ( !pEventTimer->bPaused ) | |
275 { | |
276 pParty->sEyelevel = pParty->uDefaultEyelevel; | |
277 pParty->uPartyHeight = pParty->uDefaultPartyHeight; | |
278 } | |
279 if ( bDialogueUI_InitializeActor_NPC_ID ) | |
280 { | |
281 //Actor::Actor(&actor); | |
282 memset(&actor, 0, 0x344u); | |
283 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID; | |
602 | 284 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID; |
1033 | 285 GameUI_InitializeDialogue(&actor, false); |
0 | 286 bDialogueUI_InitializeActor_NPC_ID = 0; |
287 } | |
288 if ( pMessageQueue_50CBD0->uNumMessages ) | |
289 { | |
1025 | 290 //v1 = ""; |
0 | 291 while ( 2 ) |
292 { | |
293 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
294 break; | |
295 | |
296 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199); | |
297 switch ( uMessage ) | |
298 { | |
299 case UIMSG_ChangeGameState: | |
978 | 300 uGameState = GAME_FINISHED; |
4 | 301 continue; |
0 | 302 case UIMSG_PlayArcomage: |
303 pVideoPlayer->_4BF5B2(); | |
304 pArcomageGame->bGameInProgress = 1; | |
305 PrepareArcomage(); | |
4 | 306 continue; |
0 | 307 case UIMSG_StartNPCDialogue: |
308 if ( !uActiveCharacter ) | |
4 | 309 continue; |
978 | 310 viewparams->field_48 = 1; |
0 | 311 if ( pMessageQueue_50CBD0->uNumMessages ) |
312 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
602 | 313 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID; |
0 | 314 pActor = &pActors[uMessageParam]; |
4 | 315 //goto _actor_init_dlg; |
1033 | 316 GameUI_InitializeDialogue(pActor, true); |
4 | 317 continue; |
199 | 318 case UIMSG_StartHireling1Dialogue: |
319 case UIMSG_StartHireling2Dialogue: | |
320 { | |
321 if (bNoNPCHiring || pCurrentScreen) | |
322 continue; | |
323 | |
0 | 324 if ( pMessageQueue_50CBD0->uNumMessages ) |
325 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
326 uAction = 0; | |
201 | 327 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue; |
0 | 328 v4 = 0; |
199 | 329 |
330 for (uint i = 0; i < 2; ++i) | |
331 //pNPCData0 = pParty->pHirelings; | |
332 //do | |
333 { | |
334 if (pParty->pHirelings[i].pName) | |
335 //{ | |
336 //v6 = uAction++; | |
337 pTmpBuf[uAction++] = i; | |
338 //} | |
339 //++pNPCData0; | |
340 //++v4; | |
341 } | |
342 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem ); | |
343 | |
344 //_this = 0; | |
345 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
346 { | |
347 auto npc = pNPCStats->pNewNPCData + i; | |
348 //do | |
349 //{ | |
248 | 350 if (npc->Hired() && |
199 | 351 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) && |
352 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) ) | |
0 | 353 { |
199 | 354 //v7 =; |
355 pTmpBuf[uAction++] = i + 2; | |
0 | 356 } |
199 | 357 //++_this; |
358 //++pNPCData4; | |
359 //} | |
360 //while ( _this < (signed int)pNPCStats->uNumNewNPCs ); | |
0 | 361 } |
201 | 362 |
363 if ( (signed int)(hireling_idx + (unsigned __int8)pParty->field_709) < uAction ) | |
0 | 364 { |
365 //Actor::Actor(&actor); | |
366 memset(&actor, 0, 0x344u); | |
602 | 367 actor.sNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx; |
0 | 368 pActor = &actor; |
1033 | 369 GameUI_InitializeDialogue(&actor, true); |
0 | 370 } |
371 } | |
4 | 372 continue; |
735 | 373 |
374 case UIMSG_BuyInShop_Identify_Repair: | |
375 UIShop_Buy_Identify_Repair(); | |
376 continue; | |
467 | 377 case UIMSG_ClickNPCTopic: |
378 ClickNPCTopic(uMessageParam); | |
379 continue; | |
651 | 380 case UIMSG_SelectShopDialogueOption: |
381 OnSelectShopDialogueOption(uMessageParam); | |
382 continue; | |
383 case UIMSG_SelectNPCDialogueOption: | |
384 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); | |
4 | 385 continue; |
961 | 386 case UIMSG_ClickHouseNPCPortrait: |
0 | 387 _4B4224_UpdateNPCTopics(uMessageParam); |
4 | 388 continue; |
0 | 389 case UIMSG_StartNewGame: |
390 if ( dword_6BE138 == 124 || uMessageParam ) | |
391 { | |
1006 | 392 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
393 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 394 if ( pMessageQueue_50CBD0->uNumMessages ) |
395 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
396 pGUIWindow_CurrentMenu->Release(); | |
978 | 397 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU; |
151 | 398 pCurrentScreen = SCREEN_GAME; |
978 | 399 viewparams->bRedrawGameUI = 1; |
0 | 400 } |
401 else | |
402 { | |
403 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game" | |
404 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); | |
405 dword_6BE138 = 124; | |
406 } | |
407 stru_506E40.Release(); | |
4 | 408 continue; |
0 | 409 case UIMSG_Game_OpenLoadGameDialog: |
1006 | 410 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
411 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 412 if ( pMessageQueue_50CBD0->uNumMessages ) |
413 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
414 pGUIWindow_CurrentMenu->Release(); | |
151 | 415 pCurrentScreen = SCREEN_LOADGAME; |
1033 | 416 LoadUI_Load(1); |
4 | 417 continue; |
0 | 418 case UIMSG_Quit: |
419 if ( dword_6BE138 == 132 || uMessageParam ) | |
420 { | |
1006 | 421 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
422 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 423 if ( pMessageQueue_50CBD0->uNumMessages ) |
424 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
425 pGUIWindow_CurrentMenu->Release(); | |
151 | 426 pCurrentScreen = SCREEN_GAME; |
978 | 427 viewparams->bRedrawGameUI = 1; |
0 | 428 if ( !uMessageParam ) |
429 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0); | |
978 | 430 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU; |
0 | 431 } |
432 else | |
433 { | |
369 | 434 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit" |
0 | 435 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0); |
436 dword_6BE138 = 132; | |
437 } | |
4 | 438 stru_506E40.Release(); |
439 continue; | |
151 | 440 case UIMSG_80: |
987 | 441 __debugbreak(); |
1006 | 442 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
443 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 444 pGUIWindow_CurrentMenu->Release(); |
151 | 445 pCurrentScreen = SCREEN_OPTIONS; |
710 | 446 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0); |
11 | 447 continue; |
2 | 448 case UIMSG_ArrowUp: |
449 --pSaveListPosition; | |
450 if ( pSaveListPosition < 0 ) | |
451 pSaveListPosition = 0; | |
962 | 452 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); |
11 | 453 continue; |
2 | 454 case UIMSG_DownArrow: |
455 ++pSaveListPosition; | |
456 if ( pSaveListPosition >= uMessageParam ) | |
457 pSaveListPosition = uMessageParam - 1; | |
962 | 458 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); |
11 | 459 continue; |
2 | 460 case UIMSG_Cancel: |
962 | 461 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0); |
11 | 462 continue; |
961 | 463 case UIMSG_SaveLoadBtn: |
464 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
11 | 465 continue; |
3 | 466 case UIMSG_SelectLoadSlot: |
1038 | 467 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
468 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
151 | 469 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) |
2 | 470 { |
471 v10 = pSaveListPosition + uMessageParam; | |
472 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) | |
0 | 473 { |
961 | 474 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); |
437 | 475 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
0 | 476 } |
477 uLoadGameUI_SelectedSlot = v10; | |
478 dword_6BE138 = v10; | |
479 } | |
480 else | |
481 { | |
3 | 482 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); |
43 | 483 if ( strcmp((const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pGlobalTXT_LocalizationStrings[72]) )// "Empty" |
484 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot]); | |
0 | 485 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); |
486 } | |
4 | 487 continue; |
0 | 488 case UIMSG_LoadGame: |
489 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) | |
490 { | |
491 LoadGame(uLoadGameUI_SelectedSlot); | |
1214
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1207
diff
changeset
|
492 uGameState = GAME_STATE_LOADING_GAME; |
0 | 493 } |
4 | 494 stru_506E40.Release(); |
495 continue; | |
0 | 496 case UIMSG_SaveGame: |
1038 | 497 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
498 { | |
499 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
837 | 500 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], (const char *)pKeyActionMap->pPressedKeysBuffer); |
0 | 501 } |
502 DoSavegame(uLoadGameUI_SelectedSlot); | |
4 | 503 stru_506E40.Release(); |
504 continue; | |
151 | 505 case UIMSG_Game_OpenSaveGameDialog: |
0 | 506 pGUIWindow_CurrentMenu->Release(); |
151 | 507 pCurrentScreen = SCREEN_SAVEGAME; |
1033 | 508 SaveUI_Load(); |
4 | 509 continue; |
369 | 510 case UIMSG_Game_OpenOptionsDialog://Open |
0 | 511 if ( pMessageQueue_50CBD0->uNumMessages ) |
512 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
513 pGUIWindow_CurrentMenu->Release(); | |
978 | 514 viewparams->field_48 = 1; |
151 | 515 pCurrentScreen = SCREEN_OPTIONS; |
948 | 516 |
517 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); | |
518 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); | |
519 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); | |
520 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); | |
521 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
522 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
523 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
524 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
525 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
526 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
527 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
528 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
529 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
530 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
531 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
532 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
533 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); | |
534 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); | |
535 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); | |
536 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | |
537 | |
0 | 538 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); |
832 | 539 pGUIWindow_CurrentMenu->CreateButton(22, 270, |
948 | 540 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, |
541 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, | |
1025 | 542 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); |
948 | 543 pGUIWindow_CurrentMenu->CreateButton(93, 270, |
544 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, | |
545 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, | |
1025 | 546 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); |
948 | 547 pGUIWindow_CurrentMenu->CreateButton(164, 270, |
548 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, | |
549 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, | |
1025 | 550 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); |
948 | 551 |
552 pGUIWindow_CurrentMenu->CreateButton(20, 303, | |
553 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, | |
554 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, | |
1025 | 555 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); |
948 | 556 pGUIWindow_CurrentMenu->CreateButton(128, 303, |
557 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, | |
558 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, | |
1025 | 559 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); |
948 | 560 pGUIWindow_CurrentMenu->CreateButton(20, 325, |
561 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, | |
562 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, | |
1025 | 563 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); |
948 | 564 pGUIWindow_CurrentMenu->CreateButton(128, 325, |
565 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, | |
566 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, | |
1025 | 567 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); |
568 | |
569 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
570 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
571 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); | |
572 | |
573 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
574 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
575 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); | |
576 | |
577 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
578 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
579 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); | |
978 | 580 |
581 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" | |
1025 | 582 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0); |
583 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0); | |
948 | 584 continue; |
585 | |
369 | 586 case UIMSG_OpenKeyMappingOptions://Open |
0 | 587 if ( pMessageQueue_50CBD0->uNumMessages ) |
588 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
589 pGUIWindow_CurrentMenu->Release(); | |
590 viewparams->field_48 = 1; | |
151 | 591 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS; |
369 | 592 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); |
593 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); | |
594 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
595 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); | |
596 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); | |
0 | 597 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0); |
832 | 598 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); |
599 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0); | |
600 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0); | |
601 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0); | |
602 pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0); | |
603 pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0); | |
604 pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 1u, 0, "", 0); | |
605 pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 2u, 0, "", 0); | |
606 pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 3u, 0, "", 0); | |
607 pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, UIMSG_ChangeKeyButton, 4u, 0, "", 0); | |
608 pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 5u, 0, "", 0); | |
609 pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 6u, 0, "", 0); | |
610 pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 7u, 0, "", 0); | |
611 pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 8u, 0, "", 0); | |
612 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0); | |
613 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0); | |
614 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0); | |
615 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0); | |
616 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0); | |
1031 | 617 uGameMenuUI_CurentlySelectedKeyIdx = -1; |
362 | 618 KeyboardPageNum = 1; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
619 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags)); |
369 | 620 //*(_WORD *)KeyButtonArray[28] = 0; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
621 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); |
1025 | 622 //v1 = ""; |
978 | 623 //v0 = 1; |
11 | 624 continue; |
362 | 625 case UIMSG_ChangeKeyButton: |
1031 | 626 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) |
362 | 627 { |
628 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
629 continue; | |
630 } | |
0 | 631 v14 = uMessageParam; |
978 | 632 if ( KeyboardPageNum != 1 ) |
0 | 633 v14 = uMessageParam + 14; |
1031 | 634 uGameMenuUI_CurentlySelectedKeyIdx = v14; |
978 | 635 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu); |
4 | 636 continue; |
0 | 637 case UIMSG_ResetKeyMapping: |
638 v197 = 1; | |
639 pKeyActionMap->SetDefaultMapping(); | |
640 uAction = 0; | |
641 do | |
642 { | |
643 v15 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
644 if ( v15 != pPrevVirtualCidesMapping[uAction] ) | |
645 { | |
646 if ( v197 ) | |
647 { | |
648 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
978 | 649 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1); |
0 | 650 v197 = 0; |
651 } | |
652 else | |
653 { | |
654 v17 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
655 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0); | |
656 } | |
657 } | |
658 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
659 v18 = uAction++; | |
4 | 660 v13 = uAction > 28; |
0 | 661 v12 = uAction - 28 < 0; |
1031 | 662 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0; |
0 | 663 } |
664 while ( v12 ^ v13 ); | |
369 | 665 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); |
666 continue; | |
362 | 667 case UIMSG_SelectKeyPage1: |
978 | 668 KeyboardPageNum = 1; |
362 | 669 continue; |
670 case UIMSG_SelectKeyPage2: | |
671 KeyboardPageNum = 2; | |
4 | 672 continue; |
0 | 673 case UIMSG_OpenVideoOptions: |
674 if ( pMessageQueue_50CBD0->uNumMessages ) | |
675 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
676 pGUIWindow_CurrentMenu->Release(); | |
978 | 677 viewparams->field_48 = 1; |
151 | 678 pCurrentScreen = SCREEN_VIDEO_OPTIONS; |
0 | 679 uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); |
680 uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); | |
681 uTextureID_507C18 = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); | |
682 uTextureID_507C1C = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); | |
683 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
684 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
685 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
686 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
687 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
688 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
689 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
690 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
691 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
692 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
693 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
694 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
695 uTextureID_507C50 = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); | |
696 uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); | |
697 uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); | |
698 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0); | |
1025 | 699 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); |
0 | 700 if ( pRenderer->pRenderD3D ) |
701 { | |
1025 | 702 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0); |
703 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); | |
704 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); | |
0 | 705 } |
706 if ( !pRenderer->bWindowMode ) | |
707 { | |
978 | 708 //v0 = 1; |
0 | 709 if ( GammaController::IsGammaSupported() ) |
710 { | |
1025 | 711 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); |
712 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); | |
713 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); | |
0 | 714 } |
715 } | |
4 | 716 continue; |
151 | 717 case UIMSG_1A9: |
987 | 718 __debugbreak(); |
0 | 719 if ( uMessageParam == 4 ) |
720 { | |
151 | 721 //--uGammaPos; |
722 if ( (uGammaPos -- -1) < 0 ) | |
0 | 723 { |
724 uGammaPos = 0; | |
369 | 725 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); |
726 continue; | |
0 | 727 } |
728 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
729 pGame->pGammaController->Initialize(v19); | |
1268 | 730 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
369 | 731 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); |
732 continue; | |
0 | 733 } |
734 if ( uMessageParam == 5 ) | |
735 { | |
736 ++uGammaPos; | |
737 if ( (signed int)uGammaPos <= 9 ) | |
738 { | |
739 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
740 pGame->pGammaController->Initialize(v21); | |
1268 | 741 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
369 | 742 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); |
743 continue; | |
0 | 744 } |
745 uGammaPos = 9; | |
746 } | |
747 else | |
748 { | |
749 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17; | |
750 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6; | |
751 pGame->pGammaController->Initialize(v22); | |
752 } | |
369 | 753 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); |
754 continue; | |
0 | 755 case UIMSG_ToggleBloodsplats: |
756 pGame->ToggleFlags2(0x20u); | |
4 | 757 continue; |
0 | 758 case UIMSG_ToggleColoredLights: |
759 pRenderer->bUseColoredLights = pRenderer->bUseColoredLights == 0; | |
4 | 760 continue; |
0 | 761 case UIMSG_ToggleTint: |
762 pRenderer->bTinting = pRenderer->bTinting == 0; | |
4 | 763 continue; |
0 | 764 case UIMSG_ChangeMusicVolume: |
765 if ( uMessageParam == 4 ) | |
766 { | |
767 --uMusicVolimeMultiplier; | |
768 if ( (char)uMusicVolimeMultiplier < 1 ) | |
769 uMusicVolimeMultiplier = 0; | |
1268 | 770 GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
4 | 771 if ( uMusicVolimeMultiplier ) |
328 | 772 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); |
773 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); | |
4 | 774 continue; |
0 | 775 } |
776 if ( uMessageParam == 5 ) | |
777 { | |
778 ++uMusicVolimeMultiplier; | |
779 if ( (char)uMusicVolimeMultiplier > 9 ) | |
780 uMusicVolimeMultiplier = 9; | |
1268 | 781 GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
4 | 782 if ( uMusicVolimeMultiplier ) |
328 | 783 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); |
784 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); | |
4 | 785 continue; |
0 | 786 } |
787 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17; | |
788 if ( (char)uMusicVolimeMultiplier > 9 ) | |
789 uMusicVolimeMultiplier = 9; | |
790 if ( uMusicVolimeMultiplier ) | |
328 | 791 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0); |
792 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
4 | 793 continue; |
0 | 794 case UIMSG_ChangeSoundVolume: |
369 | 795 if ( uMessageParam == 4 )//reduce sound level button left |
0 | 796 { |
797 --uSoundVolumeMultiplier; | |
798 if ( (char)uSoundVolumeMultiplier < 1 ) | |
799 uSoundVolumeMultiplier = 0; | |
1268 | 800 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
328 | 801 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); |
802 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); | |
803 continue; | |
804 } | |
369 | 805 if ( uMessageParam == 5 )//Increase sound level button right |
0 | 806 { |
807 ++uSoundVolumeMultiplier; | |
808 if ( (char)uSoundVolumeMultiplier > 8 ) | |
809 uSoundVolumeMultiplier = 9; | |
978 | 810 //v168 = 1; |
0 | 811 v24 = 435; |
961 | 812 //v154 = (int)pBtn_SliderRight; |
1268 | 813 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
328 | 814 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); |
369 | 815 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); |
816 continue; | |
0 | 817 } |
818 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; | |
819 if ( (char)uSoundVolumeMultiplier > 8 ) | |
820 uSoundVolumeMultiplier = 9; | |
328 | 821 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); |
369 | 822 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); |
823 continue; | |
0 | 824 case UIMSG_ToggleFlipOnExit: |
825 bFlipOnExit = bFlipOnExit == 0; | |
4 | 826 continue; |
0 | 827 case UIMSG_ToggleAlwaysRun: |
828 bAlwaysRun = bAlwaysRun == 0; | |
4 | 829 continue; |
0 | 830 case UIMSG_ToggleWalkSound: |
831 bWalkSound = bWalkSound == 0; | |
4 | 832 continue; |
0 | 833 case UIMSG_ToggleShowDamage: |
834 bShowDamage = bShowDamage == 0; | |
4 | 835 continue; |
0 | 836 case UIMSG_ChangeVoiceVolume: |
837 if ( uMessageParam == 4 ) | |
838 { | |
839 --uVoicesVolumeMultiplier; | |
840 if ( (char)uVoicesVolumeMultiplier < 1 ) | |
841 uVoicesVolumeMultiplier = 0; | |
1268 | 842 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); |
4 | 843 if ( !uVoicesVolumeMultiplier ) |
844 continue; | |
369 | 845 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); |
846 continue; | |
0 | 847 } |
848 if ( uMessageParam == 5 ) | |
849 { | |
850 ++uVoicesVolumeMultiplier; | |
851 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
852 uVoicesVolumeMultiplier = 9; | |
1268 | 853 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); |
4 | 854 if ( !uVoicesVolumeMultiplier ) |
855 continue; | |
369 | 856 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); |
857 continue; | |
0 | 858 } |
859 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17; | |
860 if ( (char)uVoicesVolumeMultiplier > 8 ) | |
861 uVoicesVolumeMultiplier = 9; | |
862 if ( !uVoicesVolumeMultiplier ) | |
4 | 863 continue; |
369 | 864 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); |
865 continue; | |
0 | 866 case UIMSG_SetTurnSpeed: |
867 if ( uMessageParam ) | |
868 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam; | |
869 uTurnSpeed = uMessageParam; | |
4 | 870 continue; |
0 | 871 case UIMSG_SetGraphicsMode: |
872 if ( !bUseLoResSprites ) | |
873 { | |
874 byte_6BE388_graphicsmode = uMessageParam; | |
875 MM7Initialization(); | |
4 | 876 continue; |
0 | 877 } |
878 if ( uMessageParam ) | |
879 { | |
880 if ( uMessageParam == 1 ) | |
881 { | |
882 byte_6BE388_graphicsmode = 0; | |
883 } | |
884 else | |
885 { | |
886 if ( uMessageParam != 2 ) | |
4 | 887 continue; |
0 | 888 byte_6BE388_graphicsmode = 1; |
889 } | |
4 | 890 MM7Initialization(); |
891 continue; | |
0 | 892 } |
1458 | 893 ModalWindow(pNPCTopics[453].pText, UIMSG_0); |
4 | 894 continue; |
369 | 895 case UIMSG_GameMenu_ReturnToGame: |
0 | 896 pGUIWindow_CurrentMenu->Release(); |
897 pEventTimer->Resume(); | |
369 | 898 pCurrentScreen = SCREEN_GAME; |
978 | 899 viewparams->bRedrawGameUI = 1; |
369 | 900 stru_506E40.Release(); |
901 continue; | |
0 | 902 case UIMSG_OpenQuestBook: |
903 if ( pMessageQueue_50CBD0->uNumMessages ) | |
904 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
905 if ( pCurrentScreen ) | |
906 pGUIWindow_CurrentMenu->Release(); | |
907 pEventTimer->Pause(); | |
908 pAudioPlayer->StopChannels(-1, -1); | |
909 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | |
960 | 910 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); |
0 | 911 bFlashQuestBook = 0; |
4 | 912 continue; |
0 | 913 case UIMSG_OpenAutonotes: |
914 if ( pMessageQueue_50CBD0->uNumMessages ) | |
915 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
916 if ( pCurrentScreen ) | |
917 pGUIWindow_CurrentMenu->Release(); | |
918 pEventTimer->Pause(); | |
919 pAudioPlayer->StopChannels(-1, -1); | |
920 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | |
960 | 921 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); |
0 | 922 bFlashAutonotesBook = 0; |
4 | 923 continue; |
0 | 924 case UIMSG_OpenMapBook: |
925 if ( pMessageQueue_50CBD0->uNumMessages ) | |
926 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
927 if ( pCurrentScreen ) | |
928 pGUIWindow_CurrentMenu->Release(); | |
929 pEventTimer->Pause(); | |
693 | 930 viewparams->sViewCenterX = pParty->vPosition.x; |
931 viewparams->sViewCenterY = pParty->vPosition.y; | |
0 | 932 pAudioPlayer->StopChannels(-1, -1); |
960 | 933 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); |
934 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); | |
4 | 935 continue; |
0 | 936 case UIMSG_OpenCalendar: |
937 if ( pMessageQueue_50CBD0->uNumMessages ) | |
938 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
939 if ( pCurrentScreen ) | |
940 pGUIWindow_CurrentMenu->Release(); | |
941 pEventTimer->Pause(); | |
942 pAudioPlayer->StopChannels(-1, -1); | |
369 | 943 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); |
960 | 944 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); |
4 | 945 continue; |
0 | 946 case UIMSG_OpenHistoryBook: |
947 if ( pMessageQueue_50CBD0->uNumMessages ) | |
948 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
949 if ( pCurrentScreen ) | |
950 pGUIWindow_CurrentMenu->Release(); | |
951 pEventTimer->Pause(); | |
952 pAudioPlayer->StopChannels(-1, -1); | |
953 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | |
960 | 954 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); |
0 | 955 bFlashHistoryBook = 0; |
4 | 956 continue; |
369 | 957 case UIMSG_Escape:// íàæàòèå Escape and return to game |
0 | 958 back_to_game(); |
959 if ( pMessageQueue_50CBD0->uNumMessages ) | |
960 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
990 | 961 switch ( pCurrentScreen ) |
962 { | |
963 case SCREEN_E: | |
964 __debugbreak(); | |
965 case SCREEN_NPC_DIALOGUE: | |
966 case SCREEN_CHEST: | |
967 case SCREEN_CHEST_INVENTORY: | |
968 case SCREEN_CHANGE_LOCATION: | |
969 case SCREEN_INPUT_BLV: | |
970 case SCREEN_QUICK_REFERENCE: | |
0 | 971 if ( dword_50CDC8 ) |
990 | 972 break; |
11 | 973 CloseWindowBackground(); |
978 | 974 uMessageParam = 1; |
990 | 975 break; |
976 case SCREEN_HOUSE: | |
977 if ( !dword_50CDC8 && !dword_5C35C8 ) | |
978 { | |
979 CloseWindowBackground(); | |
980 dword_5C35C8 = 0; | |
981 uMessageParam = 1; | |
982 break; | |
983 } | |
984 break; | |
985 } | |
1458 | 986 if ( !pModalWindow ) |
0 | 987 { |
988 pRenderer->ClearZBuffer(0, 479); | |
978 | 989 viewparams->bRedrawGameUI = 1; |
990 viewparams->field_48 = 1; | |
0 | 991 if ( pCurrentScreen ) |
992 { | |
151 | 993 if ( pCurrentScreen > SCREEN_67 ) |
0 | 994 { |
151 | 995 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE ) |
990 | 996 { |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
997 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
990 | 998 if ( pGUIWindow_Settings ) |
999 { | |
1000 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
1001 { | |
1002 pMouse->SetCursorBitmap("MICON2"); | |
1003 } | |
1004 else | |
1005 { | |
1006 pGUIWindow_Settings->Release(); | |
1007 pGUIWindow_Settings = 0; | |
1008 pMouse->SetCursorBitmap("MICON1"); | |
1009 GameUI_Footer_TimeLeft = 0; | |
1010 unk_50C9A0 = 0; | |
1011 back_to_game(); | |
1012 } | |
1013 } | |
1014 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
1015 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1016 pGUIWindow_CurrentMenu->Release(); | |
1017 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1018 window_SpeakInHouse = 0; | |
1019 pGUIWindow_CurrentMenu = 0; | |
1020 pEventTimer->Resume(); | |
1021 pCurrentScreen = SCREEN_GAME; | |
1022 viewparams->bRedrawGameUI = 1; | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1023 pIcons_LOD->RemoveTexturesFromTextureList(); |
990 | 1024 continue; |
1025 } | |
0 | 1026 } |
1027 else | |
1028 { | |
151 | 1029 if ( pCurrentScreen < SCREEN_64 ) |
0 | 1030 { |
1031 switch ( pCurrentScreen ) | |
1032 { | |
151 | 1033 case SCREEN_CASTING: |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1034 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 1035 if ( some_active_character ) |
1036 { | |
1037 uActiveCharacter = some_active_character; | |
1038 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1039 some_active_character = 0; | |
1040 if ( pParty->bTurnBasedModeOn ) | |
1448 | 1041 pTurnEngine->ApplyPlayerAction(); |
0 | 1042 dword_50C9D0 = 0; |
1043 dword_50C9D4 = 0; | |
1044 dword_50C9D8 = 0; | |
1045 } | |
1046 if ( ptr_50C9A4 && ptr_50C9A4->uItemID ) | |
1047 { | |
1048 LOBYTE(ptr_50C9A4->uAttributes) &= 0xFu; | |
984 | 1049 _50C9A8_item_enchantment_timer = 0; |
0 | 1050 ptr_50C9A4 = 0; |
1051 } | |
4 | 1052 if ( pGUIWindow_Settings ) |
1053 { | |
151 | 1054 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1055 { |
1056 pMouse->SetCursorBitmap("MICON2"); | |
1057 } | |
1058 else | |
1059 { | |
1060 pGUIWindow_Settings->Release(); | |
1061 pGUIWindow_Settings = 0; | |
1062 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1063 GameUI_Footer_TimeLeft = 0; |
4 | 1064 unk_50C9A0 = 0; |
1065 back_to_game(); | |
1066 } | |
1067 } | |
978 | 1068 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1069 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1070 pGUIWindow_CurrentMenu->Release(); | |
336 | 1071 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1072 window_SpeakInHouse = 0; | |
4 | 1073 pGUIWindow_CurrentMenu = 0; |
1074 pEventTimer->Resume(); | |
151 | 1075 pCurrentScreen = SCREEN_GAME; |
978 | 1076 viewparams->bRedrawGameUI = 1; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1077 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1078 continue; |
151 | 1079 case SCREEN_BOOKS: |
0 | 1080 pBooksWindow->Release(); |
1081 //crt_deconstruct_ptr_6A0118(); | |
1082 pBooksWindow = 0; | |
1083 pEventTimer->Resume(); | |
4 | 1084 if ( pGUIWindow_Settings ) |
1085 { | |
151 | 1086 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1087 { |
1088 pMouse->SetCursorBitmap("MICON2"); | |
1089 } | |
1090 else | |
1091 { | |
1092 pGUIWindow_Settings->Release(); | |
1093 pGUIWindow_Settings = 0; | |
1094 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1095 GameUI_Footer_TimeLeft = 0; |
4 | 1096 unk_50C9A0 = 0; |
1097 back_to_game(); | |
1098 } | |
1099 } | |
978 | 1100 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1101 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1102 pGUIWindow_CurrentMenu->Release(); | |
336 | 1103 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1104 window_SpeakInHouse = 0; | |
4 | 1105 pGUIWindow_CurrentMenu = 0; |
1106 pEventTimer->Resume(); | |
151 | 1107 pCurrentScreen = SCREEN_GAME; |
978 | 1108 viewparams->bRedrawGameUI = 1; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1109 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1110 continue; |
151 | 1111 case SCREEN_SAVEGAME: |
1112 case SCREEN_LOADGAME: | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1113 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 1114 //crt_deconstruct_ptr_6A0118(); |
4 | 1115 stru_506E40.Release(); |
1116 break; | |
987 | 1117 case SCREEN_CHEST_INVENTORY: |
151 | 1118 pCurrentScreen = SCREEN_CHEST; |
4 | 1119 continue; |
151 | 1120 case SCREEN_CHEST: |
0 | 1121 pWindow2 = pChestWindow; |
1122 pWindow2->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1123 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
151 | 1124 pCurrentScreen = SCREEN_GAME; |
978 | 1125 viewparams->bRedrawGameUI = 1; |
0 | 1126 pEventTimer->Resume(); |
4 | 1127 continue; |
151 | 1128 case SCREEN_19: |
987 | 1129 __debugbreak(); |
4 | 1130 pWindow2 = ptr_507BC8; |
1131 pWindow2->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1132 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
151 | 1133 pCurrentScreen = SCREEN_GAME; |
978 | 1134 viewparams->bRedrawGameUI = 1; |
4 | 1135 pEventTimer->Resume(); |
1136 continue; | |
369 | 1137 case SCREEN_OPTIONS://Close |
948 | 1138 options_menu_skin.Relaease(); |
1006 | 1139 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1140 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); |
1141 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); | |
1142 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); | |
1143 WriteWindowsRegistryInt("WalkSound", bWalkSound); | |
1144 WriteWindowsRegistryInt("ShowDamage", bShowDamage); | |
1145 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode); | |
1146 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); | |
1147 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit); | |
1148 if ( !uTurnSpeed ) | |
1149 { | |
978 | 1150 WriteWindowsRegistryInt("TurnDelta", 3); |
4 | 1151 stru_506E40.Release(); |
1152 break; | |
0 | 1153 } |
1154 if ( uTurnSpeed == 64 ) | |
1155 { | |
978 | 1156 WriteWindowsRegistryInt("TurnDelta", 2); |
4 | 1157 stru_506E40.Release(); |
1158 break; | |
0 | 1159 } |
1160 if ( uTurnSpeed != 128 ) | |
4 | 1161 { |
1162 stru_506E40.Release(); | |
1163 break; | |
1164 } | |
978 | 1165 WriteWindowsRegistryInt("TurnDelta", 1); |
0 | 1166 stru_506E40.Release(); |
1167 break; | |
151 | 1168 case SCREEN_MENU: |
1006 | 1169 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1170 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
1006 | 1171 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1172 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
4 | 1173 stru_506E40.Release(); |
1174 break; | |
151 | 1175 case SCREEN_VIDEO_OPTIONS: |
0 | 1176 if ( pRenderer->pRenderD3D ) |
1177 { | |
1178 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights); | |
1179 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting); | |
1180 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1); | |
1181 } | |
1182 if ( pRenderer->bWindowMode ) | |
4 | 1183 { |
1184 stru_506E40.Release(); | |
1185 break; | |
1186 } | |
978 | 1187 //v30 = uGammaPos; |
1188 //v31 = "GammaPos"; | |
1189 WriteWindowsRegistryInt("GammaPos", uGammaPos); | |
4 | 1190 stru_506E40.Release(); |
1191 break; | |
1031 | 1192 |
369 | 1193 case SCREEN_KEYBOARD_OPTIONS://Return to game |
0 | 1194 v197 = 1; |
1195 v32 = 0; | |
1031 | 1196 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32]) |
0 | 1197 { |
1198 ++v32; | |
1199 if ( v32 >= 28 ) | |
1200 { | |
362 | 1201 thisb = (signed int)&uTextureID_Optkb; |
1031 | 1202 assert(false && "Invalid condition values"); |
0 | 1203 do |
1204 { | |
1205 if ( *(int *)thisb ) | |
1206 pIcons_LOD->pTextures[*(int *)thisb].Release(); | |
1207 thisb += 4; | |
1208 } | |
1031 | 1209 while ( thisb < (signed int)0x00507C08 ); |
1210 | |
362 | 1211 memset(&uTextureID_Optkb, 0, 0x14u); |
1006 | 1212 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1213 uAction = 0; |
1214 do | |
1215 { | |
1216 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1217 if ( v33 != pPrevVirtualCidesMapping[uAction] ) | |
1218 { | |
1219 if ( v197 ) | |
1220 { | |
1221 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
978 | 1222 GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1); |
0 | 1223 v197 = 0; |
1224 } | |
1225 else | |
1226 { | |
1227 v35 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); | |
1228 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0); | |
1229 } | |
1230 } | |
978 | 1231 if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 ) |
1232 pKeyToggleType = (KeyToggleType)1; | |
0 | 1233 else |
1234 pKeyToggleType = (KeyToggleType)0; | |
1235 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType); | |
1236 ++uAction; | |
1237 } | |
1238 while ( uAction < 28 ); | |
1239 pKeyActionMap->StoreMappings(); | |
4 | 1240 stru_506E40.Release(); |
1241 break; | |
0 | 1242 } |
1243 } | |
369 | 1244 break; |
916 | 1245 case SCREEN_REST://close rest screen |
0 | 1246 if ( dword_506F14 ) |
1247 { | |
1396 | 1248 Rest(_506F18_num_minutes_to_sleep); |
1520 | 1249 pParty->pPlayers[3].SetAsleep(false); |
1250 pParty->pPlayers[2].SetAsleep(false); | |
1251 pParty->pPlayers[1].SetAsleep(false); | |
1252 pParty->pPlayers[0].SetAsleep(false); | |
0 | 1253 } |
1254 pTexture_RestUI_CurrentSkyFrame->Release(); | |
1255 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
1256 pTexture_RestUI_CurrentHourglassFrame = 0; | |
1257 pTexture_RestUI_CurrentSkyFrame = 0; | |
1006 | 1258 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1259 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
1520 | 1260 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
1261 { | |
1262 pOutdoor->UpdateSunlightVectors(); | |
1263 pOutdoor->UpdateFog(); | |
1264 } | |
1396 | 1265 _506F18_num_minutes_to_sleep = 0; |
0 | 1266 dword_506F14 = 0; |
978 | 1267 dword_507B94 = 1; |
4 | 1268 if ( pGUIWindow_Settings ) |
1269 { | |
151 | 1270 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1271 { |
1272 pMouse->SetCursorBitmap("MICON2"); | |
1273 } | |
1274 else | |
1275 { | |
1276 pGUIWindow_Settings->Release(); | |
1277 pGUIWindow_Settings = 0; | |
1278 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1279 GameUI_Footer_TimeLeft = 0; |
4 | 1280 unk_50C9A0 = 0; |
1281 back_to_game(); | |
1282 } | |
1520 | 1283 } |
1284 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
4 | 1285 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1520 | 1286 pGUIWindow_CurrentMenu->Release(); |
1287 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1288 window_SpeakInHouse = 0; | |
1289 pGUIWindow_CurrentMenu = 0; | |
1290 pEventTimer->Resume(); | |
1291 pCurrentScreen = SCREEN_GAME; | |
1292 viewparams->bRedrawGameUI = 1; | |
1293 pIcons_LOD->RemoveTexturesFromTextureList(); | |
1294 continue; | |
151 | 1295 case SCREEN_E: |
987 | 1296 __debugbreak(); |
0 | 1297 pGUIWindow_CurrentMenu->Release(); |
151 | 1298 pCurrentScreen = SCREEN_HOUSE; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1299 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
4 | 1300 continue; |
151 | 1301 case SCREEN_HOUSE: |
0 | 1302 if ( uDialogueType ) |
1303 uDialogueType = 0; | |
978 | 1304 if ( uGameState == GAME_STATE_2 ) |
0 | 1305 { |
1306 while ( sub_4BD8B5() ) | |
1307 ; | |
1308 } | |
1309 else | |
1310 { | |
1311 if ( sub_4BD8B5() ) | |
4 | 1312 continue; |
0 | 1313 } |
1407 | 1314 GetHouseGoodbyeSpeech(); |
978 | 1315 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); |
0 | 1316 pVideoPlayer->Unload(); |
336 | 1317 pGUIWindow_CurrentMenu = window_SpeakInHouse; |
4 | 1318 if ( pGUIWindow_Settings ) |
1319 { | |
151 | 1320 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1321 { |
1322 pMouse->SetCursorBitmap("MICON2"); | |
1323 } | |
1324 else | |
1325 { | |
1326 pGUIWindow_Settings->Release(); | |
1327 pGUIWindow_Settings = 0; | |
1328 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1329 GameUI_Footer_TimeLeft = 0; |
4 | 1330 unk_50C9A0 = 0; |
1331 back_to_game(); | |
1332 } | |
1333 } | |
978 | 1334 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1335 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1336 pGUIWindow_CurrentMenu->Release(); | |
336 | 1337 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1338 window_SpeakInHouse = 0; | |
4 | 1339 pGUIWindow_CurrentMenu = 0; |
1340 pEventTimer->Resume(); | |
151 | 1341 pCurrentScreen = SCREEN_GAME; |
1035 | 1342 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1343 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1344 continue; |
987 | 1345 case SCREEN_INPUT_BLV://click escape |
0 | 1346 if ( uCurrentHouse_Animation == 153 ) |
735 | 1347 PlayHouseSound(0x99u, HouseSound_Greeting_2); |
0 | 1348 pVideoPlayer->Unload(); |
4 | 1349 if ( dword_5B65CC ) |
1350 { | |
1351 pParty->field_709 = 0; | |
1352 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | |
1035 | 1353 pParty->CountHirelings(); |
1354 viewparams->bRedrawGameUI = true; | |
4 | 1355 dword_5B65CC = 0; |
1356 } | |
987 | 1357 DialogueEnding(); |
1358 pCurrentScreen = SCREEN_GAME; | |
1035 | 1359 viewparams->bRedrawGameUI = true; |
987 | 1360 continue; |
1361 case SCREEN_NPC_DIALOGUE://click escape | |
0 | 1362 if ( dword_5B65CC ) |
1363 { | |
1364 pParty->field_709 = 0; | |
1365 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | |
1035 | 1366 pParty->CountHirelings(); |
1367 viewparams->bRedrawGameUI = true; | |
0 | 1368 dword_5B65CC = 0; |
1369 } | |
987 | 1370 //goto LABEL_317; |
1371 DialogueEnding(); | |
1372 pCurrentScreen = SCREEN_GAME; | |
1035 | 1373 viewparams->bRedrawGameUI = true; |
987 | 1374 continue; |
1375 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1376 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); |
0 | 1377 sub_4452BB(); |
987 | 1378 DialogueEnding(); |
1379 pCurrentScreen = SCREEN_GAME; | |
1035 | 1380 viewparams->bRedrawGameUI = true; |
987 | 1381 continue; |
1382 case SCREEN_CHANGE_LOCATION://click escape | |
0 | 1383 if ( pParty->vPosition.x < -22528 ) |
1384 pParty->vPosition.x = -22528; | |
1385 if ( pParty->vPosition.x > 22528 ) | |
1386 pParty->vPosition.x = 22528; | |
1387 if ( pParty->vPosition.y < -22528 ) | |
1388 pParty->vPosition.y = -22528; | |
1389 if ( pParty->vPosition.y > 22528 ) | |
1390 pParty->vPosition.y = 22528; | |
987 | 1391 DialogueEnding(); |
1392 pCurrentScreen = SCREEN_GAME; | |
1035 | 1393 viewparams->bRedrawGameUI = true; |
987 | 1394 continue; |
151 | 1395 case SCREEN_VIDEO: |
0 | 1396 pVideoPlayer->Unload(); |
4 | 1397 continue; |
151 | 1398 case SCREEN_CHARACTERS: |
992 | 1399 CharacterUI_ReleaseButtons(); |
1458 | 1400 ReleaseAwardsScrollBar(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1401 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
990 | 1402 if ( pGUIWindow_Settings ) |
1403 { | |
1404 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
1405 { | |
1406 pMouse->SetCursorBitmap("MICON2"); | |
1407 } | |
1408 else | |
1409 { | |
1410 pGUIWindow_Settings->Release(); | |
1411 pGUIWindow_Settings = 0; | |
1412 pMouse->SetCursorBitmap("MICON1"); | |
1413 GameUI_Footer_TimeLeft = 0; | |
1414 unk_50C9A0 = 0; | |
1415 back_to_game(); | |
1416 } | |
1417 } | |
1418 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
1419 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1420 pGUIWindow_CurrentMenu->Release(); | |
1421 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1422 window_SpeakInHouse = 0; | |
1423 pGUIWindow_CurrentMenu = 0; | |
1424 pEventTimer->Resume(); | |
1425 pCurrentScreen = SCREEN_GAME; | |
1035 | 1426 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1427 pIcons_LOD->RemoveTexturesFromTextureList(); |
990 | 1428 continue; |
0 | 1429 default: |
4 | 1430 if ( pGUIWindow_Settings ) |
1431 { | |
151 | 1432 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1433 { |
1434 pMouse->SetCursorBitmap("MICON2"); | |
1435 } | |
1436 else | |
1437 { | |
1438 pGUIWindow_Settings->Release(); | |
1439 pGUIWindow_Settings = 0; | |
1440 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1441 GameUI_Footer_TimeLeft = 0; |
4 | 1442 unk_50C9A0 = 0; |
1443 back_to_game(); | |
1444 } | |
1445 } | |
978 | 1446 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1447 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1448 pGUIWindow_CurrentMenu->Release(); | |
336 | 1449 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1450 window_SpeakInHouse = 0; | |
4 | 1451 pGUIWindow_CurrentMenu = 0; |
1452 pEventTimer->Resume(); | |
151 | 1453 pCurrentScreen = SCREEN_GAME; |
978 | 1454 viewparams->bRedrawGameUI = 1; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1455 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1456 continue; |
0 | 1457 } |
4 | 1458 if ( pGUIWindow_Settings ) |
1459 { | |
151 | 1460 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1461 { |
1462 pMouse->SetCursorBitmap("MICON2"); | |
1463 } | |
1464 else | |
1465 { | |
1466 pGUIWindow_Settings->Release(); | |
1467 pGUIWindow_Settings = 0; | |
1468 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1469 GameUI_Footer_TimeLeft = 0; |
4 | 1470 unk_50C9A0 = 0; |
1471 back_to_game(); | |
1472 } | |
1473 } | |
978 | 1474 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1475 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1476 pGUIWindow_CurrentMenu->Release(); | |
336 | 1477 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1478 window_SpeakInHouse = 0; | |
4 | 1479 pGUIWindow_CurrentMenu = 0; |
1480 pEventTimer->Resume(); | |
151 | 1481 pCurrentScreen = SCREEN_GAME; |
1035 | 1482 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1483 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1484 continue; |
0 | 1485 } |
991 | 1486 CharacterUI_ReleaseButtons(); |
1458 | 1487 ReleaseAwardsScrollBar(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1488 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 1489 } |
1490 if ( pGUIWindow_Settings ) | |
1491 { | |
151 | 1492 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
0 | 1493 { |
1494 pMouse->SetCursorBitmap("MICON2"); | |
1495 } | |
1496 else | |
1497 { | |
1498 pGUIWindow_Settings->Release(); | |
1499 pGUIWindow_Settings = 0; | |
1500 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1501 GameUI_Footer_TimeLeft = 0; |
0 | 1502 unk_50C9A0 = 0; |
1503 back_to_game(); | |
1504 } | |
1505 } | |
978 | 1506 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
0 | 1507 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1508 pGUIWindow_CurrentMenu->Release(); | |
336 | 1509 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1510 window_SpeakInHouse = 0; | |
0 | 1511 pGUIWindow_CurrentMenu = 0; |
1512 pEventTimer->Resume(); | |
151 | 1513 pCurrentScreen = SCREEN_GAME; |
1035 | 1514 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1515 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1516 continue; |
0 | 1517 } |
1518 if ( !pGUIWindow_Settings )//Draw Menu | |
1519 { | |
1520 dword_6BE138 = -1; | |
1268 | 1521 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); |
0 | 1522 pEventTimer->Pause(); |
1523 pAudioPlayer->StopChannels(-1, -1); | |
1035 | 1524 pCurrentScreen = SCREEN_MENU; |
1525 | |
0 | 1526 ++pIcons_LOD->uTexturePacksCount; |
1527 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
1528 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
1035 | 1529 |
961 | 1530 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0); |
362 | 1531 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); |
1532 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
1533 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
1534 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
1535 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
1536 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
1537 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
978 | 1538 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, |
0 | 1539 pGlobalTXT_LocalizationStrings[614],// "New Game" |
710 | 1540 pIcons_LOD->GetTexture(uTextureID_New1), 0); |
978 | 1541 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, |
0 | 1542 pGlobalTXT_LocalizationStrings[615],// "Save Game" |
710 | 1543 pIcons_LOD->GetTexture(uTextureID_Save1), 0); |
978 | 1544 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, |
0 | 1545 pGlobalTXT_LocalizationStrings[616],// "Load Game" |
710 | 1546 pIcons_LOD->GetTexture(uTextureID_Load1), 0); |
978 | 1547 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, |
0 | 1548 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" |
710 | 1549 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); |
978 | 1550 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, |
0 | 1551 pGlobalTXT_LocalizationStrings[618],// "Quit" |
710 | 1552 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); |
978 | 1553 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, |
0 | 1554 pGlobalTXT_LocalizationStrings[619],// "Return to Game" |
710 | 1555 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); |
978 | 1556 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); |
1557 viewparams->field_48 = 1; | |
0 | 1558 stru_506E40.Release(); |
1559 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); | |
1560 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | |
1561 free((void *)uNumSeconds); | |
1562 stru_506E40._40E55E("gamma.pcx", 0); | |
4 | 1563 continue; |
0 | 1564 } |
1000 | 1565 pGUIWindow_Settings->Release(); |
11 | 1566 pGUIWindow_Settings = 0; |
1567 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1568 GameUI_Footer_TimeLeft = 0; |
11 | 1569 unk_50C9A0 = 0; |
1570 back_to_game(); | |
1571 continue; | |
0 | 1572 } |
1458 | 1573 ModalWindow_Release(); |
0 | 1574 continue; |
111 | 1575 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel |
0 | 1576 if ( uMessageParam ) |
1577 { | |
962 | 1578 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); |
0 | 1579 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; |
1580 if ( (unsigned __int8)pParty->field_709 < v37 ) | |
1581 { | |
111 | 1582 ++pParty->field_709;//??? maybe number of the first cell??? |
0 | 1583 if ( (unsigned __int8)pParty->field_709 >= v37 ) |
1584 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; | |
1585 } | |
1586 } | |
1587 else | |
1588 { | |
962 | 1589 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); |
0 | 1590 if ( pParty->field_709 ) |
1591 { | |
1592 --pParty->field_709; | |
1593 if ( pParty->field_709 < 1 ) | |
1594 pParty->field_709 = 0; | |
1595 } | |
1596 } | |
994 | 1597 GameUI_DrawHiredNPCs(); |
4 | 1598 continue; |
434 | 1599 case UIMSG_TransitionUI_Confirm: |
0 | 1600 if ( pMessageQueue_50CBD0->uNumMessages ) |
1601 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
978 | 1602 dword_50CDC8 = 1; |
0 | 1603 sub_42FBDD(); |
758 | 1604 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); |
0 | 1605 pVideoPlayer->Unload(); |
960 | 1606 DialogueEnding(); |
978 | 1607 viewparams->bRedrawGameUI = 1; |
0 | 1608 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
1609 { | |
1610 if ( dword_59117C_teleportx ) | |
1611 { | |
1612 pParty->vPosition.x = dword_59117C_teleportx; | |
1613 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx; | |
1614 } | |
1615 if ( dword_591178_teleporty ) | |
1616 { | |
1617 pParty->vPosition.y = dword_591178_teleporty; | |
1618 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty; | |
1619 } | |
1620 if ( dword_591174_teleportz ) | |
1621 { | |
1622 pParty->vPosition.z = dword_591174_teleportz; | |
1623 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz; | |
1624 pParty->uFallStartY = dword_591174_teleportz; | |
1625 } | |
1626 if ( dword_591170_teleport_directiony ) | |
1627 { | |
1628 pParty->sRotationY = dword_591170_teleport_directiony; | |
1629 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony; | |
1630 } | |
1631 if ( dword_59116C_teleport_directionx ) | |
1632 { | |
1633 pParty->sRotationX = dword_59116C_teleport_directionx; | |
1634 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx; | |
1635 v38 = dword_591168_teleport_speedz; | |
1636 pParty->uFallSpeed = dword_591168_teleport_speedz; | |
1637 dword_5B65BC = dword_591168_teleport_speedz; | |
1638 } | |
1639 else | |
1640 { | |
1641 v38 = dword_5B65BC; | |
1642 } | |
1643 if ( *dword_591164_teleport_map_name != 48 ) | |
1644 { | |
1645 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; | |
1646 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38; | |
1647 OnMapLeave(); | |
783 | 1648 sub_44987B(dword_591164_teleport_map_name, MapStartPoint_Party); |
0 | 1649 } |
1650 } | |
1651 else | |
1652 { | |
1052 | 1653 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); |
1654 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1655 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") ) |
0 | 1656 pParty->uTimePlayed += 1474560i64; |
4 | 1657 continue; |
960 | 1658 case UIMSG_TransitionWindowCloseBtn: |
11 | 1659 CloseWindowBackground(); |
0 | 1660 pVideoPlayer->Unload(); |
960 | 1661 DialogueEnding(); |
1035 | 1662 viewparams->bRedrawGameUI = true; |
910 | 1663 continue; |
0 | 1664 case UIMSG_CycleCharacters: |
1665 v39 = GetAsyncKeyState(VK_SHIFT); | |
910 | 1666 uActiveCharacter = CycleCharacter(v39); |
1035 | 1667 viewparams->bRedrawGameUI = true; |
910 | 1668 continue; |
783 | 1669 case UIMSG_OnTravelByFoot: |
0 | 1670 if ( pMessageQueue_50CBD0->uNumMessages ) |
1671 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
978 | 1672 dword_50CDC8 = 1; |
0 | 1673 sub_42FBDD(); |
1430 | 1674 //pNPCData4 = (NPCData *)GetTravelTime(); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1675 strcpy(pOutdoor->pLevelFilename, pCurrentMapName); |
0 | 1676 if ( bUnderwater != 1 && pParty->bFlying |
978 | 1677 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) |
1678 { | |
1679 viewparams->bRedrawGameUI = 1; | |
11 | 1680 CloseWindowBackground(); |
0 | 1681 if ( pParty->vPosition.x < -22528 ) |
1682 pParty->vPosition.x = -22528; | |
1683 if ( pParty->vPosition.x > 22528 ) | |
1684 pParty->vPosition.x = 22528; | |
1685 if ( pParty->vPosition.y < -22528 ) | |
1686 pParty->vPosition.y = -22528; | |
1687 if ( pParty->vPosition.y > 22528 ) | |
1688 pParty->vPosition.y = 22528; | |
960 | 1689 DialogueEnding(); |
151 | 1690 pCurrentScreen = SCREEN_GAME; |
0 | 1691 } |
1692 else | |
1693 { | |
1694 pParty->field_6E4 = 0; | |
1695 pParty->field_6E0 = 0; | |
1517 | 1696 CastSpellInfoHelpers::_427D48(); |
960 | 1697 DialogueEnding(); |
0 | 1698 pEventTimer->Pause(); |
434 | 1699 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); |
0 | 1700 ++pGameLoadingUI_ProgressBar->uProgressMax; |
978 | 1701 SaveGame(1, 0); |
0 | 1702 pGameLoadingUI_ProgressBar->Progress(); |
1430 | 1703 RestAndHeal(1440 * (signed int)GetTravelTime()); |
0 | 1704 if ( pParty->uNumFoodRations ) |
1705 { | |
1706 pParty->RestAndHeal(); | |
1430 | 1707 if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) |
0 | 1708 { |
1709 pPlayer7 = pParty->pPlayers; | |
1710 do | |
1711 { | |
978 | 1712 pPlayer7->SetCondition(1, 0); |
0 | 1713 ++pPlayer7; |
1714 } | |
1715 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); | |
766 | 1716 ++pParty->days_played_without_rest; |
0 | 1717 } |
1430 | 1718 Party::TakeFood((unsigned int)GetTravelTime()); |
0 | 1719 } |
1720 else | |
1721 { | |
1722 pPlayer8 = pParty->pPlayers; | |
1723 do | |
1724 { | |
978 | 1725 pPlayer8->SetCondition(1, 0); |
0 | 1726 ++pPlayer8; |
1727 } | |
1728 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings ); | |
766 | 1729 ++pParty->days_played_without_rest; |
0 | 1730 } |
1731 pPaletteManager->ResetNonLocked(); | |
1732 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1733 strcpy(pCurrentMapName, pOut); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1734 strcpy(pLevelName, pCurrentMapName); |
783 | 1735 v41 = strtok(pLevelName, "."); |
1736 strcpy(pLevelName, v41); | |
1737 Level_LoadEvtAndStr(pLevelName); | |
1738 pDecalBuilder->Reset(0); | |
0 | 1739 LoadLevel_InitializeLevelEvt(); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1740 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName); |
0 | 1741 bUnderwater = 0; |
1742 bNoNPCHiring = 0; | |
1743 pGame->uFlags2 &= 0xFFFFFFF7u; | |
1744 if ( Is_out15odm_underwater() ) | |
1745 { | |
1746 bUnderwater = 1; | |
1747 pGame->uFlags2 |= 8u; | |
1748 } | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1749 if ( !_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv") ) |
0 | 1750 bNoNPCHiring = 1; |
1751 PrepareToLoadODM(1u, (OutdoorCamera *)1); | |
1752 pAudioPlayer->SetMapEAX(); | |
1753 bDialogueUI_InitializeActor_NPC_ID = 0; | |
1754 OnMapLoad(); | |
1755 pOutdoor->SetFog(); | |
1756 TeleportToStartingPoint(uLevel_StartingPointType); | |
783 | 1757 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); |
0 | 1758 pParty->uFallStartY = pParty->vPosition.z; |
1459 | 1759 _461103_load_level_sub(); |
0 | 1760 pEventTimer->Resume(); |
1761 viewparams->bRedrawGameUI = 1; | |
151 | 1762 pCurrentScreen = SCREEN_GAME; |
0 | 1763 pGameLoadingUI_ProgressBar->Release(); |
1764 } | |
978 | 1765 viewparams->bRedrawGameUI = 1; |
910 | 1766 continue; |
987 | 1767 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: |
1768 CloseWindowBackground(); | |
1769 if ( pParty->vPosition.x < -22528 ) | |
1770 pParty->vPosition.x = -22528; | |
1771 if ( pParty->vPosition.x > 22528 ) | |
1772 pParty->vPosition.x = 22528; | |
1773 if ( pParty->vPosition.y < -22528 ) | |
1774 pParty->vPosition.y = -22528; | |
1775 if ( pParty->vPosition.y > 22528 ) | |
1776 pParty->vPosition.y = 22528; | |
1777 DialogueEnding(); | |
1778 pCurrentScreen = SCREEN_GAME; | |
1779 viewparams->bRedrawGameUI = 1; | |
1780 continue; | |
1326 | 1781 case UIMSG_CastSpell_Telekinesis: |
0 | 1782 if ( pRenderer->pRenderD3D ) |
1783 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1784 else | |
1785 { | |
1786 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | |
1787 pPoint = pMouse->GetCursorPos(&v208); | |
1788 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | |
1789 } | |
1790 v44 = (unsigned __int16)v42; | |
848 | 1791 v45 = PID_TYPE(v44); |
0 | 1792 uNumSeconds = v44; |
848 | 1793 v46 = PID_ID(v44); |
0 | 1794 if ( v45 == 3 ) |
1795 { | |
1796 v47 = pActors[v46].uAIState == Dead; | |
11 | 1797 if ( !v47 ) |
1798 continue; | |
1000 | 1799 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1519 | 1800 pSpellInfo->uFlags &= ~0x40u; |
1000 | 1801 pSpellInfo->uPlayerID_2 = uMessageParam; |
1802 pSpellInfo->spell_target_pid = v44; | |
1803 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1804 pGUIWindow_Settings->Release(); | |
11 | 1805 pGUIWindow_Settings = 0; |
1806 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1807 GameUI_Footer_TimeLeft = 0; |
11 | 1808 unk_50C9A0 = 0; |
1809 back_to_game(); | |
1810 continue; | |
0 | 1811 } |
1812 if ( v45 == 2 ) | |
1813 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
1814 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; |
0 | 1815 if ( !v47 ) |
4 | 1816 continue; |
1000 | 1817 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1519 | 1818 pSpellInfo->uFlags &= ~0x40u; |
1000 | 1819 pSpellInfo->uPlayerID_2 = uMessageParam; |
1820 pSpellInfo->spell_target_pid = v44; | |
1821 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1822 pGUIWindow_Settings->Release(); | |
11 | 1823 pGUIWindow_Settings = 0; |
1824 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1825 GameUI_Footer_TimeLeft = 0; |
11 | 1826 unk_50C9A0 = 0; |
1827 back_to_game(); | |
1828 continue; | |
0 | 1829 } |
1830 if ( v45 == 5 ) | |
1831 { | |
1514
965af46e8793
Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents:
1504
diff
changeset
|
1832 v48 = pLevelDecorations[v46].uEventID == 0; |
0 | 1833 } |
1834 else | |
1835 { | |
1836 if ( v45 != 6 ) | |
4 | 1837 continue; |
978 | 1838 if ( uCurrentlyLoadedLevelType != 1 ) |
0 | 1839 { |
1840 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | |
1841 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) | |
4 | 1842 continue; |
0 | 1843 v44 = uNumSeconds; |
1000 | 1844 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1519 | 1845 pSpellInfo->uFlags &= ~0x40u; |
1000 | 1846 pSpellInfo->uPlayerID_2 = uMessageParam; |
1847 pSpellInfo->spell_target_pid = v44; | |
1848 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1849 pGUIWindow_Settings->Release(); | |
11 | 1850 pGUIWindow_Settings = 0; |
1851 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1852 GameUI_Footer_TimeLeft = 0; |
11 | 1853 unk_50C9A0 = 0; |
1854 back_to_game(); | |
1855 continue; | |
0 | 1856 } |
1857 pBLVFace = &pIndoor->pFaces[v46]; | |
1858 if ( !(BYTE3(pBLVFace->uAttributes) & 2) ) | |
4 | 1859 continue; |
0 | 1860 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; |
1861 } | |
1862 if ( v48 ) | |
4 | 1863 continue; |
1000 | 1864 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1519 | 1865 pSpellInfo->uFlags &= ~0x40u; |
1000 | 1866 pSpellInfo->uPlayerID_2 = uMessageParam; |
1867 pSpellInfo->spell_target_pid = v44; | |
1868 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1869 pGUIWindow_Settings->Release(); | |
0 | 1870 pGUIWindow_Settings = 0; |
1871 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1872 GameUI_Footer_TimeLeft = 0; |
0 | 1873 unk_50C9A0 = 0; |
1874 back_to_game(); | |
4 | 1875 continue; |
1000 | 1876 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade) |
1877 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure | |
1878 case UIMSG_HiredNPC_CastSpell: | |
0 | 1879 if ( pMessageQueue_50CBD0->uNumMessages ) |
1880 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1881 if ( unk_50C9A0 ) | |
1882 { | |
910 | 1883 uActiveCharacter = uMessageParam; |
978 | 1884 viewparams->bRedrawGameUI = 1; |
0 | 1885 } |
1886 else | |
1887 { | |
1888 if ( pGUIWindow_Settings ) | |
1889 { | |
1000 | 1890 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
0 | 1891 switch ( uMessage ) |
1892 { | |
1000 | 1893 case UIMSG_CastSpell_Character_Big_Improvement: |
1519 | 1894 pSpellInfo->uFlags &= ~0x02u; |
0 | 1895 break; |
1000 | 1896 case UIMSG_CastSpell_Character_Small_Improvement: |
1519 | 1897 pSpellInfo->uFlags &= ~0x0100u; |
0 | 1898 break; |
1000 | 1899 case UIMSG_HiredNPC_CastSpell: |
1519 | 1900 pSpellInfo->uFlags &= ~0x0200u; |
0 | 1901 break; |
1902 } | |
1000 | 1903 pSpellInfo->uPlayerID_2 = uMessageParam; |
1904 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
0 | 1905 pGUIWindow_Settings->Release(); |
1906 pGUIWindow_Settings = 0; | |
1907 pEventTimer->Resume(); | |
1908 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1909 GameUI_Footer_TimeLeft = 0; |
0 | 1910 unk_50C9A0 = 0; |
1911 } | |
1912 } | |
4 | 1913 continue; |
0 | 1914 case UIMSG_BF: |
987 | 1915 __debugbreak(); |
978 | 1916 dword_50CDC8 = 1; |
0 | 1917 sub_42FBDD(); |
978 | 1918 SaveGame(1, 0); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1919 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); |
978 | 1920 dword_6BE364_game_settings_1 |= 1; |
1921 uGameState = GAME_STATE_2; | |
11 | 1922 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
336 | 1923 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; |
4 | 1924 if ( v53 < 0 ) |
0 | 1925 { |
1926 v54 = abs(v53) - 1; | |
1927 _5B65B8_npcdata_hiword_house_or_other = 0; | |
1928 dword_5B65BC = 0; | |
1929 v55 = dword_4E4560[v54]; | |
1930 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54]; | |
1931 v56 = dword_4E4590[v54]; | |
1932 v57 = dword_4E45A8[v54]; | |
1933 _5B65A8_npcdata_uflags_or_other = v55; | |
1934 _5B65B4_npcdata_loword_house_or_other = v57; | |
1935 _5B65B0_npcdata_rep_or_other = v56; | |
1936 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; | |
1937 } | |
1938 sub_4BD8B5(); | |
11 | 1939 //goto LABEL_434; |
437 | 1940 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
11 | 1941 { |
990 | 1942 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 1943 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
1944 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1945 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 1946 }*/ |
978 | 1947 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
11 | 1948 continue; |
710 | 1949 |
1950 case UIMSG_OnCastTownPortal: | |
0 | 1951 pAudioPlayer->StopChannels(-1, -1); |
1268 | 1952 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); |
710 | 1953 continue; |
1954 | |
961 | 1955 case UIMSG_OnCastLloydsBeacon: |
0 | 1956 pAudioPlayer->StopChannels(-1, -1); |
961 | 1957 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0); |
710 | 1958 continue; |
1959 | |
961 | 1960 case UIMSG_LloydsBeacon_FlippingBtn: |
0 | 1961 bRecallingBeacon = uMessageParam; |
1962 v127 = uMessageParam + 204; | |
916 | 1963 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
1964 continue; | |
961 | 1965 case UIMSG_HintBeaconSlot: |
0 | 1966 if ( !pGUIWindow_CurrentMenu ) |
4 | 1967 continue; |
0 | 1968 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; |
1969 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | |
1970 if ( bRecallingBeacon ) | |
1971 { | |
1430 | 1972 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) ) |
4 | 1973 continue; |
1430 | 1974 v173 = pMapStats->pInfos[sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1975 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1976 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 1977 continue; |
0 | 1978 } |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
1979 pMapNum = pMapStats->GetMapInfo(pCurrentMapName); |
1430 | 1980 pMapName = "Not in Map Stats"; |
1981 if ( pMapNum ) | |
1982 pMapName = pMapStats->pInfos[pMapNum].pName; | |
1983 if ( !*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels ) || !pMapNum ) | |
0 | 1984 { |
1430 | 1985 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s" |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1986 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 1987 continue; |
0 | 1988 } |
1989 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | |
1430 | 1990 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s" |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1991 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 1992 continue; |
961 | 1993 case UIMSG_CloseAfterInstallBeacon: |
978 | 1994 dword_50CDC8 = 1; |
437 | 1995 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1996 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
11 | 1997 continue; |
990 | 1998 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 1999 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2000 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 2001 ++pMessageQueue_50CBD0->uNumMessages;*/ |
11 | 2002 continue; |
961 | 2003 case UIMSG_InstallBeacon: |
0 | 2004 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; |
1430 | 2005 if ( !pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon ) |
4 | 2006 continue; |
0 | 2007 byte_506360 = 1; |
2008 pPlayer9->CanCastSpell(uRequiredMana); | |
2009 if ( pParty->bTurnBasedModeOn ) | |
2010 { | |
2011 v60 = sRecoveryTime; | |
2012 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; | |
2013 pPlayer9->SetRecoveryTime(v60); | |
1448 | 2014 pTurnEngine->ApplyPlayerAction(); |
0 | 2015 } |
2016 else | |
2017 { | |
2018 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
2019 } | |
2020 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); | |
2021 if ( bRecallingBeacon ) | |
2022 { | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2023 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) |
0 | 2024 { |
978 | 2025 SaveGame(1, 0); |
0 | 2026 OnMapLeave(); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2027 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); |
978 | 2028 dword_6BE364_game_settings_1 |= 1; |
2029 uGameState = GAME_STATE_2; | |
1430 | 2030 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
2031 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
2032 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
2033 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | |
2034 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
978 | 2035 dword_5B65C0 = 1; |
0 | 2036 } |
2037 else | |
2038 { | |
1430 | 2039 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
2040 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | |
2041 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | |
0 | 2042 pParty->uFallStartY = pParty->vPosition.z; |
1430 | 2043 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; |
2044 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y; | |
0 | 2045 } |
978 | 2046 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
0 | 2047 pBooksWindow->Release(); |
2048 pGUIWindow_CurrentMenu->Release(); | |
2049 pBooksWindow = 0; | |
2050 pGUIWindow_CurrentMenu = 0; | |
2051 } | |
2052 else | |
2053 { | |
2054 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | |
2055 SaveScreenshot(a1); | |
2056 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); | |
1430 | 2057 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); |
2058 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x; | |
2059 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y; | |
2060 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z; | |
2061 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY); | |
2062 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX); | |
837 | 2063 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) |
4 | 2064 continue; |
1430 | 2065 for ( thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg ) |
0 | 2066 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2067 if ( !_stricmp((const char *)pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName) ) |
1430 | 2068 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg; |
0 | 2069 } |
2070 } | |
4 | 2071 continue; |
961 | 2072 case UIMSG_ClickTownInTP: |
0 | 2073 if ( uMessageParam ) |
2074 { | |
2075 switch ( uMessageParam ) | |
2076 { | |
2077 case 1: | |
2078 v63 = 208; | |
2079 break; | |
2080 case 2: | |
2081 v63 = 207; | |
2082 break; | |
2083 case 3: | |
2084 v63 = 211; | |
2085 break; | |
2086 case 4: | |
2087 v63 = 209; | |
2088 break; | |
2089 default: | |
2090 if ( uMessageParam != 5 ) | |
2091 { | |
2092 LABEL_486: | |
978 | 2093 SaveGame(1, 0); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2094 v64 = pMapStats->GetMapInfo(pCurrentMapName); |
0 | 2095 v65 = uMessageParam; |
839 | 2096 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) |
0 | 2097 { |
839 | 2098 pParty->vPosition.x = TownPortalList[v65].pos.x; |
2099 pParty->vPosition.y = TownPortalList[v65].pos.y; | |
2100 pParty->vPosition.z = TownPortalList[v65].pos.z; | |
0 | 2101 pParty->uFallStartY = pParty->vPosition.z; |
839 | 2102 pParty->sRotationY = TownPortalList[v65].rot_y; |
2103 pParty->sRotationX = TownPortalList[v65].rot_x; | |
0 | 2104 } |
2105 else | |
2106 { | |
978 | 2107 SaveGame(1, 0); |
0 | 2108 OnMapLeave(); |
978 | 2109 dword_6BE364_game_settings_1 |= 1; |
2110 uGameState = GAME_STATE_2; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2111 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
978 | 2112 dword_5B65C0 = 1; |
839 | 2113 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; |
2114 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | |
2115 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; | |
2116 v66 = TownPortalList[uMessageParam].rot_x; | |
2117 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; | |
0 | 2118 _5B65B8_npcdata_hiword_house_or_other = v66; |
2119 InitializeActors(); | |
2120 } | |
1268 | 2121 v67 = (char*)pGUIWindow_CurrentMenu->Hint; |
0 | 2122 if ( v67 ) |
978 | 2123 *((int *)v67 + 17) = 1; |
0 | 2124 else |
710 | 2125 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); |
437 | 2126 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 2127 { |
990 | 2128 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 2129 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
2130 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2131 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2132 }*/ |
978 | 2133 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
4 | 2134 continue; |
0 | 2135 } |
2136 v63 = 210; | |
2137 break; | |
2138 } | |
2139 } | |
2140 else | |
2141 { | |
2142 v63 = 206; | |
2143 } | |
484 | 2144 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) |
0 | 2145 return; |
2146 goto LABEL_486; | |
961 | 2147 case UIMSG_HintTownPortal: |
0 | 2148 if ( uMessageParam ) |
2149 { | |
2150 switch ( uMessageParam ) | |
2151 { | |
2152 case 1: | |
2153 v68 = 208; | |
2154 break; | |
2155 case 2: | |
2156 v68 = 207; | |
2157 break; | |
2158 case 3: | |
2159 v68 = 211; | |
2160 break; | |
2161 case 4: | |
2162 v68 = 209; | |
2163 break; | |
2164 default: | |
2165 if ( uMessageParam != 5 ) | |
11 | 2166 //goto LABEL_506; |
2167 { | |
2168 if ( uMessageParam ) | |
2169 { | |
2170 switch ( uMessageParam ) | |
2171 { | |
2172 case 1: | |
2173 v69 = pMapStats->pInfos[4].pName; | |
2174 break; | |
2175 case 2: | |
2176 v69 = pMapStats->pInfos[3].pName; | |
2177 break; | |
2178 case 3: | |
2179 v69 = pMapStats->pInfos[10].pName; | |
2180 break; | |
2181 case 4: | |
2182 v69 = pMapStats->pInfos[7].pName; | |
2183 break; | |
2184 default: | |
2185 if ( uMessageParam != 5 ) | |
2186 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2187 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2188 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2189 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2190 continue; |
11 | 2191 } |
2192 v69 = pMapStats->pInfos[8].pName; | |
2193 break; | |
2194 } | |
2195 } | |
2196 else | |
2197 { | |
2198 v69 = pMapStats->pInfos[21].pName; | |
2199 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2200 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2201 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2202 continue; |
11 | 2203 } |
2204 v68 = 210; | |
2205 break; | |
0 | 2206 } |
2207 } | |
2208 else | |
2209 { | |
2210 v68 = 206; | |
2211 } | |
484 | 2212 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) ) |
0 | 2213 { |
2214 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
4 | 2215 continue; |
0 | 2216 } |
11 | 2217 //LABEL_506: |
0 | 2218 if ( uMessageParam ) |
2219 { | |
2220 switch ( uMessageParam ) | |
2221 { | |
2222 case 1: | |
2223 v69 = pMapStats->pInfos[4].pName; | |
2224 break; | |
2225 case 2: | |
2226 v69 = pMapStats->pInfos[3].pName; | |
2227 break; | |
2228 case 3: | |
2229 v69 = pMapStats->pInfos[10].pName; | |
2230 break; | |
2231 case 4: | |
2232 v69 = pMapStats->pInfos[7].pName; | |
2233 break; | |
2234 default: | |
2235 if ( uMessageParam != 5 ) | |
2236 //goto LABEL_519; | |
4 | 2237 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2238 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2239 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2240 continue; |
4 | 2241 } |
0 | 2242 v69 = pMapStats->pInfos[8].pName; |
2243 break; | |
2244 } | |
2245 } | |
2246 else | |
2247 { | |
2248 v69 = pMapStats->pInfos[21].pName; | |
2249 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2250 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2251 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2252 continue; |
0 | 2253 case UIMSG_ShowFinalWindow: |
1412 | 2254 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." |
0 | 2255 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." |
2256 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | |
1458 | 2257 ModalWindow(pFinalMessage.data(), UIMSG_OnFinalWindowClose); |
0 | 2258 uGameState = GAME_STATE_FINAL_WINDOW; |
4 | 2259 continue; |
1458 | 2260 case UIMSG_OnFinalWindowClose: |
987 | 2261 __debugbreak(); |
982 | 2262 uGameState = GAME_STATE_PLAYING; |
0 | 2263 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); |
1458 | 2264 __debugbreak(); // missed break/continue? |
151 | 2265 case UIMSG_DD: |
990 | 2266 __debugbreak(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2267 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); |
703 | 2268 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); |
701 | 2269 if ( v216.uPropCount == 1 ) |
0 | 2270 { |
837 | 2271 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); |
0 | 2272 v70 = atoi(v216.pProperties[0]); |
2273 if ( v70 <= 0 || v70 >= 77 ) | |
4 | 2274 continue; |
0 | 2275 v71 = v70; |
2276 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | |
2277 pNPCData3 = 0; | |
2278 if ( (signed int)pNPCData4 > 0 ) | |
2279 { | |
2280 thish = 0; | |
2281 do | |
2282 { | |
1104 | 2283 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) |
0 | 2284 break; |
2285 ++thish; | |
2286 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); | |
2287 } | |
2288 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | |
2289 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | |
2290 { | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2291 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); |
0 | 2292 dword_6BE364_game_settings_1 |= 1u; |
978 | 2293 uGameState = GAME_STATE_2; |
0 | 2294 OnMapLeave(); |
4 | 2295 continue; |
0 | 2296 } |
2297 } | |
2298 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | |
2299 v73 = Str2; | |
2300 } | |
2301 else | |
2302 { | |
701 | 2303 if ( v216.uPropCount != 3 ) |
11 | 2304 continue; |
0 | 2305 v74 = atoi(v216.pProperties[0]); |
2306 thisi = atoi(v216.pProperties[1]); | |
2307 v75 = atoi(v216.pProperties[2]); | |
2308 v76 = v75; | |
2309 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
2310 { | |
2311 if ( pIndoor->GetSector(v74, thisi, v75) ) | |
2312 { | |
2313 v77 = thisi; | |
2314 pParty->vPosition.x = v74; | |
2315 pParty->vPosition.y = v77; | |
2316 pParty->vPosition.z = v76; | |
2317 pParty->uFallStartY = v76; | |
11 | 2318 continue; |
0 | 2319 } |
2320 } | |
2321 else | |
2322 { | |
2323 if ( v74 > -32768 ) | |
2324 { | |
2325 if ( v74 < 32768 ) | |
2326 { | |
2327 v77 = thisi; | |
2328 if ( thisi > -32768 ) | |
2329 { | |
2330 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | |
11 | 2331 { |
2332 pParty->vPosition.x = v74; | |
2333 pParty->vPosition.y = v77; | |
2334 pParty->vPosition.z = v76; | |
2335 pParty->uFallStartY = v76; | |
2336 continue; | |
2337 } | |
0 | 2338 } |
2339 } | |
2340 } | |
2341 } | |
2342 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2343 v73 = "Can't jump to that location!"; | |
2344 } | |
2345 ShowStatusBarString(v73, 6u); | |
4 | 2346 continue; |
961 | 2347 case UIMSG_CastQuickSpell: |
0 | 2348 if ( bUnderwater == 1 ) |
362 | 2349 { |
2350 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
2351 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
2352 continue; | |
2353 } | |
0 | 2354 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) |
11 | 2355 continue; |
362 | 2356 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); |
11 | 2357 continue; |
1000 | 2358 case UIMSG_CastSpell_Monster_Improvement: |
2359 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, | |
0 | 2360 if ( pRenderer->pRenderD3D ) |
2361 { | |
2362 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
2363 } | |
2364 else | |
2365 { | |
2366 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); | |
2367 pPoint2 = pMouse->GetCursorPos(&v201); | |
2368 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | |
2369 } | |
2370 v83 = v81; | |
2371 v44 = (unsigned __int16)v81; | |
2372 v84 = v83 >> 16; | |
848 | 2373 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
4 | 2374 continue; |
1000 | 2375 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
2376 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) | |
2377 { | |
1519 | 2378 pSpellInfo->uFlags &= ~0x08; |
0 | 2379 } |
2380 else | |
2381 { | |
1000 | 2382 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) |
1519 | 2383 pSpellInfo->uFlags &= ~0x0100u; |
0 | 2384 else |
1519 | 2385 pSpellInfo->uFlags &= ~0x0200u; |
1000 | 2386 } |
2387 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2388 pSpellInfo->spell_target_pid = v44; | |
2389 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2390 pGUIWindow_Settings->Release(); | |
11 | 2391 pGUIWindow_Settings = 0; |
2392 pMouse->SetCursorBitmap("MICON1"); | |
783 | 2393 GameUI_Footer_TimeLeft = 0; |
11 | 2394 unk_50C9A0 = 0; |
2395 back_to_game(); | |
2396 continue; | |
151 | 2397 case UIMSG_1C: |
987 | 2398 __debugbreak(); |
0 | 2399 if ( !uActiveCharacter || pCurrentScreen ) |
4 | 2400 continue; |
710 | 2401 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); |
151 | 2402 pCurrentScreen = SCREEN_19; |
0 | 2403 pEventTimer->Pause(); |
4 | 2404 continue; |
151 | 2405 case UIMSG_1B: |
987 | 2406 __debugbreak(); |
0 | 2407 if ( !uActiveCharacter ) |
4 | 2408 continue; |
978 | 2409 if ( pParty->bTurnBasedModeOn != 1 ) |
11 | 2410 { |
2411 if ( pActors[uMessageParam].uAIState == 5 ) | |
2412 stru_50C198.LootActor(&pActors[uMessageParam]); | |
2413 else | |
2414 Actor::StealFrom(uMessageParam); | |
2415 continue; | |
2416 } | |
1340 | 2417 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) |
4 | 2418 continue; |
1450 | 2419 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) |
0 | 2420 { |
2421 if ( pActors[uMessageParam].uAIState == 5 ) | |
2422 stru_50C198.LootActor(&pActors[uMessageParam]); | |
2423 else | |
2424 Actor::StealFrom(uMessageParam); | |
2425 } | |
4 | 2426 continue; |
271 | 2427 |
2428 case UIMSG_Attack: | |
0 | 2429 if ( !uActiveCharacter ) |
4 | 2430 continue; |
978 | 2431 if ( pParty->bTurnBasedModeOn != 1 ) |
11 | 2432 { |
2433 _42ECB5_PlayerAttacksActor(); | |
2434 continue; | |
2435 } | |
1340 | 2436 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) |
4 | 2437 continue; |
1450 | 2438 if ( !(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS) ) |
0 | 2439 _42ECB5_PlayerAttacksActor(); |
4 | 2440 continue; |
151 | 2441 case UIMSG_ExitRest: |
1268 | 2442 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" |
11 | 2443 continue; |
151 | 2444 case UIMSG_Wait5Minutes: |
0 | 2445 if ( dword_506F14 == 2 ) |
916 | 2446 { |
2447 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
362 | 2448 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2449 continue; | |
11 | 2450 } |
962 | 2451 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2452 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" |
978 | 2453 dword_506F14 = 1; |
1396 | 2454 _506F18_num_minutes_to_sleep = 5; |
4 | 2455 continue; |
151 | 2456 case UIMSG_Wait1Hour: |
0 | 2457 if ( dword_506F14 == 2 ) |
916 | 2458 { |
2459 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
362 | 2460 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2461 continue; | |
11 | 2462 } |
962 | 2463 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2464 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" |
978 | 2465 dword_506F14 = 1; |
1396 | 2466 _506F18_num_minutes_to_sleep = 60; |
4 | 2467 continue; |
907 | 2468 case UIMSG_RentRoom: |
0 | 2469 dword_506F14 = 2; |
1033 | 2470 RestUI_Load(); |
758 | 2471 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; |
1396 | 2472 _506F18_num_minutes_to_sleep = v86; |
2473 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern | |
2474 _506F18_num_minutes_to_sleep = v86 + 12 * 60; | |
11 | 2475 dword_506F14 = 2; |
2476 pParty->RestAndHeal(); | |
766 | 2477 pParty->days_played_without_rest = 0; |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2478 pParty->pPlayers[3].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2479 pParty->pPlayers[2].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2480 pParty->pPlayers[1].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2481 pParty->pPlayers[0].SetAsleep(1); |
11 | 2482 continue; |
907 | 2483 case UIMSG_RestWindow: |
0 | 2484 if ( pMessageQueue_50CBD0->uNumMessages ) |
2485 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2486 if ( pCurrentScreen ) | |
4 | 2487 continue; |
1458 | 2488 if ( _42F4DA_check_actor_proximity() ) |
11 | 2489 { |
978 | 2490 if ( pParty->bTurnBasedModeOn == 1 ) |
11 | 2491 { |
916 | 2492 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" |
11 | 2493 continue; |
2494 } | |
2495 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
2496 if ( pParty->uFlags & 0x88 ) | |
2497 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
916 | 2498 ShowStatusBarString(v88, 2); |
11 | 2499 if ( !uActiveCharacter ) |
2500 continue; | |
916 | 2501 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2502 continue; | |
11 | 2503 } |
978 | 2504 if ( pParty->bTurnBasedModeOn == 1 ) |
916 | 2505 { |
2506 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
11 | 2507 continue; |
2508 } | |
0 | 2509 if ( !(pParty->uFlags & 0x88) ) |
2510 { | |
1033 | 2511 RestUI_Load(); |
4 | 2512 continue; |
0 | 2513 } |
978 | 2514 if ( pParty->bTurnBasedModeOn == 1 ) |
0 | 2515 { |
916 | 2516 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" |
11 | 2517 continue; |
0 | 2518 } |
2519 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
2520 if ( pParty->uFlags & 0x88 ) | |
2521 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
2522 ShowStatusBarString(v88, 2u); | |
2523 if ( !uActiveCharacter ) | |
4 | 2524 continue; |
916 | 2525 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2526 continue; | |
907 | 2527 case UIMSG_Rest8Hour: |
0 | 2528 if ( dword_506F14 ) |
916 | 2529 { |
2530 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
362 | 2531 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2532 continue; | |
11 | 2533 } |
0 | 2534 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) |
2535 { | |
2536 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" | |
2537 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) | |
916 | 2538 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0); |
0 | 2539 } |
2540 else | |
2541 { | |
2542 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed; | |
2543 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed; | |
2544 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed; | |
2545 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1473
diff
changeset
|
2546 v90 = pMapStats->GetMapInfo(pCurrentMapName); |
0 | 2547 if ( !v90 ) |
2548 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; | |
2549 pMapInfo = &pMapStats->pInfos[v90]; | |
237 | 2550 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent ) |
0 | 2551 { |
2552 v91 = rand() % 100; | |
237 | 2553 v92 = pMapInfo->EncM1percent; |
0 | 2554 v93 = v91 + 1; |
2555 if ( v93 > v92 ) | |
237 | 2556 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2); |
0 | 2557 else |
978 | 2558 pNPCData4 = (NPCData *)1; |
1415 | 2559 if ( !_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4) ) |
0 | 2560 pNPCData4 = 0; |
2561 if ( pNPCData4 ) | |
2562 { | |
2563 pPlayerNum = rand() % 4; | |
2564 LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; | |
2565 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; | |
2566 v95 = rand(); | |
2567 Rest(v95 % 6 + 60); | |
1396 | 2568 _506F18_num_minutes_to_sleep = 0; |
0 | 2569 dword_506F14 = 0; |
437 | 2570 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 2571 { |
990 | 2572 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 2573 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2574 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2575 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2576 }*/ |
2577 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
916 | 2578 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!" |
2579 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); | |
2580 continue; | |
0 | 2581 } |
2582 } | |
2583 Party::TakeFood(uRestUI_FoodRequiredToRest); | |
1396 | 2584 _506F18_num_minutes_to_sleep = 480; |
0 | 2585 dword_506F14 = 2; |
2586 pParty->RestAndHeal(); | |
766 | 2587 pParty->days_played_without_rest = 0; |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2588 pParty->pPlayers[3].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2589 pParty->pPlayers[2].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2590 pParty->pPlayers[1].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2591 pParty->pPlayers[0].SetAsleep(1); |
0 | 2592 } |
4 | 2593 continue; |
151 | 2594 case UIMSG_AlreadyResting: |
0 | 2595 if ( dword_506F14 == 2 ) |
2596 { | |
916 | 2597 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" |
362 | 2598 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2599 continue; | |
0 | 2600 } |
962 | 2601 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2602 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" |
758 | 2603 v97 = _494820_training_time(pParty->uCurrentHour); |
978 | 2604 dword_506F14 = 1; |
1396 | 2605 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; |
4 | 2606 continue; |
960 | 2607 case UIMSG_HintSelectRemoveQuickSpellBtn: |
688 | 2608 if ( quick_spell_at_page && byte_506550 ) |
2609 { | |
2610 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2611 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173); |
0 | 2612 } |
2613 else | |
2614 { | |
2615 if ( pPlayers[uActiveCharacter]->uQuickSpell ) | |
2616 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | |
2617 else | |
2618 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell" | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2619 strcpy(pTmpBuf.data(), v177); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2620 } |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2621 GameUI_SetFooterString(pTmpBuf.data()); |
4 | 2622 continue; |
370 | 2623 case UIMSG_SPellbook_ShowHightlightedSpellInfo: |
4 | 2624 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], |
0 | 2625 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) |
4 | 2626 continue; |
0 | 2627 if ( sub_4637E0_is_there_popup_onscreen() ) |
2628 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; | |
2629 v98 = *(char *)(uNumSeconds + 6734); | |
688 | 2630 if ( quick_spell_at_page - 1 == uMessageParam ) |
0 | 2631 { |
2632 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
2633 v161 = pGlobalTXT_LocalizationStrings[485]; | |
2634 } | |
2635 else | |
2636 { | |
2637 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
2638 v161 = pGlobalTXT_LocalizationStrings[486]; | |
2639 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2640 sprintfex(pTmpBuf.data(), v161, v178); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2641 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 2642 continue; |
960 | 2643 case UIMSG_ClickInstallRemoveQuickSpellBtn: |
962 | 2644 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); |
0 | 2645 if ( !uActiveCharacter ) |
4 | 2646 continue; |
0 | 2647 pPlayer10 = pPlayers[uActiveCharacter]; |
688 | 2648 if ( !byte_506550 || !quick_spell_at_page ) |
0 | 2649 { |
2650 pPlayer10->uQuickSpell = 0; | |
688 | 2651 quick_spell_at_page = 0; |
916 | 2652 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0); |
2653 continue; | |
0 | 2654 } |
688 | 2655 v99 = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
0 | 2656 pPlayers[uActiveCharacter]->uQuickSpell = v99; |
1397 | 2657 stru_AA1058[uActiveCharacter - 1]._494836(v99, uActiveCharacter); |
0 | 2658 if ( uActiveCharacter ) |
187 | 2659 pPlayer10->PlaySound(SPEECH_12, 0); |
0 | 2660 byte_506550 = 0; |
4 | 2661 continue; |
1118 | 2662 case UIMSG_SpellBook_PressTab: |
2663 //__debugbreak(); | |
0 | 2664 if ( !uActiveCharacter ) |
4 | 2665 continue; |
0 | 2666 pPlayer3 = pPlayers[uActiveCharacter]; |
2667 pNPCData4 = 0; | |
2668 uAction = 0; | |
2669 v101 = 0; | |
2670 thisl = (int)&pPlayer3->pActiveSkills[12]; | |
2671 do | |
2672 { | |
2673 if ( *(short *)thisl ) | |
2674 { | |
198 | 2675 if ( pPlayer3->lastOpenedSpellbookPage == v101 ) |
0 | 2676 uAction = (int)pNPCData4; |
2677 v102 = (int)pNPCData4; | |
2678 pNPCData4 = (NPCData *)((char *)pNPCData4 + 1); | |
2679 v217[v102] = v101; | |
2680 } | |
2681 thisl += 2; | |
2682 ++v101; | |
2683 } | |
2684 while ( v101 < 9 ); | |
2685 if ( !pNPCData4 ) | |
11 | 2686 { |
2687 v127 = rand() % 2 + 204; | |
916 | 2688 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2689 continue; | |
11 | 2690 } |
0 | 2691 if ( GetAsyncKeyState(16) ) |
2692 { | |
2693 --uAction; | |
2694 if ( uAction < 0 ) | |
2695 uAction = (int)((char *)pNPCData4 - 1); | |
2696 } | |
2697 else | |
2698 { | |
2699 ++uAction; | |
2700 if ( uAction >= (signed int)pNPCData4 ) | |
2701 uAction = 0; | |
2702 } | |
1402 | 2703 OnCloseSpellBookPage(); |
198 | 2704 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); |
11 | 2705 pGUIWindow_CurrentMenu->OpenSpellBook(); |
2706 v127 = rand() % 2 + 204; | |
916 | 2707 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2708 continue; | |
832 | 2709 case UIMSG_OpenSpellbookPage: |
1340 | 2710 if ( pTurnEngine->turn_stage == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) |
4 | 2711 continue; |
1402 | 2712 OnCloseSpellBookPage(); |
198 | 2713 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; |
11 | 2714 pGUIWindow_CurrentMenu->OpenSpellBook(); |
0 | 2715 v127 = rand() % 2 + 204; |
916 | 2716 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2717 continue; | |
437 | 2718 case UIMSG_SelectSpell: |
2719 { | |
1340 | 2720 if (pTurnEngine->turn_stage == 3) |
437 | 2721 continue; |
2722 if (!uActiveCharacter) | |
2723 continue; | |
2724 | |
2725 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; | |
2726 auto player = pPlayers[uActiveCharacter]; | |
2727 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam]) | |
2728 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) ) | |
2729 { | |
688 | 2730 if ( quick_spell_at_page - 1 == uMessageParam ) |
0 | 2731 { |
2732 pGUIWindow_CurrentMenu->Release(); | |
2733 pEventTimer->Resume(); | |
978 | 2734 viewparams->bRedrawGameUI = 1; |
151 | 2735 pCurrentScreen = SCREEN_GAME; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
2736 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
688 | 2737 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; |
1000 | 2738 /*if ( dword_50C9E8 < 40 ) |
0 | 2739 { |
437 | 2740 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; |
2741 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | |
2742 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | |
0 | 2743 ++dword_50C9E8; |
1000 | 2744 }*/ |
1012 | 2745 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); |
2746 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
0 | 2747 } |
2748 else | |
2749 { | |
2750 byte_506550 = 1; | |
688 | 2751 quick_spell_at_page = uMessageParam + 1; |
0 | 2752 } |
437 | 2753 } |
2754 } | |
2755 continue; | |
370 | 2756 |
2757 case UIMSG_CastSpellFromBook: | |
1340 | 2758 if ( pTurnEngine->turn_stage != 3 ) |
370 | 2759 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); |
2760 continue; | |
2761 | |
1019 | 2762 case UIMSG_SpellScrollUse: |
987 | 2763 __debugbreak(); |
1340 | 2764 if ( pTurnEngine->turn_stage != 3 ) |
978 | 2765 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); |
4 | 2766 continue; |
907 | 2767 case UIMSG_SpellBookWindow: |
1340 | 2768 if ( pTurnEngine->turn_stage == 3 ) |
4 | 2769 continue; |
0 | 2770 if ( bUnderwater == 1 ) |
2771 { | |
362 | 2772 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" |
916 | 2773 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
0 | 2774 } |
2775 else | |
2776 { | |
2777 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2778 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2779 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | |
2780 { | |
2781 if ( !pCurrentScreen ) | |
2782 { | |
962 | 2783 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
151 | 2784 pCurrentScreen = SCREEN_SPELL_BOOK; |
0 | 2785 pEventTimer->Pause(); |
710 | 2786 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); |
0 | 2787 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
978 | 2788 viewparams->field_48 = 1; |
4 | 2789 continue; |
0 | 2790 } |
151 | 2791 if ( pCurrentScreen != SCREEN_REST |
2792 && pCurrentScreen != SCREEN_CHARACTERS | |
2793 && (pCurrentScreen <= SCREEN_63 | |
2794 || pCurrentScreen > SCREEN_67) ) | |
11 | 2795 { |
2796 pGUIWindow_CurrentMenu->Release(); | |
962 | 2797 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
151 | 2798 pCurrentScreen = SCREEN_SPELL_BOOK; |
11 | 2799 pEventTimer->Pause(); |
710 | 2800 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); |
11 | 2801 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
978 | 2802 viewparams->field_48 = 1; |
11 | 2803 continue; |
2804 } | |
2805 } | |
2806 } | |
2807 continue; | |
2808 case UIMSG_QuickReference: | |
0 | 2809 if ( pMessageQueue_50CBD0->uNumMessages ) |
2810 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2811 if ( pCurrentScreen ) | |
2812 pGUIWindow_CurrentMenu->Release(); | |
2813 ++pIcons_LOD->uTexturePacksCount; | |
2814 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2815 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
962 | 2816 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); |
978 | 2817 viewparams->bRedrawGameUI = 1; |
0 | 2818 pEventTimer->Pause(); |
2819 pAudioPlayer->StopChannels(-1, -1); | |
151 | 2820 pCurrentScreen = SCREEN_QUICK_REFERENCE; |
710 | 2821 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); |
0 | 2822 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); |
978 | 2823 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, |
0 | 2824 pGlobalTXT_LocalizationStrings[79],// "Exit" |
973 | 2825 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); |
4 | 2826 continue; |
358 | 2827 case UIMSG_GameMenuButton: |
0 | 2828 if ( pCurrentScreen ) |
2829 { | |
2830 pGUIWindow_CurrentMenu->Release(); | |
2831 pEventTimer->Resume(); | |
151 | 2832 pCurrentScreen = SCREEN_GAME; |
978 | 2833 viewparams->bRedrawGameUI = 1; |
0 | 2834 } |
2835 stru_506E40.Release(); | |
2836 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); | |
2837 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | |
2838 free((void *)uNumSeconds); | |
2839 stru_506E40._40E55E("gamma.pcx", 0); | |
962 | 2840 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
11 | 2841 //LABEL_453: |
437 | 2842 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
4 | 2843 continue; |
990 | 2844 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 2845 //goto LABEL_770; |
2846 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
2847 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 2848 ++pMessageQueue_50CBD0->uNumMessages;*/ |
2849 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
11 | 2850 continue; |
1101
3e5d70cfe20e
Award order fix, changed UIMSG_C0 to UIMSG_ClickAwardScrollBar
Grumpy7
parents:
1091
diff
changeset
|
2851 case UIMSG_ClickAwardScrollBar: |
1446 | 2852 books_page_number = 1; |
0 | 2853 if ( pMouse->GetCursorPos(&v211)->y > 178 ) |
1446 | 2854 books_page_number = -1; |
4 | 2855 continue; |
961 | 2856 case UIMSG_ClickAwardsUpBtn: |
962 | 2857 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); |
990 | 2858 BtnUp_flag = 1; |
4 | 2859 continue; |
961 | 2860 case UIMSG_ClickAwardsDownBtn: |
962 | 2861 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); |
990 | 2862 BtnDown_flag = 1; |
4 | 2863 continue; |
910 | 2864 case UIMSG_ChangeDetaliz: |
978 | 2865 bRingsShownInCharScreen ^= 1; |
910 | 2866 pCharacterScreen_DetalizBtn->Release(); |
697 | 2867 pCharacterScreen_DollBtn->Release(); |
0 | 2868 if ( bRingsShownInCharScreen ) |
2869 { | |
973 | 2870 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; |
2871 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; | |
0 | 2872 v123 = 445; |
2873 v121 = 470; | |
2874 } | |
2875 else | |
2876 { | |
2877 v128 = 30; | |
2878 v125 = 30; | |
2879 v123 = 300; | |
2880 v121 = 600; | |
2881 } | |
978 | 2882 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, |
0 | 2883 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" |
2884 0); | |
1025 | 2885 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); |
978 | 2886 viewparams->bRedrawGameUI = 1; |
910 | 2887 continue; |
2888 case UIMSG_ClickPaperdoll: | |
0 | 2889 OnPaperdollLeftClick(); |
4 | 2890 continue; |
960 | 2891 case UIMSG_ClickStatsBtn: |
0 | 2892 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; |
991 | 2893 CharacterUI_ReleaseButtons(); |
1458 | 2894 ReleaseAwardsScrollBar(); |
962 | 2895 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); |
960 | 2896 continue; |
2897 case UIMSG_ClickSkillsBtn: | |
0 | 2898 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; |
991 | 2899 CharacterUI_ReleaseButtons(); |
1458 | 2900 ReleaseAwardsScrollBar(); |
991 | 2901 CharacterUI_SkillsTab_CreateButtons(); |
962 | 2902 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); |
11 | 2903 continue; |
0 | 2904 case UIMSG_SkillUp: |
2905 pPlayer4 = pPlayers[uActiveCharacter]; | |
2906 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | |
2907 LOWORD(v2) = *(short *)v105; | |
2908 uNumSeconds = v2; | |
2909 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) | |
2910 { | |
2911 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" | |
2912 } | |
2913 else | |
2914 { | |
2915 if ( (uNumSeconds & 0x3F) < 0x3C ) | |
2916 { | |
2917 *(short *)v105 = uNumSeconds + 1; | |
2918 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; | |
187 | 2919 pPlayer4->PlaySound(SPEECH_14, 0); |
916 | 2920 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0); |
2921 continue; | |
0 | 2922 } |
2923 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | |
2924 } | |
916 | 2925 ShowStatusBarString(v87, 2); |
4 | 2926 continue; |
960 | 2927 case UIMSG_ClickInventoryBtn: |
0 | 2928 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
1458 | 2929 ReleaseAwardsScrollBar(); |
991 | 2930 CharacterUI_ReleaseButtons(); |
962 | 2931 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); |
960 | 2932 continue; |
2933 case UIMSG_ClickExitCharacterWindowBtn: | |
2934 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); | |
2935 continue; | |
2936 case UIMSG_ClickAwardsBtn: | |
1458 | 2937 ReleaseAwardsScrollBar(); |
991 | 2938 CharacterUI_ReleaseButtons(); |
1455 | 2939 CreateAwardsScrollBar(); |
0 | 2940 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; |
962 | 2941 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); |
521 | 2942 FillAwardsData(); |
4 | 2943 continue; |
1000 | 2944 case UIMSG_ClickBooksBtn: |
0 | 2945 switch ( uMessageParam ) |
2946 { | |
990 | 2947 case 11://Page UP |
2948 BtnUp_flag = 1; | |
2949 pButton = pBtn_Book_2; | |
2950 break; | |
2951 case 10://Page DOWN | |
2952 BtnDown_flag = 1; | |
2953 pButton = pBtn_Book_1; | |
2954 break; | |
1000 | 2955 case 0://Zoom plus |
0 | 2956 pButton = pBtn_Book_1; |
990 | 2957 BtnDown_flag = 1; |
0 | 2958 break; |
1000 | 2959 case 1://Zoom minus |
2960 pButton = pBtn_Book_2; | |
990 | 2961 BtnUp_flag = 1; |
0 | 2962 break; |
990 | 2963 case 2://Potions |
2964 Book_PageBtn3_flag = 1; | |
0 | 2965 if ( dword_506364 ) |
4 | 2966 continue; |
0 | 2967 pButton = pBtn_Book_3; |
2968 break; | |
990 | 2969 case 3://fountains |
2970 Book_PageBtn4_flag = 1; | |
0 | 2971 if ( dword_506364 ) |
4 | 2972 continue; |
0 | 2973 pButton = pBtn_Book_4; |
2974 break; | |
990 | 2975 case 4://obelisks |
2976 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag | |
0 | 2977 if ( dword_506364 ) |
4 | 2978 continue; |
0 | 2979 pButton = pBtn_Book_5; |
2980 break; | |
990 | 2981 case 5://seer |
2982 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag | |
0 | 2983 if ( dword_506364 ) |
4 | 2984 continue; |
0 | 2985 pButton = pBtn_Book_6; |
2986 break; | |
990 | 2987 case 6://misc |
0 | 2988 pButton = pBtn_Autonotes_Misc; |
990 | 2989 Autonotes_Misc_page_flag = 1; |
0 | 2990 break; |
990 | 2991 case 7://Instructors |
0 | 2992 pButton = pBtn_Autonotes_Instructors; |
990 | 2993 Autonotes_Instructors_page_flag = 1; |
0 | 2994 break; |
990 | 2995 default: |
2996 continue; | |
0 | 2997 } |
1268 | 2998 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
11 | 2999 continue; |
0 | 3000 case UIMSG_SelectCharacter: |
3001 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3002 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3003 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | |
4 | 3004 continue; |
0 | 3005 case UIMSG_ShowStatus_Funds: |
3006 v174 = (char *)pParty->uNumGoldInBank; | |
1430 | 3007 //v158 = pParty->uNumGold + pParty->uNumGoldInBank; |
3008 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank" | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3009 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3010 continue; |
0 | 3011 case UIMSG_ShowStatus_DateTime: |
3012 pNPCData4 = (NPCData *)pParty->uCurrentHour; | |
3013 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3014 { | |
3015 if ( !pNPCData4 ) | |
3016 pNPCData4 = (NPCData *)12; | |
3017 } | |
3018 else | |
3019 { | |
3020 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); | |
3021 } | |
978 | 3022 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) |
0 | 3023 uNumSeconds = 0; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3024 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], |
0 | 3025 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3026 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3027 continue; |
0 | 3028 case UIMSG_ShowStatus_Food: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3029 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3030 GameUI_SetFooterString(pTmpBuf.data()); |
306 | 3031 continue; |
0 | 3032 case UIMSG_ShowStatus_Player: |
3033 pPlayer5 = pPlayers[uMessageParam]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3034 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3035 strcat(pTmpBuf.data(), ": "); |
0 | 3036 v107 = pPlayer5->GetMajorConditionIdx(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3037 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3038 GameUI_SetFooterString(pTmpBuf.data()); |
0 | 3039 v108 = 8 * uMessageParam - 8; |
3040 LOBYTE(v108) = v108 | 4; | |
888 | 3041 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); |
4 | 3042 continue; |
0 | 3043 case UIMSG_ShowStatus_ManaHP: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3044 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), |
1000 | 3045 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), |
3046 pGlobalTXT_LocalizationStrings[212]); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3047 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3048 continue; |
987 | 3049 case UIMSG_CHEST_ClickItem: |
3050 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
3051 { | |
3052 OnInventoryLeftClick(); | |
11 | 3053 continue; |
3054 } | |
987 | 3055 OnChestLeftClick(); |
4 | 3056 continue; |
151 | 3057 case UIMSG_InventoryLeftClick: |
987 | 3058 OnInventoryLeftClick(); |
4 | 3059 continue; |
960 | 3060 case UIMSG_MouseLeftClickInGame: |
0 | 3061 if ( !pRenderer->pRenderD3D ) |
11 | 3062 { |
3063 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3064 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3065 OnGameViewportClick(); | |
3066 continue; | |
3067 } | |
0 | 3068 v115 = pMessageQueue_50CBD0->uNumMessages; |
3069 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
11 | 3070 { |
990 | 3071 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3072 /*if ( (signed int)v115 < 40 ) |
11 | 3073 //goto LABEL_769; |
3074 { | |
990 | 3075 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
11 | 3076 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3077 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3078 ++pMessageQueue_50CBD0->uNumMessages; | |
3079 continue; | |
437 | 3080 }*/ |
11 | 3081 continue; |
3082 } | |
0 | 3083 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
3084 { | |
978 | 3085 pMessageQueue_50CBD0->uNumMessages = 1; |
990 | 3086 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3087 /*v115 = v0; |
0 | 3088 pMessageQueue_50CBD0->uNumMessages = v0; |
990 | 3089 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
0 | 3090 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
11 | 3091 //goto LABEL_771; |
3092 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 3093 ++pMessageQueue_50CBD0->uNumMessages;*/ |
11 | 3094 continue; |
0 | 3095 } |
3096 v115 = 0; | |
3097 pMessageQueue_50CBD0->uNumMessages = 0; | |
990 | 3098 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3099 /*if ( (signed int)v115 < 40 ) |
11 | 3100 //goto LABEL_769; |
3101 { | |
990 | 3102 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
11 | 3103 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3104 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3105 ++pMessageQueue_50CBD0->uNumMessages; | |
3106 continue; | |
437 | 3107 }*/ |
4 | 3108 continue; |
990 | 3109 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame |
0 | 3110 if ( pMessageQueue_50CBD0->uNumMessages ) |
3111 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3112 OnGameViewportClick(); | |
4 | 3113 continue; |
151 | 3114 case UIMSG_F: |
987 | 3115 __debugbreak(); |
0 | 3116 if ( pRenderer->pRenderD3D ) |
3117 { | |
3118 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
3119 } | |
3120 else | |
3121 { | |
3122 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | |
3123 pPoint3 = pMouse->GetCursorPos(&v204); | |
3124 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | |
3125 } | |
3126 pButton2 = (GUIButton *)(unsigned __int16)v116; | |
960 | 3127 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); |
11 | 3128 continue; |
151 | 3129 case UIMSG_54: |
987 | 3130 __debugbreak(); |
0 | 3131 pButton2 = (GUIButton *)uMessageParam; |
990 | 3132 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); |
4 | 3133 continue; |
201 | 3134 case UIMSG_Game_Action: |
0 | 3135 if ( pMessageQueue_50CBD0->uNumMessages ) |
3136 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3137 OnPressSpace(); | |
4 | 3138 continue; |
960 | 3139 case UIMSG_ClickZoomOutBtn: |
0 | 3140 if ( pCurrentScreen ) |
4 | 3141 continue; |
0 | 3142 pParty->uFlags |= 2u; |
1000 | 3143 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); |
0 | 3144 uNumSeconds = 131072; |
3145 v118 = 2 * viewparams->uMinimapZoom; | |
3146 ++viewparams->field_28; | |
3147 viewparams->uMinimapZoom *= 2; | |
3148 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | |
3149 { | |
3150 if ( (signed int)v118 > 4096 ) | |
3151 { | |
3152 viewparams->uMinimapZoom = 4096; | |
3153 viewparams->field_28 = 12; | |
3154 } | |
4 | 3155 continue; |
0 | 3156 } |
3157 v119 = 2048; | |
3158 if ( (signed int)v118 <= 2048 ) | |
960 | 3159 { |
1051 | 3160 _576E2C_current_minimap_zoom = v118; |
960 | 3161 dword_576E28 = viewparams->field_28; |
3162 break; | |
3163 } | |
0 | 3164 viewparams->field_28 = 11; |
960 | 3165 viewparams->uMinimapZoom = v119; |
1051 | 3166 _576E2C_current_minimap_zoom = v119; |
960 | 3167 dword_576E28 = viewparams->field_28; |
3168 break; | |
3169 case UIMSG_ClickZoomInBtn: | |
0 | 3170 if ( pCurrentScreen ) |
4 | 3171 continue; |
0 | 3172 pParty->uFlags |= 2u; |
1000 | 3173 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); |
0 | 3174 uNumSeconds = 32768; |
3175 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
3176 --viewparams->field_28; | |
3177 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
3178 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3179 { | |
3180 v119 = 512; | |
3181 if ( (signed int)v118 < 512 ) | |
3182 { | |
3183 viewparams->field_28 = 9; | |
3184 v118 = v119; | |
3185 viewparams->uMinimapZoom = v119; | |
3186 } | |
1051 | 3187 _576E2C_current_minimap_zoom = v118; |
0 | 3188 dword_576E28 = viewparams->field_28; |
3189 } | |
3190 else | |
3191 { | |
3192 if ( (signed int)v118 < 256 ) | |
3193 { | |
3194 viewparams->uMinimapZoom = 256; | |
3195 viewparams->field_28 = 8; | |
3196 } | |
3197 } | |
4 | 3198 default: |
3199 continue; | |
0 | 3200 } |
3201 } | |
3202 } | |
1012 | 3203 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8; |
3204 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages); | |
3205 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); | |
3206 //dword_50C9E8 = 0; | |
3207 | |
3208 | |
3209 pMessageQueue_50C9E8->uNumMessages=0; | |
0 | 3210 if ( dword_50C9DC ) |
3211 { | |
437 | 3212 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 3213 { |
3214 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; | |
3215 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; | |
3216 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3217 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 3218 }*/ |
3219 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0); | |
0 | 3220 dword_50C9DC = 0; |
3221 } | |
3222 else | |
3223 { | |
3224 if ( dword_50C9D0 > 0 ) | |
3225 { | |
3226 dword_50C9D8 -= pEventTimer->uTimeElapsed; | |
3227 if ( dword_50C9D8 <= 0 ) | |
3228 { | |
437 | 3229 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 3230 { |
3231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; | |
3232 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; | |
3233 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3234 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 3235 }*/ |
3236 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9D0, dword_50C9D4, 0); | |
0 | 3237 dword_50C9D0 = 0; |
3238 dword_50C9D4 = 0; | |
3239 dword_50C9D8 = 0; | |
3240 } | |
3241 } | |
3242 } | |
1517 | 3243 CastSpellInfoHelpers::_427E01_cast_spell(); |
0 | 3244 } |
3245 | |
3246 //----- (004356FF) -------------------------------------------------------- | |
1458 | 3247 void back_to_game() |
0 | 3248 { |
3249 dword_507BF0_is_there_popup_onscreen = 0; | |
3250 dword_4E455C = 1; | |
3251 dword_50CDCC = 0; | |
3252 if ( pGUIWindow_ScrollWindow ) | |
3253 free_book_subwindow(); | |
3254 if ( !pCurrentScreen && !pGUIWindow_Settings ) | |
3255 pEventTimer->Resume(); | |
3256 viewparams->bRedrawGameUI = 1; | |
3257 } | |
782 | 3258 |
0 | 3259 //----- (00435748) -------------------------------------------------------- |
1458 | 3260 void GUI_MainMenuMessageProc() |
0 | 3261 { |
967 | 3262 Player *pPlayer; // ebx@2 |
0 | 3263 void *v3; // edi@21 |
3264 signed int v4; // eax@29 | |
3265 int v5; // ecx@29 | |
821 | 3266 PLAYER_SKILL_TYPE v6; // edi@37 |
0 | 3267 GUIWindow *pWindow; // eax@56 |
3268 GUIButton *pButton; // eax@59 | |
3269 int v15; // edi@70 | |
3270 char v20; // dl@116 | |
3271 unsigned int v21; // eax@116 | |
3272 unsigned int v25; // eax@120 | |
3273 unsigned int v26; // ecx@127 | |
3274 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | |
3275 signed int v41; // [sp-10h] [bp-20h]@29 | |
971 | 3276 int pParam; // [sp+4h] [bp-Ch]@3 |
0 | 3277 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 |
967 | 3278 int pSex; // [sp+Ch] [bp-4h]@3 |
0 | 3279 |
3280 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3281 { | |
2 | 3282 pPlayer = pParty->pPlayers; |
0 | 3283 do |
3284 { | |
187 | 3285 int param2; |
971 | 3286 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); |
3287 auto player = &pParty->pPlayers[pParam]; | |
187 | 3288 |
3 | 3289 switch (pUIMessageType) // For buttons of window MainMenu |
2 | 3290 { |
165 | 3291 case UIMSG_MainMenu_ShowPartyCreationWnd: |
962 | 3292 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); |
0 | 3293 SetCurrentMenuID(MENU_NEWGAME); |
960 | 3294 break; |
165 | 3295 case UIMSG_MainMenu_ShowLoadWindow: |
962 | 3296 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0); |
0 | 3297 SetCurrentMenuID(MENU_SAVELOAD); |
960 | 3298 break; |
165 | 3299 case UIMSG_ShowCredits: |
962 | 3300 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0); |
0 | 3301 SetCurrentMenuID(MENU_CREDITS); |
960 | 3302 break; |
165 | 3303 case UIMSG_ExitToWindows: |
962 | 3304 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); |
982 | 3305 SetCurrentMenuID(MENU_EXIT_GAME); |
960 | 3306 break; |
187 | 3307 case UIMSG_PlayerCreation_SelectAttribute: |
960 | 3308 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3309 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3310 uPlayerCreationUI_SelectedCharacter = pParam; | |
960 | 3311 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3312 break; | |
187 | 3313 case UIMSG_PlayerCreation_VoicePrev: |
967 | 3314 pSex = player->GetSexByVoice(); |
960 | 3315 do |
3316 { | |
3317 if (player->uVoiceID == 0) | |
3318 player->uVoiceID = 19; | |
3319 else --player->uVoiceID; | |
3320 } | |
967 | 3321 while (player->GetSexByVoice() != pSex); |
971 | 3322 pButton = pCreationUI_BtnPressLeft2[pParam]; |
1268 | 3323 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
960 | 3324 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3325 player->PlaySound(SPEECH_PickMe, 0); | |
3326 break; | |
187 | 3327 case UIMSG_PlayerCreation_VoiceNext: |
967 | 3328 pSex = player->GetSexByVoice(); |
3329 do | |
3330 { | |
3331 player->uVoiceID = (player->uVoiceID + 1) % 20; | |
3332 } | |
3333 while (player->GetSexByVoice() != pSex); | |
971 | 3334 pButton = pCreationUI_BtnPressRight2[pParam]; |
1268 | 3335 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
967 | 3336 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3337 player->PlaySound(SPEECH_PickMe, 0); | |
3338 break; | |
187 | 3339 case UIMSG_PlayerCreation_FacePrev: |
971 | 3340 pPlayer = &pParty->pPlayers[pParam]; |
1014 | 3341 if (!pPlayer->uCurrentFace) |
3342 pPlayer->uCurrentFace = 19; | |
960 | 3343 else |
1014 | 3344 pPlayer->uCurrentFace -= 1; |
3345 pPlayer->uVoiceID = pPlayer->uCurrentFace; | |
960 | 3346 pPlayer->SetInitialStats(); |
3347 pPlayer->SetSexByVoice(); | |
3348 pPlayer->RandomizeName(); | |
971 | 3349 v25 = pParam; |
960 | 3350 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3351 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3352 uPlayerCreationUI_SelectedCharacter = v25; |
1268 | 3353 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); |
960 | 3354 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); |
3355 pPlayer->PlaySound(SPEECH_PickMe, 0); | |
3356 break; | |
187 | 3357 case UIMSG_PlayerCreation_FaceNext: |
971 | 3358 pPlayer = &pParty->pPlayers[pParam]; |
1014 | 3359 v20 = (char)((int)pPlayer->uCurrentFace + 1) % 20; |
3360 pPlayer->uCurrentFace = v20; | |
960 | 3361 pPlayer->uVoiceID = v20; |
3362 pPlayer->SetInitialStats(); | |
3363 pPlayer->SetSexByVoice(); | |
3364 pPlayer->RandomizeName(); | |
971 | 3365 v21 = pParam; |
960 | 3366 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3367 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3368 uPlayerCreationUI_SelectedCharacter = v21; |
1268 | 3369 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); |
960 | 3370 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3371 pPlayer->PlaySound(SPEECH_PickMe, 0); | |
3372 break; | |
3373 case UIMSG_PlayerCreationClickPlus: | |
1268 | 3374 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); |
960 | 3375 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3376 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
3377 break; | |
3378 case UIMSG_PlayerCreationClickMinus: | |
1268 | 3379 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); |
960 | 3380 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3381 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
3382 break; | |
3383 case UIMSG_PlayerCreationSelectActiveSkill: | |
967 | 3384 pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter]; |
971 | 3385 v6 = pPlayer->GetSkillIdxByOrder(pParam + 4); |
967 | 3386 if ( pPlayer->GetSkillIdxByOrder(3) == 37 ) |
3387 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | |
3388 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3389 break; | |
960 | 3390 case UIMSG_PlayerCreationSelectClass: |
971 | 3391 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); |
960 | 3392 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3393 break; | |
3394 case UIMSG_PlayerCreationClickOK: | |
962 | 3395 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); |
1459 | 3396 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills() ) |
960 | 3397 GameUI_Footer_TimeLeft = GetTickCount() + 4000; |
3398 else | |
982 | 3399 uGameState = GAME_STATE_STARTING_NEW_GAME; |
960 | 3400 break; |
3401 case UIMSG_PlayerCreationClickReset: | |
962 | 3402 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); |
960 | 3403 pParty->Reset(); |
3404 break; | |
3405 case UIMSG_PlayerCreationRemoveUpSkill: | |
971 | 3406 uPlayerCreationUI_SelectedCharacter = pParam; |
960 | 3407 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3408 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3409 v41 = 2; | |
971 | 3410 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3411 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; |
3412 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | |
3413 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | |
3414 break; | |
3415 case UIMSG_PlayerCreationChangeName: | |
3416 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
971 | 3417 v3 = (void *)pParam; |
3418 uPlayerCreationUI_SelectedCharacter = pParam; | |
960 | 3419 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); |
3420 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
3421 break; | |
3422 case UIMSG_ChangeGameState: | |
978 | 3423 uGameState = GAME_FINISHED; |
960 | 3424 break; |
1412 | 3425 case UIMSG_ChangeCursor: |
960 | 3426 pMouse->SetCursorBitmap("MICON2"); |
3427 break; | |
3428 case UIMSG_3A: | |
1458 | 3429 SetCurrentMenuID(MENU_DebugBLVLevel); |
960 | 3430 break; |
165 | 3431 case UIMSG_LoadGame: |
0 | 3432 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) |
960 | 3433 break; |
961 | 3434 SetCurrentMenuID(MENU_LoadingProcInMainMenu); |
960 | 3435 break; |
165 | 3436 case UIMSG_SelectLoadSlot: |
0 | 3437 //main menu save/load wnd clicking on savegame lines |
1038 | 3438 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
3439 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
971 | 3440 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) |
0 | 3441 { |
3442 //load clicked line | |
971 | 3443 v26 = pParam + pSaveListPosition; |
3444 if ( dword_6BE138 == pParam + pSaveListPosition ) | |
0 | 3445 { |
961 | 3446 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); |
437 | 3447 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
0 | 3448 } |
3449 uLoadGameUI_SelectedSlot = v26; | |
3450 dword_6BE138 = v26; | |
3451 } | |
3452 else | |
3453 { | |
3454 //typing in the line | |
3 | 3455 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); |
0 | 3456 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); |
3457 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
3458 } | |
960 | 3459 break; |
961 | 3460 case UIMSG_SaveLoadBtn: |
3461 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
960 | 3462 break; |
165 | 3463 case UIMSG_DownArrow: |
3 | 3464 ++pSaveListPosition; |
971 | 3465 if ( pSaveListPosition >= pParam ) |
3466 pSaveListPosition = pParam - 1; | |
3 | 3467 if ( pSaveListPosition < 1 ) |
3468 pSaveListPosition = 0; | |
3469 pWindow = pGUIWindow_CurrentMenu; | |
962 | 3470 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); |
960 | 3471 break; |
165 | 3472 case UIMSG_Cancel: |
960 | 3473 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); |
3474 break; | |
165 | 3475 case UIMSG_ArrowUp: |
3 | 3476 --pSaveListPosition; |
3477 if ( pSaveListPosition < 0 ) | |
3478 pSaveListPosition = 0; | |
3479 pWindow = pGUIWindow_CurrentMenu; | |
962 | 3480 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); |
960 | 3481 break; |
3482 case UIMSG_AD: | |
962 | 3483 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); |
961 | 3484 SetCurrentMenuID(MENU_LoadingProcInMainMenu); |
960 | 3485 break; |
3486 case UIMSG_AE: | |
962 | 3487 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); |
1458 | 3488 SetCurrentMenuID(MENU_DebugBLVLevel); |
960 | 3489 break; |
3490 case UIMSG_Escape: | |
1458 | 3491 if ( pModalWindow ) |
0 | 3492 { |
1458 | 3493 ModalWindow_Release(); |
960 | 3494 break; |
0 | 3495 } |
3496 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) | |
960 | 3497 break; |
0 | 3498 v15 = 1; |
3499 pVideoPlayer->bStopBeforeSchedule = 1; | |
3500 viewparams->bRedrawGameUI = 1; | |
3501 viewparams->field_48 = 1; | |
165 | 3502 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) |
3503 { | |
3504 if ( pCurrentScreen == SCREEN_VIDEO ) | |
3505 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | |
3506 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | |
3507 { | |
3508 SetCurrentMenuID(MENU_CREATEPARTY); | |
960 | 3509 break; |
0 | 3510 } |
165 | 3511 if (GetCurrentMenuID() == MENU_CREDITSPROC) |
3512 { | |
3513 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
960 | 3514 break; |
0 | 3515 } |
437 | 3516 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); |
960 | 3517 break; |
0 | 3518 } |
971 | 3519 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) |
3520 { | |
3521 if ( pCurrentScreen == SCREEN_VIDEO ) | |
3522 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | |
3523 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | |
3524 { | |
3525 SetCurrentMenuID(MENU_CREATEPARTY); | |
3526 break; | |
3527 } | |
3528 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
3529 { | |
3530 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
3531 break; | |
3532 } | |
3533 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
3534 break; | |
3535 } | |
151 | 3536 if ( pCurrentScreen == SCREEN_LOADGAME ) |
0 | 3537 { |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
3538 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 3539 //crt_deconstruct_ptr_6A0118(); |
3540 pTexture_PCX.Release(); | |
3541 pTexture_PCX.Load("title.pcx", 0); | |
3542 SetCurrentMenuID(MENU_MAIN); | |
3543 v15 = 1; | |
3544 pGUIWindow_CurrentMenu->Release(); | |
3545 pGUIWindow2->Release(); | |
3546 pGUIWindow2 = 0; | |
3547 pEventTimer->Resume(); | |
151 | 3548 pCurrentScreen = SCREEN_GAME; |
0 | 3549 viewparams->bRedrawGameUI = v15; |
960 | 3550 break; |
0 | 3551 } |
151 | 3552 if ( pCurrentScreen == SCREEN_VIDEO ) |
0 | 3553 { |
3554 pVideoPlayer->Unload(); | |
3555 } | |
3556 else | |
3557 { | |
151 | 3558 if ( pCurrentScreen != SCREEN_1B ) |
2 | 3559 { |
3560 pGUIWindow_CurrentMenu->Release(); | |
3561 pGUIWindow2->Release(); | |
3562 pGUIWindow2 = 0; | |
3563 pEventTimer->Resume(); | |
151 | 3564 pCurrentScreen = SCREEN_GAME; |
2 | 3565 viewparams->bRedrawGameUI = v15; |
960 | 3566 break; |
2 | 3567 } |
0 | 3568 //VideoPlayer::dtor(); |
3569 } | |
960 | 3570 break; |
3571 case UIMSG_PlayerCreationRemoveDownSkill: | |
971 | 3572 uPlayerCreationUI_SelectedCharacter = pParam; |
1412 | 3573 __debugbreak(); |
165 | 3574 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 |
971 | 3575 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
165 | 3576 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) |
0 | 3577 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
960 | 3578 break; |
3579 default: | |
3580 break; | |
0 | 3581 } |
3582 } | |
3583 while ( pMessageQueue_50CBD0->uNumMessages ); | |
3584 } | |
3585 } | |
3586 | |
3587 //----- (00436427) -------------------------------------------------------- | |
1458 | 3588 double get_shading_dist_mist() |
0 | 3589 { |
1412 | 3590 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
3591 return (double)pOutdoorCamera->shading_dist_mist; | |
0 | 3592 else |
1412 | 3593 return 16192.0; |
0 | 3594 } |
3595 | |
3596 //----- (0043648F) -------------------------------------------------------- | |
3597 void Vec3_short__to_RenderVertexSoft(RenderVertexSoft *_this, Vec3_short_ *a2) | |
3598 { | |
3599 _this->flt_2C = 0.0; | |
3600 | |
3601 _this->vWorldPosition.x = a2->x; | |
3602 _this->vWorldPosition.y = a2->y; | |
3603 _this->vWorldPosition.z = a2->z; | |
3604 } | |
3605 | |
3606 //----- (004369DB) -------------------------------------------------------- | |
3607 void Vec3_float_::Normalize() | |
3608 { | |
1025 | 3609 this->x = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->x; |
3610 this->y = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->y; | |
3611 this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z; | |
0 | 3612 } |
3613 | |
3614 //----- (00438F8F) -------------------------------------------------------- | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1384
diff
changeset
|
3615 void area_of_effect__damage_evaluate() |
0 | 3616 { |
3617 int v0; // edx@1 | |
3618 char *v1; // esi@2 | |
3619 int v2; // ecx@3 | |
3620 signed int v3; // eax@3 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3621 SpriteObject *v4; // eax@4 |
0 | 3622 signed int v5; // eax@4 |
3623 signed int v6; // eax@6 | |
3624 unsigned int v7; // edi@6 | |
3625 int v8; // eax@6 | |
3626 __int16 v9; // bx@8 | |
3627 int v10; // edi@8 | |
3628 Vec3_int_ v11; // ST04_12@9 | |
3629 int v12; // ST0C_4@10 | |
3630 Actor *v13; // edi@11 | |
3631 int v14; // edx@15 | |
3632 int v15; // edx@15 | |
3633 int v16; // ebx@15 | |
3634 signed int v17; // eax@15 | |
3635 int v18; // edi@15 | |
3636 int v19; // edi@15 | |
3637 Vec3_int_ v20; // ST04_12@16 | |
3638 Vec3_int_ *v21; // eax@17 | |
3639 unsigned int v22; // edx@17 | |
3640 int v23; // edx@18 | |
3641 int v24; // eax@18 | |
3642 Vec3_int_ v25; // ST04_12@19 | |
3643 unsigned int v26; // ebx@20 | |
89 | 3644 Player *v27; // edi@20 |
90 | 3645 Actor *v28; // edi@27 |
0 | 3646 int v29; // ebx@29 |
3647 int v30; // eax@29 | |
3648 int v31; // edx@29 | |
3649 int v32; // eax@29 | |
3650 int v33; // ST24_4@29 | |
3651 Vec3_int_ v34; // ST04_12@30 | |
3652 Vec3_int_ *v35; // eax@31 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3653 SpriteObject *v36; // [sp+0h] [bp-28h]@0 |
0 | 3654 signed int v37; // [sp+4h] [bp-24h]@5 |
3655 int v38; // [sp+4h] [bp-24h]@15 | |
3656 signed int v39; // [sp+8h] [bp-20h]@3 | |
3657 int v40; // [sp+8h] [bp-20h]@15 | |
3658 int v41; // [sp+Ch] [bp-1Ch]@5 | |
3659 int v42; // [sp+Ch] [bp-1Ch]@15 | |
3660 int v43; // [sp+10h] [bp-18h]@1 | |
3661 int v44; // [sp+14h] [bp-14h]@15 | |
3662 unsigned int uActorID; // [sp+18h] [bp-10h]@6 | |
3663 Vec3_int_ *pVelocity; // [sp+1Ch] [bp-Ch]@2 | |
3664 int a1; // [sp+20h] [bp-8h]@8 | |
3665 int v48; // [sp+24h] [bp-4h]@8 | |
3666 | |
3667 v0 = 0; | |
3668 v43 = 0; | |
3669 if ( stru_50FE08.count > 0 ) | |
3670 { | |
3671 pVelocity = &stru_50FE08.vec_4B4; | |
3672 v1 = (char *)stru_50FE08.pZs; | |
3673 do | |
3674 { | |
848 | 3675 v2 = PID_TYPE(*((short *)v1 - 300)); |
3676 v3 = PID_ID((signed int)*((short *)v1 - 300)); | |
3677 v39 = PID_ID((signed int)*((short *)v1 - 300)); | |
0 | 3678 if ( v2 == 2 ) |
3679 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3680 v4 = &pSpriteObjects[v3]; |
0 | 3681 v36 = v4; |
822 | 3682 v5 = v4->spell_caster_pid; |
848 | 3683 v2 = PID_TYPE(v5); |
3684 v3 = PID_ID(v5); | |
0 | 3685 } |
3686 v41 = v2; | |
3687 v37 = v3; | |
3688 if ( stru_50FE08.field_3EC[v0] & 1 ) | |
3689 { | |
417 | 3690 v6 = ai_near_actors_targets_pid[v3]; |
848 | 3691 v7 = PID_ID(v6); |
3692 v8 = PID_TYPE(v6) - 3; | |
0 | 3693 uActorID = v7; |
3694 if ( v8 ) | |
3695 { | |
3696 if ( v8 == 1 ) | |
3697 { | |
3698 v9 = *(short *)v1; | |
3699 v10 = pParty->vPosition.y - *((short *)v1 - 100); | |
3700 a1 = pParty->vPosition.x - *((short *)v1 - 200); | |
3701 v48 = v10; | |
3702 if ( a1 * a1 | |
3703 + v10 * v10 | |
3704 + ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9)) | |
3705 * ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9)) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) ) | |
3706 { | |
3707 v11.z = *(short *)v1; | |
3708 v11.y = *((short *)v1 - 100); | |
3709 v11.x = *((short *)v1 - 200); | |
3710 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v11) ) | |
3711 { | |
3712 v12 = stru_50C198.which_player_would_attack(&pActors[v39]); | |
3713 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v12); | |
3714 } | |
3715 } | |
3716 } | |
3717 } | |
3718 else | |
3719 { | |
3720 v13 = &pActors[v7]; | |
3721 if ( SHIDWORD(v13->pActorBuffs[6].uExpireTime) > 0 | |
3722 || SHIDWORD(v13->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(v13->pActorBuffs[6].uExpireTime) | |
3723 || v13->CanAct() ) | |
3724 { | |
3725 v14 = v13->vPosition.y; | |
3726 v40 = v13->vPosition.x; | |
3727 v38 = v14; | |
3728 v15 = v14 - *((short *)v1 - 100); | |
3729 v16 = *(short *)v1; | |
3730 v42 = v13->vPosition.z; | |
3731 a1 = v40 - *((short *)v1 - 200); | |
3732 v17 = v13->uActorHeight; | |
3733 v18 = v13->uActorRadius; | |
3734 v44 = v42; | |
3735 v19 = *((short *)v1 + 100) + v18; | |
3736 v48 = v15; | |
3737 if ( a1 * a1 + v15 * v15 + (v42 + (v17 >> 1) - v16) * (v42 + (v17 >> 1) - v16) < (unsigned int)(v19 * v19) ) | |
3738 { | |
3739 v20.z = *(short *)v1; | |
3740 v20.y = *((short *)v1 - 100); | |
3741 v20.x = *((short *)v1 - 200); | |
3742 if ( sub_407A1C(v40, v38, v42 + 50, v20) ) | |
3743 { | |
3744 Vec3_int_::Normalize(&a1, &v48, &v44); | |
3745 v21 = pVelocity; | |
3746 v22 = uActorID; | |
3747 pVelocity->x = a1; | |
3748 v21->y = v48; | |
3749 v21->z = v44; | |
3750 sub_43B1B0(*((short *)v1 - 300), v22, v21, stru_50FE08.field_450[v43]); | |
3751 } | |
3752 } | |
3753 } | |
3754 } | |
3755 } | |
3756 else | |
3757 { | |
3758 v23 = pParty->vPosition.y - *((short *)v1 - 100); | |
3759 v24 = ((signed int)pParty->uPartyHeight >> 1) - *(short *)v1; | |
3760 a1 = pParty->vPosition.x - *((short *)v1 - 200); | |
3761 v48 = v23; | |
3762 if ( a1 * a1 + v23 * v23 + (pParty->vPosition.z + v24) * (pParty->vPosition.z + v24) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) ) | |
3763 { | |
3764 v25.z = *(short *)v1; | |
3765 v25.y = *((short *)v1 - 100); | |
3766 v25.x = *((short *)v1 - 200); | |
3767 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v25) ) | |
3768 { | |
3769 v26 = 0; | |
89 | 3770 v27 = pParty->pPlayers;//[0].pConditions[15]; |
0 | 3771 do |
3772 { | |
89 | 3773 if ( !(HIDWORD(v27->pConditions[14]) | LODWORD(v27->pConditions[14])) && !v27->pConditions[15] && !v27->pConditions[16] ) |
0 | 3774 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v26); |
89 | 3775 ++v27; |
0 | 3776 ++v26; |
3777 } | |
89 | 3778 while ( v27 <= &pParty->pPlayers[3] ); |
0 | 3779 } |
3780 } | |
3781 uActorID = 0; | |
3782 if ( (signed int)uNumActors > 0 ) | |
3783 { | |
1202 | 3784 v28 = pActors.data();//[0].vPosition.z; |
0 | 3785 do |
3786 { | |
91 | 3787 if ( v28->CanAct() ) |
0 | 3788 { |
3789 v29 = *(short *)v1; | |
91 | 3790 v30 = v28->vPosition.y - *((short *)v1 - 100); |
3791 a1 = v28->vPosition.x - *((short *)v1 - 200); | |
90 | 3792 v31 = v28->vPosition.z; |
0 | 3793 v48 = v30; |
3794 v44 = v31; | |
90 | 3795 v32 = (v28->uActorHeight >> 1) - v29; |
91 | 3796 v33 = v28->uActorRadius + *((short *)v1 + 100); |
0 | 3797 if ( a1 * a1 + v48 * v48 + (v31 + v32) * (v31 + v32) < (unsigned int)(v33 * v33) ) |
3798 { | |
3799 v34.z = *(short *)v1; | |
3800 v34.y = *((short *)v1 - 100); | |
3801 v34.x = *((short *)v1 - 200); | |
90 | 3802 if ( sub_407A1C(v28->vPosition.x, v28->vPosition.y, v28->vPosition.z + 50, v34) ) |
0 | 3803 { |
3804 Vec3_int_::Normalize(&a1, &v48, &v44); | |
3805 v35 = pVelocity; | |
3806 pVelocity->x = a1; | |
3807 v35->y = v48; | |
3808 v35->z = v44; | |
3809 switch ( v41 ) | |
3810 { | |
303 | 3811 case OBJECT_Player: |
0 | 3812 DamageMonsterFromParty(*((short *)v1 - 300), uActorID, v35); |
3813 break; | |
303 | 3814 case OBJECT_Actor: |
90 | 3815 if ( v36 && pActors[v37].GetActorsRelation(v28) ) |
0 | 3816 sub_43B1B0(*((short *)v1 - 300), uActorID, pVelocity, v36->field_61); |
3817 break; | |
303 | 3818 case OBJECT_Item: |
0 | 3819 sub_43B057(*((short *)v1 - 300), uActorID, v35); |
3820 break; | |
3821 } | |
3822 } | |
3823 } | |
3824 } | |
3825 ++uActorID; | |
90 | 3826 ++v28; |
0 | 3827 } |
3828 while ( (signed int)uActorID < (signed int)uNumActors ); | |
3829 } | |
3830 } | |
3831 ++pVelocity; | |
3832 v0 = v43 + 1; | |
3833 v1 += 2; | |
3834 ++v43; | |
3835 } | |
3836 while ( v43 < stru_50FE08.count ); | |
3837 } | |
3838 stru_50FE08.count = 0; | |
3839 } | |
3840 // 50FE08: using guessed type stru298 stru_50FE08; | |
3841 | |
3842 // 4D864C: using guessed type char byte_4D864C; | |
3843 | |
3844 //----- (0043A97E) -------------------------------------------------------- | |
3845 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2) | |
3846 { | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1384
diff
changeset
|
3847 if (PID_TYPE(a2) == OBJECT_BLVDoor) |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3848 { |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3849 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3850 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3851 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3852 |
0 | 3853 Vec3_int_::Normalize(&layingitem_vel_50FDFC.x, &layingitem_vel_50FDFC.y, &layingitem_vel_50FDFC.z); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3854 DamagePlayerFromMonster(PID(OBJECT_Item, uLayingItemID), pSpriteObjects[uLayingItemID].field_61, &layingitem_vel_50FDFC, 0xFFFFFFFFu); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3855 } |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3856 else if (PID_TYPE(a2) == OBJECT_Actor) |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3857 { |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3858 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3859 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3860 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3861 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3862 Vec3_int_::Normalize(&layingitem_vel_50FDFC.x, &layingitem_vel_50FDFC.y, &layingitem_vel_50FDFC.z); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3863 switch (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid)) |
0 | 3864 { |
3865 case OBJECT_Actor: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3866 sub_43B1B0(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC, pSpriteObjects[uLayingItemID].field_61); |
0 | 3867 break; |
3868 case OBJECT_Player: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3869 DamageMonsterFromParty(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC); |
0 | 3870 break; |
3871 case OBJECT_Item: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3872 sub_43B057(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC); |
0 | 3873 break; |
3874 } | |
3875 } | |
3876 } | |
3877 | |
3878 //----- (0043AE12) -------------------------------------------------------- | |
3879 double __fastcall sub_43AE12(signed int a1) | |
3880 { | |
3881 signed int v1; // ST00_4@1 | |
3882 signed int v2; // ecx@1 | |
3883 double v3; // st7@1 | |
3884 double result; // st7@6 | |
3885 | |
3886 v1 = a1; | |
3887 v2 = 0; | |
3888 v3 = (double)v1; | |
3889 do | |
3890 { | |
3891 if ( v3 < flt_4E4A80[v2 + 5] ) | |
3892 break; | |
3893 ++v2; | |
3894 } | |
3895 while ( v2 < 5 ); | |
3896 if ( v2 <= 0 || v2 >= 5 ) | |
3897 { | |
3898 if ( v2 ) | |
3899 result = flt_4E4A80[4]; | |
3900 else | |
3901 result = flt_4E4A80[0]; | |
3902 } | |
3903 else | |
3904 { | |
1469 | 3905 result = (flt_4E4A80[v2] - flt_4E4A80[v2 - 1]) * (v3 - flt_4E4A80[v2 + 4]) / (flt_4E4A80[v2 + 5] - flt_4E4A80[v2 + 4]) + flt_4E4A80[v2]; |
0 | 3906 } |
3907 return result; | |
3908 } | |
3909 | |
3910 //----- (0043B057) -------------------------------------------------------- | |
3911 void __fastcall sub_43B057(unsigned int uObjID, unsigned int uActorID, Vec3_int_ *pVelocity) | |
3912 { | |
3913 Actor *pActor; // esi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3914 SpriteObject *v4; // eax@3 |
0 | 3915 int v5; // ecx@3 |
3916 int v6; // eax@4 | |
3917 int v7; // edi@4 | |
3918 unsigned int uActorIDa; // [sp+8h] [bp-8h]@1 | |
3919 unsigned int a2; // [sp+Ch] [bp-4h]@1 | |
3920 int a2a; // [sp+Ch] [bp-4h]@8 | |
3921 | |
3922 uActorIDa = uActorID; | |
3923 pActor = &pActors[uActorID]; | |
3924 a2 = uObjID; | |
303 | 3925 if ( !pActors[uActorID].IsNotAlive() ) |
0 | 3926 { |
848 | 3927 if ( PID_TYPE(a2) == OBJECT_Item) |
3928 { | |
3929 v4 = &pSpriteObjects[PID_ID(a2)]; | |
822 | 3930 v5 = v4->spell_id; |
0 | 3931 if ( v5 ) |
3932 { | |
822 | 3933 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP); |
0 | 3934 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); |
3935 pActor->sCurrentHP -= v7; | |
3936 if ( v7 ) | |
3937 { | |
3938 if ( pActor->sCurrentHP > 0 ) | |
1060 | 3939 Actor::AI_Stun(uActorIDa, a2, 0); |
0 | 3940 else |
3941 Actor::Die(uActorIDa); | |
3942 a2a = 20 * v7 / (signed int)pActor->pMonsterInfo.uHP; | |
3943 if ( 20 * v7 / (signed int)pActor->pMonsterInfo.uHP > 10 ) | |
3944 a2a = 10; | |
3945 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) | |
3946 { | |
3947 pVelocity->x = (unsigned __int64)(a2a * (signed __int64)pVelocity->x) >> 16; | |
3948 pVelocity->y = (unsigned __int64)(a2a * (signed __int64)pVelocity->y) >> 16; | |
3949 pVelocity->z = (unsigned __int64)(a2a * (signed __int64)pVelocity->z) >> 16; | |
3950 pActor->vVelocity.x = 50 * LOWORD(pVelocity->x); | |
3951 pActor->vVelocity.y = 50 * LOWORD(pVelocity->y); | |
3952 pActor->vVelocity.z = 50 * LOWORD(pVelocity->z); | |
3953 } | |
3954 Actor::AddBloodsplatOnDamageOverlay(uActorIDa, 1, v7); | |
3955 } | |
3956 else | |
3957 { | |
1060 | 3958 Actor::AI_Stun(uActorIDa, a2, 0); |
0 | 3959 } |
3960 } | |
3961 } | |
3962 } | |
3963 } | |
3964 | |
3965 //----- (0043B1B0) -------------------------------------------------------- | |
322 | 3966 void sub_43B1B0(signed int a1, unsigned int a2, Vec3_int_ *pVelocity, signed int a4) |
0 | 3967 { |
3968 int v4; // ebx@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3969 SpriteObject *v5; // eax@2 |
0 | 3970 bool v6; // eax@3 |
3971 Actor *v7; // esi@4 | |
3972 Actor *v8; // edi@4 | |
3973 char v9; // zf@5 | |
3974 __int64 v10; // qax@8 | |
3975 signed __int16 v11; // cx@9 | |
3976 signed int v12; // ecx@20 | |
3977 int v13; // ecx@22 | |
3978 int v14; // edi@30 | |
3979 unsigned int uActorID; // [sp+Ch] [bp-8h]@1 | |
3980 signed int v17; // [sp+10h] [bp-4h]@1 | |
3981 int v18; // [sp+20h] [bp+Ch]@34 | |
3982 | |
3983 v4 = 0; | |
3984 uActorID = a2; | |
3985 v17 = a1; | |
848 | 3986 if ( PID_TYPE(a1) == OBJECT_Item) |
3987 { | |
3988 v5 = &pSpriteObjects[PID_ID(a1)]; | |
0 | 3989 v4 = v5->field_60_distance_related_prolly_lod; |
822 | 3990 v17 = v5->spell_caster_pid; |
0 | 3991 } |
848 | 3992 LOWORD(v6) = PID_TYPE(v17); |
303 | 3993 if ( v6 == OBJECT_Actor) |
0 | 3994 { |
3995 v7 = &pActors[a2]; | |
848 | 3996 v8 = &pActors[PID_ID(v17)]; |
303 | 3997 v6 = pActors[a2].IsNotAlive(); |
0 | 3998 if ( !v6 ) |
3999 { | |
4000 v9 = v7->uAIState == 7; | |
4001 v7->uLastCharacterIDToHit = v17; | |
4002 if ( v9 ) | |
4003 BYTE2(v7->uAttributes) |= 2u; | |
4004 v6 = stru_50C198._4273BB(v8, v7, v4, 0); | |
4005 if ( v6 ) | |
4006 { | |
4007 v10 = (unsigned int)Actor::_43B3E0_CalcDamage(v8, a4); | |
4008 if ( (signed __int64)v8->pActorBuffs[3].uExpireTime > 0 ) | |
4009 { | |
4010 v11 = v8->pActorBuffs[3].uPower; | |
4011 if ( v11 ) | |
4012 v10 = (signed int)v10 / (unsigned __int16)v11; | |
4013 } | |
4014 if ( SHIDWORD(v7->pActorBuffs[5].uExpireTime) >= SHIDWORD(v10) | |
4015 && (SHIDWORD(v7->pActorBuffs[5].uExpireTime) > SHIDWORD(v10) | |
4016 || LODWORD(v7->pActorBuffs[5].uExpireTime) > HIDWORD(v10)) ) | |
4017 LODWORD(v10) = 0; | |
4018 if ( a4 != HIDWORD(v10) ) | |
4019 { | |
4020 if ( a4 - HIDWORD(v10) == 1 ) | |
4021 { | |
4022 v12 = v8->pMonsterInfo.uAttack2Type; | |
4023 if ( SHIDWORD(v7->pActorBuffs[15].uExpireTime) >= SHIDWORD(v10) | |
4024 && (SHIDWORD(v7->pActorBuffs[15].uExpireTime) > SHIDWORD(v10) | |
4025 || LODWORD(v7->pActorBuffs[15].uExpireTime) > HIDWORD(v10)) ) | |
4026 LODWORD(v10) = (signed int)v10 >> 1; | |
4027 goto LABEL_30; | |
4028 } | |
4029 if ( a4 - HIDWORD(v10) == 2 ) | |
4030 { | |
4031 v13 = v7->pMonsterInfo.uSpell1ID; | |
4032 } | |
4033 else | |
4034 { | |
4035 if ( a4 - HIDWORD(v10) != 3 ) | |
4036 { | |
4037 if ( a4 - HIDWORD(v10) == 4 ) | |
4038 v12 = v8->pMonsterInfo.field_3C_some_special_attack; | |
4039 else | |
4040 v12 = 4; | |
4041 LABEL_30: | |
4042 v14 = stru_50C198.CalcMagicalDamageToActor(v7, v12, v10); | |
4043 v7->sCurrentHP -= v14; | |
4044 if ( v14 ) | |
4045 { | |
4046 if ( v7->sCurrentHP > 0 ) | |
1060 | 4047 Actor::AI_Stun(uActorID, v17, 0); |
0 | 4048 else |
4049 Actor::Die(uActorID); | |
322 | 4050 Actor::AggroSurroundingPeasants(uActorID, 0); |
0 | 4051 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP; |
4052 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 ) | |
4053 v18 = 10; | |
4054 if ( !MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) | |
4055 { | |
4056 pVelocity->x = (unsigned __int64)(v18 * (signed __int64)pVelocity->x) >> 16; | |
4057 pVelocity->y = (unsigned __int64)(v18 * (signed __int64)pVelocity->y) >> 16; | |
4058 pVelocity->z = (unsigned __int64)(v18 * (signed __int64)pVelocity->z) >> 16; | |
4059 v7->vVelocity.x = 50 * LOWORD(pVelocity->x); | |
4060 v7->vVelocity.y = 50 * LOWORD(pVelocity->y); | |
4061 v7->vVelocity.z = 50 * LOWORD(pVelocity->z); | |
4062 } | |
322 | 4063 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14); |
0 | 4064 } |
4065 else | |
4066 { | |
1060 | 4067 Actor::AI_Stun(uActorID, v17, 0); |
0 | 4068 } |
322 | 4069 return; |
0 | 4070 } |
4071 v13 = v7->pMonsterInfo.uSpell2ID; | |
4072 } | |
4073 v12 = LOBYTE(pSpellStats->pInfos[v13].uSchool); | |
4074 goto LABEL_30; | |
4075 } | |
4076 v12 = v8->pMonsterInfo.uAttack1Type; | |
4077 goto LABEL_30; | |
4078 } | |
4079 } | |
4080 } | |
4081 } | |
4082 | |
4083 | |
4084 //----- (0043F515) -------------------------------------------------------- | |
657 | 4085 void FindBillboardsLightLevels_BLV() |
0 | 4086 { |
4087 for (uint i = 0; i < uNumBillboardsToDraw; ++i) | |
4088 { | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
4089 auto p = &pBillboardRenderList[i]; |
0 | 4090 |
4091 if (p->field_1E & 2 || uCurrentlyLoadedLevelType == LEVEL_Indoor && !p->uIndoorSectorID) | |
657 | 4092 p->dimming_level = 0; |
0 | 4093 else |
657 | 4094 p->dimming_level = _43F55F_get_billboard_light_level(p, -1); |
0 | 4095 } |
4096 } | |
4097 | |
4098 //----- (0043F55F) -------------------------------------------------------- | |
4099 int __fastcall _43F55F_get_billboard_light_level(RenderBillboard *a1, int uBaseLightLevel) | |
4100 { | |
4101 signed int v3; // ecx@2 | |
4102 | |
4103 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
4104 { | |
4105 v3 = pIndoor->pSectors[a1->uIndoorSectorID].uMinAmbientLightLevel; | |
4106 } | |
4107 else | |
4108 { | |
4109 if ( uBaseLightLevel == -1 ) | |
657 | 4110 v3 = a1->dimming_level; |
0 | 4111 else |
4112 v3 = uBaseLightLevel; | |
4113 } | |
430 | 4114 return _43F5C8_get_point_light_level_with_respect_to_lights(v3, a1->uIndoorSectorID, a1->world_x, a1->world_y, a1->world_z); |
0 | 4115 } |
4116 | |
4117 //----- (0043F5C8) -------------------------------------------------------- | |
4118 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z) | |
4119 { | |
4120 int v5; // esi@1 | |
4121 signed int v6; // edi@1 | |
4122 int v8; // eax@6 | |
4123 int v9; // ebx@6 | |
4124 unsigned int v10; // ecx@6 | |
4125 unsigned int v11; // edx@9 | |
4126 unsigned int v12; // edx@11 | |
4127 signed int v13; // ecx@12 | |
4128 BLVLightMM7 *v16; // esi@20 | |
4129 int v17; // ebx@21 | |
4130 int v18; // eax@24 | |
4131 int v19; // ebx@24 | |
4132 unsigned int v20; // ecx@24 | |
4133 int v21; // edx@25 | |
4134 unsigned int v22; // edx@27 | |
4135 unsigned int v23; // edx@29 | |
4136 signed int v24; // ecx@30 | |
4137 int v26; // ebx@35 | |
4138 int v27; // eax@38 | |
4139 int v28; // ebx@38 | |
4140 unsigned int v29; // ecx@38 | |
4141 int v30; // edx@39 | |
4142 unsigned int v31; // edx@41 | |
4143 unsigned int v32; // edx@43 | |
4144 signed int v33; // ecx@44 | |
4145 int v37; // [sp+Ch] [bp-18h]@37 | |
4146 int v38; // [sp+10h] [bp-14h]@5 | |
4147 int v39; // [sp+10h] [bp-14h]@23 | |
4148 int v40; // [sp+10h] [bp-14h]@36 | |
4149 int v42; // [sp+14h] [bp-10h]@22 | |
4150 unsigned int v43; // [sp+18h] [bp-Ch]@12 | |
4151 unsigned int v44; // [sp+18h] [bp-Ch]@30 | |
4152 unsigned int v45; // [sp+18h] [bp-Ch]@44 | |
4153 | |
4154 v6 = uBaseLightLevel; | |
4155 for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i) | |
4156 { | |
4157 auto p = pMobileLightsStack->pLights + i; | |
4158 | |
4159 auto distX = abs(p->vPosition.x - x); | |
4160 if ( distX <= p->uRadius) | |
4161 { | |
4162 auto distY = abs(p->vPosition.y - y); | |
4163 if ( distY <= p->uRadius) | |
4164 { | |
4165 auto distZ = abs(p->vPosition.z - z); | |
4166 if ( distZ <= p->uRadius) | |
4167 { | |
4168 v8 = distX; | |
4169 v9 = distY; | |
4170 v10 = distZ; | |
4171 if (distX < distY) | |
4172 { | |
4173 v8 = distY; | |
4174 v9 = distX; | |
4175 } | |
4176 if ( v8 < distZ ) | |
4177 { | |
4178 v11 = v8; | |
4179 v8 = distZ; | |
4180 v10 = v11; | |
4181 } | |
4182 if ( v9 < (signed int)v10 ) | |
4183 { | |
4184 v12 = v10; | |
4185 v10 = v9; | |
4186 v9 = v12; | |
4187 } | |
4188 v43 = ((unsigned int)(11 * v9) / 32) + (v10 / 4) + v8; | |
4189 v13 = p->uRadius; | |
4190 if ( (signed int)v43 < v13 ) | |
4191 v6 += ((unsigned __int64)(30i64 * (signed int)(v43 << 16) / v13) >> 16) - 30; | |
4192 } | |
4193 } | |
4194 } | |
4195 } | |
4196 | |
4197 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4198 { | |
4199 auto pSector = pIndoor->pSectors + uSectorID; | |
4200 | |
4201 for (uint i = 0; i < pSector->uNumLights; ++i) | |
4202 { | |
4203 v16 = pIndoor->pLights + pSector->pLights[i]; | |
4204 if (~v16->uAtributes & 8) | |
4205 { | |
4206 v17 = abs(v16->vPosition.x - x); | |
4207 if ( v17 <= v16->uRadius ) | |
4208 { | |
4209 v42 = abs(v16->vPosition.y - y); | |
4210 if ( v42 <= v16->uRadius ) | |
4211 { | |
4212 v39 = abs(v16->vPosition.z - z); | |
4213 if ( v39 <= v16->uRadius ) | |
4214 { | |
4215 v18 = v17; | |
4216 v19 = v42; | |
4217 v20 = v39; | |
4218 if ( v18 < v42 ) | |
4219 { | |
4220 v21 = v18; | |
4221 v18 = v42; | |
4222 v19 = v21; | |
4223 } | |
4224 if ( v18 < v39 ) | |
4225 { | |
4226 v22 = v18; | |
4227 v18 = v39; | |
4228 v20 = v22; | |
4229 } | |
4230 if ( v19 < (signed int)v20 ) | |
4231 { | |
4232 v23 = v20; | |
4233 v20 = v19; | |
4234 v19 = v23; | |
4235 } | |
4236 v44 = ((unsigned int)(11 * v19) >> 5) + (v20 >> 2) + v18; | |
4237 v24 = v16->uRadius; | |
4238 if ( (signed int)v44 < v24 ) | |
4239 v6 += ((unsigned __int64)(30i64 * (signed int)(v44 << 16) / v24) >> 16) - 30; | |
4240 } | |
4241 } | |
4242 } | |
4243 } | |
4244 } | |
4245 } | |
4246 | |
4247 for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i) | |
4248 { | |
4249 auto p = pStationaryLightsStack->pLights + i; | |
4250 v26 = abs(p->vPosition.x - x); | |
4251 if ( v26 <= p->uRadius) | |
4252 { | |
4253 v40 = abs(p->vPosition.y - y); | |
4254 if ( v40 <= p->uRadius) | |
4255 { | |
4256 v37 = abs(p->vPosition.z - z); | |
4257 if ( v37 <= p->uRadius) | |
4258 { | |
4259 v27 = v26; | |
4260 v28 = v40; | |
4261 v29 = v37; | |
4262 if ( v27 < v40 ) | |
4263 { | |
4264 v30 = v27; | |
4265 v27 = v40; | |
4266 v28 = v30; | |
4267 } | |
4268 if ( v27 < v37 ) | |
4269 { | |
4270 v31 = v27; | |
4271 v27 = v37; | |
4272 v29 = v31; | |
4273 } | |
4274 if ( v28 < (signed int)v29 ) | |
4275 { | |
4276 v32 = v29; | |
4277 v29 = v28; | |
4278 v28 = v32; | |
4279 } | |
4280 v45 = ((unsigned int)(11 * v28) >> 5) + (v29 >> 2) + v27; | |
4281 v33 = p->uRadius; | |
4282 if ( (signed int)v45 < v33 ) | |
4283 v6 += ((unsigned __int64)(30i64 * (signed int)(v45 << 16) / v33) >> 16) - 30; | |
4284 } | |
4285 } | |
4286 } | |
4287 } | |
4288 | |
4289 if ( v6 <= 31 ) | |
4290 { | |
4291 if ( v6 < 0 ) | |
4292 v6 = 0; | |
4293 } | |
4294 else | |
4295 { | |
4296 v6 = 31; | |
4297 } | |
4298 return v6; | |
4299 } | |
4300 | |
4301 | |
4302 //----- (004070EF) -------------------------------------------------------- | |
1493 | 4303 bool __fastcall sub_4070EF_prolly_detect_player(unsigned int uObjID, unsigned int uObj2ID) |
0 | 4304 { |
4305 signed int v2; // eax@1 | |
1493 | 4306 //unsigned int v3; // ecx@1 |
4307 //signed int v4; // esi@1 | |
0 | 4308 int v5; // ecx@2 |
4309 signed int v6; // eax@4 | |
1493 | 4310 int object1_sector; // eax@4 |
0 | 4311 float v8; // ST24_4@5 |
4312 double v9; // ST18_8@5 | |
4313 signed int v10; // eax@6 | |
4314 int v11; // ecx@6 | |
4315 signed int v12; // eax@7 | |
4316 int v13; // esi@7 | |
4317 int v14; // esi@8 | |
4318 int v15; // esi@9 | |
4319 signed int v16; // eax@11 | |
1493 | 4320 int obj2_z; // edi@11 |
4321 int obj2_x; // esi@11 | |
4322 int obj2_sector; // eax@13 | |
0 | 4323 float v20; // ST24_4@14 |
4324 double v21; // ST18_8@14 | |
4325 signed int v22; // eax@15 | |
1493 | 4326 int dist2_x; // ebx@16 |
0 | 4327 signed int v24; // ecx@16 |
4328 int v25; // eax@18 | |
1493 | 4329 //int v26; // eax@28 |
4330 //BLVSector *v27; // edx@31 | |
4331 //int v28; // ecx@31 | |
0 | 4332 BLVFace *v29; // ebx@32 |
4333 Vec3_short_ *v30; // esi@32 | |
4334 int v31; // eax@32 | |
4335 int v32; // ST50_4@44 | |
4336 int v33; // ST54_4@44 | |
4337 int v34; // eax@44 | |
4338 char v35; // zf@44 | |
4339 int v36; // edi@44 | |
4340 int v37; // eax@45 | |
4341 signed int v38; // esi@45 | |
4342 int v39; // ST4C_4@49 | |
4343 signed __int64 v40; // qtt@50 | |
4344 __int16 v42; // bx@58 | |
4345 int v43; // [sp-8h] [bp-70h]@11 | |
4346 int v44; // [sp-4h] [bp-6Ch]@11 | |
1493 | 4347 //int v45; // [sp+Ch] [bp-5Ch]@32 |
4348 //__int16 v46; // [sp+10h] [bp-58h]@32 | |
0 | 4349 int v47; // [sp+18h] [bp-50h]@20 |
4350 int v48; // [sp+1Ch] [bp-4Ch]@20 | |
4351 int v49; // [sp+20h] [bp-48h]@20 | |
1493 | 4352 int dist2_z; // [sp+24h] [bp-44h]@16 |
0 | 4353 signed int v51; // [sp+24h] [bp-44h]@27 |
4354 signed int v52; // [sp+28h] [bp-40h]@26 | |
4355 signed int v53; // [sp+2Ch] [bp-3Ch]@23 | |
4356 signed int v54; // [sp+30h] [bp-38h]@22 | |
4357 signed int v55; // [sp+34h] [bp-34h]@21 | |
4358 signed int v56; // [sp+38h] [bp-30h]@20 | |
4359 signed int v57; // [sp+3Ch] [bp-2Ch]@28 | |
4360 int v58; // [sp+44h] [bp-24h]@50 | |
4361 int v59; // [sp+48h] [bp-20h]@44 | |
1493 | 4362 int obj2_y; // [sp+50h] [bp-18h]@11 |
0 | 4363 signed int v61; // [sp+50h] [bp-18h]@31 |
1493 | 4364 //int v62; // [sp+54h] [bp-14h]@16 |
4365 int obj_x; // [sp+58h] [bp-10h]@4 | |
4366 int obj_y; // [sp+5Ch] [bp-Ch]@4 | |
4367 int obj_z; // [sp+60h] [bp-8h]@4 | |
0 | 4368 int v66; // [sp+64h] [bp-4h]@7 |
4369 | |
848 | 4370 v2 = PID_ID(uObjID); |
1493 | 4371 if ( PID_TYPE(uObjID) == 5 ) |
0 | 4372 { |
4373 v6 = v2; | |
1493 | 4374 obj_x = pLevelDecorations[v6].vPosition.x; |
4375 obj_y = pLevelDecorations[v6].vPosition.y; | |
4376 obj_z = pLevelDecorations[v6].vPosition.z; | |
4377 object1_sector = pIndoor->GetSector(obj_x, obj_y, obj_z); | |
4378 } | |
4379 else if ( PID_TYPE(uObjID) == 3 ) | |
4380 { | |
4381 obj_x = pActors[v2].vPosition.x; | |
4382 obj_y = pActors[v2].vPosition.y; | |
0 | 4383 v8 = (double)pActors[v2].uActorHeight * 0.69999999; |
1493 | 4384 //v9 = v8 + 6.7553994e15; |
4385 //obj_z = LODWORD(v9) + pActors[v2].vPosition.z; | |
4386 obj_z = (int)v8 + pActors[v2].vPosition.z; | |
4387 object1_sector = pActors[v2].uSectorID; | |
0 | 4388 } |
1493 | 4389 else if ( PID_TYPE(uObjID) == 2 ) |
0 | 4390 { |
4391 v10 = v2; | |
1493 | 4392 obj_x = pSpriteObjects[v10].vPosition.x; |
4393 obj_y = pSpriteObjects[v10].vPosition.y; | |
4394 obj_z = pSpriteObjects[v10].vPosition.z; | |
4395 object1_sector = pSpriteObjects[v10].uSectorID; | |
0 | 4396 } |
4397 else | |
1493 | 4398 return 0; |
4399 v66 = object1_sector; | |
4400 v12 = PID_ID(uObj2ID); | |
4401 if ( PID_TYPE(uObj2ID) == 5) | |
4402 { | |
4403 v16 = v12; | |
4404 obj2_z = pLevelDecorations[v16].vPosition.z; | |
4405 obj2_x = pLevelDecorations[v16].vPosition.x; | |
4406 obj2_y = pLevelDecorations[v16].vPosition.y; | |
4407 obj2_sector = pIndoor->GetSector(obj2_x, obj2_y, obj2_z); | |
4408 } | |
4409 else if ( PID_TYPE(uObj2ID) == 4) | |
4410 { | |
4411 obj2_x = pParty->vPosition.x; | |
4412 obj2_z = pParty->sEyelevel + pParty->vPosition.z; | |
4413 obj2_y = pParty->vPosition.y; | |
4414 obj2_sector = pIndoor->GetSector(obj2_x, obj2_y, obj2_z); | |
4415 } | |
4416 | |
4417 else if( PID_TYPE(uObj2ID) == 3) | |
4418 { | |
4419 obj2_y = pActors[v12].vPosition.y; | |
4420 obj2_x = pActors[v12].vPosition.x; | |
4421 v20 = (double)pActors[v12].uActorHeight * 0.69999999; | |
4422 //v21 = v20 + 6.7553994e15; | |
4423 //obj2_z = LODWORD(v21) + pActors[v12].vPosition.z; | |
4424 obj2_z = (int)v20 + pActors[v12].vPosition.z; | |
4425 obj2_sector = pActors[v12].uSectorID; | |
4426 } | |
4427 | |
4428 else if ( PID_TYPE(uObj2ID) == 2) | |
0 | 4429 { |
4430 v22 = v12; | |
1493 | 4431 obj2_x = pSpriteObjects[v22].vPosition.x; |
4432 obj2_z = pSpriteObjects[v22].vPosition.z; | |
4433 obj2_y = pSpriteObjects[v22].vPosition.y; | |
4434 obj2_sector = pSpriteObjects[v22].uSectorID; | |
0 | 4435 } |
1493 | 4436 else |
4437 return 0; | |
4438 dist2_x = obj2_x - obj_x; | |
4439 dist2_z = obj2_z - obj_z; | |
4440 v24 = integer_sqrt(dist2_x * dist2_x + (obj2_y - obj_y) * (obj2_y - obj_y) + dist2_z * dist2_z); | |
0 | 4441 if ( v24 > 5120 ) |
4442 return 0; | |
4443 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4444 return 1; | |
4445 v25 = 65536; | |
4446 if ( v24 ) | |
4447 v25 = 65536 / v24; | |
1493 | 4448 v49 = dist2_x * v25; |
4449 v47 = dist2_z * v25; | |
4450 v48 = (obj2_y - obj_y) * v25; | |
4451 if ( obj_x < obj2_x ) | |
0 | 4452 { |
1493 | 4453 v56 = obj_x; |
4454 v55 = obj2_x; | |
0 | 4455 } |
4456 else | |
4457 { | |
1493 | 4458 v56 = obj2_x; |
4459 v55 = obj_x; | |
0 | 4460 } |
1493 | 4461 if ( obj_y < obj2_y ) |
0 | 4462 { |
1493 | 4463 v54 = obj_y; |
4464 v53 = obj2_y; | |
0 | 4465 } |
4466 else | |
4467 { | |
1493 | 4468 v54 = obj2_y; |
4469 v53 = obj_y; | |
0 | 4470 } |
1493 | 4471 if ( obj_z < obj2_z ) |
0 | 4472 { |
1493 | 4473 v52 = obj_z; |
4474 v51 = obj2_z; | |
0 | 4475 } |
4476 else | |
4477 { | |
1493 | 4478 v52 = obj2_z; |
4479 v51 = obj_z; | |
0 | 4480 } |
4481 v57 = 0; | |
1493 | 4482 if ( v66 == obj2_sector ) |
0 | 4483 return 1; |
1493 | 4484 //for ( v57 = 0; v57 < 30; v57++ ) |
4485 if ( v57 < 30 && !(v61 = 0, pIndoor->pSectors[v66].uNumPortals <= 0) ) | |
4486 for( int v61 = 0; v61 < pIndoor->pSectors[v66].uNumPortals; v61++ ) | |
4487 { | |
4488 v29 = &pIndoor->pFaces[pIndoor->pSectors[v66].pPortals[v61]]; | |
0 | 4489 v30 = &pIndoor->pVertices[*v29->pVertexIDs]; |
1493 | 4490 //v45 = *(int *)&v30->x; |
4491 //v46 = v30->z; | |
4492 //v31 = v29->pFacePlane_old.vNormal.z * (v46 - obj_z) | |
4493 v31 = v29->pFacePlane_old.vNormal.z * (v30->z - obj_z) | |
4494 //+ v29->pFacePlane_old.vNormal.y * (SHIWORD(v45) - obj_y) | |
4495 + v29->pFacePlane_old.vNormal.y * (v30->y - obj_y) | |
4496 //+ v29->pFacePlane_old.vNormal.x * ((signed __int16)v45 - obj_x); | |
4497 + v29->pFacePlane_old.vNormal.x * (v30->x - obj_x); | |
0 | 4498 if ( v66 != v29->uSectorID ) |
4499 v31 = -v31; | |
1493 | 4500 //if (!( v31 >= 0 && (signed __int16)v45 != obj_x && SHIWORD(v45) != obj_y && v46 != obj_z |
4501 if (!( v31 >= 0 && v30->x != obj_x && v30->y != obj_y && v30->z != obj_z | |
0 | 4502 || v56 > v29->pBounding.x2 |
4503 || v55 < v29->pBounding.x1 | |
4504 || v54 > v29->pBounding.y2 | |
4505 || v53 < v29->pBounding.y1 | |
4506 || v52 > v29->pBounding.z2 | |
1493 | 4507 || v51 < v29->pBounding.z1 ) ) |
4508 { | |
4509 v32 = (unsigned __int64)(v49 * (signed __int64)v29->pFacePlane_old.vNormal.x) >> 16; | |
4510 v33 = (unsigned __int64)(v47 * (signed __int64)v29->pFacePlane_old.vNormal.z) >> 16; | |
4511 v34 = (unsigned __int64)(v48 * (signed __int64)v29->pFacePlane_old.vNormal.y) >> 16; | |
4512 v35 = v32 + v33 + v34 == 0; | |
4513 v36 = v32 + v33 + v34; | |
4514 v59 = v32 + v33 + v34; | |
4515 if ( !v35 ) | |
4516 { | |
4517 v37 = obj_z * v29->pFacePlane_old.vNormal.z; | |
4518 v38 = -(v29->pFacePlane_old.dist + v37 + obj_x * v29->pFacePlane_old.vNormal.x + obj_y * v29->pFacePlane_old.vNormal.y); | |
4519 if ( v36 <= 0 ^ v29->pFacePlane_old.dist + v37 + obj_x * v29->pFacePlane_old.vNormal.x + obj_y * v29->pFacePlane_old.vNormal.y <= 0) | |
4520 { | |
4521 v39 = abs(-(v29->pFacePlane_old.dist | |
4522 + v37 | |
4523 + obj_x * v29->pFacePlane_old.vNormal.x | |
4524 + obj_y * v29->pFacePlane_old.vNormal.y)) >> 14; | |
4525 if ( v39 > abs(v36) | |
4526 || (LODWORD(v40) = v38 << 16, HIDWORD(v40) = v38 >> 16, v58 = v40 / v59, (signed int)(v40 / v59) < 0) | |
4527 || !sub_4075DB( | |
4528 obj_x + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v49) >> 16) + 32768) >> 16), | |
4529 obj_y + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v48) >> 16) + 32768) >> 16), | |
4530 obj_z + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v47) >> 16) + 32768) >> 16), | |
4531 v29) ) | |
4532 { | |
4533 continue; | |
4534 } | |
4535 if ( v29->uSectorID == v66 ) | |
4536 v42 = v29->uBackSectorID; | |
4537 else | |
4538 v42 = v29->uSectorID; | |
4539 if ( v42 != v66 ) | |
4540 { | |
4541 ++v57; | |
4542 v66 = v42; | |
4543 if ( v42 == obj2_sector ) | |
4544 return 1; | |
4545 if ( v57 < 30 && pIndoor->pSectors[v66].uNumPortals > 0) | |
4546 { | |
4547 v61=-1; | |
4548 continue; | |
4549 } | |
4550 | |
4551 } | |
4552 break; | |
4553 } | |
4554 } | |
4555 } | |
0 | 4556 } |
1493 | 4557 if ( v66 != obj2_sector ) |
0 | 4558 return 0; |
4559 return 1; | |
4560 } | |
4561 | |
4562 //----- (004075DB) -------------------------------------------------------- | |
4563 bool __fastcall sub_4075DB(int a1, int a2, int a3, BLVFace *a4) | |
4564 { | |
4565 unsigned int v5; // esi@1 | |
4566 char v7; // zf@2 | |
4567 int v8; // edi@2 | |
4568 Vec3_short_ *v9; // ecx@3 | |
4569 int v10; // edx@4 | |
4570 Vec3_short_ *v12; // ecx@8 | |
4571 int v13; // edx@9 | |
4572 Vec3_short_ *v15; // ecx@12 | |
4573 int v16; // edx@13 | |
4574 bool v18; // esi@14 | |
4575 int v19; // ecx@14 | |
4576 int v20; // ecx@16 | |
4577 int v21; // edx@16 | |
4578 int v22; // eax@17 | |
4579 signed int v23; // ebx@18 | |
4580 int v24; // esi@20 | |
4581 signed int v25; // eax@22 | |
4582 signed __int64 v26; // qtt@22 | |
4583 bool result; // eax@25 | |
4584 int v29; // [sp+10h] [bp-Ch]@14 | |
4585 signed int a3a; // [sp+24h] [bp+8h]@14 | |
4586 int a4a; // [sp+28h] [bp+Ch]@2 | |
4587 | |
1493 | 4588 //__debugbreak(); |
1458 | 4589 |
0 | 4590 v5 = a4->uAttributes; |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4591 v9 = pIndoor->pVertices; |
1471 | 4592 if ( v5 & FACE_XY_PLANE ) |
0 | 4593 { |
4594 a4a = a1; | |
4595 v8 = a2; | |
1471 | 4596 for(int i = 0; i < a4->uNumVertices; i++) |
4597 { | |
4598 dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].x; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4599 dword_4F5CC4_ys[i+1] = v9[a4->pVertexIDs[i]].y; |
1471 | 4600 } |
0 | 4601 } |
4602 else | |
4603 { | |
4604 v8 = a3; | |
1471 | 4605 if ( v5 & FACE_XY_PLANE ) |
0 | 4606 { |
4607 a4a = a1; | |
1471 | 4608 for(int i = 0; i < a4->uNumVertices; i++) |
4609 { | |
4610 dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].x; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4611 dword_4F5CC4_ys[i+1] = v9[a4->pVertexIDs[i]].z; |
1471 | 4612 } |
0 | 4613 } |
4614 else | |
4615 { | |
4616 a4a = a2; | |
1471 | 4617 for(int i = 0; i < a4->uNumVertices; i++) |
4618 { | |
4619 dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].y; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4620 dword_4F5CC4_ys[i+1] = v9[a4->pVertexIDs[i]].z; |
1471 | 4621 } |
0 | 4622 } |
4623 } | |
4624 a3a = 0; | |
1471 | 4625 dword_4F5D98_xs[a4->uNumVertices] = dword_4F5D98_xs[0]; |
4626 dword_4F5CC4_ys[a4->uNumVertices + 1] = dword_4F5CC4_ys[1]; | |
4627 for(int i = 0; i < a4->uNumVertices; i++) | |
0 | 4628 { |
4629 if ( a3a >= 2 ) | |
4630 break; | |
1471 | 4631 if ( dword_4F5CC4_ys[i + 1] >= v8 ^ (dword_4F5CC4_ys[i + 2] >= v8) ) |
0 | 4632 { |
1471 | 4633 if( dword_4F5D98_xs[i + 1] >= a4a || dword_4F5D98_xs[i] >= a4a) |
0 | 4634 { |
1471 | 4635 if ( (dword_4F5D98_xs[i + 1] >= a4a && dword_4F5D98_xs[i] >= a4a) |
4636 || (v25 = dword_4F5D98_xs[i + 1] - dword_4F5D98_xs[i], | |
0 | 4637 LODWORD(v26) = v25 << 16, |
4638 HIDWORD(v26) = v25 >> 16, | |
1471 | 4639 dword_4F5D98_xs[i] |
0 | 4640 + ((signed int)(((unsigned __int64)(v26 |
1471 | 4641 / (dword_4F5CC4_ys[i + 2] - dword_4F5CC4_ys[i + 1]) |
4642 * ((v8 - dword_4F5CC4_ys[i + 1]) << 16)) >> 16) | |
0 | 4643 + 32768) >> 16) >= a4a) ) |
4644 ++a3a; | |
4645 } | |
4646 } | |
4647 } | |
4648 result = 1; | |
4649 if ( a3a != 1 ) | |
4650 result = 0; | |
4651 return result; | |
4652 } | |
4653 | |
4654 //----- (004077F1) -------------------------------------------------------- | |
4655 bool __fastcall sub_4077F1(int a1, int a2, int a3, ODMFace *a4, BSPVertexBuffer *a5) | |
4656 { | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4657 //ODMFace *v5; // eax@1 |
1473 | 4658 Vec3_int_ *v9; |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4659 unsigned int v5; // esi@1 |
0 | 4660 signed int v7; // edi@1 |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4661 //char v8; // zf@2 |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4662 //unsigned __int16 *v9; // edx@3 |
0 | 4663 int v10; // ecx@4 |
4664 unsigned __int16 *v11; // edx@8 | |
4665 int v12; // ecx@9 | |
4666 int v13; // edx@12 | |
4667 int v14; // ecx@13 | |
4668 int v15; // esi@14 | |
4669 bool v16; // edi@14 | |
4670 int v17; // ecx@16 | |
4671 int v18; // edx@16 | |
4672 int v19; // eax@17 | |
4673 signed int v20; // ebx@18 | |
4674 int v21; // edi@20 | |
4675 signed int v22; // eax@22 | |
4676 signed __int64 v23; // qtt@22 | |
4677 bool result; // eax@25 | |
4678 int v25; // [sp+14h] [bp-8h]@14 | |
4679 int a4a; // [sp+28h] [bp+Ch]@2 | |
4680 signed int a5a; // [sp+2Ch] [bp+10h]@14 | |
4681 | |
1458 | 4682 __debugbreak(); |
4683 | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4684 v5 = a4->uAttributes; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4685 v9 = a5->pVertices; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4686 if ( v5 & FACE_XY_PLANE ) |
0 | 4687 { |
4688 a4a = a1; | |
4689 a3 = a2; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4690 for(int i = 0; i < a4->uNumVertices; i++) |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4691 { |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4692 dword_4F5BF4_xs[i+1] = v9[a4->pVertexIDs[i]].x; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4693 dword_4F5B24_ys[i+1] = v9[a4->pVertexIDs[i]].y; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4694 } |
0 | 4695 } |
4696 else | |
4697 { | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4698 if ( v5 & FACE_XY_PLANE ) |
0 | 4699 { |
4700 a4a = a1; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4701 for(int i = 0; i < a4->uNumVertices; i++) |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4702 { |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4703 dword_4F5BF4_xs[i+1] = v9[a4->pVertexIDs[i]].x; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4704 dword_4F5B24_ys[i+1] = v9[a4->pVertexIDs[i]].z; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4705 } |
0 | 4706 } |
4707 else | |
4708 { | |
4709 a4a = a2; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4710 for(int i = 0; i < a4->uNumVertices; i++) |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4711 { |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4712 dword_4F5BF4_xs[i+1] = v9[a4->pVertexIDs[i]].y; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4713 dword_4F5B24_ys[i+1] = v9[a4->pVertexIDs[i]].z; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4714 } |
0 | 4715 } |
4716 } | |
4717 a5a = 0; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4718 dword_4F5BF4_xs[a4->uNumVertices + 1] = dword_4F5BF4_xs[1]; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4719 dword_4F5B24_ys[a4->uNumVertices + 1] = dword_4F5B24_ys[1]; |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4720 for(int i = 0; i < a4->uNumVertices; i++) |
0 | 4721 { |
4722 if ( a5a >= 2 ) | |
4723 break; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4724 if ( dword_4F5B24_ys[i + 1] >= a3 ^ (dword_4F5B24_ys[i + 2] >= a3) ) |
0 | 4725 { |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4726 if( dword_4F5BF4_xs[i + 2] >= a4a || dword_4F5BF4_xs[i] >= a4a) |
0 | 4727 { |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4728 if ( (dword_4F5BF4_xs[i + 2] >= a4a && dword_4F5BF4_xs[i + 1] >= a4a) |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4729 || (v25 = dword_4F5BF4_xs[i + 2] - dword_4F5BF4_xs[i + 1], |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4730 LODWORD(v23) = v25 << 16, |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4731 HIDWORD(v23) = v25 >> 16, |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4732 dword_4F5BF4_xs[i + 1] |
0 | 4733 + ((signed int)(((unsigned __int64)(v23 |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4734 / (dword_4F5B24_ys[i + 2] - dword_4F5B24_ys[i + 1]) |
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4735 * ((a3 - dword_4F5B24_ys[i + 1]) << 16)) >> 16) |
0 | 4736 + 32768) >> 16) >= a4a) ) |
4737 ++a5a; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4738 } |
0 | 4739 } |
4740 } | |
4741 result = 1; | |
4742 if ( a5a != 1 ) | |
4743 result = 0; | |
4744 return result; | |
1472
2395e99b89d0
sub_4077F1 cleaned, and fixed previous mistake in cleaning
zipi
parents:
1471
diff
changeset
|
4745 |
0 | 4746 } |
4747 | |
4748 //----- (004088E9) -------------------------------------------------------- | |
1459 | 4749 int __fastcall sub_4088E9(int x1, int y1, int x2, int y2, int x3, int y3) |
0 | 4750 { |
4751 int v8; // eax@1 | |
4752 signed int result; // eax@1 | |
4753 int v11; // [sp+18h] [bp+8h]@1 | |
4754 | |
1459 | 4755 v11 = abs(x2 - x1); |
4756 v8 = abs(y2 - y1); | |
295 | 4757 result = integer_sqrt(v11 * v11 + v8 * v8); |
0 | 4758 if ( result ) |
1459 | 4759 result = abs(((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / result); |
0 | 4760 return result; |
4761 } | |
4762 | |
4763 //----- (0040DEF3) -------------------------------------------------------- | |
949 | 4764 unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b ) |
983 | 4765 { |
688 | 4766 return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) + |
4767 LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) + | |
4768 LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8)); | |
0 | 4769 } |
4770 | |
1184 | 4771 |
0 | 4772 |
4773 //----- (0040F82D) -------------------------------------------------------- | |
4774 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | |
4775 { | |
973 | 4776 assert(uTextureId != -1); |
4777 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue); | |
0 | 4778 } |
4779 | |
1160 | 4780 |
0 | 4781 |
4782 //----- (0040F89C) -------------------------------------------------------- | |
4783 void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue) | |
4784 { | |
4785 void *v3; // eax@3 | |
4786 void *v4; // esi@5 | |
4787 int *v5; // edi@5 | |
4788 int v6; // eax@5 | |
4789 int v7; // ecx@6 | |
4790 Texture *v8; // [sp+Ch] [bp-14h]@1 | |
4791 int *v9; // [sp+10h] [bp-10h]@1 | |
4792 int v10; // [sp+14h] [bp-Ch]@1 | |
4793 int v11; // [sp+18h] [bp-8h]@1 | |
4794 void *v12; // [sp+1Ch] [bp-4h]@5 | |
4795 | |
4796 v10 = pTex->uTextureWidth; | |
4797 v8 = pTex; | |
4798 v9 = pZBuffer; | |
4799 v11 = pTex->uTextureHeight; | |
4800 if ( pIcons_LOD->dword_011BA4 && pTex->uDecompressedSize ) | |
4801 v3 = pTex->UnzipPalette(); | |
4802 else | |
710 | 4803 v3 = pTex->pLevelOfDetail0_prolly_alpha_mask; |
0 | 4804 v12 = v3; |
4805 v4 = v3; | |
4806 v5 = v9; | |
4807 v6 = 0; | |
4808 do | |
4809 { | |
4810 v7 = v10; | |
4811 do | |
4812 { | |
4813 LOBYTE(v6) = *(char *)v4; | |
4814 v4 = (char *)v4 + 1; | |
4815 if ( v6 ) | |
4816 *v5 = uZValue; | |
4817 ++v5; | |
4818 --v7; | |
4819 } | |
4820 while ( v7 ); | |
4821 v5 += 640 - v10; | |
4822 --v11; | |
4823 } | |
4824 while ( v11 ); | |
4825 if ( pIcons_LOD->dword_011BA4 ) | |
4826 { | |
4827 if ( v8->uDecompressedSize ) | |
4828 free(v12); | |
4829 } | |
4830 } | |
4831 | |
4832 //----- (0040F92A) -------------------------------------------------------- | |
1458 | 4833 void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3) |
0 | 4834 { |
4835 Texture *v3; // esi@1 | |
4836 void *v4; // eax@3 | |
4837 int *v5; // edi@5 | |
4838 int v6; // ecx@6 | |
4839 int *v7; // [sp+Ch] [bp-10h]@1 | |
4840 int v8; // [sp+10h] [bp-Ch]@1 | |
4841 int v9; // [sp+18h] [bp-4h]@1 | |
4842 | |
4843 v3 = a2; | |
4844 v7 = pZBuffer; | |
4845 v8 = a2->uTextureWidth; | |
4846 v9 = a2->uTextureHeight; | |
4847 if ( pIcons_LOD->dword_011BA4 && a2->uDecompressedSize ) | |
4848 v4 = a2->UnzipPalette(); | |
4849 else | |
710 | 4850 v4 = a2->pLevelOfDetail0_prolly_alpha_mask; |
0 | 4851 v5 = v7; |
4852 do | |
4853 { | |
4854 v6 = v8; | |
4855 do | |
4856 { | |
4857 *v5 = a3; | |
4858 ++v5; | |
4859 --v6; | |
4860 } | |
4861 while ( v6 ); | |
4862 v5 += 640 - v8; | |
4863 --v9; | |
4864 } | |
4865 while ( v9 ); | |
4866 if ( pIcons_LOD->dword_011BA4 ) | |
4867 { | |
4868 if ( v3->uDecompressedSize ) | |
4869 free(v4); | |
4870 } | |
4871 } | |
4872 | |
4873 //----- (00410D99) -------------------------------------------------------- | |
1458 | 4874 int __fastcall sub_410D99_get_map_index(int a1) |
0 | 4875 { |
4876 int v1; // edi@1 | |
4877 signed int v2; // ebp@1 | |
4878 const char **v3; // esi@2 | |
4879 char *v4; // ebx@2 | |
4880 | |
4881 v1 = a1; | |
4882 v2 = 1; | |
1104 | 4883 if ( _stricmp(pMapStats->pInfos[1].pFilename, (const char *)&pGames_LOD->pSubIndices[a1]) ) |
0 | 4884 { |
4885 v3 = (const char **)&pMapStats->pInfos[1].pFilename; | |
4886 v4 = (char *)&pMapStats->pInfos[1].pFilename; | |
4887 do | |
4888 { | |
4889 if ( !*(int *)v4 ) | |
4890 break; | |
4891 v3 += 17; | |
4892 ++v2; | |
4893 v4 = (char *)v3; | |
4894 } | |
1104 | 4895 while ( _stricmp(*v3, (const char *)&pGames_LOD->pSubIndices[v1]) ); |
0 | 4896 } |
4897 return v2; | |
4898 } | |
4899 | |
4900 // 4E28F8: using guessed type int pCurrentScreen; | |
4901 | |
762 | 4902 void LoadFonts_and_DrawCopyrightWindow() |
4903 { | |
4904 MainMenuUI_LoadFontsAndSomeStuff(); | |
4905 DrawCopyrightWindow(); | |
4906 } | |
0 | 4907 |
4908 | |
4909 //----- (00416196) -------------------------------------------------------- | |
1033 | 4910 void identify_item() |
0 | 4911 { |
4912 Player *v0; // esi@2 | |
4913 POINT *v1; // edi@2 | |
4914 signed int v2; // ecx@5 | |
4915 signed int v3; // eax@5 | |
4916 int v4; // eax@5 | |
4917 char v5; // sf@5 | |
4918 int v6; // eax@5 | |
4919 int v7; // eax@7 | |
4920 unsigned __int16 v8; // ax@10 | |
4921 int v9; // edi@10 | |
4922 int v10; // eax@10 | |
4923 int v11; // edx@13 | |
4924 LONG v12; // edx@23 | |
4925 signed int v13; // edx@23 | |
4926 int v14; // edx@25 | |
4927 unsigned int v15; // edi@25 | |
4928 signed int v16; // edx@27 | |
4929 int v17; // eax@54 | |
4930 unsigned int v18; // edx@57 | |
4931 int v19; // eax@65 | |
4932 int v20; // edi@67 | |
4933 int v21; // eax@72 | |
4934 int v22; // ecx@74 | |
4935 int v23; // edx@78 | |
4936 int v24; // eax@79 | |
4937 int v25; // eax@80 | |
4938 int v26; // eax@84 | |
4939 ItemGen *v27; // esi@98 | |
4940 unsigned int v28; // eax@98 | |
4941 ItemGen *v29; // edi@98 | |
4942 unsigned int v30; // ecx@103 | |
4943 double v31; // st7@112 | |
4944 unsigned __int64 v32; // qax@113 | |
4945 unsigned int v33; // ecx@117 | |
4946 int v34; // eax@126 | |
4947 unsigned int v35; // ecx@127 | |
4948 double v36; // st7@132 | |
4949 signed __int64 v37; // qax@135 | |
4950 unsigned int v38; // eax@138 | |
4951 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83 | |
4952 int *v40; // [sp-Ch] [bp-9Ch]@83 | |
4953 int *v41; // [sp-8h] [bp-98h]@83 | |
4954 int *v42; // [sp-4h] [bp-94h]@83 | |
4955 GUIWindow v43; // [sp+Ch] [bp-84h]@137 | |
4956 unsigned int pY; // [sp+60h] [bp-30h]@2 | |
4957 int v45; // [sp+64h] [bp-2Ch]@10 | |
4958 unsigned int pX; // [sp+68h] [bp-28h]@2 | |
4959 int v47; // [sp+6Ch] [bp-24h]@25 | |
4960 POINT y; // [sp+70h] [bp-20h]@2 | |
4961 POINT a2; // [sp+78h] [bp-18h]@2 | |
4962 Vec3_int_ pOut; // [sp+80h] [bp-10h]@2 | |
4963 unsigned int v51; // [sp+8Ch] [bp-4h]@23 | |
4964 | |
4965 if ( dword_50CDCC ) | |
4966 return; | |
4967 v0 = pPlayers[uActiveCharacter]; | |
4968 v1 = pMouse->GetCursorPos(&a2); | |
4969 pOut.z = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&y)->y]] & 0xFFFF; | |
4970 pMouse->GetClickPos(&pX, &pY); | |
4971 if ( !pOut.z ) | |
4972 { | |
4973 if ( (signed int)pX <= 13 | |
4974 || (signed int)pX >= 462 | |
4975 || (v2 = pX - 14, | |
4976 v3 = pY - 17, | |
4977 pX = v2, | |
4978 pY = v3, | |
4979 v4 = 14 * (v3 >> 5), | |
4980 v2 >>= 5, | |
4981 v5 = v2 + v4 < 0, | |
4982 v6 = v2 + v4, | |
4983 pOut.z = v6, | |
4984 v5) | |
4985 || v6 > 126 | |
4986 || (v7 = v0->GetItemIDAtInventoryIndex(&pOut.z)) == 0 ) | |
4987 return; | |
4988 pOut.z = v7; | |
4989 } | |
4990 if ( !v0->CanAct() ) | |
4991 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
4992 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], v0->pName, pGlobalTXT_LocalizationStrings[541]); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
4993 v43.Hint = pTmpBuf.data(); |
0 | 4994 v43.uFrameWidth = 384; |
4995 v43.uFrameHeight = 180; | |
4996 v43.uFrameY = 40; | |
4997 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
4998 v38 = pMouse->GetCursorPos(&a2)->x + 30; | |
4999 else | |
5000 v38 = pMouse->GetCursorPos(&a2)->x - 414; | |
5001 v43.uFrameX = v38; | |
5002 v43.DrawMessageBox(0); | |
5003 return; | |
5004 } | |
5005 --pOut.z; | |
5006 LOBYTE(v8) = v0->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY); | |
5007 v9 = v8 & 0x3F; | |
5008 v45 = v8 & 0x3F; | |
5009 pOut.y = SkillToMastery(v8); | |
5010 v10 = pOut.z; | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1340
diff
changeset
|
5011 if ( pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE ) |
0 | 5012 { |
5013 LABEL_116: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5014 GameUI_DrawItemInfo(&v0->pInventoryItemList[v10]); |
0 | 5015 return; |
5016 } | |
5017 if ( (signed int)pParty->pPickedItem.uItemID < 200 | |
5018 || (signed int)pParty->pPickedItem.uItemID > 219 | |
5019 || (v11 = (int)((char *)v0 + 36 * pOut.z), *(int *)(v11 + 532) != 220) ) | |
5020 { | |
5021 if ( (signed int)pParty->pPickedItem.uItemID < 221 | |
5022 || (signed int)pParty->pPickedItem.uItemID > 271 | |
5023 || (v12 = (LONG)((char *)v0 + 36 * pOut.z), a2.y = v12, v13 = *(int *)(v12 + 532), v51 = v13, v13 < 221) | |
5024 || v13 > 271 ) | |
5025 { | |
5026 if ( pParty->pPickedItem.uItemID != 236 | |
5027 && ((signed int)pParty->pPickedItem.uItemID < 246 || (signed int)pParty->pPickedItem.uItemID > 250) | |
5028 && pParty->pPickedItem.uItemID != 263 | |
5029 && pParty->pPickedItem.uItemID != 233 ) | |
5030 goto LABEL_116; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5031 v27 = &v0->pInventoryItemList[pOut.z]; |
0 | 5032 v28 = v27->uItemID; |
5033 v51 = pItemsTable->pItems[v27->uItemID].uEquipType; | |
570 | 5034 v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEnchantmentType); |
0 | 5035 if ( pParty->pPickedItem.uItemID != 233 ) |
5036 { | |
5037 if ( pParty->pPickedItem.uItemID == 236 ) | |
5038 { | |
5039 v35 = v27->uAttributes; | |
5040 if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 ) | |
1419 | 5041 { |
5042 pMouse->RemoveHoldingItem(); | |
5043 dword_50CDCC = 1; | |
5044 return; | |
5045 } | |
0 | 5046 LOWORD(v35) = v35 | 0x210; |
5047 v27->uAttributes = v35; | |
5048 } | |
5049 else | |
5050 { | |
5051 if ( (signed int)pParty->pPickedItem.uItemID <= 245 ) | |
1419 | 5052 { |
5053 pMouse->RemoveHoldingItem(); | |
5054 dword_50CDCC = 1; | |
5055 return; | |
5056 } | |
0 | 5057 if ( (signed int)pParty->pPickedItem.uItemID <= 250 ) |
5058 { | |
5059 v27->UpdateTempBonus(pParty->uTimePlayed); | |
5060 v33 = v27->uItemID; | |
5061 if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65 | |
5062 || (pOut.y = v27->uAttributes, pOut.y & 2) | |
377 | 5063 || v27->uSpecEnchantmentType |
570 | 5064 || v27->uEnchantmentType |
0 | 5065 || v51 && v51 != 1 && v51 != 2 |
5066 || (signed int)v33 >= 500 ) | |
1419 | 5067 { |
5068 pMouse->RemoveHoldingItem(); | |
5069 dword_50CDCC = 1; | |
5070 return; | |
5071 } | |
0 | 5072 v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4]; |
5073 a2.y = (int)v29 << 7; | |
5074 v31 = (double)(signed int)((int)v29 << 7); | |
377 | 5075 v27->uSpecEnchantmentType = v34; |
0 | 5076 } |
5077 else | |
5078 { | |
5079 if ( pParty->pPickedItem.uItemID != 263 | |
5080 || (v27->UpdateTempBonus(pParty->uTimePlayed), v30 = v27->uItemID, (signed int)v27->uItemID >= 64) | |
5081 && (signed int)v30 <= 65 | |
5082 || (pOut.y = v27->uAttributes, pOut.y & 2) | |
377 | 5083 || v27->uSpecEnchantmentType |
570 | 5084 || v27->uEnchantmentType |
0 | 5085 || v51 && v51 != 1 && v51 != 2 |
5086 || (signed int)v30 >= 500 ) | |
1419 | 5087 { |
5088 pMouse->RemoveHoldingItem(); | |
5089 dword_50CDCC = 1; | |
5090 return; | |
5091 } | |
0 | 5092 a2.y = (int)v29 << 7; |
377 | 5093 v27->uSpecEnchantmentType = 40; |
0 | 5094 v31 = (double)a2.y; |
5095 } | |
5096 v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335); | |
5097 LODWORD(v27->uExpireTime) = v32; | |
5098 LODWORD(v32) = pOut.y; | |
5099 LOBYTE(v32) = LOBYTE(pOut.y) | 0x18; | |
5100 HIDWORD(v27->uExpireTime) = HIDWORD(v32); | |
5101 v27->uAttributes = v32; | |
5102 } | |
984 | 5103 _50C9A8_item_enchantment_timer = 256; |
1419 | 5104 pMouse->RemoveHoldingItem(); |
5105 dword_50CDCC = 1; | |
5106 return; | |
0 | 5107 } |
570 | 5108 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; |
0 | 5109 if ( v36 < 0.0 ) |
5110 v36 = 0.0; | |
5111 if ( v51 != 12 ) | |
5112 { | |
5113 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
5114 return; | |
5115 } | |
5116 a2.y = v27->uMaxCharges; | |
5117 v37 = (signed __int64)((double)a2.y - v36 * (double)a2.y); | |
5118 v27->uMaxCharges = v37; | |
5119 v27->uNumCharges = (unsigned __int8)v37; | |
1419 | 5120 pMouse->RemoveHoldingItem(); |
5121 dword_50CDCC = 1; | |
5122 return; | |
0 | 5123 } |
5124 v14 = v13 - 222; | |
5125 v15 = pParty->pPickedItem.uItemID - 222; | |
5126 v47 = v14; | |
5127 y.y = 0; | |
5128 if ( pParty->pPickedItem.uItemID == 221 || v51 == 221 ) | |
5129 { | |
5130 v16 = 5; | |
5131 } | |
5132 else | |
5133 { | |
5134 v16 = *(short *)&pItemsTable->field_EDE0[2 * (v14 + 50 * v15) + 388]; | |
5135 v10 = pOut.z; | |
5136 } | |
5137 v51 = v16; | |
5138 if ( v45 ) | |
5139 { | |
5140 if ( v16 < 225 || v16 > 227 ) | |
5141 { | |
5142 if ( v16 < 228 || v16 > 239 ) | |
5143 { | |
5144 if ( v16 < 240 || v16 > 261 ) | |
5145 { | |
5146 if ( v16 >= 262 && pOut.y != 4 ) | |
5147 { | |
5148 LABEL_53: | |
5149 v51 = 4; | |
5150 goto LABEL_54; | |
5151 } | |
5152 } | |
5153 else | |
5154 { | |
5155 if ( pOut.y <= 2 ) | |
5156 { | |
5157 LABEL_38: | |
5158 v51 = 3; | |
5159 goto LABEL_54; | |
5160 } | |
5161 } | |
5162 } | |
5163 else | |
5164 { | |
5165 if ( pOut.y == 1 ) | |
5166 { | |
5167 LABEL_35: | |
5168 v51 = 2; | |
5169 goto LABEL_54; | |
5170 } | |
5171 } | |
5172 } | |
5173 } | |
5174 else | |
5175 { | |
5176 if ( v16 >= 225 && v16 <= 227 ) | |
5177 { | |
5178 v51 = 1; | |
5179 goto LABEL_54; | |
5180 } | |
5181 if ( v16 >= 228 && v16 <= 239 ) | |
5182 goto LABEL_35; | |
5183 if ( v16 >= 240 && v16 <= 261 ) | |
5184 goto LABEL_38; | |
5185 if ( v16 >= 262 ) | |
5186 goto LABEL_53; | |
5187 } | |
5188 LABEL_54: | |
5189 pOut.y = 0; | |
5190 pOut.x = v10 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5191 v17 = (int)v0->pInventoryMatrix; |
0 | 5192 while ( *(int *)v17 != pOut.x ) |
5193 { | |
5194 ++pOut.y; | |
5195 v17 += 4; | |
5196 if ( pOut.y >= 126 ) | |
5197 { | |
5198 v18 = y.y; | |
5199 goto LABEL_59; | |
5200 } | |
5201 } | |
5202 v18 = pOut.y; | |
5203 LABEL_59: | |
5204 if ( !v51 ) | |
5205 { | |
5206 LABEL_115: | |
5207 v10 = pOut.z; | |
5208 goto LABEL_116; | |
5209 } | |
5210 if ( v51 == 1 ) | |
5211 { | |
5212 v0->RemoveItemAtInventoryIndex(v18); | |
5213 v26 = rand(); | |
1036 | 5214 v0->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE); |
0 | 5215 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
437 | 5216 |
5217 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1033 | 5218 |
0 | 5219 v42 = (int *)&a2.y; |
5220 v41 = (int *)&y.y; | |
5221 v40 = (int *)&pOut; | |
5222 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
5223 } | |
5224 else | |
5225 { | |
5226 if ( v51 == 2 ) | |
5227 { | |
5228 v0->RemoveItemAtInventoryIndex(v18); | |
5229 v25 = rand(); | |
1036 | 5230 v0->ReceiveDamage(v25 % 71 + 30, DMGT_FIRE); |
0 | 5231 v23 = 1; |
5232 } | |
5233 else | |
5234 { | |
5235 if ( v51 == 3 ) | |
5236 { | |
5237 v0->RemoveItemAtInventoryIndex(v18); | |
5238 v24 = rand(); | |
1036 | 5239 v0->ReceiveDamage(v24 % 201 + 50, DMGT_FIRE); |
0 | 5240 v23 = 5; |
5241 } | |
5242 else | |
5243 { | |
5244 if ( v51 != 4 ) | |
5245 { | |
5246 if ( v51 != 5 ) | |
5247 { | |
1014 | 5248 v19 = v0->AddItem(-1, 0xDCu); |
0 | 5249 if ( v19 ) |
1019 | 5250 // *(int *)&v0->field_1F5[36 * v19 + 15] = 1; |
5251 v0->pOwnItems[v19-1].uAttributes=ITEM_IDENTIFIED; | |
0 | 5252 v20 = v47 + 50 * v15; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5253 v0->pInventoryItemList[pOut.z].uItemID = v51; |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5254 v0->pInventoryItemList[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5255 + v0->pInventoryItemList[pOut.z].uEnchantmentType) |
0 | 5256 / 2; |
222 | 5257 v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168 + 388 |
0 | 5258 LABEL_74: |
5259 v22 = (int)((char *)v0 + 36 * pOut.z); | |
222 | 5260 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) ) |
0 | 5261 *(int *)(v22 + 552) |= 1u; |
5262 if ( !dword_4E455C ) | |
1419 | 5263 { |
5264 pMouse->RemoveHoldingItem(); | |
5265 dword_50CDCC = 1; | |
5266 return; | |
5267 } | |
187 | 5268 v0->PlaySound(SPEECH_16, 0); |
1419 | 5269 dword_4E455C = 0; |
5270 pMouse->RemoveHoldingItem(); | |
5271 dword_50CDCC = 1; | |
5272 return; | |
0 | 5273 } |
5274 if ( v45 ) | |
5275 { | |
5276 if ( *(int *)(a2.y + 532) == 221 ) | |
5277 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; | |
5278 else | |
570 | 5279 *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType; |
1014 | 5280 v21 = v0->AddItem(-1, 0xDCu); |
0 | 5281 if ( v21 ) |
1019 | 5282 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1; |
5283 v0->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED; | |
0 | 5284 goto LABEL_74; |
5285 } | |
5286 goto LABEL_115; | |
5287 } | |
5288 v0->RemoveItemAtInventoryIndex(v18); | |
5289 v0->SetCondition(0x10u, 0); | |
5290 v23 = 0; | |
5291 } | |
5292 } | |
1012 | 5293 v0->ItemsEnchant(v23); |
0 | 5294 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
437 | 5295 |
5296 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1033 | 5297 |
0 | 5298 v42 = (int *)&a2.y; |
5299 v41 = (int *)&y.y; | |
5300 v40 = (int *)&pOut; | |
5301 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
5302 } | |
5303 *(_QWORD *)&v39.x = *(_QWORD *)&pParty->vPosition.x; | |
5304 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, v40, v41, v42); | |
5305 sub_42F7EB_DropItemAt(0x41Bu, pOut.x, y.y, a2.y, 0, 1, 0, 0, 0); | |
5306 if ( dword_4E455C ) | |
5307 { | |
5308 if ( v0->CanAct() ) | |
187 | 5309 v0->PlaySound(SPEECH_17, 0); |
0 | 5310 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u); |
5311 dword_4E455C = 0; | |
5312 } | |
5313 pMouse->RemoveHoldingItem(); | |
5314 dword_50CDCC = 1; | |
5315 return; | |
5316 } | |
5317 *(int *)(v11 + 536) = v9 + pItemsTable->pItems[pParty->pPickedItem.uItemID].uDamageDice; | |
5318 switch ( pParty->pPickedItem.uItemID ) | |
5319 { | |
5320 case 0xC8u: | |
5321 case 0xC9u: | |
5322 case 0xCAu: | |
5323 case 0xCBu: | |
5324 case 0xCCu: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5325 v0->pInventoryItemList[pOut.z].uItemID = 222; |
0 | 5326 break; |
5327 case 0xCDu: | |
5328 case 0xCEu: | |
5329 case 0xCFu: | |
5330 case 0xD0u: | |
5331 case 0xD1u: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5332 v0->pInventoryItemList[pOut.z].uItemID = 223; |
0 | 5333 break; |
5334 case 0xD2u: | |
5335 case 0xD3u: | |
5336 case 0xD4u: | |
5337 case 0xD5u: | |
5338 case 0xD6u: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5339 v0->pInventoryItemList[pOut.z].uItemID = 224; |
0 | 5340 break; |
5341 case 0xD7u: | |
5342 case 0xD8u: | |
5343 case 0xD9u: | |
5344 case 0xDAu: | |
5345 case 0xDBu: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5346 v0->pInventoryItemList[pOut.z].uItemID = 221; |
0 | 5347 break; |
5348 default: | |
5349 break; | |
5350 } | |
5351 pMouse->RemoveHoldingItem(); | |
5352 dword_50CDCC = 1; | |
5353 if ( dword_4E455C ) | |
5354 { | |
187 | 5355 v0->PlaySound(SPEECH_16, 0); |
0 | 5356 dword_4E455C = 0; |
5357 } | |
5358 } | |
5359 | |
5360 //----- (00417AD4) -------------------------------------------------------- | |
983 | 5361 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level) |
1393 | 5362 { |
5363 switch (uPlayerClass % 4) | |
269 | 5364 { |
1393 | 5365 case 0: |
269 | 5366 { |
1393 | 5367 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) |
5368 return ui_character_skillinfo_can_learn; | |
5369 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level && | |
5370 byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
5371 { | |
5372 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType] < skill_level) | |
5373 return ui_character_skillinfo_cant_learn; | |
5374 } | |
5375 return ui_character_skillinfo_can_learn_gm; | |
0 | 5376 } |
1393 | 5377 break; |
5378 | |
5379 case 1: | |
269 | 5380 { |
1393 | 5381 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) |
5382 return ui_character_skillinfo_can_learn; | |
5383 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level) | |
5384 { | |
5385 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
5386 return ui_character_skillinfo_cant_learn; | |
5387 } | |
5388 return ui_character_skillinfo_can_learn_gm; | |
0 | 5389 } |
1393 | 5390 break; |
5391 | |
5392 case 2: | |
5393 case 3: | |
5394 { | |
5395 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level) | |
5396 return ui_character_skillinfo_cant_learn; | |
5397 return ui_character_skillinfo_can_learn; | |
5398 } | |
5399 break; | |
0 | 5400 } |
1393 | 5401 assert(false); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5402 return 0; |
1296 | 5403 } |