Mercurial > might-and-magic-trilogy
comparison AudioPlayer.cpp @ 67:476145dc3441
Слияние
author | Ritor1 |
---|---|
date | Fri, 26 Oct 2012 23:22:41 +0600 |
parents | 41cbaabde2cb |
children | a84fb3752681 |
comparison
equal
deleted
inserted
replaced
66:5ec98919c8fd | 67:476145dc3441 |
---|---|
823 if ( a5 != -1 ) | 823 if ( a5 != -1 ) |
824 { | 824 { |
825 if ( !a5 ) | 825 if ( !a5 ) |
826 v75 = pParty->vPosition.x; | 826 v75 = pParty->vPosition.x; |
827 if ( !a6 ) | 827 if ( !a6 ) |
828 a6 = pParty->vPosition.z; | 828 a6 = pParty->vPosition.y; |
829 if ( uNumRepeats ) | 829 if ( uNumRepeats ) |
830 AIL_set_sample_loop_count(v73->hSample, uNumRepeats - 1); | 830 AIL_set_sample_loop_count(v73->hSample, uNumRepeats - 1); |
831 v83 = sub_4AB66C(v75, a6); | 831 v83 = sub_4AB66C(v75, a6); |
832 AIL_set_sample_pan(v73->hSample, v83); | 832 AIL_set_sample_pan(v73->hSample, v83); |
833 v84 = GetSoundStrengthByDistanceFromParty(v75, a6, pParty->vPosition.y); | 833 v84 = GetSoundStrengthByDistanceFromParty(v75, a6, pParty->vPosition.z); |
834 AIL_set_sample_volume(v73->hSample, v84); | 834 AIL_set_sample_volume(v73->hSample, v84); |
835 v76 = a3; | 835 v76 = a3; |
836 goto LABEL_184; | 836 goto LABEL_184; |
837 } | 837 } |
838 v76 = a3; | 838 v76 = a3; |
1047 { | 1047 { |
1048 v96 = 12; | 1048 v96 = 12; |
1049 v12 = 10; | 1049 v12 = 10; |
1050 LABEL_46: | 1050 LABEL_46: |
1051 a1.vWorldPosition.x = (double)pParty->vPosition.x; | 1051 a1.vWorldPosition.x = (double)pParty->vPosition.x; |
1052 a1.vWorldPosition.y = (double)pParty->vPosition.z; | 1052 a1.vWorldPosition.y = (double)pParty->vPosition.y; |
1053 v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.y; | 1053 v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; |
1054 goto LABEL_47; | 1054 goto LABEL_47; |
1055 } | 1055 } |
1056 v12 = 10 * v13 / 16; | 1056 v12 = 10 * v13 / 16; |
1057 v14 = 12 * v13; | 1057 v14 = 12 * v13; |
1058 } | 1058 } |
1257 goto LABEL_101; | 1257 goto LABEL_101; |
1258 } | 1258 } |
1259 if ( (a3 & 7) != 5 ) | 1259 if ( (a3 & 7) != 5 ) |
1260 { | 1260 { |
1261 a1.vWorldPosition.x = (double)pParty->vPosition.x; | 1261 a1.vWorldPosition.x = (double)pParty->vPosition.x; |
1262 v43 = (double)pParty->vPosition.z; | 1262 v43 = (double)pParty->vPosition.y; |
1263 LABEL_100: | 1263 LABEL_100: |
1264 a1.vWorldPosition.y = v43; | 1264 a1.vWorldPosition.y = v43; |
1265 v47 = (double)pParty->sEyelevel + (double)pParty->vPosition.y; | 1265 v47 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; |
1266 goto LABEL_101; | 1266 goto LABEL_101; |
1267 } | 1267 } |
1268 v44 = (LayingItem *)&pLevelDecorations[a3 >> 3]; | 1268 v44 = (LayingItem *)&pLevelDecorations[a3 >> 3]; |
1269 } | 1269 } |
1270 a1.vWorldPosition.x = (double)v44->vPosition.x; | 1270 a1.vWorldPosition.x = (double)v44->vPosition.x; |
1425 goto LABEL_21; | 1425 goto LABEL_21; |
1426 } | 1426 } |
1427 if ( v10 != 2 ) | 1427 if ( v10 != 2 ) |
1428 { | 1428 { |
1429 a1.vWorldPosition.x = (double)pParty->vPosition.x; | 1429 a1.vWorldPosition.x = (double)pParty->vPosition.x; |
1430 a1.vWorldPosition.y = (double)pParty->vPosition.z; | 1430 a1.vWorldPosition.y = (double)pParty->vPosition.y; |
1431 v11 = (double)pParty->sEyelevel + (double)pParty->vPosition.y; | 1431 v11 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; |
1432 goto LABEL_21; | 1432 goto LABEL_21; |
1433 } | 1433 } |
1434 v12 = (LayingItem *)&pLevelDecorations[v6->field_4 >> 3]; | 1434 v12 = (LayingItem *)&pLevelDecorations[v6->field_4 >> 3]; |
1435 } | 1435 } |
1436 else | 1436 else |
1449 v55 = pBLVRenderParams->fCosineY; | 1449 v55 = pBLVRenderParams->fCosineY; |
1450 v56 = pBLVRenderParams->fSineY; | 1450 v56 = pBLVRenderParams->fSineY; |
1451 if ( pBLVRenderParams->sPartyRotX ) | 1451 if ( pBLVRenderParams->sPartyRotX ) |
1452 { | 1452 { |
1453 v58 = a1.vWorldPosition.x - (double)pParty->vPosition.x; | 1453 v58 = a1.vWorldPosition.x - (double)pParty->vPosition.x; |
1454 *(float *)&uNumRepeats = a1.vWorldPosition.y - (double)pParty->vPosition.z; | 1454 *(float *)&uNumRepeats = a1.vWorldPosition.y - (double)pParty->vPosition.y; |
1455 v18 = a1.vWorldPosition.z - (double)pParty->vPosition.y; | 1455 v18 = a1.vWorldPosition.z - (double)pParty->vPosition.z; |
1456 if ( pRenderer->pRenderD3D ) | 1456 if ( pRenderer->pRenderD3D ) |
1457 { | 1457 { |
1458 v19 = *(float *)&uNumRepeats * v56 + v58 * v55; | 1458 v19 = *(float *)&uNumRepeats * v56 + v58 * v55; |
1459 v20 = v58 * v56 - *(float *)&uNumRepeats * v55; | 1459 v20 = v58 * v56 - *(float *)&uNumRepeats * v55; |
1460 } | 1460 } |
1468 a1.vWorldViewPosition.z = v19 * v17 + v18 * v16; | 1468 a1.vWorldViewPosition.z = v19 * v17 + v18 * v16; |
1469 } | 1469 } |
1470 else | 1470 else |
1471 { | 1471 { |
1472 v58 = a1.vWorldPosition.x - (double)pParty->vPosition.x; | 1472 v58 = a1.vWorldPosition.x - (double)pParty->vPosition.x; |
1473 *(float *)&uNumRepeats = a1.vWorldPosition.y - (double)pParty->vPosition.z; | 1473 *(float *)&uNumRepeats = a1.vWorldPosition.y - (double)pParty->vPosition.y; |
1474 if ( pRenderer->pRenderD3D ) | 1474 if ( pRenderer->pRenderD3D ) |
1475 { | 1475 { |
1476 a1.vWorldViewPosition.x = *(float *)&uNumRepeats * v56 + v58 * v55; | 1476 a1.vWorldViewPosition.x = *(float *)&uNumRepeats * v56 + v58 * v55; |
1477 v21 = v58 * v56 - *(float *)&uNumRepeats * v55; | 1477 v21 = v58 * v56 - *(float *)&uNumRepeats * v55; |
1478 } | 1478 } |
1480 { | 1480 { |
1481 a1.vWorldViewPosition.x = v58 * v55 - *(float *)&uNumRepeats * v56; | 1481 a1.vWorldViewPosition.x = v58 * v55 - *(float *)&uNumRepeats * v56; |
1482 v21 = v58 * v56 + *(float *)&uNumRepeats * v55; | 1482 v21 = v58 * v56 + *(float *)&uNumRepeats * v55; |
1483 } | 1483 } |
1484 a1.vWorldViewPosition.y = v21; | 1484 a1.vWorldViewPosition.y = v21; |
1485 a1.vWorldViewPosition.z = a1.vWorldPosition.z - (double)pParty->vPosition.y; | 1485 a1.vWorldViewPosition.z = a1.vWorldPosition.z - (double)pParty->vPosition.z; |
1486 } | 1486 } |
1487 } | 1487 } |
1488 else | 1488 else |
1489 { | 1489 { |
1490 LABEL_31: | 1490 LABEL_31: |
1621 while ( 1 ) | 1621 while ( 1 ) |
1622 { | 1622 { |
1623 LODWORD(v56) = 1; | 1623 LODWORD(v56) = 1; |
1624 v43 = 4 * v59 + 6817720; | 1624 v43 = 4 * v59 + 6817720; |
1625 v44 = &pLevelDecorations[_6807B8_level_decorations_ids[v59]]; | 1625 v44 = &pLevelDecorations[_6807B8_level_decorations_ids[v59]]; |
1626 v45 = abs(v44->vPosition.z - pParty->vPosition.y); | 1626 v45 = abs(v44->vPosition.z - pParty->vPosition.z); |
1627 v46 = abs(v44->vPosition.y - pParty->vPosition.z); | 1627 v46 = abs(v44->vPosition.y - pParty->vPosition.y); |
1628 v47 = abs(v44->vPosition.x - pParty->vPosition.x); | 1628 v47 = abs(v44->vPosition.x - pParty->vPosition.x); |
1629 if ( sub_4621DA(v47, v46, v45) <= 8192 ) | 1629 if ( sub_4621DA(v47, v46, v45) <= 8192 ) |
1630 break; | 1630 break; |
1631 LABEL_89: | 1631 LABEL_89: |
1632 ++v59; | 1632 ++v59; |
1690 //----- (004AB66C) -------------------------------------------------------- | 1690 //----- (004AB66C) -------------------------------------------------------- |
1691 int __fastcall sub_4AB66C(int a1, int a2) | 1691 int __fastcall sub_4AB66C(int a1, int a2) |
1692 { | 1692 { |
1693 signed int v2; // eax@1 | 1693 signed int v2; // eax@1 |
1694 | 1694 |
1695 v2 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->Atan2(a1 - pParty->vPosition.x, a2 - pParty->vPosition.z) | 1695 v2 = stru_5C6E00->uDoublePiMask & (stru_5C6E00->Atan2(a1 - pParty->vPosition.x, a2 - pParty->vPosition.y) |
1696 - stru_5C6E00->uIntegerHalfPi | 1696 - stru_5C6E00->uIntegerHalfPi |
1697 - pParty->sRotationY); | 1697 - pParty->sRotationY); |
1698 if ( v2 > (signed int)stru_5C6E00->uIntegerPi ) | 1698 if ( v2 > (signed int)stru_5C6E00->uIntegerPi ) |
1699 v2 = 2 * stru_5C6E00->uIntegerPi - v2; | 1699 v2 = 2 * stru_5C6E00->uIntegerPi - v2; |
1700 return (v2 >> 3) - (v2 >> 10); | 1700 return (v2 >> 3) - (v2 >> 10); |
1712 int result; // eax@2 | 1712 int result; // eax@2 |
1713 int v9; // [sp+10h] [bp+8h]@1 | 1713 int v9; // [sp+10h] [bp+8h]@1 |
1714 | 1714 |
1715 v3 = a2; | 1715 v3 = a2; |
1716 v4 = a1; | 1716 v4 = a1; |
1717 v5 = abs(a3 - pParty->vPosition.y); | 1717 v5 = abs(a3 - pParty->vPosition.z); |
1718 v6 = abs(v3 - pParty->vPosition.z); | 1718 v6 = abs(v3 - pParty->vPosition.y); |
1719 v7 = abs(v4 - pParty->vPosition.x); | 1719 v7 = abs(v4 - pParty->vPosition.x); |
1720 v9 = sub_4621DA(v7, v6, v5); | 1720 v9 = sub_4621DA(v7, v6, v5); |
1721 if ( v9 <= 8192 ) | 1721 if ( v9 <= 8192 ) |
1722 result = 114 - (unsigned __int64)(signed __int64)((double)v9 * 0.0001220703125 * 100.0); | 1722 result = 114 - (unsigned __int64)(signed __int64)((double)v9 * 0.0001220703125 * 100.0); |
1723 else | 1723 else |
2199 v10 = pBLVRenderParams->fSineY; | 2199 v10 = pBLVRenderParams->fSineY; |
2200 result = 0; | 2200 result = 0; |
2201 if ( pBLVRenderParams->sPartyRotX ) | 2201 if ( pBLVRenderParams->sPartyRotX ) |
2202 { | 2202 { |
2203 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 2203 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
2204 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.z; | 2204 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
2205 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.y; | 2205 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
2206 if ( pRenderer->pRenderD3D ) | 2206 if ( pRenderer->pRenderD3D ) |
2207 { | 2207 { |
2208 v5 = v11 * pBLVRenderParams->fSineY + v13 * pBLVRenderParams->fCosineY; | 2208 v5 = v11 * pBLVRenderParams->fSineY + v13 * pBLVRenderParams->fCosineY; |
2209 v6 = v13 * pBLVRenderParams->fSineY - v11 * pBLVRenderParams->fCosineY; | 2209 v6 = v13 * pBLVRenderParams->fSineY - v11 * pBLVRenderParams->fCosineY; |
2210 } | 2210 } |
2218 a1->vWorldViewPosition.z = v5 * v2 + v4 * v1; | 2218 a1->vWorldViewPosition.z = v5 * v2 + v4 * v1; |
2219 } | 2219 } |
2220 else | 2220 else |
2221 { | 2221 { |
2222 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 2222 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
2223 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.z; | 2223 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
2224 v7 = a1->vWorldPosition.z - (double)pParty->vPosition.y; | 2224 v7 = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
2225 if ( pRenderer->pRenderD3D ) | 2225 if ( pRenderer->pRenderD3D ) |
2226 { | 2226 { |
2227 a1->vWorldViewPosition.x = v12 * pBLVRenderParams->fSineY + v14 * pBLVRenderParams->fCosineY; | 2227 a1->vWorldViewPosition.x = v12 * pBLVRenderParams->fSineY + v14 * pBLVRenderParams->fCosineY; |
2228 v8 = v14 * v10 - v12 * v9; | 2228 v8 = v14 * v10 - v12 * v9; |
2229 } | 2229 } |