comparison mm7_5.cpp @ 336:ea55d6414029

Event_proceccor preliminary
author Gloval
date Thu, 21 Feb 2013 00:33:12 +0400
parents 8e23edf57e27
children d27e30e0158a
comparison
equal deleted inserted replaced
329:f76027321087 336:ea55d6414029
1276 } 1276 }
1277 } 1277 }
1278 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1278 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1279 uActiveCharacter = pParty->GetNextActiveCharacter(); 1279 uActiveCharacter = pParty->GetNextActiveCharacter();
1280 pGUIWindow_CurrentMenu->Release(); 1280 pGUIWindow_CurrentMenu->Release();
1281 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1281 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1282 ptr_507BC0 = 0; 1282 window_SpeakInHouse = 0;
1283 pGUIWindow_CurrentMenu = 0; 1283 pGUIWindow_CurrentMenu = 0;
1284 pEventTimer->Resume(); 1284 pEventTimer->Resume();
1285 pCurrentScreen = SCREEN_GAME; 1285 pCurrentScreen = SCREEN_GAME;
1286 viewparams->bRedrawGameUI = v0; 1286 viewparams->bRedrawGameUI = v0;
1287 pIcons_LOD->_4355F7(); 1287 pIcons_LOD->_4355F7();
1309 } 1309 }
1310 } 1310 }
1311 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1311 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1312 uActiveCharacter = pParty->GetNextActiveCharacter(); 1312 uActiveCharacter = pParty->GetNextActiveCharacter();
1313 pGUIWindow_CurrentMenu->Release(); 1313 pGUIWindow_CurrentMenu->Release();
1314 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1314 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1315 ptr_507BC0 = 0; 1315 window_SpeakInHouse = 0;
1316 pGUIWindow_CurrentMenu = 0; 1316 pGUIWindow_CurrentMenu = 0;
1317 pEventTimer->Resume(); 1317 pEventTimer->Resume();
1318 pCurrentScreen = SCREEN_GAME; 1318 pCurrentScreen = SCREEN_GAME;
1319 viewparams->bRedrawGameUI = v0; 1319 viewparams->bRedrawGameUI = v0;
1320 pIcons_LOD->_4355F7(); 1320 pIcons_LOD->_4355F7();
1516 } 1516 }
1517 } 1517 }
1518 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1518 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1519 uActiveCharacter = pParty->GetNextActiveCharacter(); 1519 uActiveCharacter = pParty->GetNextActiveCharacter();
1520 pGUIWindow_CurrentMenu->Release(); 1520 pGUIWindow_CurrentMenu->Release();
1521 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1521 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1522 ptr_507BC0 = 0; 1522 window_SpeakInHouse = 0;
1523 pGUIWindow_CurrentMenu = 0; 1523 pGUIWindow_CurrentMenu = 0;
1524 pEventTimer->Resume(); 1524 pEventTimer->Resume();
1525 pCurrentScreen = SCREEN_GAME; 1525 pCurrentScreen = SCREEN_GAME;
1526 viewparams->bRedrawGameUI = v0; 1526 viewparams->bRedrawGameUI = v0;
1527 pIcons_LOD->_4355F7(); 1527 pIcons_LOD->_4355F7();
1545 continue; 1545 continue;
1546 } 1546 }
1547 sub_4B1D27(); 1547 sub_4B1D27();
1548 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0); 1548 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 814, 0, -1, 0, 0, 0, 0);
1549 pVideoPlayer->Unload(); 1549 pVideoPlayer->Unload();
1550 pGUIWindow_CurrentMenu = ptr_507BC0; 1550 pGUIWindow_CurrentMenu = window_SpeakInHouse;
1551 //goto LABEL_322; 1551 //goto LABEL_322;
1552 if ( pGUIWindow_Settings ) 1552 if ( pGUIWindow_Settings )
1553 { 1553 {
1554 if ( pCurrentScreen == SCREEN_CHARACTERS ) 1554 if ( pCurrentScreen == SCREEN_CHARACTERS )
1555 { 1555 {
1566 } 1566 }
1567 } 1567 }
1568 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1568 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1569 uActiveCharacter = pParty->GetNextActiveCharacter(); 1569 uActiveCharacter = pParty->GetNextActiveCharacter();
1570 pGUIWindow_CurrentMenu->Release(); 1570 pGUIWindow_CurrentMenu->Release();
1571 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1571 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1572 ptr_507BC0 = 0; 1572 window_SpeakInHouse = 0;
1573 pGUIWindow_CurrentMenu = 0; 1573 pGUIWindow_CurrentMenu = 0;
1574 pEventTimer->Resume(); 1574 pEventTimer->Resume();
1575 pCurrentScreen = SCREEN_GAME; 1575 pCurrentScreen = SCREEN_GAME;
1576 viewparams->bRedrawGameUI = v0; 1576 viewparams->bRedrawGameUI = v0;
1577 pIcons_LOD->_4355F7(); 1577 pIcons_LOD->_4355F7();
1639 } 1639 }
1640 } 1640 }
1641 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1641 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1642 uActiveCharacter = pParty->GetNextActiveCharacter(); 1642 uActiveCharacter = pParty->GetNextActiveCharacter();
1643 pGUIWindow_CurrentMenu->Release(); 1643 pGUIWindow_CurrentMenu->Release();
1644 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1644 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1645 ptr_507BC0 = 0; 1645 window_SpeakInHouse = 0;
1646 pGUIWindow_CurrentMenu = 0; 1646 pGUIWindow_CurrentMenu = 0;
1647 pEventTimer->Resume(); 1647 pEventTimer->Resume();
1648 pCurrentScreen = SCREEN_GAME; 1648 pCurrentScreen = SCREEN_GAME;
1649 viewparams->bRedrawGameUI = v0; 1649 viewparams->bRedrawGameUI = v0;
1650 pIcons_LOD->_4355F7(); 1650 pIcons_LOD->_4355F7();
1668 } 1668 }
1669 } 1669 }
1670 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1670 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1671 uActiveCharacter = pParty->GetNextActiveCharacter(); 1671 uActiveCharacter = pParty->GetNextActiveCharacter();
1672 pGUIWindow_CurrentMenu->Release(); 1672 pGUIWindow_CurrentMenu->Release();
1673 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1673 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1674 ptr_507BC0 = 0; 1674 window_SpeakInHouse = 0;
1675 pGUIWindow_CurrentMenu = 0; 1675 pGUIWindow_CurrentMenu = 0;
1676 pEventTimer->Resume(); 1676 pEventTimer->Resume();
1677 pCurrentScreen = SCREEN_GAME; 1677 pCurrentScreen = SCREEN_GAME;
1678 viewparams->bRedrawGameUI = v0; 1678 viewparams->bRedrawGameUI = v0;
1679 pIcons_LOD->_4355F7(); 1679 pIcons_LOD->_4355F7();
1703 } 1703 }
1704 } 1704 }
1705 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 ) 1705 if ( (signed int)uActiveCharacter < v0 || (signed int)uActiveCharacter > 4 )
1706 uActiveCharacter = pParty->GetNextActiveCharacter(); 1706 uActiveCharacter = pParty->GetNextActiveCharacter();
1707 pGUIWindow_CurrentMenu->Release(); 1707 pGUIWindow_CurrentMenu->Release();
1708 if ( pGUIWindow_CurrentMenu == ptr_507BC0 ) 1708 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
1709 ptr_507BC0 = 0; 1709 window_SpeakInHouse = 0;
1710 pGUIWindow_CurrentMenu = 0; 1710 pGUIWindow_CurrentMenu = 0;
1711 pEventTimer->Resume(); 1711 pEventTimer->Resume();
1712 pCurrentScreen = SCREEN_GAME; 1712 pCurrentScreen = SCREEN_GAME;
1713 viewparams->bRedrawGameUI = v0; 1713 viewparams->bRedrawGameUI = v0;
1714 pIcons_LOD->_4355F7(); 1714 pIcons_LOD->_4355F7();
1847 sub_44987B(dword_591164_teleport_map_name, 0); 1847 sub_44987B(dword_591164_teleport_map_name, 0);
1848 } 1848 }
1849 } 1849 }
1850 else 1850 else
1851 { 1851 {
1852 dword_597F18 = dword_5C341C; 1852 start_event_seq_number = dword_5C341C;
1853 EventProcessor(dword_5C3418, 0, v0); 1853 EventProcessor(dword_5C3418, 0, v0);
1854 } 1854 }
1855 dword_597F18 = 0; 1855 start_event_seq_number = 0;
1856 if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) 1856 if ( !_strcmpi(byte_6BE3B0, "d05.blv") )
1857 pParty->uTimePlayed += 1474560i64; 1857 pParty->uTimePlayed += 1474560i64;
1858 continue; 1858 continue;
1859 case UIMSG_19C: 1859 case UIMSG_19C:
1860 CloseWindowBackground(); 1860 CloseWindowBackground();
1861 pVideoPlayer->Unload(); 1861 pVideoPlayer->Unload();
1862 sub_44603D(); 1862 sub_44603D();
1863 dword_597F18 = 0; 1863 start_event_seq_number = 0;
1864 goto LABEL_422; 1864 goto LABEL_422;
1865 case UIMSG_CycleCharacters: 1865 case UIMSG_CycleCharacters:
1866 v39 = GetAsyncKeyState(VK_SHIFT); 1866 v39 = GetAsyncKeyState(VK_SHIFT);
1867 v40 = CycleCharacter(v39); 1867 v40 = CycleCharacter(v39);
1868 goto LABEL_421; 1868 goto LABEL_421;
2124 SaveGame(v0, 0); 2124 SaveGame(v0, 0);
2125 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); 2125 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
2126 dword_6BE364_game_settings_1 |= v0; 2126 dword_6BE364_game_settings_1 |= v0;
2127 uGameState = 2; 2127 uGameState = 2;
2128 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; 2128 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
2129 v53 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1]._quest_related; 2129 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
2130 if ( v53 < 0 ) 2130 if ( v53 < 0 )
2131 { 2131 {
2132 v54 = abs(v53) - 1; 2132 v54 = abs(v53) - 1;
2133 _5B65B8_npcdata_hiword_house_or_other = 0; 2133 _5B65B8_npcdata_hiword_house_or_other = 0;
2134 dword_5B65BC = 0; 2134 dword_5B65BC = 0;
12570 void *v0; // eax@1 12570 void *v0; // eax@1
12571 stru348 *v1; // eax@1 12571 stru348 *v1; // eax@1
12572 int v2; // ecx@1 12572 int v2; // ecx@1
12573 int v3; // eax@1 12573 int v3; // eax@1
12574 12574
12575 v0 = ptr_507BC0->ptr_1C; 12575 v0 = window_SpeakInHouse->ptr_1C;
12576 dword_4E1874 = 5; 12576 dword_4E1874 = 5;
12577 v1 = &stru_4E1890[(int)((char *)v0 - 108)]; 12577 v1 = &stru_4E1890[(int)((char *)v0 - 108)];
12578 amuint_4E1860 = v1->field_4; 12578 amuint_4E1860 = v1->field_4;
12579 amuint_4E1864 = v1->field_6; 12579 amuint_4E1864 = v1->field_6;
12580 amuint_4E1868 = v1->field_8 - 1; 12580 amuint_4E1868 = v1->field_8 - 1;
15813 DrawBranchlessDialogueUI(); 15813 DrawBranchlessDialogueUI();
15814 } 15814 }
15815 continue; 15815 continue;
15816 } 15816 }
15817 pWindowList[pVisibleWindowsIdxs[i] - 1]._4B3157(); 15817 pWindowList[pVisibleWindowsIdxs[i] - 1]._4B3157();
15818 if ( !ptr_507BC0 ) 15818 if ( !window_SpeakInHouse )
15819 continue; 15819 continue;
15820 v10 = ptr_507BC0->ptr_1C; 15820 v10 = window_SpeakInHouse->ptr_1C;
15821 if ( (signed int)v10 >= 53 ) 15821 if ( (signed int)v10 >= 53 )
15822 continue; 15822 continue;
15823 v11 = pParty->field_3C._shop_ban_times[2 * (_DWORD)v10 + 1]; 15823 v11 = pParty->field_3C._shop_ban_times[2 * (_DWORD)v10 + 1];
15824 if ( !__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * (_DWORD)v10]) 15824 if ( !__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * (_DWORD)v10])
15825 || v11 < SHIDWORD(pParty->uTimePlayed) 15825 || v11 < SHIDWORD(pParty->uTimePlayed)