comparison mm7_1.cpp @ 561:8b9cbf1f87fb

Cave kinda works
author Nomad
date Tue, 05 Mar 2013 00:24:28 +0200
parents f146781c5c2d
children b23f19fc0d1b
comparison
equal deleted inserted replaced
555:a09757c2c5e1 561:8b9cbf1f87fb
5802 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; 5802 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0];
5803 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; 5803 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0];
5804 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; 5804 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0];
5805 thisa = _50B924_view_transformed_xs[0] >= 0x80000u; 5805 thisa = _50B924_view_transformed_xs[0] >= 0x80000u;
5806 //int i = 1; 5806 //int i = 1;
5807 for (uint i = 1; i < v1->uNumVertices; ++i) 5807 for (uint i = 1; i <= v1->uNumVertices; ++i)
5808 { 5808 {
5809 v10 = _50B924_view_transformed_xs[i]; 5809 v10 = _50B924_view_transformed_xs[i];
5810 v81 = v10 >= (signed int)0x80000u; 5810 v81 = v10 >= (signed int)0x80000u;
5811 if ( thisa ^ v81 ) 5811 if ( thisa ^ v81 )
5812 { 5812 {
5844 dword_50B738[v20] = _50B744_view_transformed_ys[i]; 5844 dword_50B738[v20] = _50B744_view_transformed_ys[i];
5845 } 5845 }
5846 //++i; 5846 //++i;
5847 thisa = v81; 5847 thisa = v81;
5848 } 5848 }
5849 ia = 0;
5850 v21 = v79; 5849 v21 = v79;
5851 dword_50B918[v79] = dword_50B918[0]; 5850 dword_50B918[v79] = dword_50B918[0];
5852 dword_50B828[v79] = dword_50B828[0]; 5851 dword_50B828[v79] = dword_50B828[0];
5853 for ( dword_50B738[v79] = dword_50B738[0]; ia < v79; dword_50BA08[v22] = pBLVRenderParams->uViewportCenterY - v35 ) 5852 dword_50B738[v79] = dword_50B738[0];
5853 for (ia = 0; ia < v79; ++ia)
5854 { 5854 {
5855 v22 = ia; 5855 v22 = ia;
5856 thisc = abs(dword_50B918[ia]); 5856 thisc = abs(dword_50B918[ia]);
5857 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) 5857 if ( abs(dword_50B828[ia]) >> 13 <= thisc )
5858 { 5858 {
5877 v25 = v24 - 1; 5877 v25 = v24 - 1;
5878 v26 = (v25 & 0x800000) - 0x400000; 5878 v26 = (v25 & 0x800000) - 0x400000;
5879 } 5879 }
5880 } 5880 }
5881 v29 = dword_50B738[v22]; 5881 v29 = dword_50B738[v22];
5882 dword_50BAF4_xs[v22 + 1] = v26; 5882 dword_50BAF8_xs[v22] = v26;
5883 if ( abs(v29) >> 13 <= thisc ) 5883 if ( abs(v29) >> 13 <= thisc )
5884 { 5884 {
5885 v33 = dword_50B738[v22]; 5885 v33 = dword_50B738[v22];
5886 LODWORD(v34) = v33 << 16; 5886 LODWORD(v34) = v33 << 16;
5887 HIDWORD(v34) = v33 >> 16; 5887 HIDWORD(v34) = v33 >> 16;
5900 LOBYTE(v30) = dword_50B918[v22] >= v23; 5900 LOBYTE(v30) = dword_50B918[v22] >= v23;
5901 v31 = v30 - 1; 5901 v31 = v30 - 1;
5902 v32 = (v31 & 0x800000) - 0x400000; 5902 v32 = (v31 & 0x800000) - 0x400000;
5903 } 5903 }
5904 } 5904 }
5905 dword_50BA08[v22] = v32; 5905 dword_50BA08_ys[v22] = v32;
5906 dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; 5906 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16;
5907 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08[v22]) >> 16; 5907 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16;
5908 dword_50BAF4_xs[v22 + 1] = pBLVRenderParams->uViewportCenterX - dword_50BAF4_xs[v22 + 1]; 5908 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22];
5909 ++ia; 5909 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35;
5910 } 5910 }
5911 v36 = 0; 5911 v36 = 0;
5912 dword_50BAF4_xs[v21 + 1] = dword_50BAF4_xs[1]; 5912 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0];
5913 dword_50BA08[v21] = dword_50BA08[0]; 5913 dword_50BA08_ys[v21] = dword_50BA08_ys[0];
5914 v37 = pBLVRenderParams->uViewportX; 5914 v37 = pBLVRenderParams->uViewportX;
5915 v38 = dword_50BAF4_xs[1] < (signed int)pBLVRenderParams->uViewportX; 5915 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX;
5916 LOBYTE(v38) = dword_50BAF4_xs[1] >= (signed int)pBLVRenderParams->uViewportX; 5916 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX;
5917 v39 = 1; 5917 v39 = 1;
5918 ib = 1; 5918 ib = 1;
5919 if ( v79 < 1 ) 5919 if ( v79 < 1 )
5920 return 0; 5920 return 0;
5921 do 5921 do
5922 { 5922 {
5923 v40 = v39; 5923 v40 = v39;
5924 v41 = dword_50BAF4_xs[v40 + 1]; 5924 v41 = dword_50BAF8_xs[v40];
5925 v82 = v41 >= (signed int)v37; 5925 v82 = v41 >= (signed int)v37;
5926 if ( v38 ^ v82 ) 5926 if ( v38 ^ v82 )
5927 { 5927 {
5928 if ( v41 >= (signed int)v37 ) 5928 if ( v41 >= (signed int)v37 )
5929 { 5929 {
5930 v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) / (v41 - dword_50BAF4_xs[v40]); 5930 v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]);
5931 v42 = dword_50B9F8[v40 + 3]; 5931 v42 = dword_50BA08_ys[v40 - 1];
5932 } 5932 }
5933 else 5933 else
5934 { 5934 {
5935 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) / (dword_50BAF4_xs[v40] - v41); 5935 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41);
5936 v42 = dword_50BA08[v40]; 5936 v42 = dword_50BA08_ys[v40];
5937 } 5937 }
5938 dword_50B9FC_ys[v36] = v67 + v42;
5939 v37 = pBLVRenderParams->uViewportX;
5940 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX;
5938 ++v36; 5941 ++v36;
5939 dword_50B9F8[v36] = v67 + v42;
5940 v37 = pBLVRenderParams->uViewportX;
5941 dword_50BAE8_xs[v36] = pBLVRenderParams->uViewportX;
5942 } 5942 }
5943 v38 = v82; 5943 v38 = v82;
5944 if ( v82 ) 5944 if ( v82 )
5945 { 5945 {
5946 dword_50BAE8_xs[v36 + 1] = dword_50BAF4_xs[v40 + 1]; 5946 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40];
5947 dword_50B9F8[v36++ + 1] = dword_50BA08[v40]; 5947 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40];
5948 ++v36;
5948 } 5949 }
5949 v39 = ib++ + 1; 5950 v39 = ib++ + 1;
5950 } 5951 }
5951 while ( ib <= v79 ); 5952 while ( ib <= v79 );
5952 5953
5953 if (v36 < 1) 5954 if (v36 < 1)
5954 return 0; 5955 return 0;
5955 5956
5956 v43 = 0; 5957 v43 = 0;
5957 dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1]; 5958 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0];
5958 dword_50B9F8[v36 + 1] = dword_50B9F8[1]; 5959 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0];
5959 v44 = pBLVRenderParams->uViewportZ; 5960 v44 = pBLVRenderParams->uViewportZ;
5960 thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ; 5961 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ;
5961 ic = 1; 5962 ic = 1;
5962 5963
5963 do 5964 do
5964 { 5965 {
5965 v45 = ic; 5966 v45 = ic;
5966 v46 = dword_50BAE8_xs[ic + 1]; 5967 v46 = dword_50BAEC_xs[ic];
5967 v83 = v46 <= (signed int)v44; 5968 v83 = v46 <= (signed int)v44;
5968 if ( thisd ^ v83 ) 5969 if ( thisd ^ v83 )
5969 { 5970 {
5970 if ( v46 <= (signed int)v44 ) 5971 if ( v46 <= (signed int)v44 )
5971 { 5972 {
5972 v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) / (v46 - dword_50BAE8_xs[v45]); 5973 v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]);
5973 v47 = dword_50B9F8[v45]; 5974 v47 = dword_50B9FC_ys[v45 - 1];
5974 } 5975 }
5975 else 5976 else
5976 { 5977 {
5977 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) / (dword_50BAE8_xs[v45] - v46); 5978 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46);
5978 v47 = dword_50B9F8[v45 + 1]; 5979 v47 = dword_50B9FC_ys[v45];
5979 } 5980 }
5981 dword_50B9F0[v43] = v68 + v47;
5982 v44 = pBLVRenderParams->uViewportZ;
5983 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ;
5980 ++v43; 5984 ++v43;
5981 dword_50B9EC[v43] = v68 + v47;
5982 v44 = pBLVRenderParams->uViewportZ;
5983 dword_50BADC_xs[v43] = pBLVRenderParams->uViewportZ;
5984 } 5985 }
5985 if ( v83 ) 5986 if ( v83 )
5986 { 5987 {
5987 dword_50BAE0[v43] = dword_50BAE8_xs[v45 + 1]; 5988 dword_50BAE0[v43] = dword_50BAEC_xs[v45];
5988 dword_50B9F0[v43++] = dword_50B9F8[v45 + 1]; 5989 dword_50B9F0[v43++] = dword_50B9FC_ys[v45];
5989 } 5990 }
5990 ++ic; 5991 ++ic;
5991 thisd = v83; 5992 thisd = v83;
5992 } 5993 }
5993 while ( ic <= v36 ); 5994 while ( ic <= v36 );
6010 v84 = v53 >= (signed int)v49; 6011 v84 = v53 >= (signed int)v49;
6011 if ( v50 ^ v84 ) 6012 if ( v50 ^ v84 )
6012 { 6013 {
6013 if ( v53 >= (signed int)v49 ) 6014 if ( v53 >= (signed int)v49 )
6014 { 6015 {
6015 v69 = (signed int)(v49 - dword_50B9EC[v52]) * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) / (v53 - dword_50B9EC[v52]); 6016 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]);
6016 v54 = dword_50BADC_xs[v52]; 6017 v54 = dword_50BAE0[v52 - 1];
6017 } 6018 }
6018 else 6019 else
6019 { 6020 {
6020 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) / (dword_50B9EC[v52] - v53); 6021 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53);
6021 v54 = dword_50BAE0[v52]; 6022 v54 = dword_50BAE0[v52];
6022 } 6023 }
6024 dword_50BAD4[v48] = v69 + v54;
6025 v49 = pBLVRenderParams->uViewportY;
6026 dword_50B9E4[v48] = pBLVRenderParams->uViewportY;
6023 ++v48; 6027 ++v48;
6024 dword_50BAD0[v48] = v69 + v54;
6025 v49 = pBLVRenderParams->uViewportY;
6026 dword_50B9E0_ys[v48] = pBLVRenderParams->uViewportY;
6027 } 6028 }
6028 v50 = v84; 6029 v50 = v84;
6029 if ( v84 ) 6030 if ( v84 )
6030 { 6031 {
6031 dword_50BAD4[v48] = dword_50BAE0[v52]; 6032 dword_50BAD4[v48] = dword_50BAE0[v52];
6032 dword_50B9E0_ys[v48++ + 1] = dword_50B9F0[v52]; 6033 dword_50B9E4[v48++] = dword_50B9F0[v52];
6033 } 6034 }
6034 v51 = id++ + 1; 6035 v51 = id++ + 1;
6035 } 6036 }
6036 while ( id <= v43 ); 6037 while ( id <= v43 );
6037 6038
6038 if (v48 < 1) 6039 if (v48 < 1)
6039 return 0; 6040 return 0;
6040 6041
6041 v55 = 0; 6042 v55 = 0;
6042 dword_50BAD4[v48] = dword_50BAD4[0]; 6043 dword_50BAD4[v48] = dword_50BAD4[0];
6043 dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1]; 6044 dword_50B9E4[v48] = dword_50B9E4[0];
6044 v56 = pBLVRenderParams->uViewportW; 6045 v56 = pBLVRenderParams->uViewportW;
6045 thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW; 6046 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW;
6046 ie = 1; 6047 ie = 1;
6047 do 6048 do
6048 { 6049 {
6049 v57 = ie; 6050 v57 = ie;
6050 v58 = dword_50B9E0_ys[ie + 1]; 6051 v58 = dword_50B9E4[ie];
6051 v85 = v58 <= (signed int)v56; 6052 v85 = v58 <= (signed int)v56;
6052 if ( thise ^ v85 ) 6053 if ( thise ^ v85 )
6053 { 6054 {
6054 if ( v58 <= (signed int)v56 ) 6055 if ( v58 <= (signed int)v56 )
6055 { 6056 {
6056 v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) / (v58 - dword_50B9E0_ys[v57]); 6057 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]);
6057 v59 = dword_50BAD0[v57]; 6058 v59 = dword_50BAD4[v57 - 1];
6058 } 6059 }
6059 else 6060 else
6060 { 6061 {
6061 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) / (dword_50B9E0_ys[v57] - v58); 6062 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58);
6062 v59 = dword_50BAD4[v57]; 6063 v59 = dword_50BAD4[v57];
6063 } 6064 }
6065 dword_50BAC8[v55] = v70 + v59;
6066 v56 = pBLVRenderParams->uViewportW;
6067 dword_50B9D8_ys[v55] = pBLVRenderParams->uViewportW;
6064 ++v55; 6068 ++v55;
6065 dword_50BAC4[v55] = v70 + v59;
6066 v56 = pBLVRenderParams->uViewportW;
6067 unk_50B9D4[v55] = pBLVRenderParams->uViewportW;
6068 } 6069 }
6069 if ( v85 ) 6070 if ( v85 )
6070 { 6071 {
6071 dword_50BAC8[v55] = dword_50BAD4[v57]; 6072 dword_50BAC8[v55] = dword_50BAD4[v57];
6072 dword_50B9D8_ys[v55++] = dword_50B9E0_ys[v57 + 1]; 6073 dword_50B9D8_ys[v55++] = dword_50B9E4[v57];
6073 } 6074 }
6074 ++ie; 6075 ++ie;
6075 thise = v85; 6076 thise = v85;
6076 } 6077 }
6077 while ( ie <= v48 ); 6078 while ( ie <= v48 );