# HG changeset patch # User zipi # Date 1379195025 -3600 # Node ID de6e646822a63a4207e333218279a3f0926b105e # Parent 89dec2be255f6a130a9bfe7b173ab7f2cecd7792 mul <> sub0 difference diff -r 89dec2be255f -r de6e646822a6 mm7_5.cpp --- a/mm7_5.cpp Sat Sep 14 22:02:56 2013 +0100 +++ b/mm7_5.cpp Sat Sep 14 22:43:45 2013 +0100 @@ -4486,9 +4486,9 @@ continue; } - v32 = fixpoint_mul(v29->pFacePlane_old.vNormal.x,v49); - v33 = fixpoint_mul(v29->pFacePlane_old.vNormal.z,v47); - v34 = fixpoint_mul(v29->pFacePlane_old.vNormal.y,v48); + v32 = fixpoint_sub0(v29->pFacePlane_old.vNormal.x,v49); + v33 = fixpoint_sub0(v29->pFacePlane_old.vNormal.z,v47); + v34 = fixpoint_sub0(v29->pFacePlane_old.vNormal.y,v48); v59 = v32 + v33 + v34; if ( v59 ) { @@ -4518,18 +4518,16 @@ if( v58 < 0 ) { - //TEMPORARY - //continue; + continue; } if(!sub_4075DB( - obj1_x + ((fixpoint_mul(v49,v58) + 32768) >> 16), - obj1_y + ((fixpoint_mul(v48,v58) + 32768) >> 16), - obj1_z + ((fixpoint_mul(v47,v58) + 32768) >> 16), + obj1_x + ((fixpoint_sub0(v49,v58) + 32768) >> 16), + obj1_y + ((fixpoint_sub0(v48,v58) + 32768) >> 16), + obj1_z + ((fixpoint_sub0(v47,v58) + 32768) >> 16), v29) ) { - //TEMPORARY - //continue; + continue; } //if there is no next sector turn back @@ -4571,7 +4569,7 @@ } //----- (004075DB) -------------------------------------------------------- -bool __fastcall sub_4075DB(int a1, int a2, int a3, BLVFace *a4) +bool __fastcall sub_4075DB(int x, int y, int z, BLVFace *a4) { unsigned int v5; // esi@1 char v7; // zf@2 @@ -4602,8 +4600,8 @@ v9 = pIndoor->pVertices; if ( v5 & FACE_XY_PLANE ) { - a4a = a1; - v8 = a2; + a4a = x; + v8 = y; for(int i = 0; i < a4->uNumVertices; i++) { dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].x; @@ -4612,10 +4610,10 @@ } else { - v8 = a3; - if ( v5 & FACE_XY_PLANE ) + v8 = z; + if ( v5 & FACE_XZ_PLANE ) { - a4a = a1; + a4a = x; for(int i = 0; i < a4->uNumVertices; i++) { dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].x; @@ -4624,7 +4622,7 @@ } else { - a4a = a2; + a4a = y; for(int i = 0; i < a4->uNumVertices; i++) { dword_4F5D98_xs[i] = v9[a4->pVertexIDs[i]].y; @@ -4650,7 +4648,7 @@ else { v25 = fixpoint_sub2(dword_4F5D98_xs[i + 1] - dword_4F5D98_xs[i], dword_4F5CC8_ys[i + 1] - dword_4F5CC8_ys[i]); - if( dword_4F5D98_xs[i] + (fixpoint_mul(v25, (v8 - dword_4F5CC8_ys[i]) << 16) + 32768 >> 16) >= a4a) + if( dword_4F5D98_xs[i] + (fixpoint_sub0(v25, (v8 - dword_4F5CC8_ys[i]) << 16) + 32768 >> 16) >= a4a) ++a3a; } }