Mercurial > mm7
changeset 1279:34c433886ed4
* indoor working
* process party actions crash fixed
author | zipi |
---|---|
date | Sat, 15 Jun 2013 12:33:13 +0100 |
parents | ce8ea73e7678 |
children | 89210052dbb4 2767980b98bb |
files | mm7_1.cpp mm7_data.cpp mm7_data.h stru367.h |
diffstat | 4 files changed, 245 insertions(+), 220 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_1.cpp Sat Jun 15 07:52:05 2013 +0200 +++ b/mm7_1.cpp Sat Jun 15 12:33:13 2013 +0100 @@ -1488,21 +1488,21 @@ //----- (00423B5D) -------------------------------------------------------- int __fastcall sub_423B5D(unsigned int uFaceID) { - BLVFace *pFace; // ebx@1 + BLVFace *v1; // ebx@1 Vec3_short_ *v2; // esi@1 - //int v3; // ST28_4@1 + int v3; // ST28_4@1 __int16 v4; // ST2C_2@1 - //signed int v5; // esi@1 - //Vec3_short_ *v6; // eax@4 - //signed int v7; // edi@5 - //signed int v8; // eax@5 - //signed int i_; // ecx@10 + signed int v5; // esi@1 + Vec3_short_ *v6; // eax@4 + signed int v7; // edi@5 + signed int v8; // eax@5 + signed int v9; // ecx@10 int v10; // eax@10 int v11; // edx@11 int v12; // ST28_4@12 signed int v13; // edx@12 signed __int64 v14; // qtt@12 - int *v15; // ebx@12 + char *v15; // ebx@12 int v16; // ST28_4@14 signed int v17; // eax@14 signed __int64 v18; // qtt@14 @@ -1540,7 +1540,7 @@ bool v50; // edx@51 int v51; // ecx@51 int v52; // ecx@52 - signed int v53; // esi@52 + int v53; // esi@52 int v54; // eax@54 int v55; // ebx@61 unsigned int v56; // eax@61 @@ -1552,12 +1552,13 @@ int v63; // ecx@76 int v64; // esi@76 int v65; // ecx@83 - //signed int v66; // [sp+14h] [bp-14h]@3 + signed int v66; // [sp+14h] [bp-14h]@3 int v67; // [sp+14h] [bp-14h]@34 int v68; // [sp+14h] [bp-14h]@44 int v69; // [sp+14h] [bp-14h]@54 int v70; // [sp+14h] [bp-14h]@64 signed int v71; // [sp+14h] [bp-14h]@75 + IndoorCameraD3D *_this; // [sp+18h] [bp-10h]@1 bool thisa; // [sp+18h] [bp-10h]@9 int thisb; // [sp+18h] [bp-10h]@12 int thisc; // [sp+18h] [bp-10h]@20 @@ -1571,334 +1572,373 @@ bool v83; // [sp+20h] [bp-8h]@42 bool v84; // [sp+20h] [bp-8h]@52 bool v85; // [sp+20h] [bp-8h]@62 - //signed int i; // [sp+24h] [bp-4h]@9 - signed int ia; // [sp+24h] [bp-4h]@19 - signed int ib; // [sp+24h] [bp-4h]@31 - signed int ic; // [sp+24h] [bp-4h]@41 - signed int id; // [sp+24h] [bp-4h]@51 - signed int ie; // [sp+24h] [bp-4h]@61 + signed int v86; // [sp+24h] [bp-4h]@9 + signed int v87; // [sp+24h] [bp-4h]@19 + signed int v88; // [sp+24h] [bp-4h]@31 + signed int v89; // [sp+24h] [bp-4h]@41 + signed int v90; // [sp+24h] [bp-4h]@51 + signed int v91; // [sp+24h] [bp-4h]@61 - pFace = &pIndoor->pFaces[uFaceID]; - //this = pGame->pIndoorCameraD3D; - v2 = &pIndoor->pVertices[pFace->pVertexIDs[0]]; - //v3 = *(_DWORD *)&v2->x; + v1 = &pIndoor->pFaces[uFaceID]; + _this = pGame->pIndoorCameraD3D; + v2 = &pIndoor->pVertices[*v1->pVertexIDs]; + v3 = *(_DWORD *)&v2->x; v4 = v2->z; - //v5 = 0; - if ( pFace->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) - + pFace->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) - + pFace->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) + v5 = 0; + if ( v1->pFacePlane_old.vNormal.x * ((signed __int16)v3 - pBLVRenderParams->vPartyPos.x) + + v1->pFacePlane_old.vNormal.y * (SHIWORD(v3) - pBLVRenderParams->vPartyPos.y) + + v1->pFacePlane_old.vNormal.z * (v4 - pBLVRenderParams->vPartyPos.z) < 0 ) { stru_50B700.field_0 = 1; } else { stru_50B700.field_0 = 0; - if ( !pFace->Portal() ) + if ( !(v1->uAttributes & 1) ) return 0; } - //v66 = v1->uNumVertices; - for (uint i = 0; i < pFace->uNumVertices; ++i) + v66 = v1->uNumVertices; + if ( (signed int)v1->uNumVertices > 0 ) { - auto v6 = &pIndoor->pVertices[pFace->pVertexIDs[i]]; - pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(v6->x, v6->y, v6->z, - &stru_50B700._view_transformed_xs[i], &stru_50B700._view_transformed_zs[i], &stru_50B700._view_transformed_ys[i], 0); - } - - //v7 = v1->uNumVertices; - //v8 = 0; - if (pFace->uNumVertices <= 0) - return 0; - - bool bFound = false; - for (uint i = 0; i < pFace->uNumVertices; ++i) - if (stru_50B700._view_transformed_xs[i] >= 0x80000u) + do { - bFound = true; - break; + v6 = &pIndoor->pVertices[v1->pVertexIDs[v5]]; + pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( + v6->x, + v6->y, + v6->z, + &stru_50B700._view_transformed_xs[v5 + 3], + &stru_50B700._view_transformed_zs[v5 + 3], + &stru_50B700._view_transformed_ys[v5 + 3], + 0); + ++v5; } - if (!bFound) + while ( v5 < v66 ); + } + v7 = v66; + v8 = 0; + if ( v66 <= 0 ) return 0; - + do + { + if ( stru_50B700._view_transformed_xs[v8 + 3] >= 524288 ) + break; + ++v8; + } + while ( v8 < v66 ); + if ( v8 >= v66 ) + return 0; v79 = 0; - stru_50B700._view_transformed_xs[pFace->uNumVertices] = stru_50B700._view_transformed_xs[0]; - stru_50B700._view_transformed_zs[pFace->uNumVertices] = stru_50B700._view_transformed_zs[0]; - stru_50B700._view_transformed_ys[pFace->uNumVertices] = stru_50B700._view_transformed_ys[0]; - thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u; - //int i = 1; - for (uint i = 1; i <= pFace->uNumVertices; ++i) + stru_50B700._view_transformed_xs[v66 + 3] = stru_50B700._view_transformed_xs[3]; + stru_50B700._view_transformed_zs[v66 + 3] = stru_50B700._view_transformed_zs[3]; + stru_50B700._view_transformed_ys[v66 + 3] = stru_50B700._view_transformed_ys[3]; + thisa = stru_50B700._view_transformed_xs[3] >= 524288; + v86 = 1; + if ( v66 >= 1 ) { - v10 = stru_50B700._view_transformed_xs[i]; - v81 = v10 >= (signed int)0x80000u; + do + { + v9 = v86; + v10 = stru_50B700._view_transformed_xs[v86 + 3]; + v81 = v10 >= 524288; if ( thisa ^ v81 ) { - v11 = stru_50B700._view_transformed_xs[i - 1]; - if ( v10 >= (signed int)0x80000u ) + v11 = stru_50B700._view_transformed_xs[v9 + 2]; + if ( v10 >= 524288 ) { v12 = v10 - v11; - v13 = 0x80000 - v11; + v13 = 524288 - v11; LODWORD(v14) = v13 << 16; HIDWORD(v14) = v13 >> 16; - v15 = &stru_50B700._view_transformed_ys[i - 1]; - stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1]) * v14 / v12) >> 16) + stru_50B700._view_transformed_zs[i - 1]; - thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1]) * v14 / v12) >> 16; + v15 = (char *)&stru_50B700._view_transformed_ys[v9 + 2]; + stru_50B700._view_transformed_zs[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[v9 + 3] + - stru_50B700._view_transformed_zs[v9 + 2]) + * v14 + / v12) >> 16) + + stru_50B700._view_transformed_zs[v9 + 2]; + thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[v9 + 3] - stru_50B700._view_transformed_ys[v9 + 2]) + * v14 + / v12) >> 16; } else { v16 = v11 - v10; - v17 = 0x80000 - v10; + v17 = 524288 - v10; LODWORD(v18) = v17 << 16; HIDWORD(v18) = v17 >> 16; - v15 = &stru_50B700._view_transformed_ys[i]; - stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i]) * v18 / v16) >> 16) + stru_50B700._view_transformed_zs[i]; - thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i]) * v18 / v16) >> 16; + v15 = (char *)&stru_50B700._view_transformed_ys[v9 + 3]; + stru_50B700._view_transformed_zs[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[v9 + 2] + - stru_50B700._view_transformed_zs[v9 + 3]) + * v18 + / v16) >> 16) + + stru_50B700._view_transformed_zs[v9 + 3]; + thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[v9 + 2] - stru_50B700._view_transformed_ys[v9 + 3]) + * v18 + / v16) >> 16; } v19 = v79++; - //v7 = v66; - stru_50B700.field_38[v19] = thisb + *v15; - stru_50B700.field_218[v19] = 0x80000u; + v7 = v66; + stru_50B700._view_transformed_ys[v19] = thisb + *(_DWORD *)v15; + stru_50B700._view_transformed_xs[v19] = 524288; } if ( v81 ) { v20 = v79++; - stru_50B700.field_218[v20] = stru_50B700._view_transformed_xs[i]; - stru_50B700.field_128[v20] = stru_50B700._view_transformed_zs[i]; - stru_50B700.field_38[v20] = stru_50B700._view_transformed_ys[i]; + stru_50B700._view_transformed_xs[v20] = stru_50B700._view_transformed_xs[v9 + 3]; + stru_50B700._view_transformed_zs[v20] = stru_50B700._view_transformed_zs[v9 + 3]; + stru_50B700._view_transformed_ys[v20] = stru_50B700._view_transformed_ys[v9 + 3]; } - //++i; + ++v86; thisa = v81; + } + while ( v86 <= v7 ); } + v87 = 0; v21 = v79; - stru_50B700.field_218[v79] = stru_50B700.field_218[0]; - stru_50B700.field_128[v79] = stru_50B700.field_128[0]; - stru_50B700.field_38[v79] = stru_50B700.field_38[0]; - for (ia = 0; ia < v79; ++ia) + stru_50B700._view_transformed_xs[v79] = stru_50B700._view_transformed_xs[0]; + stru_50B700._view_transformed_zs[v79] = stru_50B700._view_transformed_zs[0]; + for ( stru_50B700._view_transformed_ys[v79] = stru_50B700._view_transformed_ys[0]; + v87 < v79; + stru_50B700._screen_space_y[v22 + 12] = pBLVRenderParams->uViewportCenterY - v35 ) { - v22 = ia; - thisc = abs(stru_50B700.field_218[ia]); - if ( abs(stru_50B700.field_128[ia]) >> 13 <= thisc ) + v22 = v87; + thisc = abs(stru_50B700._view_transformed_xs[v87]); + if ( abs(stru_50B700._view_transformed_zs[v87]) >> 13 <= thisc ) { - v27 = stru_50B700.field_128[v22]; + v27 = stru_50B700._view_transformed_zs[v22]; LODWORD(v28) = v27 << 16; HIDWORD(v28) = v27 >> 16; - v26 = v28 / stru_50B700.field_218[v22]; + v26 = v28 / stru_50B700._view_transformed_xs[v22]; v23 = 0; } else { v23 = 0; v24 = 0; - if ( stru_50B700.field_128[v22] >= 0 ) + if ( stru_50B700._view_transformed_zs[v22] >= 0 ) { - LOBYTE(v24) = stru_50B700.field_218[v22] >= 0; - v26 = ((v24 - 1) & 0xFF800000) + 0x400000; + LOBYTE(v24) = stru_50B700._view_transformed_xs[v22] >= 0; + v26 = ((v24 - 1) & 0xFF800000) + 4194304; } else { - LOBYTE(v24) = stru_50B700.field_218[v22] >= 0; + LOBYTE(v24) = stru_50B700._view_transformed_xs[v22] >= 0; v25 = v24 - 1; - v26 = (v25 & 0x800000) - 0x400000; + v26 = (v25 & 0x800000) - 4194304; } } - v29 = stru_50B700.field_38[v22]; - stru_50B700._xs3[v22] = v26; + v29 = stru_50B700._view_transformed_ys[v22]; + stru_50B700._screen_space_x[v22 + 12] = v26; if ( abs(v29) >> 13 <= thisc ) { - v33 = stru_50B700.field_38[v22]; + v33 = stru_50B700._view_transformed_ys[v22]; LODWORD(v34) = v33 << 16; HIDWORD(v34) = v33 >> 16; - v32 = v34 / stru_50B700.field_218[v22]; + v32 = v34 / stru_50B700._view_transformed_xs[v22]; } else { v30 = 0; - if ( stru_50B700.field_38[v22] >= v23 ) + if ( stru_50B700._view_transformed_ys[v22] >= v23 ) { - LOBYTE(v30) = stru_50B700.field_218[v22] >= v23; - v32 = ((v30 - 1) & 0xFF800000) + 0x400000; + LOBYTE(v30) = stru_50B700._view_transformed_xs[v22] >= v23; + v32 = ((v30 - 1) & 0xFF800000) + 4194304; } else { - LOBYTE(v30) = stru_50B700.field_218[v22] >= v23; + LOBYTE(v30) = stru_50B700._view_transformed_xs[v22] >= v23; v31 = v30 - 1; - v32 = (v31 & 0x800000) - 0x400000; + v32 = (v31 & 0x800000) - 4194304; } } - stru_50B700._ys2[v22] = v32; - stru_50B700._xs3[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._xs3[v22]) >> 16; - v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._ys2[v22]) >> 16; - stru_50B700._xs3[v22] = pBLVRenderParams->uViewportCenterX - stru_50B700._xs3[v22]; - stru_50B700._ys2[v22] = pBLVRenderParams->uViewportCenterY - v35; + stru_50B700._screen_space_y[v22 + 12] = v32; + stru_50B700._screen_space_x[v22 + 12] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) + * (signed __int64)stru_50B700._screen_space_x[v22 + 12]) >> 16; + v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._screen_space_y[v22 + 12]) >> 16; + stru_50B700._screen_space_x[v22 + 12] = pBLVRenderParams->uViewportCenterX - stru_50B700._screen_space_x[v22 + 12]; + ++v87; } v36 = 0; - stru_50B700._xs3[v21] = stru_50B700._xs3[0]; - stru_50B700._ys2[v21] = stru_50B700._ys2[0]; + stru_50B700._screen_space_x[v21 + 12] = stru_50B700._screen_space_x[12]; + stru_50B700._screen_space_y[v21 + 12] = stru_50B700._screen_space_y[12]; v37 = pBLVRenderParams->uViewportX; - v38 = stru_50B700._xs3[0] < (signed int)pBLVRenderParams->uViewportX; - LOBYTE(v38) = stru_50B700._xs3[0] >= (signed int)pBLVRenderParams->uViewportX; + v38 = stru_50B700._screen_space_x[12] < (signed int)pBLVRenderParams->uViewportX; + LOBYTE(v38) = stru_50B700._screen_space_x[12] >= (signed int)pBLVRenderParams->uViewportX; v39 = 1; - ib = 1; + v88 = 1; if ( v79 < 1 ) return 0; do { v40 = v39; - v41 = stru_50B700._xs3[v40]; + v41 = stru_50B700._screen_space_x[v40 + 12]; v82 = v41 >= (signed int)v37; if ( v38 ^ v82 ) { if ( v41 >= (signed int)v37 ) { - v67 = (signed int)(v37 - stru_50B700._xs3[v40 - 1]) * (signed __int64)(stru_50B700._ys2[v40] - stru_50B700._ys2[v40 - 1]) / (v41 - stru_50B700._xs3[v40 - 1]); - v42 = stru_50B700._ys2[v40 - 1]; + v67 = (signed int)(v37 - stru_50B700._screen_space_x[v40 + 11]) + * (signed __int64)(stru_50B700._screen_space_y[v40 + 12] - stru_50B700._screen_space_y[v40 + 11]) + / (v41 - stru_50B700._screen_space_x[v40 + 11]); + v42 = stru_50B700._screen_space_y[v40 + 11]; } else { - v67 = (signed int)(v37 - v41) * (signed __int64)(stru_50B700._ys2[v40 - 1] - stru_50B700._ys2[v40]) / (stru_50B700._xs3[v40 - 1] - v41); - v42 = stru_50B700._ys2[v40]; + v67 = (signed int)(v37 - v41) + * (signed __int64)(stru_50B700._screen_space_y[v40 + 11] - stru_50B700._screen_space_y[v40 + 12]) + / (stru_50B700._screen_space_x[v40 + 11] - v41); + v42 = stru_50B700._screen_space_y[v40 + 12]; } - stru_50B700._ys[v36] = v67 + v42; + ++v36; + stru_50B700._screen_space_y[v36 + 8] = v67 + v42; v37 = pBLVRenderParams->uViewportX; - stru_50B700._xs2[v36] = pBLVRenderParams->uViewportX; - ++v36; + stru_50B700._screen_space_x[v36 + 8] = pBLVRenderParams->uViewportX; } v38 = v82; if ( v82 ) { - stru_50B700._xs2[v36] = stru_50B700._xs3[v40]; - stru_50B700._ys[v36] = stru_50B700._ys2[v40]; - ++v36; + stru_50B700._screen_space_x[v36 + 9] = stru_50B700._screen_space_x[v40 + 12]; + stru_50B700._screen_space_y[v36++ + 9] = stru_50B700._screen_space_y[v40 + 12]; } - v39 = ib++ + 1; + v39 = v88++ + 1; } - while ( ib <= v79 ); - - if (v36 < 1) + while ( v88 <= v79 ); + if ( !v36 + || (v43 = 0, + stru_50B700._screen_space_x[v36 + 9] = stru_50B700._screen_space_x[9], + stru_50B700._screen_space_y[v36 + 9] = stru_50B700._screen_space_y[9], + v44 = pBLVRenderParams->uViewportZ, + thisd = stru_50B700._screen_space_x[9] <= (signed int)pBLVRenderParams->uViewportZ, + v89 = 1, + v36 < 1) ) return 0; - - v43 = 0; - stru_50B700._xs2[v36] = stru_50B700._xs2[0]; - stru_50B700._ys[v36] = stru_50B700._ys[0]; - v44 = pBLVRenderParams->uViewportZ; - thisd = stru_50B700._xs2[0] <= (signed int)pBLVRenderParams->uViewportZ; - ic = 1; - do { - v45 = ic; - v46 = stru_50B700._xs2[ic]; + v45 = v89; + v46 = stru_50B700._screen_space_x[v89 + 9]; v83 = v46 <= (signed int)v44; if ( thisd ^ v83 ) { if ( v46 <= (signed int)v44 ) { - v68 = (signed int)(v44 - stru_50B700._xs2[v45 - 1]) * (signed __int64)(stru_50B700._ys[v45] - stru_50B700._ys[v45 - 1]) / (v46 - stru_50B700._xs2[v45 - 1]); - v47 = stru_50B700._ys[v45 - 1]; + v68 = (signed int)(v44 - stru_50B700._screen_space_x[v45 + 8]) + * (signed __int64)(stru_50B700._screen_space_y[v45 + 9] - stru_50B700._screen_space_y[v45 + 8]) + / (v46 - stru_50B700._screen_space_x[v45 + 8]); + v47 = stru_50B700._screen_space_y[v45 + 8]; } else { - v68 = (signed int)(v44 - v46) * (signed __int64)(stru_50B700._ys[v45 - 1] - stru_50B700._ys[v45]) / (stru_50B700._xs2[v45 - 1] - v46); - v47 = stru_50B700._ys[v45]; + v68 = (signed int)(v44 - v46) + * (signed __int64)(stru_50B700._screen_space_y[v45 + 8] - stru_50B700._screen_space_y[v45 + 9]) + / (stru_50B700._screen_space_x[v45 + 8] - v46); + v47 = stru_50B700._screen_space_y[v45 + 9]; } - stru_50B700.field_2F0[v43] = v68 + v47; + ++v43; + stru_50B700._screen_space_y[v43 + 5] = v68 + v47; v44 = pBLVRenderParams->uViewportZ; - stru_50B700._xs[v43] = pBLVRenderParams->uViewportZ; - ++v43; + stru_50B700._screen_space_x[v43 + 5] = pBLVRenderParams->uViewportZ; } if ( v83 ) { - stru_50B700._xs[v43] = stru_50B700._xs2[v45]; - stru_50B700.field_2F0[v43++] = stru_50B700._ys[v45]; + stru_50B700._screen_space_x[v43 + 6] = stru_50B700._screen_space_x[v45 + 9]; + stru_50B700._screen_space_y[v43++ + 6] = stru_50B700._screen_space_y[v45 + 9]; } - ++ic; + ++v89; thisd = v83; } - while ( ic <= v36 ); - - if (v43 < 1) + while ( v89 <= v36 ); + if ( !v43 + || (v48 = 0, + stru_50B700._screen_space_x[v43 + 6] = stru_50B700._screen_space_x[6], + stru_50B700._screen_space_y[v43 + 6] = stru_50B700._screen_space_y[6], + v49 = pBLVRenderParams->uViewportY, + v50 = stru_50B700._screen_space_y[6] < (signed int)pBLVRenderParams->uViewportY, + LOBYTE(v50) = stru_50B700._screen_space_y[6] >= (signed int)pBLVRenderParams->uViewportY, + v51 = 1, + v90 = 1, + v43 < 1) ) return 0; - - v48 = 0; - stru_50B700._xs[v43] = stru_50B700._xs[0]; - stru_50B700.field_2F0[v43] = stru_50B700.field_2F0[0]; - v49 = pBLVRenderParams->uViewportY; - v50 = stru_50B700.field_2F0[0] < (signed int)pBLVRenderParams->uViewportY; - LOBYTE(v50) = stru_50B700.field_2F0[0] >= (signed int)pBLVRenderParams->uViewportY; - v51 = 1; - id = 1; do { v52 = v51; - v53 = stru_50B700.field_2F0[v52]; + v53 = stru_50B700._screen_space_y[v52 + 6]; v84 = v53 >= (signed int)v49; if ( v50 ^ v84 ) { if ( v53 >= (signed int)v49 ) { - v69 = (signed int)(v49 - stru_50B700.field_2F0[v52 - 1]) * (signed __int64)(stru_50B700._xs[v52] - stru_50B700._xs[v52 - 1]) / (v53 - stru_50B700.field_2F0[v52 - 1]); - v54 = stru_50B700._xs[v52 - 1]; + v69 = (signed int)(v49 - stru_50B700._screen_space_y[v52 + 5]) + * (signed __int64)(stru_50B700._screen_space_x[v52 + 6] - stru_50B700._screen_space_x[v52 + 5]) + / (v53 - stru_50B700._screen_space_y[v52 + 5]); + v54 = stru_50B700._screen_space_x[v52 + 5]; } else { - v69 = (signed int)(v49 - v53) * (signed __int64)(stru_50B700._xs[v52 - 1] - stru_50B700._xs[v52]) / (stru_50B700.field_2F0[v52 - 1] - v53); - v54 = stru_50B700._xs[v52]; + v69 = (signed int)(v49 - v53) + * (signed __int64)(stru_50B700._screen_space_x[v52 + 5] - stru_50B700._screen_space_x[v52 + 6]) + / (stru_50B700._screen_space_y[v52 + 5] - v53); + v54 = stru_50B700._screen_space_x[v52 + 6]; } - stru_50B700.field_3D4[v48] = v69 + v54; + ++v48; + stru_50B700._screen_space_x[v48 + 2] = v69 + v54; v49 = pBLVRenderParams->uViewportY; - stru_50B700._xs[v48+1] = pBLVRenderParams->uViewportY; - ++v48; + stru_50B700._screen_space_y[v48 + 2] = pBLVRenderParams->uViewportY; } v50 = v84; if ( v84 ) { - stru_50B700.field_3D4[v48] = stru_50B700._xs[v52]; - stru_50B700._xs[v48+1] = stru_50B700.field_2F0[v52]; - v48++; + stru_50B700._screen_space_x[v48 + 3] = stru_50B700._screen_space_x[v52 + 6]; + stru_50B700._screen_space_y[v48++ + 3] = stru_50B700._screen_space_y[v52 + 6]; } - v51 = id++ + 1; + v51 = v90++ + 1; } - while ( id <= v43 ); - - if (v48 < 1) + while ( v90 <= v43 ); + if ( !v48 + || (v55 = 0, + stru_50B700._screen_space_x[v48 + 3] = stru_50B700._screen_space_x[3], + stru_50B700._screen_space_y[v48 + 3] = stru_50B700._screen_space_y[3], + v56 = pBLVRenderParams->uViewportW, + thise = stru_50B700._screen_space_y[3] <= (signed int)pBLVRenderParams->uViewportW, + v91 = 1, + v48 < 1) ) return 0; - - v55 = 0; - stru_50B700.field_3D4[v48] = stru_50B700.field_3D4[0]; - stru_50B700._xs[v48+1] = stru_50B700._xs[1]; - v56 = pBLVRenderParams->uViewportW; - thise = stru_50B700._xs[1] <= (signed int)pBLVRenderParams->uViewportW; - ie = 1; do { - v57 = ie; - v58 = stru_50B700._xs[ie+1]; + v57 = v91; + v58 = stru_50B700._screen_space_y[v91 + 3]; v85 = v58 <= (signed int)v56; if ( thise ^ v85 ) { if ( v58 <= (signed int)v56 ) { - v70 = (signed int)(v56 - stru_50B700._xs[v57]) * (signed __int64)(stru_50B700.field_3D4[v57] - stru_50B700.field_3D4[v57 - 1]) / (v58 - stru_50B700._xs[v57]); - v59 = stru_50B700.field_3D4[v57 - 1]; + v70 = (signed int)(v56 - stru_50B700._screen_space_y[v57 + 2]) + * (signed __int64)(stru_50B700._screen_space_x[v57 + 3] - stru_50B700._screen_space_x[v57 + 2]) + / (v58 - stru_50B700._screen_space_y[v57 + 2]); + v59 = stru_50B700._screen_space_x[v57 + 2]; } else { - v70 = (signed int)(v56 - v58) * (signed __int64)(stru_50B700.field_3D4[v57 - 1] - stru_50B700.field_3D4[v57]) / (stru_50B700._xs[v57] - v58); - v59 = stru_50B700.field_3D4[v57]; + v70 = (signed int)(v56 - v58) + * (signed __int64)(stru_50B700._screen_space_x[v57 + 2] - stru_50B700._screen_space_x[v57 + 3]) + / (stru_50B700._screen_space_y[v57 + 2] - v58); + v59 = stru_50B700._screen_space_x[v57 + 3]; } - stru_50B700._screen_space_x[v55] = v70 + v59; + ++v55; + //stru_50B700._screen_space_y[v55 + 59] = v70 + v59; + stru_50B700._screen_space_x[v55 - 1] = v70 + v59; v56 = pBLVRenderParams->uViewportW; - stru_50B700._screen_space_y[v55] = pBLVRenderParams->uViewportW; - ++v55; + //stru_50B700._view_transformed_xs[v55 + 47] = pBLVRenderParams->uViewportW; + stru_50B700._screen_space_y[v55 - 1] = pBLVRenderParams->uViewportW; } if ( v85 ) { - stru_50B700._screen_space_x[v55] = stru_50B700.field_3D4[v57]; - stru_50B700._screen_space_y[v55++] = stru_50B700._xs[v57+1]; + stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[v57 + 3]; + stru_50B700._screen_space_y[v55++] = stru_50B700._screen_space_y[v57 + 3]; } - ++ie; + ++v91; thise = v85; } - while ( ie <= v48 ); - + while ( v91 <= v48 ); if ( !v55 ) return 0; v61 = pRenderer->pRenderD3D == 0; @@ -1925,8 +1965,10 @@ if ( v64 >= v55 ) v64 -= v55; if ( thisf - * ((stru_50B700._screen_space_y[v64] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v62] - stru_50B700._screen_space_x[v63]) - - (stru_50B700._screen_space_y[v62] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v64] - stru_50B700._screen_space_x[v63])) < 0 ) + * ((stru_50B700._screen_space_y[v64] - stru_50B700._screen_space_y[v63]) + * (stru_50B700._screen_space_x[v62] - stru_50B700._screen_space_x[v63]) + - (stru_50B700._screen_space_y[v62] - stru_50B700._screen_space_y[v63]) + * (stru_50B700._screen_space_x[v64] - stru_50B700._screen_space_x[v63])) < 0 ) { v62 = v80; v71 = v80; @@ -1937,8 +1979,14 @@ v65 = v71; if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) { - memcpy(&stru_50B700._screen_space_y[v65], &stru_50B700._screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); - memcpy(&stru_50B700._screen_space_x[v65], &stru_50B700._screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); + memcpy( + &stru_50B700._screen_space_y[v65], + &stru_50B700._screen_space_y[v65 + 1], + 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); + memcpy( + &stru_50B700._screen_space_x[v65], + &stru_50B700._screen_space_x[v65 + 1], + 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); } --v55; } @@ -1950,7 +1998,6 @@ } return v55; } - //----- (00424579) -------------------------------------------------------- int __fastcall sub_424579(int uFaceID, stru320 *a2) {
--- a/mm7_data.cpp Sat Jun 15 07:52:05 2013 +0200 +++ b/mm7_data.cpp Sat Jun 15 12:33:13 2013 +0100 @@ -887,7 +887,7 @@ int ai_arrays_size; // weak std::array<int, 500> ai_near_actors_distances; std::array<unsigned int, 500> ai_near_actors_ids; -std::array<int, 121> dword_4F8580; // weak +std::array<int, 182> dword_4F8580; // weak
--- a/mm7_data.h Sat Jun 15 07:52:05 2013 +0200 +++ b/mm7_data.h Sat Jun 15 12:33:13 2013 +0100 @@ -527,7 +527,7 @@ extern int ai_arrays_size; // weak extern std::array<int, 500> ai_near_actors_distances; extern std::array<unsigned int, 500> ai_near_actors_ids; -extern std::array<int, 121> dword_4F8580; // weak +extern std::array<int, 182> dword_4F8580; // weak extern int dword_4FA9B0[]; // weak extern int dword_4FA9B4[]; // weak
--- a/stru367.h Sat Jun 15 07:52:05 2013 +0200 +++ b/stru367.h Sat Jun 15 12:33:13 2013 +0100 @@ -7,34 +7,12 @@ struct stru367 { int field_0; - int field_4[13]; - int field_38[2]; - int _view_transformed_ys_minus1; - int _view_transformed_ys[57]; - int field_128[2]; - int _view_transformed_zs_minus1; - int _view_transformed_zs[57]; - int field_218[2]; - int _view_transformed_xs_minus1; - int _view_transformed_xs[45]; - int _screen_space_y[2]; - int field_2E0; - int field_2E4[2]; - int field_2EC; - int field_2F0[2]; - int field_2F8; - int _ys[3]; - int _ys2[48]; - int _screen_space_x[2]; - int field_3D0; - int field_3D4[2]; - int field_3DC; - //int field_3E0; - int _xs[54]; - int field_3E4; - int field_3E8; - int _xs2[3]; - int _xs3[48]; + std::array<int, 13> field_4; + std::array<int, 60> _view_transformed_ys; + std::array<int, 60> _view_transformed_zs; + std::array<int, 48> _view_transformed_xs; + std::array<int, 60> _screen_space_y; + std::array<int, 60> _screen_space_x; }; #pragma pack(pop)