Mercurial > mm7
annotate Game.cpp @ 735:6daaa2f18d0d
Fixed some house sounds & shop-related stuff
author | Nomad |
---|---|
date | Fri, 22 Mar 2013 20:01:46 +0200 |
parents | e0a1fccc89b1 |
children | a464d28566a6 |
rev | line source |
---|---|
137 | 1 #include <assert.h> |
2 | |
0 | 3 #include "Game.h" |
4 #include "Party.h" | |
5 #include "IndoorCamera.h" | |
6 #include "Math.h" | |
7 #include "LightmapBuilder.h" | |
8 #include "Viewport.h" | |
9 #include "Time.h" | |
10 #include "Outdoor.h" | |
11 #include "Overlays.h" | |
12 #include "stru279.h" | |
13 #include "AudioPlayer.h" | |
14 #include "LOD.h" | |
15 #include "OSInfo.h" | |
16 #include "GUIWindow.h" | |
17 #include "Party.h" | |
18 #include "TurnEngine.h" | |
19 #include "VideoPlayer.h" | |
20 #include "Bink_Smacker.h" | |
21 #include "Events.h" | |
22 #include "Arcomage.h" | |
189 | 23 #include "texts.h" |
194 | 24 #include "Actor.h" |
25 #include "Log.h" | |
0 | 26 |
27 //#include "MM7.h" | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 Game *pGame; | |
35 | |
36 | |
37 | |
38 | |
39 | |
40 //----- (00435694) -------------------------------------------------------- | |
41 void Game::ToggleFlags2(unsigned int uFlag) | |
42 { | |
43 unsigned int v2; // eax@1 | |
44 | |
45 v2 = this->uFlags2; | |
46 if ( v2 & uFlag ) | |
47 this->uFlags2 = v2 & ~uFlag; | |
48 else | |
49 this->uFlags2 = uFlag | v2; | |
50 } | |
51 | |
52 //----- (0044103C) -------------------------------------------------------- | |
53 void Game::Draw() | |
54 { | |
142 | 55 //float v2; // ST24_4@11 |
0 | 56 //double v3; // ST28_8@11 |
57 int v4; // edi@26 | |
142 | 58 //int v5; // eax@35 |
0 | 59 |
60 uFlags2 &= 0xFFFFFFFDu; | |
61 if ( pParty->_497FC5_check_party_perception_against_level() ) | |
62 uFlags2 |= 2u; | |
63 pIndoorCamera->sRotationX = pParty->sRotationX; | |
64 pIndoorCamera->sRotationY = pParty->sRotationY; | |
120 | 65 //pIndoorCamera->pos.x = pParty->vPosition.x - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//12552 |
66 //pIndoorCamera->pos.y = pParty->vPosition.y - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//800 | |
67 pIndoorCamera->pos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0); | |
68 pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0); | |
66 | 69 pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353 |
0 | 70 pIndoorCamera->Initialize2(); |
71 pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); | |
72 pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum(); | |
73 | |
74 if ( pVideoPlayer->AnyMovieLoaded() ) | |
75 { | |
76 if ( pRenderer->pRenderD3D ) | |
77 goto LABEL_22; | |
78 pRenderer->BeginSceneD3D(); | |
79 pMouse->DrawCursorToTarget(); | |
80 } | |
81 else | |
82 { | |
78 | 83 if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.y != pParty->vPrevPosition.y |
101 | 84 | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.z != pParty->vPrevPosition.z | pParty->sEyelevel != pParty->sPrevEyelevel ) |
0 | 85 pParty->uFlags |= 2u; |
78 | 86 pParty->vPrevPosition = pParty->vPosition; |
87 pParty->vPrevPosition.y = pParty->vPosition.y; | |
0 | 88 //v0 = &pRenderer; |
89 pParty->sPrevRotationY = pParty->sRotationY; | |
78 | 90 pParty->vPrevPosition.z = pParty->vPosition.z; |
0 | 91 pParty->sPrevRotationX = pParty->sRotationX; |
92 pParty->sPrevEyelevel = pParty->sEyelevel; | |
93 pRenderer->BeginSceneD3D(); | |
94 | |
95 if ( !pRenderer->pRenderD3D ) | |
96 pMouse->DrawCursorToTarget(); | |
265 | 97 if ( !PauseGameDrawing() || viewparams->field_48 == 1 ) |
0 | 98 { |
99 if ( pRenderer->pRenderD3D ) | |
100 { | |
142 | 101 float v2 = (double)(((signed int)pMiscTimer->uTotalGameTimeElapsed >> 2) & 0x1F) * 0.032258064 * 6.0; |
0 | 102 //v3 = v2 + 6.7553994e15; |
103 //pRenderer->field_1036A8_bitmapid = LODWORD(v3); | |
265 | 104 pRenderer->hd_water_current_frame = floorf(v2 + 0.5f); |
0 | 105 } |
106 | |
107 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
108 pIndoor->Draw(); | |
109 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
110 pOutdoor->Draw(); | |
137 | 111 else assert(false); |
0 | 112 |
113 if (pRenderer->pRenderD3D) | |
114 { | |
115 pDecalBuilder->DrawBloodsplats(); | |
569 | 116 pGame->pLightmapBuilder->DrawLightmaps(2); |
0 | 117 } |
118 } | |
119 } | |
120 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); | |
121 LABEL_22: | |
122 pRenderer->BeginScene(); | |
123 if (pRenderer->pRenderD3D) | |
124 pMouse->DrawCursorToTarget(); | |
142 | 125 if (pOtherOverlayList->bRedraw) |
126 viewparams->bRedrawGameUI = true; | |
0 | 127 v4 = viewparams->bRedrawGameUI; |
128 GameUI_DrawStatusBar(); | |
129 if (!viewparams->bRedrawGameUI) | |
130 { | |
131 GameUI_DrawRightPanelItems(); | |
132 } | |
133 else | |
134 { | |
135 GameUI_DrawRightPanelFrames(); | |
136 GameUI_DrawStatusBar_2(); | |
137 viewparams->bRedrawGameUI = false; | |
138 } | |
139 if (!pVideoPlayer->pSmackerMovie) | |
140 { | |
141 GameUI_DrawMinimap(488, 16, 625, 133, viewparams->uMinimapZoom, pParty->uFlags & 2); | |
142 if (v4) | |
143 { | |
265 | 144 if ( !PauseGameDrawing() && pRenderer->pRenderD3D) // clear game viewport with transparent color |
693 | 145 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pViewport->uViewportBR_X - pViewport->uViewportTL_X, |
146 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, | |
142 | 147 pRenderer->uTargetGMask | pRenderer->uTargetBMask); |
0 | 148 viewparams->field_48 = 0; |
149 } | |
150 } | |
142 | 151 |
152 viewparams->bRedrawGameUI = pOtherOverlayList->bRedraw; | |
153 pOtherOverlayList->bRedraw = 0; | |
154 | |
0 | 155 GameUI_DrawPartySpells(); |
291 | 156 if (v4 || pParty->pHirelings[0].evt_C || pParty->pHirelings[1].evt_C ) |
134 | 157 DrawHiredNPCs(); |
0 | 158 GameUI_DrawPortraits(v4); |
159 GameUI_DrawLifeManaBars(); | |
160 GameUI_DrawCharacterSelectionFrame(); | |
161 if ( sub_44100D() ) | |
162 draw_right_panel(); | |
163 if ( !pVideoPlayer->AnyMovieLoaded() ) | |
164 { | |
165 pStru6Instance->DrawPlayerBuffAnims(); | |
569 | 166 pOtherOverlayList->DrawTurnBasedIcon(v4); |
0 | 167 GameUI_DrawTorchlightAndWizardEye(); |
168 } | |
169 GUI_UpdateWindows(); | |
130 | 170 pParty->UpdatePlayersAndHirelingsEmotions(); |
0 | 171 ++stru_51076C.field_8; |
434 | 172 _unused_5B5924_is_travel_ui_drawn = false; |
0 | 173 if (v4) |
174 pMouse->field_14 = 1; | |
175 pMouse->_469EA4(); | |
176 pMouse->DrawCursor(); | |
177 pMouse->_469E1C(); | |
178 pRenderer->EndScene(); | |
179 pRenderer->Present(); | |
569 | 180 pParty->uFlags &= ~2; |
0 | 181 } |
182 | |
183 //----- (0047A815) -------------------------------------------------------- | |
184 void Game::DrawParticles() | |
185 { | |
186 pParticleEngine->Draw(); | |
187 } | |
188 | |
189 //----- (00463149) -------------------------------------------------------- | |
190 void Game::Loop() | |
191 { | |
192 //signed int v0; // ebp@3 | |
193 //signed int v1; // esi@4 | |
194 //Render *v2; // edi@7 | |
195 //signed int v3; // esi@7 | |
196 signed int pNewNPCsCount; // ecx@58 | |
197 char *pFlags; // eax@59 | |
198 Player *pPlayer; // esi@65 | |
199 OtherOverlay *pOtherOverlay; // esi@67 | |
200 signed int v8; // edi@67 | |
201 int pPlayerNum; // edi@69 | |
202 int *pHealth; // esi@71 | |
203 signed int v11; // esi@78 | |
204 int v12; // eax@83 | |
205 const char *pLocationName; // [sp-4h] [bp-68h]@74 | |
206 bool bLoading; // [sp+10h] [bp-54h]@1 | |
207 signed int bLoadinga; // [sp+10h] [bp-54h]@19 | |
208 signed int v16; // [sp+14h] [bp-50h]@8 | |
209 int v17[4]; // [sp+18h] [bp-4Ch]@80 | |
210 MSG Msg; // [sp+28h] [bp-3Ch]@20 | |
211 char Source[64]; // [sp+44h] [bp-20h]@76 | |
212 | |
165 | 213 bLoading = uCurrentMenuID == MENU_LOADINGPROC; |
0 | 214 SetCurrentMenuID((MENU_STATE)-1); |
215 if (bLoading) | |
216 { | |
217 pParty->Reset(); | |
218 dword_6BE340 = 0; | |
219 uGameState = 0; | |
220 LoadGame(uLoadGameUI_SelectedSlot); | |
221 } | |
222 | |
223 for (uint i = 1; i < 5; ++i) | |
224 for (uint j = 1; j < 6; ++j) | |
225 { | |
226 sprintf(pTmpBuf, "data\\lloyd%d%d.pcx", i, j); | |
227 remove(pTmpBuf); | |
228 } | |
229 | |
230 LoadPlayerPortraintsAndVoices(); | |
231 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles; | |
328 | 232 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); |
0 | 233 |
234 while ( 2 ) | |
235 { | |
236 v16 = 1; | |
237 if (pMessageQueue_50CBD0->uNumMessages) | |
238 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
239 | |
240 pPartyActionQueue->uNumActions = 0; | |
241 if (pParty->bTurnBasedModeOn) | |
242 { | |
243 pTurnEngine->End(false); | |
244 pParty->bTurnBasedModeOn = false; | |
245 } | |
246 DoPrepareWorld(bLoading, 1); | |
247 pEventTimer->Resume(); | |
248 dword_6BE364_game_settings_1 |= 0x80; | |
249 dword_6BE340 = 2; | |
250 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; | |
151 | 251 pCurrentScreen = SCREEN_GAME; |
0 | 252 if (pAsyncMouse) |
253 pAsyncMouse->Resume(); | |
254 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard ) | |
255 pAsyncKeyboard->Resume(); | |
256 if ( pRenderer->pRenderD3D ) | |
257 pGame->pVisInstance->_4C1A02(); | |
258 bLoadinga = 0; | |
259 do | |
260 { | |
261 while ( PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE) ) | |
262 { | |
263 if ( Msg.message == WM_QUIT ) | |
264 Game_DeinitializeAndTerminate(0); | |
265 TranslateMessage(&Msg); | |
266 DispatchMessageA(&Msg); | |
267 } | |
268 if (dword_6BE364_game_settings_1 & 0x0100 ) | |
269 { | |
270 WaitMessage(); | |
271 continue; | |
272 } | |
273 pGame->_44EEA7(); | |
274 GameUI_WritePointedObjectStatusString(); | |
275 ProcessInputActions(); | |
276 GameUI_MsgProc(); | |
277 if ( pArcomageGame->bGameInProgress ) | |
278 { | |
279 ArcomageGame::Loop(); | |
280 //LABEL_89: | |
281 pRenderer->Present(); | |
282 continue; | |
283 } | |
284 if (pAsyncMouse) | |
285 pAsyncMouse->_46B736_consume_click_lists(1); | |
286 if ( pVideoPlayer->pSmackerMovie && !SmackWait(pVideoPlayer->pSmackerMovie) ) | |
287 { | |
288 pRenderer->BeginScene(); | |
289 pMouse->DrawCursorToTarget(); | |
290 pVideoPlayer->SmackUpdatePalette(pVideoPlayer->hWindow); | |
291 pMouse->_469EA4(); | |
292 pRenderer->EndScene(); | |
293 } | |
294 if ( pVideoPlayer->pBinkMovie && !BinkWait(pVideoPlayer->pBinkMovie) ) | |
295 { | |
296 pRenderer->BeginScene(); | |
297 pMouse->DrawCursorToTarget(); | |
298 pVideoPlayer->BinkUpdatePalette(pVideoPlayer->hWindow); | |
299 pMouse->_469EA4(); | |
300 pRenderer->EndScene(); | |
301 } | |
302 pEventTimer->Update(); | |
303 pMiscTimer->Update(); | |
304 OnTimer(0); | |
305 GameUI_StatusBar_UpdateTimedString(0); | |
306 if ( pMiscTimer->bPaused && !pEventTimer->bPaused ) | |
307 pMiscTimer->Resume(); | |
308 if ( pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn ) | |
309 pEventTimer->bTackGameTime = 0; | |
310 if ( !pEventTimer->bPaused && !uGameState ) | |
311 { | |
312 if ( !pEventTimer->bTackGameTime ) | |
313 _494035_timed_effects__water_walking_damage__etc(); | |
314 if ( dword_6BE364_game_settings_1 & 1 ) | |
315 { | |
316 dword_6BE364_game_settings_1 &= 0xFFFFFFFEu; | |
317 } | |
318 else | |
319 { | |
320 sub_401A91_AI(); | |
321 sub_46BDC0_UpdateUserInput_and_MapSpecificStuff(); | |
322 } | |
323 } | |
324 if ( v16 ) | |
325 { | |
326 v16 = 0; | |
327 viewparams->bRedrawGameUI = true; | |
328 } | |
378 | 329 pAudioPlayer->UpdateSounds(); |
0 | 330 if (uGameState == 1) |
331 //goto LABEL_96; | |
4 | 332 { |
333 bLoadinga = 1; | |
0 | 334 continue; |
4 | 335 } |
0 | 336 if (uGameState == 2) |
337 { | |
338 pAudioPlayer->StopChannels(-1, -1); | |
339 PrepareWorld(0); | |
340 uGameState = 0; | |
341 continue; | |
342 } | |
343 if ( (signed int)uGameState <= 2 ) | |
344 //goto LABEL_85; | |
4 | 345 { |
346 pGame->Draw(); | |
0 | 347 continue; |
4 | 348 } |
0 | 349 if ( (signed int)uGameState <= 5 || uGameState == 7 ) |
350 { | |
351 //LABEL_96: | |
352 bLoadinga = 1; | |
353 continue; | |
354 } | |
355 if ( uGameState != 8 ) | |
356 { | |
357 if ( uGameState != 9 ) | |
358 { | |
359 //LABEL_85: | |
360 pGame->Draw(); | |
361 continue; | |
362 } | |
363 pRenderer->BeginScene(); | |
364 GUI_UpdateWindows(); | |
365 pRenderer->EndScene(); | |
366 //goto LABEL_89; | |
4 | 367 pRenderer->Present(); |
0 | 368 continue; |
369 } | |
4 | 370 pAudioPlayer->StopChannels(-1, -1);//äàëåå â ñëó÷àå ñìåðòè ãðóïïû |
293 | 371 memset(&pParty->pHirelings[0], 0, 0x4Cu); |
0 | 372 memset(&pParty->pHirelings[1], 0, 0x4Cu); |
373 pNewNPCsCount = 0; | |
374 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
375 { | |
376 pFlags = (char *)&pNPCStats->pNewNPCData[0].uFlags; | |
377 do | |
378 { | |
379 if ( *((int *)pFlags + 6) ) | |
380 *pFlags &= 0x7Fu; | |
381 ++pNewNPCsCount; | |
382 pFlags += 76; | |
383 } | |
384 while ( pNewNPCsCount < (signed int)pNPCStats->uNumNewNPCs ); | |
385 } | |
386 pVideoPlayer->PlayDeathMovie(); | |
387 if ( pVideoPlayer->AnyMovieLoaded() ) | |
388 pVideoPlayer->Unload(); | |
389 SaveGame(0, 0); | |
390 ++pParty->uNumDeaths; | |
391 pPlayer = pParty->pPlayers; | |
392 do | |
393 { | |
394 pPlayer->SetVariable(VAR_Award, 85); | |
395 ++pPlayer; | |
396 } | |
397 while ( (signed int)pPlayer < (signed int)pParty->pHirelings ); | |
398 pParty->field_764 = 0; | |
399 pParty->uTimePlayed += 0x276000ui64; | |
569 | 400 LOWORD(pParty->uFlags) &= ~0x204; |
0 | 401 pParty->SetGold(0); |
402 pOtherOverlay = pOtherOverlayList->pOverlays; | |
403 v8 = 50; | |
404 do | |
405 { | |
406 pOtherOverlay->Reset(); | |
407 ++pOtherOverlay; | |
408 --v8; | |
409 } | |
410 while ( v8 ); | |
411 memset(pParty->pPartyBuffs, 0, 0x140u); | |
412 pPlayerNum = 1; | |
413 if ( pParty->bTurnBasedModeOn == 1 ) | |
414 { | |
415 pTurnEngine->End(1); | |
416 pParty->bTurnBasedModeOn = 0; | |
417 } | |
440 | 418 //pHealth = &pParty->pPlayers[0].sHealth;//193C |
419 //do | |
420 for(int i=0; i<4; ++i) | |
0 | 421 { |
440 | 422 memset(pParty->pPlayers[i].pConditions, 0, 0xA0u);//(pConditions, 0, 160) |
423 memset(pParty->pPlayers[i].pPlayerBuffs, 0, 0x180u);//(pPlayerBuffs[0], 0, 384) | |
424 //*pHealth = 1; | |
425 pParty->pPlayers[i].sHealth=1; | |
426 //pHealth += 1743; //6CF | |
0 | 427 uActiveCharacter = 1; |
428 } | |
440 | 429 // while ( (signed int)pHealth < (signed int)&pParty->field_871C[567] ); |
484 | 430 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 136) ) |
0 | 431 { |
432 pParty->vPosition.x = -17331; // respawn in harmondale | |
433 pParty->vPosition.y = 12547; | |
434 pParty->vPosition.z = 465; | |
435 pParty->sRotationY = 0; | |
436 pLocationName = "out02.odm"; | |
437 } | |
438 else | |
439 { | |
440 pParty->vPosition.x = 12552; // respawn on emerald isle | |
441 pParty->vPosition.y = 1816; | |
442 pParty->vPosition.z = 0; | |
443 pParty->sRotationY = 512; | |
444 pLocationName = "out01.odm"; | |
445 } | |
446 strcpy(Source, pLocationName); | |
447 pParty->uFallStartY = pParty->vPosition.z; | |
448 pParty->sRotationX = 0; | |
449 pParty->uFallSpeed = 0; | |
450 pParty->field_6E4 = 0; | |
451 pParty->field_6E0 = 0; | |
452 if ( _strcmpi(Source, pCurrentMapName) ) | |
453 { | |
454 strcpy(pCurrentMapName, Source); | |
455 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x; | |
456 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y; | |
457 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z; | |
458 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY; | |
459 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX; | |
460 dword_5B65C0 = 1; | |
461 PrepareWorld(1); | |
462 } | |
463 InitializeActors(); | |
464 v11 = 0; | |
465 do | |
466 { | |
467 if ( pPlayers[pPlayerNum]->CanAct() ) | |
468 v17[v11++] = pPlayerNum; | |
469 ++pPlayerNum; | |
470 } | |
471 while ( pPlayerNum <= 4 ); | |
472 if ( v11 ) | |
473 { | |
474 v12 = rand(); | |
187 | 475 pPlayers[v17[v12 % v11]]->PlaySound(SPEECH_99, 0); |
0 | 476 } |
477 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2u);// "Once again you've cheated death!.." "Âû ñíîâà îáõèòðèëè ñìåðòü! …" | |
478 uGameState = 0; | |
479 } | |
480 while ( !bLoadinga ); | |
481 dword_6BE340 = 0; | |
482 pEventTimer->Pause(); | |
483 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | |
484 if ( uGameState == 3 ) | |
485 { | |
486 sub_491E3A(); | |
487 LoadPlayerPortraintsAndVoices(); | |
488 uGameState = 0; | |
489 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles; | |
490 bLoading = true; | |
491 continue; | |
492 } | |
493 break; | |
494 } | |
151 | 495 pCurrentScreen = SCREEN_VIDEO; |
0 | 496 sub_491E3A(); |
497 } | |
498 | |
499 | |
500 //----- (0044F192) -------------------------------------------------------- | |
501 void Game::PrepareBloodsplats() | |
502 { | |
503 for (uint i = 0; i < uNumBloodsplats; ++i) | |
504 { | |
505 pBloodsplatContainer->AddBloodsplat( | |
506 pBloodsplats[i].x, | |
507 pBloodsplats[i].y, | |
508 pBloodsplats[i].z, | |
509 pBloodsplats[i].radius, | |
510 pBloodsplats[i].r, | |
511 pBloodsplats[i].g, | |
512 pBloodsplats[i].b); | |
513 } | |
514 } | |
515 | |
516 | |
517 //----- (0044F120) -------------------------------------------------------- | |
518 void Game::PushStationaryLights(int a2) | |
519 { | |
520 signed int v3; // ebx@1 | |
521 char *v4; // esi@2 | |
522 | |
523 auto v2 = this; | |
524 v3 = 0; | |
525 if ( (signed int)this->uNumStationaryLights > 0 ) | |
526 { | |
527 v4 = (char *)&this->pStationaryLights[0].vRGBColor.y; | |
528 do | |
529 { | |
530 pStationaryLightsStack->AddLight( | |
531 (signed __int64)*((float *)v4 - 4), | |
532 (signed __int64)*((float *)v4 - 3), | |
533 (signed __int64)*((float *)v4 - 2), | |
534 (signed __int64)*((float *)v4 + 2), | |
535 (signed __int64)*((float *)v4 - 1), | |
536 (signed __int64)*(float *)v4, | |
537 (signed __int64)*((float *)v4 + 1), | |
538 byte_4E94D0); | |
539 ++v3; | |
540 v4 += 28; | |
541 } | |
542 while ( v3 < (signed int)v2->uNumStationaryLights ); | |
543 } | |
544 } | |
545 // 4E94D0: using guessed type char byte_4E94D0; | |
546 | |
547 //----- (0044F0FD) -------------------------------------------------------- | |
548 void Game::_44F0FD() | |
549 { | |
550 ToggleFlags(0x40u); | |
551 | |
552 if ( !(uFlags & 0x40) ) | |
553 { | |
554 uNumBloodsplats = 0; | |
555 field_E0C = 0; | |
556 } | |
557 } | |
558 | |
559 //----- (0044F0D8) -------------------------------------------------------- | |
560 void Game::ToggleFlags(uint uMask) | |
561 { | |
562 if (uFlags & uMask) | |
563 uFlags &= ~uMask; | |
564 else | |
565 uFlags |= uMask; | |
566 } | |
567 | |
568 | |
569 //----- (0044F07B) -------------------------------------------------------- | |
570 bool Game::_44F07B() | |
571 { | |
572 if (!pKeyboardInstance->IsKeyBeingHeld(VK_SHIFT) && | |
573 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) && | |
574 !pKeyboardInstance->IsKeyBeingHeld(VK_LSHIFT) || | |
575 | |
576 (pKeyboardInstance->WasKeyPressed(VK_F11) == 0 && | |
577 pKeyboardInstance->WasKeyPressed(VK_F11))) | |
578 return true; | |
579 return false; | |
580 } | |
581 | |
582 //----- (0044EEA7) -------------------------------------------------------- | |
583 bool Game::_44EEA7() | |
584 { | |
585 //Game *v1; // esi@1 | |
194 | 586 //double v2; // st7@2 |
0 | 587 float depth; // ST00_4@9 |
194 | 588 //bool result; // eax@9 |
0 | 589 unsigned int v5; // eax@14 |
590 __int64 v6; // kr00_8@21 | |
591 unsigned int y; // [sp+4h] [bp-24h]@2 | |
592 unsigned int x; // [sp+8h] [bp-20h]@2 | |
194 | 593 Vis_SelectionFilter *v10; // [sp+10h] [bp-18h]@2 |
594 Vis_SelectionFilter *v11; // [sp+14h] [bp-14h]@2 | |
0 | 595 POINT a2; // [sp+20h] [bp-8h]@1 |
596 | |
597 //v1 = this; | |
598 ++qword_5C6DF0; | |
599 pParticleEngine->UpdateParticles(); | |
600 pMouseInstance->GetCursorPos(&a2); | |
194 | 601 |
602 x = a2.y; | |
603 y = a2.x; | |
0 | 604 if ( sub_4637E0_is_there_popup_onscreen() ) |
605 { | |
194 | 606 v11 = &vis_face_filter; |
607 v10 = &vis_sprite_filter_2; | |
608 depth = GetPickDepth(); | |
0 | 609 } |
610 else | |
611 { | |
592 | 612 if ( uFlags2 & GAME_FLAGS_2_TARGETING_MODE ) |
0 | 613 { |
194 | 614 v11 = &vis_face_filter; |
615 v10 = &vis_sprite_filter_1; | |
0 | 616 } |
617 else | |
618 { | |
194 | 619 v11 = &vis_face_filter; |
620 v10 = &vis_sprite_filter_4; | |
0 | 621 } |
194 | 622 depth = 5120.0; |
0 | 623 } |
194 | 624 //depth = v2; |
0 | 625 |
323 | 626 PickMouse(depth, y, x, false, v10, v11); |
0 | 627 pLightmapBuilder->std__vector_000004_size = 0; |
628 pLightmapBuilder->std__vector_183808_size = 0; | |
629 pDecalBuilder->std__vector_pDecals_size = 0; | |
630 pDecalBuilder->field_308008 = 0; | |
194 | 631 if (!_44F07B()) |
632 return false; | |
633 | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
638
diff
changeset
|
634 if ( uFlags & GAME_FLAGS_1_DRAW_BLV_DEBUGS) |
0 | 635 LOBYTE(pStru10Instance->field_4) = 0; |
636 if ( pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
637 { | |
638 v5 = GetLevelFogColor(); | |
639 pRenderer->uFogColor = v5 & 0xFFFFFF; | |
640 } | |
641 if (uFlags & 0x0400) | |
642 uFlags2 |= 0x01; | |
643 if ( !pRenderer->pRenderD3D && uCurrentlyLoadedLevelType == LEVEL_Outdoor && pMobileLightsStack->uNumLightsActive ) | |
644 { | |
645 uFlags2 |= 0x01; | |
646 field_E10 = qword_5C6DF0; | |
647 } | |
648 v6 = qword_5C6DF0 - field_E10; | |
649 if ( qword_5C6DF0 - field_E10 == 1 ) | |
650 uFlags2 |= v6; | |
651 if (uNumStationaryLights_in_pStationaryLightsStack != pStationaryLightsStack->uNumLightsActive ) | |
652 { | |
653 uFlags2 |= 1u; | |
654 uNumStationaryLights_in_pStationaryLightsStack = pStationaryLightsStack->uNumLightsActive; | |
655 } | |
656 _44E904(); | |
194 | 657 return true; |
0 | 658 } |
659 | |
660 | |
661 //----- (0044EDE4) -------------------------------------------------------- | |
638 | 662 bool Game::AlterGamma_BLV(BLVFace *pFace, unsigned int *pColor) |
0 | 663 { |
638 | 664 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS && |
665 pFace->uAttributes & FACE_CAN_SATURATE_COLOR) | |
0 | 666 { |
667 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); | |
668 return true; | |
669 } | |
670 else | |
671 return false; | |
672 } | |
673 | |
674 //----- (0044EE30) -------------------------------------------------------- | |
638 | 675 bool Game::AlterGamma_ODM(ODMFace *pFace, unsigned int *pColor) |
0 | 676 { |
638 | 677 if (uFlags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS && |
678 pFace->uAttributes & FACE_CAN_SATURATE_COLOR) | |
0 | 679 { |
638 | 680 *pColor = ReplaceHSV(*pColor, 1.0, fSaturation, -1.0); |
0 | 681 return true; |
682 } | |
683 else | |
684 return false; | |
685 } | |
686 | |
687 | |
688 //----- (004645FA) -------------------------------------------------------- | |
689 void Game::Deinitialize() | |
690 { | |
691 struct tagRECT Rect; // [sp+0h] [bp-10h]@6 | |
692 | |
693 if (pAsyncMouse) | |
694 pAsyncMouse->Suspend(); | |
695 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard) | |
696 pAsyncKeyboard->Suspend(); | |
697 WriteWindowsRegistryInt("startinwindow", pRenderer->bWindowMode); | |
698 if ( GetWindowRect(hWnd, &Rect) && pRenderer->bWindowMode ) | |
699 { | |
700 WriteWindowsRegistryInt("window X", Rect.left); | |
701 WriteWindowsRegistryInt("window Y", Rect.top); | |
702 } | |
703 WriteWindowsRegistryInt("debug flags", stru_51076C.registry_debug_flags); | |
704 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); | |
705 pItemsTable->Release(); | |
706 pNPCStats->Release(); | |
707 if (pAsyncKeyboard) | |
708 pAsyncKeyboard->Release(); | |
709 if (pAsyncMouse) | |
710 pAsyncMouse->Release(); | |
711 if (pMouse) | |
712 pMouse->Deactivate(); | |
713 | |
714 pAudioPlayer->Release();//error | |
715 pNew_LOD->FreeSubIndexAndIO(); | |
716 pGames_LOD->FreeSubIndexAndIO(); | |
717 ClipCursor(0); | |
718 Game::Destroy(); | |
719 } | |
720 | |
721 //----- (0044EE7C) -------------------------------------------------------- | |
722 bool Game::draw_debug_outlines() | |
723 { | |
724 if (uFlags & 0x04) | |
725 { | |
726 pLightmapBuilder->DrawDebugOutlines(-1); | |
727 pDecalBuilder->DrawDecalDebugOutlines(); | |
728 } | |
729 return true; | |
730 } | |
731 | |
732 //----- (0044EC23) -------------------------------------------------------- | |
733 int Game::_44EC23(stru148 *a2, int *a3, signed int a4) | |
734 { | |
735 double v4; // st7@4 | |
736 //double v5; // ST00_8@4 | |
737 signed int v6; // eax@5 | |
738 //double v7; // ST00_8@6 | |
739 signed int result; // eax@8 | |
740 //double v9; // ST00_8@9 | |
741 //double v10; // ST00_8@11 | |
742 float a2a; // [sp+14h] [bp+8h]@4 | |
743 float a3a; // [sp+18h] [bp+Ch]@4 | |
744 float a3b; // [sp+18h] [bp+Ch]@6 | |
745 float a4a; // [sp+1Ch] [bp+10h]@9 | |
746 float a4b; // [sp+1Ch] [bp+10h]@11 | |
747 | |
748 if ( this->uFlags2 & 2 && a2->field_59 == 5 && a2->pODMFace->uAttributes & 2 ) | |
749 { | |
750 v4 = (double)a4; | |
751 a2a = v4; | |
752 *a3 |= 2u; | |
753 a3a = (1.0 - this->fSaturation) * v4; | |
754 //v5 = a3a + 6.7553994e15; | |
755 //if ( SLODWORD(v5) >= 0 ) | |
756 if (floorf(a3a + 0.5f) >= 0 ) | |
757 { | |
758 a3b = (1.0 - this->fSaturation) * a2a; | |
759 //v7 = a3b + 6.7553994e15; | |
760 //v6 = LODWORD(v7); | |
761 v6 = floorf(a3b + 0.5f); | |
762 } | |
763 else | |
764 { | |
765 v6 = 0; | |
766 } | |
767 if ( a4 >= v6 ) | |
768 { | |
769 a4a = (1.0 - fSaturation) * a2a; | |
770 //v9 = a4a + 6.7553994e15; | |
771 //if ( SLODWORD(v9) >= 0 ) | |
772 if (floorf(a4a + 0.5f) >= 0) | |
773 { | |
774 a4b = (1.0 - fSaturation) * a2a; | |
775 //v10 = a4b + 6.7553994e15; | |
776 //result = LODWORD(v10); | |
777 result = floorf(a4b + 0.5f); | |
778 } | |
779 else | |
780 { | |
781 result = 0; | |
782 } | |
783 } | |
784 else | |
785 { | |
786 result = a4; | |
787 } | |
788 } | |
789 else | |
790 { | |
791 result = -1; | |
792 } | |
793 return result; | |
794 } | |
795 | |
796 | |
797 | |
798 //----- (00465C8B) -------------------------------------------------------- | |
799 Game *Game::Create() | |
800 { | |
801 return new Game; | |
802 } | |
803 | |
804 //----- (00465CF3) -------------------------------------------------------- | |
805 void Game::Destroy() | |
806 { | |
807 if (pGame) | |
808 delete pGame; | |
809 pGame = nullptr; | |
810 } | |
811 | |
812 //----- (0044ED0A) -------------------------------------------------------- | |
813 signed int Game::_44ED0A(BLVFace *a2, int *a3, signed int a4) | |
814 { | |
815 double v4; // st7@3 | |
816 //double v5; // ST00_8@3 | |
817 signed int v6; // eax@4 | |
818 //double v7; // ST00_8@5 | |
819 signed int result; // eax@7 | |
820 //double v9; // ST00_8@8 | |
821 //double v10; // ST00_8@10 | |
822 float v11; // [sp+14h] [bp+8h]@3 | |
823 float v12; // [sp+18h] [bp+Ch]@3 | |
824 float v13; // [sp+18h] [bp+Ch]@5 | |
825 float v14; // [sp+1Ch] [bp+10h]@8 | |
826 float v15; // [sp+1Ch] [bp+10h]@10 | |
827 | |
828 if ( this->uFlags2 & 2 && a2->uAttributes & 2 ) | |
829 { | |
830 v4 = (double)a4; | |
831 v11 = v4; | |
832 *a3 |= 2u; | |
833 v12 = (1.0 - this->fSaturation) * v4; | |
834 //v5 = v12 + 6.7553994e15; | |
835 if (floorf(v12 + 0.5f)/* SLODWORD(v5)*/ >= 0 ) | |
836 { | |
837 v13 = (1.0 - this->fSaturation) * v11; | |
838 //v7 = v13 + 6.7553994e15; | |
839 //v6 = LODWORD(v7); | |
840 v6 = floorf(v13 + 0.5f); | |
841 } | |
842 else | |
843 { | |
844 v6 = 0; | |
845 } | |
846 if ( a4 >= v6 ) | |
847 { | |
848 v14 = (1.0 - fSaturation) * v11; | |
849 //v9 = v14 + 6.7553994e15; | |
850 if (floorf(v14 + 0.5f)/* SLODWORD(v9)*/ >= 0 ) | |
851 { | |
852 v15 = (1.0 - fSaturation) * v11; | |
853 //v10 = v15 + 6.7553994e15; | |
854 //result = LODWORD(v10); | |
855 result = floorf(v15 + 0.5f); | |
856 } | |
857 else | |
858 { | |
859 result = 0; | |
860 } | |
861 } | |
862 else | |
863 { | |
864 result = a4; | |
865 } | |
866 } | |
867 else | |
868 { | |
869 result = -1; | |
870 } | |
871 return result; | |
872 } | |
873 | |
874 | |
875 //----- (0044E4B7) -------------------------------------------------------- | |
876 Game::Game() | |
877 { | |
878 uNumStationaryLights = 0; | |
879 uNumBloodsplats = 0; | |
880 field_E0C = 0; | |
881 field_E10 = 0; | |
882 uNumStationaryLights_in_pStationaryLightsStack = 0; | |
883 bGammaControlInitialized = false; | |
884 uFlags = 0; | |
885 uFlags2 = 0; | |
886 uSomeGammaStartTime = 0; | |
887 uSomeGammaDeltaTime = 0; | |
888 | |
889 pThreadWardInstance = new ThreadWard; | |
890 pParticleEngine = new ParticleEngine; | |
891 pMouse = pMouseInstance = new Mouse(pThreadWardInstance); | |
892 pLightmapBuilder = new LightmapBuilder; | |
893 pVisInstance = new Vis; | |
894 pStru6Instance = new stru6; | |
895 pIndoorCameraD3D = new IndoorCameraD3D; | |
896 pStru9Instance = new stru9; | |
897 pStru10Instance = new stru10; | |
898 pStru11Instance = new stru11; | |
899 pStru12Instance = new stru12(pStru11Instance); | |
900 pCShow = new CShow; | |
901 pKeyboardInstance = new Keyboard; | |
902 pGammaController = new GammaController; | |
903 | |
904 uFlags |= 0x0800; | |
905 uFlags2 |= 0x24; | |
906 | |
907 _44F0FD(); | |
908 | |
909 bWinNT4_0 = false; | |
910 if (pVersion->pVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && | |
911 pVersion->pVersionInfo.dwMajorVersion == 4) | |
912 bWinNT4_0 = true; | |
913 } | |
914 | |
915 //----- (0044E7F3) -------------------------------------------------------- | |
916 Game::~Game() | |
917 { | |
918 if (pGammaController) | |
919 delete pGammaController; | |
920 if (pKeyboardInstance) | |
921 delete pKeyboardInstance; | |
922 if (pCShow) | |
923 delete pCShow; | |
924 if (pStru12Instance) | |
925 delete pStru12Instance; | |
926 if (pStru11Instance) | |
927 delete pStru11Instance; | |
928 if (pStru10Instance) | |
929 delete pStru10Instance; | |
930 if (pStru9Instance) | |
931 delete pStru9Instance; | |
932 if (pIndoorCameraD3D) | |
933 delete pIndoorCameraD3D; | |
934 if (pStru6Instance) | |
935 delete pStru6Instance; | |
936 if (pVisInstance) | |
937 delete pVisInstance; | |
938 if (pLightmapBuilder) | |
939 delete pLightmapBuilder; | |
940 if (pMouseInstance) | |
941 delete pMouseInstance; | |
942 if (pParticleEngine) | |
943 delete pParticleEngine; | |
944 if (pThreadWardInstance) | |
945 delete pThreadWardInstance; | |
946 } | |
947 | |
948 //----- (0044E904) -------------------------------------------------------- | |
949 void Game::_44E904() | |
950 { | |
951 //Game *v1; // esi@1 | |
952 unsigned __int64 v2; // qax@1 | |
953 unsigned int v3; // ecx@1 | |
954 int v4; // edi@1 | |
955 unsigned __int8 v5; // cf@7 | |
956 double v6; // st7@13 | |
957 double v7; // st7@15 | |
958 signed __int64 v8; // [sp+Ch] [bp-8h]@1 | |
959 | |
960 //v1 = this; | |
961 v2 = pEventTimer->Time(); | |
962 v4 = (v2 - uSomeGammaStartTime) >> 32; | |
963 v3 = v2 - LODWORD(uSomeGammaStartTime); | |
964 v8 = v2 - uSomeGammaStartTime; | |
965 if ( v4 < 0 | |
966 || SHIDWORD(v2) < ((unsigned int)v2 < LODWORD(uSomeGammaStartTime)) + HIDWORD(uSomeGammaStartTime) | v4 == 0 | |
967 && v3 <= 0x80 ) | |
968 { | |
969 if ( v4 > 0 || v4 >= 0 ) | |
970 goto LABEL_12; | |
971 v3 = 0; | |
972 v4 = 0; | |
973 } | |
974 else | |
975 { | |
976 if ( uSomeGammaDeltaTime ) | |
977 { | |
978 LODWORD(uSomeGammaDeltaTime) = 0; | |
979 HIDWORD(uSomeGammaDeltaTime) = 0; | |
980 } | |
981 else | |
982 { | |
983 LODWORD(uSomeGammaDeltaTime) = v3; | |
984 HIDWORD(uSomeGammaDeltaTime) = v4; | |
985 } | |
986 v5 = __CFADD__(v3, -128); | |
987 v3 -= 128; | |
988 v4 = v5 + v4 - 1; | |
989 } | |
990 uSomeGammaStartTime = v2; | |
991 v8 = __PAIR__(v4, v3); | |
992 LABEL_12: | |
993 if ( uSomeGammaDeltaTime ) | |
994 v6 = (double)(signed __int64)(uSomeGammaDeltaTime - __PAIR__(v4, v3)); | |
995 else | |
996 v6 = (double)v8; | |
997 v7 = v6 * 0.0078125; | |
998 if ( v7 < 0.0 || v7 <= 1.0 ) | |
999 { | |
1000 if ( v7 < 0.0 ) | |
1001 v7 = 0.0; | |
1002 } | |
1003 else | |
1004 { | |
1005 v7 = 1.0; | |
1006 } | |
1007 if ( pRenderer->pRenderD3D ) | |
1008 fSaturation = v7; | |
1009 else | |
1010 fSaturation = (1.0 - 0.5) * v7 + 0.5; | |
1011 } | |
1012 | |
1013 //----- (0044EA17) -------------------------------------------------------- | |
1014 bool Game::InitializeGammaController() | |
1015 { | |
1016 if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || | |
1017 pVersion->pVersionInfo.dwMajorVersion != 4 ) | |
1018 pGammaController->InitializeFromSurface(pRenderer->pFrontBuffer4); | |
1019 | |
1020 bGammaControlInitialized = true; | |
1021 uSomeGammaStartTime = pEventTimer->Time(); | |
1022 return true; | |
1023 } | |
1024 | |
1025 //----- (0044EA5E) -------------------------------------------------------- | |
194 | 1026 bool Game::PickMouse(float fPickDepth, unsigned int uMouseX, unsigned int uMouseY, bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 1027 { |
227 | 1028 if (pCurrentScreen != SCREEN_GAME|| !pRenderer->pRenderD3D) |
194 | 1029 return false; |
0 | 1030 |
194 | 1031 if (!pVisInstance) |
0 | 1032 { |
194 | 1033 MessageBoxW(nullptr, L"The 'Vis' object pointer has not been instatiated, but CGame::Pick() is trying to call through it.", nullptr, 0); |
1034 return false; | |
1035 } | |
0 | 1036 |
692 | 1037 if (uMouseX >= (signed int)pViewport->uScreen_TL_X && |
1038 uMouseX <= (signed int)pViewport->uScreen_BR_X && | |
1039 uMouseY >= (signed int)pViewport->uScreen_TL_Y && | |
1040 uMouseY <= (signed int)pViewport->uScreen_BR_Y) | |
194 | 1041 { |
1042 pVisInstance->PickMouse(fPickDepth, uMouseX, uMouseY, sprite_filter, face_filter); | |
0 | 1043 |
194 | 1044 if (bOutline) |
1045 OutlineSelection(); | |
0 | 1046 } |
194 | 1047 |
1048 return true; | |
0 | 1049 } |
1050 // 4E28F8: using guessed type int pCurrentScreen; | |
1051 | |
1052 //----- (0044EB12) -------------------------------------------------------- | |
194 | 1053 bool Game::PickKeyboard(bool bOutline, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter) |
0 | 1054 { |
271 | 1055 if (pCurrentScreen == SCREEN_GAME && pVisInstance && pRenderer->pRenderD3D) |
0 | 1056 { |
194 | 1057 bool r = pVisInstance->PickKeyboard(&pVisInstance->default_list, sprite_filter, face_filter); |
0 | 1058 |
1059 if (bOutline) | |
1060 OutlineSelection(); | |
1061 return r; | |
1062 } | |
1063 return false; | |
1064 } | |
123 | 1065 /* |
1066 Result::Code Game::PickKeyboard(bool bOutline, struct unnamed_F93E6C *a3, struct unnamed_F93E6C *a4) | |
1067 { | |
1068 if (dword_4E28F8_PartyCantJumpIfTrue) | |
1069 return Result::Generic; | |
1070 | |
1071 pVis->PickKeyboard(a3, a4); | |
1072 if (bOutline) | |
1073 Game_outline_selection((int)this); | |
1074 return Result::Success; | |
1075 } | |
1076 */ | |
0 | 1077 // 4E28F8: using guessed type int pCurrentScreen; |
1078 | |
1079 //----- (0044EB5A) -------------------------------------------------------- | |
1080 void Game::OutlineSelection() | |
1081 { | |
194 | 1082 if (!pVisInstance) |
1083 return; | |
1084 | |
1085 if (!pVisInstance->default_list.uNumPointers) | |
1086 return; | |
0 | 1087 |
194 | 1088 auto object_info = pVisInstance->default_list.object_pointers[0]; |
1089 if (object_info) | |
1090 switch (object_info->object_type) | |
0 | 1091 { |
194 | 1092 case VisObjectType_Sprite: |
0 | 1093 { |
194 | 1094 Log::Warning(L"Sprite outline currently unsupported"); |
1095 return; | |
0 | 1096 } |
1097 | |
194 | 1098 case VisObjectType_Face: |
1099 { | |
1100 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
0 | 1101 { |
194 | 1102 auto face = (ODMFace *)object_info->object; |
1103 if (face->uAttributes & FACE_OUTLINED) | |
1104 face->uAttributes &= ~FACE_OUTLINED; | |
0 | 1105 else |
194 | 1106 face->uAttributes |= FACE_OUTLINED; |
1107 } | |
1108 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1109 { | |
1110 auto face = (BLVFace *)object_info->object; | |
1111 if (face->uAttributes & FACE_OUTLINED) | |
1112 face->uAttributes &= ~FACE_OUTLINED; | |
1113 else | |
1114 face->uAttributes |= FACE_OUTLINED; | |
0 | 1115 } |
194 | 1116 else assert(false); |
1117 } | |
323 | 1118 break; |
194 | 1119 |
1120 default: | |
1121 { | |
1122 MessageBoxW(nullptr, L"Undefined CObjectInfo type requested in CGame::outline_selection()", nullptr, 0); | |
1123 ExitProcess(0); | |
1124 } | |
0 | 1125 } |
1126 } |