comparison mm7_3.cpp @ 323:d720a13e2273

Very basic picking & entering houses
author Nomad
date Wed, 20 Feb 2013 08:23:12 +0200
parents ce39b96acf5c
children f76027321087
comparison
equal deleted inserted replaced
322:ce39b96acf5c 323:d720a13e2273
1036 } 1036 }
1037 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 1 ) 1037 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 1 )
1038 v8 = (signed __int64)((double)v73 * flt_6BE3AC_debug_recmod1_x_1_6); 1038 v8 = (signed __int64)((double)v73 * flt_6BE3AC_debug_recmod1_x_1_6);
1039 if ( v8 > 1000 ) 1039 if ( v8 > 1000 )
1040 v8 = 1000; 1040 v8 = 1000;
1041 v12 = stru_5C6E00->SinCos(v0->uYawAngle); 1041 v12 = stru_5C6E00->Cos(v0->uYawAngle);
1042 v69 = v12; 1042 v69 = v12;
1043 v13 = v12 * (signed __int64)v8; 1043 v13 = v12 * (signed __int64)v8;
1044 v73 = v13 >> 16; 1044 v73 = v13 >> 16;
1045 v0->vVelocity.x = WORD1(v13); 1045 v0->vVelocity.x = WORD1(v13);
1046 v69 = stru_5C6E00->SinCos(v0->uYawAngle - stru_5C6E00->uIntegerHalfPi); 1046 v69 = stru_5C6E00->Sin(v0->uYawAngle);
1047 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v8) >> 16; 1047 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v8) >> 16;
1048 v9 = v74 == 0; 1048 v9 = v74 == 0;
1049 v0->vVelocity.y = v69 * v8 >> 16; 1049 v0->vVelocity.y = v69 * v8 >> 16;
1050 if ( !v9 ) 1050 if ( !v9 )
1051 { 1051 {
1052 v14 = stru_5C6E00->SinCos(v0->uPitchAngle - stru_5C6E00->uIntegerHalfPi); 1052 v14 = stru_5C6E00->Sin(v0->uPitchAngle);
1053 v69 = v14; 1053 v69 = v14;
1054 v15 = v14 * (signed __int64)v8; 1054 v15 = v14 * (signed __int64)v8;
1055 v73 = v15 >> 16; 1055 v73 = v15 >> 16;
1056 v0->vVelocity.z = WORD1(v15); 1056 v0->vVelocity.z = WORD1(v15);
1057 } 1057 }
1262 case 5: 1262 case 5:
1263 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); 1263 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y);
1264 v48 = stru_5C6E00->Atan2( 1264 v48 = stru_5C6E00->Atan2(
1265 v0->vPosition.x - pLevelDecorations[v39].vPosition.x, 1265 v0->vPosition.x - pLevelDecorations[v39].vPosition.x,
1266 v0->vPosition.y - pLevelDecorations[v39].vPosition.y); 1266 v0->vPosition.y - pLevelDecorations[v39].vPosition.y);
1267 v71 = stru_5C6E00->SinCos(v48); 1267 v71 = stru_5C6E00->Cos(v48);
1268 v70 = (unsigned __int64)(v71 * (signed __int64)v47) >> 16; 1268 v70 = (unsigned __int64)(v71 * (signed __int64)v47) >> 16;
1269 v49 = v48 - stru_5C6E00->uIntegerHalfPi; 1269 v49 = v48;
1270 v0->vVelocity.x = (unsigned int)(v71 * v47) >> 16; 1270 v0->vVelocity.x = (unsigned int)(v71 * v47) >> 16;
1271 v50 = stru_5C6E00->SinCos(v49); 1271 v50 = stru_5C6E00->Sin(v48);
1272 v71 = v50; 1272 v71 = v50;
1273 v51 = v50 * (signed __int64)v47; 1273 v51 = v50 * (signed __int64)v47;
1274 v70 = v51 >> 16; 1274 v70 = v51 >> 16;
1275 v0->vVelocity.y = WORD1(v51); 1275 v0->vVelocity.y = WORD1(v51);
1276 break; 1276 break;
1580 { 1580 {
1581 v40 = integer_sqrt(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y); 1581 v40 = integer_sqrt(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y);
1582 v23 = stru_5C6E00->Atan2( 1582 v23 = stru_5C6E00->Atan2(
1583 v1->vPosition.x - pLevelDecorations[v15].vPosition.x, 1583 v1->vPosition.x - pLevelDecorations[v15].vPosition.x,
1584 v1->vPosition.y - pLevelDecorations[v15].vPosition.y); 1584 v1->vPosition.y - pLevelDecorations[v15].vPosition.y);
1585 v42 = stru_5C6E00->SinCos(v23); 1585 v42 = stru_5C6E00->Cos(v23);
1586 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16; 1586 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
1587 v24 = v23 - stru_5C6E00->uIntegerHalfPi; 1587 v24 = v23;
1588 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16; 1588 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
1589 v25 = stru_5C6E00->SinCos(v24); 1589 v25 = stru_5C6E00->Sin(v23);
1590 v42 = v25; 1590 v42 = v25;
1591 v26 = v25 * (signed __int64)v40; 1591 v26 = v25 * (signed __int64)v40;
1592 v41 = v26 >> 16; 1592 v41 = v26 >> 16;
1593 v1->vVelocity.y = WORD1(v26); 1593 v1->vVelocity.y = WORD1(v26);
1594 } 1594 }
2164 v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x); 2164 v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
2165 v38 = stru_5C6E00->Atan2( 2165 v38 = stru_5C6E00->Atan2(
2166 v1->vPosition.x - pLevelDecorations[v30].vPosition.x, 2166 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
2167 v1->vPosition.y - pLevelDecorations[v30].vPosition.y); 2167 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
2168 v56 = v38; 2168 v56 = v38;
2169 v39 = stru_5C6E00->SinCos(v38); 2169 v39 = stru_5C6E00->Cos(v38);
2170 v60 = (Actor *)v39; 2170 v60 = (Actor *)v39;
2171 v40 = v39 * (signed __int64)v57; 2171 v40 = v39 * (signed __int64)v57;
2172 v58 = v40 >> 16; 2172 v58 = v40 >> 16;
2173 v1->vVelocity.x = WORD1(v40); 2173 v1->vVelocity.x = WORD1(v40);
2174 v41 = stru_5C6E00->SinCos(v56 - stru_5C6E00->uIntegerHalfPi); 2174 v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi);
2175 v60 = (Actor *)v41; 2175 v60 = (Actor *)v41;
2176 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16; 2176 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
2177 v58 = v35; 2177 v58 = v35;
2178 LABEL_73: 2178 LABEL_73:
2179 v1->vVelocity.y = v35; 2179 v1->vVelocity.y = v35;
2601 LABEL_56: 2601 LABEL_56:
2602 angle = stru_5C6E00->uDoublePiMask & (angle - v15); 2602 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
2603 goto LABEL_87; 2603 goto LABEL_87;
2604 case PARTY_StrafeLeft: 2604 case PARTY_StrafeLeft:
2605 __debugbreak(); 2605 __debugbreak();
2606 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2606 v17 = stru_5C6E00->Sin(angle);
2607 v18 = (double)v81; 2607 v18 = (double)v81;
2608 //v88 = v18; 2608 //v88 = v18;
2609 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16; 2609 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
2610 v2 -= v78; 2610 v2 -= v78;
2611 v19 = stru_5C6E00->SinCos(angle); 2611 v19 = stru_5C6E00->Cos(angle);
2612 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16; 2612 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
2613 goto LABEL_63; 2613 goto LABEL_63;
2614 case PARTY_StrafeRight: 2614 case PARTY_StrafeRight:
2615 __debugbreak(); 2615 __debugbreak();
2616 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2616 v20 = stru_5C6E00->Sin(angle);
2617 v21 = (double)v81; 2617 v21 = (double)v81;
2618 //v88 = v21; 2618 //v88 = v21;
2619 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16; 2619 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
2620 v2 += v78; 2620 v2 += v78;
2621 v22 = stru_5C6E00->SinCos(angle); 2621 v22 = stru_5C6E00->Cos(angle);
2622 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16; 2622 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
2623 goto LABEL_68; 2623 goto LABEL_68;
2624 case PARTY_WalkForward: 2624 case PARTY_WalkForward:
2625 __debugbreak(); 2625 __debugbreak();
2626 v23 = stru_5C6E00->SinCos(angle); 2626 v23 = stru_5C6E00->Cos(angle);
2627 v24 = (double)v81; 2627 v24 = (double)v81;
2628 //v88 = v24; 2628 //v88 = v24;
2629 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16; 2629 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
2630 v2 += v78; 2630 v2 += v78;
2631 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2631 v25 = stru_5C6E00->Sin(angle);
2632 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16; 2632 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
2633 LABEL_63: 2633 LABEL_63:
2634 v1 += v78; 2634 v1 += v78;
2635 goto LABEL_64; 2635 goto LABEL_64;
2636 case PARTY_WalkBackward: 2636 case PARTY_WalkBackward:
2637 __debugbreak(); 2637 __debugbreak();
2638 v26 = stru_5C6E00->SinCos(angle); 2638 v26 = stru_5C6E00->Cos(angle);
2639 v27 = (double)v81; 2639 v27 = (double)v81;
2640 //v88 = v27; 2640 //v88 = v27;
2641 v78 = (unsigned __int64)(v26 2641 v78 = (unsigned __int64)(v26
2642 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; 2642 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
2643 v2 -= v78; 2643 v2 -= v78;
2644 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2644 v28 = stru_5C6E00->Sin(angle);
2645 v78 = (unsigned __int64)(v28 2645 v78 = (unsigned __int64)(v28
2646 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; 2646 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
2647 LABEL_68: 2647 LABEL_68:
2648 v1 -= v78; 2648 v1 -= v78;
2649 LABEL_64: 2649 LABEL_64:
2650 v78 = 1; 2650 v78 = 1;
2651 goto LABEL_87; 2651 goto LABEL_87;
2652 case PARTY_RunForward: 2652 case PARTY_RunForward:
2653 //v29 = stru_5C6E00->SinCos(angle); 2653 //v29 = stru_5C6E00->Cos(angle);
2654 //v30 = (double)v81; 2654 //v30 = (double)v81;
2655 //v88 = (double)v81; 2655 //v88 = (double)v81;
2656 v2 += (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; 2656 v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
2657 //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2657 //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
2658 v1 += (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; 2658 v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
2659 v72 = 1; 2659 v72 = 1;
2660 goto LABEL_87; 2660 goto LABEL_87;
2661 case PARTY_RunBackward: 2661 case PARTY_RunBackward:
2662 //v32 = stru_5C6E00->SinCos(angle); 2662 //v32 = stru_5C6E00->SinCos(angle);
2663 //v33 = (double)v81; 2663 //v33 = (double)v81;
2664 //v88 = (double)v81; 2664 //v88 = (double)v81;
2665 v2 -= (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; 2665 v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
2666 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 2666 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
2667 v1 -= (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; 2667 v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
2668 //LABEL_70: 2668 //LABEL_70:
2669 v72 = 1; 2669 v72 = 1;
2670 goto LABEL_87; 2670 goto LABEL_87;
2671 case PARTY_LookUp: 2671 case PARTY_LookUp:
2672 __debugbreak(); 2672 __debugbreak();
2828 v53 = integer_sqrt(v2 * v2 + v1 * v1); 2828 v53 = integer_sqrt(v2 * v2 + v1 * v1);
2829 v80 = v53; 2829 v80 = v53;
2830 v54 = stru_5C6E00->Atan2( 2830 v54 = stru_5C6E00->Atan2(
2831 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, 2831 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x,
2832 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y); 2832 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y);
2833 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16; 2833 v2 = (unsigned __int64)(stru_5C6E00->Cos(v54) * (signed __int64)v53) >> 16;
2834 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); 2834 v55 = stru_5C6E00->Sin(v54);
2835 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; 2835 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16;
2836 } 2836 }
2837 else 2837 else
2838 { 2838 {
2839 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel) 2839 if ( (stru_721530.uFaceID & 7) == OBJECT_BModel)
3550 { 3550 {
3551 if ( pParty->bFlying ) 3551 if ( pParty->bFlying )
3552 { 3552 {
3553 LABEL_130: 3553 LABEL_130:
3554 v31 = GetTickCount(); 3554 v31 = GetTickCount();
3555 v126 = stru_5C6E00->SinCos(v31); 3555 v126 = stru_5C6E00->Cos(v31);
3556 v129 = (unsigned __int64)(4i64 * v126) >> 16; 3556 v129 = (unsigned __int64)(4i64 * v126) >> 16;
3557 v123 = v113 + v129; 3557 v123 = v113 + v129;
3558 if ( v127 ) 3558 if ( v127 )
3559 v123 = v113; 3559 v123 = v113;
3560 if (pParty->FlyActive()) 3560 if (pParty->FlyActive())
3760 v118 = v56; 3760 v118 = v56;
3761 v57 = stru_5C6E00->Atan2( 3761 v57 = stru_5C6E00->Atan2(
3762 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, 3762 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
3763 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y); 3763 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
3764 v129 = v57; 3764 v129 = v57;
3765 v58 = (BSPModel *)stru_5C6E00->SinCos(v57); 3765 v58 = (BSPModel *)stru_5C6E00->Cos(v57);
3766 v127 = v58; 3766 v127 = v58;
3767 v59 = (signed int)v58 * (signed __int64)v56; 3767 v59 = (signed int)v58 * (signed __int64)v56;
3768 v122 = v59 >> 16; 3768 v122 = v59 >> 16;
3769 v2 = v59 >> 16; 3769 v2 = v59 >> 16;
3770 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi); 3770 v60 = (BSPModel *)stru_5C6E00->Sin(v129);
3771 v127 = v60; 3771 v127 = v60;
3772 v61 = (signed int)v60 * (signed __int64)v118; 3772 v61 = (signed int)v60 * (signed __int64)v118;
3773 v122 = v61 >> 16; 3773 v122 = v61 >> 16;
3774 v128 = v61 >> 16; 3774 v128 = v61 >> 16;
3775 } 3775 }
5138 { 5138 {
5139 v15 = (char *)&this->field_14[1]; 5139 v15 = (char *)&this->field_14[1];
5140 v31 = 3; 5140 v31 = 3;
5141 do 5141 do
5142 { 5142 {
5143 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625; 5143 v40 = (double)stru_5C6E00->Cos(pIndoorCamera->sRotationX) * 0.0000152587890625;
5144 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi) 5144 v32 = (double)stru_5C6E00->Sin(pIndoorCamera->sRotationX) * 0.0000152587890625;
5145 * 0.0000152587890625; 5145 v34 = (double)stru_5C6E00->Cos(pIndoorCamera->sRotationY) * 0.0000152587890625;
5146 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625; 5146 v16 = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
5147 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
5148 LODWORD(v38) = *(int *)v15; 5147 LODWORD(v38) = *(int *)v15;
5149 v33 = (double)v16 * 0.0000152587890625; 5148 v33 = (double)v16 * 0.0000152587890625;
5150 //UNDEF(v17); 5149 //UNDEF(v17);
5151 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x; 5150 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
5152 if ( v19 | v18 ) 5151 if ( v19 | v18 )
6188 // 50B570: using guessed type int dword_50B570[]; 6187 // 50B570: using guessed type int dword_50B570[];
6189 // 50B638: using guessed type int dword_50B638[]; 6188 // 50B638: using guessed type int dword_50B638[];
6190 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag; 6189 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
6191 6190
6192 //----- (00479089) -------------------------------------------------------- 6191 //----- (00479089) --------------------------------------------------------
6193 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused) 6192 bool __fastcall IsBModelVisible(unsigned int uModelID, int *reachable)
6194 { 6193 {
6195 BSPModel *v2; // eax@1 6194 BSPModel *v2; // eax@1
6196 int v3; // edi@1 6195 int v3; // edi@1
6197 int v4; // ebx@1 6196 int v4; // ebx@1
6198 int v5; // ST28_4@1 6197 int v5; // ST28_4@1
6199 int v6; // ecx@1 6198 int v6; // ecx@1
6200 int v7; // ebx@3 6199 int v7; // ebx@3
6201 int v8; // eax@3 6200 int v8; // eax@3
6202 int v9; // eax@3 6201 int v9; // eax@3
6203 int v10; // ebx@3 6202 //int v10; // ebx@3
6204 signed int v11; // esi@6 6203 signed int v11; // esi@6
6205 int v12; // esi@8 6204 int v12; // esi@8
6206 bool result; // eax@9 6205 bool result; // eax@9
6207 unsigned int v14; // [sp+Ch] [bp-20h]@1 6206 //unsigned int v14; // [sp+Ch] [bp-20h]@1
6208 int v15; // [sp+Ch] [bp-20h]@5 6207 int v15; // [sp+Ch] [bp-20h]@5
6209 int *v16; // [sp+10h] [bp-1Ch]@1 6208 //int *v16; // [sp+10h] [bp-1Ch]@1
6210 int v17; // [sp+1Ch] [bp-10h]@1 6209 int v17; // [sp+1Ch] [bp-10h]@1
6211 int v18; // [sp+20h] [bp-Ch]@1 6210 int v18; // [sp+20h] [bp-Ch]@1
6212 int v19; // [sp+20h] [bp-Ch]@3 6211 int v19; // [sp+20h] [bp-Ch]@3
6213 int angle; // [sp+24h] [bp-8h]@1 6212 int angle; // [sp+24h] [bp-8h]@1
6214 int v21; // [sp+28h] [bp-4h]@1 6213 int v21; // [sp+28h] [bp-4h]@1
6215 int v22; // [sp+28h] [bp-4h]@3 6214 //int v22; // [sp+28h] [bp-4h]@3
6216 6215
6217 v16 = unused; 6216 //v16 = unused;
6218 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1; 6217 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
6219 v14 = uModelID; 6218 //v14 = uModelID;
6220 v2 = &pOutdoor->pBModels[uModelID]; 6219 v2 = &pOutdoor->pBModels[uModelID];
6221 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x; 6220 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
6222 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y; 6221 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
6223 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY); 6222 v5 = stru_5C6E00->Cos(pIndoorCamera->sRotationY);
6224 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi); 6223 v21 = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
6225 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX); 6224 v18 = stru_5C6E00->Cos(pIndoorCamera->sRotationX);
6226 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi); 6225 stru_5C6E00->Sin(pIndoorCamera->sRotationX);
6227 v6 = v5; 6226 v6 = v5;
6228 v17 = v3 * v5 + v4 * v21; 6227 v17 = v3 * v5 + v4 * v21;
6229 if ( pIndoorCamera->sRotationX ) 6228 if ( pIndoorCamera->sRotationX )
6230 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16; 6229 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
6231 v19 = v4 * v6 - v3 * v21; 6230 v19 = v4 * v6 - v3 * v21;
6232 v7 = abs(v4); 6231 v7 = abs(v4);
6233 v8 = abs(v3); 6232 v8 = abs(v3);
6234 v9 = int_get_vector_length(v8, v7, 0); 6233 v9 = int_get_vector_length(v8, v7, 0);
6235 v10 = v14 * 188; 6234 //v10 = v14 * 188;
6236 v22 = v9; 6235 //v22 = v9;
6237 *v16 = 0; 6236 *reachable = false;
6238 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 ) 6237 if ( v9 < pOutdoor->pBModels[uModelID].sBoundingRadius + 256 )
6239 *v16 = 1; 6238 *reachable = true;
6240 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); 6239 v15 = stru_5C6E00->Sin(angle);
6241 if ( v19 >= 0 ) 6240 if ( v19 >= 0 )
6242 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16) 6241 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16) - ((unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)v19) >> 16);
6243 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
6244 else 6242 else
6245 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16) 6243 v11 = ((unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)v19) >> 16) + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
6246 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
6247 v12 = v11 >> 16; 6244 v12 = v11 >> 16;
6248 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 ) 6245 if ( v9 <= pOutdoorCamera->shading_dist_mist + 2048 )
6249 { 6246 {
6250 //if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 ) 6247 //if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
6251 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels[v14].sBoundingRadius) + 512 ) 6248 if ( abs(v12) > pOutdoor->pBModels[uModelID].sBoundingRadius + 512 )
6252 { 6249 {
6253 result = v12 < 0; 6250 result = v12 < 0;
6254 LOBYTE(result) = v12 >= 0; 6251 LOBYTE(result) = v12 >= 0;
6252 return result;
6255 } 6253 }
6256 else 6254 else
6257 { 6255 return true;
6258 result = 1; 6256 }
6259 } 6257 return false;
6260 }
6261 else
6262 {
6263 result = 0;
6264 }
6265 return result;
6266 } 6258 }
6267 6259
6268 6260
6269 6261
6270 6262
6945 if (pOutdoor->uSky_TextureID == -1) 6937 if (pOutdoor->uSky_TextureID == -1)
6946 return; 6938 return;
6947 6939
6948 _this.field_58 = 0; 6940 _this.field_58 = 0;
6949 _this.uNumVertices = 4; 6941 _this.uNumVertices = 4;
6950 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16); 6942 _this.v_18.x = -stru_5C6E00->Sin(pIndoorCamera->sRotationX + 16);
6951 _this.v_18.y = 0; 6943 _this.v_18.y = 0;
6952 _this.v_18.z = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX + 16); 6944 _this.v_18.z = -stru_5C6E00->Cos(pIndoorCamera->sRotationX + 16);
6953 _this.field_24 = 0x2000000; 6945 _this.field_24 = 0x2000000;
6954 6946
6955 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed; 6947 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
6956 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed; 6948 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
6957 6949
7203 if ( !v62.pTexture ) 7195 if ( !v62.pTexture )
7204 return; 7196 return;
7205 v8 = pBLVRenderParams->sPartyRotX; 7197 v8 = pBLVRenderParams->sPartyRotX;
7206 v62.field_58 = 0; 7198 v62.field_58 = 0;
7207 v62.uNumVertices = v3; 7199 v62.uNumVertices = v3;
7208 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16); 7200 v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX + 16);
7209 v62.v_18.y = 0; 7201 v62.v_18.y = 0;
7210 v62.v_18.x = -v9; 7202 v62.v_18.x = -v9;
7211 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16); 7203 v62.v_18.z = -stru_5C6E00->Cos(v8 + 16);
7212 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX; 7204 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
7213 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3])); 7205 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
7214 LODWORD(v80) = v10; 7206 LODWORD(v80) = v10;
7215 v62.field_24 = 33554432; 7207 v62.field_24 = 33554432;
7216 v64 = (double)(signed int)v10 * 0.5; 7208 v64 = (double)(signed int)v10 * 0.5;
9793 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16; 9785 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
9794 v43 = (v71 + v42) >> v76; 9786 v43 = (v71 + v42) >> v76;
9795 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76; 9787 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
9796 a1.field_4 = (v43 - v30) >> 4; 9788 a1.field_4 = (v43 - v30) >> 4;
9797 a1.field_0 = (v79 - v68) >> 4; 9789 a1.field_0 = (v79 - v68) >> 4;
9798 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66)); 9790 a1.field_30 = v30 + 4 * stru_5C6E00->Cos(v81 + (v68 >> v66));
9799 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi); 9791 v44 = stru_5C6E00->Sin(v81 + (v30 >> v66));
9800 a1.field_2C = v68 + 4 * v44; 9792 a1.field_2C = v68 + 4 * v44;
9801 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 ) 9793 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
9802 sr_sub_485975(&a1, (stru315 *)&a2); 9794 sr_sub_485975(&a1, (stru315 *)&a2);
9803 else 9795 else
9804 sr_sub_4D6FB0(v2); 9796 sr_sub_4D6FB0(v2);
9813 v31 = v79; 9805 v31 = v79;
9814 } 9806 }
9815 if ( !v72 ) 9807 if ( !v72 )
9816 return 1; 9808 return 1;
9817 v66 = 12 - v75; 9809 v66 = 12 - v75;
9818 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75))); 9810 a1.field_30 = v30 + 4 * stru_5C6E00->Cos(v81 + (v31 >> (12 - v75)));
9819 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi); 9811 v46 = stru_5C6E00->Sin(v81 + (v30 >> v66));
9820 a1.field_2C = v68 + 4 * v46; 9812 a1.field_2C = v68 + 4 * v46;
9821 v79 = v5->v_18.y; 9813 v79 = v5->v_18.y;
9822 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16; 9814 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
9823 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16; 9815 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
9824 v48 = v47 + v60; 9816 v48 = v47 + v60;
9941 v44 = v4; 9933 v44 = v4;
9942 v41 = v8; 9934 v41 = v8;
9943 v42 = v3->v_18.z; 9935 v42 = v3->v_18.z;
9944 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16; 9936 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
9945 v9 = v44 + v3->v_18.x; 9937 v9 = v44 + v3->v_18.x;
9946 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi); 9938 v35 = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
9947 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY); 9939 v10 = stru_5C6E00->Cos(pIndoorCamera->sRotationY);
9948 v11 = v2->field_8; 9940 v11 = v2->field_8;
9949 v36 = v10; 9941 v36 = v10;
9950 a1.field_28 = v2->field_C; 9942 a1.field_28 = v2->field_C;
9951 v12 = pViewport->uScreenCenterX - v11; 9943 v12 = pViewport->uScreenCenterX - v11;
9952 v13 = v3->field_24; 9944 v13 = v3->field_24;
10119 v40 = v4; 10111 v40 = v4;
10120 v38 = v8; 10112 v38 = v8;
10121 v39 = v3->v_18.z; 10113 v39 = v3->v_18.z;
10122 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16; 10114 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
10123 v9 = v40 + v3->v_18.x; 10115 v9 = v40 + v3->v_18.x;
10124 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi); 10116 v32 = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
10125 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY); 10117 v10 = stru_5C6E00->Cos(pIndoorCamera->sRotationY);
10126 v11 = v2->field_8; 10118 v11 = v2->field_8;
10127 v33 = v10; 10119 v33 = v10;
10128 v35.field_28 = v2->field_C; 10120 v35.field_28 = v2->field_C;
10129 v12 = pViewport->uScreenCenterX - v11; 10121 v12 = pViewport->uScreenCenterX - v11;
10130 v13 = v3->field_24; 10122 v13 = v3->field_24;
10762 v45 = pOutdoorCamera->int_fov_rad_inv; 10754 v45 = pOutdoorCamera->int_fov_rad_inv;
10763 a1a.field_10 = v34 + 16; 10755 a1a.field_10 = v34 + 16;
10764 a1a.field_C = v32 - 1; 10756 a1a.field_C = v32 - 1;
10765 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16; 10757 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
10766 v47 = (Span *)(i >> v44); 10758 v47 = (Span *)(i >> v44);
10767 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi); 10759 v35 = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
10768 v36 = (signed int)v47 * (signed __int64)v35; 10760 v36 = (signed int)v47 * (signed __int64)v35;
10769 i = v36 >> 16; 10761 i = v36 >> 16;
10770 a1a.field_4 = v36 >> 16; 10762 a1a.field_4 = v36 >> 16;
10771 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY); 10763 v37 = stru_5C6E00->Cos(pIndoorCamera->sRotationY);
10772 v38 = (signed int)v47 * (signed __int64)v37; 10764 v38 = (signed int)v47 * (signed __int64)v37;
10773 i = v38 >> 16; 10765 i = v38 >> 16;
10774 a1a.field_0 = v38 >> 16; 10766 a1a.field_0 = v38 >> 16;
10775 if ( (signed int)v43 > 0 ) 10767 if ( (signed int)v43 > 0 )
10776 { 10768 {
10777 v47 = v43; 10769 v47 = v43;
10778 v39 = 12 - v49; 10770 v39 = 12 - v49;
10779 for ( i = 12 - v49; ; v39 = i ) 10771 for ( i = 12 - v49; ; v39 = i )
10780 { 10772 {
10781 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39)); 10773 a1a.field_30 = v30 + 4 * stru_5C6E00->Cos(X + (v31 >> v39));
10782 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi); 10774 a1a.field_2C = v31 + 4 * stru_5C6E00->Sin(X + (v30 >> i));
10783 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 ) 10775 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
10784 sr_sub_485975(&a1a, (stru315 *)&a2); 10776 sr_sub_485975(&a1a, (stru315 *)&a2);
10785 else 10777 else
10786 sr_sub_4D6FB0(v1); 10778 sr_sub_4D6FB0(v1);
10787 a1a.field_28 = 16; 10779 a1a.field_28 = 16;
10793 } 10785 }
10794 } 10786 }
10795 if ( v48 ) 10787 if ( v48 )
10796 { 10788 {
10797 i = 12 - v49; 10789 i = 12 - v49;
10798 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49))); 10790 a1a.field_30 = v30 + 4 * stru_5C6E00->Cos(X + (v31 >> (12 - v49)));
10799 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi); 10791 a1a.field_2C = v31 + 4 * stru_5C6E00->Sin(X + (v30 >> i));
10800 a1a.field_28 = v48; 10792 a1a.field_28 = v48;
10801 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 ) 10793 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
10802 sr_sub_485975(&a1a, (stru315 *)&a2); 10794 sr_sub_485975(&a1a, (stru315 *)&a2);
10803 else 10795 else
10804 sr_sub_4D6FB0(v1); 10796 sr_sub_4D6FB0(v1);
11386 } 11378 }
11387 11379
11388 //----- (0048600E) -------------------------------------------------------- 11380 //----- (0048600E) --------------------------------------------------------
11389 void OutdoorCamera::RotationToInts() 11381 void OutdoorCamera::RotationToInts()
11390 { 11382 {
11391 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi); 11383 camera_rotation_y_int_sine = stru_5C6E00->Sin(pIndoorCamera->sRotationY);
11392 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY); 11384 camera_rotation_y_int_cosine = stru_5C6E00->Cos(pIndoorCamera->sRotationY);
11393 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi); 11385 camera_rotation_x_int_sine = stru_5C6E00->Sin(pIndoorCamera->sRotationX);
11394 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX); 11386 camera_rotation_x_int_cosine = stru_5C6E00->Cos(pIndoorCamera->sRotationX);
11395 } 11387 }
11396 11388
11397 11389
11398 //----- (0048607B) -------------------------------------------------------- 11390 //----- (0048607B) --------------------------------------------------------
11399 void stru148::_48607B(stru149 *a2) 11391 void stru148::_48607B(stru149 *a2)
11587 int v29; // [sp+24h] [bp-4h]@1 11579 int v29; // [sp+24h] [bp-4h]@1
11588 int v30; // [sp+30h] [bp+8h]@10 11580 int v30; // [sp+30h] [bp+8h]@10
11589 int v31; // [sp+3Ch] [bp+14h]@10 11581 int v31; // [sp+3Ch] [bp+14h]@10
11590 11582
11591 v7 = this; 11583 v7 = this;
11592 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY); 11584 v8 = stru_5C6E00->Cos(pBLVRenderParams->sPartyRotY);
11593 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi); 11585 v29 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotY);
11594 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX); 11586 v28 = stru_5C6E00->Cos(pBLVRenderParams->sPartyRotX);
11595 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi); 11587 v9 = stru_5C6E00->Sin(pBLVRenderParams->sPartyRotX);
11596 v11 = -pBLVRenderParams->vPartyPos.y; 11588 v11 = -pBLVRenderParams->vPartyPos.y;
11597 v26 = -pBLVRenderParams->vPartyPos.x; 11589 v26 = -pBLVRenderParams->vPartyPos.x;
11598 v27 = v9; 11590 v27 = v9;
11599 v12 = -pBLVRenderParams->vPartyPos.z; 11591 v12 = -pBLVRenderParams->vPartyPos.z;
11600 if ( pBLVRenderParams->sPartyRotX ) 11592 if ( pBLVRenderParams->sPartyRotX )
18434 18426
18435 18427
18436 18428
18437 18429
18438 //----- (00402CAE) -------------------------------------------------------- 18430 //----- (00402CAE) --------------------------------------------------------
18439 int stru193_math::SinCos(int angle) 18431 int stru193_math::Cos(int angle)
18440 { 18432 {
18441 int v2; // eax@1 18433 int v2; // eax@1
18442 18434
18443 //a2: (angle - uIntegerHalfPi) for sin(angle) 18435 //a2: (angle - uIntegerHalfPi) for sin(angle)
18444 // (angle) for cos(angle) 18436 // (angle) for cos(angle)