Mercurial > mm7
comparison mm7_5.cpp @ 998:e4383e6dfbef
ProcessInput
author | Ritor1 |
---|---|
date | Tue, 14 May 2013 17:37:24 +0600 |
parents | 1c13fbaad0c5 |
children | dcdfbb6eede9 |
comparison
equal
deleted
inserted
replaced
997:1c13fbaad0c5 | 998:e4383e6dfbef |
---|---|
80 //const char *v31; // ecx@262 | 80 //const char *v31; // ecx@262 |
81 signed int v32; // eax@269 | 81 signed int v32; // eax@269 |
82 unsigned int v33; // eax@277 | 82 unsigned int v33; // eax@277 |
83 unsigned __int8 v34; // al@279 | 83 unsigned __int8 v34; // al@279 |
84 unsigned __int8 v35; // al@280 | 84 unsigned __int8 v35; // al@280 |
85 GUIWindow *pWindow3; // ecx@332 | 85 //GUIWindow *pWindow3; // ecx@332 |
86 int v37; // eax@341 | 86 int v37; // eax@341 |
87 int v38; // eax@358 | 87 int v38; // eax@358 |
88 SHORT v39; // ax@365 | 88 SHORT v39; // ax@365 |
89 //signed int v40; // eax@365 | 89 //signed int v40; // eax@365 |
90 char *v41; // eax@380 | 90 char *v41; // eax@380 |
95 signed int v46; // ecx@398 | 95 signed int v46; // ecx@398 |
96 char v47; // zf@399 | 96 char v47; // zf@399 |
97 char v48; // zf@405 | 97 char v48; // zf@405 |
98 BLVFace *pBLVFace; // ecx@410 | 98 BLVFace *pBLVFace; // ecx@410 |
99 ODMFace *pODMFace; // ecx@412 | 99 ODMFace *pODMFace; // ecx@412 |
100 CastSpellInfo *v51; // ecx@415 | 100 CastSpellInfo *pSpellInfo; // ecx@415 |
101 void *v52; // eax@424 | 101 void *v52; // eax@424 |
102 __int16 v53; // ax@431 | 102 __int16 v53; // ax@431 |
103 int v54; // eax@432 | 103 int v54; // eax@432 |
104 int v55; // ecx@432 | 104 int v55; // ecx@432 |
105 int v56; // edx@432 | 105 int v56; // edx@432 |
1484 pCurrentScreen = SCREEN_GAME; | 1484 pCurrentScreen = SCREEN_GAME; |
1485 viewparams->bRedrawGameUI = 1; | 1485 viewparams->bRedrawGameUI = 1; |
1486 pIcons_LOD->_4355F7(); | 1486 pIcons_LOD->_4355F7(); |
1487 continue; | 1487 continue; |
1488 } | 1488 } |
1489 LABEL_319: | |
1490 CharacterUI_ReleaseButtons(); | 1489 CharacterUI_ReleaseButtons(); |
1491 sub_419379(); | 1490 sub_419379(); |
1492 pIcons_LOD->_4114F2(); | 1491 pIcons_LOD->_4114F2(); |
1493 } | 1492 } |
1494 if ( pGUIWindow_Settings ) | 1493 if ( pGUIWindow_Settings ) |
1517 pCurrentScreen = SCREEN_GAME; | 1516 pCurrentScreen = SCREEN_GAME; |
1518 viewparams->bRedrawGameUI = 1; | 1517 viewparams->bRedrawGameUI = 1; |
1519 pIcons_LOD->_4355F7(); | 1518 pIcons_LOD->_4355F7(); |
1520 continue; | 1519 continue; |
1521 } | 1520 } |
1522 pWindow3 = pGUIWindow_Settings; | |
1523 if ( !pGUIWindow_Settings )//Draw Menu | 1521 if ( !pGUIWindow_Settings )//Draw Menu |
1524 { | 1522 { |
1525 dword_6BE138 = -1; | 1523 dword_6BE138 = -1; |
1526 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, 1); | 1524 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, 1); |
1527 pEventTimer->Pause(); | 1525 pEventTimer->Pause(); |
1563 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | 1561 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); |
1564 free((void *)uNumSeconds); | 1562 free((void *)uNumSeconds); |
1565 stru_506E40._40E55E("gamma.pcx", 0); | 1563 stru_506E40._40E55E("gamma.pcx", 0); |
1566 continue; | 1564 continue; |
1567 } | 1565 } |
1568 pWindow3->Release(); | 1566 pGUIWindow_Settings->Release(); |
1569 pGUIWindow_Settings = 0; | 1567 pGUIWindow_Settings = 0; |
1570 pMouse->SetCursorBitmap("MICON1"); | 1568 pMouse->SetCursorBitmap("MICON1"); |
1571 GameUI_Footer_TimeLeft = 0; | 1569 GameUI_Footer_TimeLeft = 0; |
1572 unk_50C9A0 = 0; | 1570 unk_50C9A0 = 0; |
1573 back_to_game(); | 1571 back_to_game(); |
1803 if ( v45 == 3 ) | 1801 if ( v45 == 3 ) |
1804 { | 1802 { |
1805 v47 = pActors[v46].uAIState == Dead; | 1803 v47 = pActors[v46].uAIState == Dead; |
1806 if ( !v47 ) | 1804 if ( !v47 ) |
1807 continue; | 1805 continue; |
1808 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1806 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1809 LOBYTE(v51->field_8) &= 0xBFu; | 1807 LOBYTE(pSpellInfo->field_8) &= 0xBFu; |
1810 v51->uPlayerID_2 = uMessageParam; | 1808 pSpellInfo->uPlayerID_2 = uMessageParam; |
1811 v51->spell_target_pid = v44; | 1809 pSpellInfo->spell_target_pid = v44; |
1812 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 1810 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
1813 pWindow3 = pGUIWindow_Settings; | 1811 pGUIWindow_Settings->Release(); |
1814 pWindow3->Release(); | |
1815 pGUIWindow_Settings = 0; | 1812 pGUIWindow_Settings = 0; |
1816 pMouse->SetCursorBitmap("MICON1"); | 1813 pMouse->SetCursorBitmap("MICON1"); |
1817 GameUI_Footer_TimeLeft = 0; | 1814 GameUI_Footer_TimeLeft = 0; |
1818 unk_50C9A0 = 0; | 1815 unk_50C9A0 = 0; |
1819 back_to_game(); | 1816 back_to_game(); |
1822 if ( v45 == 2 ) | 1819 if ( v45 == 2 ) |
1823 { | 1820 { |
1824 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; | 1821 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0; |
1825 if ( !v47 ) | 1822 if ( !v47 ) |
1826 continue; | 1823 continue; |
1827 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1824 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1828 LOBYTE(v51->field_8) &= 0xBFu; | 1825 LOBYTE(pSpellInfo->field_8) &= 0xBFu; |
1829 v51->uPlayerID_2 = uMessageParam; | 1826 pSpellInfo->uPlayerID_2 = uMessageParam; |
1830 v51->spell_target_pid = v44; | 1827 pSpellInfo->spell_target_pid = v44; |
1831 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 1828 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
1832 pWindow3 = pGUIWindow_Settings; | 1829 pGUIWindow_Settings->Release(); |
1833 pWindow3->Release(); | |
1834 pGUIWindow_Settings = 0; | 1830 pGUIWindow_Settings = 0; |
1835 pMouse->SetCursorBitmap("MICON1"); | 1831 pMouse->SetCursorBitmap("MICON1"); |
1836 GameUI_Footer_TimeLeft = 0; | 1832 GameUI_Footer_TimeLeft = 0; |
1837 unk_50C9A0 = 0; | 1833 unk_50C9A0 = 0; |
1838 back_to_game(); | 1834 back_to_game(); |
1850 { | 1846 { |
1851 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; | 1847 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; |
1852 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) | 1848 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) |
1853 continue; | 1849 continue; |
1854 v44 = uNumSeconds; | 1850 v44 = uNumSeconds; |
1855 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1851 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1856 *((char *)v51 + 8) &= 0xBFu; | 1852 LOBYTE(pSpellInfo->field_8) &= 0xBFu; |
1857 v51->uPlayerID_2 = uMessageParam; | 1853 pSpellInfo->uPlayerID_2 = uMessageParam; |
1858 v51->spell_target_pid = v44; | 1854 pSpellInfo->spell_target_pid = v44; |
1859 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 1855 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
1860 pWindow3 = pGUIWindow_Settings; | 1856 pGUIWindow_Settings->Release(); |
1861 pWindow3->Release(); | |
1862 pGUIWindow_Settings = 0; | 1857 pGUIWindow_Settings = 0; |
1863 pMouse->SetCursorBitmap("MICON1"); | 1858 pMouse->SetCursorBitmap("MICON1"); |
1864 GameUI_Footer_TimeLeft = 0; | 1859 GameUI_Footer_TimeLeft = 0; |
1865 unk_50C9A0 = 0; | 1860 unk_50C9A0 = 0; |
1866 back_to_game(); | 1861 back_to_game(); |
1871 continue; | 1866 continue; |
1872 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; | 1867 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; |
1873 } | 1868 } |
1874 if ( v48 ) | 1869 if ( v48 ) |
1875 continue; | 1870 continue; |
1876 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1871 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1877 LOBYTE(v51->field_8) &= 0xBFu; | 1872 LOBYTE(pSpellInfo->field_8) &= 0xBFu; |
1878 v51->uPlayerID_2 = uMessageParam; | 1873 pSpellInfo->uPlayerID_2 = uMessageParam; |
1879 v51->spell_target_pid = v44; | 1874 pSpellInfo->spell_target_pid = v44; |
1880 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 1875 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
1881 pWindow3 = pGUIWindow_Settings; | 1876 pGUIWindow_Settings->Release(); |
1882 pWindow3->Release(); | |
1883 pGUIWindow_Settings = 0; | 1877 pGUIWindow_Settings = 0; |
1884 pMouse->SetCursorBitmap("MICON1"); | 1878 pMouse->SetCursorBitmap("MICON1"); |
1885 GameUI_Footer_TimeLeft = 0; | 1879 GameUI_Footer_TimeLeft = 0; |
1886 unk_50C9A0 = 0; | 1880 unk_50C9A0 = 0; |
1887 back_to_game(); | 1881 back_to_game(); |
1888 continue; | 1882 continue; |
1889 case UIMSG_CastSpell_8F: | 1883 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade),regeneration |
1890 __debugbreak(); | 1884 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure |
1891 case UIMSG_CastSpell_SPIRIT_Preservation://and blessing, treatment paralysis, hand hammers(individual upgrade) | 1885 case UIMSG_HiredNPC_CastSpell: |
1892 case UIMSG_CastSpell_SPIRIT_Fate: | |
1893 if ( pMessageQueue_50CBD0->uNumMessages ) | 1886 if ( pMessageQueue_50CBD0->uNumMessages ) |
1894 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1887 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1895 if ( unk_50C9A0 ) | 1888 if ( unk_50C9A0 ) |
1896 { | 1889 { |
1897 uActiveCharacter = uMessageParam; | 1890 uActiveCharacter = uMessageParam; |
1899 } | 1892 } |
1900 else | 1893 else |
1901 { | 1894 { |
1902 if ( pGUIWindow_Settings ) | 1895 if ( pGUIWindow_Settings ) |
1903 { | 1896 { |
1904 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 1897 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
1905 switch ( uMessage ) | 1898 switch ( uMessage ) |
1906 { | 1899 { |
1907 case UIMSG_CastSpell_SPIRIT_Preservation: | 1900 case UIMSG_CastSpell_Character_Big_Improvement: |
1908 LOBYTE(v51->field_8) &= 0xFDu; | 1901 LOBYTE(pSpellInfo->field_8) &= 0xFDu; |
1909 break; | 1902 break; |
1910 case UIMSG_CastSpell_SPIRIT_Fate: | 1903 case UIMSG_CastSpell_Character_Small_Improvement: |
1911 HIBYTE(v51->field_8) &= 0xFEu; | 1904 HIBYTE(pSpellInfo->field_8) &= 0xFEu; |
1912 break; | 1905 break; |
1913 case UIMSG_CastSpell_8F: | 1906 case UIMSG_HiredNPC_CastSpell: |
1914 HIBYTE(v51->field_8) &= 0xFDu; | 1907 HIBYTE(pSpellInfo->field_8) &= 0xFDu; |
1915 break; | 1908 break; |
1916 } | 1909 } |
1917 v51->uPlayerID_2 = uMessageParam; | 1910 pSpellInfo->uPlayerID_2 = uMessageParam; |
1918 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 1911 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
1919 pGUIWindow_Settings->Release(); | 1912 pGUIWindow_Settings->Release(); |
1920 pGUIWindow_Settings = 0; | 1913 pGUIWindow_Settings = 0; |
1921 pEventTimer->Resume(); | 1914 pEventTimer->Resume(); |
1922 pMouse->SetCursorBitmap("MICON1"); | 1915 pMouse->SetCursorBitmap("MICON1"); |
1923 GameUI_Footer_TimeLeft = 0; | 1916 GameUI_Footer_TimeLeft = 0; |
2397 v1 = ""; | 2390 v1 = ""; |
2398 continue; | 2391 continue; |
2399 } | 2392 } |
2400 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); | 2393 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); |
2401 continue; | 2394 continue; |
2402 case UIMSG_CastSpell_GreatShot://??? | 2395 case UIMSG_CastSpell_Monster_Improvement://Fate, cure |
2403 __debugbreak(); | 2396 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm, |
2404 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, | |
2405 if ( pRenderer->pRenderD3D ) | 2397 if ( pRenderer->pRenderD3D ) |
2406 { | 2398 { |
2407 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 2399 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
2408 } | 2400 } |
2409 else | 2401 else |
2418 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) | 2410 if ( PID_TYPE(v44) != 3 || v84 >= 5120 ) |
2419 { | 2411 { |
2420 v1 = ""; | 2412 v1 = ""; |
2421 continue; | 2413 continue; |
2422 } | 2414 } |
2423 v51 = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | 2415 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; |
2424 if ( uMessage == UIMSG_CastSpell_SmallShot ) | 2416 if ( uMessage == UIMSG_CastSpell_Shoot_Monster ) |
2425 { | 2417 { |
2426 LOBYTE(v51->field_8) &= 0xF7; | 2418 LOBYTE(pSpellInfo->field_8) &= 0xF7; |
2427 } | 2419 } |
2428 else | 2420 else |
2429 { | 2421 { |
2430 if ( uMessage == UIMSG_CastSpell_GreatShot ) | 2422 if ( uMessage == UIMSG_CastSpell_Monster_Improvement ) |
2431 HIBYTE(v51->field_8) &= 0xFEu; | 2423 HIBYTE(pSpellInfo->field_8) &= 0xFEu; |
2432 else | 2424 else |
2433 HIBYTE(v51->field_8) &= 0xFDu; | 2425 HIBYTE(pSpellInfo->field_8) &= 0xFDu; |
2434 } | 2426 } |
2435 v51->uPlayerID_2 = uMessageParam; | 2427 pSpellInfo->uPlayerID_2 = uMessageParam; |
2436 v51->spell_target_pid = v44; | 2428 pSpellInfo->spell_target_pid = v44; |
2437 pParty->pPlayers[v51->uPlayerID].SetRecoveryTime(300); | 2429 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300); |
2438 pWindow3 = pGUIWindow_Settings; | 2430 pGUIWindow_Settings->Release(); |
2439 pWindow3->Release(); | |
2440 pGUIWindow_Settings = 0; | 2431 pGUIWindow_Settings = 0; |
2441 pMouse->SetCursorBitmap("MICON1"); | 2432 pMouse->SetCursorBitmap("MICON1"); |
2442 GameUI_Footer_TimeLeft = 0; | 2433 GameUI_Footer_TimeLeft = 0; |
2443 unk_50C9A0 = 0; | 2434 unk_50C9A0 = 0; |
2444 back_to_game(); | 2435 back_to_game(); |
2803 pEventTimer->Resume(); | 2794 pEventTimer->Resume(); |
2804 viewparams->bRedrawGameUI = 1; | 2795 viewparams->bRedrawGameUI = 1; |
2805 pCurrentScreen = SCREEN_GAME; | 2796 pCurrentScreen = SCREEN_GAME; |
2806 pIcons_LOD->_4114F2(); | 2797 pIcons_LOD->_4114F2(); |
2807 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; | 2798 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage; |
2808 if ( dword_50C9E8 < 40 ) | 2799 /*if ( dword_50C9E8 < 40 ) |
2809 { | 2800 { |
2810 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; | 2801 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; |
2811 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; | 2802 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; |
2812 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; | 2803 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; |
2813 ++dword_50C9E8; | 2804 ++dword_50C9E8; |
2814 } | 2805 }*/ |
2806 pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); | |
2815 } | 2807 } |
2816 else | 2808 else |
2817 { | 2809 { |
2818 byte_506550 = 1; | 2810 byte_506550 = 1; |
2819 quick_spell_at_page = uMessageParam + 1; | 2811 quick_spell_at_page = uMessageParam + 1; |