Mercurial > mm7
comparison mm7_2.cpp @ 1038:39f42990698f
Cleanings
author | Nomad |
---|---|
date | Thu, 23 May 2013 03:29:29 +0200 |
parents | 3a5c8df8381d |
children | 05c62d166182 |
comparison
equal
deleted
inserted
replaced
1035:306ec23b37df | 1038:39f42990698f |
---|---|
800 unsigned int v2; // esi@30 | 800 unsigned int v2; // esi@30 |
801 //const char *v3; // ebx@31 | 801 //const char *v3; // ebx@31 |
802 | 802 |
803 if ( pMessageQueue_50CBD0->uNumMessages ) | 803 if ( pMessageQueue_50CBD0->uNumMessages ) |
804 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 804 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
805 pKeyActionMap->_459ED1(3); | 805 pKeyActionMap->SetWindowInputStatus(3); |
806 pKeyActionMap->ResetKeys(); | 806 pKeyActionMap->ResetKeys(); |
807 activeLevelDecoration = NULL; | 807 activeLevelDecoration = NULL; |
808 current_npc_text = 0; | 808 current_npc_text = 0; |
809 if ( pDialogueNPCCount ) | 809 if ( pDialogueNPCCount ) |
810 { | 810 { |
6632 Texture *pTexture; // [sp-14h] [bp-50h]@39 | 6632 Texture *pTexture; // [sp-14h] [bp-50h]@39 |
6633 GUIButton *pButton2; // [sp+0h] [bp-3Ch]@27 | 6633 GUIButton *pButton2; // [sp+0h] [bp-3Ch]@27 |
6634 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 | 6634 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 |
6635 | 6635 |
6636 pCurrentScreen = SCREEN_GAME; | 6636 pCurrentScreen = SCREEN_GAME; |
6637 if (pAsyncMouse) | 6637 |
6638 pAsyncMouse->Resume(); | |
6639 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | |
6640 pAsyncKeyboard->Resume(); | |
6641 pGUIWindow2 = 0; | 6638 pGUIWindow2 = 0; |
6642 pAudioPlayer->StopChannels(-1, -1); | 6639 pAudioPlayer->StopChannels(-1, -1); |
6643 pMouse->RemoveHoldingItem(); | 6640 pMouse->RemoveHoldingItem(); |
6644 | 6641 |
6645 pIcons_LOD->_inlined_sub2(); | 6642 pIcons_LOD->_inlined_sub2(); |
6692 } | 6689 } |
6693 else | 6690 else |
6694 { | 6691 { |
6695 pRenderer->BeginScene(); | 6692 pRenderer->BeginScene(); |
6696 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); | 6693 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); |
6697 if (pAsyncMouse) | 6694 |
6698 pAsyncMouse->_46B736_consume_click_lists(1); | |
6699 GUI_MainMenuMessageProc(); | 6695 GUI_MainMenuMessageProc(); |
6700 GUI_UpdateWindows(); | 6696 GUI_UpdateWindows(); |
6701 if (pAsyncMouse) | 6697 |
6702 pAsyncMouse->_46B736_consume_click_lists(1); | |
6703 if (GetCurrentMenuID() != MENU_MAIN) | 6698 if (GetCurrentMenuID() != MENU_MAIN) |
6704 { | 6699 { |
6705 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) | 6700 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) |
6706 { | 6701 { |
6707 pIcons_LOD->_4114F2(); | 6702 pIcons_LOD->_4114F2(); |
7014 case WM_SIZING: | 7009 case WM_SIZING: |
7015 return 1; | 7010 return 1; |
7016 case WM_LBUTTONDOWN: | 7011 case WM_LBUTTONDOWN: |
7017 if ( pArcomageGame->bGameInProgress ) | 7012 if ( pArcomageGame->bGameInProgress ) |
7018 { | 7013 { |
7019 if (pAsyncMouse) | |
7020 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7021 pArcomageGame->stru1.field_0 = 7; | 7014 pArcomageGame->stru1.field_0 = 7; |
7022 ArcomageGame::OnMouseClick(0, 1); | 7015 ArcomageGame::OnMouseClick(0, 1); |
7023 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7016 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7024 } | 7017 } |
7025 goto __handle_mouse_click; | 7018 goto __handle_mouse_click; |
7029 if ( !pArcomageGame->bGameInProgress ) | 7022 if ( !pArcomageGame->bGameInProgress ) |
7030 //goto LABEL_240; | 7023 //goto LABEL_240; |
7031 { | 7024 { |
7032 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) | 7025 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) |
7033 pVideoPlayer->bStopBeforeSchedule = 1; | 7026 pVideoPlayer->bStopBeforeSchedule = 1; |
7034 if (!pAsyncMouse) | 7027 |
7035 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7028 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7036 if (pGame) | 7029 if (pGame) |
7037 { | 7030 { |
7038 if (pAsyncMouse) | |
7039 //goto _def_wnd_proc; | |
7040 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7041 v33 = pGame->pIndoorCameraD3D->GetPickDepth(); | 7031 v33 = pGame->pIndoorCameraD3D->GetPickDepth(); |
7042 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); | 7032 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); |
7043 } | 7033 } |
7044 if (!pAsyncMouse) | 7034 |
7045 { | |
7046 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); | 7035 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); |
7047 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7036 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7048 } | 7037 |
7049 //goto _def_wnd_proc; | 7038 } |
7050 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7039 |
7051 } | |
7052 if (pAsyncMouse) | |
7053 //goto _def_wnd_proc; | |
7054 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7055 pArcomageGame->stru1.field_0 = 8; | 7040 pArcomageGame->stru1.field_0 = 8; |
7056 ArcomageGame::OnMouseClick(1, 1); | 7041 ArcomageGame::OnMouseClick(1, 1); |
7057 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7042 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7058 case WM_LBUTTONUP: | 7043 case WM_LBUTTONUP: |
7059 v32 = 0; | 7044 v32 = 0; |
7060 if ( !pArcomageGame->bGameInProgress ) | 7045 if ( !pArcomageGame->bGameInProgress ) |
7061 //goto LABEL_218; | 7046 //goto LABEL_218; |
7062 { | 7047 { |
7063 if ( pAsyncMouse != v32 ) | |
7064 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7065 back_to_game(); | 7048 back_to_game(); |
7066 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7049 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7067 } | 7050 } |
7068 if (pAsyncMouse) | |
7069 //goto _def_wnd_proc; | |
7070 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7071 pArcomageGame->stru1.field_0 = 3; | 7051 pArcomageGame->stru1.field_0 = 3; |
7072 ArcomageGame::OnMouseClick(0, 0); | 7052 ArcomageGame::OnMouseClick(0, 0); |
7073 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7053 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7074 case WM_RBUTTONUP: | 7054 case WM_RBUTTONUP: |
7075 v32 = 0; | 7055 v32 = 0; |
7076 if ( !pArcomageGame->bGameInProgress ) | 7056 if ( !pArcomageGame->bGameInProgress ) |
7077 { | 7057 { |
7078 //LABEL_218: | 7058 //LABEL_218: |
7079 if ( pAsyncMouse != v32 ) | 7059 |
7080 //goto _def_wnd_proc; | |
7081 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7082 back_to_game(); | 7060 back_to_game(); |
7083 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7061 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7084 } | 7062 } |
7085 if (pAsyncMouse) | |
7086 //goto _def_wnd_proc; | |
7087 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7088 pArcomageGame->stru1.field_0 = 4; | 7063 pArcomageGame->stru1.field_0 = 4; |
7089 v29 = 0; | 7064 v29 = 0; |
7090 //goto LABEL_262; | 7065 //goto LABEL_262; |
7091 v30 = 1; | 7066 v30 = 1; |
7092 ArcomageGame::OnMouseClick(v30, v29); | 7067 ArcomageGame::OnMouseClick(v30, v29); |
7093 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7068 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7094 | 7069 |
7095 case WM_LBUTTONDBLCLK: | 7070 case WM_LBUTTONDBLCLK: |
7096 if ( pArcomageGame->bGameInProgress ) | 7071 if ( pArcomageGame->bGameInProgress ) |
7097 { | 7072 { |
7098 if (pAsyncMouse) | |
7099 //goto _def_wnd_proc; | |
7100 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7101 pArcomageGame->stru1.field_0 = 7; | 7073 pArcomageGame->stru1.field_0 = 7; |
7102 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7074 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7103 } | 7075 } |
7104 | 7076 |
7105 __handle_mouse_click: | 7077 __handle_mouse_click: |
7106 if ( pVideoPlayer->pVideoFrame.pPixels ) | 7078 if ( pVideoPlayer->pVideoFrame.pPixels ) |
7107 pVideoPlayer->bStopBeforeSchedule = 1; | 7079 pVideoPlayer->bStopBeforeSchedule = 1; |
7108 | 7080 |
7109 if ( !pAsyncMouse ) | |
7110 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7081 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7111 | 7082 |
7112 if (GetCurrentMenuID() != MENU_CREATEPARTY) | 7083 if (GetCurrentMenuID() != MENU_CREATEPARTY) |
7113 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7084 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7114 else | 7085 else |
7115 { | 7086 { |
7116 UI_OnKeyDown(VK_SELECT); | 7087 UI_OnKeyDown(VK_SELECT); |
7117 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7088 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7118 } | 7089 } |
7119 | 7090 |
7120 if (!pAsyncMouse) | 7091 |
7121 { | |
7122 if (pGame) | 7092 if (pGame) |
7123 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, false, &vis_sprite_filter_3, &vis_door_filter); | 7093 pGame->PickMouse(512.0, (unsigned __int16)lParam, lParam >> 16, false, &vis_sprite_filter_3, &vis_door_filter); |
7124 | 7094 |
7125 UI_OnMouseLeftClick(0); | 7095 UI_OnMouseLeftClick(0); |
7126 } | 7096 |
7127 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7097 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7128 | 7098 |
7129 case WM_RBUTTONDBLCLK: | 7099 case WM_RBUTTONDBLCLK: |
7130 v31 = 0; | 7100 v31 = 0; |
7131 if ( !pArcomageGame->bGameInProgress ) | 7101 if ( !pArcomageGame->bGameInProgress ) |
7132 { | 7102 { |
7133 //LABEL_240: | 7103 //LABEL_240: |
7134 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) | 7104 if ( pVideoPlayer->pVideoFrame.pPixels != (unsigned __int16 *)v31 ) |
7135 pVideoPlayer->bStopBeforeSchedule = 1; | 7105 pVideoPlayer->bStopBeforeSchedule = 1; |
7136 if (!pAsyncMouse) | 7106 |
7137 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7107 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7138 if (pGame) | 7108 if (pGame) |
7139 { | 7109 { |
7140 if (pAsyncMouse) | |
7141 //goto _def_wnd_proc; | |
7142 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7143 v33 = pGame->pIndoorCameraD3D->GetPickDepth(); | 7110 v33 = pGame->pIndoorCameraD3D->GetPickDepth(); |
7144 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); | 7111 pGame->PickMouse(v33, (unsigned __int16)lParam, lParam >> 16, v31, &vis_sprite_filter_2, &vis_door_filter); |
7145 } | 7112 } |
7146 if (!pAsyncMouse) | 7113 |
7147 { | |
7148 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); | 7114 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); |
7149 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7115 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7150 } | 7116 |
7151 //goto _def_wnd_proc; | 7117 } |
7152 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7153 } | |
7154 if (pAsyncMouse) | |
7155 //goto _def_wnd_proc; | |
7156 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7157 pArcomageGame->stru1.field_0 = 8; | 7118 pArcomageGame->stru1.field_0 = 8; |
7158 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7119 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7159 case WM_MBUTTONDOWN: | 7120 case WM_MBUTTONDOWN: |
7160 if ( pRenderer->pRenderD3D ) | 7121 if ( pRenderer->pRenderD3D ) |
7161 { | 7122 { |
7162 if ( pGame && !pAsyncMouse ) | 7123 if ( pGame ) |
7163 { | 7124 { |
7164 v34 = pGame->pIndoorCameraD3D->GetPickDepth(); | 7125 v34 = pGame->pIndoorCameraD3D->GetPickDepth(); |
7165 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &vis_sprite_filter_3, &vis_face_filter); | 7126 pGame->PickMouse(v34, (unsigned __int16)lParam, lParam >> 16, 1, &vis_sprite_filter_3, &vis_face_filter); |
7166 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7127 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7167 } | 7128 } |
7168 //goto _def_wnd_proc; | |
7169 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7170 } | 7129 } |
7171 if ( !pGame ) | 7130 if ( !pGame ) |
7172 //goto _def_wnd_proc; | 7131 //goto _def_wnd_proc; |
7173 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7132 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7174 sub_417871(0); | 7133 sub_417871(0); |
7175 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7134 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7176 case WM_MOUSEMOVE: | 7135 case WM_MOUSEMOVE: |
7177 if ( pArcomageGame->bGameInProgress ) | 7136 if ( pArcomageGame->bGameInProgress ) |
7178 { | 7137 { |
7179 if (pAsyncMouse) | |
7180 //goto _def_wnd_proc; | |
7181 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7182 pXY[0] = (unsigned __int16)lParam; | 7138 pXY[0] = (unsigned __int16)lParam; |
7183 pXY[1] = lParam >> 16; | 7139 pXY[1] = lParam >> 16; |
7184 ArcomageGame::OnMouseMove((POINT *)pXY); | 7140 ArcomageGame::OnMouseMove((POINT *)pXY); |
7185 ArcomageGame::OnMouseClick(0, wParam & 1); | 7141 ArcomageGame::OnMouseClick(0, wParam & 1); |
7186 v29 = (wParam >> 1) & 1; | 7142 v29 = (wParam >> 1) & 1; |
7187 ArcomageGame::OnMouseClick(1, v29); | 7143 ArcomageGame::OnMouseClick(1, v29); |
7188 } | 7144 } |
7189 else | 7145 else |
7190 { | 7146 { |
7191 if (pAsyncMouse) | |
7192 //goto _def_wnd_proc; | |
7193 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
7194 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); | 7147 pMouse->SetMouseClick((unsigned __int16)lParam, lParam >> 16); |
7195 } | 7148 } |
7196 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7149 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
7197 default: | 7150 default: |
7198 //goto _def_wnd_proc; | 7151 //goto _def_wnd_proc; |
7928 ReleaseDC(0, v10); | 7881 ReleaseDC(0, v10); |
7929 if ( a2 != 16 || v11 != 1 ) | 7882 if ( a2 != 16 || v11 != 1 ) |
7930 Abortf(pGlobalTXT_LocalizationStrings[62]); | 7883 Abortf(pGlobalTXT_LocalizationStrings[62]); |
7931 } | 7884 } |
7932 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu; | 7885 BYTE1(dword_6BE364_game_settings_1) &= 0xFEu; |
7933 if (pAsyncMouse) | 7886 |
7934 pAsyncMouse->Resume(); | |
7935 if ( pArcomageGame->bGameInProgress ) | 7887 if ( pArcomageGame->bGameInProgress ) |
7936 { | 7888 { |
7937 pArcomageGame->field_F9 = 1; | 7889 pArcomageGame->field_F9 = 1; |
7938 } | 7890 } |
7939 else | 7891 else |
7944 pEventTimer->Resume(); | 7896 pEventTimer->Resume(); |
7945 if ( BYTE1(dword_6BE364_game_settings_1) & 4 ) | 7897 if ( BYTE1(dword_6BE364_game_settings_1) & 4 ) |
7946 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu; | 7898 BYTE1(dword_6BE364_game_settings_1) &= 0xFBu; |
7947 else | 7899 else |
7948 pMiscTimer->Resume(); | 7900 pMiscTimer->Resume(); |
7949 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | 7901 |
7950 pAsyncKeyboard->Resume(); | 7902 viewparams->bRedrawGameUI = true; |
7951 viewparams->bRedrawGameUI = 1; | |
7952 if ( pVideoPlayer->pSmackerMovie ) | 7903 if ( pVideoPlayer->pSmackerMovie ) |
7953 { | 7904 { |
7954 pRenderer->RestoreFrontBuffer(); | 7905 pRenderer->RestoreFrontBuffer(); |
7955 pRenderer->_4A184C(); | 7906 pRenderer->_4A184C(); |
7956 pVideoPlayer->_4BF5B2(); | 7907 pVideoPlayer->_4BF5B2(); |
7966 { | 7917 { |
7967 while(initing); //ADDED spinlock to allow int players ets! Gloval | 7918 while(initing); //ADDED spinlock to allow int players ets! Gloval |
7968 dword_4E98BC_bApplicationActive = 0; | 7919 dword_4E98BC_bApplicationActive = 0; |
7969 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie ) | 7920 if ( (pVideoPlayer->pSmackerMovie || pVideoPlayer->pBinkMovie) && pVideoPlayer->bPlayingMovie ) |
7970 pVideoPlayer->bStopBeforeSchedule = 1; | 7921 pVideoPlayer->bStopBeforeSchedule = 1; |
7971 if (pAsyncMouse) | 7922 |
7972 pAsyncMouse->Suspend(); | |
7973 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 ) | 7923 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 ) |
7974 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u); | 7924 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u); |
7975 ClipCursor(0); | 7925 ClipCursor(0); |
7976 dword_6BE364_game_settings_1 |= 0x100u; | 7926 dword_6BE364_game_settings_1 |= 0x100u; |
7977 if ( pEventTimer->bPaused ) | 7927 if ( pEventTimer->bPaused ) |
7980 pEventTimer->Pause(); | 7930 pEventTimer->Pause(); |
7981 if ( pMiscTimer->bPaused ) | 7931 if ( pMiscTimer->bPaused ) |
7982 BYTE1(dword_6BE364_game_settings_1) |= 4u; | 7932 BYTE1(dword_6BE364_game_settings_1) |= 4u; |
7983 else | 7933 else |
7984 pMiscTimer->Pause(); | 7934 pMiscTimer->Pause(); |
7985 if ( pGame && LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | 7935 |
7986 pAsyncKeyboard->Suspend(); | |
7987 pAudioPlayer->StopChannels(-1, -1); | 7936 pAudioPlayer->StopChannels(-1, -1); |
7988 if ( pAudioPlayer->hAILRedbook ) | 7937 if ( pAudioPlayer->hAILRedbook ) |
7989 AIL_redbook_pause(pAudioPlayer->hAILRedbook); | 7938 AIL_redbook_pause(pAudioPlayer->hAILRedbook); |
7990 } | 7939 } |
7991 } | 7940 } |
8009 { | 7958 { |
8010 v6 = GetCurrentProcess(); | 7959 v6 = GetCurrentProcess(); |
8011 SetPriorityClass(v6, 0x20u); | 7960 SetPriorityClass(v6, 0x20u); |
8012 if ( pGame ) | 7961 if ( pGame ) |
8013 { | 7962 { |
8014 v7 = pGame->pKeyboardInstance; | 7963 |
8015 if ( v7 ) | 7964 } |
8016 { | 7965 |
8017 if ( LOBYTE(v7->bUsingAsynKeyboard) && pAsyncKeyboard ) | |
8018 pAsyncKeyboard->_45B3A4(); | |
8019 } | |
8020 } | |
8021 if (pAsyncMouse) | |
8022 pAsyncMouse->_46B1DD(); | |
8023 PostQuitMessage(0); | 7966 PostQuitMessage(0); |
8024 return 0; | 7967 return 0; |
8025 } | 7968 } |
8026 if ( Msg == WM_SETFOCUS ) | 7969 if ( Msg == WM_SETFOCUS ) |
8027 { | 7970 { |
8029 { | 7972 { |
8030 dword_4E98BC_bApplicationActive = 0; | 7973 dword_4E98BC_bApplicationActive = 0; |
8031 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 ) | 7974 if ( pRenderer->bUserDirect3D && pRenderer->uAcquiredDirect3DDevice == 1 ) |
8032 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u); | 7975 SetWindowPos(::hWnd, (HWND)0xFFFFFFFE, 0, 0, 0, 0, 0x18u); |
8033 ClipCursor(0); | 7976 ClipCursor(0); |
8034 if (pAsyncMouse) | 7977 |
8035 { | |
8036 pAsyncMouse->Suspend(); | |
8037 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
8038 } | |
8039 } | 7978 } |
8040 //_def_wnd_proc: | 7979 //_def_wnd_proc: |
8041 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 7980 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
8042 } | 7981 } |
8043 if ( Msg != WM_KILLFOCUS ) | 7982 if ( Msg != WM_KILLFOCUS ) |
8068 return 0; | 8007 return 0; |
8069 } | 8008 } |
8070 //goto _def_wnd_proc; | 8009 //goto _def_wnd_proc; |
8071 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 8010 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
8072 } | 8011 } |
8073 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || !pAsyncMouse ) | 8012 if ( ::hWnd != (HWND)wParam || (dword_4E98BC_bApplicationActive = 1, pRenderer->bWindowMode) || true ) |
8074 return DefWindowProcA(hWnd, Msg, wParam, lParam); | 8013 return DefWindowProcA(hWnd, Msg, wParam, lParam); |
8075 pAsyncMouse->Resume(); | 8014 |
8076 if ( !pAsyncMouse ) | |
8077 //goto _def_wnd_proc; | |
8078 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
8079 pAsyncMouse->Clip(); | |
8080 return DefWindowProcA(hWnd, Msg, wParam, lParam); | |
8081 } | 8015 } |
8082 | 8016 |
8083 //----- (00464479) -------------------------------------------------------- | 8017 //----- (00464479) -------------------------------------------------------- |
8084 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() | 8018 void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() |
8085 { | 8019 { |
9071 // not in window | 9005 // not in window |
9072 { | 9006 { |
9073 SetMenu(hWnd, 0); | 9007 SetMenu(hWnd, 0); |
9074 SetWindowLongA(hWnd, GWL_EXSTYLE, 0); | 9008 SetWindowLongA(hWnd, GWL_EXSTYLE, 0); |
9075 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE); | 9009 SetWindowLongA(hWnd, GWL_STYLE, WS_VISIBLE); |
9076 if (pAsyncMouse) | |
9077 pAsyncMouse->Clip(); | |
9078 pRenderer->InitializeFullscreen(hWnd); | 9010 pRenderer->InitializeFullscreen(hWnd); |
9079 } | 9011 } |
9080 else | 9012 else |
9081 { | 9013 { |
9082 ClipCursor(nullptr); | 9014 ClipCursor(nullptr); |
9153 int v7; // edx@7 | 9085 int v7; // edx@7 |
9154 ObjectDesc *v8; // eax@7 | 9086 ObjectDesc *v8; // eax@7 |
9155 char pContainer[32]; // [sp+10h] [bp-Ch]@9 | 9087 char pContainer[32]; // [sp+10h] [bp-Ch]@9 |
9156 | 9088 |
9157 pMouse->Initialize(hWnd); | 9089 pMouse->Initialize(hWnd); |
9158 CreateAsyncMouse(); | |
9159 CreateAsyncKeyboard(); | |
9160 | 9090 |
9161 pItemsTable = new ItemsTable; | 9091 pItemsTable = new ItemsTable; |
9162 pItemsTable->Initialize(); | 9092 pItemsTable->Initialize(); |
9163 | 9093 |
9164 pBitmaps_LOD->dword_011BA8 = 1; | 9094 pBitmaps_LOD->dword_011BA8 = 1; |
9521 else | 9451 else |
9522 { | 9452 { |
9523 if (GetCurrentMenuID() != MENU_10) | 9453 if (GetCurrentMenuID() != MENU_10) |
9524 goto LABEL_49; | 9454 goto LABEL_49; |
9525 pMouse->Activate(0); | 9455 pMouse->Activate(0); |
9526 if (pAsyncMouse) | 9456 |
9527 pAsyncMouse->Suspend(); | |
9528 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | |
9529 pAsyncKeyboard->Suspend(); | |
9530 pParty->Reset(); | 9457 pParty->Reset(); |
9531 pParty->CreateDefaultParty(1); | 9458 pParty->CreateDefaultParty(1); |
9532 crt_init_globals_46271C(); | 9459 crt_init_globals_46271C(); |
9533 extern OPENFILENAMEA ofn; | 9460 extern OPENFILENAMEA ofn; |
9534 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) | 9461 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) |
9535 { | 9462 { |
9536 pMouse->Activate(1); | 9463 pMouse->Activate(1); |
9537 if (pAsyncMouse) | 9464 |
9538 pAsyncMouse->Resume(); | |
9539 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | |
9540 pAsyncKeyboard->Resume(); | |
9541 break; | 9465 break; |
9542 } | 9466 } |
9543 _chdir("..\\"); | 9467 _chdir("..\\"); |
9544 strcpy(pCurrentMapName, ofn.lpstrFileTitle); | 9468 strcpy(pCurrentMapName, ofn.lpstrFileTitle); |
9545 pMouse->Activate(1); | 9469 pMouse->Activate(1); |
9546 if (pAsyncMouse) | |
9547 pAsyncMouse->Resume(); | |
9548 if ( LOBYTE(pGame->pKeyboardInstance->bUsingAsynKeyboard) && pAsyncKeyboard ) | |
9549 pAsyncKeyboard->Resume(); | |
9550 } | 9470 } |
9551 //LABEL_48: | 9471 //LABEL_48: |
9552 pGame->Loop(); | 9472 pGame->Loop(); |
9553 LABEL_49: | 9473 LABEL_49: |
9554 if ( uGameState == GAME_STATE_3 ) | 9474 if ( uGameState == GAME_STATE_3 ) |
9588 char __cdecl sub_4637E0_is_there_popup_onscreen() | 9508 char __cdecl sub_4637E0_is_there_popup_onscreen() |
9589 { | 9509 { |
9590 return dword_507BF0_is_there_popup_onscreen == 1; | 9510 return dword_507BF0_is_there_popup_onscreen == 1; |
9591 } | 9511 } |
9592 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen; | 9512 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen; |
9593 | |
9594 //----- (00465F5A) -------------------------------------------------------- | |
9595 void __cdecl CreateAsyncMouse() | |
9596 { | |
9597 LOG_DECOMPILATION_WARNING(); | |
9598 /* | |
9599 if (!pAsyncMouse && | |
9600 pRenderer->bUserDirect3D && | |
9601 pRenderer->uAcquiredDirect3DDevice == 1) | |
9602 { | |
9603 pAsyncMouse = new AsyncMouse(&pRenderer->pDirectDraw4); | |
9604 if (pAsyncMouse) | |
9605 pAsyncMouse->Resume(); | |
9606 }*/ | |
9607 } | |
9608 | |
9609 //----- (00465FF0) -------------------------------------------------------- | |
9610 void __cdecl CreateAsyncKeyboard() | |
9611 { | |
9612 LOG_DECOMPILATION_WARNING(); | |
9613 /* | |
9614 if (!pAsyncKeyboard && | |
9615 pGame->pKeyboardInstance->bUsingAsynKeyboard) | |
9616 { | |
9617 pAsyncKeyboard = new AsyncKeyboard; | |
9618 if (pAsyncKeyboard) | |
9619 pAsyncKeyboard->Resume(); | |
9620 }*/ | |
9621 } | |
9622 | 9513 |
9623 //----- (00466082) -------------------------------------------------------- | 9514 //----- (00466082) -------------------------------------------------------- |
9624 void MM6_Initialize(const wchar_t *pIniFilename) | 9515 void MM6_Initialize(const wchar_t *pIniFilename) |
9625 { | 9516 { |
9626 //int v0; // eax@1 | 9517 //int v0; // eax@1 |
9860 default: return L"unk"; | 9751 default: return L"unk"; |
9861 }; | 9752 }; |
9862 }; | 9753 }; |
9863 void SetCurrentMenuID(MENU_STATE uMenu) | 9754 void SetCurrentMenuID(MENU_STATE uMenu) |
9864 { | 9755 { |
9865 if ((int)uCurrentMenuID != -1) | |
9866 { | |
9867 if (pGame->pKeyboardInstance->bUsingAsynKeyboard && pAsyncKeyboard) | |
9868 pAsyncKeyboard->Resume(); | |
9869 } | |
9870 uCurrentMenuID = uMenu; | 9756 uCurrentMenuID = uMenu; |
9871 | 9757 |
9872 Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu)); | 9758 Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu)); |
9873 } | 9759 } |
9874 | 9760 |
9876 MENU_STATE GetCurrentMenuID() | 9762 MENU_STATE GetCurrentMenuID() |
9877 { | 9763 { |
9878 return uCurrentMenuID; | 9764 return uCurrentMenuID; |
9879 } | 9765 } |
9880 | 9766 |
9881 //----- (00467D5D) -------------------------------------------------------- | 9767 |
9882 int __thiscall sub_467D5D(int _this) | 9768 //----- (00467E7F) -------------------------------------------------------- |
9769 void sub_467E7F_EquipBody(ITEM_EQUIP_TYPE uEquipType) | |
9883 { | 9770 { |
9884 return *(int *)(_this + 7204); | 9771 //unsigned int v1; // esi@1 |
9885 } | |
9886 | |
9887 //----- (00467E7F) -------------------------------------------------------- | |
9888 void __thiscall sub_467E7F_EquipBody(unsigned int uEquipType) | |
9889 { | |
9890 unsigned int v1; // esi@1 | |
9891 int v2; // ebx@1 | 9772 int v2; // ebx@1 |
9892 Player *v3; // eax@1 | 9773 Player *v3; // eax@1 |
9893 int v4; // edx@1 | 9774 int v4; // edx@1 |
9894 int v5; // esi@2 | 9775 int v5; // esi@2 |
9895 int v6; // eax@2 | 9776 //int v6; // eax@2 |
9896 unsigned int v7; // eax@3 | 9777 unsigned int v7; // eax@3 |
9897 ItemGen _this; // [sp+Ch] [bp-30h]@1 | 9778 ItemGen _this; // [sp+Ch] [bp-30h]@1 |
9898 Player *v9; // [sp+30h] [bp-Ch]@1 | 9779 //Player *v9; // [sp+30h] [bp-Ch]@1 |
9899 int v10; // [sp+34h] [bp-8h]@1 | 9780 int v10; // [sp+34h] [bp-8h]@1 |
9900 int *v11; // [sp+38h] [bp-4h]@1 | 9781 int *v11; // [sp+38h] [bp-4h]@1 |
9901 | 9782 |
9902 v1 = uEquipType; | 9783 static unsigned char byte_4E8398[200] = // 4E8398 |
9784 { | |
9785 1, // EQUIP_OFF_HAND | |
9786 1, // EQUIP_MAIN_HAND | |
9787 2, // EQUIP_BOW | |
9788 3, // EQUIP_ARMOUR | |
9789 0, // EQUIP_SHIELD | |
9790 4, // EQUIP_HELMET | |
9791 5, // EQUIP_BELT | |
9792 6, // EQUIP_CLOAK | |
9793 7, // EQUIP_GAUNTLETS | |
9794 8, // EQUIP_BOOTS | |
9795 10, // EQUIP_RING | |
9796 9, // EQUIP_AMULET | |
9797 1, // EQUIP_WAND | |
9798 0, // EQUIP_REAGENT | |
9799 0, // EQUIP_POTION | |
9800 0, // EQUIP_SPELL_SCROLL | |
9801 0, // EQUIP_BOOK | |
9802 0, // EQUIP_MESSAGE_SCROLL | |
9803 0, // EQUIP_GOLD | |
9804 0, // EQUIP_GEM | |
9805 0, // EQUIP_NONE | |
9806 // ??? | |
9807 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, | |
9808 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, | |
9809 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, | |
9810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
9811 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, | |
9812 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1, | |
9813 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
9814 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0 | |
9815 }; | |
9816 | |
9903 _this.Reset(); | 9817 _this.Reset(); |
9904 v2 = (unsigned __int8)byte_4E8394[v1 + 4]; | 9818 v2 = byte_4E8398[uEquipType]; |
9905 v3 = pPlayers[uActiveCharacter]; | 9819 v3 = pPlayers[uActiveCharacter]; |
9906 v9 = v3; | 9820 v11 = (int *)&v3->pEquipment.pIndices[v2]; |
9907 v11 = (int *)((char *)&v3->pEquipment + 4 * v2); | |
9908 v4 = *v11; | 9821 v4 = *v11; |
9909 v10 = *v11; | 9822 v10 = *v11; |
9910 if ( v10 ) | 9823 if ( v10 ) |
9911 { | 9824 { |
9912 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); | 9825 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); |
9913 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9)); | 9826 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9)); |
9914 *(char *)(v5 + 556) = 0; | 9827 *(char *)(v5 + 556) = 0; |
9915 pParty->pPickedItem.Reset(); | 9828 pParty->pPickedItem.Reset(); |
9916 pParty->SetHoldingItem((ItemGen *)(v5 + 532)); | 9829 pParty->SetHoldingItem((ItemGen *)(v5 + 532)); |
9917 v6 = v10; | |
9918 _this.uBodyAnchor = v2 + 1; | 9830 _this.uBodyAnchor = v2 + 1; |
9919 memcpy((void *)(v5 + 532), &_this, 0x24u); | 9831 memcpy((void *)(v5 + 532), &_this, 0x24u); |
9920 *v11 = v6; | 9832 *v11 = v10; |
9921 } | 9833 } |
9922 else | 9834 else |
9923 { | 9835 { |
9924 v7 = v3->FindFreeInventorySlot(); | 9836 v7 = v3->FindFreeInventorySlot(); |
9925 if ( (v7 & 0x80000000u) == 0 ) | 9837 if (v7 >= 0) |
9926 { | 9838 { |
9927 pParty->pPickedItem.uBodyAnchor = v2 + 1; | 9839 pParty->pPickedItem.uBodyAnchor = v2 + 1; |
9928 memcpy(&v9->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v9->pInventoryItems[v7])); | 9840 memcpy(&v3->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v3->pInventoryItems[v7])); |
9929 *v11 = v7 + 1; | 9841 *v11 = v7 + 1; |
9930 pMouse->RemoveHoldingItem(); | 9842 pMouse->RemoveHoldingItem(); |
9931 } | 9843 } |
9932 } | 9844 } |
9933 } | 9845 } |
10103 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); | 10015 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); |
10104 return; | 10016 return; |
10105 } | 10017 } |
10106 if ( pParty->pPickedItem.uItemID == 604 ) | 10018 if ( pParty->pPickedItem.uItemID == 604 ) |
10107 { | 10019 { |
10108 sub_467E7F_EquipBody(3); | 10020 sub_467E7F_EquipBody((ITEM_EQUIP_TYPE)3); |
10109 WetsuitOn(uActiveCharacter); | 10021 WetsuitOn(uActiveCharacter); |
10110 return; | 10022 return; |
10111 } | 10023 } |
10112 v6 = v52; | 10024 v6 = v52; |
10113 switch ( v52 ) | 10025 switch ( v52 ) |
10128 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) | 10040 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (v6 != 3 || bUnderwater) ) |
10129 { | 10041 { |
10130 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 10042 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
10131 return; | 10043 return; |
10132 } | 10044 } |
10133 sub_467E7F_EquipBody(v6); | 10045 sub_467E7F_EquipBody((ITEM_EQUIP_TYPE)v6); |
10134 if ( pParty->pPickedItem.uItemID == 604 ) | 10046 if ( pParty->pPickedItem.uItemID == 604 ) |
10135 WetsuitOff(uActiveCharacter); | 10047 WetsuitOff(uActiveCharacter); |
10136 return; | 10048 return; |
10137 case 0xAu: | 10049 case 0xAu: |
10138 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) | 10050 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) |
10245 } | 10157 } |
10246 v50 = 0; | 10158 v50 = 0; |
10247 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) | 10159 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) |
10248 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) | 10160 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) |
10249 { | 10161 { |
10250 if (pAsyncMouse) | 10162 |
10251 { | |
10252 v18 = *((int *)pAsyncMouse + 6); | |
10253 v19 = *((int *)pAsyncMouse + 7); | |
10254 } | |
10255 else | |
10256 { | |
10257 v18 = pMouse->uMouseClickX; | 10163 v18 = pMouse->uMouseClickX; |
10258 v19 = pMouse->uMouseClickY; | 10164 v19 = pMouse->uMouseClickY; |
10259 } | 10165 |
10260 v49 = v19; | 10166 v49 = v19; |
10261 if ( (signed int)v18 >= 560 ) | 10167 if ( (signed int)v18 >= 560 ) |
10262 { | 10168 { |
10263 if ( !v51 ) | 10169 if ( !v51 ) |
10264 { | 10170 { |
10411 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0); | 10317 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0); |
10412 return; | 10318 return; |
10413 } | 10319 } |
10414 return; | 10320 return; |
10415 } | 10321 } |
10416 if (pAsyncMouse) | 10322 |
10417 { | |
10418 v32 = *((int *)pAsyncMouse + 6); | |
10419 v33 = *((int *)pAsyncMouse + 7); | |
10420 v49 = *((int *)pAsyncMouse + 7); | |
10421 v48 = v32; | |
10422 } | |
10423 else | |
10424 { | |
10425 v32 = pMouse->uMouseClickX; | 10323 v32 = pMouse->uMouseClickX; |
10426 v33 = pMouse->uMouseClickY; | 10324 v33 = pMouse->uMouseClickY; |
10427 } | 10325 |
10428 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF; | 10326 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF; |
10429 if ( v34 ) | 10327 if ( v34 ) |
10430 { | 10328 { |
10431 v36 = v34 - 1; | 10329 v36 = v34 - 1; |
10432 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36); | 10330 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36); |
10480 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; | 10378 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; |
10481 } | 10379 } |
10482 } | 10380 } |
10483 } | 10381 } |
10484 | 10382 |
10485 //----- (0046A0A1) -------------------------------------------------------- | |
10486 int __thiscall UnprojectX(int x) | |
10487 { | |
10488 double v1; // st7@3 | |
10489 int v3; // [sp-4h] [bp-8h]@5 | |
10490 | |
10491 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
10492 { | |
10493 if ( pRenderer->pRenderD3D ) | |
10494 v1 = pGame->pIndoorCameraD3D->fov; | |
10495 else | |
10496 v1 = pIndoorCamera->flt_1C_fov; | |
10497 v3 = (signed __int64)v1; | |
10498 } | |
10499 else | |
10500 { | |
10501 v3 = pOutdoorCamera->int_fov_rad; | |
10502 } | |
10503 return stru_5C6E00->Atan2(x - pViewport->uScreenCenterX, v3) - stru_5C6E00->uIntegerHalfPi; | |
10504 } | |
10505 | |
10506 //----- (0046A0F6) -------------------------------------------------------- | |
10507 int __thiscall UnprojectY(int _this) | |
10508 { | |
10509 double v1; // st7@3 | |
10510 int v3; // [sp-4h] [bp-8h]@5 | |
10511 | |
10512 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
10513 { | |
10514 if ( pRenderer->pRenderD3D ) | |
10515 v1 = pGame->pIndoorCameraD3D->fov; | |
10516 else | |
10517 v1 = pIndoorCamera->flt_1C_fov; | |
10518 v3 = (signed __int64)v1; | |
10519 } | |
10520 else | |
10521 { | |
10522 v3 = pOutdoorCamera->int_fov_rad; | |
10523 } | |
10524 return stru_5C6E00->Atan2(_this - pViewport->uScreenCenterY, v3) - stru_5C6E00->uIntegerHalfPi; | |
10525 } | |
10526 | 10383 |
10527 //----- (0046A14B) -------------------------------------------------------- | 10384 //----- (0046A14B) -------------------------------------------------------- |
10528 void OnPressSpace() | 10385 void OnPressSpace() |
10529 { | 10386 { |
10530 //SHORT v0; // ax@2 | 10387 //SHORT v0; // ax@2 |
10554 { | 10411 { |
10555 pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter); | 10412 pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter); |
10556 auto pid = pGame->pVisInstance->get_picked_object_zbuf_val(); | 10413 auto pid = pGame->pVisInstance->get_picked_object_zbuf_val(); |
10557 if ( pid != -1 ) | 10414 if ( pid != -1 ) |
10558 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid)); | 10415 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid)); |
10559 } | 10416 return; |
10417 } | |
10418 | |
10419 | |
10420 // software render stuff following | |
10421 | |
10422 static int dword_720660[100]; // 720660 | |
10423 static int dword_7207F0[100]; // 7207F0 | |
10560 | 10424 |
10561 v22 = 0; | 10425 v22 = 0; |
10562 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer | 10426 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer |
10563 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) | 10427 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) |
10564 { | 10428 { |
10600 if ( v19 == v22 && v4 < 100 ) | 10464 if ( v19 == v22 && v4 < 100 ) |
10601 { | 10465 { |
10602 ++v22; | 10466 ++v22; |
10603 ++v4; | 10467 ++v4; |
10604 v8 = *v21; | 10468 v8 = *v21; |
10605 dword_7207EC[v4] = v7; | 10469 dword_7207F0[v4 - 1] = v7; |
10606 dword_72065C[v4] = v8; | 10470 dword_720660[v4 - 1] = v8; |
10607 } | 10471 } |
10608 } | 10472 } |
10609 else if ( (unsigned int)*v21 <= 0x2000000 ) | 10473 else if ( (unsigned int)*v21 <= 0x2000000 ) |
10610 { | 10474 { |
10611 if ( v19 == v22 && v4 < 100 ) | 10475 if ( v19 == v22 && v4 < 100 ) |
10612 { | 10476 { |
10613 ++v22; | 10477 ++v22; |
10614 ++v4; | 10478 ++v4; |
10615 v8 = *v21; | 10479 v8 = *v21; |
10616 dword_7207EC[v4] = v7; | 10480 dword_7207F0[v4 - 1] = v7; |
10617 dword_72065C[v4] = v8; | 10481 dword_720660[v4 - 1] = v8; |
10618 } | 10482 } |
10619 } | 10483 } |
10620 v1 = v21 + 2; | 10484 v1 = v21 + 2; |
10621 --v5; | 10485 --v5; |
10622 v21 += 2; | 10486 v21 += 2; |
10742 { | 10606 { |
10743 Actor::FaceObject(v12, 4u, 0, 0); | 10607 Actor::FaceObject(v12, 4u, 0, 0); |
10744 if ( v13->sNPC_ID ) | 10608 if ( v13->sNPC_ID ) |
10745 { | 10609 { |
10746 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v12, 0); | 10610 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v12, 0); |
10747 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
10748 { | |
10749 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_StartNPCDialogue; | |
10750 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
10751 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
10752 ++pMessageQueue_50CBD0->uNumMessages; | |
10753 }*/ | |
10754 } | 10611 } |
10755 else | 10612 else |
10756 { | 10613 { |
10757 v15 = pNPCStats->pGroups_copy[v13->uGroup]; | 10614 v15 = pNPCStats->pGroups_copy[v13->uGroup]; |
10758 if ( v15 ) | 10615 if ( v15 ) |
10945 if ( v4 <= (unsigned int)(a3 << 16) ) | 10802 if ( v4 <= (unsigned int)(a3 << 16) ) |
10946 { | 10803 { |
10947 v6 = PID_ID(v5); | 10804 v6 = PID_ID(v5); |
10948 v7 = v6; | 10805 v7 = v6; |
10949 v8 = pActors[v6].uAIState; | 10806 v8 = pActors[v6].uAIState; |
10950 if ( v8 != 5 ) | 10807 if ( v8 != Dead ) |
10951 { | 10808 { |
10952 if ( v8 != 4 ) | 10809 if ( v8 != Dying ) |
10953 { | 10810 { |
10954 if ( v8 != 11 ) | 10811 if ( v8 != Removed ) |
10955 { | 10812 { |
10956 if ( v8 != 19 ) | 10813 if ( v8 != Disabled ) |
10957 { | 10814 { |
10958 if ( v8 != 17 ) | 10815 if ( v8 != Summoned ) |
10959 { | 10816 { |
10960 v9 = (double)a3; | 10817 v9 = (double)a3; |
10961 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) ) | 10818 if ( pGame->pVisInstance->DoesRayIntersectBillboard(v9, a1a) ) |
10962 { | 10819 { |
10963 if ( v15 < v14 - 1 ) | 10820 if ( v15 < v14 - 1 ) |