Mercurial > mm7
comparison mm7_2.cpp @ 1030:7735bdb3c30f
Doors and other bmodel triggers are now clickable.
author | Nomad |
---|---|
date | Tue, 21 May 2013 12:52:38 +0200 |
parents | 67e33708d815 |
children | f93d17337113 |
comparison
equal
deleted
inserted
replaced
1029:c94d6a37d298 | 1030:7735bdb3c30f |
---|---|
10552 int v22; // [sp+1Ch] [bp-4h]@4 | 10552 int v22; // [sp+1Ch] [bp-4h]@4 |
10553 | 10553 |
10554 if ( pRenderer->pRenderD3D ) | 10554 if ( pRenderer->pRenderD3D ) |
10555 { | 10555 { |
10556 pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter); | 10556 pGame->PickKeyboard(GetAsyncKeyState(VK_CONTROL) & 0x8001, &vis_sprite_filter_3, &vis_door_filter); |
10557 v1 = (int *)pGame->pVisInstance->get_picked_object_zbuf_val(); | 10557 auto pid = pGame->pVisInstance->get_picked_object_zbuf_val(); |
10558 if ( v1 != (int *)-1 ) | 10558 if ( pid != -1 ) |
10559 DoInteractionWithTopmostZObject((unsigned __int16)v1, (signed int)(unsigned __int16)v1 >> 3); | 10559 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid)); |
10560 } | 10560 } |
10561 | |
10561 v22 = 0; | 10562 v22 = 0; |
10562 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer | 10563 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 ) | 10564 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) |
10564 { | 10565 { |
10565 v2 = (char *)v1 - 50; | 10566 v2 = (char *)v1 - 50; |
10664 { | 10665 { |
10665 int v2; // edx@1 | 10666 int v2; // edx@1 |
10666 BLVFace *v4; // eax@9 | 10667 BLVFace *v4; // eax@9 |
10667 unsigned int v5; // ecx@9 | 10668 unsigned int v5; // ecx@9 |
10668 unsigned __int16 v6; // ax@11 | 10669 unsigned __int16 v6; // ax@11 |
10669 ODMFace *v7; // eax@16 | 10670 //ODMFace *v7; // eax@16 |
10670 LevelDecoration *v8; // esi@19 | 10671 LevelDecoration *v8; // esi@19 |
10671 __int16 v9; // ax@19 | 10672 __int16 v9; // ax@19 |
10672 int v10; // eax@22 | 10673 int v10; // eax@22 |
10673 int v11; // ecx@22 | 10674 int v11; // ecx@22 |
10674 int v12; // edi@23 | 10675 int v12; // edi@23 |
10790 activeLevelDecoration = NULL; | 10791 activeLevelDecoration = NULL; |
10791 } | 10792 } |
10792 break; | 10793 break; |
10793 | 10794 |
10794 default: | 10795 default: |
10795 if ( PID_TYPE(a1) != OBJECT_BModel) | 10796 MessageBoxW(nullptr, L"Warning: Invalid ID reached!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Mouse.cpp:2020", 0); |
10796 { | 10797 return 1; |
10797 MessageBoxW(nullptr, L"Warning: Invalid ID reached!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Mouse.cpp:2020", 0); | 10798 |
10798 return 1; | 10799 case OBJECT_BModel: |
10799 } | 10800 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
10800 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) | 10801 { |
10801 { | 10802 int bmodel_id = a1 >> 9, |
10802 if ( a1 >> 9 >= pOutdoor->uNumBModels | 10803 face_id = PID_ID(a1) &0x3F; |
10803 || (v7 = &pOutdoor->pBModels[a1 >> 9].pFaces[(PID_ID(a1)) & 0x3F], BYTE2(v7->uAttributes) & 0x10) | 10804 if (bmodel_id >= pOutdoor->uNumBModels) |
10804 || (v6 = v7->sCogTriggeredID) == 0 ) | 10805 return 1; |
10806 auto face = &pOutdoor->pBModels[bmodel_id].pFaces[face_id]; | |
10807 if (face->uAttributes & 0x100000 || (v6 = face->sCogTriggeredID) == 0 ) | |
10805 return 1; | 10808 return 1; |
10806 EventProcessor((signed __int16)v6, v2, 1); | 10809 EventProcessor((signed __int16)v6, v2, 1); |
10807 return 0; | 10810 } |
10808 } | 10811 else |
10809 v4 = &pIndoor->pFaces[PID_ID(a1)]; | 10812 { |
10810 v5 = v4->uAttributes; | 10813 v4 = &pIndoor->pFaces[PID_ID(a1)]; |
10811 if ( !(v5 & 0x2000000) ) | 10814 v5 = v4->uAttributes; |
10812 { | 10815 if ( !(v5 & 0x2000000) ) |
10813 ShowNothingHereStatus(); | 10816 { |
10814 return 1; | 10817 ShowNothingHereStatus(); |
10815 } | 10818 return 1; |
10816 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 ) | 10819 } |
10817 return 1; | 10820 if ( v5 & 0x100000 || (v6 = pIndoor->pFaceExtras[v4->uFaceExtraID].uEventID) == 0 ) |
10818 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) | 10821 return 1; |
10819 { | 10822 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
10820 EventProcessor((signed __int16)v6, v2, 1); | 10823 EventProcessor((signed __int16)v6, v2, 1); |
10821 return 0; | 10824 } |
10822 } | 10825 return 0; |
10823 break; | 10826 break; |
10824 } | 10827 } |
10825 return 0; | 10828 return 0; |
10826 } | 10829 } |
10827 // 4E28F8: using guessed type int pCurrentScreen; | 10830 // 4E28F8: using guessed type int pCurrentScreen; |