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