Mercurial > mm7
comparison mm7_1.cpp @ 676:ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
author | Nomad |
---|---|
date | Fri, 15 Mar 2013 04:13:24 +0200 |
parents | 1ff57450f090 |
children | 26dfde53decd |
comparison
equal
deleted
inserted
replaced
675:92c1e1250e7c | 676:ecfb1b3c9a39 |
---|---|
5824 dword_50B700 = 1; | 5824 dword_50B700 = 1; |
5825 } | 5825 } |
5826 else | 5826 else |
5827 { | 5827 { |
5828 dword_50B700 = 0; | 5828 dword_50B700 = 0; |
5829 if ( !v1->TwoSided() ) | 5829 if ( !v1->Portal() ) |
5830 return 0; | 5830 return 0; |
5831 } | 5831 } |
5832 //v66 = v1->uNumVertices; | 5832 //v66 = v1->uNumVertices; |
5833 for (uint i = 0; i < v1->uNumVertices; ++i) | 5833 for (uint i = 0; i < v1->uNumVertices; ++i) |
5834 { | 5834 { |
6120 else | 6120 else |
6121 { | 6121 { |
6122 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); | 6122 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); |
6123 v59 = dword_50BAD4[v57]; | 6123 v59 = dword_50BAD4[v57]; |
6124 } | 6124 } |
6125 dword_50BAC8[v55] = v70 + v59; | 6125 _50BAC8_screen_space_x[v55] = v70 + v59; |
6126 v56 = pBLVRenderParams->uViewportW; | 6126 v56 = pBLVRenderParams->uViewportW; |
6127 dword_50B9D8_ys[v55] = pBLVRenderParams->uViewportW; | 6127 _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW; |
6128 ++v55; | 6128 ++v55; |
6129 } | 6129 } |
6130 if ( v85 ) | 6130 if ( v85 ) |
6131 { | 6131 { |
6132 dword_50BAC8[v55] = dword_50BAD4[v57]; | 6132 _50BAC8_screen_space_x[v55] = dword_50BAD4[v57]; |
6133 dword_50B9D8_ys[v55++] = dword_50B9E4[v57]; | 6133 _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57]; |
6134 } | 6134 } |
6135 ++ie; | 6135 ++ie; |
6136 thise = v85; | 6136 thise = v85; |
6137 } | 6137 } |
6138 while ( ie <= v48 ); | 6138 while ( ie <= v48 ); |
6139 | 6139 |
6140 if ( !v55 ) | 6140 if ( !v55 ) |
6141 return 0; | 6141 return 0; |
6142 v61 = pRenderer->pRenderD3D == 0; | 6142 v61 = pRenderer->pRenderD3D == 0; |
6143 dword_50BAC8[v55] = dword_50BAC8[0]; | 6143 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0]; |
6144 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | 6144 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
6145 if ( v61 && v55 > 3 ) | 6145 if ( v61 && v55 > 3 ) |
6146 { | 6146 { |
6147 dword_50BAC8[v55 + 1] = dword_50BAC8[1]; | 6147 _50BAC8_screen_space_x[v55 + 1] = _50BAC8_screen_space_x[1]; |
6148 dword_50B9D8_ys[v55 + 1] = dword_50B9D8_ys[1]; | 6148 _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1]; |
6149 thisf = 2 * (dword_50B700 != 0) - 1; | 6149 thisf = 2 * (dword_50B700 != 0) - 1; |
6150 if ( v55 > 0 ) | 6150 if ( v55 > 0 ) |
6151 { | 6151 { |
6152 v62 = 1; | 6152 v62 = 1; |
6153 v71 = 1; | 6153 v71 = 1; |
6161 if ( v62 >= v55 ) | 6161 if ( v62 >= v55 ) |
6162 v62 -= v55; | 6162 v62 -= v55; |
6163 if ( v64 >= v55 ) | 6163 if ( v64 >= v55 ) |
6164 v64 -= v55; | 6164 v64 -= v55; |
6165 if ( thisf | 6165 if ( thisf |
6166 * ((dword_50B9D8_ys[v64] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v62] - dword_50BAC8[v63]) | 6166 * ((_50B9D8_screen_space_y[v64] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v62] - _50BAC8_screen_space_x[v63]) |
6167 - (dword_50B9D8_ys[v62] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v64] - dword_50BAC8[v63])) < 0 ) | 6167 - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 ) |
6168 { | 6168 { |
6169 v62 = v80; | 6169 v62 = v80; |
6170 v71 = v80; | 6170 v71 = v80; |
6171 } | 6171 } |
6172 else | 6172 else |
6173 { | 6173 { |
6174 v62 = v71; | 6174 v62 = v71; |
6175 v65 = v71; | 6175 v65 = v71; |
6176 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | 6176 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) |
6177 { | 6177 { |
6178 memcpy(&dword_50B9D8_ys[v65], &dword_50B9D8_ys[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | 6178 memcpy(&_50B9D8_screen_space_y[v65], &_50B9D8_screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); |
6179 memcpy(&dword_50BAC8[v65], &dword_50BAC8[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | 6179 memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); |
6180 } | 6180 } |
6181 --v55; | 6181 --v55; |
6182 } | 6182 } |
6183 } | 6183 } |
6184 while ( v62 - 1 < v55 ); | 6184 while ( v62 - 1 < v55 ); |
6185 } | 6185 } |
6186 dword_50BAC8[v55] = dword_50BAC8[0]; | 6186 _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0]; |
6187 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | 6187 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
6188 } | 6188 } |
6189 return v55; | 6189 return v55; |
6190 } | 6190 } |
6191 | 6191 |
6192 //----- (00424579) -------------------------------------------------------- | 6192 //----- (00424579) -------------------------------------------------------- |
6542 v5 = a2; | 6542 v5 = a2; |
6543 v74 = a1; | 6543 v74 = a1; |
6544 v60 = a2; | 6544 v60 = a2; |
6545 if ( !a1 | 6545 if ( !a1 |
6546 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | 6546 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), |
6547 v7 = dword_50B9D8_ys[0], | 6547 v7 = _50B9D8_screen_space_y[0], |
6548 v65 = 0, | 6548 v65 = 0, |
6549 v8 = dword_50B9D8_ys[0], | 6549 v8 = _50B9D8_screen_space_y[0], |
6550 a1 <= v6) ) | 6550 a1 <= v6) ) |
6551 return 0; | 6551 return 0; |
6552 do | 6552 do |
6553 { | 6553 { |
6554 v9 = dword_50B9D8_ys[v6]; | 6554 v9 = _50B9D8_screen_space_y[v6]; |
6555 if ( v9 >= v7 ) | 6555 if ( v9 >= v7 ) |
6556 { | 6556 { |
6557 if ( v9 > v8 ) | 6557 if ( v9 > v8 ) |
6558 v8 = dword_50B9D8_ys[v6]; | 6558 v8 = _50B9D8_screen_space_y[v6]; |
6559 } | 6559 } |
6560 else | 6560 else |
6561 { | 6561 { |
6562 v65 = v6; | 6562 v65 = v6; |
6563 v7 = dword_50B9D8_ys[v6]; | 6563 v7 = _50B9D8_screen_space_y[v6]; |
6564 } | 6564 } |
6565 ++v6; | 6565 ++v6; |
6566 } | 6566 } |
6567 while ( v6 < v4 ); | 6567 while ( v6 < v4 ); |
6568 v73 = v8; | 6568 v73 = v8; |
6586 } | 6586 } |
6587 else | 6587 else |
6588 { | 6588 { |
6589 v10 -= v74; | 6589 v10 -= v74; |
6590 } | 6590 } |
6591 v12 = dword_50B9D8_ys[v10]; | 6591 v12 = _50B9D8_screen_space_y[v10]; |
6592 if ( v12 <= dword_50B9D8_ys[v11] ) | 6592 if ( v12 <= _50B9D8_screen_space_y[v11] ) |
6593 { | 6593 { |
6594 v55 = v10; | 6594 v55 = v10; |
6595 v11 = v10; | 6595 v11 = v10; |
6596 } | 6596 } |
6597 if ( v12 == v73 ) | 6597 if ( v12 == v73 ) |
6612 { | 6612 { |
6613 v13 -= v74; | 6613 v13 -= v74; |
6614 } | 6614 } |
6615 v67 = v13; | 6615 v67 = v13; |
6616 LABEL_27: | 6616 LABEL_27: |
6617 if ( dword_50B9D8_ys[v13] != dword_50B9D8_ys[v55] ) | 6617 if ( _50B9D8_screen_space_y[v13] != _50B9D8_screen_space_y[v55] ) |
6618 { | 6618 { |
6619 v14 = dword_50BAC8[v55]; | 6619 v14 = _50BAC8_screen_space_x[v55]; |
6620 v62 = v14 << 16; | 6620 v62 = v14 << 16; |
6621 v54 = ((dword_50BAC8[v13] - v14) << 16) / (dword_50B9D8_ys[v13] - dword_50B9D8_ys[v55]); | 6621 v54 = ((_50BAC8_screen_space_x[v13] - v14) << 16) / (_50B9D8_screen_space_y[v13] - _50B9D8_screen_space_y[v55]); |
6622 v5->array_18[v7] = LOWORD(dword_50BAC8[v55]); | 6622 v5->array_18[v7] = LOWORD(_50BAC8_screen_space_x[v55]); |
6623 } | 6623 } |
6624 v15 = v65; | 6624 v15 = v65; |
6625 v69 = 0; | 6625 v69 = 0; |
6626 v61 = v65; | 6626 v61 = v65; |
6627 if ( v74 > 0 ) | 6627 if ( v74 > 0 ) |
6637 } | 6637 } |
6638 else | 6638 else |
6639 { | 6639 { |
6640 v15 -= v74; | 6640 v15 -= v74; |
6641 } | 6641 } |
6642 v17 = dword_50B9D8_ys[v15]; | 6642 v17 = _50B9D8_screen_space_y[v15]; |
6643 if ( v17 <= dword_50B9D8_ys[v16] ) | 6643 if ( v17 <= _50B9D8_screen_space_y[v16] ) |
6644 { | 6644 { |
6645 v61 = v15; | 6645 v61 = v15; |
6646 v16 = v15; | 6646 v16 = v15; |
6647 } | 6647 } |
6648 if ( v17 == v73 ) | 6648 if ( v17 == v73 ) |
6665 } | 6665 } |
6666 v66 = v18; | 6666 v66 = v18; |
6667 LABEL_44: | 6667 LABEL_44: |
6668 v19 = v18; | 6668 v19 = v18; |
6669 v20 = v61; | 6669 v20 = v61; |
6670 v53 = dword_50B9D8_ys[v19] - dword_50B9D8_ys[v61]; | 6670 v53 = _50B9D8_screen_space_y[v19] - _50B9D8_screen_space_y[v61]; |
6671 if ( dword_50B9D8_ys[v19] != dword_50B9D8_ys[v61] ) | 6671 if ( _50B9D8_screen_space_y[v19] != _50B9D8_screen_space_y[v61] ) |
6672 { | 6672 { |
6673 v21 = dword_50BAC8[v20]; | 6673 v21 = _50BAC8_screen_space_x[v20]; |
6674 v5 = v60; | 6674 v5 = v60; |
6675 v61 = v21 << 16; | 6675 v61 = v21 << 16; |
6676 v53 = ((dword_50BAC8[v19] - v21) << 16) / v53; | 6676 v53 = ((_50BAC8_screen_space_x[v19] - v21) << 16) / v53; |
6677 v60->array_3D8[v73] = LOWORD(dword_50BAC8[v20]); | 6677 v60->array_3D8[v73] = LOWORD(_50BAC8_screen_space_x[v20]); |
6678 } | 6678 } |
6679 v22 = v7; | 6679 v22 = v7; |
6680 v70 = v7; | 6680 v70 = v7; |
6681 if ( v7 <= v73 ) | 6681 if ( v7 <= v73 ) |
6682 { | 6682 { |
6683 v56 = &v5->array_3D8[v7]; | 6683 v56 = &v5->array_3D8[v7]; |
6684 v23 = &v5->array_18[v7]; | 6684 v23 = &v5->array_18[v7]; |
6685 do | 6685 do |
6686 { | 6686 { |
6687 v24 = v67; | 6687 v24 = v67; |
6688 if ( v22 < dword_50B9D8_ys[v67] || v22 == v73 ) | 6688 if ( v22 < _50B9D8_screen_space_y[v67] || v22 == v73 ) |
6689 goto LABEL_57; | 6689 goto LABEL_57; |
6690 v25 = v64 + v67; | 6690 v25 = v64 + v67; |
6691 v67 = v25; | 6691 v67 = v25; |
6692 if ( v25 < v74 ) | 6692 if ( v25 < v74 ) |
6693 { | 6693 { |
6700 v25 -= v74; | 6700 v25 -= v74; |
6701 } | 6701 } |
6702 v67 = v25; | 6702 v67 = v25; |
6703 LABEL_55: | 6703 LABEL_55: |
6704 v26 = v25; | 6704 v26 = v25; |
6705 v27 = dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24]; | 6705 v27 = _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24]; |
6706 if ( dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24] > 0 ) | 6706 if ( _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24] > 0 ) |
6707 { | 6707 { |
6708 v28 = dword_50BAC8[v24]; | 6708 v28 = _50BAC8_screen_space_x[v24]; |
6709 v54 = ((dword_50BAC8[v26] - v28) << 16) / v27; | 6709 v54 = ((_50BAC8_screen_space_x[v26] - v28) << 16) / v27; |
6710 v62 = v28 << 16; | 6710 v62 = v28 << 16; |
6711 } | 6711 } |
6712 LABEL_57: | 6712 LABEL_57: |
6713 v29 = v66; | 6713 v29 = v66; |
6714 if ( v70 >= dword_50B9D8_ys[v66] && v70 != v73 ) | 6714 if ( v70 >= _50B9D8_screen_space_y[v66] && v70 != v73 ) |
6715 { | 6715 { |
6716 v30 = v63 + v66; | 6716 v30 = v63 + v66; |
6717 v66 += v63; | 6717 v66 += v63; |
6718 if ( v66 >= v74 ) | 6718 if ( v66 >= v74 ) |
6719 { | 6719 { |
6725 v30 += v74; | 6725 v30 += v74; |
6726 LABEL_63: | 6726 LABEL_63: |
6727 v66 = v30; | 6727 v66 = v30; |
6728 } | 6728 } |
6729 v31 = v30; | 6729 v31 = v30; |
6730 v32 = dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29]; | 6730 v32 = _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29]; |
6731 if ( dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29] > 0 ) | 6731 if ( _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29] > 0 ) |
6732 { | 6732 { |
6733 v33 = dword_50BAC8[v29]; | 6733 v33 = _50BAC8_screen_space_x[v29]; |
6734 v53 = ((dword_50BAC8[v31] - v33) << 16) / v32; | 6734 v53 = ((_50BAC8_screen_space_x[v31] - v33) << 16) / v32; |
6735 v61 = v33 << 16; | 6735 v61 = v33 << 16; |
6736 } | 6736 } |
6737 } | 6737 } |
6738 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | 6738 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); |
6739 *v56 = HIWORD(v61); | 6739 *v56 = HIWORD(v61); |