Mercurial > might-and-magic-trilogy
comparison mm7_3.cpp @ 87:c0cf9393af64
Слияние
author | Ritor1 |
---|---|
date | Mon, 29 Oct 2012 09:28:08 +0600 |
parents | 8b0c4d626477 |
children | 6c42178c226e 51a5b0dc3f30 |
comparison
equal
deleted
inserted
replaced
86:c83d06692295 | 87:c0cf9393af64 |
---|---|
120 { | 120 { |
121 while ( 1 ) | 121 while ( 1 ) |
122 { | 122 { |
123 v9 = &pIndoor->pSectors[v33[result]]; | 123 v9 = &pIndoor->pSectors[v33[result]]; |
124 v10 = 0; | 124 v10 = 0; |
125 v32 = v9->field_4 + v9->field_C + v9->field_14; | 125 v32 = v9->uNumFloors + v9->field_C + v9->field_14; |
126 v26 = 0; | 126 v26 = 0; |
127 if ( v32 > 0 ) | 127 if ( v32 > 0 ) |
128 break; | 128 break; |
129 LABEL_46: | 129 LABEL_46: |
130 result = v29++ + 1; | 130 result = v29++ + 1; |
344 f.pFacePlane_old.vNormal.y = v4->pFacePlane.vNormal.y; | 344 f.pFacePlane_old.vNormal.y = v4->pFacePlane.vNormal.y; |
345 v5 = v4->pFacePlane.vNormal.z; | 345 v5 = v4->pFacePlane.vNormal.z; |
346 f.pFacePlane_old.vNormal.z = v4->pFacePlane.vNormal.z; | 346 f.pFacePlane_old.vNormal.z = v4->pFacePlane.vNormal.z; |
347 v6 = v4->pFacePlane.dist; | 347 v6 = v4->pFacePlane.dist; |
348 f.pFacePlane_old.dist = v4->pFacePlane.dist; | 348 f.pFacePlane_old.dist = v4->pFacePlane.dist; |
349 v7 = v4->uFaceAttributes; | 349 v7 = v4->uAttributes; |
350 f.uAttributes = v7; | 350 f.uAttributes = v7; |
351 f.pBounding.x1 = v4->pBoundingBox.x1; | 351 f.pBounding.x1 = v4->pBoundingBox.x1; |
352 f.pBounding.y1 = v4->pBoundingBox.y1; | 352 f.pBounding.y1 = v4->pBoundingBox.y1; |
353 f.pBounding.z1 = v4->pBoundingBox.z1; | 353 f.pBounding.z1 = v4->pBoundingBox.z1; |
354 f.pBounding.x2 = v4->pBoundingBox.x2; | 354 f.pBounding.x2 = v4->pBoundingBox.x2; |
516 } | 516 } |
517 | 517 |
518 | 518 |
519 | 519 |
520 //----- (0046ED1B) -------------------------------------------------------- | 520 //----- (0046ED1B) -------------------------------------------------------- |
521 int __fastcall _46ED1B_collide_against_floor(signed int a1, signed int a2, int a3, unsigned int *pSectorID, int *a5) | 521 int _46ED1B_collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID) |
522 { | 522 { |
523 unsigned int *v5; // edi@1 | 523 uint uFaceID = -1; |
524 int result; // eax@1 | 524 int floor_level = _46CEC3_get_floor_level(x, y, z, *pSectorID, &uFaceID); |
525 int v7; // eax@3 | 525 |
526 int v8; // [sp+Ch] [bp-8h]@1 | 526 if (floor_level != -30000 && floor_level <= z + 50) |
527 int v9; // [sp+10h] [bp-4h]@1 | 527 { |
528 | 528 *pFaceID = uFaceID; |
529 v5 = pSectorID; | 529 return floor_level; |
530 v9 = a2; | 530 } |
531 v8 = a1; | 531 |
532 result = _46CEC3_get_floor_level(a1, a2, a3, *pSectorID, (int *)&pSectorID); | 532 uint uSectorID = pIndoor->GetSector(x, y, z); |
533 if ( result != -30000 && result <= a3 + 50 | 533 *pSectorID = uSectorID; |
534 || (v7 = pIndoor->GetSector(v8, v9, a3), (*v5 = v7) != 0) | 534 |
535 && (result = _46CEC3_get_floor_level(v8, v9, a3, v7, (int *)&pSectorID), result != -30000) ) | 535 floor_level = _46CEC3_get_floor_level(x, y, z, uSectorID, &uFaceID); |
536 *a5 = (int)pSectorID; | 536 if (uSectorID && floor_level != -30000) |
537 else | 537 *pFaceID = uFaceID; |
538 result = -30000; | 538 else return -30000; |
539 return result; | 539 return floor_level; |
540 } | 540 } |
541 | 541 |
542 //----- (0046ED8A) -------------------------------------------------------- | 542 //----- (0046ED8A) -------------------------------------------------------- |
543 void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this) | 543 void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this) |
544 { | 544 { |
647 v9 = pParty->uPartyHeight; | 647 v9 = pParty->uPartyHeight; |
648 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 ) | 648 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 ) |
649 { | 649 { |
650 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 ) | 650 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 ) |
651 { | 651 { |
652 if ( stru_721530.sMaxY <= pParty->vPosition.z + v1 ) | 652 if ( stru_721530.sMaxY <= pParty->vPosition.y + v1 ) |
653 { | 653 { |
654 if ( stru_721530.sMinY >= pParty->vPosition.z - v1 ) | 654 if ( stru_721530.sMinY >= pParty->vPosition.y - v1 ) |
655 { | 655 { |
656 if ( stru_721530.sMaxZ <= (signed int)(pParty->vPosition.y + pParty->uPartyHeight) ) | 656 if ( stru_721530.sMaxZ <= (signed int)(pParty->vPosition.z + pParty->uPartyHeight) ) |
657 { | 657 { |
658 if ( stru_721530.sMinZ >= pParty->vPosition.y ) | 658 if ( stru_721530.sMinZ >= pParty->vPosition.z ) |
659 { | 659 { |
660 v3 = stru_721530.prolly_normal_d + v1; | 660 v3 = stru_721530.prolly_normal_d + v1; |
661 v11 = pParty->vPosition.x - stru_721530.normal.x; | 661 v11 = pParty->vPosition.x - stru_721530.normal.x; |
662 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y | 662 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y |
663 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16; | 663 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16; |
664 v10 = pParty->vPosition.z - stru_721530.normal.y; | 664 v10 = pParty->vPosition.y - stru_721530.normal.y; |
665 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y | 665 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y |
666 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16); | 666 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16); |
667 if ( result <= v3 ) | 667 if ( result <= v3 ) |
668 { | 668 { |
669 result = v10 * stru_721530.field_58.y; | 669 result = v10 * stru_721530.field_58.y; |
670 v5 = (v10 * stru_721530.field_58.y + v11 * stru_721530.field_58.x) >> 16; | 670 v5 = (v10 * stru_721530.field_58.y + v11 * stru_721530.field_58.x) >> 16; |
671 if ( v5 > 0 ) | 671 if ( v5 > 0 ) |
672 { | 672 { |
673 v6 = ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v5) >> 16) + stru_721530.normal.z; | 673 v6 = ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v5) >> 16) + stru_721530.normal.z; |
674 result = pParty->vPosition.y; | 674 result = pParty->vPosition.z; |
675 if ( v6 >= pParty->vPosition.y ) | 675 if ( v6 >= pParty->vPosition.z ) |
676 { | 676 { |
677 result = v9 + pParty->vPosition.y; | 677 result = v9 + pParty->vPosition.z; |
678 if ( v6 <= (signed int)(v9 + pParty->vPosition.y) || v8 ) | 678 if ( v6 <= (signed int)(v9 + pParty->vPosition.z) || v8 ) |
679 { | 679 { |
680 result = sub_452A9E(v3 * v3 - v4 * v4); | 680 result = sub_452A9E(v3 * v3 - v4 * v4); |
681 v7 = v5 - result; | 681 v7 = v5 - result; |
682 if ( v7 < 0 ) | 682 if ( v7 < 0 ) |
683 v7 = 0; | 683 v7 = 0; |
1009 v67 = v69 == 0; | 1009 v67 = v69 == 0; |
1010 if ( v6 > v5 + 1 ) | 1010 if ( v6 > v5 + 1 ) |
1011 v72 = 1; | 1011 v72 = 1; |
1012 if ( v0->uAIState == 5 && v76 && !v72 ) | 1012 if ( v0->uAIState == 5 && v76 && !v72 ) |
1013 { | 1013 { |
1014 v0->uAIState = 11; | 1014 v0->uAIState = Removed; |
1015 goto LABEL_121; | 1015 goto LABEL_121; |
1016 } | 1016 } |
1017 if ( v0->uCurrentActionAnimation == 1 ) | 1017 if ( v0->uCurrentActionAnimation == 1 ) |
1018 { | 1018 { |
1019 v8 = v0->uMovementSpeed; | 1019 v8 = v0->uMovementSpeed; |
1112 { | 1112 { |
1113 v0->vVelocity.x += rand() % 100 - 50; | 1113 v0->vVelocity.x += rand() % 100 - 50; |
1114 v0->vVelocity.y += rand() % 100 - 50; | 1114 v0->vVelocity.y += rand() % 100 - 50; |
1115 v0->vVelocity.z += rand() % 100 - 20; | 1115 v0->vVelocity.z += rand() % 100 - 20; |
1116 v25 = rand(); | 1116 v25 = rand(); |
1117 v0->uAIState = 8; | 1117 v0->uAIState = Stunned; |
1118 v0->uYawAngle += v25 % 32 - 16; | 1118 v0->uYawAngle += v25 % 32 - 16; |
1119 v0->UpdateAnimation(); | 1119 v0->UpdateAnimation(); |
1120 } | 1120 } |
1121 if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == v17 ) | 1121 if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == v17 ) |
1122 { | 1122 { |
1189 if ( v64 ) | 1189 if ( v64 ) |
1190 v61 = v36 + 30; | 1190 v61 = v36 + 30; |
1191 else | 1191 else |
1192 v61 = v68 + 60; | 1192 v61 = v68 + 60; |
1193 sub_42F960_create_object(v0->vPosition.x, v0->vPosition.y, v61); | 1193 sub_42F960_create_object(v0->vPosition.x, v0->vPosition.y, v61); |
1194 v0->uAIState = 11; | 1194 v0->uAIState = Removed; |
1195 return; | 1195 return; |
1196 } | 1196 } |
1197 } | 1197 } |
1198 } | 1198 } |
1199 if ( stru_721530.field_7C >= stru_721530.field_6C ) | 1199 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
1272 v0->vVelocity.y = WORD1(v51); | 1272 v0->vVelocity.y = WORD1(v51); |
1273 break; | 1273 break; |
1274 case 6: | 1274 case 6: |
1275 v40 = &pOutdoor->pBModels[v38 >> 9]; | 1275 v40 = &pOutdoor->pBModels[v38 >> 9]; |
1276 v41 = &v40->pFaces[v39 & 0x3F]; | 1276 v41 = &v40->pFaces[v39 & 0x3F]; |
1277 if ( !(BYTE3(v41->uFaceAttributes) & 0x20) ) | 1277 if ( !(BYTE3(v41->uAttributes) & 0x20) ) |
1278 { | 1278 { |
1279 v42 = v41->uPolygonType; | 1279 v42 = v41->uPolygonType; |
1280 if ( v42 == 3 ) | 1280 if ( v42 == 3 ) |
1281 { | 1281 { |
1282 v43 = v0->vVelocity.y; | 1282 v43 = v0->vVelocity.y; |
1370 if ( v0->CanAct() ) | 1370 if ( v0->CanAct() ) |
1371 { | 1371 { |
1372 v0->uYawAngle -= 32; | 1372 v0->uYawAngle -= 32; |
1373 v0->uCurrentActionTime = 0; | 1373 v0->uCurrentActionTime = 0; |
1374 v0->uCurrentActionLength = 128; | 1374 v0->uCurrentActionLength = 128; |
1375 v0->uAIState = 7; | 1375 v0->uAIState = Fleeing; |
1376 } | 1376 } |
1377 } | 1377 } |
1378 } | 1378 } |
1379 LABEL_121: | 1379 LABEL_121: |
1380 ++v75; | 1380 ++v75; |
1381 } | 1381 } |
1382 while ( (signed int)v75 < (signed int)uNumActors ); | 1382 while ( (signed int)v75 < (signed int)uNumActors ); |
1383 } | 1383 } |
1384 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int); | |
1385 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int); | |
1386 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int); | |
1387 // 4F75D8: using guessed type int ai_arrays_size; | |
1388 | 1384 |
1389 | 1385 |
1390 | 1386 |
1391 //----- (0047136C) -------------------------------------------------------- | 1387 //----- (0047136C) -------------------------------------------------------- |
1392 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID) | 1388 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID) |
1426 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19 | 1422 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19 |
1427 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68 | 1423 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68 |
1428 Particle_ Dst; // [sp+Ch] [bp-84h]@18 | 1424 Particle_ Dst; // [sp+Ch] [bp-84h]@18 |
1429 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1 | 1425 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1 |
1430 ObjectDesc *v37; // [sp+78h] [bp-18h]@1 | 1426 ObjectDesc *v37; // [sp+78h] [bp-18h]@1 |
1431 int v38; // [sp+7Ch] [bp-14h]@4 | 1427 unsigned int uFaceID; // [sp+7Ch] [bp-14h]@4 |
1432 int v39; // [sp+80h] [bp-10h]@33 | 1428 int v39; // [sp+80h] [bp-10h]@33 |
1433 int v40; // [sp+84h] [bp-Ch]@28 | 1429 int v40; // [sp+84h] [bp-Ch]@28 |
1434 int v41; // [sp+88h] [bp-8h]@34 | 1430 int v41; // [sp+88h] [bp-8h]@34 |
1435 int v42; // [sp+8Ch] [bp-4h]@4 | 1431 int v42; // [sp+8Ch] [bp-4h]@4 |
1436 | 1432 |
1440 v3 = v1->vPosition.x; | 1436 v3 = v1->vPosition.x; |
1441 v37 = &pObjectList->pObjects[v1->uObjectDescID]; | 1437 v37 = &pObjectList->pObjects[v1->uObjectDescID]; |
1442 if ( abs(v3) > 32767 | 1438 if ( abs(v3) > 32767 |
1443 || abs(v1->vPosition.y) > 32767 | 1439 || abs(v1->vPosition.y) > 32767 |
1444 || abs(v1->vPosition.z) > 20000 | 1440 || abs(v1->vPosition.z) > 20000 |
1445 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &v38), | 1441 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &uFaceID), |
1446 v42 <= -30000) | 1442 v42 <= -30000) |
1447 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z), | 1443 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z), |
1448 (v1->uSectorID = v4) == 0) | 1444 (v1->uSectorID = v4) == 0) |
1449 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v4, &v38), v42 == -30000)) ) | 1445 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v4, &uFaceID), v42 == -30000)) ) |
1450 { | 1446 { |
1451 LayingItem::_42F933(uLayingItemID_); | 1447 LayingItem::_42F933(uLayingItemID_); |
1452 return; | 1448 return; |
1453 } | 1449 } |
1454 v5 = v2->uFlags; | 1450 v5 = v2->uFlags; |
1456 { | 1452 { |
1457 LABEL_24: | 1453 LABEL_24: |
1458 v8 = 0; | 1454 v8 = 0; |
1459 LABEL_25: | 1455 LABEL_25: |
1460 stru_721530.field_0 = v8; | 1456 stru_721530.field_0 = v8; |
1461 v38 = v8; | 1457 uFaceID = v8; |
1462 stru_721530.prolly_normal_d = v2->uRadius; | 1458 stru_721530.prolly_normal_d = v2->uRadius; |
1463 v12 = v2->uHeight; | 1459 v12 = v2->uHeight; |
1464 stru_721530.field_84 = -1; | 1460 stru_721530.field_84 = -1; |
1465 stru_721530.field_C = v12; | 1461 stru_721530.field_C = v12; |
1466 stru_721530.field_8 = v8; | 1462 stru_721530.field_8 = v8; |
1557 Dst.uDiffuse = rand(); | 1553 Dst.uDiffuse = rand(); |
1558 v30 = rand(); | 1554 v30 = rand(); |
1559 v34 = (TEXTURE_TYPE)v8; | 1555 v34 = (TEXTURE_TYPE)v8; |
1560 v32 = "effpar03"; | 1556 v32 = "effpar03"; |
1561 } | 1557 } |
1562 Dst.field_20 = (unsigned __int8)(v30 & 0x80) + 128; | 1558 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128; |
1563 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34); | 1559 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34); |
1564 goto LABEL_71; | 1560 goto LABEL_71; |
1565 } | 1561 } |
1566 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; | 1562 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
1567 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; | 1563 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
1658 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; | 1654 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; |
1659 v40 = 58500; | 1655 v40 = 58500; |
1660 v1->vVelocity.y = v41; | 1656 v1->vVelocity.y = v41; |
1661 v41 = v1->vVelocity.z; | 1657 v41 = v1->vVelocity.z; |
1662 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; | 1658 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; |
1663 ++v38; | 1659 ++uFaceID; |
1664 v28 = __OFSUB__(v38, 100); | 1660 v28 = __OFSUB__(uFaceID, 100); |
1665 v27 = v38 - 100 < 0; | 1661 v27 = uFaceID - 100 < 0; |
1666 v1->vVelocity.z = v41; | 1662 v1->vVelocity.z = v41; |
1667 if ( !(v27 ^ v28) ) | 1663 if ( !(v27 ^ v28) ) |
1668 return; | 1664 return; |
1669 v8 = 0; | 1665 v8 = 0; |
1670 } | 1666 } |
1676 } | 1672 } |
1677 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) ) | 1673 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) ) |
1678 { | 1674 { |
1679 v6 = pIndoor->pFaces; | 1675 v6 = pIndoor->pFaces; |
1680 v1->vPosition.z = v42 + 1; | 1676 v1->vPosition.z = v42 + 1; |
1681 v7 = &v6[v38]; | 1677 v7 = &v6[uFaceID]; |
1682 if ( v7->uPolygonType == 3 ) | 1678 if ( v7->uPolygonType == 3 ) |
1683 { | 1679 { |
1684 v8 = 0; | 1680 v8 = 0; |
1685 v1->vVelocity.z = 0; | 1681 v1->vVelocity.z = 0; |
1686 } | 1682 } |
1689 if ( v7->pFacePlane_old.vNormal.z < 45000 ) | 1685 if ( v7->pFacePlane_old.vNormal.z < 45000 ) |
1690 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); | 1686 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
1691 v8 = 0; | 1687 v8 = 0; |
1692 } | 1688 } |
1693 v42 = v1->vVelocity.x; | 1689 v42 = v1->vVelocity.x; |
1694 v38 = 58500; | 1690 uFaceID = 58500; |
1695 v42 = (unsigned __int64)(58500i64 * v42) >> 16; | 1691 v42 = (unsigned __int64)(58500i64 * v42) >> 16; |
1696 v1->vVelocity.x = v42; | 1692 v1->vVelocity.x = v42; |
1697 v42 = v1->vVelocity.y; | 1693 v42 = v1->vVelocity.y; |
1698 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16; | 1694 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16; |
1699 v38 = 58500; | 1695 uFaceID = 58500; |
1700 v1->vVelocity.y = v42; | 1696 v1->vVelocity.y = v42; |
1701 v42 = v1->vVelocity.z; | 1697 v42 = v1->vVelocity.z; |
1702 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16; | 1698 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16; |
1703 v9 = v1->vVelocity.x; | 1699 v9 = v1->vVelocity.x; |
1704 v1->vVelocity.z = v42; | 1700 v1->vVelocity.z = v42; |
1705 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 ) | 1701 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 ) |
1706 { | 1702 { |
1707 v1->vVelocity.z = v8; | 1703 v1->vVelocity.z = v8; |
1731 if ( v10 & 0x400 ) | 1727 if ( v10 & 0x400 ) |
1732 { | 1728 { |
1733 LABEL_70: | 1729 LABEL_70: |
1734 Dst.bFree = 512; | 1730 Dst.bFree = 512; |
1735 Dst.uDiffuse = rand(); | 1731 Dst.uDiffuse = rand(); |
1736 Dst.field_20 = 64; | 1732 Dst.timeToLive = 64; |
1737 Dst.uTextureID = v8; | 1733 Dst.uTextureID = v8; |
1738 LABEL_71: | 1734 LABEL_71: |
1739 Dst.flt_28 = 1.0; | 1735 Dst.flt_28 = 1.0; |
1740 goto LABEL_72; | 1736 goto LABEL_72; |
1741 } | 1737 } |
1744 Dst.flt_28 = 1.0; | 1740 Dst.flt_28 = 1.0; |
1745 v11 = rand(); | 1741 v11 = rand(); |
1746 v33 = (TEXTURE_TYPE)v8; | 1742 v33 = (TEXTURE_TYPE)v8; |
1747 v31 = "effpar03"; | 1743 v31 = "effpar03"; |
1748 } | 1744 } |
1749 Dst.field_20 = (unsigned __int8)(v11 & 0x80) + 128; | 1745 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128; |
1750 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33); | 1746 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33); |
1751 LABEL_72: | 1747 LABEL_72: |
1752 pGame->pParticleEngine->AddParticle(&Dst); | 1748 pGame->pParticleEngine->AddParticle(&Dst); |
1753 return; | 1749 return; |
1754 } | 1750 } |
1925 { | 1921 { |
1926 if ( HIBYTE(v23) & 4 ) | 1922 if ( HIBYTE(v23) & 4 ) |
1927 { | 1923 { |
1928 Dst.bFree = 512; | 1924 Dst.bFree = 512; |
1929 Dst.uDiffuse = rand(); | 1925 Dst.uDiffuse = rand(); |
1930 Dst.field_20 = 64; | 1926 Dst.timeToLive = 64; |
1931 Dst.uTextureID = 0; | 1927 Dst.uTextureID = 0; |
1932 LABEL_89: | 1928 LABEL_89: |
1933 Dst.flt_28 = 1.0; | 1929 Dst.flt_28 = 1.0; |
1934 pGame->pParticleEngine->AddParticle(&Dst); | 1930 pGame->pParticleEngine->AddParticle(&Dst); |
1935 return; | 1931 return; |
1939 v24 = rand(); | 1935 v24 = rand(); |
1940 v48 = (TEXTURE_TYPE)0; | 1936 v48 = (TEXTURE_TYPE)0; |
1941 LABEL_87: | 1937 LABEL_87: |
1942 v47 = "effpar03"; | 1938 v47 = "effpar03"; |
1943 } | 1939 } |
1944 Dst.field_20 = (unsigned __int8)(v24 & 0x80) + 128; | 1940 Dst.timeToLive = (unsigned __int8)(v24 & 0x80) + 128; |
1945 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48); | 1941 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48); |
1946 goto LABEL_89; | 1942 goto LABEL_89; |
1947 } | 1943 } |
1948 LABEL_13: | 1944 LABEL_13: |
1949 if ( v1->vPosition.z > v7 | 1945 if ( v1->vPosition.z > v7 |
2064 { | 2060 { |
2065 Dst.bFree = 512; | 2061 Dst.bFree = 512; |
2066 v46 = rand(); | 2062 v46 = rand(); |
2067 Dst.uTextureID = 0; | 2063 Dst.uTextureID = 0; |
2068 Dst.uDiffuse = v46; | 2064 Dst.uDiffuse = v46; |
2069 Dst.field_20 = 64; | 2065 Dst.timeToLive = 64; |
2070 goto LABEL_89; | 2066 goto LABEL_89; |
2071 } | 2067 } |
2072 Dst.bFree = 1032; | 2068 Dst.bFree = 1032; |
2073 Dst.uDiffuse = rand(); | 2069 Dst.uDiffuse = rand(); |
2074 v24 = rand(); | 2070 v24 = rand(); |
2125 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16; | 2121 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16; |
2126 v37 = (unsigned int)(v57 * (int)v36) >> 16; | 2122 v37 = (unsigned int)(v57 * (int)v36) >> 16; |
2127 } | 2123 } |
2128 v1->vVelocity.z += v37; | 2124 v1->vVelocity.z += v37; |
2129 LABEL_70: | 2125 LABEL_70: |
2130 if ( BYTE3(v32->uFaceAttributes) & 0x10 ) | 2126 if ( BYTE3(v32->uAttributes) & 0x10 ) |
2131 EventProcessor(v32->sCogTriggeredID, 0, 1); | 2127 EventProcessor(v32->sCogTriggeredID, 0, 1); |
2132 goto LABEL_74; | 2128 goto LABEL_74; |
2133 } | 2129 } |
2134 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z; | 2130 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z; |
2135 v34 = v1->vVelocity.x; | 2131 v34 = v1->vVelocity.x; |
2212 | 2208 |
2213 v1 = 0; | 2209 v1 = 0; |
2214 v20 = 0; | 2210 v20 = 0; |
2215 if ( (signed int)uNumLayingItems > 0 ) | 2211 if ( (signed int)uNumLayingItems > 0 ) |
2216 { | 2212 { |
2213 __debugbreak(); | |
2217 v2 = (char *)&pLayingItems[0].uSpriteFrameID; | 2214 v2 = (char *)&pLayingItems[0].uSpriteFrameID; |
2218 do | 2215 do |
2219 { | 2216 { |
2220 LOWORD(v0) = *((short *)v2 - 2); | 2217 LOWORD(v0) = *((short *)v2 - 2); |
2221 if ( v0 & 0x40 ) | 2218 if ( v0 & 0x40 ) |
2270 else | 2267 else |
2271 LayingItem::UpdateObject_fn0_ODM(v1); | 2268 LayingItem::UpdateObject_fn0_ODM(v1); |
2272 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) ) | 2269 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) ) |
2273 goto LABEL_36; | 2270 goto LABEL_36; |
2274 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26)); | 2271 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26)); |
2275 v18 = abs(pParty->vPosition.z - *(int *)(v2 - 22)); | 2272 v18 = abs(pParty->vPosition.y - *(int *)(v2 - 22)); |
2276 v19 = abs(pParty->vPosition.y - *(int *)(v2 - 18)); | 2273 v19 = abs(pParty->vPosition.z - *(int *)(v2 - 18)); |
2277 v13 = v12; | 2274 v13 = v12; |
2278 v14 = v18; | 2275 v14 = v18; |
2279 v15 = v19; | 2276 v15 = v19; |
2280 if ( v12 < v18 ) | 2277 if ( v12 < v18 ) |
2281 { | 2278 { |
2314 while ( v20 < (signed int)uNumLayingItems ); | 2311 while ( v20 < (signed int)uNumLayingItems ); |
2315 } | 2312 } |
2316 } | 2313 } |
2317 | 2314 |
2318 //----- (0047272C) -------------------------------------------------------- | 2315 //----- (0047272C) -------------------------------------------------------- |
2319 int __fastcall _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, int *a5) | 2316 int _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID) |
2320 { | 2317 { |
2321 signed int v5; // ebx@1 | 2318 signed int v5; // ebx@1 |
2322 int result; // eax@1 | 2319 int result; // eax@1 |
2323 int v7; // [sp+10h] [bp-8h]@1 | 2320 int v7; // [sp+10h] [bp-8h]@1 |
2324 signed int v8; // [sp+14h] [bp-4h]@1 | 2321 signed int v8; // [sp+14h] [bp-4h]@1 |
2325 | 2322 |
2323 __debugbreak(); | |
2326 v5 = x - 2; | 2324 v5 = x - 2; |
2327 v7 = x; | 2325 v7 = x; |
2328 v8 = y; | 2326 v8 = y; |
2329 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40); | 2327 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40); |
2330 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, a5); | 2328 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, pFaceID); |
2331 if ( result == -30000 || !*pSectorID ) | 2329 if ( result == -30000 || !*pSectorID ) |
2332 { | 2330 { |
2333 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40); | 2331 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40); |
2334 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, a5); | 2332 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, pFaceID); |
2335 if ( result == -30000 || !*pSectorID ) | 2333 if ( result == -30000 || !*pSectorID ) |
2336 { | 2334 { |
2337 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40); | 2335 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40); |
2338 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, a5); | 2336 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, pFaceID); |
2339 if ( result == -30000 || !*pSectorID ) | 2337 if ( result == -30000 || !*pSectorID ) |
2340 { | 2338 { |
2341 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40); | 2339 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40); |
2342 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, a5); | 2340 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, pFaceID); |
2343 if ( result == -30000 || !*pSectorID ) | 2341 if ( result == -30000 || !*pSectorID ) |
2344 { | 2342 { |
2345 *pSectorID = pIndoor->GetSector(v7, v8, z + 140); | 2343 *pSectorID = pIndoor->GetSector(v7, v8, z + 140); |
2346 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, a5); | 2344 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, pFaceID); |
2347 } | 2345 } |
2348 } | 2346 } |
2349 } | 2347 } |
2350 } | 2348 } |
2351 return result; | 2349 return result; |
2352 } | 2350 } |
2353 | 2351 |
2354 //----- (00472866) -------------------------------------------------------- | 2352 //----- (00472866) -------------------------------------------------------- |
2355 void __cdecl BLV_ProcessPartyActions() | 2353 void BLV_ProcessPartyActions() |
2356 { | 2354 { |
2357 int v0; // esi@1 | |
2358 int v1; // ebx@1 | 2355 int v1; // ebx@1 |
2359 int v2; // edi@1 | 2356 int v2; // edi@1 |
2360 int v3; // esi@1 | |
2361 float v4; // ST40_4@8 | |
2362 Player **v5; // esi@15 | |
2363 int v6; // eax@18 | 2357 int v6; // eax@18 |
2364 Player **v7; // esi@24 | |
2365 signed __int64 v8; // qax@27 | 2358 signed __int64 v8; // qax@27 |
2366 int v9; // eax@27 | 2359 int v9; // eax@27 |
2367 double v10; // st7@27 | 2360 double v10; // st7@27 |
2368 BLVFace *v11; // edx@41 | |
2369 unsigned int v12; // eax@49 | 2361 unsigned int v12; // eax@49 |
2370 double v13; // st7@50 | 2362 double v13; // st7@50 |
2371 int v14; // eax@51 | 2363 int v14; // eax@51 |
2372 signed __int64 v15; // qax@53 | 2364 signed __int64 v15; // qax@53 |
2373 double v16; // st7@54 | 2365 double v16; // st7@54 |
2381 double v24; // st7@66 | 2373 double v24; // st7@66 |
2382 int v25; // ST40_4@66 | 2374 int v25; // ST40_4@66 |
2383 int v26; // eax@67 | 2375 int v26; // eax@67 |
2384 double v27; // st7@67 | 2376 double v27; // st7@67 |
2385 int v28; // ST40_4@67 | 2377 int v28; // ST40_4@67 |
2386 int v29; // eax@69 | |
2387 double v30; // st7@69 | |
2388 int v31; // ST3C_4@69 | |
2389 int v32; // eax@71 | |
2390 double v33; // st7@71 | |
2391 int v34; // ST3C_4@71 | |
2392 unsigned int v35; // eax@74 | 2378 unsigned int v35; // eax@74 |
2393 int v36; // ecx@88 | 2379 int v36; // ecx@88 |
2394 int v37; // esi@96 | 2380 int new_party_z; // esi@96 |
2395 int v38; // eax@96 | 2381 int v38; // eax@96 |
2396 int v39; // ecx@106 | 2382 int v39; // ecx@106 |
2397 int v40; // eax@106 | 2383 int v40; // eax@106 |
2398 Player **v41; // esi@113 | 2384 Player **v41; // esi@113 |
2399 int v42; // eax@120 | 2385 int v42; // eax@120 |
2419 int v62; // [sp-Ch] [bp-6Ch]@161 | 2405 int v62; // [sp-Ch] [bp-6Ch]@161 |
2420 int v63; // [sp-8h] [bp-68h]@75 | 2406 int v63; // [sp-8h] [bp-68h]@75 |
2421 unsigned int v64; // [sp-8h] [bp-68h]@161 | 2407 unsigned int v64; // [sp-8h] [bp-68h]@161 |
2422 int v65; // [sp-4h] [bp-64h]@75 | 2408 int v65; // [sp-4h] [bp-64h]@75 |
2423 int v66; // [sp-4h] [bp-64h]@161 | 2409 int v66; // [sp-4h] [bp-64h]@161 |
2424 double v67; // [sp+Ch] [bp-54h]@8 | |
2425 int v68; // [sp+10h] [bp-50h]@45 | 2410 int v68; // [sp+10h] [bp-50h]@45 |
2426 int v69; // [sp+10h] [bp-50h]@140 | 2411 int v69; // [sp+10h] [bp-50h]@140 |
2427 int v70; // [sp+14h] [bp-4Ch]@1 | 2412 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1 |
2428 signed int v71; // [sp+18h] [bp-48h]@1 | 2413 signed int v71; // [sp+18h] [bp-48h]@1 |
2429 signed int v72; // [sp+1Ch] [bp-44h]@1 | 2414 signed int v72; // [sp+1Ch] [bp-44h]@1 |
2430 signed int v73; // [sp+20h] [bp-40h]@100 | 2415 signed int v73; // [sp+20h] [bp-40h]@100 |
2431 int v74; // [sp+20h] [bp-40h]@140 | 2416 int v74; // [sp+20h] [bp-40h]@140 |
2432 signed int bFeatherFall; // [sp+24h] [bp-3Ch]@15 | 2417 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15 |
2433 bool bFeatherFalla; // [sp+24h] [bp-3Ch]@33 | 2418 unsigned int uSectorID; // [sp+28h] [bp-38h]@1 |
2434 unsigned int v77; // [sp+28h] [bp-38h]@1 | |
2435 int v78; // [sp+2Ch] [bp-34h]@1 | 2419 int v78; // [sp+2Ch] [bp-34h]@1 |
2436 int v79; // [sp+30h] [bp-30h]@1 | 2420 unsigned int uFaceID; // [sp+30h] [bp-30h]@1 |
2437 int i; // [sp+34h] [bp-2Ch]@1 | 2421 int v80; // [sp+34h] [bp-2Ch]@1 |
2438 int v81; // [sp+38h] [bp-28h]@47 | 2422 int v81; // [sp+38h] [bp-28h]@47 |
2439 int v82; // [sp+3Ch] [bp-24h]@47 | 2423 int v82; // [sp+3Ch] [bp-24h]@47 |
2440 int v83; // [sp+40h] [bp-20h]@47 | 2424 int _view_angle; // [sp+40h] [bp-20h]@47 |
2441 int bJumping; // [sp+44h] [bp-1Ch]@1 | 2425 int bJumping; // [sp+44h] [bp-1Ch]@1 |
2442 int v85; // [sp+48h] [bp-18h]@1 | 2426 int new_party_y; // [sp+48h] [bp-18h]@1 |
2443 int v86; // [sp+4Ch] [bp-14h]@1 | 2427 int new_party_x; // [sp+4Ch] [bp-14h]@1 |
2444 int v87; // [sp+50h] [bp-10h]@1 | 2428 int party_z; // [sp+50h] [bp-10h]@1 |
2445 float v88; // [sp+54h] [bp-Ch]@62 | |
2446 int v89; // [sp+58h] [bp-8h]@1 | 2429 int v89; // [sp+58h] [bp-8h]@1 |
2447 int angle; // [sp+5Ch] [bp-4h]@47 | 2430 int angle; // [sp+5Ch] [bp-4h]@47 |
2448 | 2431 |
2449 v0 = pParty->vPosition.y; | 2432 uFaceEvent = 0; |
2450 v89 = pParty->uFallSpeed; | 2433 v89 = pParty->uFallSpeed; |
2451 v1 = 0; | 2434 v1 = 0; |
2452 v85 = pParty->vPosition.z; | 2435 new_party_y = pParty->vPosition.y; |
2453 v70 = 0; | |
2454 v2 = 0; | 2436 v2 = 0; |
2455 v86 = pParty->vPosition.x; | 2437 new_party_x = pParty->vPosition.x; |
2456 v87 = pParty->vPosition.y; | 2438 party_z = pParty->vPosition.z; |
2457 v77 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y); | 2439 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
2458 v72 = 0; | 2440 v72 = 0; |
2459 v78 = 0; | 2441 v78 = 0; |
2460 v71 = 0; | 2442 v71 = 0; |
2461 bJumping = 0; | 2443 bJumping = 0; |
2462 v3 = v0 + 40; | 2444 v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); |
2463 i = _46ED1B_collide_against_floor(v86, v85, v3, &v77, &v79); | |
2464 if ( pParty->bFlying ) | 2445 if ( pParty->bFlying ) |
2465 { | 2446 { |
2466 pParty->bFlying = 0; | 2447 pParty->bFlying = 0; |
2467 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 ) | 2448 __debugbreak(); |
2449 if (pParty->FlyActive()) | |
2468 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] | 2450 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] |
2469 } | 2451 } |
2470 if ( i == -30000 ) | 2452 if ( v80 == -30000 ) |
2471 { | 2453 { |
2472 i = _47272C_collide_agains_some_secotors_floors(v86, v85, v3, &v77, &v79); | 2454 v80 = _47272C_collide_agains_some_secotors_floors(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); |
2473 if ( i == -30000 ) | 2455 if ( v80 == -30000 ) |
2474 { | 2456 { |
2475 pParty->vPosition.x = blv_prev_party_x; | 2457 pParty->vPosition.x = blv_prev_party_x; |
2476 pParty->vPosition.z = blv_prev_party_z; | 2458 pParty->vPosition.y = blv_prev_party_z; |
2477 pParty->vPosition.y = blv_prev_party_y; | 2459 pParty->vPosition.z = blv_prev_party_y; |
2478 pParty->uFallStartY = blv_prev_party_y; | 2460 pParty->uFallStartY = blv_prev_party_y; |
2479 return; | 2461 return; |
2480 } | 2462 } |
2481 } | 2463 } |
2482 blv_prev_party_x = pParty->vPosition.x; | 2464 blv_prev_party_x = pParty->vPosition.x; |
2483 blv_prev_party_z = pParty->vPosition.z; | 2465 blv_prev_party_z = pParty->vPosition.y; |
2484 blv_prev_party_y = pParty->vPosition.y; | 2466 blv_prev_party_y = pParty->vPosition.z; |
2485 if ( pParty->bTurnBasedModeOn != 1 ) | 2467 if (!pParty->bTurnBasedModeOn) |
2486 { | 2468 { |
2487 v4 = (double)(GetTickCount() / 0x1F4); | 2469 auto v67 = GetTickCount() / 500; |
2488 v67 = v4 + 6.7553994e15; | 2470 if (dword_720CDC != v67 ) |
2489 if ( *(int *)&word_720C10_intercepts_xs[102] != LODWORD(v67) ) | 2471 { |
2490 { | 2472 dword_4F8580[3 * dword_4F8580[0] + 1] = pParty->vPosition.x; |
2491 dword_4F8584[3 * dword_4F8580[0]] = pParty->vPosition.x; | 2473 dword_4F8580[3 * dword_4F8580[0] + 2] = pParty->vPosition.y; |
2492 dword_4F8588[3 * dword_4F8580[0]] = pParty->vPosition.z; | 2474 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.z; |
2493 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.y; | |
2494 if ( dword_4F8580[0] > 60 ) | 2475 if ( dword_4F8580[0] > 60 ) |
2495 dword_4F8580[0] = 1; | 2476 dword_4F8580[0] = 1; |
2496 } | 2477 } |
2497 *(int *)&word_720C10_intercepts_xs[102] = LODWORD(v67); | 2478 dword_720CDC = v67; |
2498 } | 2479 } |
2499 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 | 2480 if (!pParty->FeatherFallActive()) |
2500 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 ) | 2481 { |
2501 { | 2482 bFeatherFall = false; |
2502 bFeatherFall = 0; | 2483 if (!pParty->pPlayers[0].WearsItem(536, 16) && |
2503 v5 = &pPlayers[1]; | 2484 !pParty->pPlayers[1].WearsItem(536, 16) && |
2504 while ( !(*v5)->WearsItem(536, 16) ) | 2485 !pParty->pPlayers[2].WearsItem(536, 16) && |
2505 { | 2486 !pParty->pPlayers[3].WearsItem(536, 16)) |
2506 ++v5; | 2487 { |
2507 if ( (signed int)v5 > (signed int)&pPlayers[4] ) | 2488 v6 = pParty->uFallStartY; |
2508 { | 2489 } |
2509 v6 = pParty->uFallStartY; | 2490 } |
2510 goto LABEL_20; | 2491 else |
2511 } | 2492 { |
2512 } | 2493 v6 = v80; |
2513 } | 2494 bFeatherFall = true; |
2514 v6 = i; | 2495 pParty->uFallStartY = v80; |
2515 bFeatherFall = 1; | 2496 } |
2516 pParty->uFallStartY = i; | |
2517 LABEL_20: | 2497 LABEL_20: |
2518 if ( v6 - v87 > 512 && !bFeatherFall && v87 <= i + 1 ) | 2498 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 ) |
2519 { | 2499 { |
2520 if ( BYTE1(pParty->uFlags) & 1 ) | 2500 if ( BYTE1(pParty->uFlags) & 1 ) |
2521 { | 2501 { |
2522 BYTE1(pParty->uFlags) &= 0xFEu; | 2502 BYTE1(pParty->uFlags) &= 0xFEu; |
2523 } | 2503 } |
2524 else | 2504 else for (uint i = 0; i < 4; ++i) |
2525 { | 2505 { // receive falling damage |
2526 v7 = &pPlayers[1]; // receive falling damage | 2506 auto pPlayer = pParty->pPlayers + i; |
2527 do | 2507 |
2528 { | 2508 if (!pPlayer->HasEnchantedItemEquipped(72) && |
2529 if ( !(*v7)->HasEnchantedItemEquipped(72) && !(*v7)->WearsItem(529, 8) ) | 2509 !pPlayer->WearsItem(529, 8)) |
2530 { | 2510 { |
2531 v8 = (signed __int64)((double)(*v7)->GetMaxHealth() * 0.1); | 2511 v8 = (signed __int64)((double)pPlayer->GetMaxHealth() * 0.1); |
2532 (*v7)->ReceiveDamage((pParty->uFallStartY - v87) * (signed int)v8 / 256, 4); | 2512 pPlayer->ReceiveDamage((pParty->uFallStartY - party_z) * (signed int)v8 / 256, 4); |
2533 v9 = (*v7)->GetActualEndurance(); | 2513 v9 = pPlayer->GetActualEndurance(); |
2534 v10 = (double)(20 - (*v7)->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; | 2514 v10 = (double)(20 - pPlayer->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; |
2535 (*v7)->SetRecoveryTime((signed __int64)v10); | 2515 pPlayer->SetRecoveryTime((signed __int64)v10); |
2536 } | 2516 } |
2537 ++v7; | 2517 } |
2538 } | 2518 } |
2539 while ( (signed int)v7 <= (signed int)&pPlayers[4] ); | 2519 if ( party_z > v80 + 1 ) |
2540 } | |
2541 } | |
2542 if ( v87 > i + 1 ) | |
2543 bJumping = 1; | 2520 bJumping = 1; |
2544 bFeatherFalla = v87 - i <= 32; | 2521 bFeatherFall = party_z - v80 <= 32; |
2545 if ( v87 - i <= 32 ) | 2522 if ( party_z - v80 <= 32 ) |
2546 pParty->uFallStartY = v87; | 2523 pParty->uFallStartY = party_z; |
2547 if ( bWalkSound && pParty->field_6F8 > 0 ) | 2524 if ( bWalkSound && pParty->field_6F8 > 0 ) |
2548 pParty->field_6F8 -= pEventTimer->uTimeElapsed; | 2525 pParty->field_6F8 -= pEventTimer->uTimeElapsed; |
2549 if ( v87 > i + 1 ) | 2526 if ( party_z > v80 + 1 ) |
2550 { | 2527 { |
2551 LABEL_43: | 2528 LABEL_43: |
2552 if ( bJumping ) | 2529 if ( bJumping ) |
2553 goto LABEL_45; | 2530 goto LABEL_45; |
2554 goto LABEL_44; | 2531 goto LABEL_44; |
2555 } | 2532 } |
2556 v87 = i + 1; | 2533 party_z = v80 + 1; |
2557 pParty->uFallStartY = i + 1; | 2534 pParty->uFallStartY = v80 + 1; |
2558 if ( bJumping ) | 2535 if ( bJumping ) |
2559 goto LABEL_45; | 2536 goto LABEL_45; |
2560 if ( pParty->field_6F4_packedid != v79 ) | 2537 if (pParty->field_6F4_packedid != uFaceID) |
2561 { | 2538 { |
2562 v11 = &pIndoor->pFaces[v79]; | 2539 auto pFace = &pIndoor->pFaces[uFaceID]; |
2563 if ( BYTE3(v11->uAttributes) & 4 ) | 2540 if (pFace->uAttributes & 0x04000000 ) |
2564 { | 2541 { |
2565 v70 = pIndoor->pFaceExtras[v11->uFaceExtraID].uEventID; | 2542 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; |
2566 goto LABEL_43; | 2543 goto LABEL_43; |
2567 } | 2544 } |
2568 } | 2545 } |
2569 LABEL_44: | 2546 LABEL_44: |
2570 pParty->field_6F4_packedid = v79; | 2547 pParty->field_6F4_packedid = uFaceID; |
2571 LABEL_45: | 2548 LABEL_45: |
2572 v68 = v79; | 2549 v68 = uFaceID; |
2573 if ( pIndoor->pFaces[v79].uAttributes & 0x10 ) | 2550 if ( pIndoor->pFaces[uFaceID].uAttributes & 0x10 ) |
2574 v71 = 1; | 2551 v71 = 1; |
2575 v81 = pParty->uWalkSpeed; | 2552 v81 = pParty->uWalkSpeed; |
2576 angle = pParty->sRotationY; | 2553 angle = pParty->sRotationY; |
2577 v83 = pParty->sRotationX; | 2554 _view_angle = pParty->sRotationX; |
2578 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format | 2555 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format |
2579 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi) | 2556 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi) |
2580 / 180)) >> 16; | 2557 / 180)) >> 16; |
2581 LABEL_87: | 2558 LABEL_87: |
2582 while ( pPartyActionQueue->uNumActions ) | 2559 while ( pPartyActionQueue->uNumActions ) |
2583 { | 2560 { |
2584 switch ( pPartyActionQueue->Next() ) | 2561 switch ( pPartyActionQueue->Next() ) |
2585 { | 2562 { |
2586 case PARTY_TurnLeft: | 2563 case PARTY_TurnLeft: |
2564 __debugbreak(); | |
2587 v12 = uTurnSpeed; | 2565 v12 = uTurnSpeed; |
2588 if ( uTurnSpeed ) | 2566 if ( uTurnSpeed ) |
2589 goto LABEL_58; | 2567 goto LABEL_58; |
2590 v13 = (double)v82 * fTurnSpeedMultiplier; | 2568 v13 = (double)v82 * fTurnSpeedMultiplier; |
2591 goto LABEL_51; | 2569 goto LABEL_51; |
2592 case PARTY_TurnRight: | 2570 case PARTY_TurnRight: |
2571 __debugbreak(); | |
2593 LODWORD(v15) = uTurnSpeed; | 2572 LODWORD(v15) = uTurnSpeed; |
2594 if ( uTurnSpeed ) | 2573 if ( uTurnSpeed ) |
2595 goto LABEL_56; | 2574 goto LABEL_56; |
2596 v16 = (double)v82 * fTurnSpeedMultiplier; | 2575 v16 = (double)v82 * fTurnSpeedMultiplier; |
2597 goto LABEL_55; | 2576 goto LABEL_55; |
2620 } | 2599 } |
2621 LABEL_56: | 2600 LABEL_56: |
2622 angle = stru_5C6E00->uDoublePiMask & (angle - v15); | 2601 angle = stru_5C6E00->uDoublePiMask & (angle - v15); |
2623 goto LABEL_87; | 2602 goto LABEL_87; |
2624 case PARTY_StrafeLeft: | 2603 case PARTY_StrafeLeft: |
2604 __debugbreak(); | |
2625 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2605 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2626 v18 = (double)v81; | 2606 v18 = (double)v81; |
2627 v88 = v18; | 2607 //v88 = v18; |
2628 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16; | 2608 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16; |
2629 v2 -= v78; | 2609 v2 -= v78; |
2630 v19 = stru_5C6E00->SinCos(angle); | 2610 v19 = stru_5C6E00->SinCos(angle); |
2631 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16; | 2611 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16; |
2632 goto LABEL_63; | 2612 goto LABEL_63; |
2633 case PARTY_StrafeRight: | 2613 case PARTY_StrafeRight: |
2614 __debugbreak(); | |
2634 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2615 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2635 v21 = (double)v81; | 2616 v21 = (double)v81; |
2636 v88 = v21; | 2617 //v88 = v21; |
2637 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16; | 2618 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16; |
2638 v2 += v78; | 2619 v2 += v78; |
2639 v22 = stru_5C6E00->SinCos(angle); | 2620 v22 = stru_5C6E00->SinCos(angle); |
2640 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16; | 2621 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16; |
2641 goto LABEL_68; | 2622 goto LABEL_68; |
2642 case PARTY_WalkForward: | 2623 case PARTY_WalkForward: |
2624 __debugbreak(); | |
2643 v23 = stru_5C6E00->SinCos(angle); | 2625 v23 = stru_5C6E00->SinCos(angle); |
2644 v24 = (double)v81; | 2626 v24 = (double)v81; |
2645 v88 = v24; | 2627 //v88 = v24; |
2646 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16; | 2628 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16; |
2647 v2 += v78; | 2629 v2 += v78; |
2648 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2630 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2649 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v88 * fWalkSpeedMultiplier)) >> 16; | 2631 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16; |
2650 LABEL_63: | 2632 LABEL_63: |
2651 v1 += v78; | 2633 v1 += v78; |
2652 goto LABEL_64; | 2634 goto LABEL_64; |
2653 case PARTY_WalkBackward: | 2635 case PARTY_WalkBackward: |
2636 __debugbreak(); | |
2654 v26 = stru_5C6E00->SinCos(angle); | 2637 v26 = stru_5C6E00->SinCos(angle); |
2655 v27 = (double)v81; | 2638 v27 = (double)v81; |
2656 v88 = v27; | 2639 //v88 = v27; |
2657 v78 = (unsigned __int64)(v26 | 2640 v78 = (unsigned __int64)(v26 |
2658 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardMovementSlowdownMultiplier)) >> 16; | 2641 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; |
2659 v2 -= v78; | 2642 v2 -= v78; |
2660 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2643 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2661 v78 = (unsigned __int64)(v28 | 2644 v78 = (unsigned __int64)(v28 |
2662 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16; | 2645 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16; |
2663 LABEL_68: | 2646 LABEL_68: |
2664 v1 -= v78; | 2647 v1 -= v78; |
2665 LABEL_64: | 2648 LABEL_64: |
2666 v78 = 1; | 2649 v78 = 1; |
2667 goto LABEL_87; | 2650 goto LABEL_87; |
2668 case PARTY_RunForward: | 2651 case PARTY_RunForward: |
2669 v29 = stru_5C6E00->SinCos(angle); | 2652 //v29 = stru_5C6E00->SinCos(angle); |
2670 v30 = (double)v81; | 2653 //v30 = (double)v81; |
2671 v88 = v30; | 2654 //v88 = (double)v81; |
2672 v2 += (unsigned __int64)(v29 | 2655 v2 += (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; |
2673 * (signed __int64)(signed int)(2 | 2656 //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2674 * (unsigned __int64)(signed __int64)(v30 | 2657 v1 += (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16; |
2675 * fWalkSpeedMultiplier))) >> 16; | 2658 v72 = 1; |
2676 v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2659 goto LABEL_87; |
2677 v1 += (unsigned __int64)(v31 | |
2678 * (signed __int64)(signed int)(2 | |
2679 * (unsigned __int64)(signed __int64)(v88 | |
2680 * fWalkSpeedMultiplier))) >> 16; | |
2681 goto LABEL_70; | |
2682 case PARTY_RunBackward: | 2660 case PARTY_RunBackward: |
2683 v32 = stru_5C6E00->SinCos(angle); | 2661 //v32 = stru_5C6E00->SinCos(angle); |
2684 v33 = (double)v81; | 2662 //v33 = (double)v81; |
2685 v88 = v33; | 2663 //v88 = (double)v81; |
2686 v2 -= (unsigned __int64)(v32 | 2664 v2 -= (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; |
2687 * (signed __int64)(signed int)(signed __int64)(v33 * fBackwardMovementSlowdownMultiplier)) >> 16; | 2665 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
2688 v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 2666 v1 -= (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; |
2689 v1 -= (unsigned __int64)(v34 | 2667 //LABEL_70: |
2690 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16; | |
2691 LABEL_70: | |
2692 v72 = 1; | 2668 v72 = 1; |
2693 goto LABEL_87; | 2669 goto LABEL_87; |
2694 case PARTY_LookUp: | 2670 case PARTY_LookUp: |
2695 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); | 2671 __debugbreak(); |
2696 if ( v83 > 128 ) | 2672 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); |
2697 v83 = 128; | 2673 if ( _view_angle > 128 ) |
2674 _view_angle = 128; | |
2698 v35 = uActiveCharacter; | 2675 v35 = uActiveCharacter; |
2699 if ( !uActiveCharacter ) | 2676 if ( !uActiveCharacter ) |
2700 goto LABEL_87; | 2677 goto LABEL_87; |
2701 v65 = 0; | 2678 v65 = 0; |
2702 v63 = 63; | 2679 v63 = 63; |
2703 goto LABEL_76; | 2680 goto LABEL_76; |
2704 case PARTY_LookDown: | 2681 case PARTY_LookDown: |
2705 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); | 2682 __debugbreak(); |
2706 if ( v83 < -128 ) | 2683 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0); |
2707 v83 = -128; | 2684 if ( _view_angle < -128 ) |
2685 _view_angle = -128; | |
2708 v35 = uActiveCharacter; | 2686 v35 = uActiveCharacter; |
2709 if ( uActiveCharacter ) | 2687 if ( uActiveCharacter ) |
2710 { | 2688 { |
2711 v65 = 0; | 2689 v65 = 0; |
2712 v63 = 64; | 2690 v63 = 64; |
2713 LABEL_76: | 2691 LABEL_76: |
2714 pPlayers[v35]->PlaySound(v63, v65); | 2692 pPlayers[v35]->PlaySound(v63, v65); |
2715 } | 2693 } |
2716 break; | 2694 break; |
2717 case PARTY_CenterView: | 2695 case PARTY_CenterView: |
2718 v83 = 0; | 2696 __debugbreak(); |
2697 _view_angle = 0; | |
2719 break; | 2698 break; |
2720 case PARTY_Jump: | 2699 case PARTY_Jump: |
2721 if ( (!bJumping || v87 <= i + 6 && v89 <= 0) && pParty->field_24 ) | 2700 __debugbreak(); |
2701 if ( (!bJumping || party_z <= v80 + 6 && v89 <= 0) && pParty->field_24 ) | |
2722 { | 2702 { |
2723 bJumping = 1; | 2703 bJumping = 1; |
2724 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89); | 2704 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89); |
2725 } | 2705 } |
2726 break; | 2706 break; |
2728 goto LABEL_87; | 2708 goto LABEL_87; |
2729 } | 2709 } |
2730 } | 2710 } |
2731 v36 = 0; | 2711 v36 = 0; |
2732 pParty->sRotationY = angle; | 2712 pParty->sRotationY = angle; |
2733 pParty->sRotationX = v83; | 2713 pParty->sRotationX = _view_angle; |
2734 if ( bJumping ) | 2714 if ( bJumping ) |
2735 { | 2715 { |
2736 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength(); | 2716 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength(); |
2737 } | 2717 } |
2738 else | 2718 else |
2760 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); | 2740 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); |
2761 } | 2741 } |
2762 goto LABEL_93; | 2742 goto LABEL_93; |
2763 } | 2743 } |
2764 LABEL_92: | 2744 LABEL_92: |
2765 pParty->uFallStartY = v87; | 2745 pParty->uFallStartY = party_z; |
2766 LABEL_93: | 2746 LABEL_93: |
2767 if ( v2 * v2 + v1 * v1 < 400 ) | 2747 if ( v2 * v2 + v1 * v1 < 400 ) |
2768 { | 2748 { |
2769 v1 = 0; | 2749 v1 = 0; |
2770 v2 = 0; | 2750 v2 = 0; |
2771 } | 2751 } |
2772 stru_721530.field_84 = -1; | 2752 stru_721530.field_84 = -1; |
2773 stru_721530.field_70 = 0; | 2753 stru_721530.field_70 = 0; |
2774 stru_721530.prolly_normal_d = pParty->field_14; | 2754 stru_721530.prolly_normal_d = pParty->field_14; |
2775 stru_721530.field_8 = pParty->field_14 >> 1; | 2755 stru_721530.field_8 = pParty->field_14 >> 1; |
2776 v83 = 0; | 2756 auto v83 = 0; |
2777 stru_721530.field_0 = 1; | 2757 stru_721530.field_0 = 1; |
2778 stru_721530.field_C = pParty->uPartyHeight - 32; | 2758 stru_721530.field_C = pParty->uPartyHeight - 32; |
2779 while ( 1 ) | 2759 while ( 1 ) |
2780 { | 2760 { |
2781 v37 = v87; | 2761 new_party_z = party_z; |
2782 stru_721530.field_34.x = v86; | 2762 stru_721530.field_34.x = new_party_x; |
2783 stru_721530.normal.x = v86; | 2763 stru_721530.normal.x = new_party_x; |
2784 stru_721530.field_1C = v2; | 2764 stru_721530.field_1C = v2; |
2785 stru_721530.field_34.y = v85; | 2765 stru_721530.field_34.y = new_party_y; |
2786 stru_721530.normal.y = v85; | 2766 stru_721530.normal.y = new_party_y; |
2787 stru_721530.field_20 = v1; | 2767 stru_721530.field_20 = v1; |
2788 stru_721530.normal.z = stru_721530.prolly_normal_d + v87 + 1; | 2768 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1; |
2789 stru_721530.field_34.z = stru_721530.field_C + v87 + 1; | 2769 stru_721530.field_34.z = stru_721530.field_C + party_z + 1; |
2790 stru_721530.field_24 = v89; | 2770 stru_721530.field_24 = v89; |
2791 stru_721530.uSectorID = v77; | 2771 stru_721530.uSectorID = uSectorID; |
2792 v38 = 0; | 2772 v38 = 0; |
2793 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | 2773 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) |
2794 v38 = 13312; | 2774 v38 = 13312; |
2795 if ( stru_721530._47050A(v38) ) | 2775 if ( stru_721530._47050A(v38) ) |
2796 break; | 2776 break; |
2797 v73 = 0; | 2777 v73 = 0; |
2798 do | 2778 do |
2799 { | 2779 { |
2800 _46E44E_collide_against_faces_and_portals(1u); | 2780 _46E44E_collide_against_faces_and_portals(1u); |
2801 _46E0B2_collide_against_decorations(); | 2781 _46E0B2_collide_against_decorations(); |
2802 for ( i = 0; i < (signed int)uNumActors; ++i ) | 2782 for ( v80 = 0; v80 < (signed int)uNumActors; ++v80 ) |
2803 _46DF1A_collide_against_actor(i, 0); | 2783 _46DF1A_collide_against_actor(v80, 0); |
2804 if ( _46F04E_collide_against_portals() ) | 2784 if ( _46F04E_collide_against_portals() ) |
2805 break; | 2785 break; |
2806 ++v73; | 2786 ++v73; |
2807 } | 2787 } |
2808 while ( v73 < 100 ); | 2788 while ( v73 < 100 ); |
2809 if ( stru_721530.field_7C >= stru_721530.field_6C ) | 2789 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
2810 { | 2790 { |
2811 v39 = stru_721530.normal2.x; | 2791 v39 = stru_721530.normal2.x; |
2812 v77 = stru_721530.normal2.y; | 2792 uSectorID = stru_721530.normal2.y; |
2813 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 2793 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2814 } | 2794 } |
2815 else | 2795 else |
2816 { | 2796 { |
2817 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + v86; | 2797 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + new_party_x; |
2818 v77 = v85 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); | 2798 uSectorID = new_party_y + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); |
2819 v40 = v37 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); | 2799 v40 = new_party_z + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); |
2820 } | 2800 } |
2821 v42 = _46ED1B_collide_against_floor(v39, v77, v40 + 40, &stru_721530.uSectorID, &v79); | 2801 v42 = _46ED1B_collide_against_floor(v39, uSectorID, v40 + 40, &stru_721530.uSectorID, &uFaceID); |
2822 if ( v42 == -30000 || v42 - v37 > 128 ) | 2802 if ( v42 == -30000 || v42 - new_party_z > 128 ) |
2823 return; | 2803 return; |
2824 if ( stru_721530.field_7C >= stru_721530.field_6C ) | 2804 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
2825 { | 2805 { |
2826 v86 = stru_721530.normal2.x; | 2806 new_party_x = stru_721530.normal2.x; |
2827 v85 = stru_721530.normal2.y; | 2807 new_party_y = stru_721530.normal2.y; |
2828 v37 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 2808 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2829 break; | 2809 break; |
2830 } | 2810 } |
2831 v86 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; | 2811 new_party_x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
2832 v85 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 2812 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
2833 v43 = stru_721530.uFaceID; | 2813 v43 = stru_721530.uFaceID; |
2834 v77 = stru_721530.uSectorID; | 2814 uSectorID = stru_721530.uSectorID; |
2835 stru_721530.field_70 += stru_721530.field_7C; | 2815 stru_721530.field_70 += stru_721530.field_7C; |
2836 v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v37; | 2816 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z; |
2837 if ( (stru_721530.uFaceID & 7) == 3 ) | 2817 if ( (stru_721530.uFaceID & 7) == 3 ) |
2838 { | 2818 { |
2839 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 | 2819 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0 |
2840 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) | 2820 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) ) |
2841 pParty->pPartyBuffs[11].Reset(); | 2821 pParty->pPartyBuffs[11].Reset(); |
2843 goto LABEL_152; | 2823 goto LABEL_152; |
2844 } | 2824 } |
2845 if ( (stru_721530.uFaceID & 7) == 5 ) | 2825 if ( (stru_721530.uFaceID & 7) == 5 ) |
2846 { | 2826 { |
2847 v53 = sub_452A9E(v2 * v2 + v1 * v1); | 2827 v53 = sub_452A9E(v2 * v2 + v1 * v1); |
2848 i = v53; | 2828 v80 = v53; |
2849 v54 = stru_5C6E00->Atan2( | 2829 v54 = stru_5C6E00->Atan2( |
2850 v86 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x, | 2830 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x, |
2851 v85 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y); | 2831 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y); |
2852 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16; | 2832 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16; |
2853 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); | 2833 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi); |
2854 v1 = (unsigned __int64)(v55 * (signed __int64)i) >> 16; | 2834 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16; |
2855 } | 2835 } |
2856 else | 2836 else |
2857 { | 2837 { |
2858 if ( (stru_721530.uFaceID & 7) == 6 ) | 2838 if ( (stru_721530.uFaceID & 7) == 6 ) |
2859 { | 2839 { |
2876 v46 = v89 * v44->pFacePlane_old.vNormal.z; | 2856 v46 = v89 * v44->pFacePlane_old.vNormal.z; |
2877 v47 = v45 == 4; | 2857 v47 = v45 == 4; |
2878 v48 = v44->pFacePlane_old.vNormal.x; | 2858 v48 = v44->pFacePlane_old.vNormal.x; |
2879 if ( !v47 ) | 2859 if ( !v47 ) |
2880 { | 2860 { |
2881 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | 2861 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; |
2882 if ( stru_721530.field_64 >> 3 > i ) | 2862 if ( stru_721530.field_64 >> 3 > v80 ) |
2883 i = stru_721530.field_64 >> 3; | 2863 v80 = stru_721530.field_64 >> 3; |
2884 v50 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | 2864 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; |
2885 v81 = v44->pFacePlane_old.vNormal.y; | 2865 v81 = v44->pFacePlane_old.vNormal.y; |
2886 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16; | 2866 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; |
2887 v82 = v44->pFacePlane_old.vNormal.z; | 2867 v82 = v44->pFacePlane_old.vNormal.z; |
2888 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16; | 2868 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; |
2889 v2 += v50; | 2869 v2 += v50; |
2890 v89 += v82; | 2870 v89 += v82; |
2891 v74 = v44->pFacePlane_old.vNormal.z; | 2871 v74 = v44->pFacePlane_old.vNormal.z; |
2892 v51 = v44->pFacePlane_old.vNormal.y; | 2872 v51 = v44->pFacePlane_old.vNormal.y; |
2893 v69 = v44->pFacePlane_old.vNormal.x; | 2873 v69 = v44->pFacePlane_old.vNormal.x; |
2894 i = v51; | 2874 v80 = v51; |
2895 v1 += v81; | 2875 v1 += v81; |
2896 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + v85 * v51 + v86 * v69) >> 16); | 2876 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + new_party_y * v51 + new_party_x * v69) >> 16); |
2897 if ( v52 > 0 ) | 2877 if ( v52 > 0 ) |
2898 { | 2878 { |
2899 v86 += v52 * v69 >> 16; | 2879 new_party_x += v52 * v69 >> 16; |
2900 v85 += v52 * i >> 16; | 2880 new_party_y += v52 * v80 >> 16; |
2901 v87 += v52 * v74 >> 16; | 2881 v87 += v52 * v74 >> 16; |
2902 } | 2882 } |
2903 LABEL_142: | 2883 LABEL_142: |
2904 v43 = stru_721530.uFaceID; | 2884 v43 = stru_721530.uFaceID; |
2905 LABEL_143: | 2885 LABEL_143: |
2906 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 ) | 2886 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 ) |
2907 v70 = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; | 2887 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; |
2908 goto LABEL_152; | 2888 goto LABEL_152; |
2909 } | 2889 } |
2910 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; | 2890 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; |
2911 if ( stru_721530.field_64 >> 3 > i ) | 2891 if ( stru_721530.field_64 >> 3 > v80 ) |
2912 i = stru_721530.field_64 >> 3; | 2892 v80 = stru_721530.field_64 >> 3; |
2913 v49 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; | 2893 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16; |
2914 v81 = v44->pFacePlane_old.vNormal.y; | 2894 v81 = v44->pFacePlane_old.vNormal.y; |
2915 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16; | 2895 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16; |
2916 v82 = v44->pFacePlane_old.vNormal.z; | 2896 v82 = v44->pFacePlane_old.vNormal.z; |
2917 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16; | 2897 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16; |
2918 v2 += v49; | 2898 v2 += v49; |
2919 v1 += v81; | 2899 v1 += v81; |
2920 v89 += v82; | 2900 v89 += v82; |
2921 if ( v2 * v2 + v1 * v1 >= 400 ) | 2901 if ( v2 * v2 + v1 * v1 >= 400 ) |
2922 goto LABEL_142; | 2902 goto LABEL_142; |
2930 v1 = (unsigned __int64)(58500i64 * v1) >> 16; | 2910 v1 = (unsigned __int64)(58500i64 * v1) >> 16; |
2931 ++v83; | 2911 ++v83; |
2932 v89 = (unsigned __int64)(58500i64 * v89) >> 16; | 2912 v89 = (unsigned __int64)(58500i64 * v89) >> 16; |
2933 if ( v83 >= 100 ) | 2913 if ( v83 >= 100 ) |
2934 { | 2914 { |
2935 v37 = v87; | 2915 new_party_z = v87; |
2936 break; | 2916 break; |
2937 } | 2917 } |
2938 } | 2918 } |
2939 if ( bWalkSound && pParty->field_6F8 <= 0 ) | 2919 if ( bWalkSound && pParty->field_6F8 <= 0 ) |
2940 { | 2920 { |
2941 if ( sub_452A9E((pParty->vPosition.x - v86) * (pParty->vPosition.x - v86) + (pParty->vPosition.z - v85) | 2921 if ( sub_452A9E((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y) |
2942 * (pParty->vPosition.z - v85) | 2922 * (pParty->vPosition.y - new_party_y) |
2943 + (pParty->vPosition.y - v37) | 2923 + (pParty->vPosition.z - new_party_z) |
2944 * (pParty->vPosition.y - v37)) <= 16 ) | 2924 * (pParty->vPosition.z - new_party_z)) <= 16 ) |
2945 goto LABEL_188; | 2925 goto LABEL_188; |
2946 if ( v72 && (!bJumping || bFeatherFalla) ) | 2926 if ( v72 && (!bJumping || bFeatherFall) ) |
2947 { | 2927 { |
2948 v66 = 0; | 2928 v66 = 0; |
2949 v64 = 0; | 2929 v64 = 0; |
2950 v62 = 0; | 2930 v62 = 0; |
2951 v61 = 0; | 2931 v61 = 0; |
2953 v59 = 1; | 2933 v59 = 1; |
2954 v58 = 804; | 2934 v58 = 804; |
2955 if ( !v71 ) | 2935 if ( !v71 ) |
2956 { | 2936 { |
2957 v56 = pAudioPlayer; | 2937 v56 = pAudioPlayer; |
2958 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 ) | 2938 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 ) |
2959 v57 = (SoundID)50; | 2939 v57 = (SoundID)50; |
2960 else | 2940 else |
2961 v57 = (SoundID)64; | 2941 v57 = (SoundID)64; |
2962 goto LABEL_175; | 2942 goto LABEL_175; |
2963 } | 2943 } |
2964 v57 = (SoundID)63; | 2944 v57 = (SoundID)63; |
2965 LABEL_174: | 2945 LABEL_174: |
2966 v56 = pAudioPlayer; | 2946 v56 = pAudioPlayer; |
2967 goto LABEL_175; | 2947 goto LABEL_175; |
2968 } | 2948 } |
2969 if ( v78 && (!bJumping || bFeatherFalla) ) | 2949 if ( v78 && (!bJumping || bFeatherFall) ) |
2970 { | 2950 { |
2971 v66 = 0; | 2951 v66 = 0; |
2972 v64 = 0; | 2952 v64 = 0; |
2973 v62 = 0; | 2953 v62 = 0; |
2974 v61 = 0; | 2954 v61 = 0; |
2979 { | 2959 { |
2980 v57 = (SoundID)102; | 2960 v57 = (SoundID)102; |
2981 goto LABEL_174; | 2961 goto LABEL_174; |
2982 } | 2962 } |
2983 v56 = pAudioPlayer; | 2963 v56 = pAudioPlayer; |
2984 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 ) | 2964 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 ) |
2985 v57 = (SoundID)89; | 2965 v57 = (SoundID)89; |
2986 else | 2966 else |
2987 v57 = (SoundID)103; | 2967 v57 = (SoundID)103; |
2988 LABEL_175: | 2968 LABEL_175: |
2989 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66); | 2969 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66); |
2993 LABEL_188: | 2973 LABEL_188: |
2994 pAudioPlayer->_4AA258(804); | 2974 pAudioPlayer->_4AA258(804); |
2995 pParty->field_6F8 = 64; | 2975 pParty->field_6F8 = 64; |
2996 } | 2976 } |
2997 } | 2977 } |
2998 if ( !bJumping || bFeatherFalla ) | 2978 if ( !bJumping || bFeatherFall ) |
2999 pParty->uFlags &= 0xFFFFFFF7u; | 2979 pParty->uFlags &= 0xFFFFFFF7u; |
3000 else | 2980 else |
3001 pParty->uFlags |= 8u; | 2981 pParty->uFlags |= 8u; |
3002 BYTE1(pParty->uFlags) &= 0xFDu; | 2982 BYTE1(pParty->uFlags) &= 0xFDu; |
3003 pParty->vPosition.x = v86; | 2983 pParty->vPosition.x = new_party_x; |
3004 pParty->vPosition.y = v37; | 2984 pParty->vPosition.z = new_party_z; |
3005 pParty->vPosition.z = v85; | 2985 pParty->vPosition.y = new_party_y; |
3006 pParty->uFallSpeed = v89; | 2986 pParty->uFallSpeed = v89; |
3007 if ( !bJumping && BYTE3(pIndoor->pFaces[v79].uAttributes) & 0x40 ) | 2987 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 ) |
3008 BYTE1(pParty->uFlags) |= 2u; | 2988 BYTE1(pParty->uFlags) |= 2u; |
3009 if ( v70 ) | 2989 if (uFaceEvent) |
3010 EventProcessor(v70, 0, 1); | 2990 EventProcessor(uFaceEvent, 0, 1); |
3011 } | 2991 } |
3012 | 2992 |
3013 | 2993 |
3014 //----- (00473893) -------------------------------------------------------- | 2994 //----- (00473893) -------------------------------------------------------- |
3015 void __cdecl ODM_ProcessPartyActions() | 2995 void __cdecl ODM_ProcessPartyActions() |
3145 int v128; // [sp+88h] [bp-Ch]@1 | 3125 int v128; // [sp+88h] [bp-Ch]@1 |
3146 int v129; // [sp+8Ch] [bp-8h]@92 | 3126 int v129; // [sp+8Ch] [bp-8h]@92 |
3147 int v130; // [sp+90h] [bp-4h]@14 | 3127 int v130; // [sp+90h] [bp-4h]@14 |
3148 | 3128 |
3149 v121 = pParty->uFallSpeed; | 3129 v121 = pParty->uFallSpeed; |
3150 v123 = pParty->vPosition.y; | 3130 v123 = pParty->vPosition.z; |
3151 _zero = 0; | 3131 _zero = 0; |
3152 v1 = 0; | 3132 v1 = 0; |
3153 v103 = 0; | 3133 v103 = 0; |
3154 v2 = 0; | 3134 v2 = 0; |
3155 *(float *)&v128 = 0.0; | 3135 *(float *)&v128 = 0.0; |
3156 v116 = pParty->vPosition.x; | 3136 v116 = pParty->vPosition.x; |
3157 v117 = pParty->vPosition.z; | 3137 v117 = pParty->vPosition.y; |
3158 v113 = pParty->field_6F0; | 3138 v113 = pParty->field_6F0; |
3159 bJumping = 0; | 3139 bJumping = 0; |
3160 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.z); | 3140 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.y); |
3161 v114 = 0; | 3141 v114 = 0; |
3162 v124 = 0; | 3142 v124 = 0; |
3163 v108 = 0; | 3143 v108 = 0; |
3164 v102 = 0; | 3144 v102 = 0; |
3165 v127 = 0; | 3145 v127 = 0; |
3284 pParty->bFlying = 0; | 3264 pParty->bFlying = 0; |
3285 if ( bUnderwater | 3265 if ( bUnderwater |
3286 || pParty->pPartyBuffs[7].uFlags & 1 | 3266 || pParty->pPartyBuffs[7].uFlags & 1 |
3287 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) | 3267 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 ) |
3288 { | 3268 { |
3289 if ( pParty->vPosition.y < 4000 || bJumping ) | 3269 if ( pParty->vPosition.z < 4000 || bJumping ) |
3290 { | 3270 { |
3291 v123 += 30; | 3271 v123 += 30; |
3292 v113 += 30; | 3272 v113 += 30; |
3293 pParty->bFlying = 1; | 3273 pParty->bFlying = 1; |
3294 if ( v123 > 4000 ) | 3274 if ( v123 > 4000 ) |
3304 { | 3284 { |
3305 pParty->field_6E0 = 0; | 3285 pParty->field_6E0 = 0; |
3306 pParty->field_6E4 = 0; | 3286 pParty->field_6E4 = 0; |
3307 pPartyActionQueue->uNumActions = 0; | 3287 pPartyActionQueue->uNumActions = 0; |
3308 BYTE1(pParty->uFlags) |= 1u; | 3288 BYTE1(pParty->uFlags) |= 1u; |
3309 pParty->vPosition.y = v109 - pParty->uPartyHeight - 31; | 3289 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31; |
3310 pParty->field_6F0 = v123; | 3290 pParty->field_6F0 = v123; |
3311 pParty->bFlying = 0; | 3291 pParty->bFlying = 0; |
3312 v123 = v109 - pParty->uPartyHeight - 31; | 3292 v123 = v109 - pParty->uPartyHeight - 31; |
3313 v113 = pParty->field_6F0; | 3293 v113 = pParty->field_6F0; |
3314 } | 3294 } |
3418 v19 = stru_5C6E00->SinCos(_angle_y); | 3398 v19 = stru_5C6E00->SinCos(_angle_y); |
3419 v20 = (double)_walk_speed; | 3399 v20 = (double)_walk_speed; |
3420 v126 = v19; | 3400 v126 = v19; |
3421 *(float *)&v128 = v20; | 3401 *(float *)&v128 = v20; |
3422 v124 = (unsigned __int64)(v19 | 3402 v124 = (unsigned __int64)(v19 |
3423 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardMovementSlowdownMultiplier)) >> 16; | 3403 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardWalkSpeedMultiplier)) >> 16; |
3424 v2 -= v124; | 3404 v2 -= v124; |
3425 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | 3405 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); |
3426 v124 = (unsigned __int64)(v126 | 3406 v124 = (unsigned __int64)(v126 |
3427 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 | 3407 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 |
3428 * fBackwardMovementSlowdownMultiplier)) >> 16; | 3408 * fBackwardWalkSpeedMultiplier)) >> 16; |
3429 LABEL_90: | 3409 LABEL_90: |
3430 v1 -= v124; | 3410 v1 -= v124; |
3431 goto LABEL_86; | 3411 goto LABEL_86; |
3432 case PARTY_RunForward: | 3412 case PARTY_RunForward: |
3433 if ( pParty->bFlying ) | 3413 if ( pParty->bFlying ) |
3484 case PARTY_RunBackward: | 3464 case PARTY_RunBackward: |
3485 v27 = stru_5C6E00->SinCos(_angle_y); | 3465 v27 = stru_5C6E00->SinCos(_angle_y); |
3486 v28 = (double)_walk_speed; | 3466 v28 = (double)_walk_speed; |
3487 v126 = v27; | 3467 v126 = v27; |
3488 *(float *)&v128 = v28; | 3468 *(float *)&v128 = v28; |
3489 v29 = (signed __int64)(v28 * fBackwardMovementSlowdownMultiplier); | 3469 v29 = (signed __int64)(v28 * fBackwardWalkSpeedMultiplier); |
3490 if ( pParty->bFlying ) | 3470 if ( pParty->bFlying ) |
3491 { | 3471 { |
3492 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16; | 3472 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16; |
3493 v2 -= v129; | 3473 v2 -= v129; |
3494 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | 3474 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); |
3495 v129 = (unsigned __int64)(v126 | 3475 v129 = (unsigned __int64)(v126 |
3496 * (signed __int64)(signed int)(4 | 3476 * (signed __int64)(signed int)(4 |
3497 * (unsigned __int64)(signed __int64)(*(float *)&v128 | 3477 * (unsigned __int64)(signed __int64)(*(float *)&v128 |
3498 * fBackwardMovementSlowdownMultiplier))) >> 16; | 3478 * fBackwardWalkSpeedMultiplier))) >> 16; |
3499 v1 -= v129; | 3479 v1 -= v129; |
3500 LABEL_93: | 3480 LABEL_93: |
3501 v128 = v1; | 3481 v128 = v1; |
3502 } | 3482 } |
3503 else | 3483 else |
3505 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16; | 3485 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16; |
3506 v2 -= v129; | 3486 v2 -= v129; |
3507 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); | 3487 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi); |
3508 v129 = (unsigned __int64)(v126 | 3488 v129 = (unsigned __int64)(v126 |
3509 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 | 3489 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 |
3510 * fBackwardMovementSlowdownMultiplier)) >> 16; | 3490 * fBackwardWalkSpeedMultiplier)) >> 16; |
3511 v1 -= v129; | 3491 v1 -= v129; |
3512 LABEL_86: | 3492 LABEL_86: |
3513 v128 = v1; | 3493 v128 = v1; |
3514 v124 = 1; | 3494 v124 = 1; |
3515 } | 3495 } |
3633 LABEL_164: | 3613 LABEL_164: |
3634 if ( !bUnderwater && v34 <= v32 ) | 3614 if ( !bUnderwater && v34 <= v32 ) |
3635 { | 3615 { |
3636 if ( v34 < -500 | 3616 if ( v34 < -500 |
3637 && !pParty->bFlying | 3617 && !pParty->bFlying |
3638 && pParty->vPosition.y - v111 > 1000 | 3618 && pParty->vPosition.z - v111 > 1000 |
3639 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 | 3619 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 |
3640 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) ) | 3620 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) ) |
3641 { | 3621 { |
3642 v41 = &pPlayers[1]; | 3622 v41 = &pPlayers[1]; |
3643 do | 3623 do |
3681 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | 3661 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) |
3682 v36 = 13312; | 3662 v36 = 13312; |
3683 if ( stru_721530._47050A(v36) ) | 3663 if ( stru_721530._47050A(v36) ) |
3684 break; | 3664 break; |
3685 _46E889_collide_against_bmodels(1u); | 3665 _46E889_collide_against_bmodels(1u); |
3686 v37 = WorldPosToGridCellZ(pParty->vPosition.z); | 3666 v37 = WorldPosToGridCellZ(pParty->vPosition.y); |
3687 v38 = WorldPosToGridCellX(pParty->vPosition.x); | 3667 v38 = WorldPosToGridCellX(pParty->vPosition.x); |
3688 _46E26D_collide_against_sprites(v38, v37); | 3668 _46E26D_collide_against_sprites(v38, v37); |
3689 _46ED8A_collide_against_layingItems(4u); | 3669 _46ED8A_collide_against_layingItems(4u); |
3690 for ( i = 0; i < (signed int)uNumActors; ++i ) | 3670 for ( i = 0; i < (signed int)uNumActors; ++i ) |
3691 _46DF1A_collide_against_actor(i, 0); | 3671 _46DF1A_collide_against_actor(i, 0); |
3854 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16); | 3834 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16); |
3855 } | 3835 } |
3856 LABEL_220: | 3836 LABEL_220: |
3857 v45 = stru_721530.uFaceID; | 3837 v45 = stru_721530.uFaceID; |
3858 LABEL_221: | 3838 LABEL_221: |
3859 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uFaceAttributes) & 4 ) | 3839 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uAttributes) & 4 ) |
3860 { | 3840 { |
3861 pParty->field_6F4_packedid = v45; | 3841 pParty->field_6F4_packedid = v45; |
3862 v103 = v47->sCogTriggeredID; | 3842 v103 = v47->sCogTriggeredID; |
3863 } | 3843 } |
3864 goto LABEL_234; | 3844 goto LABEL_234; |
3892 } | 3872 } |
3893 while ( v126 < 100 ); | 3873 while ( v126 < 100 ); |
3894 if ( bWalkSound && pParty->field_6F8 <= 0 ) | 3874 if ( bWalkSound && pParty->field_6F8 <= 0 ) |
3895 { | 3875 { |
3896 v122 = abs(pParty->vPosition.x - v116); | 3876 v122 = abs(pParty->vPosition.x - v116); |
3897 v126 = abs(pParty->vPosition.z - v117); | 3877 v126 = abs(pParty->vPosition.y - v117); |
3898 v62 = abs(pParty->vPosition.y - v123); | 3878 v62 = abs(pParty->vPosition.z - v123); |
3899 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 ) | 3879 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 ) |
3900 goto LABEL_344; | 3880 goto LABEL_344; |
3901 if ( v114 && (!bJumping || v101) ) | 3881 if ( v114 && (!bJumping || v101) ) |
3902 { | 3882 { |
3903 if ( !v107 | 3883 if ( !v107 |
3904 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20) ) | 3884 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20) ) |
3905 { | 3885 { |
3906 v96 = 0; | 3886 v96 = 0; |
3907 v94 = 0; | 3887 v94 = 0; |
3908 v92 = 0; | 3888 v92 = 0; |
3909 v91 = 0; | 3889 v91 = 0; |
3920 v90 = -1; | 3900 v90 = -1; |
3921 v89 = 1; | 3901 v89 = 1; |
3922 v88 = 804; | 3902 v88 = 804; |
3923 v86 = 1; | 3903 v86 = 1; |
3924 LABEL_255: | 3904 LABEL_255: |
3925 v63 = WorldPosToGridCellZ(pParty->vPosition.z) - 1; | 3905 v63 = WorldPosToGridCellZ(pParty->vPosition.y) - 1; |
3926 v64 = WorldPosToGridCellX(pParty->vPosition.x); | 3906 v64 = WorldPosToGridCellX(pParty->vPosition.x); |
3927 v87 = pOutdoor->_47EE49(v64, v63, v86); | 3907 v87 = pOutdoor->_47EE49(v64, v63, v86); |
3928 goto LABEL_257; | 3908 goto LABEL_257; |
3929 } | 3909 } |
3930 if ( v124 && (!bJumping || v101) ) | 3910 if ( v124 && (!bJumping || v101) ) |
3931 { | 3911 { |
3932 if ( v107 | 3912 if ( v107 |
3933 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20 ) | 3913 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20 ) |
3934 { | 3914 { |
3935 v96 = 0; | 3915 v96 = 0; |
3936 v94 = 0; | 3916 v94 = 0; |
3937 v92 = 0; | 3917 v92 = 0; |
3938 v91 = 0; | 3918 v91 = 0; |
3963 if ( !bJumping || v101 ) | 3943 if ( !bJumping || v101 ) |
3964 pParty->uFlags &= 0xFFFFFFF7u; | 3944 pParty->uFlags &= 0xFFFFFFF7u; |
3965 else | 3945 else |
3966 pParty->uFlags |= 8u; | 3946 pParty->uFlags |= 8u; |
3967 v126 = WorldPosToGridCellX(pParty->vPosition.x); | 3947 v126 = WorldPosToGridCellX(pParty->vPosition.x); |
3968 v65 = WorldPosToGridCellZ(pParty->vPosition.z) - 1; | 3948 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1; |
3969 v114 = WorldPosToGridCellX(v116); | 3949 v114 = WorldPosToGridCellX(v116); |
3970 v66 = WorldPosToGridCellZ(v117) - 1; | 3950 v66 = WorldPosToGridCellZ(v117) - 1; |
3971 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1); | 3951 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1); |
3972 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1; | 3952 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1; |
3973 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66); | 3953 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66); |
3983 v71 = v116; | 3963 v71 = v116; |
3984 v72 = v117; | 3964 v72 = v117; |
3985 pParty->uFallSpeed = v121; | 3965 pParty->uFallSpeed = v121; |
3986 v73 = v123; | 3966 v73 = v123; |
3987 pParty->vPosition.x = v116; | 3967 pParty->vPosition.x = v116; |
3988 pParty->vPosition.z = v117; | 3968 pParty->vPosition.y = v117; |
3989 pParty->vPosition.y = v123; | 3969 pParty->vPosition.z = v123; |
3990 pParty->field_6F0 = v113; | 3970 pParty->field_6F0 = v113; |
3991 if ( v123 > 8160 ) | 3971 if ( v123 > 8160 ) |
3992 { | 3972 { |
3993 v73 = 8160; | 3973 v73 = 8160; |
3994 pParty->uFallStartY = 8160; | 3974 pParty->uFallStartY = 8160; |
3995 pParty->vPosition.y = 8160; | 3975 pParty->vPosition.z = 8160; |
3996 } | 3976 } |
3997 if ( !v103 | 3977 if ( !v103 |
3998 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71) | 3978 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71) |
3999 && pParty->vPosition.z == v72 | 3979 && pParty->vPosition.y == v72 |
4000 && (v73 = pParty->vPosition.y, pParty->vPosition.y == v70) ) | 3980 && (v73 = pParty->vPosition.z, pParty->vPosition.z == v70) ) |
4001 { | 3981 { |
4002 if ( v73 < v111 ) | 3982 if ( v73 < v111 ) |
4003 { | 3983 { |
4004 pParty->uFallSpeed = 0; | 3984 pParty->uFallSpeed = 0; |
4005 v73 = v105; | 3985 v73 = v105; |
4006 pParty->vPosition.y = v105; | 3986 pParty->vPosition.z = v105; |
4007 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater ) | 3987 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater ) |
4008 { | 3988 { |
4009 if ( pParty->uFlags & 0x100 ) | 3989 if ( pParty->uFlags & 0x100 ) |
4010 { | 3990 { |
4011 BYTE1(pParty->uFlags) &= 0xFEu; | 3991 BYTE1(pParty->uFlags) &= 0xFEu; |
4024 (*v74)->SetRecoveryTime( | 4004 (*v74)->SetRecoveryTime( |
4025 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); | 4005 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); |
4026 ++v74; | 4006 ++v74; |
4027 } | 4007 } |
4028 while ( (signed int)v74 <= (signed int)&pPlayers[4] ); | 4008 while ( (signed int)v74 <= (signed int)&pPlayers[4] ); |
4029 v73 = pParty->vPosition.y; | 4009 v73 = pParty->vPosition.z; |
4030 } | 4010 } |
4031 } | 4011 } |
4032 pParty->uFallStartY = v70; | 4012 pParty->uFallStartY = v70; |
4033 } | 4013 } |
4034 if ( v102 && v73 < v109 ) | 4014 if ( v102 && v73 < v109 ) |
4035 { | 4015 { |
4036 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 ) | 4016 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 ) |
4037 { | 4017 { |
4038 pParty->vPosition.y = v109 - pParty->uPartyHeight - 1; | 4018 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1; |
4039 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1; | 4019 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1; |
4040 } | 4020 } |
4041 } | 4021 } |
4042 LOWORD(pParty->uFlags) &= 0xFDFBu; | 4022 LOWORD(pParty->uFlags) &= 0xFDFBu; |
4043 } | 4023 } |
4068 goto LABEL_312; | 4048 goto LABEL_312; |
4069 } | 4049 } |
4070 if ( v78 ) | 4050 if ( v78 ) |
4071 { | 4051 { |
4072 LABEL_312: | 4052 LABEL_312: |
4073 pParty->vPosition.z = v117; | 4053 pParty->vPosition.y = v117; |
4074 LABEL_313: | 4054 LABEL_313: |
4075 if ( bWaterWalk ) | 4055 if ( bWaterWalk ) |
4076 { | 4056 { |
4077 LOBYTE(pParty->uFlags) &= 0x7Fu; | 4057 LOBYTE(pParty->uFlags) &= 0x7Fu; |
4078 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; | 4058 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178; |
4095 pParty->field_6F8 = 64; | 4075 pParty->field_6F8 = 64; |
4096 } | 4076 } |
4097 LABEL_318: | 4077 LABEL_318: |
4098 v81 = v123; | 4078 v81 = v123; |
4099 v82 = v123; | 4079 v82 = v123; |
4100 pParty->vPosition.y = v123; | 4080 pParty->vPosition.z = v123; |
4101 if ( v123 > 8160 ) | 4081 if ( v123 > 8160 ) |
4102 { | 4082 { |
4103 v82 = 8160; | 4083 v82 = 8160; |
4104 pParty->uFallStartY = 8160; | 4084 pParty->uFallStartY = 8160; |
4105 pParty->vPosition.y = 8160; | 4085 pParty->vPosition.z = 8160; |
4106 } | 4086 } |
4107 LOWORD(pParty->uFlags) &= 0xFDFBu; | 4087 LOWORD(pParty->uFlags) &= 0xFDFBu; |
4108 pParty->uFallSpeed = v121; | 4088 pParty->uFallSpeed = v121; |
4109 pParty->field_6F0 = v113; | 4089 pParty->field_6F0 = v113; |
4110 if ( v114 ) | 4090 if ( v114 ) |
4111 { | 4091 { |
4112 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.z, &v110, 1); | 4092 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1); |
4113 v82 = pParty->vPosition.y; | 4093 v82 = pParty->vPosition.z; |
4114 if ( pParty->vPosition.y <= v83 ) | 4094 if ( pParty->vPosition.z <= v83 ) |
4115 pParty->uFlags |= 4u; | 4095 pParty->uFlags |= 4u; |
4116 } | 4096 } |
4117 if ( !v103 | 4097 if ( !v103 |
4118 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116) | 4098 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116) |
4119 && pParty->vPosition.z == v117 | 4099 && pParty->vPosition.y == v117 |
4120 && (v82 = pParty->vPosition.y, pParty->vPosition.y == v81) ) | 4100 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) ) |
4121 { | 4101 { |
4122 if ( v82 < v111 ) | 4102 if ( v82 < v111 ) |
4123 { | 4103 { |
4124 v82 = v105; | 4104 v82 = v105; |
4125 pParty->uFallSpeed = 0; | 4105 pParty->uFallSpeed = 0; |
4126 pParty->vPosition.y = v105; | 4106 pParty->vPosition.z = v105; |
4127 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater ) | 4107 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater ) |
4128 { | 4108 { |
4129 if ( pParty->uFlags & 0x100 ) | 4109 if ( pParty->uFlags & 0x100 ) |
4130 { | 4110 { |
4131 BYTE1(pParty->uFlags) &= 0xFEu; | 4111 BYTE1(pParty->uFlags) &= 0xFEu; |
4143 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85); | 4123 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85); |
4144 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); | 4124 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333)); |
4145 ++v84; | 4125 ++v84; |
4146 } | 4126 } |
4147 while ( (signed int)v84 <= (signed int)&pPlayers[4] ); | 4127 while ( (signed int)v84 <= (signed int)&pPlayers[4] ); |
4148 v82 = pParty->vPosition.y; | 4128 v82 = pParty->vPosition.z; |
4149 } | 4129 } |
4150 } | 4130 } |
4151 pParty->uFallStartY = v81; | 4131 pParty->uFallStartY = v81; |
4152 } | 4132 } |
4153 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 ) | 4133 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 ) |
4154 { | 4134 { |
4155 pParty->vPosition.y = v82 + pParty->uPartyHeight - v109 + 1; | 4135 pParty->vPosition.z = v82 + pParty->uPartyHeight - v109 + 1; |
4156 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1; | 4136 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1; |
4157 } | 4137 } |
4158 } | 4138 } |
4159 } | 4139 } |
4160 | 4140 |
4731 { | 4711 { |
4732 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0; | 4712 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0; |
4733 } | 4713 } |
4734 | 4714 |
4735 //----- (00476395) -------------------------------------------------------- | 4715 //----- (00476395) -------------------------------------------------------- |
4716 //0x26 Wizard eye at skill level 2 | |
4736 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession) | 4717 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession) |
4737 { | 4718 { |
4738 bool result; // eax@2 | 4719 bool result; // eax@2 |
4739 signed int v2; // esi@3 | 4720 signed int v2; // esi@3 |
4740 char *v3; // eax@4 | 4721 char *v3; // eax@4 |
6794 if ( a1 >= (signed int)v41 ) | 6775 if ( a1 >= (signed int)v41 ) |
6795 return result; | 6776 return result; |
6796 } | 6777 } |
6797 while ( 1 ) | 6778 while ( 1 ) |
6798 { | 6779 { |
6799 if ( pFace->uFaceAttributes & 0x2000 ) | 6780 if (pFace->Invisible()) |
6800 goto LABEL_85; | 6781 goto LABEL_85; |
6801 v5 = (int)*(v2 - 1); | 6782 v5 = (int)*(v2 - 1); |
6802 v6 = pFace->pVertexIDs[0]; | 6783 v6 = pFace->pVertexIDs[0]; |
6803 v53 = 0; | 6784 v53 = 0; |
6804 v7 = &array_77EC08[pOutdoorCamera->numStru148s]; | 6785 v7 = &array_77EC08[pOutdoorCamera->numStru148s]; |
6805 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8); | 6786 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8); |
6806 *(int *)&v7->flags = 0; | 6787 *(int *)&v7->flags = 0; |
6807 pLightmapBuilder = v8; | 6788 pLightmapBuilder = v8; |
6808 v9 = pFace->uTextureID; | 6789 v9 = pFace->uTextureID; |
6809 v10 = (BYTE1(pFace->uFaceAttributes) & 0x40) == 0; | 6790 v10 = (BYTE1(pFace->uAttributes) & 0x40) == 0; |
6810 v48 = pFace->uTextureID; | 6791 v48 = pFace->uTextureID; |
6811 if ( !v10 ) | 6792 if ( !v10 ) |
6812 { | 6793 { |
6813 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed); | 6794 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed); |
6814 v9 = v48; | 6795 v9 = v48; |
6816 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0); | 6797 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0); |
6817 v7->pTexture = pFaceTexture; | 6798 v7->pTexture = pFaceTexture; |
6818 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24); | 6799 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24); |
6819 v49 = v12; | 6800 v49 = v12; |
6820 v49 = pFaceTexture->uTextureHeight; | 6801 v49 = pFaceTexture->uTextureHeight; |
6821 v10 = (pFace->uFaceAttributes & 0x10) == 0; | 6802 v10 = (pFace->uAttributes & 0x10) == 0; |
6822 v45 = 1.0 / (double)v12; | 6803 v45 = 1.0 / (double)v12; |
6823 v44 = 1.0 / (double)v49; | 6804 v44 = 1.0 / (double)v49; |
6824 if ( !v10 ) | 6805 if ( !v10 ) |
6825 *(int *)&v7->flags |= 2u; | 6806 *(int *)&v7->flags |= 2u; |
6826 if ( BYTE2(pFace->uFaceAttributes) & 0x40 ) | 6807 if ( BYTE2(pFace->uAttributes) & 0x40 ) |
6827 HIBYTE(v7->flags) |= 4u; | 6808 HIBYTE(v7->flags) |= 4u; |
6828 v13 = pFace->uFaceAttributes; | 6809 v13 = pFace->uAttributes; |
6829 if ( v13 & 4 ) | 6810 if ( v13 & 4 ) |
6830 { | 6811 { |
6831 HIBYTE(v7->flags) |= 4u; | 6812 HIBYTE(v7->flags) |= 4u; |
6832 } | 6813 } |
6833 else | 6814 else |
6834 { | 6815 { |
6835 if ( v13 & 0x20 ) | 6816 if ( v13 & 0x20 ) |
6836 HIBYTE(v7->flags) |= 8u; | 6817 HIBYTE(v7->flags) |= 8u; |
6837 } | 6818 } |
6838 v14 = pFace->uFaceAttributes; | 6819 v14 = pFace->uAttributes; |
6839 if ( BYTE1(v14) & 8 ) | 6820 if ( BYTE1(v14) & 8 ) |
6840 { | 6821 { |
6841 *(int *)&v7->flags |= 0x2000u; | 6822 *(int *)&v7->flags |= 0x2000u; |
6842 } | 6823 } |
6843 else | 6824 else |
6923 else | 6904 else |
6924 v50 = 1; | 6905 v50 = 1; |
6925 } | 6906 } |
6926 else | 6907 else |
6927 { | 6908 { |
6928 v47->_436BB7_project_and_stuff((RenderVertexSoft *)(v23 - 12), 1u, 0); | 6909 v47->Project((RenderVertexSoft *)(v23 - 12), 1u, 0); |
6929 } | 6910 } |
6930 v23 += 48; | 6911 v23 += 48; |
6931 --v51; | 6912 --v51; |
6932 } | 6913 } |
6933 while ( v51 ); | 6914 while ( v51 ); |
7002 v31 = pLightmapBuilder; | 6983 v31 = pLightmapBuilder; |
7003 pLightmapBuilder->ApplyLights_OutdoorFace(pFace); | 6984 pLightmapBuilder->ApplyLights_OutdoorFace(pFace); |
7004 pDecalBuilder->ApplyDecals_OutdoorFace(pFace); | 6985 pDecalBuilder->ApplyDecals_OutdoorFace(pFace); |
7005 v31->std__vector_000004_size = 0; | 6986 v31->std__vector_000004_size = 0; |
7006 LOBYTE(v31) = 0; | 6987 LOBYTE(v31) = 0; |
7007 if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 ) | 6988 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 ) |
7008 { | 6989 { |
7009 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0); | 6990 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0); |
7010 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1); | 6991 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1); |
7011 if ( pDecalBuilder->uNumDecals > 0 ) | 6992 if ( pDecalBuilder->uNumDecals > 0 ) |
7012 { | 6993 { |
7024 0, | 7005 0, |
7025 (char)v31, | 7006 (char)v31, |
7026 -1); | 7007 -1); |
7027 } | 7008 } |
7028 } | 7009 } |
7029 if ( stru_F8AD28.field_AC > 0 ) | 7010 if ( stru_F8AD28.uNumLightsApplied > 0 ) |
7030 pLightmapBuilder->ApplyLights( | 7011 pLightmapBuilder->ApplyLights( |
7031 &stru_F8AD28, | 7012 &stru_F8AD28, |
7032 &static_RenderBuildingsD3D_stru_73C834, | 7013 &static_RenderBuildingsD3D_stru_73C834, |
7033 uNumVertices, | 7014 uNumVertices, |
7034 array_50AC10, | 7015 array_50AC10, |
7035 0.0, | 7016 0, |
7036 (char)v31); | 7017 (char)v31); |
7037 if ( v50 ) | 7018 if ( v50 ) |
7038 { | 7019 { |
7039 v32 = sr_424CD7(uNumVertices); | 7020 v32 = sr_424CD7(uNumVertices); |
7040 goto LABEL_76; | 7021 goto LABEL_76; |
7238 else | 7219 else |
7239 v74 = 1; | 7220 v74 = 1; |
7240 } | 7221 } |
7241 else | 7222 else |
7242 { | 7223 { |
7243 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff((RenderVertexSoft *)(v9 - 12), 1u, 0); | 7224 pGame->pIndoorCameraD3D->Project((RenderVertexSoft *)(v9 - 12), 1u, 0); |
7244 } | 7225 } |
7245 v81 += 2; | 7226 v81 += 2; |
7246 v9 += 48; | 7227 v9 += 48; |
7247 --v83; | 7228 --v83; |
7248 if ( !v83 ) | 7229 if ( !v83 ) |
7370 static_sub_004789DE_byte_73C830__init_flag |= 1u; | 7351 static_sub_004789DE_byte_73C830__init_flag |= 1u; |
7371 stru154::stru154(&static_sub_004789DE_stru_73C818); | 7352 stru154::stru154(&static_sub_004789DE_stru_73C818); |
7372 }*/ | 7353 }*/ |
7373 | 7354 |
7374 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3); | 7355 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3); |
7375 if ( stru_F8AD28.field_AC <= 0 ) | 7356 if ( stru_F8AD28.uNumLightsApplied <= 0 ) |
7376 { | 7357 { |
7377 v12->field_108 = 0; | 7358 v12->field_108 = 0; |
7378 } | 7359 } |
7379 else | 7360 else |
7380 { | 7361 { |
7381 v35 = (BSPVertexBuffer *)(v78 - 2); | 7362 v35 = (BSPVertexBuffer *)(v78 - 2); |
7382 v12->field_108 = 1; | 7363 v12->field_108 = 1; |
7383 | 7364 |
7384 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35); | 7365 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35); |
7385 v55 = static_sub_004789DE_stru_73C818.vNormal.x; | 7366 v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x; |
7386 v56 = static_sub_004789DE_stru_73C818.vNormal.y; | 7367 v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y; |
7387 v57 = static_sub_004789DE_stru_73C818.vNormal.z; | 7368 v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z; |
7388 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55); | 7369 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55); |
7389 } | 7370 } |
7390 if ( v74 ) | 7371 if ( v74 ) |
7391 { | 7372 { |
7392 v36 = sr_4250FE(v26); | 7373 v36 = sr_4250FE(v26); |
7904 } | 7885 } |
7905 } | 7886 } |
7906 | 7887 |
7907 | 7888 |
7908 //----- (00479A53) -------------------------------------------------------- | 7889 //----- (00479A53) -------------------------------------------------------- |
7909 void __fastcall sub_479A53(unsigned int uNumVertices, unsigned int uFaceID) | 7890 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID) |
7910 { | 7891 { |
7911 BLVFace *pFace; // esi@1 | 7892 BLVFace *pFace; // esi@1 |
7912 unsigned int v3; // edi@1 | 7893 unsigned int v3; // edi@1 |
7913 PolygonType v4; // al@1 | 7894 PolygonType v4; // al@1 |
7914 double v5; // st7@3 | 7895 double v5; // st7@3 |
7987 int v78; // [sp+164h] [bp-10h]@7 | 7968 int v78; // [sp+164h] [bp-10h]@7 |
7988 void *v79; // [sp+168h] [bp-Ch]@9 | 7969 void *v79; // [sp+168h] [bp-Ch]@9 |
7989 float v80; // [sp+16Ch] [bp-8h]@3 | 7970 float v80; // [sp+16Ch] [bp-8h]@3 |
7990 const void *v81; // [sp+170h] [bp-4h]@7 | 7971 const void *v81; // [sp+170h] [bp-4h]@7 |
7991 | 7972 |
7973 __debugbreak(); | |
7974 | |
7992 pFace = &pIndoor->pFaces[uFaceID]; | 7975 pFace = &pIndoor->pFaces[uFaceID]; |
7993 v65 = uFaceID; | 7976 v65 = uFaceID; |
7994 v3 = uNumVertices; | 7977 v3 = uNumVertices; |
7995 v4 = pFace->uPolygonType; | 7978 v4 = pFace->uPolygonType; |
7996 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor ) | 7979 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor ) |
8520 } | 8503 } |
8521 else | 8504 else |
8522 { | 8505 { |
8523 v15 = 0; | 8506 v15 = 0; |
8524 } | 8507 } |
8525 v17 = sub_43F55F(a1, v15); | 8508 v17 = _43F55F_get_billboard_light_level(a1, v15); |
8526 if ( v17 > 27 ) | 8509 if ( v17 > 27 ) |
8527 v17 = 27; | 8510 v17 = 27; |
8528 if ( !a3 ) | 8511 if ( !a3 ) |
8529 v17 = 27; | 8512 v17 = 27; |
8530 v7 = v18; | 8513 v7 = v18; |
8537 LODWORD(v12) = a3 << 16; | 8520 LODWORD(v12) = a3 << 16; |
8538 HIDWORD(v12) = a3 >> 16; | 8521 HIDWORD(v12) = a3 >> 16; |
8539 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20) | 8522 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20) |
8540 * pOutdoor->fFogDensity; | 8523 * pOutdoor->fFogDensity; |
8541 v13 = a3a + 6.7553994e15; | 8524 v13 = a3a + 6.7553994e15; |
8542 v10 = sub_43F55F(a1, LODWORD(v13) + v11); | 8525 v10 = _43F55F_get_billboard_light_level(a1, LODWORD(v13) + v11); |
8543 if ( v10 > 27 ) | 8526 if ( v10 > 27 ) |
8544 v10 = 27; | 8527 v10 = 27; |
8545 if ( v10 < a4 ) | 8528 if ( v10 < a4 ) |
8546 v10 = a4; | 8529 v10 = a4; |
8547 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type ) | 8530 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type ) |
8565 } | 8548 } |
8566 else | 8549 else |
8567 { | 8550 { |
8568 v6 = 27; | 8551 v6 = 27; |
8569 } | 8552 } |
8570 v10 = sub_43F55F(a1, v6); | 8553 v10 = _43F55F_get_billboard_light_level(a1, v6); |
8571 if ( v10 > 27 || !a3 ) | 8554 if ( v10 > 27 || !a3 ) |
8572 v10 = 27; | 8555 v10 = 27; |
8573 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1); | 8556 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1); |
8574 } | 8557 } |
8575 v7 = 0; | 8558 v7 = 0; |
9078 } | 9061 } |
9079 if ( a3 != 0.0 ) | 9062 if ( a3 != 0.0 ) |
9080 { | 9063 { |
9081 LABEL_20: | 9064 LABEL_20: |
9082 if ( a5 ) | 9065 if ( a5 ) |
9083 v6 = 8 * sub_43F55F(a5, v6 >> 3); | 9066 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3); |
9084 if ( v6 > 216 ) | 9067 if ( v6 > 216 ) |
9085 v6 = 216; | 9068 v6 = 216; |
9086 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8); | 9069 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8); |
9087 } | 9070 } |
9088 LABEL_19: | 9071 LABEL_19: |
9118 v13 = a3a + 6.7553994e15; | 9101 v13 = a3a + 6.7553994e15; |
9119 a4a = LODWORD(v13); | 9102 a4a = LODWORD(v13); |
9120 } | 9103 } |
9121 v6 = a4a + v12; | 9104 v6 = a4a + v12; |
9122 if ( a5 ) | 9105 if ( a5 ) |
9123 v6 = 8 * sub_43F55F(a5, v6 >> 3); | 9106 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3); |
9124 if ( v6 > 216 ) | 9107 if ( v6 > 216 ) |
9125 v6 = 216; | 9108 v6 = 216; |
9126 if ( v6 < v12 ) | 9109 if ( v6 < v12 ) |
9127 v6 = v12; | 9110 v6 = v12; |
9128 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type ) | 9111 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type ) |
9344 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0); | 9327 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0); |
9345 pOutdoorCamera->numStru148s = 0; | 9328 pOutdoorCamera->numStru148s = 0; |
9346 pOutdoorCamera->uNumEdges = 0; | 9329 pOutdoorCamera->uNumEdges = 0; |
9347 pOutdoorCamera->uNumSpans = 0; | 9330 pOutdoorCamera->uNumSpans = 0; |
9348 pOutdoorCamera->uNumSurfs = 0; | 9331 pOutdoorCamera->uNumSurfs = 0; |
9349 pOutdoorCamera->field_3C = 0; | 9332 pOutdoorCamera->uNumBillboards = 0; |
9350 pOutdoorCamera->field_44 = 0; | 9333 pOutdoorCamera->field_44 = 0; |
9351 } | 9334 } |
9352 | 9335 |
9353 //----- (00481EFA) -------------------------------------------------------- | 9336 //----- (00481EFA) -------------------------------------------------------- |
9354 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5) | 9337 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5) |
12899 } | 12882 } |
12900 | 12883 |
12901 | 12884 |
12902 | 12885 |
12903 //----- (0043F953) -------------------------------------------------------- | 12886 //----- (0043F953) -------------------------------------------------------- |
12904 int __cdecl PrepareWallsRenderList_BLV() | 12887 void PrepareWallsRenderList_BLV() |
12905 { | 12888 { |
12906 pStru170->uNumFaceIDs = 0; | 12889 pStru170->uNumFaceIDs = 0; |
12907 if ( pBLVRenderParams->uRadius ) | 12890 if ( pBLVRenderParams->uPartySectorID ) |
12908 { | 12891 { |
12909 pStru170->field_FA8[0].uSectorID = LOWORD(pBLVRenderParams->uRadius); | 12892 pStru170->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID; |
12910 pStru170->field_FA8[0].uViewportW = LOWORD(pBLVRenderParams->uViewportW); | 12893 pStru170->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW; |
12911 pStru170->field_FA8[0].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ); | 12894 pStru170->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ; |
12912 pStru170->field_FA8[0].uViewportY = LOWORD(pBLVRenderParams->uViewportY); | 12895 pStru170->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY; |
12913 pStru170->field_FA8[0].uViewportX = LOWORD(pBLVRenderParams->uViewportX); | 12896 pStru170->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX; |
12914 pStru170->field_FA8[0].field_C._43F9E1( | 12897 pStru170->field_FA8[0].field_C._43F9E1( |
12915 SLOWORD(pBLVRenderParams->uViewportX), | 12898 pBLVRenderParams->uViewportX, |
12916 SLOWORD(pBLVRenderParams->uViewportY), | 12899 pBLVRenderParams->uViewportY, |
12917 SLOWORD(pBLVRenderParams->uViewportZ), | 12900 pBLVRenderParams->uViewportZ, |
12918 SLOWORD(pBLVRenderParams->uViewportW)); | 12901 pBLVRenderParams->uViewportW); |
12919 pStru170->field_FA8[0].uFaceID = -1; | 12902 pStru170->field_FA8[0].uFaceID = -1; |
12920 pStru170->field_FA8[0].std__vector_0007A8 = -1; | 12903 pStru170->field_FA8[0].std__vector_0007A8 = -1; |
12921 pStru170->std__vector_000FA8 = 1; | 12904 pStru170->std__vector_000FA8 = 1; |
12922 sub_440639(0); | 12905 sub_440639(0); |
12923 } | 12906 } |
12924 return pStru170->RenderWalls(); | 12907 pStru170->MakeVisibleSectorList(); |
12925 } | 12908 } |
12926 | 12909 |
12927 //----- (0043F9E1) -------------------------------------------------------- | 12910 //----- (0043F9E1) -------------------------------------------------------- |
12928 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w) | 12911 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w) |
12929 { | 12912 { |
13060 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16; | 13043 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16; |
13061 } | 13044 } |
13062 else | 13045 else |
13063 { | 13046 { |
13064 v17 = &pGame->pIndoorCameraD3D; | 13047 v17 = &pGame->pIndoorCameraD3D; |
13065 v15->flt_8 = pGame->pIndoorCameraD3D->flt_D0; | 13048 v15->fov_x = pGame->pIndoorCameraD3D->fov_x; |
13066 v18 = (*v17)->flt_D4; | 13049 v18 = (*v17)->fov_y; |
13067 v19 = v15->flt_8; | 13050 v19 = v15->fov_x; |
13068 v15->flt_C = v18; | 13051 v15->fov_y = v18; |
13069 v31 = v19; | 13052 v31 = v19; |
13070 v25 = v19 + 6.7553994e15; | 13053 v25 = v19 + 6.7553994e15; |
13071 LODWORD(v20) = 0; | 13054 LODWORD(v20) = 0; |
13072 HIDWORD(v20) = SLOWORD(v25); | 13055 HIDWORD(v20) = SLOWORD(v25); |
13073 v37 = v20 / x; | 13056 v37 = v20 / x; |
13074 LODWORD(v31) = v12->scale; | 13057 LODWORD(v31) = v12->scale; |
13075 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; | 13058 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; |
13076 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; | 13059 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16; |
13077 v31 = v15->flt_C; | 13060 v31 = v15->fov_y; |
13078 v25 = v31 + 6.7553994e15; | 13061 v25 = v31 + 6.7553994e15; |
13079 LODWORD(v20) = 0; | 13062 LODWORD(v20) = 0; |
13080 HIDWORD(v20) = SLOWORD(v25); | 13063 HIDWORD(v20) = SLOWORD(v25); |
13081 v37 = v20 / x; | 13064 v37 = v20 / x; |
13082 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16; | 13065 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16; |
13083 } | 13066 } |
13084 HIWORD(v22) = HIWORD(x); | 13067 HIWORD(v22) = HIWORD(x); |
13085 v15->field_4 = v37; | 13068 v15->field_4 = v37; |
13086 v15->field_1E = v30; | 13069 v15->field_1E = v30; |
13087 v15->field_20 = a1; | 13070 v15->some_x = a1; |
13088 v15->field_22 = a2; | 13071 v15->some_y = a2; |
13089 v15->field_24 = a3; | 13072 v15->some_z = a3; |
13090 v15->field_26 = a5; | 13073 v15->uScreenSpaceX = a5; |
13091 v15->field_28 = a6; | 13074 v15->uScreenSpaceY = a6; |
13092 v23 = 8 * v26; | 13075 v23 = 8 * v26; |
13093 LOBYTE(v23) = 8 * v26 | 5; | 13076 LOBYTE(v23) = 8 * v26 | 5; |
13094 LOWORD(v22) = 0; | 13077 LOWORD(v22) = 0; |
13095 v15->field_2C_prolly_tint = 0; | 13078 v15->uTintColor = 0; |
13096 v15->sZValue = v22 + v23; | 13079 v15->sZValue = v22 + v23; |
13097 v15->pSpriteFrame = v12; | 13080 v15->pSpriteFrame = v12; |
13098 } | 13081 } |
13099 } | 13082 } |
13100 } | 13083 } |
13111 local_0.z = (double)v2->vPosition.z; | 13094 local_0.z = (double)v2->vPosition.z; |
13112 local_0.flt_10 = 0.0; | 13095 local_0.flt_10 = 0.0; |
13113 local_0.flt_14 = 0.0; | 13096 local_0.flt_14 = 0.0; |
13114 local_0.flt_18 = 0.0; | 13097 local_0.flt_18 = 0.0; |
13115 local_0.flt_28 = 1.0; | 13098 local_0.flt_28 = 1.0; |
13116 local_0.field_20 = (rand() & 0x80) + 128; | 13099 local_0.timeToLive = (rand() & 0x80) + 128; |
13117 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01"); | 13100 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01"); |
13118 pGame->pParticleEngine->AddParticle(&local_0); | 13101 pGame->pParticleEngine->AddParticle(&local_0); |
13119 } | 13102 } |
13120 } | 13103 } |
13121 } | 13104 } |
13122 | 13105 |
13123 | 13106 |
13124 //----- (0044028F) -------------------------------------------------------- | 13107 //----- (0044028F) -------------------------------------------------------- |
13125 void __cdecl PrepareItemsRenderList_BLV() | 13108 void PrepareItemsRenderList_BLV() |
13126 { | 13109 { |
13127 char *v0; // edi@2 | |
13128 ObjectDesc *v1; // ebx@4 | 13110 ObjectDesc *v1; // ebx@4 |
13129 __int16 v2; // ax@5 | 13111 __int16 v2; // ax@5 |
13130 RenderBillboard *v3; // esi@12 | 13112 RenderBillboard *v3; // esi@12 |
13131 SpriteFrame *v4; // eax@12 | 13113 SpriteFrame *v4; // eax@12 |
13132 SpriteFrame *v5; // ebx@12 | 13114 SpriteFrame *v5; // ebx@12 |
13135 int v8; // edx@12 | 13117 int v8; // edx@12 |
13136 int v9; // ecx@12 | 13118 int v9; // ecx@12 |
13137 unsigned __int16 v10; // ax@12 | 13119 unsigned __int16 v10; // ax@12 |
13138 int *v11; // eax@20 | 13120 int *v11; // eax@20 |
13139 char v12; // zf@26 | 13121 char v12; // zf@26 |
13140 IndoorCameraD3D **v13; // eax@27 | |
13141 double v14; // st7@27 | |
13142 float v15; // eax@27 | |
13143 double v16; // ST30_8@27 | |
13144 signed __int64 v17; // qtt@27 | |
13145 int v18; // ST5C_4@27 | 13122 int v18; // ST5C_4@27 |
13146 signed __int64 v19; // qtt@28 | 13123 signed __int64 v19; // qtt@28 |
13147 int v20; // ST5C_4@28 | 13124 int v20; // ST5C_4@28 |
13148 int v21; // edx@29 | 13125 int v21; // edx@29 |
13149 __int16 v22; // ax@29 | 13126 __int16 v22; // ax@29 |
13150 int v23; // eax@29 | 13127 int v23; // eax@29 |
13151 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12 | 13128 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12 |
13152 ObjectDesc *v25; // [sp+20h] [bp-3Ch]@4 | |
13153 __int16 a5; // [sp+28h] [bp-34h]@12 | 13129 __int16 a5; // [sp+28h] [bp-34h]@12 |
13154 int a6; // [sp+2Ch] [bp-30h]@12 | 13130 int a6; // [sp+2Ch] [bp-30h]@12 |
13155 int a2; // [sp+30h] [bp-2Ch]@12 | 13131 int a2; // [sp+30h] [bp-2Ch]@12 |
13156 int a1; // [sp+34h] [bp-28h]@12 | 13132 int a1; // [sp+34h] [bp-28h]@12 |
13157 int v30; // [sp+38h] [bp-24h]@12 | 13133 int v30; // [sp+38h] [bp-24h]@12 |
13158 int v31; // [sp+38h] [bp-24h]@27 | 13134 int v31; // [sp+38h] [bp-24h]@27 |
13159 signed int v32; // [sp+3Ch] [bp-20h]@1 | |
13160 int a3; // [sp+40h] [bp-1Ch]@12 | 13135 int a3; // [sp+40h] [bp-1Ch]@12 |
13161 signed __int16 v34; // [sp+44h] [bp-18h]@14 | 13136 signed __int16 v34; // [sp+44h] [bp-18h]@14 |
13162 int v35; // [sp+48h] [bp-14h]@25 | 13137 int v35; // [sp+48h] [bp-14h]@25 |
13163 int v36; // [sp+4Ch] [bp-10h]@25 | 13138 int v36; // [sp+4Ch] [bp-10h]@25 |
13164 signed int z; // [sp+50h] [bp-Ch]@24 | 13139 signed int z; // [sp+50h] [bp-Ch]@24 |
13165 signed int y; // [sp+54h] [bp-8h]@24 | 13140 signed int y; // [sp+54h] [bp-8h]@24 |
13166 signed int x; // [sp+58h] [bp-4h]@24 | 13141 signed int x; // [sp+58h] [bp-4h]@24 |
13167 | 13142 |
13168 v32 = 0; | 13143 for (uint i = 0; i < uNumLayingItems; ++i) |
13169 if ( (signed int)uNumLayingItems > 0 ) | 13144 { |
13170 { | 13145 auto p = pLayingItems + i; |
13171 v0 = (char *)&pLayingItems[0].uSectorID; | 13146 if (p->uObjectDescID) |
13172 do | 13147 { |
13173 { | 13148 v1 = &pObjectList->pObjects[p->uObjectDescID]; |
13174 if ( *((short *)v0 - 13) ) | |
13175 { | |
13176 v1 = &pObjectList->pObjects[*((short *)v0 - 13)]; | |
13177 v25 = v1; | |
13178 if ( !(v1->uFlags & 1) ) | 13149 if ( !(v1->uFlags & 1) ) |
13179 { | 13150 { |
13180 if ( ((v2 = *((short *)v0 - 14), v2 < 1000) || v2 >= 10000) | 13151 if ( ((v2 = p->uItemType, v2 < 1000) || v2 >= 10000) |
13181 && (v2 < 500 || v2 >= 600) | 13152 && (v2 < 500 || v2 >= 600) |
13182 && (v2 < 811 || v2 >= 815) | 13153 && (v2 < 811 || v2 >= 815) |
13183 || pGame->pStru6Instance->_4A81CA((LayingItem *)(v0 - 28)) ) | 13154 || pGame->pStru6Instance->_4A81CA(p)) |
13184 { | 13155 { |
13185 a5 = *(short *)v0; | 13156 a5 = p->uSectorID; |
13186 a1 = *((int *)v0 - 6); | 13157 a1 = p->vPosition.x; |
13187 a2 = *((int *)v0 - 5); | 13158 a2 = p->vPosition.y; |
13188 a3 = *((int *)v0 - 4); | 13159 a3 = p->vPosition.z; |
13189 v3 = &pBillboardRenderList[uNumBillboardsToDraw]; | 13160 v3 = &pBillboardRenderList[uNumBillboardsToDraw]; |
13190 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, *((short *)v0 + 1)); | 13161 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID); |
13191 v5 = v4; | 13162 v5 = v4; |
13192 v24 = v4; | 13163 v24 = v4; |
13193 v30 = v4->uFlags; | 13164 v30 = v4->uFlags; |
13194 a6 = v4->uGlowRadius * *((short *)v0 + 3); | 13165 a6 = v4->uGlowRadius * p->field_22; |
13195 v6 = stru_5C6E00->Atan2( | 13166 v6 = stru_5C6E00->Atan2( |
13196 *((int *)v0 - 6) - pBLVRenderParams->vPartyPos.x, | 13167 p->vPosition.x - pBLVRenderParams->vPartyPos.x, |
13197 *((int *)v0 - 5) - pBLVRenderParams->vPartyPos.y); | 13168 p->vPosition.y - pBLVRenderParams->vPartyPos.y); |
13198 LOWORD(v7) = *((short *)v0 - 3); | 13169 LOWORD(v7) = p->uFacing; |
13199 v8 = v30; | 13170 v8 = v30; |
13200 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7; | 13171 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7; |
13201 v10 = v5->pHwSpriteIDs[v9]; | 13172 v10 = v5->pHwSpriteIDs[v9]; |
13202 v3->uHwSpriteID = v10; | 13173 v3->uHwSpriteID = v10; |
13203 if ( v30 & 0x20 ) | 13174 if ( v30 & 0x20 ) |
13223 a1, | 13194 a1, |
13224 a2, | 13195 a2, |
13225 a3, | 13196 a3, |
13226 a5, | 13197 a5, |
13227 a6, | 13198 a6, |
13228 v25->uParticleTrailColorR, | 13199 v1->uParticleTrailColorR, |
13229 v25->uParticleTrailColorG, | 13200 v1->uParticleTrailColorG, |
13230 v25->uParticleTrailColorB, | 13201 v1->uParticleTrailColorB, |
13231 v11); | 13202 byte_4E94D3); |
13232 } | 13203 } |
13233 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | 13204 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( |
13234 a1, | 13205 a1, |
13235 a2, | 13206 a2, |
13236 a3, | 13207 a3, |
13242 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35); | 13213 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35); |
13243 if ( (signed int)uNumBillboardsToDraw >= 500 ) | 13214 if ( (signed int)uNumBillboardsToDraw >= 500 ) |
13244 return; | 13215 return; |
13245 ++uNumBillboardsToDraw; | 13216 ++uNumBillboardsToDraw; |
13246 ++uNumSpritesDrawnThisFrame; | 13217 ++uNumSpritesDrawnThisFrame; |
13247 *(v0 - 2) |= 1u; | 13218 p->uAttributes |= 1u; |
13248 v12 = pRenderer->pRenderD3D == 0; | 13219 v12 = pRenderer->pRenderD3D == 0; |
13249 v3->uPalette = v24->uPaletteIndex; | 13220 v3->uPalette = v24->uPaletteIndex; |
13250 v3->uIndoorSectorID = a5; | 13221 v3->uIndoorSectorID = a5; |
13251 if ( v12 ) | 13222 if ( v12 ) |
13252 { | 13223 { |
13256 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16; | 13227 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16; |
13257 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16; | 13228 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16; |
13258 } | 13229 } |
13259 else | 13230 else |
13260 { | 13231 { |
13261 v13 = &pGame->pIndoorCameraD3D; | 13232 v3->fov_x = pGame->pIndoorCameraD3D->fov_x; |
13262 v3->flt_8 = pGame->pIndoorCameraD3D->flt_D0; | 13233 v3->fov_y = pGame->pIndoorCameraD3D->fov_y; |
13263 v14 = (*v13)->flt_D4; | 13234 v18 = (int)floorf(v3->fov_x + 0.5f) / x; |
13264 v15 = v3->flt_8; | 13235 v3->field_0 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16; |
13265 v3->flt_C = v14; | 13236 v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16; |
13266 v16 = v15 + 6.7553994e15; | |
13267 LODWORD(v17) = 0; | |
13268 HIDWORD(v17) = SLOWORD(v16); | |
13269 v18 = v17 / x; | |
13270 v3->field_0 = (unsigned __int64)(v24->scale * v17 / x) >> 16; | |
13271 v31 = (unsigned __int64)(v24->scale * (signed __int64)v18) >> 16; | |
13272 } | 13237 } |
13273 HIWORD(v21) = HIWORD(x); | 13238 HIWORD(v21) = HIWORD(x); |
13274 v3->field_4 = v31; | 13239 v3->field_4 = v31; |
13275 v3->field_1E = v34; | 13240 v3->field_1E = v34; |
13276 v3->field_20 = a1; | 13241 v3->some_x = a1; |
13277 v3->field_22 = a2; | 13242 v3->some_y = a2; |
13278 v3->field_24 = a3; | 13243 v3->some_z = a3; |
13279 v3->field_26 = v36; | 13244 v3->uScreenSpaceX = v36; |
13280 v22 = v35; | 13245 v22 = v35; |
13281 v3->field_2C_prolly_tint = 0; | 13246 v3->uTintColor = 0; |
13282 v3->field_28 = v22; | 13247 v3->uScreenSpaceY = v22; |
13283 LOWORD(v21) = 0; | 13248 LOWORD(v21) = 0; |
13284 v23 = 8 * v32; | 13249 v23 = 8 * i; |
13285 LOBYTE(v23) = 8 * v32 | 2; | 13250 LOBYTE(v23) = 8 * i | 2; |
13286 v3->pSpriteFrame = v24; | 13251 v3->pSpriteFrame = v24; |
13287 v12 = (*(v0 - 2) & 0x20) == 0; | 13252 v12 = (p->uAttributes & 0x20) == 0; |
13288 v3->sZValue = v21 + v23; | 13253 v3->sZValue = v21 + v23; |
13289 if ( !v12 ) | 13254 if ( !v12 ) |
13290 { | 13255 { |
13291 if ( !pRenderer->pRenderD3D ) | 13256 if ( !pRenderer->pRenderD3D ) |
13292 v3->sZValue = 0; | 13257 v3->sZValue = 0; |
13293 } | 13258 } |
13294 } | 13259 } |
13295 } | 13260 } |
13296 } | 13261 } |
13297 } | 13262 } |
13298 ++v32; | |
13299 v0 += 112; | |
13300 } | |
13301 while ( v32 < (signed int)uNumLayingItems ); | |
13302 } | 13263 } |
13303 } | 13264 } |
13304 | 13265 |
13305 | 13266 |
13306 | 13267 |
13317 if ( pRenderer->pRenderD3D ) | 13278 if ( pRenderer->pRenderD3D ) |
13318 { | 13279 { |
13319 if ( v3->uNumNonBSPFaces > 0 ) | 13280 if ( v3->uNumNonBSPFaces > 0 ) |
13320 { | 13281 { |
13321 do | 13282 do |
13322 pStru170->_4B0EA8(v1, v3->pFaceIDs[v2++]); | 13283 { |
13284 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]); | |
13285 pStru170->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]); | |
13286 } | |
13323 while ( v2 < v3->uNumNonBSPFaces ); | 13287 while ( v2 < v3->uNumNonBSPFaces ); |
13324 } | 13288 } |
13325 } | 13289 } |
13326 else | 13290 else |
13327 { | 13291 { |
13328 if ( v3->uNumNonBSPFaces > 0 ) | 13292 if ( v3->uNumNonBSPFaces > 0 ) |
13329 { | 13293 { |
13330 do | 13294 do |
13331 pStru170->_4AFB86(v1, v3->pFaceIDs[v2++]); | 13295 pStru170->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]); |
13332 while ( v2 < v3->uNumNonBSPFaces ); | 13296 while ( v2 < v3->uNumNonBSPFaces ); |
13333 } | 13297 } |
13334 } | 13298 } |
13335 if ( v3->field_0 & 0x10 ) | 13299 if ( v3->field_0 & 0x10 ) |
13336 sub_4406BC(v1, v3->uFirstBSPNode); | 13300 sub_4406BC(v1, v3->uFirstBSPNode); |
13348 int v8; // ebx@10 | 13312 int v8; // ebx@10 |
13349 __int16 v9; // di@18 | 13313 __int16 v9; // di@18 |
13350 int v10; // [sp+10h] [bp-Ch]@1 | 13314 int v10; // [sp+10h] [bp-Ch]@1 |
13351 bool v11; // [sp+14h] [bp-8h]@5 | 13315 bool v11; // [sp+14h] [bp-8h]@5 |
13352 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1 | 13316 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1 |
13317 | |
13318 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode); | |
13353 | 13319 |
13354 v10 = a1; | 13320 v10 = a1; |
13355 v12 = &pStru170->field_FA8[a1]; | 13321 v12 = &pStru170->field_FA8[a1]; |
13356 while ( 1 ) | 13322 while ( 1 ) |
13357 { | 13323 { |
13371 v6 = v3->uBack; | 13337 v6 = v3->uBack; |
13372 if ( v6 != -1 ) | 13338 if ( v6 != -1 ) |
13373 sub_4406BC(v10, v6); | 13339 sub_4406BC(v10, v6); |
13374 v7 = v3->uCoplanarOffset; | 13340 v7 = v3->uCoplanarOffset; |
13375 v8 = v7 + v3->uCoplanarSize; | 13341 v8 = v7 + v3->uCoplanarSize; |
13342 | |
13343 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]); | |
13344 | |
13376 if ( pRenderer->pRenderD3D ) | 13345 if ( pRenderer->pRenderD3D ) |
13377 { | 13346 { |
13378 while ( v7 < v8 ) | 13347 while ( v7 < v8 ) |
13379 pStru170->_4B0EA8(v10, v2->pFaceIDs[v7++]); | 13348 pStru170->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]); |
13380 } | 13349 } |
13381 else | 13350 else |
13382 { | 13351 { |
13383 while ( v7 < v8 ) | 13352 while ( v7 < v8 ) |
13384 pStru170->_4AFB86(v10, v2->pFaceIDs[v7++]); | 13353 pStru170->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]); |
13385 } | 13354 } |
13386 v9 = v11 ? v3->uFront : v3->uBack; | 13355 v9 = v11 ? v3->uFront : v3->uBack; |
13387 if ( v9 == -1 ) | 13356 if ( v9 == -1 ) |
13388 break; | 13357 break; |
13389 uFirstNode = v9; | 13358 uFirstNode = v9; |
13391 } | 13360 } |
13392 | 13361 |
13393 //----- (00440DF5) -------------------------------------------------------- | 13362 //----- (00440DF5) -------------------------------------------------------- |
13394 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr) | 13363 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr) |
13395 { | 13364 { |
13396 stru167_wrap *v6; // esi@1 | |
13397 int result; // eax@1 | 13365 int result; // eax@1 |
13398 | 13366 |
13399 v6 = this; | 13367 pElements[uNumElements].field_6_rnd_value = a2; |
13400 v6->pElements[v6->uNumElements].field_6 = a2; | 13368 pElements[uNumElements].field_8_rnd_value = a3; |
13401 this->pElements[this->uNumElements].field_8 = a3; | 13369 pElements[uNumElements].field_A_rnd_value = a4; |
13402 this->pElements[this->uNumElements].field_A = a4; | 13370 pElements[uNumElements].field_C_time_left = rand() % 64 + 256; |
13403 v6->pElements[v6->uNumElements].field_C = rand() % 64 + 256; | 13371 pElements[uNumElements].field_E_time_to_live = pElements[uNumElements].field_C_time_left; |
13404 v6->pElements[v6->uNumElements].field_E = v6->pElements[v6->uNumElements].field_C; | 13372 result = 3 * uNumElements; |
13405 result = 3 * v6->uNumElements; | 13373 pElements[uNumElements++].bgr16 = bgr; |
13406 v6->pElements[v6->uNumElements++].bgr16 = bgr; | 13374 if (uNumElements >= 100 ) |
13407 if ( v6->uNumElements >= 100 ) | 13375 uNumElements = 0; |
13408 v6->uNumElements = 0; | 13376 return result; |
13409 return result; | |
13410 } | 13377 } |
13411 | 13378 |
13412 //----- (00440E91) -------------------------------------------------------- | 13379 //----- (00440E91) -------------------------------------------------------- |
13413 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr) | 13380 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr) |
13414 { | 13381 { |
13429 } | 13396 } |
13430 | 13397 |
13431 //----- (00440F07) -------------------------------------------------------- | 13398 //----- (00440F07) -------------------------------------------------------- |
13432 void stru167_wrap::_440F07() | 13399 void stru167_wrap::_440F07() |
13433 { | 13400 { |
13434 char *v1; // esi@1 | 13401 for (uint i = 0; i < 100; ++i) |
13435 signed int v2; // edi@1 | 13402 { |
13436 | 13403 if (pElements[i].field_C_time_left > 0) |
13437 v1 = (char *)&this->pElements[0].field_6; | 13404 { |
13438 v2 = 100; | 13405 pElements[i].field_A_rnd_value += rand() % 5 + 4; |
13439 do | 13406 pElements[i].field_6_rnd_value += rand() % 5 - 2; |
13440 { | 13407 pElements[i].field_8_rnd_value += rand() % 5 - 2; |
13441 if ( *((short *)v1 + 3) > 0 ) | 13408 pElements[i].field_C_time_left -= (short)pEventTimer->uTimeElapsed; |
13442 { | 13409 } |
13443 *((short *)v1 + 2) += rand() % 5 + 4; | 13410 } |
13444 *(short *)v1 += rand() % 5 - 2; | |
13445 *((short *)v1 + 1) += rand() % 5 - 2; | |
13446 *((short *)v1 + 3) -= LOWORD(pEventTimer->uTimeElapsed); | |
13447 } | |
13448 v1 += 24; | |
13449 --v2; | |
13450 } | |
13451 while ( v2 ); | |
13452 } | 13411 } |
13453 | 13412 |
13454 //----- (0044100D) -------------------------------------------------------- | 13413 //----- (0044100D) -------------------------------------------------------- |
13455 bool __cdecl sub_44100D() | 13414 bool __cdecl sub_44100D() |
13456 { | 13415 { |
13457 return uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4 | 13416 return pCurrentScreen == 4 |
13458 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 7 | 13417 || pCurrentScreen == 7 |
13459 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions > 12 | 13418 || pCurrentScreen > 12 |
13460 && (uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions <= 14 | 13419 && (pCurrentScreen <= 14 |
13461 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions > 16 | 13420 || pCurrentScreen > 16 |
13462 && (uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions <= 18 | 13421 && (pCurrentScreen <= 18 |
13463 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 23)); | 13422 || pCurrentScreen == 23)); |
13464 } | 13423 } |
13465 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; | 13424 // 4E28F8: using guessed type int pCurrentScreen; |
13466 | 13425 |
13467 //----- (00441498) -------------------------------------------------------- | 13426 //----- (00441498) -------------------------------------------------------- |
13468 void __cdecl GameUI_DrawTorchlightAndWizardEye() | 13427 void __cdecl GameUI_DrawTorchlightAndWizardEye() |
13469 { | 13428 { |
13470 unsigned int v0; // eax@15 | 13429 unsigned int v0; // eax@15 |
13471 IconFrame *v1; // eax@15 | 13430 IconFrame *v1; // eax@15 |
13472 unsigned int v2; // eax@19 | 13431 unsigned int v2; // eax@19 |
13473 IconFrame *v3; // eax@19 | 13432 IconFrame *v3; // eax@19 |
13474 | 13433 |
13475 if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions | 13434 if ( !pCurrentScreen |
13476 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 1 | 13435 || pCurrentScreen == 1 |
13477 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 2 | 13436 || pCurrentScreen == 2 |
13478 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 5 | 13437 || pCurrentScreen == 5 |
13479 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 8 | 13438 || pCurrentScreen == 8 |
13480 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 10 | 13439 || pCurrentScreen == 10 |
13481 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 11 | 13440 || pCurrentScreen == 11 |
13482 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 12 | 13441 || pCurrentScreen == 12 |
13483 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 15 | 13442 || pCurrentScreen == 15 |
13484 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 3 | 13443 || pCurrentScreen == 3 |
13485 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 19 ) | 13444 || pCurrentScreen == 19 ) |
13486 { | 13445 { |
13487 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0 | 13446 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0 |
13488 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) ) | 13447 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) ) |
13489 { | 13448 { |
13490 v0 = pEventTimer->Time(); | 13449 v0 = pEventTimer->Time(); |
13504 pUIAnim_WizardEye->y, | 13463 pUIAnim_WizardEye->y, |
13505 &pIcons_LOD->pTextures[v3->uTextureID]); | 13464 &pIcons_LOD->pTextures[v3->uTextureID]); |
13506 } | 13465 } |
13507 } | 13466 } |
13508 } | 13467 } |
13509 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; | 13468 // 4E28F8: using guessed type int pCurrentScreen; |
13510 | 13469 |
13511 //----- (0044158F) -------------------------------------------------------- | 13470 //----- (0044158F) -------------------------------------------------------- |
13512 void __cdecl GameUI_DrawCharacterSelectionFrame() | 13471 void __cdecl GameUI_DrawCharacterSelectionFrame() |
13513 { | 13472 { |
13514 if ( uActiveCharacter ) | 13473 if ( uActiveCharacter ) |
13515 pRenderer->DrawTextureTransparent( | 13474 pRenderer->DrawTextureTransparent( |
13516 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[uActiveCharacter] - 9, | 13475 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, |
13517 0x17Cu, | 13476 0x17Cu, |
13518 &pIcons_LOD->pTextures[dword_50C98C]); | 13477 &pIcons_LOD->pTextures[dword_50C98C]); |
13519 } | 13478 } |
13520 // 4ED746: using guessed type __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[]; | 13479 |
13521 // 50C98C: using guessed type int dword_50C98C; | |
13522 | 13480 |
13523 //----- (004415C5) -------------------------------------------------------- | 13481 //----- (004415C5) -------------------------------------------------------- |
13524 void __cdecl Load_isn_spells_21_27() | 13482 void __cdecl Load_isn_spells_21_27() |
13525 { | 13483 { |
13526 signed int v0; // esi@1 | 13484 signed int v0; // esi@1 |
13562 { | 13520 { |
13563 v3 = pTextureIDs_isns[v1]; | 13521 v3 = pTextureIDs_isns[v1]; |
13564 pRenderer->_4A65CC( | 13522 pRenderer->_4A65CC( |
13565 pPartySpellbuffsUI_XYs[v1][0], | 13523 pPartySpellbuffsUI_XYs[v1][0], |
13566 pPartySpellbuffsUI_XYs[v1][1], | 13524 pPartySpellbuffsUI_XYs[v1][1], |
13567 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0), | 13525 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), |
13568 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0), | 13526 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0), |
13569 v0 + 20 * pPartySpellbuffsUI_smthns[v1], | 13527 v0 + 20 * pPartySpellbuffsUI_smthns[v1], |
13570 0, | 13528 0, |
13571 63); | 13529 63); |
13572 } | 13530 } |
13573 ++v1; | 13531 ++v1; |
13574 } | 13532 } |
13575 while ( v1 < 14 ); | 13533 while ( v1 < 14 ); |
13576 if ( !uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions | 13534 if ( !pCurrentScreen |
13577 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4 ) | 13535 || pCurrentScreen == 4 ) |
13578 { | 13536 { |
13579 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 ) | 13537 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 ) |
13580 { | 13538 { |
13581 if ( pParty->bFlying ) | 13539 if ( pParty->bFlying ) |
13582 v6 = v0; | 13540 v6 = v0; |
13685 *((short *)v3 - 4)); | 13643 *((short *)v3 - 4)); |
13686 v7 = v6; | 13644 v7 = v6; |
13687 v11 = *((int *)v3 + 1); | 13645 v11 = *((int *)v3 + 1); |
13688 v13 = v6->scale; | 13646 v13 = v6->scale; |
13689 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16; | 13647 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16; |
13690 v10.field_8 = *((short *)v3 - 2); | 13648 v10.uScreenSpaceX = *((short *)v3 - 2); |
13691 v10.field_C = *((short *)v3 - 1); | 13649 v10.uScreenSpaceY = *((short *)v3 - 1); |
13692 v10.field_10 = v13; | 13650 v10.field_10 = v13; |
13693 v10.field_14 = v13; | 13651 v10.field_14 = v13; |
13694 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1); | 13652 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1); |
13695 v8 = *((short *)v3 - 5); | 13653 v8 = *((short *)v3 - 5); |
13696 v10.field_28 = 0; | 13654 v10.sZValue = 0; |
13697 v10.uFlags = 0; | 13655 v10.uFlags = 0; |
13698 v9 = pOverlayList->pOverlays[v8].uOverlayType; | 13656 v9 = pOverlayList->pOverlays[v8].uOverlayType; |
13699 if ( !v9 || v9 == 2 ) | 13657 if ( !v9 || v9 == 2 ) |
13700 v10.field_C += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1; | 13658 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1; |
13701 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0); | 13659 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0); |
13702 ++v12; | 13660 ++v12; |
13703 if ( v12 == 5 ) | 13661 if ( v12 == 5 ) |
13704 break; | 13662 break; |
13705 } | 13663 } |
13713 } | 13671 } |
13714 | 13672 |
13715 | 13673 |
13716 | 13674 |
13717 //----- (00441D38) -------------------------------------------------------- | 13675 //----- (00441D38) -------------------------------------------------------- |
13718 void __fastcall GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags) | 13676 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags) |
13719 { | 13677 { |
13720 int v6; // ebx@6 | 13678 int uHeight; // ebx@6 |
13721 BLVFace *v7; // eax@8 | 13679 //unsigned int v9; // edx@9 |
13722 unsigned int *v8; // edi@9 | 13680 //unsigned int v10; // ebx@10 |
13723 unsigned int v9; // edx@9 | |
13724 unsigned int v10; // ebx@10 | |
13725 __int16 v11; // cx@11 | 13681 __int16 v11; // cx@11 |
13726 int v12; // ecx@17 | 13682 //BLVFace *v12; // ecx@17 |
13727 unsigned int v13; // ecx@21 | 13683 //unsigned int v13; // ecx@21 |
13728 unsigned int v14; // ebx@23 | 13684 unsigned int v14; // ebx@23 |
13729 int v15; // eax@23 | 13685 int v15; // eax@23 |
13730 unsigned int *v16; // ecx@28 | 13686 //unsigned int *v16; // ecx@28 |
13731 __int16 v17; // di@30 | 13687 __int16 v17; // di@30 |
13732 double v18; // st7@30 | 13688 double v18; // st7@30 |
13733 float v19; // ST38_4@30 | 13689 float v19; // ST38_4@30 |
13734 double v20; // st7@30 | 13690 double v20; // st7@30 |
13735 double v21; // st6@30 | 13691 double v21; // st6@30 |
13736 double v22; // st5@33 | 13692 double v22; // st5@33 |
13737 float v23; // ST3C_4@37 | |
13738 double v24; // ST20_8@37 | |
13739 double v25; // ST20_8@37 | |
13740 unsigned __int16 *v26; // edx@37 | 13693 unsigned __int16 *v26; // edx@37 |
13741 signed int v27; // eax@37 | 13694 signed int v27; // eax@37 |
13742 unsigned __int16 *v28; // ecx@37 | 13695 unsigned __int16 *v28; // ecx@37 |
13743 signed int v29; // edi@40 | 13696 signed int v29; // edi@40 |
13744 int v30; // eax@42 | 13697 int v30; // eax@42 |
13784 signed int v70; // [sp+24h] [bp-30h]@37 | 13737 signed int v70; // [sp+24h] [bp-30h]@37 |
13785 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 | 13738 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 |
13786 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | 13739 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
13787 int v73; // [sp+2Ch] [bp-28h]@30 | 13740 int v73; // [sp+2Ch] [bp-28h]@30 |
13788 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30 | 13741 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30 |
13789 signed int v75; // [sp+34h] [bp-20h]@4 | |
13790 int v76; // [sp+34h] [bp-20h]@91 | 13742 int v76; // [sp+34h] [bp-20h]@91 |
13791 int v77; // [sp+34h] [bp-20h]@108 | 13743 int v77; // [sp+34h] [bp-20h]@108 |
13792 signed int v78; // [sp+38h] [bp-1Ch]@37 | 13744 signed int v78; // [sp+38h] [bp-1Ch]@37 |
13793 int v79; // [sp+38h] [bp-1Ch]@72 | 13745 int v79; // [sp+38h] [bp-1Ch]@72 |
13794 bool v80; // [sp+3Ch] [bp-18h]@2 | |
13795 unsigned int a2; // [sp+40h] [bp-14h]@1 | |
13796 int a2a; // [sp+40h] [bp-14h]@8 | |
13797 signed int a2b; // [sp+40h] [bp-14h]@41 | 13746 signed int a2b; // [sp+40h] [bp-14h]@41 |
13798 char *a2c; // [sp+40h] [bp-14h]@68 | 13747 char *a2c; // [sp+40h] [bp-14h]@68 |
13799 unsigned int a3; // [sp+44h] [bp-10h]@1 | |
13800 int a3a; // [sp+44h] [bp-10h]@40 | 13748 int a3a; // [sp+44h] [bp-10h]@40 |
13801 signed int uHeight; // [sp+48h] [bp-Ch]@1 | 13749 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
13802 signed int uWidth; // [sp+4Ch] [bp-8h]@1 | 13750 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 |
13803 signed int uZa; // [sp+5Ch] [bp+8h]@7 | 13751 //signed int uZb; // [sp+5Ch] [bp+8h]@27 |
13804 signed int uZb; // [sp+5Ch] [bp+8h]@27 | 13752 signed int uWidth; // [sp+5Ch] [bp+8h]@30 |
13805 signed int uZc; // [sp+5Ch] [bp+8h]@30 | |
13806 signed int uZd; // [sp+5Ch] [bp+8h]@45 | 13753 signed int uZd; // [sp+5Ch] [bp+8h]@45 |
13807 signed int uZe; // [sp+5Ch] [bp+8h]@67 | 13754 signed int uZe; // [sp+5Ch] [bp+8h]@67 |
13808 signed int uZf; // [sp+5Ch] [bp+8h]@85 | 13755 signed int uZf; // [sp+5Ch] [bp+8h]@85 |
13809 signed int uZg; // [sp+5Ch] [bp+8h]@105 | 13756 signed int uZg; // [sp+5Ch] [bp+8h]@105 |
13810 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | 13757 unsigned int uWa; // [sp+60h] [bp+Ch]@23 |
13811 float uWb; // [sp+60h] [bp+Ch]@30 | 13758 float uWb; // [sp+60h] [bp+Ch]@30 |
13812 float uWe; // [sp+60h] [bp+Ch]@37 | |
13813 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37 | 13759 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37 |
13814 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | 13760 unsigned int uWd; // [sp+60h] [bp+Ch]@95 |
13815 float uZooma; // [sp+64h] [bp+10h]@117 | 13761 float uZooma; // [sp+64h] [bp+10h]@117 |
13816 signed int flagsa; // [sp+68h] [bp+14h]@42 | 13762 signed int flagsa; // [sp+68h] [bp+14h]@42 |
13817 unsigned int flagsb; // [sp+68h] [bp+14h]@66 | 13763 unsigned int flagsb; // [sp+68h] [bp+14h]@66 |
13818 char *flagsc; // [sp+68h] [bp+14h]@86 | 13764 char *flagsc; // [sp+68h] [bp+14h]@86 |
13819 unsigned int flagsd; // [sp+68h] [bp+14h]@105 | 13765 unsigned int flagsd; // [sp+68h] [bp+14h]@105 |
13820 | 13766 |
13821 a3 = uY; | 13767 //a3 = uY; |
13822 a2 = uX; | 13768 //a2 = uX; |
13823 uWidth = (signed int)(uX + uZ) >> 1; | 13769 uCenterX = (uX + uZ) / 2; |
13824 uHeight = (signed int)(uY + uW) >> 1; | 13770 uCenterY = (uY + uW) / 2; |
13825 lPitch = pRenderer->uTargetSurfacePitch; | 13771 lPitch = pRenderer->uTargetSurfacePitch; |
13826 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | 13772 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); |
13827 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); | 13773 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); |
13828 v80 = (signed __int64)pParty->pPartyBuffs[19].uExpireTime > 0; | 13774 auto bWizardEyeActive = pParty->WizardEyeActive(); |
13829 v75 = pParty->pPartyBuffs[19].uSkill; | 13775 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); |
13830 if ( CheckHiredNPCSpeciality(0x26u) ) | 13776 if (CheckHiredNPCSpeciality(0x26u)) |
13831 { | 13777 { |
13832 v80 = 1; | 13778 bWizardEyeActive = true; |
13833 v75 = 2; | 13779 uWizardEyeSkillLevel = 2; |
13834 } | 13780 } |
13835 pRenderer->Clip_v2(a2, a3, uZ - 1, uW - 1); | 13781 pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1); |
13836 v6 = uW - a3; | 13782 uHeight = uW - uY; |
13783 uWidth = uZ - uX; | |
13784 | |
13837 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | 13785 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) |
13838 { | 13786 { |
13839 uZc = uZ - a2; | |
13840 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | 13787 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; |
13841 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; | 13788 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; |
13842 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | 13789 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; |
13843 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | 13790 v73 = (1 << (v17 + 16)) / (signed int)uZoom; |
13844 v18 = (double)(1 << (16 - v17)); | 13791 v18 = (double)(1 << (16 - v17)); |
13845 v19 = v18; | 13792 v19 = v18; |
13846 v20 = (double)(pParty->vPosition.x + 32768) / v18; | 13793 v20 = (double)(pParty->vPosition.x + 32768) / v18; |
13847 v21 = (double)(32768 - pParty->vPosition.z) / v19; | 13794 v21 = (double)(32768 - pParty->vPosition.y) / v19; |
13848 uWb = v21; | 13795 uWb = v21; |
13849 if ( uZoom == 512 ) | 13796 if ( uZoom == 512 ) |
13850 { | 13797 { |
13851 v20 = v20 - (double)(uZc / 2); | 13798 v20 = v20 - (double)(uWidth / 2); |
13852 v22 = (double)(v6 / 2); | 13799 v22 = (double)(uHeight / 2); |
13853 } | 13800 } |
13854 else | 13801 else |
13855 { | 13802 { |
13856 if ( uZoom == 1024 ) | 13803 if ( uZoom == 1024 ) |
13857 { | 13804 { |
13858 v20 = v20 - (double)(uZc / 4); | 13805 v20 = v20 - (double)(uWidth / 4); |
13859 v22 = (double)(v6 / 4); | 13806 v22 = (double)(uHeight / 4); |
13860 } | 13807 } |
13861 else | 13808 else |
13862 { | 13809 { |
13863 if ( uZoom != 2048 ) | 13810 if ( uZoom != 2048 ) |
13864 goto LABEL_37; | 13811 goto LABEL_37; |
13865 v20 = v20 - (double)(uZc / 8); | 13812 v20 = v20 - (double)(uWidth / 8); |
13866 v22 = (double)(v6 / 8); | 13813 v22 = (double)(uHeight / 8); |
13867 } | 13814 } |
13868 } | 13815 } |
13869 uWb = v21 - v22; | 13816 uWb = v21 - v22; |
13870 LABEL_37: | 13817 LABEL_37: |
13871 v23 = v20 * 65536.0; | 13818 //v23 = v20 * 65536.0; |
13872 v24 = v23 + 6.7553994e15; | 13819 //v24 = v23 + 6.7553994e15; |
13873 v70 = LODWORD(v24); | 13820 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); |
13874 uWe = uWb * 65536.0; | 13821 //uWe = uWb * 65536.0; |
13875 v25 = uWe + 6.7553994e15; | 13822 //v25 = uWe + 6.7553994e15; |
13876 v78 = v70; | 13823 v78 = v70; |
13877 uBluea = LODWORD(v25); | 13824 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); |
13878 v26 = (unsigned __int16 *)_56EFD8_minimap; | 13825 v26 = (unsigned __int16 *)_56EFD8_minimap; |
13879 v27 = SLODWORD(v25) >> 16; | 13826 v27 = uBluea >> 16; |
13880 uWc = (unsigned __int16 *)_56EFD8_minimap; | 13827 uWc = (unsigned __int16 *)_56EFD8_minimap; |
13881 v28 = &pRenderer->pTargetSurface[a2 + a3 * lPitch]; | 13828 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; |
13882 if ( flags ) | 13829 if ( flags ) |
13883 { | 13830 { |
13884 if ( v74 ) | 13831 if ( v74 ) |
13885 { | 13832 { |
13886 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | 13833 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; |
13887 if ( v6 > 0 ) | 13834 if ( uHeight > 0 ) |
13888 { | 13835 { |
13889 a3a = v6; | 13836 a3a = uHeight; |
13890 v29 = v70 >> 16; | 13837 v29 = v70 >> 16; |
13891 do | 13838 do |
13892 { | 13839 { |
13893 a2b = 0; | 13840 a2b = 0; |
13894 if ( uZc > 0 ) | 13841 if ( uWidth > 0 ) |
13895 { | 13842 { |
13896 v30 = (int)&v74[v27 * v64]; | 13843 v30 = (int)&v74[v27 * v64]; |
13897 flagsa = uZc; | 13844 flagsa = uWidth; |
13898 a2b = uZc; | 13845 a2b = uWidth; |
13899 do | 13846 do |
13900 { | 13847 { |
13901 v31 = uWc; | 13848 v31 = uWc; |
13902 ++uWc; | 13849 ++uWc; |
13903 *v31 = v62[*(char *)(v30 + v29)]; | 13850 *v31 = v62[*(char *)(v30 + v29)]; |
13933 v28 += lPitch - 137; | 13880 v28 += lPitch - 137; |
13934 --uZd; | 13881 --uZd; |
13935 } | 13882 } |
13936 while ( uZd ); | 13883 while ( uZd ); |
13937 uNumBlueFacesInBLVMinimap = 0; | 13884 uNumBlueFacesInBLVMinimap = 0; |
13938 goto LABEL_50; | 13885 } |
13939 } | 13886 else |
13940 pRenderer->FillRect2(v6, a2, a3, uZ - a2, v6, 0xFu); | 13887 { |
13941 uNumBlueFacesInBLVMinimap = 0; | 13888 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); |
13942 uZa = 0; | 13889 uNumBlueFacesInBLVMinimap = 0; |
13943 if ( (signed int)pIndoor->pMapVertices->uNumVertices > 0 ) | 13890 |
13944 { | 13891 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) |
13945 a2a = 0; | 13892 { |
13946 v7 = pIndoor->pFaces; | 13893 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; |
13947 while ( 1 ) | 13894 |
13948 { | 13895 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; |
13949 v8 = (uint *)&pIndoor->pMapVertices->pVertices[a2a]; | 13896 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; |
13950 v9 = v7[LOWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes; | 13897 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; |
13951 if ( !(BYTE1(v9) & 0x20) ) | 13898 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; |
13952 { | 13899 if (pFace1->Visible() && pFace2->Visible()) |
13953 v10 = v7[HIWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes; | 13900 { |
13954 if ( !(BYTE1(v10) & 0x20) ) | 13901 v11 = pOutline->uFlags; |
13955 { | 13902 if ( v11 & 1 ) |
13956 v11 = HIWORD(pIndoor->pMapVertices[a2a + 3]); | 13903 goto LABEL_15; |
13957 if ( v11 & 1 ) | 13904 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) |
13958 goto LABEL_15; | 13905 goto LABEL_ABC; |
13959 if ( (v9 & 0x80u) != 0 || (v10 & 0x80u) != 0 ) | 13906 |
13960 break; | 13907 } |
13961 } | 13908 continue; |
13962 } | 13909 |
13963 LABEL_26: | 13910 LABEL_ABC: |
13964 ++uZa; | 13911 pOutline->uFlags = v11 | 1; |
13965 a2a += 3; | 13912 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); |
13966 if ( uZa >= (signed int)pIndoor->pMapVertices->uNumVertices ) | 13913 |
13967 goto LABEL_27; | |
13968 } | |
13969 HIWORD(pIndoor->pMapVertices[a2a + 3]) = v11 | 1; | |
13970 pIndoor->_visible_outlines[uZa >> 3] |= 1 << (7 - uZa % 8); | |
13971 v7 = pIndoor->pFaces; | |
13972 LABEL_15: | 13914 LABEL_15: |
13973 if ( v80 | 13915 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; |
13974 && v75 >= 3 | 13916 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && |
13975 && ((v12 = (int)&v7[*((short *)v8 + 2)], *(int *)(v12 + 44) & 0x2000000) | 13917 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) && |
13976 || v7[*((short *)v8 + 3)].uAttributes & 0x2000000) | 13918 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) |
13977 && (pIndoor->pFaceExtras[*(short *)(v12 + 72)].uEventID | 13919 { |
13978 || pIndoor->pFaceExtras[v7[*((short *)v8 + 3)].uFaceExtraID].uEventID) | 13920 if (uNumBlueFacesInBLVMinimap < 49) |
13979 && (v13 = uNumBlueFacesInBLVMinimap, (signed int)uNumBlueFacesInBLVMinimap < 49) ) | 13921 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; |
13980 { | |
13981 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap] = uZa; | |
13982 uNumBlueFacesInBLVMinimap = v13 + 1; | |
13983 } | 13922 } |
13984 else | 13923 else |
13985 { | 13924 { |
13986 v69 = uWidth | 13925 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); |
13987 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13926 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); |
13988 * (signed __int64)pIndoor->pVertices[*(short *)v8].x) >> 16) << 16) | 13927 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); |
13989 - uZoom * pParty->vPosition.x) >> 16); | 13928 v69 = uCenterX + _c; |
13990 lPitcha = uHeight | 13929 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
13991 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13930 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
13992 * (signed __int64)pIndoor->pVertices[*(short *)v8].y) >> 16) << 16) | 13931 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
13993 - uZoom * pParty->vPosition.z) >> 16); | 13932 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
13994 uWa = uWidth | 13933 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; |
13995 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
13996 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].x) >> 16) << 16) | |
13997 - uZoom * pParty->vPosition.x) >> 16); | |
13998 v14 = uHeight | |
13999 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
14000 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].y) >> 16) << 16) | |
14001 - uZoom * pParty->vPosition.z) >> 16); | |
14002 v15 = abs(*((short *)v8 + 4) - pParty->vPosition.y) / 8; | |
14003 if ( v15 > 100 ) | 13934 if ( v15 > 100 ) |
14004 v15 = 100; | 13935 v15 = 100; |
14005 pRenderer->FillRect(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); | 13936 pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); |
14006 v7 = pIndoor->pFaces; | 13937 } |
14007 } | 13938 } |
14008 goto LABEL_26; | 13939 |
14009 } | 13940 |
14010 LABEL_27: | 13941 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) |
14011 for ( uZb = 0; uZb < (signed int)uNumBlueFacesInBLVMinimap; ++uZb ) | 13942 { |
14012 { | 13943 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; |
14013 v16 = (uint *)&pIndoor->pMapVertices->pVertices[3 * pBlueFacesInBLVMinimapIDs[uZb]]; | 13944 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; |
14014 pRenderer->FillRect( | 13945 pRenderer->Line2D( |
14015 uWidth | 13946 uCenterX |
14016 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13947 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
14017 * (signed __int64)pIndoor->pVertices[*(short *)v16].x) >> 16) << 16) | 13948 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) |
14018 - uZoom * pParty->vPosition.x) >> 16), | 13949 - uZoom * pParty->vPosition.x) >> 16), |
14019 uHeight | 13950 uCenterY |
14020 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13951 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
14021 * (signed __int64)pIndoor->pVertices[*(short *)v16].y) >> 16) << 16) | 13952 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) |
14022 - uZoom * pParty->vPosition.z) >> 16), | 13953 - uZoom * pParty->vPosition.y) >> 16), |
14023 uWidth | 13954 uCenterX |
14024 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13955 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
14025 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].x) >> 16) << 16) | 13956 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) |
14026 - uZoom * pParty->vPosition.x) >> 16), | 13957 - uZoom * pParty->vPosition.x) >> 16), |
14027 uHeight | 13958 uCenterY |
14028 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 13959 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
14029 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].y) >> 16) << 16) | 13960 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) |
14030 - uZoom * pParty->vPosition.z) >> 16), | 13961 - uZoom * pParty->vPosition.y) >> 16), |
14031 uBlue); | 13962 uBlue); |
14032 } | 13963 } |
14033 LABEL_50: | 13964 } |
13965 | |
13966 | |
13967 //_draw_party_arrow: | |
14034 v33 = 0; | 13968 v33 = 0; |
14035 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask; | 13969 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask; |
14036 v35 = 0; | 13970 v35 = 0; |
14037 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 ) | 13971 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 ) |
14038 goto LABEL_66; | 13972 goto LABEL_66; |
14080 v57 = 2; | 14014 v57 = 2; |
14081 } | 14015 } |
14082 v35 = v57; | 14016 v35 = v57; |
14083 LABEL_66: | 14017 LABEL_66: |
14084 pRenderer->DrawTextureTransparent( | 14018 pRenderer->DrawTextureTransparent( |
14085 uWidth - 3, | 14019 uCenterX - 3, |
14086 uHeight - 3, | 14020 uCenterY - 3, |
14087 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0)); | 14021 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0)); |
14088 v36 = 255; | 14022 v36 = 255; |
14089 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); | 14023 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); |
14090 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); | 14024 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); |
14091 if ( v80 ) | 14025 if ( bWizardEyeActive ) |
14092 { | 14026 { |
14093 uZe = 0; | 14027 uZe = 0; |
14094 if ( (signed int)uNumLayingItems > 0 ) | 14028 //for (uint i = 0; i < uNumLayingItems; ++i) |
14029 if (uNumLayingItems > 0) | |
14095 { | 14030 { |
14096 a2c = (char *)&pLayingItems[0].uObjectDescID; | 14031 a2c = (char *)&pLayingItems[0].uObjectDescID; |
14097 while ( 1 ) | 14032 while ( 1 ) |
14098 { | 14033 { |
14099 if ( !*((short *)a2c - 1) | 14034 if ( !*((short *)a2c - 1) |
14100 || !*(short *)a2c | 14035 || !*(short *)a2c |
14101 || v75 == 1 | 14036 || uWizardEyeSkillLevel == 1 |
14102 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | 14037 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) |
14103 + uWidth, | 14038 + uCenterX, |
14104 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16, | 14039 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16, |
14105 v38 = uHeight - v79, | 14040 v38 = uCenterY - v79, |
14106 v37 < pRenderer->field_1C_clipx) | 14041 v37 < pRenderer->field_1C_clipx) |
14107 || v37 > pRenderer->field_24_clipz | 14042 || v37 > pRenderer->field_24_clipz |
14108 || v38 < pRenderer->field_20_clipy | 14043 || v38 < pRenderer->field_20_clipy |
14109 || v38 > pRenderer->field_28_clipw ) | 14044 || v38 > pRenderer->field_28_clipw ) |
14110 goto LABEL_83; | 14045 goto LABEL_83; |
14111 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 ) | 14046 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 ) |
14112 break; | 14047 break; |
14113 if ( (signed int)uZoom > 512 ) | 14048 if ( (signed int)uZoom > 512 ) |
14114 { | 14049 { |
14115 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); | 14050 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); |
14116 pRenderer->FillRect(v37, v38 - 2, v37, v38 + 1, flagsb); | 14051 pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb); |
14117 pRenderer->FillRect(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); | 14052 pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); |
14118 pRenderer->FillRect(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); | 14053 pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); |
14119 v37 += 2; | 14054 v37 += 2; |
14120 v58 = flagsb; | 14055 v58 = flagsb; |
14121 v55 = v38 + 1; | 14056 v55 = v38 + 1; |
14122 goto LABEL_81; | 14057 goto LABEL_81; |
14123 } | 14058 } |
14124 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, uHeight - v79, flagsb); | 14059 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb); |
14125 v58 = flagsb; | 14060 v58 = flagsb; |
14126 v55 = uHeight - v79; | 14061 v55 = uCenterY - v79; |
14127 v53 = v37; | 14062 v53 = v37; |
14128 v51 = v38 - 1; | 14063 v51 = v38 - 1; |
14129 LABEL_82: | 14064 LABEL_82: |
14130 pRenderer->FillRect(v37, v51, v53, v55, v58); | 14065 pRenderer->Line2D(v37, v51, v53, v55, v58); |
14131 LABEL_83: | 14066 LABEL_83: |
14132 ++uZe; | 14067 ++uZe; |
14133 a2c += 112; | 14068 a2c += 112; |
14134 if ( uZe >= (signed int)uNumLayingItems ) | 14069 if ( uZe >= (signed int)uNumLayingItems ) |
14135 { | 14070 { |
14137 v33 = 0; | 14072 v33 = 0; |
14138 goto LABEL_85; | 14073 goto LABEL_85; |
14139 } | 14074 } |
14140 } | 14075 } |
14141 v58 = v60; | 14076 v58 = v60; |
14142 v55 = uHeight - v79; | 14077 v55 = uCenterY - v79; |
14143 LABEL_81: | 14078 LABEL_81: |
14144 v53 = v37; | 14079 v53 = v37; |
14145 v51 = uHeight - v79; | 14080 v51 = uCenterY - v79; |
14146 goto LABEL_82; | 14081 goto LABEL_82; |
14147 } | 14082 } |
14148 LABEL_85: | 14083 LABEL_85: |
14149 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33); | 14084 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33); |
14150 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33); | 14085 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33); |
14158 v39 = *(short *)flagsc; | 14093 v39 = *(short *)flagsc; |
14159 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) ) | 14094 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) ) |
14160 { | 14095 { |
14161 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x) | 14096 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x) |
14162 * (signed __int64)(signed int)uZoom) >> 16) | 14097 * (signed __int64)(signed int)uZoom) >> 16) |
14163 + uWidth; | 14098 + uCenterX; |
14164 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.z) | 14099 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.y) |
14165 * (signed __int64)(signed int)uZoom) >> 16; | 14100 * (signed __int64)(signed int)uZoom) >> 16; |
14166 v41 = uHeight - v76; | 14101 v41 = uCenterY - v76; |
14167 if ( v40 >= pRenderer->field_1C_clipx ) | 14102 if ( v40 >= pRenderer->field_1C_clipx ) |
14168 { | 14103 { |
14169 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw ) | 14104 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw ) |
14170 { | 14105 { |
14171 uWd = v61; | 14106 uWd = v61; |
14173 uWd = v63; | 14108 uWd = v63; |
14174 if ( *(short *)flagsc == 5 ) | 14109 if ( *(short *)flagsc == 5 ) |
14175 uWd = v65; | 14110 uWd = v65; |
14176 if ( (signed int)uZoom > 1024 ) | 14111 if ( (signed int)uZoom > 1024 ) |
14177 { | 14112 { |
14178 pRenderer->FillRect(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); | 14113 pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); |
14179 pRenderer->FillRect(v40, v41 - 2, v40, v41 + 2, uWd); | 14114 pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd); |
14180 pRenderer->FillRect(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); | 14115 pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); |
14181 v42 = v41 + 1; | 14116 v42 = v41 + 1; |
14182 v43 = v41 - 1; | 14117 v43 = v41 - 1; |
14183 v44 = v42; | 14118 v44 = v42; |
14184 pRenderer->FillRect(v40 - 2, v43, v40 - 2, v42, uWd); | 14119 pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd); |
14185 v40 += 2; | 14120 v40 += 2; |
14186 v59 = uWd; | 14121 v59 = uWd; |
14187 v56 = v44; | 14122 v56 = v44; |
14188 v54 = v40; | 14123 v54 = v40; |
14189 v52 = v43; | 14124 v52 = v43; |
14190 } | 14125 } |
14191 else | 14126 else |
14192 { | 14127 { |
14193 pRenderer->FillRect(v40 - 1, v41 - 1, v40 - 1, uHeight - v76, uWd); | 14128 pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); |
14194 v59 = uWd; | 14129 v59 = uWd; |
14195 v56 = uHeight - v76; | 14130 v56 = uCenterY - v76; |
14196 v54 = v40; | 14131 v54 = v40; |
14197 v52 = v41 - 1; | 14132 v52 = v41 - 1; |
14198 } | 14133 } |
14199 pRenderer->FillRect(v40, v52, v54, v56, v59); | 14134 pRenderer->Line2D(v40, v52, v54, v56, v59); |
14200 } | 14135 } |
14201 } | 14136 } |
14202 } | 14137 } |
14203 ++uZf; | 14138 ++uZf; |
14204 flagsc += 836; | 14139 flagsc += 836; |
14217 do | 14152 do |
14218 { | 14153 { |
14219 if ( *(v45 - 2) & 8 ) | 14154 if ( *(v45 - 2) & 8 ) |
14220 { | 14155 { |
14221 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | 14156 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) |
14222 + uWidth; | 14157 + uCenterX; |
14223 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16; | 14158 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; |
14224 v47 = uHeight - v77; | 14159 v47 = uCenterY - v77; |
14225 if ( v46 >= pRenderer->field_1C_clipx ) | 14160 if ( v46 >= pRenderer->field_1C_clipx ) |
14226 { | 14161 { |
14227 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw ) | 14162 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw ) |
14228 { | 14163 { |
14229 if ( (signed int)uZoom > 512 ) | 14164 if ( (signed int)uZoom > 512 ) |
14230 { | 14165 { |
14231 v48 = v47 + 1; | 14166 v48 = v47 + 1; |
14232 v49 = v47 - 1; | 14167 v49 = v47 - 1; |
14233 pRenderer->FillRect(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); | 14168 pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); |
14234 pRenderer->FillRect(v46, v49, v46, v48, flagsd); | 14169 pRenderer->Line2D(v46, v49, v46, v48, flagsd); |
14235 pRenderer->FillRect(v46 + 1, v49, v46 + 1, v48, flagsd); | 14170 pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd); |
14236 v45 = lPitchb; | 14171 v45 = lPitchb; |
14237 } | 14172 } |
14238 else | 14173 else |
14239 { | 14174 { |
14240 pRenderer->FillRect(v46, uHeight - v77, v46, uHeight - v77, flagsd); | 14175 pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd); |
14241 } | 14176 } |
14242 } | 14177 } |
14243 } | 14178 } |
14244 } | 14179 } |
14245 ++uZg; | 14180 ++uZg; |
14250 v33 = 0; | 14185 v33 = 0; |
14251 } | 14186 } |
14252 pRenderer->DrawTextureTransparent( | 14187 pRenderer->DrawTextureTransparent( |
14253 0x1D4u, | 14188 0x1D4u, |
14254 v33, | 14189 v33, |
14255 (Texture *)(dword_5079D8 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079D8] : 0)); | 14190 (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0)); |
14256 uZooma = (double)pParty->sRotationY * 0.1171875; | 14191 uZooma = (double)pParty->sRotationY * 0.1171875; |
14257 v50 = uZooma + 6.7553994e15; | 14192 v50 = uZooma + 6.7553994e15; |
14258 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u); | 14193 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u); |
14259 pRenderer->DrawTextureIndexed( | 14194 pRenderer->DrawTextureIndexed( |
14260 LODWORD(v50) + 285, | 14195 LODWORD(v50) + 285, |
14261 0x88u, | 14196 0x88u, |
14262 (Texture *)(dword_5079B4 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079B4] : 0)); | 14197 (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0)); |
14263 pRenderer->ResetClip(); | 14198 pRenderer->ResetClip(); |
14264 } | 14199 } |
14265 | 14200 |
14266 | 14201 |
14267 //----- (00442955) -------------------------------------------------------- | 14202 //----- (00442955) -------------------------------------------------------- |
14479 goto LABEL_23; | 14414 goto LABEL_23; |
14480 v5 = viewparams->field_2C - 34; | 14415 v5 = viewparams->field_2C - 34; |
14481 LABEL_8: | 14416 LABEL_8: |
14482 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); | 14417 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); |
14483 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); | 14418 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); |
14484 v7 = (uint *)pIndoor->pMapVertices; | 14419 v7 = (uint *)pIndoor->pMapOutlines; |
14485 uNumBlueFacesInBLVMinimap = 0; | 14420 uNumBlueFacesInBLVMinimap = 0; |
14486 v8 = pIndoor->pMapVertices->uNumVertices == 0; | 14421 v8 = pIndoor->pMapOutlines->uNumOutlines == 0; |
14487 v9 = (pIndoor->pMapVertices->uNumVertices & 0x80000000u) != 0; | 14422 v9 = (pIndoor->pMapOutlines->uNumOutlines & 0x80000000u) != 0; |
14488 v94 = 0; | 14423 v94 = 0; |
14489 if ( !(v9 | v8) ) | 14424 if ( !(v9 | v8) ) |
14490 { | 14425 { |
14491 i = 0; | 14426 i = 0; |
14492 do | 14427 do |
14519 v97 = (const void *)v20; | 14454 v97 = (const void *)v20; |
14520 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16; | 14455 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16; |
14521 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16; | 14456 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16; |
14522 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16); | 14457 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16); |
14523 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16; | 14458 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16; |
14524 pRenderer->FillRect( | 14459 pRenderer->Line2D( |
14525 v85 + v88, | 14460 v85 + v88, |
14526 v90 - v87, | 14461 v90 - v87, |
14527 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), | 14462 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), |
14528 v90 - v92, | 14463 v90 - v92, |
14529 black); | 14464 black); |
14530 v7 = (uint *)pIndoor->pMapVertices; | 14465 v7 = (uint *)pIndoor->pMapOutlines; |
14531 LABEL_17: | 14466 LABEL_17: |
14532 ++v94; | 14467 ++v94; |
14533 i += 12; | 14468 i += 12; |
14534 } | 14469 } |
14535 while ( (signed int)v94 < (signed int)*v7 ); | 14470 while ( (signed int)v94 < (signed int)*v7 ); |
14553 v97 = (const void *)v29; | 14488 v97 = (const void *)v29; |
14554 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16; | 14489 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16; |
14555 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16; | 14490 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16; |
14556 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16; | 14491 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16; |
14557 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16; | 14492 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16; |
14558 pRenderer->FillRect( | 14493 pRenderer->Line2D( |
14559 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16), | 14494 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16), |
14560 v90 - v88, | 14495 v90 - v88, |
14561 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16), | 14496 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16), |
14562 v90 - v95, | 14497 v90 - v95, |
14563 teal); | 14498 teal); |
14564 ++v21; | 14499 ++v21; |
14565 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) | 14500 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) |
14566 break; | 14501 break; |
14567 v7 = (uint *)pIndoor->pMapVertices; | 14502 v7 = (uint *)pIndoor->pMapOutlines; |
14568 } | 14503 } |
14569 v6 = v86; | 14504 v6 = v86; |
14570 } | 14505 } |
14571 LABEL_38: | 14506 LABEL_38: |
14572 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3; | 14507 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3; |
14573 v81 = pParty->vPosition.z - v84; | 14508 v81 = pParty->vPosition.y - v84; |
14574 v97 = (const void *)((unsigned __int64)((pParty->vPosition.z - v84) * (signed __int64)v5) >> 16); | 14509 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16); |
14575 v48 = 1; | 14510 v48 = 1; |
14576 v49 = v90 - (int)v97 - 3; | 14511 v49 = v90 - (int)v97 - 3; |
14577 if ( v47 >= (signed int)x_ ) | 14512 if ( v47 >= (signed int)x_ ) |
14578 { | 14513 { |
14579 if ( v47 > (signed int)a4 ) | 14514 if ( v47 > (signed int)a4 ) |
14684 v74 = v86; | 14619 v74 = v86; |
14685 if ( v5 > 512 ) | 14620 if ( v5 > 512 ) |
14686 { | 14621 { |
14687 v96 = v55 + 1; | 14622 v96 = v55 + 1; |
14688 black = v55 - 1; | 14623 black = v55 - 1; |
14689 pRenderer->FillRect(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86); | 14624 pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86); |
14690 pRenderer->FillRect(v54, black, v54, v96, v86); | 14625 pRenderer->Line2D(v54, black, v54, v96, v86); |
14691 ++v54; | 14626 ++v54; |
14692 v74 = v86; | 14627 v74 = v86; |
14693 v72 = v96; | 14628 v72 = v96; |
14694 v71 = v54; | 14629 v71 = v54; |
14695 v70 = black; | 14630 v70 = black; |
14698 { | 14633 { |
14699 v72 = v90 - (int)v97; | 14634 v72 = v90 - (int)v97; |
14700 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85; | 14635 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85; |
14701 v70 = v90 - (int)v97; | 14636 v70 = v90 - (int)v97; |
14702 } | 14637 } |
14703 pRenderer->FillRect(v54, v70, v71, v72, v74); | 14638 pRenderer->Line2D(v54, v70, v71, v72, v74); |
14704 } | 14639 } |
14705 } | 14640 } |
14706 } | 14641 } |
14707 ++v95; | 14642 ++v95; |
14708 result = v95; | 14643 result = v95; |
14833 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16; | 14768 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16; |
14834 this->field_2C = v1; | 14769 this->field_2C = v1; |
14835 if ( v1 < 384 ) | 14770 if ( v1 < 384 ) |
14836 this->field_2C = 384; | 14771 this->field_2C = 384; |
14837 this->sPartyPosX = pParty->vPosition.x; | 14772 this->sPartyPosX = pParty->vPosition.x; |
14838 this->sPartyPosZ = pParty->vPosition.z; | 14773 this->sPartyPosZ = pParty->vPosition.y; |
14839 return _4432E7(); | 14774 return _4432E7(); |
14840 } | 14775 } |
14841 | 14776 |
14842 //----- (00443291) -------------------------------------------------------- | 14777 //----- (00443291) -------------------------------------------------------- |
14843 int ViewingParams::_443291() | 14778 int ViewingParams::_443291() |
14851 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | 14786 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) |
14852 v2 = 3072; | 14787 v2 = 3072; |
14853 if ( v1 > v2 ) | 14788 if ( v1 > v2 ) |
14854 this->field_2C = v2; | 14789 this->field_2C = v2; |
14855 this->sPartyPosX = pParty->vPosition.x; | 14790 this->sPartyPosX = pParty->vPosition.x; |
14856 this->sPartyPosZ = pParty->vPosition.z; | 14791 this->sPartyPosZ = pParty->vPosition.y; |
14857 return _4432E7(); | 14792 return _4432E7(); |
14858 } | 14793 } |
14859 | 14794 |
14860 //----- (004432E7) -------------------------------------------------------- | 14795 //----- (004432E7) -------------------------------------------------------- |
14861 int ViewingParams::_4432E7() | 14796 int ViewingParams::_4432E7() |
14935 { | 14870 { |
14936 v16 = 0x40000000u; | 14871 v16 = 0x40000000u; |
14937 v14 = 0x40000000u; | 14872 v14 = 0x40000000u; |
14938 v17 = 0xC0000000u; | 14873 v17 = 0xC0000000u; |
14939 v15 = 0xC0000000u; | 14874 v15 = 0xC0000000u; |
14940 if ( (signed int)pIndoor->pMapVertices->uNumVertices > 0 ) | 14875 if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 ) |
14941 { | 14876 { |
14942 v2 = (__int16 *)(pIndoor->pMapVertices->pVertices); | 14877 v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines); |
14943 v11 = pIndoor->pMapVertices->uNumVertices; | 14878 v11 = pIndoor->pMapOutlines->uNumOutlines; |
14944 v12 = (uint *)pIndoor->pMapVertices->pVertices; | 14879 v12 = (uint *)pIndoor->pMapOutlines->pOutlines; |
14945 do | 14880 do |
14946 { | 14881 { |
14947 v3 = &pIndoor->pVertices[*v2]; | 14882 v3 = &pIndoor->pVertices[*v2]; |
14948 v4 = v3->x; | 14883 v4 = v3->x; |
14949 if ( (signed int)v4 < (signed int)v16 ) | 14884 if ( (signed int)v4 < (signed int)v16 ) |
15664 int v23; // [sp+20h] [bp-Ch]@1 | 15599 int v23; // [sp+20h] [bp-Ch]@1 |
15665 int v24; // [sp+24h] [bp-8h]@1 | 15600 int v24; // [sp+24h] [bp-8h]@1 |
15666 int pX; // [sp+28h] [bp-4h]@1 | 15601 int pX; // [sp+28h] [bp-4h]@1 |
15667 | 15602 |
15668 v24 = pParty->vPosition.x; | 15603 v24 = pParty->vPosition.x; |
15669 v0 = pParty->vPosition.z; | 15604 v0 = pParty->vPosition.y; |
15670 v1 = pOutdoor->uNumBModels; | 15605 v1 = pOutdoor->uNumBModels; |
15671 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789; | 15606 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789; |
15672 v2 = 0; | 15607 v2 = 0; |
15673 v18 = pOutdoor->uNumBModels; | 15608 v18 = pOutdoor->uNumBModels; |
15674 v21 = 0; | 15609 v21 = 0; |
15709 { | 15644 { |
15710 v12 = &v8[v4].pFaces[v2 / 0x134u]; | 15645 v12 = &v8[v4].pFaces[v2 / 0x134u]; |
15711 v13 = v12->sCogTriggeredID; | 15646 v13 = v12->sCogTriggeredID; |
15712 if ( v13 ) | 15647 if ( v13 ) |
15713 { | 15648 { |
15714 if ( !(BYTE2(v12->uFaceAttributes) & 0x10) ) | 15649 if ( !(BYTE2(v12->uAttributes) & 0x10) ) |
15715 { | 15650 { |
15716 v14 = _444732_GetEventHintString(v13); | 15651 v14 = _444732_GetEventHintString(v13); |
15717 v15 = v14; | 15652 v15 = v14; |
15718 if ( v14 ) | 15653 if ( v14 ) |
15719 { | 15654 { |
15720 if ( _strcmpi(v14, nullstring) ) | 15655 if ( _strcmpi(v14, "") ) |
15721 v21 = (char *)v15; | 15656 v21 = (char *)v15; |
15722 } | 15657 } |
15723 } | 15658 } |
15724 } | 15659 } |
15725 ++v24; | 15660 ++v24; |
15810 { | 15745 { |
15811 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134]; | 15746 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134]; |
15812 v12 = v11->sCogTriggeredID; | 15747 v12 = v11->sCogTriggeredID; |
15813 if ( v12 ) | 15748 if ( v12 ) |
15814 { | 15749 { |
15815 if ( !(BYTE2(v11->uFaceAttributes) & 0x10) ) | 15750 if ( !(BYTE2(v11->uAttributes) & 0x10) ) |
15816 { | 15751 { |
15817 v13 = _444732_GetEventHintString(v12); | 15752 v13 = _444732_GetEventHintString(v12); |
15818 v14 = v13; | 15753 v14 = v13; |
15819 if ( v13 ) | 15754 if ( v13 ) |
15820 { | 15755 { |
15821 if ( _strcmpi(v13, nullstring) ) | 15756 if ( _strcmpi(v13, "") ) |
15822 v17 = v14; | 15757 v17 = v14; |
15823 } | 15758 } |
15824 } | 15759 } |
15825 } | 15760 } |
15826 ++v21; | 15761 ++v21; |
15908 { | 15843 { |
15909 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?" | 15844 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?" |
15910 v1 = pTmpBuf; | 15845 v1 = pTmpBuf; |
15911 goto LABEL_12; | 15846 goto LABEL_12; |
15912 } | 15847 } |
15913 v1 = nullstring; | 15848 v1 = ""; |
15914 } | 15849 } |
15915 if ( !v1 ) | 15850 if ( !v1 ) |
15916 { | 15851 { |
15917 MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0); | 15852 MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0); |
15918 v1 = nullstring; | 15853 v1 = ""; |
15919 } | 15854 } |
15920 LABEL_12: | 15855 LABEL_12: |
15921 v7 = 3; | 15856 v7 = 3; |
15922 v6 = v1; | 15857 v6 = v1; |
15923 v5 = 0; | 15858 v5 = 0; |
15998 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1 | 15933 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1 |
15999 unsigned int v9; // [sp+80h] [bp-4h]@1 | 15934 unsigned int v9; // [sp+80h] [bp-4h]@1 |
16000 | 15935 |
16001 memcpy(&v7, pGUIWindow0, sizeof(v7)); | 15936 memcpy(&v7, pGUIWindow0, sizeof(v7)); |
16002 v9 = pMapStats->GetMapInfo(pCurrentMapName); | 15937 v9 = pMapStats->GetMapInfo(pCurrentMapName); |
16003 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.z, pDestinationMapName, 20); | 15938 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20); |
16004 v0 = pMapStats->GetMapInfo(pDestinationMapName); | 15939 v0 = pMapStats->GetMapInfo(pDestinationMapName); |
16005 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); | 15940 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); |
16006 pRenderer->DrawTextureTransparent(0x1D4u, 0, | 15941 pRenderer->DrawTextureTransparent(0x1D4u, 0, |
16007 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); | 15942 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); |
16008 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside); | 15943 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside); |
16125 pEventTimer->Pause(); | 16060 pEventTimer->Pause(); |
16126 dword_5C3418 = v4; | 16061 dword_5C3418 = v4; |
16127 dword_5C341C = v3; | 16062 dword_5C341C = v3; |
16128 _591094_decoration = _5C3420_pDecoration; | 16063 _591094_decoration = _5C3420_pDecoration; |
16129 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0); | 16064 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0); |
16130 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0); | 16065 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); |
16131 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0); | 16066 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); |
16132 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, nullstring, 0); | 16067 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); |
16133 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, nullstring, 0); | 16068 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); |
16134 } | 16069 } |
16135 } | 16070 } |
16136 | 16071 |
16137 //----- (004452BB) -------------------------------------------------------- | 16072 //----- (004452BB) -------------------------------------------------------- |
16138 void __cdecl sub_4452BB() | 16073 void __cdecl sub_4452BB() |
16381 LABEL_42: | 16316 LABEL_42: |
16382 memcpy(&v52, pDialogueWindow, sizeof(v52)); | 16317 memcpy(&v52, pDialogueWindow, sizeof(v52)); |
16383 v52.uFrameX = 483; | 16318 v52.uFrameX = 483; |
16384 v52.uFrameWidth = 148; | 16319 v52.uFrameWidth = 148; |
16385 v52.uFrameZ = 334; | 16320 v52.uFrameZ = 334; |
16386 for ( pOutString = (GUIFont *)v52.field_38; | 16321 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem; |
16387 (signed int)pOutString < v52.field_38 + v52.field_28; | 16322 (signed int)pOutString < v52.pStartingPosActiveItem + v52.pNumPresenceButton; |
16388 pOutString = (GUIFont *)((char *)pOutString + 1) ) | 16323 pOutString = (GUIFont *)((char *)pOutString + 1) ) |
16389 { | 16324 { |
16390 v14 = v52.GetControl((unsigned int)pOutString); | 16325 v14 = v52.GetControl((unsigned int)pOutString); |
16391 v15 = v14; | 16326 v15 = v14; |
16392 if ( !v14 ) | 16327 if ( !v14 ) |
16452 v23 = v0->evtf; | 16387 v23 = v0->evtf; |
16453 LABEL_63: | 16388 LABEL_63: |
16454 v24 = (&dword_721660)[8 * v23]; | 16389 v24 = (&dword_721660)[8 * v23]; |
16455 if ( !v24 ) | 16390 if ( !v24 ) |
16456 { | 16391 { |
16457 v24 = nullstring; | 16392 v24 = ""; |
16458 v15->uControlParam = 0; | 16393 v15->uControlParam = 0; |
16459 } | 16394 } |
16460 goto LABEL_79; | 16395 goto LABEL_79; |
16461 } | 16396 } |
16462 v17 = v16 - 9; | 16397 v17 = v16 - 9; |
16496 { | 16431 { |
16497 v23 = v0->evte; | 16432 v23 = v0->evte; |
16498 goto LABEL_63; | 16433 goto LABEL_63; |
16499 } | 16434 } |
16500 LABEL_71: | 16435 LABEL_71: |
16501 v24 = nullstring; | 16436 v24 = ""; |
16502 goto LABEL_79; | 16437 goto LABEL_79; |
16503 } | 16438 } |
16504 if ( v0->uFlags & 0x80 ) | 16439 if ( v0->uFlags & 0x80 ) |
16505 goto LABEL_59; | 16440 goto LABEL_59; |
16506 v24 = pGlobalTXT_LocalizationStrings[122]; | 16441 v24 = pGlobalTXT_LocalizationStrings[122]; |
16509 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 ) | 16444 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 ) |
16510 { | 16445 { |
16511 pInString = 0; | 16446 pInString = 0; |
16512 if ( (signed int)uNumActors > 0 ) | 16447 if ( (signed int)uNumActors > 0 ) |
16513 { | 16448 { |
16514 v55 = &pActors[0].uAIState; | 16449 v55 = (unsigned short *)&pActors[0].uAIState; |
16515 *(int *)v54 = uNumActors; | 16450 *(int *)v54 = uNumActors; |
16516 do | 16451 do |
16517 { | 16452 { |
16518 v30 = *v55; | 16453 v30 = *v55; |
16519 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 ) | 16454 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 ) |
16531 v32 = 0; | 16466 v32 = 0; |
16532 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); | 16467 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); |
16533 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); | 16468 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); |
16534 v34 = pDialogueWindow; | 16469 v34 = pDialogueWindow; |
16535 *(int *)v54 = v33; | 16470 *(int *)v54 = v33; |
16536 v35 = pDialogueWindow->field_38; | 16471 v35 = pDialogueWindow->pStartingPosActiveItem; |
16537 for ( i = v35 + pDialogueWindow->field_28; v35 < i; i = pDialogueWindow->field_28 + pDialogueWindow->field_38 ) | 16472 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) |
16538 { | 16473 { |
16539 v37 = v34->GetControl(v35); | 16474 v37 = v34->GetControl(v35); |
16540 if ( !v37 ) | 16475 if ( !v37 ) |
16541 { | 16476 { |
16542 v34 = pDialogueWindow; | 16477 v34 = pDialogueWindow; |
16545 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); | 16480 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0); |
16546 v34 = pDialogueWindow; | 16481 v34 = pDialogueWindow; |
16547 v32 += v38; | 16482 v32 += v38; |
16548 ++v35; | 16483 ++v35; |
16549 } | 16484 } |
16550 v39 = v34->field_28; | 16485 v39 = v34->pNumPresenceButton; |
16551 if ( v39 ) | 16486 if ( v39 ) |
16552 { | 16487 { |
16553 pOutString = (GUIFont *)((174 - v32) / v39); | 16488 pOutString = (GUIFont *)((174 - v32) / v39); |
16554 if ( (174 - v32) / v39 > 32 ) | 16489 if ( (174 - v32) / v39 > 32 ) |
16555 pOutString = (GUIFont *)32; | 16490 pOutString = (GUIFont *)32; |
16556 v55 = (unsigned __int16 *)1; | 16491 v55 = (unsigned __int16 *)1; |
16557 v40 = 174 - (int)pOutString * v39 - v32; | 16492 v40 = 174 - (int)pOutString * v39 - v32; |
16558 v41 = v34->field_38; | 16493 v41 = v34->pStartingPosActiveItem; |
16559 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; | 16494 v42 = v40 / 2 - (signed int)pOutString / 2 + 138; |
16560 if ( (signed int)v41 < (signed int)(v41 + v39) ) | 16495 if ( (signed int)v41 < (signed int)(v41 + v39) ) |
16561 { | 16496 { |
16562 do | 16497 do |
16563 { | 16498 { |
16571 v46 = v55; | 16506 v46 = v55; |
16572 v43->uHeight = v44; | 16507 v43->uHeight = v44; |
16573 v42 = v45 + v44 - 1; | 16508 v42 = v45 + v44 - 1; |
16574 v43->uW = v42; | 16509 v43->uW = v42; |
16575 v47 = v54[0]; | 16510 v47 = v54[0]; |
16576 if ( (unsigned __int16 *)pDialogueWindow->field_2C_focus_id != v46 ) | 16511 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 ) |
16577 v47 = (unsigned __int16)pInString; | 16512 v47 = (unsigned __int16)pInString; |
16578 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u); | 16513 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u); |
16579 v34 = pDialogueWindow; | 16514 v34 = pDialogueWindow; |
16580 v55 = (unsigned __int16 *)((char *)v55 + 1); | 16515 v55 = (unsigned __int16 *)((char *)v55 + 1); |
16581 ++v41; | 16516 ++v41; |
16582 } | 16517 } |
16583 while ( (signed int)v41 < pDialogueWindow->field_28 + pDialogueWindow->field_38 ); | 16518 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ); |
16584 } | 16519 } |
16585 } | 16520 } |
16586 pRenderer->DrawTextureIndexed( | 16521 pRenderer->DrawTextureIndexed( |
16587 0x1D7u, | 16522 0x1D7u, |
16588 0x1BDu, | 16523 0x1BDu, |
17206 //v124 = 0; | 17141 //v124 = 0; |
17207 for (uint i = 0; i < uSomeEVT_NumEvents; ++i) | 17142 for (uint i = 0; i < uSomeEVT_NumEvents; ++i) |
17208 { | 17143 { |
17209 //v5 = pSomeEVT; | 17144 //v5 = pSomeEVT; |
17210 //v6 = v123; | 17145 //v6 = v123; |
17211 //v7 = nullstring; | 17146 //v7 = ""; |
17212 //while ( 1 ) | 17147 //while ( 1 ) |
17213 //{ | 17148 //{ |
17214 if ( dword_5B65C4 ) | 17149 if ( dword_5B65C4 ) |
17215 goto LABEL_301; | 17150 goto LABEL_301; |
17216 //v8 = v4; | 17151 //v8 = v4; |
17236 pVideoPlayer->Unload(); | 17171 pVideoPlayer->Unload(); |
17237 pVideoPlayer->bStopBeforeSchedule = 0; | 17172 pVideoPlayer->bStopBeforeSchedule = 0; |
17238 pVideoPlayer->field_40 = 0; | 17173 pVideoPlayer->field_40 = 0; |
17239 if (pAsyncMouse) | 17174 if (pAsyncMouse) |
17240 pAsyncMouse->Suspend(); | 17175 pAsyncMouse->Suspend(); |
17241 v128 = uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; | 17176 v128 = pCurrentScreen; |
17242 //v13 = &pSomeEVT[v9]; | 17177 //v13 = &pSomeEVT[v9]; |
17243 //v14 = (unsigned __int8)v13[5]; | 17178 //v14 = (unsigned __int8)v13[5]; |
17244 //v15 = (unsigned __int8)v13[6]; | 17179 //v15 = (unsigned __int8)v13[6]; |
17245 v14 = _evt->v5; | 17180 v14 = _evt->v5; |
17246 v15 = _evt->v6; | 17181 v15 = _evt->v6; |
17269 pParty->field_764 = 0; | 17204 pParty->field_764 = 0; |
17270 } | 17205 } |
17271 LABEL_28: | 17206 LABEL_28: |
17272 if ( !v15 || v128 == 3 ) | 17207 if ( !v15 || v128 == 3 ) |
17273 { | 17208 { |
17274 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = v128; | 17209 pCurrentScreen = v128; |
17275 if ( v128 == 3 ) | 17210 if ( v128 == 3 ) |
17276 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; | 17211 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; |
17277 if ( v128 == 13 ) | 17212 if ( v128 == 13 ) |
17278 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); | 17213 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u); |
17279 } | 17214 } |
17571 LABEL_291: | 17506 LABEL_291: |
17572 ++v122; | 17507 ++v122; |
17573 //v4 = v124; | 17508 //v4 = v124; |
17574 //v5 = pSomeEVT; | 17509 //v5 = pSomeEVT; |
17575 //v6 = v123; | 17510 //v6 = v123; |
17576 //v7 = nullstring; | 17511 //v7 = ""; |
17577 break; | 17512 break; |
17578 case EVENT_CharacterAnimation: | 17513 case EVENT_CharacterAnimation: |
17579 v54 = _evt->v5; | 17514 v54 = _evt->v5; |
17580 if ( (unsigned __int8)v54 <= 3u ) | 17515 if ( (unsigned __int8)v54 <= 3u ) |
17581 { | 17516 { |
18138 if ( *v99 == 48 ) | 18073 if ( *v99 == 48 ) |
18139 { | 18074 { |
18140 if ( v100 ) | 18075 if ( v100 ) |
18141 { | 18076 { |
18142 pParty->vPosition.x = v135; | 18077 pParty->vPosition.x = v135; |
18143 pParty->vPosition.z = v132; | 18078 pParty->vPosition.y = v132; |
18144 pParty->vPosition.y = v126; | 18079 pParty->vPosition.z = v126; |
18145 pParty->uFallStartY = v126; | 18080 pParty->uFallStartY = v126; |
18146 if ( _5B65B4_npcdata_loword_house_or_other != -1 ) | 18081 if ( _5B65B4_npcdata_loword_house_or_other != -1 ) |
18147 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other; | 18082 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other; |
18148 _5B65B4_npcdata_loword_house_or_other = -1; | 18083 _5B65B4_npcdata_loword_house_or_other = -1; |
18149 v120 = 0; | 18084 v120 = 0; |
18169 else | 18104 else |
18170 { | 18105 { |
18171 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1); | 18106 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1); |
18172 sub_44987B(v99, 0); | 18107 sub_44987B(v99, 0); |
18173 v133 = 1; | 18108 v133 = 1; |
18174 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 13 ) | 18109 if ( pCurrentScreen == 13 ) |
18175 { | 18110 { |
18176 if ( uGameState == 2 ) | 18111 if ( uGameState == 2 ) |
18177 { | 18112 { |
18178 pAudioPlayer->StopChannels(-1, -1); | 18113 pAudioPlayer->StopChannels(-1, -1); |
18179 dword_F8B19C = 0; | 18114 dword_F8B19C = 0; |
18182 pVideoPlayer->Unload(); | 18117 pVideoPlayer->Unload(); |
18183 ptr_507BC0->Release(); | 18118 ptr_507BC0->Release(); |
18184 ptr_507BC0 = 0; | 18119 ptr_507BC0 = 0; |
18185 if ( pMessageQueue_50CBD0->uNumMessages ) | 18120 if ( pMessageQueue_50CBD0->uNumMessages ) |
18186 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 18121 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
18187 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; | 18122 pCurrentScreen = 0; |
18188 viewparams->bRedrawGameUI = 1; | 18123 viewparams->bRedrawGameUI = 1; |
18189 array_5913D8[6] = 0; | 18124 array_5913D8[6] = 0; |
18190 pDialogueWindow->Release(); | 18125 pDialogueWindow->Release(); |
18191 dword_F8B19C = 0; | 18126 dword_F8B19C = 0; |
18192 pDialogueWindow = 0; | 18127 pDialogueWindow = 0; |
18342 do | 18277 do |
18343 { | 18278 { |
18344 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4)); | 18279 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4)); |
18345 if ( v10->sCogNumber == v14 ) | 18280 if ( v10->sCogNumber == v14 ) |
18346 { | 18281 { |
18347 if ( BYTE1(v10->uFaceAttributes) & 0x40 ) | 18282 if ( BYTE1(v10->uAttributes) & 0x40 ) |
18348 { | 18283 { |
18349 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName( | 18284 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName( |
18350 Str2); | 18285 Str2); |
18351 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272); | 18286 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272); |
18352 if ( *(_WORD *)v11 ) | 18287 if ( *(_WORD *)v11 ) |
18509 { | 18444 { |
18510 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4)); | 18445 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4)); |
18511 if ( v9->sCogNumber == v10 ) | 18446 if ( v9->sCogNumber == v10 ) |
18512 { | 18447 { |
18513 if ( on ) | 18448 if ( on ) |
18514 v9->uFaceAttributes |= bit; | 18449 v9->uAttributes |= bit; |
18515 else | 18450 else |
18516 v9->uFaceAttributes &= ~bit; | 18451 v9->uAttributes &= ~bit; |
18517 } | 18452 } |
18518 ++v8; | 18453 ++v8; |
18519 v6 += 308; | 18454 v6 += 308; |
18520 } | 18455 } |
18521 while ( v8 < *((_DWORD *)v7 + 2) ); | 18456 while ( v8 < *((_DWORD *)v7 + 2) ); |
18547 } | 18482 } |
18548 | 18483 |
18549 //----- (00448A40) -------------------------------------------------------- | 18484 //----- (00448A40) -------------------------------------------------------- |
18550 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) | 18485 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) |
18551 { | 18486 { |
18552 unsigned __int16 *pState; // eax@6 | |
18553 | |
18554 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) | 18487 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) ) |
18555 { | 18488 { |
18556 if ( bToggle ) | 18489 if ( bToggle ) |
18557 { | 18490 { |
18558 pActors[uActorID].uAttributes |= uFlag; | 18491 pActors[uActorID].uAttributes |= uFlag; |
18559 } | 18492 } |
18560 else | 18493 else |
18561 { | 18494 { |
18562 if ( uFlag == 0x10000 ) | 18495 if ( uFlag == 0x10000 ) |
18563 { | 18496 { |
18564 pState = &pActors[uActorID].uAIState; | 18497 if (pActors[uActorID].uAIState == Disabled ) |
18565 if ( *pState == Disabled ) | 18498 pActors[uActorID].uAIState = Standing; |
18566 *pState = Standing; | |
18567 } | 18499 } |
18568 pActors[uActorID].uAttributes &= ~uFlag; | 18500 pActors[uActorID].uAttributes &= ~uFlag; |
18569 } | 18501 } |
18570 } | 18502 } |
18571 } | 18503 } |
18886 } | 18818 } |
18887 else | 18819 else |
18888 { | 18820 { |
18889 v10 = (double)pParty->vPosition.x - (double)fromx; | 18821 v10 = (double)pParty->vPosition.x - (double)fromx; |
18890 v53 = v10; | 18822 v53 = v10; |
18891 v11 = (double)pParty->vPosition.z - (double)fromy; | 18823 v11 = (double)pParty->vPosition.y - (double)fromy; |
18892 v54 = v11; | 18824 v54 = v11; |
18893 v12 = (double)(pParty->vPosition.y + pParty->sEyelevel); | 18825 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); |
18894 } | 18826 } |
18895 a7a = v12 - (double)fromz; | 18827 a7a = v12 - (double)fromz; |
18896 toza = v11 * v11; | 18828 toza = v11 * v11; |
18897 a8a = v10 * v10; | 18829 a8a = v10 * v10; |
18898 v13 = sqrt(a7a * a7a + a8a + toza); | 18830 v13 = sqrt(a7a * a7a + a8a + toza); |
19450 if ( v5 >= (signed int)uNumLevelDecorations ) | 19382 if ( v5 >= (signed int)uNumLevelDecorations ) |
19451 goto LABEL_20; | 19383 goto LABEL_20; |
19452 } | 19384 } |
19453 v7 = v5; | 19385 v7 = v5; |
19454 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x; | 19386 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x; |
19455 pParty->vPosition.z = pLevelDecorations[v7].vPosition.y; | 19387 pParty->vPosition.y = pLevelDecorations[v7].vPosition.y; |
19456 pParty->vPosition.y = pLevelDecorations[v7].vPosition.z; | 19388 pParty->vPosition.z = pLevelDecorations[v7].vPosition.z; |
19457 pParty->uFallStartY = pParty->vPosition.y; | 19389 pParty->uFallStartY = pParty->vPosition.z; |
19458 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90; | 19390 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90; |
19459 v9 = pLevelDecorations[v7].field_10_y_rot; | 19391 v9 = pLevelDecorations[v7].field_10_y_rot; |
19460 pParty->sRotationY = v8; | 19392 pParty->sRotationY = v8; |
19461 if ( v9 ) | 19393 if ( v9 ) |
19462 pParty->sRotationY = v9; | 19394 pParty->sRotationY = v9; |
19467 if ( dword_5B65C0 ) | 19399 if ( dword_5B65C0 ) |
19468 { | 19400 { |
19469 if ( _5B65A8_npcdata_uflags_or_other ) | 19401 if ( _5B65A8_npcdata_uflags_or_other ) |
19470 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other; | 19402 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other; |
19471 if ( _5B65AC_npcdata_fame_or_other ) | 19403 if ( _5B65AC_npcdata_fame_or_other ) |
19472 pParty->vPosition.z = _5B65AC_npcdata_fame_or_other; | 19404 pParty->vPosition.y = _5B65AC_npcdata_fame_or_other; |
19473 if ( _5B65B0_npcdata_rep_or_other ) | 19405 if ( _5B65B0_npcdata_rep_or_other ) |
19474 { | 19406 { |
19475 pParty->vPosition.y = _5B65B0_npcdata_rep_or_other; | 19407 pParty->vPosition.z = _5B65B0_npcdata_rep_or_other; |
19476 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other; | 19408 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other; |
19477 } | 19409 } |
19478 if ( _5B65B4_npcdata_loword_house_or_other ) | 19410 if ( _5B65B4_npcdata_loword_house_or_other ) |
19479 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other; | 19411 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other; |
19480 if ( _5B65B8_npcdata_hiword_house_or_other ) | 19412 if ( _5B65B8_npcdata_hiword_house_or_other ) |
19686 _5B65B8_npcdata_hiword_house_or_other = 0; | 19618 _5B65B8_npcdata_hiword_house_or_other = 0; |
19687 dword_5B65BC = 0; | 19619 dword_5B65BC = 0; |
19688 dword_5B65C0 = 0; | 19620 dword_5B65C0 = 0; |
19689 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; | 19621 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen; |
19690 sub_44987B("nwc.blv", 0); | 19622 sub_44987B("nwc.blv", 0); |
19691 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0; | 19623 pCurrentScreen = 0; |
19692 result = 1; | 19624 result = 1; |
19693 } | 19625 } |
19694 return result; | 19626 return result; |
19695 } | 19627 } |
19696 | 19628 |
20016 do | 19948 do |
20017 { | 19949 { |
20018 *(char *)(v0 + 1) &= 0xFBu; | 19950 *(char *)(v0 + 1) &= 0xFBu; |
20019 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() ) | 19951 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() ) |
20020 goto LABEL_37; | 19952 goto LABEL_37; |
20021 v22 = abs(pParty->vPosition.y - *(short *)(v0 + 110)); | 19953 v22 = abs(pParty->vPosition.z - *(short *)(v0 + 110)); |
20022 v21 = abs(pParty->vPosition.z - *(short *)(v0 + 108)); | 19954 v21 = abs(pParty->vPosition.y - *(short *)(v0 + 108)); |
20023 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106)); | 19955 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106)); |
20024 v2 = v21; | 19956 v2 = v21; |
20025 v3 = v22; | 19957 v3 = v22; |
20026 if ( v1 < v21 ) | 19958 if ( v1 < v21 ) |
20027 { | 19959 { |
20174 signed int v43; // [sp+1Ch] [bp-8h]@1 | 20106 signed int v43; // [sp+1Ch] [bp-8h]@1 |
20175 signed int v44; // [sp+1Ch] [bp-8h]@25 | 20107 signed int v44; // [sp+1Ch] [bp-8h]@25 |
20176 int v45; // [sp+20h] [bp-4h]@1 | 20108 int v45; // [sp+20h] [bp-4h]@1 |
20177 | 20109 |
20178 pParty->uFlags &= 0xFFFFFFCFu; | 20110 pParty->uFlags &= 0xFFFFFFCFu; |
20179 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y); | 20111 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
20180 v45 = 0; | 20112 v45 = 0; |
20181 v43 = 0; | 20113 v43 = 0; |
20182 if ( (signed int)uNumActors > 0 ) | 20114 if ( (signed int)uNumActors > 0 ) |
20183 { | 20115 { |
20184 v0 = (char *)&pActors[0].uAttributes; | 20116 v0 = (char *)&pActors[0].uAttributes; |
20185 do | 20117 do |
20186 { | 20118 { |
20187 v0[1] &= 0xFBu; | 20119 v0[1] &= 0xFBu; |
20188 if ( ! ((Actor *)(v0 - 36))->CanAct() ) | 20120 if ( ! ((Actor *)(v0 - 36))->CanAct() ) |
20189 goto LABEL_60; | 20121 goto LABEL_60; |
20190 v39 = abs(pParty->vPosition.y - *((short *)v0 + 55)); | 20122 v39 = abs(pParty->vPosition.z - *((short *)v0 + 55)); |
20191 v38 = abs(pParty->vPosition.z - *((short *)v0 + 54)); | 20123 v38 = abs(pParty->vPosition.y - *((short *)v0 + 54)); |
20192 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53)); | 20124 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53)); |
20193 v2 = v38; | 20125 v2 = v38; |
20194 v3 = v39; | 20126 v3 = v39; |
20195 if ( v1 < v38 ) | 20127 if ( v1 < v38 ) |
20196 { | 20128 { |
20614 if ( v19 != 17 ) | 20546 if ( v19 != 17 ) |
20615 { | 20547 { |
20616 Actor::_403F58(uActorID, Dying, 256, 0); | 20548 Actor::_403F58(uActorID, Dying, 256, 0); |
20617 goto LABEL_78; | 20549 goto LABEL_78; |
20618 } | 20550 } |
20619 pActor->uAIState = 0; | 20551 pActor->uAIState = Standing; |
20620 } | 20552 } |
20621 pActor->uCurrentActionTime = 0; | 20553 pActor->uCurrentActionTime = 0; |
20622 pActor->uCurrentActionLength = 0; | 20554 pActor->uCurrentActionLength = 0; |
20623 pActor->UpdateAnimation(); | 20555 pActor->UpdateAnimation(); |
20624 LABEL_78: | 20556 LABEL_78: |
20699 if ( v81 != v24 | 20631 if ( v81 != v24 |
20700 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24 | 20632 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24 |
20701 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24 | 20633 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24 |
20702 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) ) | 20634 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) ) |
20703 { | 20635 { |
20704 v21->uAIState = 11; | 20636 v21->uAIState = Removed; |
20705 goto LABEL_254; | 20637 goto LABEL_254; |
20706 } | 20638 } |
20707 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime ) | 20639 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime ) |
20708 goto LABEL_254; | 20640 goto LABEL_254; |
20709 v27 = pMiscTimer->uTimeElapsed; | 20641 v27 = pMiscTimer->uTimeElapsed; |
21099 | 21031 |
21100 | 21032 |
21101 //----- (00402CAE) -------------------------------------------------------- | 21033 //----- (00402CAE) -------------------------------------------------------- |
21102 int stru193_math::SinCos(int angle) | 21034 int stru193_math::SinCos(int angle) |
21103 { | 21035 { |
21104 unsigned int v2; // edx@1 | 21036 int v2; // eax@1 |
21105 unsigned int v3; // eax@1 | 21037 |
21106 int result; // eax@4 | 21038 //a2: (angle - uIntegerHalfPi) for sin(angle) |
21107 | 21039 // (angle) for cos(angle) |
21108 v2 = this->uIntegerPi; | 21040 |
21109 v3 = this->uDoublePiMask & angle; | 21041 v2 = uDoublePiMask & angle; |
21110 if ( (signed int)v3 > (signed int)v2 ) | 21042 |
21111 v3 = this->uIntegerDoublePi - v3; | 21043 if ( v2 > uIntegerPi ) |
21112 if ( (signed int)v3 >= (signed int)this->uIntegerHalfPi ) | 21044 v2 = uIntegerDoublePi - v2; |
21113 result = -this->pCosTable[v2 - v3]; | 21045 if ( v2 >= uIntegerHalfPi ) |
21046 return -pCosTable[uIntegerPi - v2]; | |
21114 else | 21047 else |
21115 result = this->pCosTable[v3]; | 21048 return pCosTable[v2]; |
21116 return result; | |
21117 } | 21049 } |
21118 | 21050 |
21119 | 21051 |
21120 | 21052 |
21121 | 21053 |
21267 } | 21199 } |
21268 return result; | 21200 return result; |
21269 } | 21201 } |
21270 | 21202 |
21271 //----- (0040471C) -------------------------------------------------------- | 21203 //----- (0040471C) -------------------------------------------------------- |
21272 int stru262_TurnBased::_40471C() | 21204 void stru262_TurnBased::_40471C() |
21273 { | 21205 { |
21274 int result; // eax@3 | |
21275 | |
21276 if ( pParty->bTurnBasedModeOn == 1 ) | 21206 if ( pParty->bTurnBasedModeOn == 1 ) |
21277 { | 21207 { |
21278 if ( pTurnEngine->field_4 == 2 ) | 21208 if ( pTurnEngine->field_4 == 2 ) |
21279 result = _406457(0); | 21209 _406457(0); |
21280 } | 21210 } |
21281 return result; | |
21282 } | 21211 } |
21283 | 21212 |
21284 | 21213 |
21285 //----- (00404828) -------------------------------------------------------- | 21214 //----- (00404828) -------------------------------------------------------- |
21286 LayingItem::LayingItem() | 21215 LayingItem::LayingItem() |