Mercurial > mm7
annotate mm7_5.cpp @ 1422:6bbcb91b3b7d
m
author | Ritor1 |
---|---|
date | Tue, 30 Jul 2013 09:33:52 +0600 |
parents | d4f57df4c299 |
children | c9e3b93ec570 |
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) -------------------------------------------------------- | |
54 void __cdecl GameUI_MsgProc() | |
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 | |
115 unsigned int v59; // eax@445 | |
116 signed int v60; // ST64_4@459 | |
117 NPCData *pNPCData2; // eax@467 | |
118 unsigned __int64 v62; // kr00_8@467 | |
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 |
0 | 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 | |
235 char *thise; // [sp+14h] [bp-5E8h]@445 | |
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 | |
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 } |
893 ModalWindow(pNPCTopics[453].pText, 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 } | |
0 | 986 if ( !ptr_507BDC ) |
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 ) | |
1041 pTurnEngine->_40471C(); | |
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); |
0 | 1249 pParty->pPlayers[3].pConditions[2] = 0i64; |
1250 pParty->pPlayers[2].pConditions[2] = 0i64; | |
1251 pParty->pPlayers[1].pConditions[2] = 0i64; | |
1252 pParty->pPlayers[0].pConditions[2] = 0i64; | |
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(); |
1396 | 1260 _506F18_num_minutes_to_sleep = 0; |
0 | 1261 dword_506F14 = 0; |
978 | 1262 dword_507B94 = 1; |
4 | 1263 if ( pGUIWindow_Settings ) |
1264 { | |
151 | 1265 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1266 { |
1267 pMouse->SetCursorBitmap("MICON2"); | |
1268 } | |
1269 else | |
1270 { | |
1271 pGUIWindow_Settings->Release(); | |
1272 pGUIWindow_Settings = 0; | |
1273 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1274 GameUI_Footer_TimeLeft = 0; |
4 | 1275 unk_50C9A0 = 0; |
1276 back_to_game(); | |
1277 } | |
1278 } | |
978 | 1279 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1280 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1281 pGUIWindow_CurrentMenu->Release(); | |
336 | 1282 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1283 window_SpeakInHouse = 0; | |
4 | 1284 pGUIWindow_CurrentMenu = 0; |
1285 pEventTimer->Resume(); | |
151 | 1286 pCurrentScreen = SCREEN_GAME; |
978 | 1287 viewparams->bRedrawGameUI = 1; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1288 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1289 continue; |
151 | 1290 case SCREEN_E: |
987 | 1291 __debugbreak(); |
0 | 1292 pGUIWindow_CurrentMenu->Release(); |
151 | 1293 pCurrentScreen = SCREEN_HOUSE; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1294 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
4 | 1295 continue; |
151 | 1296 case SCREEN_HOUSE: |
0 | 1297 if ( uDialogueType ) |
1298 uDialogueType = 0; | |
978 | 1299 if ( uGameState == GAME_STATE_2 ) |
0 | 1300 { |
1301 while ( sub_4BD8B5() ) | |
1302 ; | |
1303 } | |
1304 else | |
1305 { | |
1306 if ( sub_4BD8B5() ) | |
4 | 1307 continue; |
0 | 1308 } |
1407 | 1309 GetHouseGoodbyeSpeech(); |
978 | 1310 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0); |
0 | 1311 pVideoPlayer->Unload(); |
336 | 1312 pGUIWindow_CurrentMenu = window_SpeakInHouse; |
4 | 1313 if ( pGUIWindow_Settings ) |
1314 { | |
151 | 1315 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1316 { |
1317 pMouse->SetCursorBitmap("MICON2"); | |
1318 } | |
1319 else | |
1320 { | |
1321 pGUIWindow_Settings->Release(); | |
1322 pGUIWindow_Settings = 0; | |
1323 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1324 GameUI_Footer_TimeLeft = 0; |
4 | 1325 unk_50C9A0 = 0; |
1326 back_to_game(); | |
1327 } | |
1328 } | |
978 | 1329 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1330 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1331 pGUIWindow_CurrentMenu->Release(); | |
336 | 1332 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1333 window_SpeakInHouse = 0; | |
4 | 1334 pGUIWindow_CurrentMenu = 0; |
1335 pEventTimer->Resume(); | |
151 | 1336 pCurrentScreen = SCREEN_GAME; |
1035 | 1337 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1338 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1339 continue; |
987 | 1340 case SCREEN_INPUT_BLV://click escape |
0 | 1341 if ( uCurrentHouse_Animation == 153 ) |
735 | 1342 PlayHouseSound(0x99u, HouseSound_Greeting_2); |
0 | 1343 pVideoPlayer->Unload(); |
4 | 1344 if ( dword_5B65CC ) |
1345 { | |
1346 pParty->field_709 = 0; | |
1347 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | |
1035 | 1348 pParty->CountHirelings(); |
1349 viewparams->bRedrawGameUI = true; | |
4 | 1350 dword_5B65CC = 0; |
1351 } | |
987 | 1352 DialogueEnding(); |
1353 pCurrentScreen = SCREEN_GAME; | |
1035 | 1354 viewparams->bRedrawGameUI = true; |
987 | 1355 continue; |
1356 case SCREEN_NPC_DIALOGUE://click escape | |
0 | 1357 if ( dword_5B65CC ) |
1358 { | |
1359 pParty->field_709 = 0; | |
1360 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; | |
1035 | 1361 pParty->CountHirelings(); |
1362 viewparams->bRedrawGameUI = true; | |
0 | 1363 dword_5B65CC = 0; |
1364 } | |
987 | 1365 //goto LABEL_317; |
1366 DialogueEnding(); | |
1367 pCurrentScreen = SCREEN_GAME; | |
1035 | 1368 viewparams->bRedrawGameUI = true; |
987 | 1369 continue; |
1370 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1371 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); |
0 | 1372 sub_4452BB(); |
987 | 1373 DialogueEnding(); |
1374 pCurrentScreen = SCREEN_GAME; | |
1035 | 1375 viewparams->bRedrawGameUI = true; |
987 | 1376 continue; |
1377 case SCREEN_CHANGE_LOCATION://click escape | |
0 | 1378 if ( pParty->vPosition.x < -22528 ) |
1379 pParty->vPosition.x = -22528; | |
1380 if ( pParty->vPosition.x > 22528 ) | |
1381 pParty->vPosition.x = 22528; | |
1382 if ( pParty->vPosition.y < -22528 ) | |
1383 pParty->vPosition.y = -22528; | |
1384 if ( pParty->vPosition.y > 22528 ) | |
1385 pParty->vPosition.y = 22528; | |
987 | 1386 DialogueEnding(); |
1387 pCurrentScreen = SCREEN_GAME; | |
1035 | 1388 viewparams->bRedrawGameUI = true; |
987 | 1389 continue; |
151 | 1390 case SCREEN_VIDEO: |
0 | 1391 pVideoPlayer->Unload(); |
4 | 1392 continue; |
151 | 1393 case SCREEN_CHARACTERS: |
992 | 1394 CharacterUI_ReleaseButtons(); |
990 | 1395 sub_419379(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1396 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
990 | 1397 if ( pGUIWindow_Settings ) |
1398 { | |
1399 if ( pCurrentScreen == SCREEN_CHARACTERS ) | |
1400 { | |
1401 pMouse->SetCursorBitmap("MICON2"); | |
1402 } | |
1403 else | |
1404 { | |
1405 pGUIWindow_Settings->Release(); | |
1406 pGUIWindow_Settings = 0; | |
1407 pMouse->SetCursorBitmap("MICON1"); | |
1408 GameUI_Footer_TimeLeft = 0; | |
1409 unk_50C9A0 = 0; | |
1410 back_to_game(); | |
1411 } | |
1412 } | |
1413 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) | |
1414 uActiveCharacter = pParty->GetNextActiveCharacter(); | |
1415 pGUIWindow_CurrentMenu->Release(); | |
1416 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) | |
1417 window_SpeakInHouse = 0; | |
1418 pGUIWindow_CurrentMenu = 0; | |
1419 pEventTimer->Resume(); | |
1420 pCurrentScreen = SCREEN_GAME; | |
1035 | 1421 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1422 pIcons_LOD->RemoveTexturesFromTextureList(); |
990 | 1423 continue; |
0 | 1424 default: |
4 | 1425 if ( pGUIWindow_Settings ) |
1426 { | |
151 | 1427 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1428 { |
1429 pMouse->SetCursorBitmap("MICON2"); | |
1430 } | |
1431 else | |
1432 { | |
1433 pGUIWindow_Settings->Release(); | |
1434 pGUIWindow_Settings = 0; | |
1435 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1436 GameUI_Footer_TimeLeft = 0; |
4 | 1437 unk_50C9A0 = 0; |
1438 back_to_game(); | |
1439 } | |
1440 } | |
978 | 1441 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1442 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1443 pGUIWindow_CurrentMenu->Release(); | |
336 | 1444 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1445 window_SpeakInHouse = 0; | |
4 | 1446 pGUIWindow_CurrentMenu = 0; |
1447 pEventTimer->Resume(); | |
151 | 1448 pCurrentScreen = SCREEN_GAME; |
978 | 1449 viewparams->bRedrawGameUI = 1; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1450 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1451 continue; |
0 | 1452 } |
4 | 1453 if ( pGUIWindow_Settings ) |
1454 { | |
151 | 1455 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
4 | 1456 { |
1457 pMouse->SetCursorBitmap("MICON2"); | |
1458 } | |
1459 else | |
1460 { | |
1461 pGUIWindow_Settings->Release(); | |
1462 pGUIWindow_Settings = 0; | |
1463 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1464 GameUI_Footer_TimeLeft = 0; |
4 | 1465 unk_50C9A0 = 0; |
1466 back_to_game(); | |
1467 } | |
1468 } | |
978 | 1469 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
4 | 1470 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1471 pGUIWindow_CurrentMenu->Release(); | |
336 | 1472 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1473 window_SpeakInHouse = 0; | |
4 | 1474 pGUIWindow_CurrentMenu = 0; |
1475 pEventTimer->Resume(); | |
151 | 1476 pCurrentScreen = SCREEN_GAME; |
1035 | 1477 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1478 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1479 continue; |
0 | 1480 } |
991 | 1481 CharacterUI_ReleaseButtons(); |
0 | 1482 sub_419379(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1483 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 1484 } |
1485 if ( pGUIWindow_Settings ) | |
1486 { | |
151 | 1487 if ( pCurrentScreen == SCREEN_CHARACTERS ) |
0 | 1488 { |
1489 pMouse->SetCursorBitmap("MICON2"); | |
1490 } | |
1491 else | |
1492 { | |
1493 pGUIWindow_Settings->Release(); | |
1494 pGUIWindow_Settings = 0; | |
1495 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1496 GameUI_Footer_TimeLeft = 0; |
0 | 1497 unk_50C9A0 = 0; |
1498 back_to_game(); | |
1499 } | |
1500 } | |
978 | 1501 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 ) |
0 | 1502 uActiveCharacter = pParty->GetNextActiveCharacter(); |
1503 pGUIWindow_CurrentMenu->Release(); | |
336 | 1504 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse ) |
1505 window_SpeakInHouse = 0; | |
0 | 1506 pGUIWindow_CurrentMenu = 0; |
1507 pEventTimer->Resume(); | |
151 | 1508 pCurrentScreen = SCREEN_GAME; |
1035 | 1509 viewparams->bRedrawGameUI = true; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1510 pIcons_LOD->RemoveTexturesFromTextureList(); |
4 | 1511 continue; |
0 | 1512 } |
1513 if ( !pGUIWindow_Settings )//Draw Menu | |
1514 { | |
1515 dword_6BE138 = -1; | |
1268 | 1516 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); |
0 | 1517 pEventTimer->Pause(); |
1518 pAudioPlayer->StopChannels(-1, -1); | |
1035 | 1519 pCurrentScreen = SCREEN_MENU; |
1520 | |
0 | 1521 ++pIcons_LOD->uTexturePacksCount; |
1522 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
1523 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
1035 | 1524 |
961 | 1525 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0); |
362 | 1526 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); |
1527 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
1528 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
1529 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
1530 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
1531 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
1532 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
978 | 1533 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, |
0 | 1534 pGlobalTXT_LocalizationStrings[614],// "New Game" |
710 | 1535 pIcons_LOD->GetTexture(uTextureID_New1), 0); |
978 | 1536 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, |
0 | 1537 pGlobalTXT_LocalizationStrings[615],// "Save Game" |
710 | 1538 pIcons_LOD->GetTexture(uTextureID_Save1), 0); |
978 | 1539 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, |
0 | 1540 pGlobalTXT_LocalizationStrings[616],// "Load Game" |
710 | 1541 pIcons_LOD->GetTexture(uTextureID_Load1), 0); |
978 | 1542 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, |
0 | 1543 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" |
710 | 1544 pIcons_LOD->GetTexture(uTextureID_Controls1), 0); |
978 | 1545 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, |
0 | 1546 pGlobalTXT_LocalizationStrings[618],// "Quit" |
710 | 1547 pIcons_LOD->GetTexture(uTextureID_Quit1), 0); |
978 | 1548 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, |
0 | 1549 pGlobalTXT_LocalizationStrings[619],// "Return to Game" |
710 | 1550 pIcons_LOD->GetTexture(uTextureID_Resume1), 0); |
978 | 1551 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0); |
1552 viewparams->field_48 = 1; | |
0 | 1553 stru_506E40.Release(); |
1554 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); | |
1555 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | |
1556 free((void *)uNumSeconds); | |
1557 stru_506E40._40E55E("gamma.pcx", 0); | |
4 | 1558 continue; |
0 | 1559 } |
1000 | 1560 pGUIWindow_Settings->Release(); |
11 | 1561 pGUIWindow_Settings = 0; |
1562 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1563 GameUI_Footer_TimeLeft = 0; |
11 | 1564 unk_50C9A0 = 0; |
1565 back_to_game(); | |
1566 continue; | |
0 | 1567 } |
1568 sub_41426F(); | |
1569 continue; | |
111 | 1570 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel |
0 | 1571 if ( uMessageParam ) |
1572 { | |
962 | 1573 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0); |
0 | 1574 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; |
1575 if ( (unsigned __int8)pParty->field_709 < v37 ) | |
1576 { | |
111 | 1577 ++pParty->field_709;//??? maybe number of the first cell??? |
0 | 1578 if ( (unsigned __int8)pParty->field_709 >= v37 ) |
1579 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; | |
1580 } | |
1581 } | |
1582 else | |
1583 { | |
962 | 1584 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0); |
0 | 1585 if ( pParty->field_709 ) |
1586 { | |
1587 --pParty->field_709; | |
1588 if ( pParty->field_709 < 1 ) | |
1589 pParty->field_709 = 0; | |
1590 } | |
1591 } | |
994 | 1592 GameUI_DrawHiredNPCs(); |
4 | 1593 continue; |
434 | 1594 case UIMSG_TransitionUI_Confirm: |
0 | 1595 if ( pMessageQueue_50CBD0->uNumMessages ) |
1596 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
978 | 1597 dword_50CDC8 = 1; |
0 | 1598 sub_42FBDD(); |
758 | 1599 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); |
0 | 1600 pVideoPlayer->Unload(); |
960 | 1601 DialogueEnding(); |
978 | 1602 viewparams->bRedrawGameUI = 1; |
0 | 1603 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
1604 { | |
1605 if ( dword_59117C_teleportx ) | |
1606 { | |
1607 pParty->vPosition.x = dword_59117C_teleportx; | |
1608 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx; | |
1609 } | |
1610 if ( dword_591178_teleporty ) | |
1611 { | |
1612 pParty->vPosition.y = dword_591178_teleporty; | |
1613 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty; | |
1614 } | |
1615 if ( dword_591174_teleportz ) | |
1616 { | |
1617 pParty->vPosition.z = dword_591174_teleportz; | |
1618 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz; | |
1619 pParty->uFallStartY = dword_591174_teleportz; | |
1620 } | |
1621 if ( dword_591170_teleport_directiony ) | |
1622 { | |
1623 pParty->sRotationY = dword_591170_teleport_directiony; | |
1624 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony; | |
1625 } | |
1626 if ( dword_59116C_teleport_directionx ) | |
1627 { | |
1628 pParty->sRotationX = dword_59116C_teleport_directionx; | |
1629 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx; | |
1630 v38 = dword_591168_teleport_speedz; | |
1631 pParty->uFallSpeed = dword_591168_teleport_speedz; | |
1632 dword_5B65BC = dword_591168_teleport_speedz; | |
1633 } | |
1634 else | |
1635 { | |
1636 v38 = dword_5B65BC; | |
1637 } | |
1638 if ( *dword_591164_teleport_map_name != 48 ) | |
1639 { | |
1640 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2; | |
1641 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; | |
1642 OnMapLeave(); | |
783 | 1643 sub_44987B(dword_591164_teleport_map_name, MapStartPoint_Party); |
0 | 1644 } |
1645 } | |
1646 else | |
1647 { | |
1052 | 1648 EventProcessor(dword_5C3418, 0, 1, dword_5C341C); |
1649 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1650 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") ) |
0 | 1651 pParty->uTimePlayed += 1474560i64; |
4 | 1652 continue; |
960 | 1653 case UIMSG_TransitionWindowCloseBtn: |
11 | 1654 CloseWindowBackground(); |
0 | 1655 pVideoPlayer->Unload(); |
960 | 1656 DialogueEnding(); |
1035 | 1657 viewparams->bRedrawGameUI = true; |
910 | 1658 continue; |
0 | 1659 case UIMSG_CycleCharacters: |
1660 v39 = GetAsyncKeyState(VK_SHIFT); | |
910 | 1661 uActiveCharacter = CycleCharacter(v39); |
1035 | 1662 viewparams->bRedrawGameUI = true; |
910 | 1663 continue; |
783 | 1664 case UIMSG_OnTravelByFoot: |
0 | 1665 if ( pMessageQueue_50CBD0->uNumMessages ) |
1666 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
978 | 1667 dword_50CDC8 = 1; |
0 | 1668 sub_42FBDD(); |
1669 pNPCData4 = (NPCData *)GetTravelTime(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1670 strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data()); |
0 | 1671 if ( bUnderwater != 1 && pParty->bFlying |
978 | 1672 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 ) |
1673 { | |
1674 viewparams->bRedrawGameUI = 1; | |
11 | 1675 CloseWindowBackground(); |
0 | 1676 if ( pParty->vPosition.x < -22528 ) |
1677 pParty->vPosition.x = -22528; | |
1678 if ( pParty->vPosition.x > 22528 ) | |
1679 pParty->vPosition.x = 22528; | |
1680 if ( pParty->vPosition.y < -22528 ) | |
1681 pParty->vPosition.y = -22528; | |
1682 if ( pParty->vPosition.y > 22528 ) | |
1683 pParty->vPosition.y = 22528; | |
960 | 1684 DialogueEnding(); |
151 | 1685 pCurrentScreen = SCREEN_GAME; |
0 | 1686 } |
1687 else | |
1688 { | |
1689 pParty->field_6E4 = 0; | |
1690 pParty->field_6E0 = 0; | |
1202 | 1691 pCastSpellInfo.data()->_427D48(1); |
960 | 1692 DialogueEnding(); |
0 | 1693 pEventTimer->Pause(); |
434 | 1694 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); |
0 | 1695 ++pGameLoadingUI_ProgressBar->uProgressMax; |
978 | 1696 SaveGame(1, 0); |
0 | 1697 pGameLoadingUI_ProgressBar->Progress(); |
1698 RestAndHeal(1440 * (signed int)pNPCData4); | |
1699 if ( pParty->uNumFoodRations ) | |
1700 { | |
1701 pParty->RestAndHeal(); | |
1702 if ( ((pParty->uNumFoodRations - (signed int)pNPCData4) & 0x80000000u) != 0 ) | |
1703 { | |
1704 pPlayer7 = pParty->pPlayers; | |
1705 do | |
1706 { | |
978 | 1707 pPlayer7->SetCondition(1, 0); |
0 | 1708 ++pPlayer7; |
1709 } | |
1710 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); | |
766 | 1711 ++pParty->days_played_without_rest; |
0 | 1712 } |
1713 Party::TakeFood((unsigned int)pNPCData4); | |
1714 } | |
1715 else | |
1716 { | |
1717 pPlayer8 = pParty->pPlayers; | |
1718 do | |
1719 { | |
978 | 1720 pPlayer8->SetCondition(1, 0); |
0 | 1721 ++pPlayer8; |
1722 } | |
1723 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings ); | |
766 | 1724 ++pParty->days_played_without_rest; |
0 | 1725 } |
1726 pPaletteManager->ResetNonLocked(); | |
1727 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1728 strcpy(pCurrentMapName.data(), pOut); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1729 strcpy(pLevelName, pCurrentMapName.data()); |
783 | 1730 v41 = strtok(pLevelName, "."); |
1731 strcpy(pLevelName, v41); | |
1732 Level_LoadEvtAndStr(pLevelName); | |
1733 pDecalBuilder->Reset(0); | |
0 | 1734 LoadLevel_InitializeLevelEvt(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1735 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName.data()); |
0 | 1736 bUnderwater = 0; |
1737 bNoNPCHiring = 0; | |
1738 pGame->uFlags2 &= 0xFFFFFFF7u; | |
1739 if ( Is_out15odm_underwater() ) | |
1740 { | |
1741 bUnderwater = 1; | |
1742 pGame->uFlags2 |= 8u; | |
1743 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1744 if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d47.blv") ) |
0 | 1745 bNoNPCHiring = 1; |
1746 PrepareToLoadODM(1u, (OutdoorCamera *)1); | |
1747 pAudioPlayer->SetMapEAX(); | |
1748 bDialogueUI_InitializeActor_NPC_ID = 0; | |
1749 OnMapLoad(); | |
1750 pOutdoor->SetFog(); | |
1751 TeleportToStartingPoint(uLevel_StartingPointType); | |
783 | 1752 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0); |
0 | 1753 pParty->uFallStartY = pParty->vPosition.z; |
1754 sub_461103(); | |
1755 pEventTimer->Resume(); | |
1756 viewparams->bRedrawGameUI = 1; | |
151 | 1757 pCurrentScreen = SCREEN_GAME; |
0 | 1758 pGameLoadingUI_ProgressBar->Release(); |
1759 } | |
978 | 1760 viewparams->bRedrawGameUI = 1; |
910 | 1761 continue; |
987 | 1762 case UIMSG_CHANGE_LOCATION_ClickCencelBtn: |
1763 CloseWindowBackground(); | |
1764 if ( pParty->vPosition.x < -22528 ) | |
1765 pParty->vPosition.x = -22528; | |
1766 if ( pParty->vPosition.x > 22528 ) | |
1767 pParty->vPosition.x = 22528; | |
1768 if ( pParty->vPosition.y < -22528 ) | |
1769 pParty->vPosition.y = -22528; | |
1770 if ( pParty->vPosition.y > 22528 ) | |
1771 pParty->vPosition.y = 22528; | |
1772 DialogueEnding(); | |
1773 pCurrentScreen = SCREEN_GAME; | |
1774 viewparams->bRedrawGameUI = 1; | |
1775 continue; | |
1326 | 1776 case UIMSG_CastSpell_Telekinesis: |
0 | 1777 if ( pRenderer->pRenderD3D ) |
1778 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1779 else | |
1780 { | |
1781 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); | |
1782 pPoint = pMouse->GetCursorPos(&v208); | |
1783 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; | |
1784 } | |
1785 v44 = (unsigned __int16)v42; | |
848 | 1786 v45 = PID_TYPE(v44); |
0 | 1787 uNumSeconds = v44; |
848 | 1788 v46 = PID_ID(v44); |
0 | 1789 if ( v45 == 3 ) |
1790 { | |
1791 v47 = pActors[v46].uAIState == Dead; | |
11 | 1792 if ( !v47 ) |
1793 continue; | |
1000 | 1794 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1795 LOBYTE(pSpellInfo->field_8) &= 0xBFu; | |
1796 pSpellInfo->uPlayerID_2 = uMessageParam; | |
1797 pSpellInfo->spell_target_pid = v44; | |
1798 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1799 pGUIWindow_Settings->Release(); | |
11 | 1800 pGUIWindow_Settings = 0; |
1801 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1802 GameUI_Footer_TimeLeft = 0; |
11 | 1803 unk_50C9A0 = 0; |
1804 back_to_game(); | |
1805 continue; | |
0 | 1806 } |
1807 if ( v45 == 2 ) | |
1808 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
1809 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; |
0 | 1810 if ( !v47 ) |
4 | 1811 continue; |
1000 | 1812 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1813 LOBYTE(pSpellInfo->field_8) &= 0xBFu; | |
1814 pSpellInfo->uPlayerID_2 = uMessageParam; | |
1815 pSpellInfo->spell_target_pid = v44; | |
1816 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1817 pGUIWindow_Settings->Release(); | |
11 | 1818 pGUIWindow_Settings = 0; |
1819 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1820 GameUI_Footer_TimeLeft = 0; |
11 | 1821 unk_50C9A0 = 0; |
1822 back_to_game(); | |
1823 continue; | |
0 | 1824 } |
1825 if ( v45 == 5 ) | |
1826 { | |
1827 v48 = pLevelDecorations[v46].field_16_event_id == 0; | |
1828 } | |
1829 else | |
1830 { | |
1831 if ( v45 != 6 ) | |
4 | 1832 continue; |
978 | 1833 if ( uCurrentlyLoadedLevelType != 1 ) |
0 | 1834 { |
1835 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | |
1836 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) | |
4 | 1837 continue; |
0 | 1838 v44 = uNumSeconds; |
1000 | 1839 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1840 LOBYTE(pSpellInfo->field_8) &= 0xBFu; | |
1841 pSpellInfo->uPlayerID_2 = uMessageParam; | |
1842 pSpellInfo->spell_target_pid = v44; | |
1843 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1844 pGUIWindow_Settings->Release(); | |
11 | 1845 pGUIWindow_Settings = 0; |
1846 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1847 GameUI_Footer_TimeLeft = 0; |
11 | 1848 unk_50C9A0 = 0; |
1849 back_to_game(); | |
1850 continue; | |
0 | 1851 } |
1852 pBLVFace = &pIndoor->pFaces[v46]; | |
1853 if ( !(BYTE3(pBLVFace->uAttributes) & 2) ) | |
4 | 1854 continue; |
0 | 1855 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; |
1856 } | |
1857 if ( v48 ) | |
4 | 1858 continue; |
1000 | 1859 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1860 LOBYTE(pSpellInfo->field_8) &= 0xBFu; | |
1861 pSpellInfo->uPlayerID_2 = uMessageParam; | |
1862 pSpellInfo->spell_target_pid = v44; | |
1863 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
1864 pGUIWindow_Settings->Release(); | |
0 | 1865 pGUIWindow_Settings = 0; |
1866 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1867 GameUI_Footer_TimeLeft = 0; |
0 | 1868 unk_50C9A0 = 0; |
1869 back_to_game(); | |
4 | 1870 continue; |
1000 | 1871 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade) |
1872 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure | |
1873 case UIMSG_HiredNPC_CastSpell: | |
0 | 1874 if ( pMessageQueue_50CBD0->uNumMessages ) |
1875 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1876 if ( unk_50C9A0 ) | |
1877 { | |
910 | 1878 uActiveCharacter = uMessageParam; |
978 | 1879 viewparams->bRedrawGameUI = 1; |
0 | 1880 } |
1881 else | |
1882 { | |
1883 if ( pGUIWindow_Settings ) | |
1884 { | |
1000 | 1885 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
0 | 1886 switch ( uMessage ) |
1887 { | |
1000 | 1888 case UIMSG_CastSpell_Character_Big_Improvement: |
1889 LOBYTE(pSpellInfo->field_8) &= 0xFDu; | |
0 | 1890 break; |
1000 | 1891 case UIMSG_CastSpell_Character_Small_Improvement: |
1892 HIBYTE(pSpellInfo->field_8) &= 0xFEu; | |
0 | 1893 break; |
1000 | 1894 case UIMSG_HiredNPC_CastSpell: |
1895 HIBYTE(pSpellInfo->field_8) &= 0xFDu; | |
0 | 1896 break; |
1897 } | |
1000 | 1898 pSpellInfo->uPlayerID_2 = uMessageParam; |
1899 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
0 | 1900 pGUIWindow_Settings->Release(); |
1901 pGUIWindow_Settings = 0; | |
1902 pEventTimer->Resume(); | |
1903 pMouse->SetCursorBitmap("MICON1"); | |
783 | 1904 GameUI_Footer_TimeLeft = 0; |
0 | 1905 unk_50C9A0 = 0; |
1906 } | |
1907 } | |
4 | 1908 continue; |
0 | 1909 case UIMSG_BF: |
987 | 1910 __debugbreak(); |
978 | 1911 dword_50CDC8 = 1; |
0 | 1912 sub_42FBDD(); |
978 | 1913 SaveGame(1, 0); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1914 strcpy(pCurrentMapName.data(), pMapStats->pInfos[uHouse_ExitPic].pFilename); |
978 | 1915 dword_6BE364_game_settings_1 |= 1; |
1916 uGameState = GAME_STATE_2; | |
11 | 1917 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
336 | 1918 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; |
4 | 1919 if ( v53 < 0 ) |
0 | 1920 { |
1921 v54 = abs(v53) - 1; | |
1922 _5B65B8_npcdata_hiword_house_or_other = 0; | |
1923 dword_5B65BC = 0; | |
1924 v55 = dword_4E4560[v54]; | |
1925 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54]; | |
1926 v56 = dword_4E4590[v54]; | |
1927 v57 = dword_4E45A8[v54]; | |
1928 _5B65A8_npcdata_uflags_or_other = v55; | |
1929 _5B65B4_npcdata_loword_house_or_other = v57; | |
1930 _5B65B0_npcdata_rep_or_other = v56; | |
1931 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57; | |
1932 } | |
1933 sub_4BD8B5(); | |
11 | 1934 //goto LABEL_434; |
437 | 1935 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
11 | 1936 { |
990 | 1937 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 1938 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
1939 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1940 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 1941 }*/ |
978 | 1942 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
11 | 1943 continue; |
710 | 1944 |
1945 case UIMSG_OnCastTownPortal: | |
0 | 1946 pAudioPlayer->StopChannels(-1, -1); |
1268 | 1947 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); |
710 | 1948 continue; |
1949 | |
961 | 1950 case UIMSG_OnCastLloydsBeacon: |
0 | 1951 pAudioPlayer->StopChannels(-1, -1); |
961 | 1952 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0); |
710 | 1953 continue; |
1954 | |
961 | 1955 case UIMSG_LloydsBeacon_FlippingBtn: |
0 | 1956 bRecallingBeacon = uMessageParam; |
1957 v127 = uMessageParam + 204; | |
916 | 1958 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
1959 continue; | |
961 | 1960 case UIMSG_HintBeaconSlot: |
0 | 1961 if ( !pGUIWindow_CurrentMenu ) |
4 | 1962 continue; |
0 | 1963 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; |
1964 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; | |
1965 if ( bRecallingBeacon ) | |
1966 { | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
1967 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) ) |
4 | 1968 continue; |
0 | 1969 v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1970 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
|
1971 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 1972 continue; |
0 | 1973 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1974 v59 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
0 | 1975 thise = "Not in Map Stats"; |
1976 if ( v59 ) | |
1977 thise = pMapStats->pInfos[v59].pName; | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
1978 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) || !v59 ) |
0 | 1979 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1980 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1981 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 1982 continue; |
0 | 1983 } |
1984 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; | |
1985 v158 = (unsigned int)thise; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1986 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1987 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 1988 continue; |
961 | 1989 case UIMSG_CloseAfterInstallBeacon: |
978 | 1990 dword_50CDC8 = 1; |
437 | 1991 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1992 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
11 | 1993 continue; |
990 | 1994 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 1995 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
1996 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 1997 ++pMessageQueue_50CBD0->uNumMessages;*/ |
11 | 1998 continue; |
961 | 1999 case UIMSG_InstallBeacon: |
0 | 2000 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; |
2001 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; | |
2002 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) | |
4 | 2003 continue; |
0 | 2004 byte_506360 = 1; |
2005 pPlayer9->CanCastSpell(uRequiredMana); | |
2006 if ( pParty->bTurnBasedModeOn ) | |
2007 { | |
2008 v60 = sRecoveryTime; | |
2009 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; | |
2010 pPlayer9->SetRecoveryTime(v60); | |
2011 pTurnEngine->_40471C(); | |
2012 } | |
2013 else | |
2014 { | |
2015 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | |
2016 } | |
2017 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); | |
2018 if ( bRecallingBeacon ) | |
2019 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2020 if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) ) |
0 | 2021 { |
978 | 2022 SaveGame(1, 0); |
0 | 2023 OnMapLeave(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2024 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]); |
978 | 2025 dword_6BE364_game_settings_1 |= 1; |
2026 uGameState = GAME_STATE_2; | |
0 | 2027 _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags; |
2028 _5B65AC_npcdata_fame_or_other = pNPCData4->fame; | |
2029 _5B65B0_npcdata_rep_or_other = pNPCData4->rep; | |
291 | 2030 _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D); |
2031 _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D); | |
978 | 2032 dword_5B65C0 = 1; |
0 | 2033 } |
2034 else | |
2035 { | |
2036 pParty->vPosition.x = pNPCData4->uFlags; | |
2037 pParty->vPosition.y = pNPCData4->fame; | |
2038 pParty->vPosition.z = pNPCData4->rep; | |
2039 pParty->uFallStartY = pParty->vPosition.z; | |
291 | 2040 pParty->sRotationY = LOWORD(pNPCData4->Location2D); |
2041 pParty->sRotationX = HIWORD(pNPCData4->Location2D); | |
0 | 2042 } |
978 | 2043 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
437 | 2044 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 2045 { |
305 | 2046 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 2047 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
2048 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2049 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2050 }*/ |
0 | 2051 //crt_deconstruct_ptr_6A0118(); |
2052 pBooksWindow->Release(); | |
2053 pGUIWindow_CurrentMenu->Release(); | |
2054 pBooksWindow = 0; | |
2055 pGUIWindow_CurrentMenu = 0; | |
2056 } | |
2057 else | |
2058 { | |
2059 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1); | |
2060 SaveScreenshot(a1); | |
2061 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); | |
2062 v212 = qword_506350 << 7; | |
2063 pNPCData2 = pNPCData4; | |
2064 thisg = 0; | |
2065 v62 = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); | |
2066 pNPCData4->pName = (char *)v62; | |
2067 pNPCData2->uPortraitID = HIDWORD(v62); | |
2068 pNPCData2->uFlags = pParty->vPosition.x; | |
2069 pNPCData2->fame = pParty->vPosition.y; | |
2070 pNPCData2->rep = pParty->vPosition.z; | |
291 | 2071 LOWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationY); |
2072 HIWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationX); | |
837 | 2073 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 ) |
4 | 2074 continue; |
0 | 2075 uAction = 0; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2076 while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName.data()) ) |
0 | 2077 { |
2078 ++thisg; | |
2079 uAction += 32; | |
837 | 2080 if ( thisg >= (signed int)pGames_LOD->uNumSubDirs / 2 ) |
4 | 2081 continue; |
0 | 2082 } |
2083 HIWORD(pNPCData4->uProfession) = thisg; | |
2084 } | |
4 | 2085 continue; |
961 | 2086 case UIMSG_ClickTownInTP: |
0 | 2087 if ( uMessageParam ) |
2088 { | |
2089 switch ( uMessageParam ) | |
2090 { | |
2091 case 1: | |
2092 v63 = 208; | |
2093 break; | |
2094 case 2: | |
2095 v63 = 207; | |
2096 break; | |
2097 case 3: | |
2098 v63 = 211; | |
2099 break; | |
2100 case 4: | |
2101 v63 = 209; | |
2102 break; | |
2103 default: | |
2104 if ( uMessageParam != 5 ) | |
2105 { | |
2106 LABEL_486: | |
978 | 2107 SaveGame(1, 0); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2108 v64 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
0 | 2109 v65 = uMessageParam; |
839 | 2110 if ( v64 == TownPortalList[uMessageParam].uMapInfoID ) |
0 | 2111 { |
839 | 2112 pParty->vPosition.x = TownPortalList[v65].pos.x; |
2113 pParty->vPosition.y = TownPortalList[v65].pos.y; | |
2114 pParty->vPosition.z = TownPortalList[v65].pos.z; | |
0 | 2115 pParty->uFallStartY = pParty->vPosition.z; |
839 | 2116 pParty->sRotationY = TownPortalList[v65].rot_y; |
2117 pParty->sRotationX = TownPortalList[v65].rot_x; | |
0 | 2118 } |
2119 else | |
2120 { | |
978 | 2121 SaveGame(1, 0); |
0 | 2122 OnMapLeave(); |
978 | 2123 dword_6BE364_game_settings_1 |= 1; |
2124 uGameState = GAME_STATE_2; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2125 strcpy(pCurrentMapName.data(), pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
978 | 2126 dword_5B65C0 = 1; |
839 | 2127 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; |
2128 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | |
2129 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z; | |
2130 v66 = TownPortalList[uMessageParam].rot_x; | |
2131 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y; | |
0 | 2132 _5B65B8_npcdata_hiword_house_or_other = v66; |
2133 InitializeActors(); | |
2134 } | |
1268 | 2135 v67 = (char*)pGUIWindow_CurrentMenu->Hint; |
0 | 2136 if ( v67 ) |
978 | 2137 *((int *)v67 + 17) = 1; |
0 | 2138 else |
710 | 2139 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u); |
437 | 2140 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 2141 { |
990 | 2142 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 2143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0; |
2144 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2145 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2146 }*/ |
978 | 2147 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); |
4 | 2148 continue; |
0 | 2149 } |
2150 v63 = 210; | |
2151 break; | |
2152 } | |
2153 } | |
2154 else | |
2155 { | |
2156 v63 = 206; | |
2157 } | |
484 | 2158 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) |
0 | 2159 return; |
2160 goto LABEL_486; | |
961 | 2161 case UIMSG_HintTownPortal: |
0 | 2162 if ( uMessageParam ) |
2163 { | |
2164 switch ( uMessageParam ) | |
2165 { | |
2166 case 1: | |
2167 v68 = 208; | |
2168 break; | |
2169 case 2: | |
2170 v68 = 207; | |
2171 break; | |
2172 case 3: | |
2173 v68 = 211; | |
2174 break; | |
2175 case 4: | |
2176 v68 = 209; | |
2177 break; | |
2178 default: | |
2179 if ( uMessageParam != 5 ) | |
11 | 2180 //goto LABEL_506; |
2181 { | |
2182 if ( uMessageParam ) | |
2183 { | |
2184 switch ( uMessageParam ) | |
2185 { | |
2186 case 1: | |
2187 v69 = pMapStats->pInfos[4].pName; | |
2188 break; | |
2189 case 2: | |
2190 v69 = pMapStats->pInfos[3].pName; | |
2191 break; | |
2192 case 3: | |
2193 v69 = pMapStats->pInfos[10].pName; | |
2194 break; | |
2195 case 4: | |
2196 v69 = pMapStats->pInfos[7].pName; | |
2197 break; | |
2198 default: | |
2199 if ( uMessageParam != 5 ) | |
2200 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2201 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2202 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2203 continue; |
11 | 2204 } |
2205 v69 = pMapStats->pInfos[8].pName; | |
2206 break; | |
2207 } | |
2208 } | |
2209 else | |
2210 { | |
2211 v69 = pMapStats->pInfos[21].pName; | |
2212 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2213 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2214 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2215 continue; |
11 | 2216 } |
2217 v68 = 210; | |
2218 break; | |
0 | 2219 } |
2220 } | |
2221 else | |
2222 { | |
2223 v68 = 206; | |
2224 } | |
484 | 2225 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) ) |
0 | 2226 { |
2227 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
4 | 2228 continue; |
0 | 2229 } |
11 | 2230 //LABEL_506: |
0 | 2231 if ( uMessageParam ) |
2232 { | |
2233 switch ( uMessageParam ) | |
2234 { | |
2235 case 1: | |
2236 v69 = pMapStats->pInfos[4].pName; | |
2237 break; | |
2238 case 2: | |
2239 v69 = pMapStats->pInfos[3].pName; | |
2240 break; | |
2241 case 3: | |
2242 v69 = pMapStats->pInfos[10].pName; | |
2243 break; | |
2244 case 4: | |
2245 v69 = pMapStats->pInfos[7].pName; | |
2246 break; | |
2247 default: | |
2248 if ( uMessageParam != 5 ) | |
2249 //goto LABEL_519; | |
4 | 2250 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2251 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2252 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2253 continue; |
4 | 2254 } |
0 | 2255 v69 = pMapStats->pInfos[8].pName; |
2256 break; | |
2257 } | |
2258 } | |
2259 else | |
2260 { | |
2261 v69 = pMapStats->pInfos[21].pName; | |
2262 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2263 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2264 GameUI_SetFooterString(pTmpBuf.data()); |
916 | 2265 continue; |
0 | 2266 case UIMSG_ShowFinalWindow: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2267 sprintf(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." |
0 | 2268 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." |
2269 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2270 ModalWindow(pFinalMessage.data(), 196); |
0 | 2271 uGameState = GAME_STATE_FINAL_WINDOW; |
4 | 2272 continue; |
0 | 2273 case UIMSG_C4: |
987 | 2274 __debugbreak(); |
982 | 2275 uGameState = GAME_STATE_PLAYING; |
0 | 2276 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); |
151 | 2277 case UIMSG_DD: |
990 | 2278 __debugbreak(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2279 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer); |
703 | 2280 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); |
701 | 2281 if ( v216.uPropCount == 1 ) |
0 | 2282 { |
837 | 2283 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2); |
0 | 2284 v70 = atoi(v216.pProperties[0]); |
2285 if ( v70 <= 0 || v70 >= 77 ) | |
4 | 2286 continue; |
0 | 2287 v71 = v70; |
2288 strcpy(Str2, pMapStats->pInfos[v70].pFilename); | |
2289 pNPCData3 = 0; | |
2290 if ( (signed int)pNPCData4 > 0 ) | |
2291 { | |
2292 thish = 0; | |
2293 do | |
2294 { | |
1104 | 2295 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) |
0 | 2296 break; |
2297 ++thish; | |
2298 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); | |
2299 } | |
2300 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | |
2301 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | |
2302 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2303 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); |
0 | 2304 dword_6BE364_game_settings_1 |= 1u; |
978 | 2305 uGameState = GAME_STATE_2; |
0 | 2306 OnMapLeave(); |
4 | 2307 continue; |
0 | 2308 } |
2309 } | |
2310 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); | |
2311 v73 = Str2; | |
2312 } | |
2313 else | |
2314 { | |
701 | 2315 if ( v216.uPropCount != 3 ) |
11 | 2316 continue; |
0 | 2317 v74 = atoi(v216.pProperties[0]); |
2318 thisi = atoi(v216.pProperties[1]); | |
2319 v75 = atoi(v216.pProperties[2]); | |
2320 v76 = v75; | |
2321 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
2322 { | |
2323 if ( pIndoor->GetSector(v74, thisi, v75) ) | |
2324 { | |
2325 v77 = thisi; | |
2326 pParty->vPosition.x = v74; | |
2327 pParty->vPosition.y = v77; | |
2328 pParty->vPosition.z = v76; | |
2329 pParty->uFallStartY = v76; | |
11 | 2330 continue; |
0 | 2331 } |
2332 } | |
2333 else | |
2334 { | |
2335 if ( v74 > -32768 ) | |
2336 { | |
2337 if ( v74 < 32768 ) | |
2338 { | |
2339 v77 = thisi; | |
2340 if ( thisi > -32768 ) | |
2341 { | |
2342 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 ) | |
11 | 2343 { |
2344 pParty->vPosition.x = v74; | |
2345 pParty->vPosition.y = v77; | |
2346 pParty->vPosition.z = v76; | |
2347 pParty->uFallStartY = v76; | |
2348 continue; | |
2349 } | |
0 | 2350 } |
2351 } | |
2352 } | |
2353 } | |
2354 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
2355 v73 = "Can't jump to that location!"; | |
2356 } | |
2357 ShowStatusBarString(v73, 6u); | |
4 | 2358 continue; |
961 | 2359 case UIMSG_CastQuickSpell: |
0 | 2360 if ( bUnderwater == 1 ) |
362 | 2361 { |
2362 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" | |
2363 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
2364 continue; | |
2365 } | |
0 | 2366 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) |
11 | 2367 continue; |
362 | 2368 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); |
11 | 2369 continue; |
1000 | 2370 case UIMSG_CastSpell_Monster_Improvement: |
2371 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, | |
0 | 2372 if ( pRenderer->pRenderD3D ) |
2373 { | |
2374 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
2375 } | |
2376 else | |
2377 { | |
2378 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); | |
2379 pPoint2 = pMouse->GetCursorPos(&v201); | |
2380 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; | |
2381 } | |
2382 v83 = v81; | |
2383 v44 = (unsigned __int16)v81; | |
2384 v84 = v83 >> 16; | |
848 | 2385 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
4 | 2386 continue; |
1000 | 2387 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
2388 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) | |
2389 { | |
2390 LOBYTE(pSpellInfo->field_8) &= 0xF7; | |
0 | 2391 } |
2392 else | |
2393 { | |
1000 | 2394 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) |
2395 HIBYTE(pSpellInfo->field_8) &= 0xFEu; | |
0 | 2396 else |
1000 | 2397 HIBYTE(pSpellInfo->field_8) &= 0xFDu; |
2398 } | |
2399 pSpellInfo->uPlayerID_2 = uMessageParam; | |
2400 pSpellInfo->spell_target_pid = v44; | |
2401 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); | |
2402 pGUIWindow_Settings->Release(); | |
11 | 2403 pGUIWindow_Settings = 0; |
2404 pMouse->SetCursorBitmap("MICON1"); | |
783 | 2405 GameUI_Footer_TimeLeft = 0; |
11 | 2406 unk_50C9A0 = 0; |
2407 back_to_game(); | |
2408 continue; | |
151 | 2409 case UIMSG_1C: |
987 | 2410 __debugbreak(); |
0 | 2411 if ( !uActiveCharacter || pCurrentScreen ) |
4 | 2412 continue; |
710 | 2413 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0); |
151 | 2414 pCurrentScreen = SCREEN_19; |
0 | 2415 pEventTimer->Pause(); |
4 | 2416 continue; |
151 | 2417 case UIMSG_1B: |
987 | 2418 __debugbreak(); |
0 | 2419 if ( !uActiveCharacter ) |
4 | 2420 continue; |
978 | 2421 if ( pParty->bTurnBasedModeOn != 1 ) |
11 | 2422 { |
2423 if ( pActors[uMessageParam].uAIState == 5 ) | |
2424 stru_50C198.LootActor(&pActors[uMessageParam]); | |
2425 else | |
2426 Actor::StealFrom(uMessageParam); | |
2427 continue; | |
2428 } | |
1340 | 2429 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) |
4 | 2430 continue; |
1332 | 2431 if ( !(pTurnEngine->field_18 & TE_FLAG_2) ) |
0 | 2432 { |
2433 if ( pActors[uMessageParam].uAIState == 5 ) | |
2434 stru_50C198.LootActor(&pActors[uMessageParam]); | |
2435 else | |
2436 Actor::StealFrom(uMessageParam); | |
2437 } | |
4 | 2438 continue; |
271 | 2439 |
2440 case UIMSG_Attack: | |
0 | 2441 if ( !uActiveCharacter ) |
4 | 2442 continue; |
978 | 2443 if ( pParty->bTurnBasedModeOn != 1 ) |
11 | 2444 { |
2445 _42ECB5_PlayerAttacksActor(); | |
2446 continue; | |
2447 } | |
1340 | 2448 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3 ) |
4 | 2449 continue; |
1332 | 2450 if ( !(pTurnEngine->field_18 & TE_FLAG_2) ) |
0 | 2451 _42ECB5_PlayerAttacksActor(); |
4 | 2452 continue; |
151 | 2453 case UIMSG_ExitRest: |
1268 | 2454 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" |
11 | 2455 continue; |
151 | 2456 case UIMSG_Wait5Minutes: |
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_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2464 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" |
978 | 2465 dword_506F14 = 1; |
1396 | 2466 _506F18_num_minutes_to_sleep = 5; |
4 | 2467 continue; |
151 | 2468 case UIMSG_Wait1Hour: |
0 | 2469 if ( dword_506F14 == 2 ) |
916 | 2470 { |
2471 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
362 | 2472 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2473 continue; | |
11 | 2474 } |
962 | 2475 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2476 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" |
978 | 2477 dword_506F14 = 1; |
1396 | 2478 _506F18_num_minutes_to_sleep = 60; |
4 | 2479 continue; |
907 | 2480 case UIMSG_RentRoom: |
0 | 2481 dword_506F14 = 2; |
1033 | 2482 RestUI_Load(); |
758 | 2483 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute; |
1396 | 2484 _506F18_num_minutes_to_sleep = v86; |
2485 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 ) // 107 = Emerald Isle tavern | |
2486 _506F18_num_minutes_to_sleep = v86 + 12 * 60; | |
11 | 2487 dword_506F14 = 2; |
2488 pParty->RestAndHeal(); | |
766 | 2489 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
|
2490 pParty->pPlayers[3].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2491 pParty->pPlayers[2].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2492 pParty->pPlayers[1].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2493 pParty->pPlayers[0].SetAsleep(1); |
11 | 2494 continue; |
907 | 2495 case UIMSG_RestWindow: |
0 | 2496 if ( pMessageQueue_50CBD0->uNumMessages ) |
2497 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2498 if ( pCurrentScreen ) | |
4 | 2499 continue; |
0 | 2500 if ( sub_42F4DA() ) |
11 | 2501 { |
978 | 2502 if ( pParty->bTurnBasedModeOn == 1 ) |
11 | 2503 { |
916 | 2504 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" |
11 | 2505 continue; |
2506 } | |
2507 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
2508 if ( pParty->uFlags & 0x88 ) | |
2509 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
916 | 2510 ShowStatusBarString(v88, 2); |
11 | 2511 if ( !uActiveCharacter ) |
2512 continue; | |
916 | 2513 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2514 continue; | |
11 | 2515 } |
978 | 2516 if ( pParty->bTurnBasedModeOn == 1 ) |
916 | 2517 { |
2518 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" | |
11 | 2519 continue; |
2520 } | |
0 | 2521 if ( !(pParty->uFlags & 0x88) ) |
2522 { | |
1033 | 2523 RestUI_Load(); |
4 | 2524 continue; |
0 | 2525 } |
978 | 2526 if ( pParty->bTurnBasedModeOn == 1 ) |
0 | 2527 { |
916 | 2528 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!" |
11 | 2529 continue; |
0 | 2530 } |
2531 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!" | |
2532 if ( pParty->uFlags & 0x88 ) | |
2533 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!" | |
2534 ShowStatusBarString(v88, 2u); | |
2535 if ( !uActiveCharacter ) | |
4 | 2536 continue; |
916 | 2537 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0); |
2538 continue; | |
907 | 2539 case UIMSG_Rest8Hour: |
0 | 2540 if ( dword_506F14 ) |
916 | 2541 { |
2542 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | |
362 | 2543 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2544 continue; | |
11 | 2545 } |
0 | 2546 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest ) |
2547 { | |
2548 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest" | |
2549 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() ) | |
916 | 2550 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0); |
0 | 2551 } |
2552 else | |
2553 { | |
2554 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed; | |
2555 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed; | |
2556 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed; | |
2557 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2558 v90 = pMapStats->GetMapInfo(pCurrentMapName.data()); |
0 | 2559 if ( !v90 ) |
2560 v90 = rand() % (signed int)pMapStats->uNumMaps + 1; | |
2561 pMapInfo = &pMapStats->pInfos[v90]; | |
237 | 2562 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent ) |
0 | 2563 { |
2564 v91 = rand() % 100; | |
237 | 2565 v92 = pMapInfo->EncM1percent; |
0 | 2566 v93 = v91 + 1; |
2567 if ( v93 > v92 ) | |
237 | 2568 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2); |
0 | 2569 else |
978 | 2570 pNPCData4 = (NPCData *)1; |
0 | 2571 if ( !sub_45063B(pMapInfo, (int)pNPCData4) ) |
2572 pNPCData4 = 0; | |
2573 if ( pNPCData4 ) | |
2574 { | |
2575 pPlayerNum = rand() % 4; | |
2576 LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; | |
2577 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; | |
2578 v95 = rand(); | |
2579 Rest(v95 % 6 + 60); | |
1396 | 2580 _506F18_num_minutes_to_sleep = 0; |
0 | 2581 dword_506F14 = 0; |
437 | 2582 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 2583 { |
990 | 2584 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 2585 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
2586 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2587 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2588 }*/ |
2589 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
916 | 2590 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!" |
2591 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0); | |
2592 continue; | |
0 | 2593 } |
2594 } | |
2595 Party::TakeFood(uRestUI_FoodRequiredToRest); | |
1396 | 2596 _506F18_num_minutes_to_sleep = 480; |
0 | 2597 dword_506F14 = 2; |
2598 pParty->RestAndHeal(); | |
766 | 2599 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
|
2600 pParty->pPlayers[3].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2601 pParty->pPlayers[2].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2602 pParty->pPlayers[1].SetAsleep(1); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1358
diff
changeset
|
2603 pParty->pPlayers[0].SetAsleep(1); |
0 | 2604 } |
4 | 2605 continue; |
151 | 2606 case UIMSG_AlreadyResting: |
0 | 2607 if ( dword_506F14 == 2 ) |
2608 { | |
916 | 2609 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" |
362 | 2610 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
2611 continue; | |
0 | 2612 } |
962 | 2613 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, |
1268 | 2614 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" |
758 | 2615 v97 = _494820_training_time(pParty->uCurrentHour); |
978 | 2616 dword_506F14 = 1; |
1396 | 2617 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute; |
4 | 2618 continue; |
960 | 2619 case UIMSG_HintSelectRemoveQuickSpellBtn: |
688 | 2620 if ( quick_spell_at_page && byte_506550 ) |
2621 { | |
2622 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
|
2623 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173); |
0 | 2624 } |
2625 else | |
2626 { | |
2627 if ( pPlayers[uActiveCharacter]->uQuickSpell ) | |
2628 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell" | |
2629 else | |
2630 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
|
2631 strcpy(pTmpBuf.data(), v177); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2632 } |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2633 GameUI_SetFooterString(pTmpBuf.data()); |
4 | 2634 continue; |
370 | 2635 case UIMSG_SPellbook_ShowHightlightedSpellInfo: |
4 | 2636 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter], |
0 | 2637 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) ) |
4 | 2638 continue; |
0 | 2639 if ( sub_4637E0_is_there_popup_onscreen() ) |
2640 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1; | |
2641 v98 = *(char *)(uNumSeconds + 6734); | |
688 | 2642 if ( quick_spell_at_page - 1 == uMessageParam ) |
0 | 2643 { |
2644 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
2645 v161 = pGlobalTXT_LocalizationStrings[485]; | |
2646 } | |
2647 else | |
2648 { | |
2649 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName; | |
2650 v161 = pGlobalTXT_LocalizationStrings[486]; | |
2651 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2652 sprintfex(pTmpBuf.data(), v161, v178); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2653 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 2654 continue; |
960 | 2655 case UIMSG_ClickInstallRemoveQuickSpellBtn: |
962 | 2656 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0); |
0 | 2657 if ( !uActiveCharacter ) |
4 | 2658 continue; |
0 | 2659 pPlayer10 = pPlayers[uActiveCharacter]; |
688 | 2660 if ( !byte_506550 || !quick_spell_at_page ) |
0 | 2661 { |
2662 pPlayer10->uQuickSpell = 0; | |
688 | 2663 quick_spell_at_page = 0; |
916 | 2664 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0); |
2665 continue; | |
0 | 2666 } |
688 | 2667 v99 = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
0 | 2668 pPlayers[uActiveCharacter]->uQuickSpell = v99; |
1397 | 2669 stru_AA1058[uActiveCharacter - 1]._494836(v99, uActiveCharacter); |
0 | 2670 if ( uActiveCharacter ) |
187 | 2671 pPlayer10->PlaySound(SPEECH_12, 0); |
0 | 2672 byte_506550 = 0; |
4 | 2673 continue; |
1118 | 2674 case UIMSG_SpellBook_PressTab: |
2675 //__debugbreak(); | |
0 | 2676 if ( !uActiveCharacter ) |
4 | 2677 continue; |
0 | 2678 pPlayer3 = pPlayers[uActiveCharacter]; |
2679 pNPCData4 = 0; | |
2680 uAction = 0; | |
2681 v101 = 0; | |
2682 thisl = (int)&pPlayer3->pActiveSkills[12]; | |
2683 do | |
2684 { | |
2685 if ( *(short *)thisl ) | |
2686 { | |
198 | 2687 if ( pPlayer3->lastOpenedSpellbookPage == v101 ) |
0 | 2688 uAction = (int)pNPCData4; |
2689 v102 = (int)pNPCData4; | |
2690 pNPCData4 = (NPCData *)((char *)pNPCData4 + 1); | |
2691 v217[v102] = v101; | |
2692 } | |
2693 thisl += 2; | |
2694 ++v101; | |
2695 } | |
2696 while ( v101 < 9 ); | |
2697 if ( !pNPCData4 ) | |
11 | 2698 { |
2699 v127 = rand() % 2 + 204; | |
916 | 2700 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2701 continue; | |
11 | 2702 } |
0 | 2703 if ( GetAsyncKeyState(16) ) |
2704 { | |
2705 --uAction; | |
2706 if ( uAction < 0 ) | |
2707 uAction = (int)((char *)pNPCData4 - 1); | |
2708 } | |
2709 else | |
2710 { | |
2711 ++uAction; | |
2712 if ( uAction >= (signed int)pNPCData4 ) | |
2713 uAction = 0; | |
2714 } | |
1402 | 2715 OnCloseSpellBookPage(); |
198 | 2716 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); |
11 | 2717 pGUIWindow_CurrentMenu->OpenSpellBook(); |
2718 v127 = rand() % 2 + 204; | |
916 | 2719 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2720 continue; | |
832 | 2721 case UIMSG_OpenSpellbookPage: |
1340 | 2722 if ( pTurnEngine->turn_stage == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) |
4 | 2723 continue; |
1402 | 2724 OnCloseSpellBookPage(); |
198 | 2725 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; |
11 | 2726 pGUIWindow_CurrentMenu->OpenSpellBook(); |
0 | 2727 v127 = rand() % 2 + 204; |
916 | 2728 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
2729 continue; | |
437 | 2730 case UIMSG_SelectSpell: |
2731 { | |
1340 | 2732 if (pTurnEngine->turn_stage == 3) |
437 | 2733 continue; |
2734 if (!uActiveCharacter) | |
2735 continue; | |
2736 | |
2737 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter]; | |
2738 auto player = pPlayers[uActiveCharacter]; | |
2739 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam]) | |
2740 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) ) | |
2741 { | |
688 | 2742 if ( quick_spell_at_page - 1 == uMessageParam ) |
0 | 2743 { |
2744 pGUIWindow_CurrentMenu->Release(); | |
2745 pEventTimer->Resume(); | |
978 | 2746 viewparams->bRedrawGameUI = 1; |
151 | 2747 pCurrentScreen = SCREEN_GAME; |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
2748 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
688 | 2749 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; |
1000 | 2750 /*if ( dword_50C9E8 < 40 ) |
0 | 2751 { |
437 | 2752 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; |
2753 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | |
2754 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | |
0 | 2755 ++dword_50C9E8; |
1000 | 2756 }*/ |
1012 | 2757 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); |
2758 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
0 | 2759 } |
2760 else | |
2761 { | |
2762 byte_506550 = 1; | |
688 | 2763 quick_spell_at_page = uMessageParam + 1; |
0 | 2764 } |
437 | 2765 } |
2766 } | |
2767 continue; | |
370 | 2768 |
2769 case UIMSG_CastSpellFromBook: | |
1340 | 2770 if ( pTurnEngine->turn_stage != 3 ) |
370 | 2771 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); |
2772 continue; | |
2773 | |
1019 | 2774 case UIMSG_SpellScrollUse: |
987 | 2775 __debugbreak(); |
1340 | 2776 if ( pTurnEngine->turn_stage != 3 ) |
978 | 2777 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); |
4 | 2778 continue; |
907 | 2779 case UIMSG_SpellBookWindow: |
1340 | 2780 if ( pTurnEngine->turn_stage == 3 ) |
4 | 2781 continue; |
0 | 2782 if ( bUnderwater == 1 ) |
2783 { | |
362 | 2784 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" |
916 | 2785 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
0 | 2786 } |
2787 else | |
2788 { | |
2789 if ( pMessageQueue_50CBD0->uNumMessages ) | |
2790 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2791 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) | |
2792 { | |
2793 if ( !pCurrentScreen ) | |
2794 { | |
962 | 2795 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
151 | 2796 pCurrentScreen = SCREEN_SPELL_BOOK; |
0 | 2797 pEventTimer->Pause(); |
710 | 2798 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); |
0 | 2799 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
978 | 2800 viewparams->field_48 = 1; |
4 | 2801 continue; |
0 | 2802 } |
151 | 2803 if ( pCurrentScreen != SCREEN_REST |
2804 && pCurrentScreen != SCREEN_CHARACTERS | |
2805 && (pCurrentScreen <= SCREEN_63 | |
2806 || pCurrentScreen > SCREEN_67) ) | |
11 | 2807 { |
2808 pGUIWindow_CurrentMenu->Release(); | |
962 | 2809 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0); |
151 | 2810 pCurrentScreen = SCREEN_SPELL_BOOK; |
11 | 2811 pEventTimer->Pause(); |
710 | 2812 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); |
11 | 2813 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); |
978 | 2814 viewparams->field_48 = 1; |
11 | 2815 continue; |
2816 } | |
2817 } | |
2818 } | |
2819 continue; | |
2820 case UIMSG_QuickReference: | |
0 | 2821 if ( pMessageQueue_50CBD0->uNumMessages ) |
2822 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
2823 if ( pCurrentScreen ) | |
2824 pGUIWindow_CurrentMenu->Release(); | |
2825 ++pIcons_LOD->uTexturePacksCount; | |
2826 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
2827 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
962 | 2828 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0); |
978 | 2829 viewparams->bRedrawGameUI = 1; |
0 | 2830 pEventTimer->Pause(); |
2831 pAudioPlayer->StopChannels(-1, -1); | |
151 | 2832 pCurrentScreen = SCREEN_QUICK_REFERENCE; |
710 | 2833 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); |
0 | 2834 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); |
978 | 2835 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, |
0 | 2836 pGlobalTXT_LocalizationStrings[79],// "Exit" |
973 | 2837 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179); |
4 | 2838 continue; |
358 | 2839 case UIMSG_GameMenuButton: |
0 | 2840 if ( pCurrentScreen ) |
2841 { | |
2842 pGUIWindow_CurrentMenu->Release(); | |
2843 pEventTimer->Resume(); | |
151 | 2844 pCurrentScreen = SCREEN_GAME; |
978 | 2845 viewparams->bRedrawGameUI = 1; |
0 | 2846 } |
2847 stru_506E40.Release(); | |
2848 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); | |
2849 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | |
2850 free((void *)uNumSeconds); | |
2851 stru_506E40._40E55E("gamma.pcx", 0); | |
962 | 2852 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0); |
11 | 2853 //LABEL_453: |
437 | 2854 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
4 | 2855 continue; |
990 | 2856 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
11 | 2857 //goto LABEL_770; |
2858 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
2859 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 2860 ++pMessageQueue_50CBD0->uNumMessages;*/ |
2861 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
11 | 2862 continue; |
1101
3e5d70cfe20e
Award order fix, changed UIMSG_C0 to UIMSG_ClickAwardScrollBar
Grumpy7
parents:
1091
diff
changeset
|
2863 case UIMSG_ClickAwardScrollBar: |
978 | 2864 dword_50651C = 1; |
0 | 2865 if ( pMouse->GetCursorPos(&v211)->y > 178 ) |
2866 dword_50651C = -1; | |
4 | 2867 continue; |
961 | 2868 case UIMSG_ClickAwardsUpBtn: |
962 | 2869 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0); |
990 | 2870 BtnUp_flag = 1; |
4 | 2871 continue; |
961 | 2872 case UIMSG_ClickAwardsDownBtn: |
962 | 2873 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0); |
990 | 2874 BtnDown_flag = 1; |
4 | 2875 continue; |
910 | 2876 case UIMSG_ChangeDetaliz: |
978 | 2877 bRingsShownInCharScreen ^= 1; |
910 | 2878 pCharacterScreen_DetalizBtn->Release(); |
697 | 2879 pCharacterScreen_DollBtn->Release(); |
0 | 2880 if ( bRingsShownInCharScreen ) |
2881 { | |
973 | 2882 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight; |
2883 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth; | |
0 | 2884 v123 = 445; |
2885 v121 = 470; | |
2886 } | |
2887 else | |
2888 { | |
2889 v128 = 30; | |
2890 v125 = 30; | |
2891 v123 = 300; | |
2892 v121 = 600; | |
2893 } | |
978 | 2894 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0, |
0 | 2895 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" |
2896 0); | |
1025 | 2897 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0); |
978 | 2898 viewparams->bRedrawGameUI = 1; |
910 | 2899 continue; |
2900 case UIMSG_ClickPaperdoll: | |
0 | 2901 OnPaperdollLeftClick(); |
4 | 2902 continue; |
960 | 2903 case UIMSG_ClickStatsBtn: |
0 | 2904 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; |
991 | 2905 CharacterUI_ReleaseButtons(); |
0 | 2906 sub_419379(); |
962 | 2907 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0); |
960 | 2908 continue; |
2909 case UIMSG_ClickSkillsBtn: | |
0 | 2910 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; |
991 | 2911 CharacterUI_ReleaseButtons(); |
0 | 2912 sub_419379(); |
991 | 2913 CharacterUI_SkillsTab_CreateButtons(); |
962 | 2914 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0); |
11 | 2915 continue; |
0 | 2916 case UIMSG_SkillUp: |
2917 pPlayer4 = pPlayers[uActiveCharacter]; | |
2918 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | |
2919 LOWORD(v2) = *(short *)v105; | |
2920 uNumSeconds = v2; | |
2921 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) | |
2922 { | |
2923 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" | |
2924 } | |
2925 else | |
2926 { | |
2927 if ( (uNumSeconds & 0x3F) < 0x3C ) | |
2928 { | |
2929 *(short *)v105 = uNumSeconds + 1; | |
2930 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; | |
187 | 2931 pPlayer4->PlaySound(SPEECH_14, 0); |
916 | 2932 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0); |
2933 continue; | |
0 | 2934 } |
2935 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | |
2936 } | |
916 | 2937 ShowStatusBarString(v87, 2); |
4 | 2938 continue; |
960 | 2939 case UIMSG_ClickInventoryBtn: |
0 | 2940 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
2941 sub_419379(); | |
991 | 2942 CharacterUI_ReleaseButtons(); |
962 | 2943 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0); |
960 | 2944 continue; |
2945 case UIMSG_ClickExitCharacterWindowBtn: | |
2946 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); | |
2947 continue; | |
2948 case UIMSG_ClickAwardsBtn: | |
0 | 2949 sub_419379(); |
991 | 2950 CharacterUI_ReleaseButtons(); |
0 | 2951 sub_419220(); |
2952 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | |
962 | 2953 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0); |
521 | 2954 FillAwardsData(); |
4 | 2955 continue; |
1000 | 2956 case UIMSG_ClickBooksBtn: |
0 | 2957 switch ( uMessageParam ) |
2958 { | |
990 | 2959 case 11://Page UP |
2960 BtnUp_flag = 1; | |
2961 pButton = pBtn_Book_2; | |
2962 break; | |
2963 case 10://Page DOWN | |
2964 BtnDown_flag = 1; | |
2965 pButton = pBtn_Book_1; | |
2966 break; | |
1000 | 2967 case 0://Zoom plus |
0 | 2968 pButton = pBtn_Book_1; |
990 | 2969 BtnDown_flag = 1; |
0 | 2970 break; |
1000 | 2971 case 1://Zoom minus |
2972 pButton = pBtn_Book_2; | |
990 | 2973 BtnUp_flag = 1; |
0 | 2974 break; |
990 | 2975 case 2://Potions |
2976 Book_PageBtn3_flag = 1; | |
0 | 2977 if ( dword_506364 ) |
4 | 2978 continue; |
0 | 2979 pButton = pBtn_Book_3; |
2980 break; | |
990 | 2981 case 3://fountains |
2982 Book_PageBtn4_flag = 1; | |
0 | 2983 if ( dword_506364 ) |
4 | 2984 continue; |
0 | 2985 pButton = pBtn_Book_4; |
2986 break; | |
990 | 2987 case 4://obelisks |
2988 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag | |
0 | 2989 if ( dword_506364 ) |
4 | 2990 continue; |
0 | 2991 pButton = pBtn_Book_5; |
2992 break; | |
990 | 2993 case 5://seer |
2994 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag | |
0 | 2995 if ( dword_506364 ) |
4 | 2996 continue; |
0 | 2997 pButton = pBtn_Book_6; |
2998 break; | |
990 | 2999 case 6://misc |
0 | 3000 pButton = pBtn_Autonotes_Misc; |
990 | 3001 Autonotes_Misc_page_flag = 1; |
0 | 3002 break; |
990 | 3003 case 7://Instructors |
0 | 3004 pButton = pBtn_Autonotes_Instructors; |
990 | 3005 Autonotes_Instructors_page_flag = 1; |
0 | 3006 break; |
990 | 3007 default: |
3008 continue; | |
0 | 3009 } |
1268 | 3010 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
11 | 3011 continue; |
0 | 3012 case UIMSG_SelectCharacter: |
3013 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3014 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3015 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | |
4 | 3016 continue; |
0 | 3017 case UIMSG_ShowStatus_Funds: |
3018 v174 = (char *)pParty->uNumGoldInBank; | |
3019 v158 = pParty->uNumGold + pParty->uNumGoldInBank; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3020 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3021 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3022 continue; |
0 | 3023 case UIMSG_ShowStatus_DateTime: |
3024 pNPCData4 = (NPCData *)pParty->uCurrentHour; | |
3025 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3026 { | |
3027 if ( !pNPCData4 ) | |
3028 pNPCData4 = (NPCData *)12; | |
3029 } | |
3030 else | |
3031 { | |
3032 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); | |
3033 } | |
978 | 3034 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) ) |
0 | 3035 uNumSeconds = 0; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3036 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], |
0 | 3037 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
|
3038 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3039 continue; |
0 | 3040 case UIMSG_ShowStatus_Food: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3041 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
|
3042 GameUI_SetFooterString(pTmpBuf.data()); |
306 | 3043 continue; |
0 | 3044 case UIMSG_ShowStatus_Player: |
3045 pPlayer5 = pPlayers[uMessageParam]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3046 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
|
3047 strcat(pTmpBuf.data(), ": "); |
0 | 3048 v107 = pPlayer5->GetMajorConditionIdx(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3049 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3050 GameUI_SetFooterString(pTmpBuf.data()); |
0 | 3051 v108 = 8 * uMessageParam - 8; |
3052 LOBYTE(v108) = v108 | 4; | |
888 | 3053 pMouse->uPointingObjectID = PID(OBJECT_Player,v108); |
4 | 3054 continue; |
0 | 3055 case UIMSG_ShowStatus_ManaHP: |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3056 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(), |
1000 | 3057 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(), |
3058 pGlobalTXT_LocalizationStrings[212]); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
3059 GameUI_SetFooterString(pTmpBuf.data()); |
11 | 3060 continue; |
987 | 3061 case UIMSG_CHEST_ClickItem: |
3062 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
3063 { | |
3064 OnInventoryLeftClick(); | |
11 | 3065 continue; |
3066 } | |
987 | 3067 OnChestLeftClick(); |
4 | 3068 continue; |
151 | 3069 case UIMSG_InventoryLeftClick: |
987 | 3070 OnInventoryLeftClick(); |
4 | 3071 continue; |
960 | 3072 case UIMSG_MouseLeftClickInGame: |
0 | 3073 if ( !pRenderer->pRenderD3D ) |
11 | 3074 { |
3075 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3076 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3077 OnGameViewportClick(); | |
3078 continue; | |
3079 } | |
0 | 3080 v115 = pMessageQueue_50CBD0->uNumMessages; |
3081 if ( !pMessageQueue_50CBD0->uNumMessages ) | |
11 | 3082 { |
990 | 3083 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3084 /*if ( (signed int)v115 < 40 ) |
11 | 3085 //goto LABEL_769; |
3086 { | |
990 | 3087 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
11 | 3088 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3089 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3090 ++pMessageQueue_50CBD0->uNumMessages; | |
3091 continue; | |
437 | 3092 }*/ |
11 | 3093 continue; |
3094 } | |
0 | 3095 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
3096 { | |
978 | 3097 pMessageQueue_50CBD0->uNumMessages = 1; |
990 | 3098 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3099 /*v115 = v0; |
0 | 3100 pMessageQueue_50CBD0->uNumMessages = v0; |
990 | 3101 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
0 | 3102 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
11 | 3103 //goto LABEL_771; |
3104 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
437 | 3105 ++pMessageQueue_50CBD0->uNumMessages;*/ |
11 | 3106 continue; |
0 | 3107 } |
3108 v115 = 0; | |
3109 pMessageQueue_50CBD0->uNumMessages = 0; | |
990 | 3110 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0); |
437 | 3111 /*if ( (signed int)v115 < 40 ) |
11 | 3112 //goto LABEL_769; |
3113 { | |
990 | 3114 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen; |
11 | 3115 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
3116 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3117 ++pMessageQueue_50CBD0->uNumMessages; | |
3118 continue; | |
437 | 3119 }*/ |
4 | 3120 continue; |
990 | 3121 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame |
0 | 3122 if ( pMessageQueue_50CBD0->uNumMessages ) |
3123 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3124 OnGameViewportClick(); | |
4 | 3125 continue; |
151 | 3126 case UIMSG_F: |
987 | 3127 __debugbreak(); |
0 | 3128 if ( pRenderer->pRenderD3D ) |
3129 { | |
3130 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
3131 } | |
3132 else | |
3133 { | |
3134 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | |
3135 pPoint3 = pMouse->GetCursorPos(&v204); | |
3136 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | |
3137 } | |
3138 pButton2 = (GUIButton *)(unsigned __int16)v116; | |
960 | 3139 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); |
11 | 3140 continue; |
151 | 3141 case UIMSG_54: |
987 | 3142 __debugbreak(); |
0 | 3143 pButton2 = (GUIButton *)uMessageParam; |
990 | 3144 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0); |
4 | 3145 continue; |
201 | 3146 case UIMSG_Game_Action: |
0 | 3147 if ( pMessageQueue_50CBD0->uNumMessages ) |
3148 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
3149 OnPressSpace(); | |
4 | 3150 continue; |
960 | 3151 case UIMSG_ClickZoomOutBtn: |
0 | 3152 if ( pCurrentScreen ) |
4 | 3153 continue; |
0 | 3154 pParty->uFlags |= 2u; |
1000 | 3155 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0); |
0 | 3156 uNumSeconds = 131072; |
3157 v118 = 2 * viewparams->uMinimapZoom; | |
3158 ++viewparams->field_28; | |
3159 viewparams->uMinimapZoom *= 2; | |
3160 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | |
3161 { | |
3162 if ( (signed int)v118 > 4096 ) | |
3163 { | |
3164 viewparams->uMinimapZoom = 4096; | |
3165 viewparams->field_28 = 12; | |
3166 } | |
4 | 3167 continue; |
0 | 3168 } |
3169 v119 = 2048; | |
3170 if ( (signed int)v118 <= 2048 ) | |
960 | 3171 { |
1051 | 3172 _576E2C_current_minimap_zoom = v118; |
960 | 3173 dword_576E28 = viewparams->field_28; |
3174 break; | |
3175 } | |
0 | 3176 viewparams->field_28 = 11; |
960 | 3177 viewparams->uMinimapZoom = v119; |
1051 | 3178 _576E2C_current_minimap_zoom = v119; |
960 | 3179 dword_576E28 = viewparams->field_28; |
3180 break; | |
3181 case UIMSG_ClickZoomInBtn: | |
0 | 3182 if ( pCurrentScreen ) |
4 | 3183 continue; |
0 | 3184 pParty->uFlags |= 2u; |
1000 | 3185 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0); |
0 | 3186 uNumSeconds = 32768; |
3187 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
3188 --viewparams->field_28; | |
3189 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | |
3190 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3191 { | |
3192 v119 = 512; | |
3193 if ( (signed int)v118 < 512 ) | |
3194 { | |
3195 viewparams->field_28 = 9; | |
3196 v118 = v119; | |
3197 viewparams->uMinimapZoom = v119; | |
3198 } | |
1051 | 3199 _576E2C_current_minimap_zoom = v118; |
0 | 3200 dword_576E28 = viewparams->field_28; |
3201 } | |
3202 else | |
3203 { | |
3204 if ( (signed int)v118 < 256 ) | |
3205 { | |
3206 viewparams->uMinimapZoom = 256; | |
3207 viewparams->field_28 = 8; | |
3208 } | |
3209 } | |
4 | 3210 default: |
3211 continue; | |
0 | 3212 } |
3213 } | |
3214 } | |
1012 | 3215 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8; |
3216 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages); | |
3217 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); | |
3218 //dword_50C9E8 = 0; | |
3219 | |
3220 | |
3221 pMessageQueue_50C9E8->uNumMessages=0; | |
0 | 3222 if ( dword_50C9DC ) |
3223 { | |
437 | 3224 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 3225 { |
3226 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; | |
3227 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0; | |
3228 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3229 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 3230 }*/ |
3231 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0); | |
0 | 3232 dword_50C9DC = 0; |
3233 } | |
3234 else | |
3235 { | |
3236 if ( dword_50C9D0 > 0 ) | |
3237 { | |
3238 dword_50C9D8 -= pEventTimer->uTimeElapsed; | |
3239 if ( dword_50C9D8 <= 0 ) | |
3240 { | |
437 | 3241 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 3242 { |
3243 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0; | |
3244 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4; | |
3245 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3246 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 3247 }*/ |
3248 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9D0, dword_50C9D4, 0); | |
0 | 3249 dword_50C9D0 = 0; |
3250 dword_50C9D4 = 0; | |
3251 dword_50C9D8 = 0; | |
3252 } | |
3253 } | |
3254 } | |
1202 | 3255 pCastSpellInfo.data()->_427E01_cast_spell(); |
0 | 3256 } |
3257 | |
3258 //----- (004356FF) -------------------------------------------------------- | |
3259 void __cdecl back_to_game() | |
3260 { | |
3261 dword_507BF0_is_there_popup_onscreen = 0; | |
3262 dword_4E455C = 1; | |
3263 dword_50CDCC = 0; | |
3264 if ( pGUIWindow_ScrollWindow ) | |
3265 free_book_subwindow(); | |
3266 if ( !pCurrentScreen && !pGUIWindow_Settings ) | |
3267 pEventTimer->Resume(); | |
3268 viewparams->bRedrawGameUI = 1; | |
3269 } | |
782 | 3270 |
0 | 3271 //----- (00435748) -------------------------------------------------------- |
3272 void __cdecl GUI_MainMenuMessageProc() | |
3273 { | |
967 | 3274 Player *pPlayer; // ebx@2 |
0 | 3275 void *v3; // edi@21 |
3276 signed int v4; // eax@29 | |
3277 int v5; // ecx@29 | |
821 | 3278 PLAYER_SKILL_TYPE v6; // edi@37 |
0 | 3279 GUIWindow *pWindow; // eax@56 |
3280 GUIButton *pButton; // eax@59 | |
3281 int v15; // edi@70 | |
3282 char v20; // dl@116 | |
3283 unsigned int v21; // eax@116 | |
3284 unsigned int v25; // eax@120 | |
3285 unsigned int v26; // ecx@127 | |
3286 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36 | |
3287 signed int v41; // [sp-10h] [bp-20h]@29 | |
971 | 3288 int pParam; // [sp+4h] [bp-Ch]@3 |
0 | 3289 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 |
967 | 3290 int pSex; // [sp+Ch] [bp-4h]@3 |
0 | 3291 |
3292 if ( pMessageQueue_50CBD0->uNumMessages ) | |
3293 { | |
2 | 3294 pPlayer = pParty->pPlayers; |
0 | 3295 do |
3296 { | |
187 | 3297 int param2; |
971 | 3298 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, ¶m2); |
3299 auto player = &pParty->pPlayers[pParam]; | |
187 | 3300 |
3 | 3301 switch (pUIMessageType) // For buttons of window MainMenu |
2 | 3302 { |
165 | 3303 case UIMSG_MainMenu_ShowPartyCreationWnd: |
962 | 3304 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); |
0 | 3305 SetCurrentMenuID(MENU_NEWGAME); |
960 | 3306 break; |
165 | 3307 case UIMSG_MainMenu_ShowLoadWindow: |
962 | 3308 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0); |
0 | 3309 SetCurrentMenuID(MENU_SAVELOAD); |
960 | 3310 break; |
165 | 3311 case UIMSG_ShowCredits: |
962 | 3312 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0); |
0 | 3313 SetCurrentMenuID(MENU_CREDITS); |
960 | 3314 break; |
165 | 3315 case UIMSG_ExitToWindows: |
962 | 3316 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); |
982 | 3317 SetCurrentMenuID(MENU_EXIT_GAME); |
960 | 3318 break; |
187 | 3319 case UIMSG_PlayerCreation_SelectAttribute: |
960 | 3320 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3321 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
3322 uPlayerCreationUI_SelectedCharacter = pParam; | |
960 | 3323 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3324 break; | |
187 | 3325 case UIMSG_PlayerCreation_VoicePrev: |
967 | 3326 pSex = player->GetSexByVoice(); |
960 | 3327 do |
3328 { | |
3329 if (player->uVoiceID == 0) | |
3330 player->uVoiceID = 19; | |
3331 else --player->uVoiceID; | |
3332 } | |
967 | 3333 while (player->GetSexByVoice() != pSex); |
971 | 3334 pButton = pCreationUI_BtnPressLeft2[pParam]; |
1268 | 3335 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
960 | 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_VoiceNext: |
967 | 3340 pSex = player->GetSexByVoice(); |
3341 do | |
3342 { | |
3343 player->uVoiceID = (player->uVoiceID + 1) % 20; | |
3344 } | |
3345 while (player->GetSexByVoice() != pSex); | |
971 | 3346 pButton = pCreationUI_BtnPressRight2[pParam]; |
1268 | 3347 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); |
967 | 3348 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3349 player->PlaySound(SPEECH_PickMe, 0); | |
3350 break; | |
187 | 3351 case UIMSG_PlayerCreation_FacePrev: |
971 | 3352 pPlayer = &pParty->pPlayers[pParam]; |
1014 | 3353 if (!pPlayer->uCurrentFace) |
3354 pPlayer->uCurrentFace = 19; | |
960 | 3355 else |
1014 | 3356 pPlayer->uCurrentFace -= 1; |
3357 pPlayer->uVoiceID = pPlayer->uCurrentFace; | |
960 | 3358 pPlayer->SetInitialStats(); |
3359 pPlayer->SetSexByVoice(); | |
3360 pPlayer->RandomizeName(); | |
971 | 3361 v25 = pParam; |
960 | 3362 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3363 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3364 uPlayerCreationUI_SelectedCharacter = v25; |
1268 | 3365 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); |
960 | 3366 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); |
3367 pPlayer->PlaySound(SPEECH_PickMe, 0); | |
3368 break; | |
187 | 3369 case UIMSG_PlayerCreation_FaceNext: |
971 | 3370 pPlayer = &pParty->pPlayers[pParam]; |
1014 | 3371 v20 = (char)((int)pPlayer->uCurrentFace + 1) % 20; |
3372 pPlayer->uCurrentFace = v20; | |
960 | 3373 pPlayer->uVoiceID = v20; |
3374 pPlayer->SetInitialStats(); | |
3375 pPlayer->SetSexByVoice(); | |
3376 pPlayer->RandomizeName(); | |
971 | 3377 v21 = pParam; |
960 | 3378 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
971 | 3379 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3380 uPlayerCreationUI_SelectedCharacter = v21; |
1268 | 3381 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); |
960 | 3382 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3383 pPlayer->PlaySound(SPEECH_PickMe, 0); | |
3384 break; | |
3385 case UIMSG_PlayerCreationClickPlus: | |
1268 | 3386 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); |
960 | 3387 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3388 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
3389 break; | |
3390 case UIMSG_PlayerCreationClickMinus: | |
1268 | 3391 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); |
960 | 3392 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3393 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
3394 break; | |
3395 case UIMSG_PlayerCreationSelectActiveSkill: | |
967 | 3396 pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter]; |
971 | 3397 v6 = pPlayer->GetSkillIdxByOrder(pParam + 4); |
967 | 3398 if ( pPlayer->GetSkillIdxByOrder(3) == 37 ) |
3399 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | |
3400 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3401 break; | |
960 | 3402 case UIMSG_PlayerCreationSelectClass: |
971 | 3403 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam); |
960 | 3404 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3405 break; | |
3406 case UIMSG_PlayerCreationClickOK: | |
962 | 3407 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0); |
1273 | 3408 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Chose4Skills() ) |
960 | 3409 GameUI_Footer_TimeLeft = GetTickCount() + 4000; |
3410 else | |
982 | 3411 uGameState = GAME_STATE_STARTING_NEW_GAME; |
960 | 3412 break; |
3413 case UIMSG_PlayerCreationClickReset: | |
962 | 3414 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0); |
960 | 3415 pParty->Reset(); |
3416 break; | |
3417 case UIMSG_PlayerCreationRemoveUpSkill: | |
971 | 3418 uPlayerCreationUI_SelectedCharacter = pParam; |
960 | 3419 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3420 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3421 v41 = 2; | |
971 | 3422 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
960 | 3423 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; |
3424 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | |
3425 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | |
3426 break; | |
3427 case UIMSG_PlayerCreationChangeName: | |
3428 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
971 | 3429 v3 = (void *)pParam; |
3430 uPlayerCreationUI_SelectedCharacter = pParam; | |
960 | 3431 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); |
3432 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
3433 break; | |
3434 case UIMSG_ChangeGameState: | |
978 | 3435 uGameState = GAME_FINISHED; |
960 | 3436 break; |
3437 case UIMSG_11: | |
3438 pMouse->SetCursorBitmap("MICON2"); | |
3439 break; | |
3440 case UIMSG_3A: | |
3441 SetCurrentMenuID(MENU_10); | |
3442 break; | |
165 | 3443 case UIMSG_LoadGame: |
0 | 3444 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) |
960 | 3445 break; |
961 | 3446 SetCurrentMenuID(MENU_LoadingProcInMainMenu); |
960 | 3447 break; |
165 | 3448 case UIMSG_SelectLoadSlot: |
0 | 3449 //main menu save/load wnd clicking on savegame lines |
1038 | 3450 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
3451 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
971 | 3452 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition ) |
0 | 3453 { |
3454 //load clicked line | |
971 | 3455 v26 = pParam + pSaveListPosition; |
3456 if ( dword_6BE138 == pParam + pSaveListPosition ) | |
0 | 3457 { |
961 | 3458 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0); |
437 | 3459 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); |
0 | 3460 } |
3461 uLoadGameUI_SelectedSlot = v26; | |
3462 dword_6BE138 = v26; | |
3463 } | |
3464 else | |
3465 { | |
3466 //typing in the line | |
3 | 3467 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); |
0 | 3468 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); |
3469 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | |
3470 } | |
960 | 3471 break; |
961 | 3472 case UIMSG_SaveLoadBtn: |
3473 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); | |
960 | 3474 break; |
165 | 3475 case UIMSG_DownArrow: |
3 | 3476 ++pSaveListPosition; |
971 | 3477 if ( pSaveListPosition >= pParam ) |
3478 pSaveListPosition = pParam - 1; | |
3 | 3479 if ( pSaveListPosition < 1 ) |
3480 pSaveListPosition = 0; | |
3481 pWindow = pGUIWindow_CurrentMenu; | |
962 | 3482 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0); |
960 | 3483 break; |
165 | 3484 case UIMSG_Cancel: |
960 | 3485 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); |
3486 break; | |
165 | 3487 case UIMSG_ArrowUp: |
3 | 3488 --pSaveListPosition; |
3489 if ( pSaveListPosition < 0 ) | |
3490 pSaveListPosition = 0; | |
3491 pWindow = pGUIWindow_CurrentMenu; | |
962 | 3492 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0); |
960 | 3493 break; |
3494 case UIMSG_AD: | |
962 | 3495 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0); |
961 | 3496 SetCurrentMenuID(MENU_LoadingProcInMainMenu); |
960 | 3497 break; |
3498 case UIMSG_AE: | |
962 | 3499 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0); |
165 | 3500 SetCurrentMenuID(MENU_10); |
960 | 3501 break; |
3502 case UIMSG_Escape: | |
0 | 3503 if ( ptr_507BDC ) |
3504 { | |
3505 sub_41426F(); | |
960 | 3506 break; |
0 | 3507 } |
3508 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) | |
960 | 3509 break; |
0 | 3510 v15 = 1; |
3511 pVideoPlayer->bStopBeforeSchedule = 1; | |
3512 viewparams->bRedrawGameUI = 1; | |
3513 viewparams->field_48 = 1; | |
165 | 3514 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) |
3515 { | |
3516 if ( pCurrentScreen == SCREEN_VIDEO ) | |
3517 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | |
3518 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | |
3519 { | |
3520 SetCurrentMenuID(MENU_CREATEPARTY); | |
960 | 3521 break; |
0 | 3522 } |
165 | 3523 if (GetCurrentMenuID() == MENU_CREDITSPROC) |
3524 { | |
3525 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
960 | 3526 break; |
0 | 3527 } |
437 | 3528 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); |
960 | 3529 break; |
0 | 3530 } |
971 | 3531 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen ) |
3532 { | |
3533 if ( pCurrentScreen == SCREEN_VIDEO ) | |
3534 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | |
3535 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | |
3536 { | |
3537 SetCurrentMenuID(MENU_CREATEPARTY); | |
3538 break; | |
3539 } | |
3540 if (GetCurrentMenuID() == MENU_CREDITSPROC) | |
3541 { | |
3542 SetCurrentMenuID(MENU_CREDITSCLOSE); | |
3543 break; | |
3544 } | |
3545 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | |
3546 break; | |
3547 } | |
151 | 3548 if ( pCurrentScreen == SCREEN_LOADGAME ) |
0 | 3549 { |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
3550 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 3551 //crt_deconstruct_ptr_6A0118(); |
3552 pTexture_PCX.Release(); | |
3553 pTexture_PCX.Load("title.pcx", 0); | |
3554 SetCurrentMenuID(MENU_MAIN); | |
3555 v15 = 1; | |
3556 pGUIWindow_CurrentMenu->Release(); | |
3557 pGUIWindow2->Release(); | |
3558 pGUIWindow2 = 0; | |
3559 pEventTimer->Resume(); | |
151 | 3560 pCurrentScreen = SCREEN_GAME; |
0 | 3561 viewparams->bRedrawGameUI = v15; |
960 | 3562 break; |
0 | 3563 } |
151 | 3564 if ( pCurrentScreen == SCREEN_VIDEO ) |
0 | 3565 { |
3566 pVideoPlayer->Unload(); | |
3567 } | |
3568 else | |
3569 { | |
151 | 3570 if ( pCurrentScreen != SCREEN_1B ) |
2 | 3571 { |
3572 pGUIWindow_CurrentMenu->Release(); | |
3573 pGUIWindow2->Release(); | |
3574 pGUIWindow2 = 0; | |
3575 pEventTimer->Resume(); | |
151 | 3576 pCurrentScreen = SCREEN_GAME; |
2 | 3577 viewparams->bRedrawGameUI = v15; |
960 | 3578 break; |
2 | 3579 } |
0 | 3580 //VideoPlayer::dtor(); |
3581 } | |
960 | 3582 break; |
3583 case UIMSG_PlayerCreationRemoveDownSkill: | |
971 | 3584 uPlayerCreationUI_SelectedCharacter = pParam; |
165 | 3585 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 |
971 | 3586 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; |
165 | 3587 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) |
0 | 3588 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
960 | 3589 break; |
3590 default: | |
3591 break; | |
0 | 3592 } |
3593 } | |
3594 while ( pMessageQueue_50CBD0->uNumMessages ); | |
3595 } | |
3596 } | |
3597 | |
3598 //----- (00436427) -------------------------------------------------------- | |
3599 double __cdecl get_shading_dist_mist() | |
3600 { | |
3601 double result; // st7@2 | |
3602 | |
3603 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3604 result = (double)pOutdoorCamera->shading_dist_mist; | |
3605 else | |
3606 result = 16192.0; | |
3607 return result; | |
3608 } | |
3609 | |
3610 //----- (0043648F) -------------------------------------------------------- | |
3611 void Vec3_short__to_RenderVertexSoft(RenderVertexSoft *_this, Vec3_short_ *a2) | |
3612 { | |
3613 _this->flt_2C = 0.0; | |
3614 | |
3615 _this->vWorldPosition.x = a2->x; | |
3616 _this->vWorldPosition.y = a2->y; | |
3617 _this->vWorldPosition.z = a2->z; | |
3618 } | |
3619 | |
3620 //----- (004369DB) -------------------------------------------------------- | |
3621 void Vec3_float_::Normalize() | |
3622 { | |
1025 | 3623 this->x = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->x; |
3624 this->y = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->y; | |
3625 this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z; | |
0 | 3626 } |
3627 | |
3628 //----- (00438F8F) -------------------------------------------------------- | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1384
diff
changeset
|
3629 void area_of_effect__damage_evaluate() |
0 | 3630 { |
3631 int v0; // edx@1 | |
3632 char *v1; // esi@2 | |
3633 int v2; // ecx@3 | |
3634 signed int v3; // eax@3 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3635 SpriteObject *v4; // eax@4 |
0 | 3636 signed int v5; // eax@4 |
3637 signed int v6; // eax@6 | |
3638 unsigned int v7; // edi@6 | |
3639 int v8; // eax@6 | |
3640 __int16 v9; // bx@8 | |
3641 int v10; // edi@8 | |
3642 Vec3_int_ v11; // ST04_12@9 | |
3643 int v12; // ST0C_4@10 | |
3644 Actor *v13; // edi@11 | |
3645 int v14; // edx@15 | |
3646 int v15; // edx@15 | |
3647 int v16; // ebx@15 | |
3648 signed int v17; // eax@15 | |
3649 int v18; // edi@15 | |
3650 int v19; // edi@15 | |
3651 Vec3_int_ v20; // ST04_12@16 | |
3652 Vec3_int_ *v21; // eax@17 | |
3653 unsigned int v22; // edx@17 | |
3654 int v23; // edx@18 | |
3655 int v24; // eax@18 | |
3656 Vec3_int_ v25; // ST04_12@19 | |
3657 unsigned int v26; // ebx@20 | |
89 | 3658 Player *v27; // edi@20 |
90 | 3659 Actor *v28; // edi@27 |
0 | 3660 int v29; // ebx@29 |
3661 int v30; // eax@29 | |
3662 int v31; // edx@29 | |
3663 int v32; // eax@29 | |
3664 int v33; // ST24_4@29 | |
3665 Vec3_int_ v34; // ST04_12@30 | |
3666 Vec3_int_ *v35; // eax@31 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3667 SpriteObject *v36; // [sp+0h] [bp-28h]@0 |
0 | 3668 signed int v37; // [sp+4h] [bp-24h]@5 |
3669 int v38; // [sp+4h] [bp-24h]@15 | |
3670 signed int v39; // [sp+8h] [bp-20h]@3 | |
3671 int v40; // [sp+8h] [bp-20h]@15 | |
3672 int v41; // [sp+Ch] [bp-1Ch]@5 | |
3673 int v42; // [sp+Ch] [bp-1Ch]@15 | |
3674 int v43; // [sp+10h] [bp-18h]@1 | |
3675 int v44; // [sp+14h] [bp-14h]@15 | |
3676 unsigned int uActorID; // [sp+18h] [bp-10h]@6 | |
3677 Vec3_int_ *pVelocity; // [sp+1Ch] [bp-Ch]@2 | |
3678 int a1; // [sp+20h] [bp-8h]@8 | |
3679 int v48; // [sp+24h] [bp-4h]@8 | |
3680 | |
3681 v0 = 0; | |
3682 v43 = 0; | |
3683 if ( stru_50FE08.count > 0 ) | |
3684 { | |
3685 pVelocity = &stru_50FE08.vec_4B4; | |
3686 v1 = (char *)stru_50FE08.pZs; | |
3687 do | |
3688 { | |
848 | 3689 v2 = PID_TYPE(*((short *)v1 - 300)); |
3690 v3 = PID_ID((signed int)*((short *)v1 - 300)); | |
3691 v39 = PID_ID((signed int)*((short *)v1 - 300)); | |
0 | 3692 if ( v2 == 2 ) |
3693 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3694 v4 = &pSpriteObjects[v3]; |
0 | 3695 v36 = v4; |
822 | 3696 v5 = v4->spell_caster_pid; |
848 | 3697 v2 = PID_TYPE(v5); |
3698 v3 = PID_ID(v5); | |
0 | 3699 } |
3700 v41 = v2; | |
3701 v37 = v3; | |
3702 if ( stru_50FE08.field_3EC[v0] & 1 ) | |
3703 { | |
417 | 3704 v6 = ai_near_actors_targets_pid[v3]; |
848 | 3705 v7 = PID_ID(v6); |
3706 v8 = PID_TYPE(v6) - 3; | |
0 | 3707 uActorID = v7; |
3708 if ( v8 ) | |
3709 { | |
3710 if ( v8 == 1 ) | |
3711 { | |
3712 v9 = *(short *)v1; | |
3713 v10 = pParty->vPosition.y - *((short *)v1 - 100); | |
3714 a1 = pParty->vPosition.x - *((short *)v1 - 200); | |
3715 v48 = v10; | |
3716 if ( a1 * a1 | |
3717 + v10 * v10 | |
3718 + ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9)) | |
3719 * ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9)) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) ) | |
3720 { | |
3721 v11.z = *(short *)v1; | |
3722 v11.y = *((short *)v1 - 100); | |
3723 v11.x = *((short *)v1 - 200); | |
3724 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v11) ) | |
3725 { | |
3726 v12 = stru_50C198.which_player_would_attack(&pActors[v39]); | |
3727 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v12); | |
3728 } | |
3729 } | |
3730 } | |
3731 } | |
3732 else | |
3733 { | |
3734 v13 = &pActors[v7]; | |
3735 if ( SHIDWORD(v13->pActorBuffs[6].uExpireTime) > 0 | |
3736 || SHIDWORD(v13->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(v13->pActorBuffs[6].uExpireTime) | |
3737 || v13->CanAct() ) | |
3738 { | |
3739 v14 = v13->vPosition.y; | |
3740 v40 = v13->vPosition.x; | |
3741 v38 = v14; | |
3742 v15 = v14 - *((short *)v1 - 100); | |
3743 v16 = *(short *)v1; | |
3744 v42 = v13->vPosition.z; | |
3745 a1 = v40 - *((short *)v1 - 200); | |
3746 v17 = v13->uActorHeight; | |
3747 v18 = v13->uActorRadius; | |
3748 v44 = v42; | |
3749 v19 = *((short *)v1 + 100) + v18; | |
3750 v48 = v15; | |
3751 if ( a1 * a1 + v15 * v15 + (v42 + (v17 >> 1) - v16) * (v42 + (v17 >> 1) - v16) < (unsigned int)(v19 * v19) ) | |
3752 { | |
3753 v20.z = *(short *)v1; | |
3754 v20.y = *((short *)v1 - 100); | |
3755 v20.x = *((short *)v1 - 200); | |
3756 if ( sub_407A1C(v40, v38, v42 + 50, v20) ) | |
3757 { | |
3758 Vec3_int_::Normalize(&a1, &v48, &v44); | |
3759 v21 = pVelocity; | |
3760 v22 = uActorID; | |
3761 pVelocity->x = a1; | |
3762 v21->y = v48; | |
3763 v21->z = v44; | |
3764 sub_43B1B0(*((short *)v1 - 300), v22, v21, stru_50FE08.field_450[v43]); | |
3765 } | |
3766 } | |
3767 } | |
3768 } | |
3769 } | |
3770 else | |
3771 { | |
3772 v23 = pParty->vPosition.y - *((short *)v1 - 100); | |
3773 v24 = ((signed int)pParty->uPartyHeight >> 1) - *(short *)v1; | |
3774 a1 = pParty->vPosition.x - *((short *)v1 - 200); | |
3775 v48 = v23; | |
3776 if ( a1 * a1 + v23 * v23 + (pParty->vPosition.z + v24) * (pParty->vPosition.z + v24) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) ) | |
3777 { | |
3778 v25.z = *(short *)v1; | |
3779 v25.y = *((short *)v1 - 100); | |
3780 v25.x = *((short *)v1 - 200); | |
3781 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v25) ) | |
3782 { | |
3783 v26 = 0; | |
89 | 3784 v27 = pParty->pPlayers;//[0].pConditions[15]; |
0 | 3785 do |
3786 { | |
89 | 3787 if ( !(HIDWORD(v27->pConditions[14]) | LODWORD(v27->pConditions[14])) && !v27->pConditions[15] && !v27->pConditions[16] ) |
0 | 3788 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v26); |
89 | 3789 ++v27; |
0 | 3790 ++v26; |
3791 } | |
89 | 3792 while ( v27 <= &pParty->pPlayers[3] ); |
0 | 3793 } |
3794 } | |
3795 uActorID = 0; | |
3796 if ( (signed int)uNumActors > 0 ) | |
3797 { | |
1202 | 3798 v28 = pActors.data();//[0].vPosition.z; |
0 | 3799 do |
3800 { | |
91 | 3801 if ( v28->CanAct() ) |
0 | 3802 { |
3803 v29 = *(short *)v1; | |
91 | 3804 v30 = v28->vPosition.y - *((short *)v1 - 100); |
3805 a1 = v28->vPosition.x - *((short *)v1 - 200); | |
90 | 3806 v31 = v28->vPosition.z; |
0 | 3807 v48 = v30; |
3808 v44 = v31; | |
90 | 3809 v32 = (v28->uActorHeight >> 1) - v29; |
91 | 3810 v33 = v28->uActorRadius + *((short *)v1 + 100); |
0 | 3811 if ( a1 * a1 + v48 * v48 + (v31 + v32) * (v31 + v32) < (unsigned int)(v33 * v33) ) |
3812 { | |
3813 v34.z = *(short *)v1; | |
3814 v34.y = *((short *)v1 - 100); | |
3815 v34.x = *((short *)v1 - 200); | |
90 | 3816 if ( sub_407A1C(v28->vPosition.x, v28->vPosition.y, v28->vPosition.z + 50, v34) ) |
0 | 3817 { |
3818 Vec3_int_::Normalize(&a1, &v48, &v44); | |
3819 v35 = pVelocity; | |
3820 pVelocity->x = a1; | |
3821 v35->y = v48; | |
3822 v35->z = v44; | |
3823 switch ( v41 ) | |
3824 { | |
303 | 3825 case OBJECT_Player: |
0 | 3826 DamageMonsterFromParty(*((short *)v1 - 300), uActorID, v35); |
3827 break; | |
303 | 3828 case OBJECT_Actor: |
90 | 3829 if ( v36 && pActors[v37].GetActorsRelation(v28) ) |
0 | 3830 sub_43B1B0(*((short *)v1 - 300), uActorID, pVelocity, v36->field_61); |
3831 break; | |
303 | 3832 case OBJECT_Item: |
0 | 3833 sub_43B057(*((short *)v1 - 300), uActorID, v35); |
3834 break; | |
3835 } | |
3836 } | |
3837 } | |
3838 } | |
3839 ++uActorID; | |
90 | 3840 ++v28; |
0 | 3841 } |
3842 while ( (signed int)uActorID < (signed int)uNumActors ); | |
3843 } | |
3844 } | |
3845 ++pVelocity; | |
3846 v0 = v43 + 1; | |
3847 v1 += 2; | |
3848 ++v43; | |
3849 } | |
3850 while ( v43 < stru_50FE08.count ); | |
3851 } | |
3852 stru_50FE08.count = 0; | |
3853 } | |
3854 // 50FE08: using guessed type stru298 stru_50FE08; | |
3855 | |
3856 // 4D864C: using guessed type char byte_4D864C; | |
3857 | |
3858 //----- (0043A97E) -------------------------------------------------------- | |
3859 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2) | |
3860 { | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1384
diff
changeset
|
3861 if (PID_TYPE(a2) == OBJECT_BLVDoor) |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3862 { |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3863 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3864 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3865 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3866 |
0 | 3867 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
|
3868 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
|
3869 } |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3870 else if (PID_TYPE(a2) == OBJECT_Actor) |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3871 { |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3872 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3873 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3874 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z; |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3875 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3876 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
|
3877 switch (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid)) |
0 | 3878 { |
3879 case OBJECT_Actor: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3880 sub_43B1B0(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC, pSpriteObjects[uLayingItemID].field_61); |
0 | 3881 break; |
3882 case OBJECT_Player: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3883 DamageMonsterFromParty(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC); |
0 | 3884 break; |
3885 case OBJECT_Item: | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
3886 sub_43B057(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC); |
0 | 3887 break; |
3888 } | |
3889 } | |
3890 } | |
3891 | |
3892 //----- (0043AA99) -------------------------------------------------------- | |
3893 void __fastcall Vec3_int_::Rotate(int sDepth, int sRotY, int sRotX, Vec3_int_ v, int *outx, int *outy, int *outz) | |
3894 { | |
147 | 3895 float cosf_x = cosf(3.14159265f * sRotX / 1024.0f), |
1025 | 3896 sinf_x = sinf(3.14159265f * sRotX / 1024.0f), |
147 | 3897 cosf_y = cosf(3.14159265f * sRotY / 1024.0f), |
3898 sinf_y = sinf(3.14159265f * sRotY / 1024.0f); | |
1045 | 3899 |
1025 | 3900 *outx = v.x + ((unsigned __int64)(sinf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16))); |
3901 *outy = v.y + ((unsigned __int64)(cosf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16))); | |
3902 *outz = v.z + ((unsigned __int64)(sinf_x * (signed __int64)sDepth) >> 16); | |
0 | 3903 } |
3904 | |
3905 //----- (0043AB61) -------------------------------------------------------- | |
3906 void Vec3_int_::Normalize(int *x, int *y, int *z) | |
3907 { | |
1025 | 3908 *x *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); |
3909 *y *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); | |
3910 *z *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1); | |
0 | 3911 } |
3912 | |
3913 //----- (0043AE12) -------------------------------------------------------- | |
3914 double __fastcall sub_43AE12(signed int a1) | |
3915 { | |
3916 signed int v1; // ST00_4@1 | |
3917 signed int v2; // ecx@1 | |
3918 double v3; // st7@1 | |
3919 double result; // st7@6 | |
3920 | |
3921 v1 = a1; | |
3922 v2 = 0; | |
3923 v3 = (double)v1; | |
3924 do | |
3925 { | |
3926 if ( v3 < flt_4E4A80[v2 + 5] ) | |
3927 break; | |
3928 ++v2; | |
3929 } | |
3930 while ( v2 < 5 ); | |
3931 if ( v2 <= 0 || v2 >= 5 ) | |
3932 { | |
3933 if ( v2 ) | |
3934 result = flt_4E4A80[4]; | |
3935 else | |
3936 result = flt_4E4A80[0]; | |
3937 } | |
3938 else | |
3939 { | |
1033 | 3940 result = (flt_4E4A80[v2] - flt_4E4A80[v2 - 3]) * (v3 - flt_4E4A80[v2 + 4]) / (flt_4E4A80[v2 + 5] - flt_4E4A80[v2 + 4]) + flt_4E4A80[v2]; |
0 | 3941 } |
3942 return result; | |
3943 } | |
3944 | |
3945 //----- (0043B057) -------------------------------------------------------- | |
3946 void __fastcall sub_43B057(unsigned int uObjID, unsigned int uActorID, Vec3_int_ *pVelocity) | |
3947 { | |
3948 Actor *pActor; // esi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
3949 SpriteObject *v4; // eax@3 |
0 | 3950 int v5; // ecx@3 |
3951 int v6; // eax@4 | |
3952 int v7; // edi@4 | |
3953 unsigned int uActorIDa; // [sp+8h] [bp-8h]@1 | |
3954 unsigned int a2; // [sp+Ch] [bp-4h]@1 | |
3955 int a2a; // [sp+Ch] [bp-4h]@8 | |
3956 | |
3957 uActorIDa = uActorID; | |
3958 pActor = &pActors[uActorID]; | |
3959 a2 = uObjID; | |
303 | 3960 if ( !pActors[uActorID].IsNotAlive() ) |
0 | 3961 { |
848 | 3962 if ( PID_TYPE(a2) == OBJECT_Item) |
3963 { | |
3964 v4 = &pSpriteObjects[PID_ID(a2)]; | |
822 | 3965 v5 = v4->spell_id; |
0 | 3966 if ( v5 ) |
3967 { | |
822 | 3968 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP); |
0 | 3969 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); |
3970 pActor->sCurrentHP -= v7; | |
3971 if ( v7 ) | |
3972 { | |
3973 if ( pActor->sCurrentHP > 0 ) | |
1060 | 3974 Actor::AI_Stun(uActorIDa, a2, 0); |
0 | 3975 else |
3976 Actor::Die(uActorIDa); | |
3977 a2a = 20 * v7 / (signed int)pActor->pMonsterInfo.uHP; | |
3978 if ( 20 * v7 / (signed int)pActor->pMonsterInfo.uHP > 10 ) | |
3979 a2a = 10; | |
3980 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) | |
3981 { | |
3982 pVelocity->x = (unsigned __int64)(a2a * (signed __int64)pVelocity->x) >> 16; | |
3983 pVelocity->y = (unsigned __int64)(a2a * (signed __int64)pVelocity->y) >> 16; | |
3984 pVelocity->z = (unsigned __int64)(a2a * (signed __int64)pVelocity->z) >> 16; | |
3985 pActor->vVelocity.x = 50 * LOWORD(pVelocity->x); | |
3986 pActor->vVelocity.y = 50 * LOWORD(pVelocity->y); | |
3987 pActor->vVelocity.z = 50 * LOWORD(pVelocity->z); | |
3988 } | |
3989 Actor::AddBloodsplatOnDamageOverlay(uActorIDa, 1, v7); | |
3990 } | |
3991 else | |
3992 { | |
1060 | 3993 Actor::AI_Stun(uActorIDa, a2, 0); |
0 | 3994 } |
3995 } | |
3996 } | |
3997 } | |
3998 } | |
3999 | |
4000 //----- (0043B1B0) -------------------------------------------------------- | |
322 | 4001 void sub_43B1B0(signed int a1, unsigned int a2, Vec3_int_ *pVelocity, signed int a4) |
0 | 4002 { |
4003 int v4; // ebx@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4004 SpriteObject *v5; // eax@2 |
0 | 4005 bool v6; // eax@3 |
4006 Actor *v7; // esi@4 | |
4007 Actor *v8; // edi@4 | |
4008 char v9; // zf@5 | |
4009 __int64 v10; // qax@8 | |
4010 signed __int16 v11; // cx@9 | |
4011 signed int v12; // ecx@20 | |
4012 int v13; // ecx@22 | |
4013 int v14; // edi@30 | |
4014 unsigned int uActorID; // [sp+Ch] [bp-8h]@1 | |
4015 signed int v17; // [sp+10h] [bp-4h]@1 | |
4016 int v18; // [sp+20h] [bp+Ch]@34 | |
4017 | |
4018 v4 = 0; | |
4019 uActorID = a2; | |
4020 v17 = a1; | |
848 | 4021 if ( PID_TYPE(a1) == OBJECT_Item) |
4022 { | |
4023 v5 = &pSpriteObjects[PID_ID(a1)]; | |
0 | 4024 v4 = v5->field_60_distance_related_prolly_lod; |
822 | 4025 v17 = v5->spell_caster_pid; |
0 | 4026 } |
848 | 4027 LOWORD(v6) = PID_TYPE(v17); |
303 | 4028 if ( v6 == OBJECT_Actor) |
0 | 4029 { |
4030 v7 = &pActors[a2]; | |
848 | 4031 v8 = &pActors[PID_ID(v17)]; |
303 | 4032 v6 = pActors[a2].IsNotAlive(); |
0 | 4033 if ( !v6 ) |
4034 { | |
4035 v9 = v7->uAIState == 7; | |
4036 v7->uLastCharacterIDToHit = v17; | |
4037 if ( v9 ) | |
4038 BYTE2(v7->uAttributes) |= 2u; | |
4039 v6 = stru_50C198._4273BB(v8, v7, v4, 0); | |
4040 if ( v6 ) | |
4041 { | |
4042 v10 = (unsigned int)Actor::_43B3E0_CalcDamage(v8, a4); | |
4043 if ( (signed __int64)v8->pActorBuffs[3].uExpireTime > 0 ) | |
4044 { | |
4045 v11 = v8->pActorBuffs[3].uPower; | |
4046 if ( v11 ) | |
4047 v10 = (signed int)v10 / (unsigned __int16)v11; | |
4048 } | |
4049 if ( SHIDWORD(v7->pActorBuffs[5].uExpireTime) >= SHIDWORD(v10) | |
4050 && (SHIDWORD(v7->pActorBuffs[5].uExpireTime) > SHIDWORD(v10) | |
4051 || LODWORD(v7->pActorBuffs[5].uExpireTime) > HIDWORD(v10)) ) | |
4052 LODWORD(v10) = 0; | |
4053 if ( a4 != HIDWORD(v10) ) | |
4054 { | |
4055 if ( a4 - HIDWORD(v10) == 1 ) | |
4056 { | |
4057 v12 = v8->pMonsterInfo.uAttack2Type; | |
4058 if ( SHIDWORD(v7->pActorBuffs[15].uExpireTime) >= SHIDWORD(v10) | |
4059 && (SHIDWORD(v7->pActorBuffs[15].uExpireTime) > SHIDWORD(v10) | |
4060 || LODWORD(v7->pActorBuffs[15].uExpireTime) > HIDWORD(v10)) ) | |
4061 LODWORD(v10) = (signed int)v10 >> 1; | |
4062 goto LABEL_30; | |
4063 } | |
4064 if ( a4 - HIDWORD(v10) == 2 ) | |
4065 { | |
4066 v13 = v7->pMonsterInfo.uSpell1ID; | |
4067 } | |
4068 else | |
4069 { | |
4070 if ( a4 - HIDWORD(v10) != 3 ) | |
4071 { | |
4072 if ( a4 - HIDWORD(v10) == 4 ) | |
4073 v12 = v8->pMonsterInfo.field_3C_some_special_attack; | |
4074 else | |
4075 v12 = 4; | |
4076 LABEL_30: | |
4077 v14 = stru_50C198.CalcMagicalDamageToActor(v7, v12, v10); | |
4078 v7->sCurrentHP -= v14; | |
4079 if ( v14 ) | |
4080 { | |
4081 if ( v7->sCurrentHP > 0 ) | |
1060 | 4082 Actor::AI_Stun(uActorID, v17, 0); |
0 | 4083 else |
4084 Actor::Die(uActorID); | |
322 | 4085 Actor::AggroSurroundingPeasants(uActorID, 0); |
0 | 4086 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP; |
4087 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 ) | |
4088 v18 = 10; | |
4089 if ( !MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) | |
4090 { | |
4091 pVelocity->x = (unsigned __int64)(v18 * (signed __int64)pVelocity->x) >> 16; | |
4092 pVelocity->y = (unsigned __int64)(v18 * (signed __int64)pVelocity->y) >> 16; | |
4093 pVelocity->z = (unsigned __int64)(v18 * (signed __int64)pVelocity->z) >> 16; | |
4094 v7->vVelocity.x = 50 * LOWORD(pVelocity->x); | |
4095 v7->vVelocity.y = 50 * LOWORD(pVelocity->y); | |
4096 v7->vVelocity.z = 50 * LOWORD(pVelocity->z); | |
4097 } | |
322 | 4098 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14); |
0 | 4099 } |
4100 else | |
4101 { | |
1060 | 4102 Actor::AI_Stun(uActorID, v17, 0); |
0 | 4103 } |
322 | 4104 return; |
0 | 4105 } |
4106 v13 = v7->pMonsterInfo.uSpell2ID; | |
4107 } | |
4108 v12 = LOBYTE(pSpellStats->pInfos[v13].uSchool); | |
4109 goto LABEL_30; | |
4110 } | |
4111 v12 = v8->pMonsterInfo.uAttack1Type; | |
4112 goto LABEL_30; | |
4113 } | |
4114 } | |
4115 } | |
4116 } | |
4117 | |
4118 | |
4119 //----- (0043F515) -------------------------------------------------------- | |
657 | 4120 void FindBillboardsLightLevels_BLV() |
0 | 4121 { |
4122 for (uint i = 0; i < uNumBillboardsToDraw; ++i) | |
4123 { | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
4124 auto p = &pBillboardRenderList[i]; |
0 | 4125 |
4126 if (p->field_1E & 2 || uCurrentlyLoadedLevelType == LEVEL_Indoor && !p->uIndoorSectorID) | |
657 | 4127 p->dimming_level = 0; |
0 | 4128 else |
657 | 4129 p->dimming_level = _43F55F_get_billboard_light_level(p, -1); |
0 | 4130 } |
4131 } | |
4132 | |
4133 //----- (0043F55F) -------------------------------------------------------- | |
4134 int __fastcall _43F55F_get_billboard_light_level(RenderBillboard *a1, int uBaseLightLevel) | |
4135 { | |
4136 signed int v3; // ecx@2 | |
4137 | |
4138 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
4139 { | |
4140 v3 = pIndoor->pSectors[a1->uIndoorSectorID].uMinAmbientLightLevel; | |
4141 } | |
4142 else | |
4143 { | |
4144 if ( uBaseLightLevel == -1 ) | |
657 | 4145 v3 = a1->dimming_level; |
0 | 4146 else |
4147 v3 = uBaseLightLevel; | |
4148 } | |
430 | 4149 return _43F5C8_get_point_light_level_with_respect_to_lights(v3, a1->uIndoorSectorID, a1->world_x, a1->world_y, a1->world_z); |
0 | 4150 } |
4151 | |
4152 //----- (0043F5C8) -------------------------------------------------------- | |
4153 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z) | |
4154 { | |
4155 int v5; // esi@1 | |
4156 signed int v6; // edi@1 | |
4157 int v8; // eax@6 | |
4158 int v9; // ebx@6 | |
4159 unsigned int v10; // ecx@6 | |
4160 unsigned int v11; // edx@9 | |
4161 unsigned int v12; // edx@11 | |
4162 signed int v13; // ecx@12 | |
4163 BLVLightMM7 *v16; // esi@20 | |
4164 int v17; // ebx@21 | |
4165 int v18; // eax@24 | |
4166 int v19; // ebx@24 | |
4167 unsigned int v20; // ecx@24 | |
4168 int v21; // edx@25 | |
4169 unsigned int v22; // edx@27 | |
4170 unsigned int v23; // edx@29 | |
4171 signed int v24; // ecx@30 | |
4172 int v26; // ebx@35 | |
4173 int v27; // eax@38 | |
4174 int v28; // ebx@38 | |
4175 unsigned int v29; // ecx@38 | |
4176 int v30; // edx@39 | |
4177 unsigned int v31; // edx@41 | |
4178 unsigned int v32; // edx@43 | |
4179 signed int v33; // ecx@44 | |
4180 int v37; // [sp+Ch] [bp-18h]@37 | |
4181 int v38; // [sp+10h] [bp-14h]@5 | |
4182 int v39; // [sp+10h] [bp-14h]@23 | |
4183 int v40; // [sp+10h] [bp-14h]@36 | |
4184 int v42; // [sp+14h] [bp-10h]@22 | |
4185 unsigned int v43; // [sp+18h] [bp-Ch]@12 | |
4186 unsigned int v44; // [sp+18h] [bp-Ch]@30 | |
4187 unsigned int v45; // [sp+18h] [bp-Ch]@44 | |
4188 | |
4189 v6 = uBaseLightLevel; | |
4190 for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i) | |
4191 { | |
4192 auto p = pMobileLightsStack->pLights + i; | |
4193 | |
4194 auto distX = abs(p->vPosition.x - x); | |
4195 if ( distX <= p->uRadius) | |
4196 { | |
4197 auto distY = abs(p->vPosition.y - y); | |
4198 if ( distY <= p->uRadius) | |
4199 { | |
4200 auto distZ = abs(p->vPosition.z - z); | |
4201 if ( distZ <= p->uRadius) | |
4202 { | |
4203 v8 = distX; | |
4204 v9 = distY; | |
4205 v10 = distZ; | |
4206 if (distX < distY) | |
4207 { | |
4208 v8 = distY; | |
4209 v9 = distX; | |
4210 } | |
4211 if ( v8 < distZ ) | |
4212 { | |
4213 v11 = v8; | |
4214 v8 = distZ; | |
4215 v10 = v11; | |
4216 } | |
4217 if ( v9 < (signed int)v10 ) | |
4218 { | |
4219 v12 = v10; | |
4220 v10 = v9; | |
4221 v9 = v12; | |
4222 } | |
4223 v43 = ((unsigned int)(11 * v9) / 32) + (v10 / 4) + v8; | |
4224 v13 = p->uRadius; | |
4225 if ( (signed int)v43 < v13 ) | |
4226 v6 += ((unsigned __int64)(30i64 * (signed int)(v43 << 16) / v13) >> 16) - 30; | |
4227 } | |
4228 } | |
4229 } | |
4230 } | |
4231 | |
4232 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
4233 { | |
4234 auto pSector = pIndoor->pSectors + uSectorID; | |
4235 | |
4236 for (uint i = 0; i < pSector->uNumLights; ++i) | |
4237 { | |
4238 v16 = pIndoor->pLights + pSector->pLights[i]; | |
4239 if (~v16->uAtributes & 8) | |
4240 { | |
4241 v17 = abs(v16->vPosition.x - x); | |
4242 if ( v17 <= v16->uRadius ) | |
4243 { | |
4244 v42 = abs(v16->vPosition.y - y); | |
4245 if ( v42 <= v16->uRadius ) | |
4246 { | |
4247 v39 = abs(v16->vPosition.z - z); | |
4248 if ( v39 <= v16->uRadius ) | |
4249 { | |
4250 v18 = v17; | |
4251 v19 = v42; | |
4252 v20 = v39; | |
4253 if ( v18 < v42 ) | |
4254 { | |
4255 v21 = v18; | |
4256 v18 = v42; | |
4257 v19 = v21; | |
4258 } | |
4259 if ( v18 < v39 ) | |
4260 { | |
4261 v22 = v18; | |
4262 v18 = v39; | |
4263 v20 = v22; | |
4264 } | |
4265 if ( v19 < (signed int)v20 ) | |
4266 { | |
4267 v23 = v20; | |
4268 v20 = v19; | |
4269 v19 = v23; | |
4270 } | |
4271 v44 = ((unsigned int)(11 * v19) >> 5) + (v20 >> 2) + v18; | |
4272 v24 = v16->uRadius; | |
4273 if ( (signed int)v44 < v24 ) | |
4274 v6 += ((unsigned __int64)(30i64 * (signed int)(v44 << 16) / v24) >> 16) - 30; | |
4275 } | |
4276 } | |
4277 } | |
4278 } | |
4279 } | |
4280 } | |
4281 | |
4282 for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i) | |
4283 { | |
4284 auto p = pStationaryLightsStack->pLights + i; | |
4285 v26 = abs(p->vPosition.x - x); | |
4286 if ( v26 <= p->uRadius) | |
4287 { | |
4288 v40 = abs(p->vPosition.y - y); | |
4289 if ( v40 <= p->uRadius) | |
4290 { | |
4291 v37 = abs(p->vPosition.z - z); | |
4292 if ( v37 <= p->uRadius) | |
4293 { | |
4294 v27 = v26; | |
4295 v28 = v40; | |
4296 v29 = v37; | |
4297 if ( v27 < v40 ) | |
4298 { | |
4299 v30 = v27; | |
4300 v27 = v40; | |
4301 v28 = v30; | |
4302 } | |
4303 if ( v27 < v37 ) | |
4304 { | |
4305 v31 = v27; | |
4306 v27 = v37; | |
4307 v29 = v31; | |
4308 } | |
4309 if ( v28 < (signed int)v29 ) | |
4310 { | |
4311 v32 = v29; | |
4312 v29 = v28; | |
4313 v28 = v32; | |
4314 } | |
4315 v45 = ((unsigned int)(11 * v28) >> 5) + (v29 >> 2) + v27; | |
4316 v33 = p->uRadius; | |
4317 if ( (signed int)v45 < v33 ) | |
4318 v6 += ((unsigned __int64)(30i64 * (signed int)(v45 << 16) / v33) >> 16) - 30; | |
4319 } | |
4320 } | |
4321 } | |
4322 } | |
4323 | |
4324 if ( v6 <= 31 ) | |
4325 { | |
4326 if ( v6 < 0 ) | |
4327 v6 = 0; | |
4328 } | |
4329 else | |
4330 { | |
4331 v6 = 31; | |
4332 } | |
4333 return v6; | |
4334 } | |
4335 | |
4336 | |
4337 //----- (004070EF) -------------------------------------------------------- | |
4338 bool __fastcall sub_4070EF_prolly_collide_objects(unsigned int uObjID, unsigned int uObj2ID) | |
4339 { | |
4340 signed int v2; // eax@1 | |
4341 unsigned int v3; // ecx@1 | |
4342 signed int v4; // esi@1 | |
4343 int v5; // ecx@2 | |
4344 signed int v6; // eax@4 | |
4345 int v7; // eax@4 | |
4346 float v8; // ST24_4@5 | |
4347 double v9; // ST18_8@5 | |
4348 signed int v10; // eax@6 | |
4349 int v11; // ecx@6 | |
4350 signed int v12; // eax@7 | |
4351 int v13; // esi@7 | |
4352 int v14; // esi@8 | |
4353 int v15; // esi@9 | |
4354 signed int v16; // eax@11 | |
4355 int v17; // edi@11 | |
4356 int v18; // esi@11 | |
4357 int v19; // eax@13 | |
4358 float v20; // ST24_4@14 | |
4359 double v21; // ST18_8@14 | |
4360 signed int v22; // eax@15 | |
4361 int v23; // ebx@16 | |
4362 signed int v24; // ecx@16 | |
4363 int v25; // eax@18 | |
4364 int v26; // eax@28 | |
4365 BLVSector *v27; // edx@31 | |
4366 int v28; // ecx@31 | |
4367 BLVFace *v29; // ebx@32 | |
4368 Vec3_short_ *v30; // esi@32 | |
4369 int v31; // eax@32 | |
4370 int v32; // ST50_4@44 | |
4371 int v33; // ST54_4@44 | |
4372 int v34; // eax@44 | |
4373 char v35; // zf@44 | |
4374 int v36; // edi@44 | |
4375 int v37; // eax@45 | |
4376 signed int v38; // esi@45 | |
4377 int v39; // ST4C_4@49 | |
4378 signed __int64 v40; // qtt@50 | |
4379 __int16 v42; // bx@58 | |
4380 int v43; // [sp-8h] [bp-70h]@11 | |
4381 int v44; // [sp-4h] [bp-6Ch]@11 | |
4382 int v45; // [sp+Ch] [bp-5Ch]@32 | |
4383 __int16 v46; // [sp+10h] [bp-58h]@32 | |
4384 int v47; // [sp+18h] [bp-50h]@20 | |
4385 int v48; // [sp+1Ch] [bp-4Ch]@20 | |
4386 int v49; // [sp+20h] [bp-48h]@20 | |
4387 int v50; // [sp+24h] [bp-44h]@16 | |
4388 signed int v51; // [sp+24h] [bp-44h]@27 | |
4389 signed int v52; // [sp+28h] [bp-40h]@26 | |
4390 signed int v53; // [sp+2Ch] [bp-3Ch]@23 | |
4391 signed int v54; // [sp+30h] [bp-38h]@22 | |
4392 signed int v55; // [sp+34h] [bp-34h]@21 | |
4393 signed int v56; // [sp+38h] [bp-30h]@20 | |
4394 signed int v57; // [sp+3Ch] [bp-2Ch]@28 | |
4395 int v58; // [sp+44h] [bp-24h]@50 | |
4396 int v59; // [sp+48h] [bp-20h]@44 | |
4397 int v60; // [sp+50h] [bp-18h]@11 | |
4398 signed int v61; // [sp+50h] [bp-18h]@31 | |
4399 int v62; // [sp+54h] [bp-14h]@16 | |
4400 int v63; // [sp+58h] [bp-10h]@4 | |
4401 int v64; // [sp+5Ch] [bp-Ch]@4 | |
4402 int v65; // [sp+60h] [bp-8h]@4 | |
4403 int v66; // [sp+64h] [bp-4h]@7 | |
4404 | |
848 | 4405 v2 = PID_ID(uObjID); |
4406 v3 = PID_TYPE(uObjID) - 2; | |
0 | 4407 v4 = uObj2ID; |
4408 if ( v3 ) | |
4409 { | |
4410 v5 = v3 - 1; | |
4411 if ( v5 ) | |
4412 { | |
4413 if ( v5 != 2 ) | |
4414 return 0; | |
4415 v6 = v2; | |
4416 v63 = pLevelDecorations[v6].vPosition.x; | |
4417 v64 = pLevelDecorations[v6].vPosition.y; | |
4418 v65 = pLevelDecorations[v6].vPosition.z; | |
4419 v7 = pIndoor->GetSector(v63, v64, v65); | |
4420 } | |
4421 else | |
4422 { | |
4423 v63 = pActors[v2].vPosition.x; | |
4424 v64 = pActors[v2].vPosition.y; | |
4425 v8 = (double)pActors[v2].uActorHeight * 0.69999999; | |
4426 v9 = v8 + 6.7553994e15; | |
4427 v65 = LODWORD(v9) + pActors[v2].vPosition.z; | |
4428 v7 = pActors[v2].uSectorID; | |
4429 } | |
4430 } | |
4431 else | |
4432 { | |
4433 v10 = v2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4434 v63 = pSpriteObjects[v10].vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4435 v64 = pSpriteObjects[v10].vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4436 v11 = pSpriteObjects[v10].vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4437 v7 = pSpriteObjects[v10].uSectorID; |
0 | 4438 v65 = v11; |
4439 } | |
4440 v66 = v7; | |
848 | 4441 v12 = PID_ID(v4); |
4442 v13 = PID_TYPE(v4) - 2; | |
0 | 4443 if ( v13 ) |
4444 { | |
4445 v14 = v13 - 1; | |
4446 if ( v14 ) | |
4447 { | |
4448 v15 = v14 - 1; | |
4449 if ( v15 ) | |
4450 { | |
4451 if ( v15 != 1 ) | |
4452 return 0; | |
4453 v16 = v12; | |
4454 v17 = pLevelDecorations[v16].vPosition.z; | |
4455 v18 = pLevelDecorations[v16].vPosition.x; | |
4456 v44 = pLevelDecorations[v16].vPosition.z; | |
4457 v60 = pLevelDecorations[v16].vPosition.y; | |
4458 v43 = pLevelDecorations[v16].vPosition.y; | |
4459 } | |
4460 else | |
4461 { | |
4462 v18 = pParty->vPosition.x; | |
4463 v17 = pParty->sEyelevel + pParty->vPosition.z; | |
4464 v60 = pParty->vPosition.y; | |
4465 v44 = pParty->sEyelevel + pParty->vPosition.z; | |
4466 v43 = pParty->vPosition.y; | |
4467 } | |
4468 v19 = pIndoor->GetSector(v18, v43, v44); | |
4469 } | |
4470 else | |
4471 { | |
4472 v60 = pActors[v12].vPosition.y; | |
4473 v18 = pActors[v12].vPosition.x; | |
4474 v20 = (double)pActors[v12].uActorHeight * 0.69999999; | |
4475 v21 = v20 + 6.7553994e15; | |
4476 v17 = LODWORD(v21) + pActors[v12].vPosition.z; | |
4477 v19 = pActors[v12].uSectorID; | |
4478 } | |
4479 } | |
4480 else | |
4481 { | |
4482 v22 = v12; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4483 v18 = pSpriteObjects[v22].vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4484 v17 = pSpriteObjects[v22].vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4485 v60 = pSpriteObjects[v22].vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
513
diff
changeset
|
4486 v19 = pSpriteObjects[v22].uSectorID; |
0 | 4487 } |
4488 v62 = v19; | |
4489 v23 = v18 - v63; | |
4490 v50 = v17 - v65; | |
295 | 4491 v24 = integer_sqrt(v23 * v23 + (v60 - v64) * (v60 - v64) + v50 * v50); |
0 | 4492 if ( v24 > 5120 ) |
4493 return 0; | |
4494 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4495 return 1; | |
4496 v25 = 65536; | |
4497 if ( v24 ) | |
4498 v25 = 65536 / v24; | |
4499 v49 = v23 * v25; | |
4500 v47 = v50 * v25; | |
4501 v48 = (v60 - v64) * v25; | |
4502 v56 = v63; | |
4503 if ( v63 < v18 ) | |
4504 { | |
4505 v55 = v18; | |
4506 } | |
4507 else | |
4508 { | |
4509 v56 = v18; | |
4510 v55 = v63; | |
4511 } | |
4512 v54 = v64; | |
4513 if ( v64 < v60 ) | |
4514 { | |
4515 v53 = v60; | |
4516 } | |
4517 else | |
4518 { | |
4519 v54 = v60; | |
4520 v53 = v64; | |
4521 } | |
4522 v52 = v65; | |
4523 if ( v65 < v17 ) | |
4524 { | |
4525 v51 = v17; | |
4526 } | |
4527 else | |
4528 { | |
4529 v52 = v17; | |
4530 v51 = v65; | |
4531 } | |
4532 v57 = 0; | |
4533 v26 = v66; | |
4534 while ( 2 ) | |
4535 { | |
4536 if ( v26 == v62 ) | |
4537 return 1; | |
4538 if ( v57 >= 30 || (v27 = pIndoor->pSectors, v28 = v66, v61 = 0, pIndoor->pSectors[v66].uNumPortals <= 0) ) | |
4539 break; | |
4540 while ( 1 ) | |
4541 { | |
4542 v29 = &pIndoor->pFaces[v27[v28].pPortals[v61]]; | |
4543 v30 = &pIndoor->pVertices[*v29->pVertexIDs]; | |
4544 v45 = *(int *)&v30->x; | |
4545 v46 = v30->z; | |
4546 v31 = v29->pFacePlane_old.vNormal.z * (v46 - v65) | |
4547 + v29->pFacePlane_old.vNormal.y * (SHIWORD(v45) - v64) | |
4548 + v29->pFacePlane_old.vNormal.x * ((signed __int16)v45 - v63); | |
4549 if ( v66 != v29->uSectorID ) | |
4550 v31 = -v31; | |
4551 if ( v31 >= 0 && (signed __int16)v45 != v63 && SHIWORD(v45) != v64 && v46 != v65 | |
4552 || v56 > v29->pBounding.x2 | |
4553 || v55 < v29->pBounding.x1 | |
4554 || v54 > v29->pBounding.y2 | |
4555 || v53 < v29->pBounding.y1 | |
4556 || v52 > v29->pBounding.z2 | |
4557 || v51 < v29->pBounding.z1 ) | |
4558 goto LABEL_54; | |
4559 v32 = (unsigned __int64)(v49 * (signed __int64)v29->pFacePlane_old.vNormal.x) >> 16; | |
4560 v33 = (unsigned __int64)(v47 * (signed __int64)v29->pFacePlane_old.vNormal.z) >> 16; | |
4561 v34 = (unsigned __int64)(v48 * (signed __int64)v29->pFacePlane_old.vNormal.y) >> 16; | |
4562 v35 = v32 + v33 + v34 == 0; | |
4563 v36 = v32 + v33 + v34; | |
4564 v59 = v32 + v33 + v34; | |
4565 if ( v35 ) | |
4566 goto LABEL_53; | |
4567 v37 = v65 * v29->pFacePlane_old.vNormal.z; | |
4568 v38 = -(v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y); | |
4569 if ( v36 <= 0 ) | |
4570 break; | |
4571 if ( v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y <= 0 ) | |
4572 goto LABEL_49; | |
4573 LABEL_53: | |
4574 v27 = pIndoor->pSectors; | |
4575 LABEL_54: | |
4576 ++v61; | |
4577 if ( v61 >= v27[v28].uNumPortals ) | |
4578 goto LABEL_55; | |
4579 } | |
4580 if ( v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y < 0 ) | |
4581 goto LABEL_53; | |
4582 LABEL_49: | |
4583 v39 = abs(-(v29->pFacePlane_old.dist | |
4584 + v37 | |
4585 + v63 * v29->pFacePlane_old.vNormal.x | |
4586 + v64 * v29->pFacePlane_old.vNormal.y)) >> 14; | |
4587 if ( v39 > abs(v36) | |
4588 || (LODWORD(v40) = v38 << 16, HIDWORD(v40) = v38 >> 16, v58 = v40 / v59, (signed int)(v40 / v59) < 0) | |
4589 || !sub_4075DB( | |
4590 v63 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v49) >> 16) + 32768) >> 16), | |
4591 v64 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v48) >> 16) + 32768) >> 16), | |
4592 v65 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v47) >> 16) + 32768) >> 16), | |
4593 v29) ) | |
4594 { | |
4595 v28 = v66; | |
4596 goto LABEL_53; | |
4597 } | |
4598 if ( v29->uSectorID == v66 ) | |
4599 v42 = v29->uBackSectorID; | |
4600 else | |
4601 v42 = v29->uSectorID; | |
4602 v26 = v42; | |
4603 if ( v42 != v66 ) | |
4604 { | |
4605 ++v57; | |
4606 v66 = v42; | |
4607 continue; | |
4608 } | |
4609 break; | |
4610 } | |
4611 LABEL_55: | |
4612 if ( v66 != v62 ) | |
4613 return 0; | |
4614 return 1; | |
4615 } | |
4616 | |
4617 //----- (004075DB) -------------------------------------------------------- | |
4618 bool __fastcall sub_4075DB(int a1, int a2, int a3, BLVFace *a4) | |
4619 { | |
4620 BLVFace *v4; // eax@1 | |
4621 unsigned int v5; // esi@1 | |
4622 signed int v6; // esi@2 | |
4623 char v7; // zf@2 | |
4624 int v8; // edi@2 | |
4625 Vec3_short_ *v9; // ecx@3 | |
4626 int v10; // edx@4 | |
4627 signed int v11; // esi@7 | |
4628 Vec3_short_ *v12; // ecx@8 | |
4629 int v13; // edx@9 | |
4630 signed int v14; // esi@11 | |
4631 Vec3_short_ *v15; // ecx@12 | |
4632 int v16; // edx@13 | |
4633 int v17; // eax@14 | |
4634 bool v18; // esi@14 | |
4635 int v19; // ecx@14 | |
4636 int v20; // ecx@16 | |
4637 int v21; // edx@16 | |
4638 int v22; // eax@17 | |
4639 signed int v23; // ebx@18 | |
4640 int v24; // esi@20 | |
4641 signed int v25; // eax@22 | |
4642 signed __int64 v26; // qtt@22 | |
4643 bool result; // eax@25 | |
4644 int v28; // [sp+8h] [bp-14h]@14 | |
4645 int v29; // [sp+10h] [bp-Ch]@14 | |
4646 signed int a3a; // [sp+24h] [bp+8h]@14 | |
4647 int a4a; // [sp+28h] [bp+Ch]@2 | |
4648 | |
4649 v4 = a4; | |
4650 v5 = a4->uAttributes; | |
4651 if ( v5 & 0x100 ) | |
4652 { | |
4653 v6 = 0; | |
4654 v7 = a4->uNumVertices == 0; | |
4655 a4a = a1; | |
4656 v8 = a2; | |
4657 if ( !v7 ) | |
4658 { | |
4659 v9 = pIndoor->pVertices; | |
4660 do | |
4661 { | |
4662 dword_4F5D98_xs[v6] = v9[v4->pVertexIDs[v6]].x; | |
4663 v10 = v4->pVertexIDs[v6++]; | |
4664 dword_4F5CC4_ys[v6] = v9[v10].y; | |
4665 } | |
4666 while ( v6 < v4->uNumVertices ); | |
4667 } | |
4668 } | |
4669 else | |
4670 { | |
4671 v8 = a3; | |
4672 if ( v5 & 0x200 ) | |
4673 { | |
4674 v11 = 0; | |
4675 v7 = a4->uNumVertices == 0; | |
4676 a4a = a1; | |
4677 if ( !v7 ) | |
4678 { | |
4679 v12 = pIndoor->pVertices; | |
4680 do | |
4681 { | |
4682 dword_4F5D98_xs[v11] = v12[v4->pVertexIDs[v11]].x; | |
4683 v13 = v4->pVertexIDs[v11++]; | |
4684 dword_4F5CC4_ys[v11] = v12[v13].z; | |
4685 } | |
4686 while ( v11 < v4->uNumVertices ); | |
4687 } | |
4688 } | |
4689 else | |
4690 { | |
4691 v14 = 0; | |
4692 v7 = a4->uNumVertices == 0; | |
4693 a4a = a2; | |
4694 if ( !v7 ) | |
4695 { | |
4696 v15 = pIndoor->pVertices; | |
4697 do | |
4698 { | |
4699 dword_4F5D98_xs[v14] = v15[v4->pVertexIDs[v14]].y; | |
4700 v16 = v4->pVertexIDs[v14++]; | |
4701 dword_4F5CC4_ys[v14] = v15[v16].z; | |
4702 } | |
4703 while ( v14 < v4->uNumVertices ); | |
4704 } | |
4705 } | |
4706 } | |
4707 v17 = v4->uNumVertices; | |
4708 a3a = 0; | |
4709 dword_4F5D98_xs[v17] = dword_4F5D98_xs[0]; | |
4710 dword_4F5CC4_ys[v17 + 1] = dword_4F5CC4_ys[1]; | |
4711 v28 = v17; | |
4712 v18 = dword_4F5CC4_ys[1] >= v8; | |
4713 v19 = 0; | |
4714 v29 = 0; | |
4715 if ( v17 <= 0 ) | |
4716 goto LABEL_29; | |
4717 do | |
4718 { | |
4719 if ( a3a >= 2 ) | |
4720 break; | |
4721 v20 = v19; | |
4722 v21 = dword_4F5CC4_ys[v20 + 2]; | |
1110 | 4723 if ( v18 ^ (v21 >= v8) ) |
0 | 4724 { |
4725 v22 = dword_4F5D98_xs[v20 + 1]; | |
4726 if ( v22 >= a4a ) | |
4727 v23 = 0; | |
4728 else | |
4729 v23 = 2; | |
1110 | 4730 v24 = v23 | (dword_4F5D98_xs[v20] < a4a); |
0 | 4731 if ( v24 != 3 ) |
4732 { | |
4733 if ( !v24 | |
4734 || (v25 = v22 - dword_4F5D98_xs[v20], | |
4735 LODWORD(v26) = v25 << 16, | |
4736 HIDWORD(v26) = v25 >> 16, | |
4737 dword_4F5D98_xs[v20] | |
4738 + ((signed int)(((unsigned __int64)(v26 | |
4739 / (v21 - dword_4F5CC4_ys[v20 + 1]) | |
4740 * ((v8 - dword_4F5CC4_ys[v20 + 1]) << 16)) >> 16) | |
4741 + 32768) >> 16) >= a4a) ) | |
4742 ++a3a; | |
4743 } | |
4744 } | |
4745 v18 = v21 >= v8; | |
4746 v19 = v29++ + 1; | |
4747 } | |
4748 while ( v29 < v28 ); | |
4749 result = 1; | |
4750 if ( a3a != 1 ) | |
4751 LABEL_29: | |
4752 result = 0; | |
4753 return result; | |
4754 } | |
4755 | |
4756 //----- (004077F1) -------------------------------------------------------- | |
4757 bool __fastcall sub_4077F1(int a1, int a2, int a3, ODMFace *a4, BSPVertexBuffer *a5) | |
4758 { | |
4759 ODMFace *v5; // eax@1 | |
4760 unsigned int v6; // esi@1 | |
4761 signed int v7; // edi@1 | |
4762 char v8; // zf@2 | |
4763 unsigned __int16 *v9; // edx@3 | |
4764 int v10; // ecx@4 | |
4765 unsigned __int16 *v11; // edx@8 | |
4766 int v12; // ecx@9 | |
4767 int v13; // edx@12 | |
4768 int v14; // ecx@13 | |
4769 int v15; // esi@14 | |
4770 bool v16; // edi@14 | |
4771 int v17; // ecx@16 | |
4772 int v18; // edx@16 | |
4773 int v19; // eax@17 | |
4774 signed int v20; // ebx@18 | |
4775 int v21; // edi@20 | |
4776 signed int v22; // eax@22 | |
4777 signed __int64 v23; // qtt@22 | |
4778 bool result; // eax@25 | |
4779 int v25; // [sp+14h] [bp-8h]@14 | |
4780 int a4a; // [sp+28h] [bp+Ch]@2 | |
4781 signed int a5a; // [sp+2Ch] [bp+10h]@14 | |
4782 | |
4783 v5 = a4; | |
4784 v6 = a4->uAttributes; | |
4785 v7 = 0; | |
4786 if ( v6 & 0x100 ) | |
4787 { | |
4788 v8 = a4->uNumVertices == 0; | |
4789 a4a = a1; | |
4790 a3 = a2; | |
4791 if ( !v8 ) | |
4792 { | |
4793 v9 = v5->pVertexIDs; | |
4794 do | |
4795 { | |
4796 ++v7; | |
4797 dword_4F5BF4_xs[v7] = a5->pVertices[*v9].x; | |
4798 v10 = *v9; | |
4799 ++v9; | |
4800 dword_4F5B24_ys[v7] = a5->pVertices[v10].y; | |
4801 } | |
4802 while ( v7 < v5->uNumVertices ); | |
4803 } | |
4804 } | |
4805 else | |
4806 { | |
4807 if ( v6 & 0x200 ) | |
4808 { | |
4809 v8 = a4->uNumVertices == 0; | |
4810 a4a = a1; | |
4811 if ( !v8 ) | |
4812 { | |
4813 v11 = v5->pVertexIDs; | |
4814 do | |
4815 { | |
4816 ++v7; | |
4817 dword_4F5BF4_xs[v7] = a5->pVertices[*v11].x; | |
4818 v12 = *v11; | |
4819 ++v11; | |
4820 dword_4F5B24_ys[v7] = a5->pVertices[v12].z; | |
4821 } | |
4822 while ( v7 < v5->uNumVertices ); | |
4823 } | |
4824 } | |
4825 else | |
4826 { | |
4827 v8 = a4->uNumVertices == 0; | |
4828 a4a = a2; | |
4829 if ( !v8 ) | |
4830 { | |
4831 v13 = (int)v5->pVertexIDs; | |
4832 do | |
4833 { | |
4834 ++v7; | |
4835 dword_4F5BF4_xs[v7] = a5->pVertices[*(short *)v13].y; | |
4836 v14 = *(short *)v13; | |
4837 v13 += 2; | |
4838 dword_4F5B24_ys[v7] = a5->pVertices[v14].z; | |
4839 } | |
4840 while ( v7 < v5->uNumVertices ); | |
4841 } | |
4842 } | |
4843 } | |
4844 v15 = v5->uNumVertices; | |
4845 a5a = 0; | |
4846 dword_4F5BF4_xs[v15 + 1] = dword_4F5BF4_xs[1]; | |
4847 dword_4F5B24_ys[v15 + 1] = dword_4F5B24_ys[1]; | |
4848 v25 = 0; | |
4849 v16 = dword_4F5B24_ys[1] >= a3; | |
4850 if ( v15 <= 0 ) | |
4851 goto LABEL_29; | |
4852 do | |
4853 { | |
4854 if ( a5a >= 2 ) | |
4855 break; | |
4856 v17 = v25; | |
4857 v18 = dword_4F5B24_ys[v25 + 2]; | |
1110 | 4858 if ( v16 ^ (v18 >= a3) ) |
0 | 4859 { |
4860 v19 = dword_4F5BF4_xs[v17 + 2]; | |
4861 if ( v19 >= a4a ) | |
4862 v20 = 0; | |
4863 else | |
4864 v20 = 2; | |
1110 | 4865 v21 = v20 | (dword_4F5BF4_xs[v17 + 1] < a4a); |
0 | 4866 if ( v21 != 3 ) |
4867 { | |
4868 if ( !v21 | |
4869 || (v22 = v19 - dword_4F5BF4_xs[v17 + 1], | |
4870 LODWORD(v23) = v22 << 16, | |
4871 HIDWORD(v23) = v22 >> 16, | |
4872 dword_4F5BF4_xs[v17 + 1] | |
4873 + ((signed int)(((unsigned __int64)(v23 | |
4874 / (v18 - dword_4F5B24_ys[v17 + 1]) | |
4875 * ((a3 - dword_4F5B24_ys[v17 + 1]) << 16)) >> 16) | |
4876 + 32768) >> 16) >= a4a) ) | |
4877 ++a5a; | |
4878 } | |
4879 } | |
4880 ++v25; | |
4881 v16 = v18 >= a3; | |
4882 } | |
4883 while ( v25 < v15 ); | |
4884 result = 1; | |
4885 if ( a5a != 1 ) | |
4886 LABEL_29: | |
4887 result = 0; | |
4888 return result; | |
4889 } | |
4890 | |
4891 //----- (004088E9) -------------------------------------------------------- | |
4892 signed int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6) | |
4893 { | |
4894 int v6; // esi@1 | |
4895 int v7; // edi@1 | |
4896 int v8; // eax@1 | |
4897 signed int result; // eax@1 | |
4898 int v10; // [sp+Ch] [bp-4h]@1 | |
4899 int v11; // [sp+18h] [bp+8h]@1 | |
4900 | |
4901 v6 = a1; | |
4902 v10 = a2; | |
4903 v7 = a3 - a1; | |
4904 v11 = abs(a3 - a1); | |
4905 v8 = abs(a4 - v10); | |
295 | 4906 result = integer_sqrt(v11 * v11 + v8 * v8); |
0 | 4907 if ( result ) |
4908 result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result); | |
4909 return result; | |
4910 } | |
4911 | |
4912 //----- (0040DEF3) -------------------------------------------------------- | |
949 | 4913 unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b ) |
983 | 4914 { |
688 | 4915 return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) + |
4916 LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) + | |
4917 LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8)); | |
0 | 4918 } |
4919 | |
4920 //----- (0040DFA7) -------------------------------------------------------- | |
4921 int __stdcall retzero_sub_40DFA7(int a1) | |
4922 { | |
4923 return 0; | |
4924 } | |
4925 // 40DFA7: using guessed type int __stdcall retzero_sub_40DFA7(int); | |
4926 | |
1184 | 4927 |
0 | 4928 |
4929 //----- (0040F82D) -------------------------------------------------------- | |
4930 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | |
4931 { | |
973 | 4932 assert(uTextureId != -1); |
4933 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue); | |
0 | 4934 } |
4935 | |
1160 | 4936 |
0 | 4937 |
4938 //----- (0040F89C) -------------------------------------------------------- | |
4939 void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue) | |
4940 { | |
4941 void *v3; // eax@3 | |
4942 void *v4; // esi@5 | |
4943 int *v5; // edi@5 | |
4944 int v6; // eax@5 | |
4945 int v7; // ecx@6 | |
4946 Texture *v8; // [sp+Ch] [bp-14h]@1 | |
4947 int *v9; // [sp+10h] [bp-10h]@1 | |
4948 int v10; // [sp+14h] [bp-Ch]@1 | |
4949 int v11; // [sp+18h] [bp-8h]@1 | |
4950 void *v12; // [sp+1Ch] [bp-4h]@5 | |
4951 | |
4952 v10 = pTex->uTextureWidth; | |
4953 v8 = pTex; | |
4954 v9 = pZBuffer; | |
4955 v11 = pTex->uTextureHeight; | |
4956 if ( pIcons_LOD->dword_011BA4 && pTex->uDecompressedSize ) | |
4957 v3 = pTex->UnzipPalette(); | |
4958 else | |
710 | 4959 v3 = pTex->pLevelOfDetail0_prolly_alpha_mask; |
0 | 4960 v12 = v3; |
4961 v4 = v3; | |
4962 v5 = v9; | |
4963 v6 = 0; | |
4964 do | |
4965 { | |
4966 v7 = v10; | |
4967 do | |
4968 { | |
4969 LOBYTE(v6) = *(char *)v4; | |
4970 v4 = (char *)v4 + 1; | |
4971 if ( v6 ) | |
4972 *v5 = uZValue; | |
4973 ++v5; | |
4974 --v7; | |
4975 } | |
4976 while ( v7 ); | |
4977 v5 += 640 - v10; | |
4978 --v11; | |
4979 } | |
4980 while ( v11 ); | |
4981 if ( pIcons_LOD->dword_011BA4 ) | |
4982 { | |
4983 if ( v8->uDecompressedSize ) | |
4984 free(v12); | |
4985 } | |
4986 } | |
4987 | |
4988 //----- (0040F92A) -------------------------------------------------------- | |
4989 void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3) | |
4990 { | |
4991 Texture *v3; // esi@1 | |
4992 void *v4; // eax@3 | |
4993 int *v5; // edi@5 | |
4994 int v6; // ecx@6 | |
4995 int *v7; // [sp+Ch] [bp-10h]@1 | |
4996 int v8; // [sp+10h] [bp-Ch]@1 | |
4997 int v9; // [sp+18h] [bp-4h]@1 | |
4998 | |
4999 v3 = a2; | |
5000 v7 = pZBuffer; | |
5001 v8 = a2->uTextureWidth; | |
5002 v9 = a2->uTextureHeight; | |
5003 if ( pIcons_LOD->dword_011BA4 && a2->uDecompressedSize ) | |
5004 v4 = a2->UnzipPalette(); | |
5005 else | |
710 | 5006 v4 = a2->pLevelOfDetail0_prolly_alpha_mask; |
0 | 5007 v5 = v7; |
5008 do | |
5009 { | |
5010 v6 = v8; | |
5011 do | |
5012 { | |
5013 *v5 = a3; | |
5014 ++v5; | |
5015 --v6; | |
5016 } | |
5017 while ( v6 ); | |
5018 v5 += 640 - v8; | |
5019 --v9; | |
5020 } | |
5021 while ( v9 ); | |
5022 if ( pIcons_LOD->dword_011BA4 ) | |
5023 { | |
5024 if ( v3->uDecompressedSize ) | |
5025 free(v4); | |
5026 } | |
5027 } | |
5028 | |
5029 //----- (00410D99) -------------------------------------------------------- | |
5030 signed int __fastcall sub_410D99_get_map_index(int a1) | |
5031 { | |
5032 int v1; // edi@1 | |
5033 signed int v2; // ebp@1 | |
5034 const char **v3; // esi@2 | |
5035 char *v4; // ebx@2 | |
5036 | |
5037 v1 = a1; | |
5038 v2 = 1; | |
1104 | 5039 if ( _stricmp(pMapStats->pInfos[1].pFilename, (const char *)&pGames_LOD->pSubIndices[a1]) ) |
0 | 5040 { |
5041 v3 = (const char **)&pMapStats->pInfos[1].pFilename; | |
5042 v4 = (char *)&pMapStats->pInfos[1].pFilename; | |
5043 do | |
5044 { | |
5045 if ( !*(int *)v4 ) | |
5046 break; | |
5047 v3 += 17; | |
5048 ++v2; | |
5049 v4 = (char *)v3; | |
5050 } | |
1104 | 5051 while ( _stricmp(*v3, (const char *)&pGames_LOD->pSubIndices[v1]) ); |
0 | 5052 } |
5053 return v2; | |
5054 } | |
5055 | |
5056 // 4E28F8: using guessed type int pCurrentScreen; | |
5057 | |
762 | 5058 void LoadFonts_and_DrawCopyrightWindow() |
5059 { | |
5060 MainMenuUI_LoadFontsAndSomeStuff(); | |
5061 DrawCopyrightWindow(); | |
5062 } | |
0 | 5063 |
5064 | |
5065 //----- (00416196) -------------------------------------------------------- | |
1033 | 5066 void identify_item() |
0 | 5067 { |
5068 Player *v0; // esi@2 | |
5069 POINT *v1; // edi@2 | |
5070 signed int v2; // ecx@5 | |
5071 signed int v3; // eax@5 | |
5072 int v4; // eax@5 | |
5073 char v5; // sf@5 | |
5074 int v6; // eax@5 | |
5075 int v7; // eax@7 | |
5076 unsigned __int16 v8; // ax@10 | |
5077 int v9; // edi@10 | |
5078 int v10; // eax@10 | |
5079 int v11; // edx@13 | |
5080 LONG v12; // edx@23 | |
5081 signed int v13; // edx@23 | |
5082 int v14; // edx@25 | |
5083 unsigned int v15; // edi@25 | |
5084 signed int v16; // edx@27 | |
5085 int v17; // eax@54 | |
5086 unsigned int v18; // edx@57 | |
5087 int v19; // eax@65 | |
5088 int v20; // edi@67 | |
5089 int v21; // eax@72 | |
5090 int v22; // ecx@74 | |
5091 int v23; // edx@78 | |
5092 int v24; // eax@79 | |
5093 int v25; // eax@80 | |
5094 int v26; // eax@84 | |
5095 ItemGen *v27; // esi@98 | |
5096 unsigned int v28; // eax@98 | |
5097 ItemGen *v29; // edi@98 | |
5098 unsigned int v30; // ecx@103 | |
5099 double v31; // st7@112 | |
5100 unsigned __int64 v32; // qax@113 | |
5101 unsigned int v33; // ecx@117 | |
5102 int v34; // eax@126 | |
5103 unsigned int v35; // ecx@127 | |
5104 double v36; // st7@132 | |
5105 signed __int64 v37; // qax@135 | |
5106 unsigned int v38; // eax@138 | |
5107 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83 | |
5108 int *v40; // [sp-Ch] [bp-9Ch]@83 | |
5109 int *v41; // [sp-8h] [bp-98h]@83 | |
5110 int *v42; // [sp-4h] [bp-94h]@83 | |
5111 GUIWindow v43; // [sp+Ch] [bp-84h]@137 | |
5112 unsigned int pY; // [sp+60h] [bp-30h]@2 | |
5113 int v45; // [sp+64h] [bp-2Ch]@10 | |
5114 unsigned int pX; // [sp+68h] [bp-28h]@2 | |
5115 int v47; // [sp+6Ch] [bp-24h]@25 | |
5116 POINT y; // [sp+70h] [bp-20h]@2 | |
5117 POINT a2; // [sp+78h] [bp-18h]@2 | |
5118 Vec3_int_ pOut; // [sp+80h] [bp-10h]@2 | |
5119 unsigned int v51; // [sp+8Ch] [bp-4h]@23 | |
5120 | |
5121 if ( dword_50CDCC ) | |
5122 return; | |
5123 v0 = pPlayers[uActiveCharacter]; | |
5124 v1 = pMouse->GetCursorPos(&a2); | |
5125 pOut.z = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&y)->y]] & 0xFFFF; | |
5126 pMouse->GetClickPos(&pX, &pY); | |
5127 if ( !pOut.z ) | |
5128 { | |
5129 if ( (signed int)pX <= 13 | |
5130 || (signed int)pX >= 462 | |
5131 || (v2 = pX - 14, | |
5132 v3 = pY - 17, | |
5133 pX = v2, | |
5134 pY = v3, | |
5135 v4 = 14 * (v3 >> 5), | |
5136 v2 >>= 5, | |
5137 v5 = v2 + v4 < 0, | |
5138 v6 = v2 + v4, | |
5139 pOut.z = v6, | |
5140 v5) | |
5141 || v6 > 126 | |
5142 || (v7 = v0->GetItemIDAtInventoryIndex(&pOut.z)) == 0 ) | |
5143 return; | |
5144 pOut.z = v7; | |
5145 } | |
5146 if ( !v0->CanAct() ) | |
5147 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
5148 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
|
5149 v43.Hint = pTmpBuf.data(); |
0 | 5150 v43.uFrameWidth = 384; |
5151 v43.uFrameHeight = 180; | |
5152 v43.uFrameY = 40; | |
5153 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
5154 v38 = pMouse->GetCursorPos(&a2)->x + 30; | |
5155 else | |
5156 v38 = pMouse->GetCursorPos(&a2)->x - 414; | |
5157 v43.uFrameX = v38; | |
5158 v43.DrawMessageBox(0); | |
5159 return; | |
5160 } | |
5161 --pOut.z; | |
5162 LOBYTE(v8) = v0->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY); | |
5163 v9 = v8 & 0x3F; | |
5164 v45 = v8 & 0x3F; | |
5165 pOut.y = SkillToMastery(v8); | |
5166 v10 = pOut.z; | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1340
diff
changeset
|
5167 if ( pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE ) |
0 | 5168 { |
5169 LABEL_116: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5170 GameUI_DrawItemInfo(&v0->pInventoryItemList[v10]); |
0 | 5171 return; |
5172 } | |
5173 if ( (signed int)pParty->pPickedItem.uItemID < 200 | |
5174 || (signed int)pParty->pPickedItem.uItemID > 219 | |
5175 || (v11 = (int)((char *)v0 + 36 * pOut.z), *(int *)(v11 + 532) != 220) ) | |
5176 { | |
5177 if ( (signed int)pParty->pPickedItem.uItemID < 221 | |
5178 || (signed int)pParty->pPickedItem.uItemID > 271 | |
5179 || (v12 = (LONG)((char *)v0 + 36 * pOut.z), a2.y = v12, v13 = *(int *)(v12 + 532), v51 = v13, v13 < 221) | |
5180 || v13 > 271 ) | |
5181 { | |
5182 if ( pParty->pPickedItem.uItemID != 236 | |
5183 && ((signed int)pParty->pPickedItem.uItemID < 246 || (signed int)pParty->pPickedItem.uItemID > 250) | |
5184 && pParty->pPickedItem.uItemID != 263 | |
5185 && pParty->pPickedItem.uItemID != 233 ) | |
5186 goto LABEL_116; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5187 v27 = &v0->pInventoryItemList[pOut.z]; |
0 | 5188 v28 = v27->uItemID; |
5189 v51 = pItemsTable->pItems[v27->uItemID].uEquipType; | |
570 | 5190 v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEnchantmentType); |
0 | 5191 if ( pParty->pPickedItem.uItemID != 233 ) |
5192 { | |
5193 if ( pParty->pPickedItem.uItemID == 236 ) | |
5194 { | |
5195 v35 = v27->uAttributes; | |
5196 if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 ) | |
5197 goto LABEL_92; | |
5198 LOWORD(v35) = v35 | 0x210; | |
5199 v27->uAttributes = v35; | |
5200 } | |
5201 else | |
5202 { | |
5203 if ( (signed int)pParty->pPickedItem.uItemID <= 245 ) | |
5204 goto LABEL_92; | |
5205 if ( (signed int)pParty->pPickedItem.uItemID <= 250 ) | |
5206 { | |
5207 v27->UpdateTempBonus(pParty->uTimePlayed); | |
5208 v33 = v27->uItemID; | |
5209 if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65 | |
5210 || (pOut.y = v27->uAttributes, pOut.y & 2) | |
377 | 5211 || v27->uSpecEnchantmentType |
570 | 5212 || v27->uEnchantmentType |
0 | 5213 || v51 && v51 != 1 && v51 != 2 |
5214 || (signed int)v33 >= 500 ) | |
5215 goto LABEL_92; | |
5216 v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4]; | |
5217 a2.y = (int)v29 << 7; | |
5218 v31 = (double)(signed int)((int)v29 << 7); | |
377 | 5219 v27->uSpecEnchantmentType = v34; |
0 | 5220 } |
5221 else | |
5222 { | |
5223 if ( pParty->pPickedItem.uItemID != 263 | |
5224 || (v27->UpdateTempBonus(pParty->uTimePlayed), v30 = v27->uItemID, (signed int)v27->uItemID >= 64) | |
5225 && (signed int)v30 <= 65 | |
5226 || (pOut.y = v27->uAttributes, pOut.y & 2) | |
377 | 5227 || v27->uSpecEnchantmentType |
570 | 5228 || v27->uEnchantmentType |
0 | 5229 || v51 && v51 != 1 && v51 != 2 |
5230 || (signed int)v30 >= 500 ) | |
5231 goto LABEL_92; | |
5232 a2.y = (int)v29 << 7; | |
377 | 5233 v27->uSpecEnchantmentType = 40; |
0 | 5234 v31 = (double)a2.y; |
5235 } | |
5236 v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335); | |
5237 LODWORD(v27->uExpireTime) = v32; | |
5238 LODWORD(v32) = pOut.y; | |
5239 LOBYTE(v32) = LOBYTE(pOut.y) | 0x18; | |
5240 HIDWORD(v27->uExpireTime) = HIDWORD(v32); | |
5241 v27->uAttributes = v32; | |
5242 } | |
984 | 5243 _50C9A8_item_enchantment_timer = 256; |
0 | 5244 goto LABEL_92; |
5245 } | |
570 | 5246 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; |
0 | 5247 if ( v36 < 0.0 ) |
5248 v36 = 0.0; | |
5249 if ( v51 != 12 ) | |
5250 { | |
5251 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
5252 return; | |
5253 } | |
5254 a2.y = v27->uMaxCharges; | |
5255 v37 = (signed __int64)((double)a2.y - v36 * (double)a2.y); | |
5256 v27->uMaxCharges = v37; | |
5257 v27->uNumCharges = (unsigned __int8)v37; | |
5258 goto LABEL_92; | |
5259 } | |
5260 v14 = v13 - 222; | |
5261 v15 = pParty->pPickedItem.uItemID - 222; | |
5262 v47 = v14; | |
5263 y.y = 0; | |
5264 if ( pParty->pPickedItem.uItemID == 221 || v51 == 221 ) | |
5265 { | |
5266 v16 = 5; | |
5267 } | |
5268 else | |
5269 { | |
5270 v16 = *(short *)&pItemsTable->field_EDE0[2 * (v14 + 50 * v15) + 388]; | |
5271 v10 = pOut.z; | |
5272 } | |
5273 v51 = v16; | |
5274 if ( v45 ) | |
5275 { | |
5276 if ( v16 < 225 || v16 > 227 ) | |
5277 { | |
5278 if ( v16 < 228 || v16 > 239 ) | |
5279 { | |
5280 if ( v16 < 240 || v16 > 261 ) | |
5281 { | |
5282 if ( v16 >= 262 && pOut.y != 4 ) | |
5283 { | |
5284 LABEL_53: | |
5285 v51 = 4; | |
5286 goto LABEL_54; | |
5287 } | |
5288 } | |
5289 else | |
5290 { | |
5291 if ( pOut.y <= 2 ) | |
5292 { | |
5293 LABEL_38: | |
5294 v51 = 3; | |
5295 goto LABEL_54; | |
5296 } | |
5297 } | |
5298 } | |
5299 else | |
5300 { | |
5301 if ( pOut.y == 1 ) | |
5302 { | |
5303 LABEL_35: | |
5304 v51 = 2; | |
5305 goto LABEL_54; | |
5306 } | |
5307 } | |
5308 } | |
5309 } | |
5310 else | |
5311 { | |
5312 if ( v16 >= 225 && v16 <= 227 ) | |
5313 { | |
5314 v51 = 1; | |
5315 goto LABEL_54; | |
5316 } | |
5317 if ( v16 >= 228 && v16 <= 239 ) | |
5318 goto LABEL_35; | |
5319 if ( v16 >= 240 && v16 <= 261 ) | |
5320 goto LABEL_38; | |
5321 if ( v16 >= 262 ) | |
5322 goto LABEL_53; | |
5323 } | |
5324 LABEL_54: | |
5325 pOut.y = 0; | |
5326 pOut.x = v10 + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5327 v17 = (int)v0->pInventoryMatrix; |
0 | 5328 while ( *(int *)v17 != pOut.x ) |
5329 { | |
5330 ++pOut.y; | |
5331 v17 += 4; | |
5332 if ( pOut.y >= 126 ) | |
5333 { | |
5334 v18 = y.y; | |
5335 goto LABEL_59; | |
5336 } | |
5337 } | |
5338 v18 = pOut.y; | |
5339 LABEL_59: | |
5340 if ( !v51 ) | |
5341 { | |
5342 LABEL_115: | |
5343 v10 = pOut.z; | |
5344 goto LABEL_116; | |
5345 } | |
5346 if ( v51 == 1 ) | |
5347 { | |
5348 v0->RemoveItemAtInventoryIndex(v18); | |
5349 v26 = rand(); | |
1036 | 5350 v0->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE); |
0 | 5351 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
437 | 5352 |
5353 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1033 | 5354 |
0 | 5355 v42 = (int *)&a2.y; |
5356 v41 = (int *)&y.y; | |
5357 v40 = (int *)&pOut; | |
5358 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
5359 } | |
5360 else | |
5361 { | |
5362 if ( v51 == 2 ) | |
5363 { | |
5364 v0->RemoveItemAtInventoryIndex(v18); | |
5365 v25 = rand(); | |
1036 | 5366 v0->ReceiveDamage(v25 % 71 + 30, DMGT_FIRE); |
0 | 5367 v23 = 1; |
5368 } | |
5369 else | |
5370 { | |
5371 if ( v51 == 3 ) | |
5372 { | |
5373 v0->RemoveItemAtInventoryIndex(v18); | |
5374 v24 = rand(); | |
1036 | 5375 v0->ReceiveDamage(v24 % 201 + 50, DMGT_FIRE); |
0 | 5376 v23 = 5; |
5377 } | |
5378 else | |
5379 { | |
5380 if ( v51 != 4 ) | |
5381 { | |
5382 if ( v51 != 5 ) | |
5383 { | |
1014 | 5384 v19 = v0->AddItem(-1, 0xDCu); |
0 | 5385 if ( v19 ) |
1019 | 5386 // *(int *)&v0->field_1F5[36 * v19 + 15] = 1; |
5387 v0->pOwnItems[v19-1].uAttributes=ITEM_IDENTIFIED; | |
0 | 5388 v20 = v47 + 50 * v15; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5389 v0->pInventoryItemList[pOut.z].uItemID = v51; |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5390 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
|
5391 + v0->pInventoryItemList[pOut.z].uEnchantmentType) |
0 | 5392 / 2; |
222 | 5393 v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168 + 388 |
0 | 5394 LABEL_74: |
5395 v22 = (int)((char *)v0 + 36 * pOut.z); | |
222 | 5396 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) ) |
0 | 5397 *(int *)(v22 + 552) |= 1u; |
5398 if ( !dword_4E455C ) | |
5399 goto LABEL_92; | |
187 | 5400 v0->PlaySound(SPEECH_16, 0); |
0 | 5401 goto LABEL_91; |
5402 } | |
5403 if ( v45 ) | |
5404 { | |
5405 if ( *(int *)(a2.y + 532) == 221 ) | |
5406 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; | |
5407 else | |
570 | 5408 *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType; |
1014 | 5409 v21 = v0->AddItem(-1, 0xDCu); |
0 | 5410 if ( v21 ) |
1019 | 5411 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1; |
5412 v0->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED; | |
0 | 5413 goto LABEL_74; |
5414 } | |
5415 goto LABEL_115; | |
5416 } | |
5417 v0->RemoveItemAtInventoryIndex(v18); | |
5418 v0->SetCondition(0x10u, 0); | |
5419 v23 = 0; | |
5420 } | |
5421 } | |
1012 | 5422 v0->ItemsEnchant(v23); |
0 | 5423 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
437 | 5424 |
5425 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1033 | 5426 |
0 | 5427 v42 = (int *)&a2.y; |
5428 v41 = (int *)&y.y; | |
5429 v40 = (int *)&pOut; | |
5430 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
5431 } | |
5432 *(_QWORD *)&v39.x = *(_QWORD *)&pParty->vPosition.x; | |
5433 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, v40, v41, v42); | |
5434 sub_42F7EB_DropItemAt(0x41Bu, pOut.x, y.y, a2.y, 0, 1, 0, 0, 0); | |
5435 if ( dword_4E455C ) | |
5436 { | |
5437 if ( v0->CanAct() ) | |
187 | 5438 v0->PlaySound(SPEECH_17, 0); |
0 | 5439 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u); |
5440 LABEL_91: | |
5441 dword_4E455C = 0; | |
5442 } | |
5443 LABEL_92: | |
5444 pMouse->RemoveHoldingItem(); | |
5445 dword_50CDCC = 1; | |
5446 return; | |
5447 } | |
5448 *(int *)(v11 + 536) = v9 + pItemsTable->pItems[pParty->pPickedItem.uItemID].uDamageDice; | |
5449 switch ( pParty->pPickedItem.uItemID ) | |
5450 { | |
5451 case 0xC8u: | |
5452 case 0xC9u: | |
5453 case 0xCAu: | |
5454 case 0xCBu: | |
5455 case 0xCCu: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5456 v0->pInventoryItemList[pOut.z].uItemID = 222; |
0 | 5457 break; |
5458 case 0xCDu: | |
5459 case 0xCEu: | |
5460 case 0xCFu: | |
5461 case 0xD0u: | |
5462 case 0xD1u: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5463 v0->pInventoryItemList[pOut.z].uItemID = 223; |
0 | 5464 break; |
5465 case 0xD2u: | |
5466 case 0xD3u: | |
5467 case 0xD4u: | |
5468 case 0xD5u: | |
5469 case 0xD6u: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5470 v0->pInventoryItemList[pOut.z].uItemID = 224; |
0 | 5471 break; |
5472 case 0xD7u: | |
5473 case 0xD8u: | |
5474 case 0xD9u: | |
5475 case 0xDAu: | |
5476 case 0xDBu: | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1361
diff
changeset
|
5477 v0->pInventoryItemList[pOut.z].uItemID = 221; |
0 | 5478 break; |
5479 default: | |
5480 break; | |
5481 } | |
5482 pMouse->RemoveHoldingItem(); | |
5483 dword_50CDCC = 1; | |
5484 if ( dword_4E455C ) | |
5485 { | |
187 | 5486 v0->PlaySound(SPEECH_16, 0); |
0 | 5487 dword_4E455C = 0; |
5488 } | |
5489 } | |
5490 | |
5491 //----- (00417AD4) -------------------------------------------------------- | |
983 | 5492 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level) |
1393 | 5493 { |
5494 switch (uPlayerClass % 4) | |
269 | 5495 { |
1393 | 5496 case 0: |
269 | 5497 { |
1393 | 5498 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) |
5499 return ui_character_skillinfo_can_learn; | |
5500 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level && | |
5501 byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
5502 { | |
5503 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType] < skill_level) | |
5504 return ui_character_skillinfo_cant_learn; | |
5505 } | |
5506 return ui_character_skillinfo_can_learn_gm; | |
0 | 5507 } |
1393 | 5508 break; |
5509 | |
5510 case 1: | |
269 | 5511 { |
1393 | 5512 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) |
5513 return ui_character_skillinfo_can_learn; | |
5514 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level) | |
5515 { | |
5516 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
5517 return ui_character_skillinfo_cant_learn; | |
5518 } | |
5519 return ui_character_skillinfo_can_learn_gm; | |
0 | 5520 } |
1393 | 5521 break; |
5522 | |
5523 case 2: | |
5524 case 3: | |
5525 { | |
5526 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level) | |
5527 return ui_character_skillinfo_cant_learn; | |
5528 return ui_character_skillinfo_can_learn; | |
5529 } | |
5530 break; | |
0 | 5531 } |
1393 | 5532 assert(false); |
1296 | 5533 } |