Mercurial > mm7
comparison Game.cpp @ 2064:74f06d8a8017
Merge
author | Ritor1 |
---|---|
date | Mon, 02 Dec 2013 20:43:28 +0600 |
parents | b2a434d65344 |
children | 259df09dfb50 |
comparison
equal
deleted
inserted
replaced
2063:7890930801a8 | 2064:74f06d8a8017 |
---|---|
302 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu; | 302 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu; |
303 SetCurrentMenuID((MENU_STATE)-1); | 303 SetCurrentMenuID((MENU_STATE)-1); |
304 if (bLoading) | 304 if (bLoading) |
305 { | 305 { |
306 pParty->Reset(); | 306 pParty->Reset(); |
307 dword_6BE340 = 0; | |
308 uGameState = GAME_STATE_PLAYING; | 307 uGameState = GAME_STATE_PLAYING; |
309 LoadGame(uLoadGameUI_SelectedSlot); | 308 LoadGame(uLoadGameUI_SelectedSlot); |
310 } | 309 } |
311 | 310 |
312 for (uint i = 1; i < 5; ++i) | 311 for (uint i = 1; i < 5; ++i) |
331 pTurnEngine->End(false); | 330 pTurnEngine->End(false); |
332 pParty->bTurnBasedModeOn = false; | 331 pParty->bTurnBasedModeOn = false; |
333 } | 332 } |
334 DoPrepareWorld(bLoading, 1); | 333 DoPrepareWorld(bLoading, 1); |
335 pEventTimer->Resume(); | 334 pEventTimer->Resume(); |
336 dword_6BE364_game_settings_1 |= 0x80; | 335 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME; |
337 dword_6BE340 = 2; | |
338 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; | 336 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; |
339 pCurrentScreen = SCREEN_GAME; | 337 pCurrentScreen = SCREEN_GAME; |
340 | 338 |
341 if ( pRenderer->pRenderD3D ) | 339 if ( pRenderer->pRenderD3D ) |
342 pGame->pVisInstance->_4C1A02(); | 340 pGame->pVisInstance->_4C1A02(); |
349 if ( Msg.message == WM_QUIT ) | 347 if ( Msg.message == WM_QUIT ) |
350 Game_DeinitializeAndTerminate(0); | 348 Game_DeinitializeAndTerminate(0); |
351 TranslateMessage(&Msg); | 349 TranslateMessage(&Msg); |
352 DispatchMessageA(&Msg); | 350 DispatchMessageA(&Msg); |
353 } | 351 } |
354 if (dword_6BE364_game_settings_1 & 0x0100 ) | 352 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) |
355 { | 353 { |
356 WaitMessage(); | 354 WaitMessage(); |
357 continue; | 355 continue; |
358 } | 356 } |
359 pGame->_44EEA7(); | 357 pGame->_44EEA7(); |
380 pEventTimer->bTackGameTime = 0; | 378 pEventTimer->bTackGameTime = 0; |
381 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING) | 379 if ( !pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING) |
382 { | 380 { |
383 if ( !pEventTimer->bTackGameTime ) | 381 if ( !pEventTimer->bTackGameTime ) |
384 _494035_timed_effects__water_walking_damage__etc(); | 382 _494035_timed_effects__water_walking_damage__etc(); |
385 if ( dword_6BE364_game_settings_1 & 1 ) | 383 |
386 { | 384 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001) |
387 dword_6BE364_game_settings_1 &= 0xFFFFFFFEu; | 385 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001; |
388 } | |
389 else | 386 else |
390 { | 387 { |
391 UpdateActorAI(); | 388 UpdateActorAI(); |
392 UpdateUserInput_and_MapSpecificStuff(); | 389 UpdateUserInput_and_MapSpecificStuff(); |
393 } | 390 } |
545 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2u);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …" | 542 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2u);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …" |
546 uGameState = GAME_STATE_PLAYING; | 543 uGameState = GAME_STATE_PLAYING; |
547 } | 544 } |
548 while (!game_finished); | 545 while (!game_finished); |
549 | 546 |
550 dword_6BE340 = 0; | |
551 pEventTimer->Pause(); | 547 pEventTimer->Pause(); |
552 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | 548 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
553 if ( uGameState == GAME_STATE_LOADING_GAME ) | 549 if ( uGameState == GAME_STATE_LOADING_GAME ) |
554 { | 550 { |
555 sub_491E3A(); | 551 sub_491E3A(); |
752 if (pRenderer->bWindowMode) | 748 if (pRenderer->bWindowMode) |
753 { | 749 { |
754 WriteWindowsRegistryInt("window X", window->GetX()); | 750 WriteWindowsRegistryInt("window X", window->GetX()); |
755 WriteWindowsRegistryInt("window Y", window->GetY()); | 751 WriteWindowsRegistryInt("window Y", window->GetY()); |
756 } | 752 } |
757 window->Delete(); | |
758 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); | 753 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun); |
759 pItemsTable->Release(); | 754 pItemsTable->Release(); |
760 pNPCStats->Release(); | 755 pNPCStats->Release(); |
761 | 756 |
762 if (pMouse) | 757 if (pMouse) |
3047 __debugbreak(); | 3042 __debugbreak(); |
3048 dword_50CDC8 = 1; | 3043 dword_50CDC8 = 1; |
3049 sub_42FBDD(); | 3044 sub_42FBDD(); |
3050 SaveGame(1, 0); | 3045 SaveGame(1, 0); |
3051 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); | 3046 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); |
3052 dword_6BE364_game_settings_1 |= 1; | 3047 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
3053 uGameState = GAME_STATE_2; | 3048 uGameState = GAME_STATE_2; |
3054 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; | 3049 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; |
3055 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; | 3050 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related; |
3056 if ( v53 < 0 ) | 3051 if ( v53 < 0 ) |
3057 { | 3052 { |
3155 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) | 3150 if ( _stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]) ) |
3156 { | 3151 { |
3157 SaveGame(1, 0); | 3152 SaveGame(1, 0); |
3158 OnMapLeave(); | 3153 OnMapLeave(); |
3159 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); | 3154 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]); |
3160 dword_6BE364_game_settings_1 |= 1; | 3155 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
3161 uGameState = GAME_STATE_2; | 3156 uGameState = GAME_STATE_2; |
3162 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; | 3157 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X; |
3163 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; | 3158 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y; |
3164 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; | 3159 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z; |
3165 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; | 3160 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X; |
3236 } | 3231 } |
3237 else | 3232 else |
3238 { | 3233 { |
3239 SaveGame(1, 0); | 3234 SaveGame(1, 0); |
3240 OnMapLeave(); | 3235 OnMapLeave(); |
3241 dword_6BE364_game_settings_1 |= 1; | 3236 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
3242 uGameState = GAME_STATE_2; | 3237 uGameState = GAME_STATE_2; |
3243 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); | 3238 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename); |
3244 dword_5B65C0 = 1; | 3239 dword_5B65C0 = 1; |
3245 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; | 3240 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x; |
3246 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; | 3241 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y; |
3419 } | 3414 } |
3420 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); | 3415 while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); |
3421 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) | 3416 if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) |
3422 { | 3417 { |
3423 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); | 3418 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); |
3424 dword_6BE364_game_settings_1 |= 1u; | 3419 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001; |
3425 uGameState = GAME_STATE_2; | 3420 uGameState = GAME_STATE_2; |
3426 OnMapLeave(); | 3421 OnMapLeave(); |
3427 continue; | 3422 continue; |
3428 } | 3423 } |
3429 } | 3424 } |
4606 if ( pModalWindow ) | 4601 if ( pModalWindow ) |
4607 { | 4602 { |
4608 ModalWindow_Release(); | 4603 ModalWindow_Release(); |
4609 break; | 4604 break; |
4610 } | 4605 } |
4611 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) | 4606 if ( !(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000)) |
4612 break; | 4607 break; |
4613 v15 = 1; | 4608 v15 = 1; |
4614 pVideoPlayer->bStopBeforeSchedule = 1; | 4609 pVideoPlayer->bStopBeforeSchedule = 1; |
4615 viewparams->bRedrawGameUI = 1; | 4610 viewparams->bRedrawGameUI = 1; |
4616 viewparams->field_48 = 1; | 4611 viewparams->field_48 = 1; |