Mercurial > mm7
comparison Vis.cpp @ 1035:306ec23b37df
004C1EE5 & other stuff
author | Nomad |
---|---|
date | Wed, 22 May 2013 14:12:51 +0200 |
parents | c94d6a37d298 |
children | 39f42990698f 010a844ef4a0 |
comparison
equal
deleted
inserted
replaced
1034:aa848c90181f | 1035:306ec23b37df |
---|---|
759 } | 759 } |
760 | 760 |
761 //----- (004C1EE5) -------------------------------------------------------- | 761 //----- (004C1EE5) -------------------------------------------------------- |
762 bool Vis::_4C1EE5_BLV_IntersectBModel_2(int *a1, int *a2, __int16 *a3, __int16 *a4, Vec3_short_ *a5, BLVFace *pFace) | 762 bool Vis::_4C1EE5_BLV_IntersectBModel_2(int *a1, int *a2, __int16 *a3, __int16 *a4, Vec3_short_ *a5, BLVFace *pFace) |
763 { | 763 { |
764 bool result; // eax@1 | 764 if (pFace->uAttributes & FACE_XY_PLANE) |
765 unsigned int v8; // ecx@1 | 765 { |
766 Vec3_short_ *v9; // ecx@2 | 766 *a1 = a5->x; |
767 __int16 *v10; // edx@3 | 767 *a2 = a5->y; |
768 signed int v11; // ecx@4 | 768 |
769 char v12; // zf@6 | 769 for (uint i = 0; i < pFace->uNumVertices; ++i) |
770 Vec3_short_ *v13; // ecx@6 | 770 { |
771 int v14; // edx@7 | 771 a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; |
772 __int16 *v15; // edx@8 | 772 a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; |
773 signed int v16; // ecx@9 | 773 |
774 int v17; // edx@11 | 774 a4[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; |
775 __int16 *v18; // edx@12 | 775 a4[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; |
776 signed int v19; // ecx@13 | 776 } |
777 signed int a5a; // [sp+24h] [bp+18h]@2 | 777 } |
778 signed int a5b; // [sp+24h] [bp+18h]@7 | 778 else if (pFace->uAttributes & FACE_XZ_PLANE) |
779 signed int a5c; // [sp+24h] [bp+18h]@11 | 779 { |
780 | 780 *a1 = a5->x; |
781 result = (bool)pFace; | 781 *a2 = a5->z; |
782 v8 = pFace->uAttributes; | 782 |
783 if ( BYTE1(v8) & 1 ) | 783 for (uint i = 0; i < pFace->uNumVertices; ++i) |
784 { | 784 { |
785 v9 = a5; | 785 a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; |
786 a5a = 0; | 786 a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; |
787 *a1 = v9->x; | 787 |
788 *a2 = v9->y; | 788 a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; |
789 if ( pFace->uNumVertices ) | 789 a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; |
790 { | 790 } |
791 v10 = a4 + 1; | 791 } |
792 do | 792 else if (pFace->uAttributes & FACE_YZ_PLANE) |
793 { | 793 { |
794 v11 = a5a; | 794 *a1 = a5->y; |
795 a3[2 * a5a] = pFace->pXInterceptDisplacements[a5a] + pIndoor->pVertices[pFace->pVertexIDs[a5a]].x; | 795 *a2 = a5->z; |
796 *(v10 - 1) = pFace->pYInterceptDisplacements[v11] + pIndoor->pVertices[pFace->pVertexIDs[v11]].y; | 796 |
797 *(__int16 *)((char *)v10 + (int)a3 - (int)a4) = pFace->pXInterceptDisplacements[v11 + 1] | 797 for (uint i = 0; i < pFace->uNumVertices; ++i) |
798 + pIndoor->pVertices[pFace->pVertexIDs[v11 + 1]].x; | 798 { |
799 ++a5a; | 799 a3[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; |
800 *v10 = pFace->pYInterceptDisplacements[v11 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v11 + 1]].y; | 800 a3[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; |
801 v10 += 2; | 801 |
802 } | 802 a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; |
803 while ( a5a < pFace->uNumVertices ); | 803 a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; |
804 } | 804 } |
805 } | 805 } |
806 else | 806 else |
807 { | 807 { |
808 v12 = (BYTE1(v8) & 2) == 0; | 808 assert(false); |
809 v13 = a5; | 809 return false; |
810 if ( v12 ) | 810 } |
811 { | 811 |
812 v17 = a5->y; | 812 return true; |
813 a5c = 0; | |
814 *a1 = v17; | |
815 *a2 = v13->z; | |
816 if ( pFace->uNumVertices ) | |
817 { | |
818 v18 = a4 + 1; | |
819 do | |
820 { | |
821 v19 = a5c; | |
822 a3[2 * a5c] = pFace->pYInterceptDisplacements[a5c] + pIndoor->pVertices[pFace->pVertexIDs[a5c]].y; | |
823 *(v18 - 1) = pFace->pZInterceptDisplacements[v19] + pIndoor->pVertices[pFace->pVertexIDs[v19]].z; | |
824 *(__int16 *)((char *)v18 + (int)(char *)a3 - (char *)a4) = pFace->pYInterceptDisplacements[v19 + 1] | |
825 + pIndoor->pVertices[pFace->pVertexIDs[v19 + 1]].y; | |
826 ++a5c; | |
827 *v18 = pFace->pZInterceptDisplacements[v19 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v19 + 1]].z; | |
828 v18 += 2; | |
829 } | |
830 while ( a5c < pFace->uNumVertices ); | |
831 } | |
832 } | |
833 else | |
834 { | |
835 v14 = a5->x; | |
836 a5b = 0; | |
837 *a1 = v14; | |
838 *a2 = v13->z; | |
839 if ( pFace->uNumVertices ) | |
840 { | |
841 v15 = a4 + 1; | |
842 do | |
843 { | |
844 v16 = a5b; | |
845 a3[2 * a5b] = pFace->pXInterceptDisplacements[a5b] + pIndoor->pVertices[pFace->pVertexIDs[a5b]].x; | |
846 *(v15 - 1) = pFace->pZInterceptDisplacements[v16] + pIndoor->pVertices[pFace->pVertexIDs[v16]].z; | |
847 *(__int16 *)((char *)v15 + (int)a3 - (int)a4) = pFace->pXInterceptDisplacements[v16 + 1] | |
848 + pIndoor->pVertices[pFace->pVertexIDs[v16 + 1]].x; | |
849 ++a5b; | |
850 *v15 = pFace->pZInterceptDisplacements[v16 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v16 + 1]].z; | |
851 v15 += 2; | |
852 } | |
853 while ( a5b < pFace->uNumVertices ); | |
854 } | |
855 } | |
856 } | |
857 LOBYTE(result) = 1; | |
858 return result; | |
859 } | 813 } |
860 | 814 |
861 //----- (004C2186) -------------------------------------------------------- | 815 //----- (004C2186) -------------------------------------------------------- |
862 bool Vis::_4C2186_BLV_IntersectBModel(BLVFace *pFace, unsigned int ModelID, __int16 *displaced_face_intersect_plane_coords_a, __int16 *displaced_face_intersect_plane_coords_b, Vec3_short_ *a5, BLVFace *face, unsigned int uModelID) | 816 bool Vis::_4C2186_BLV_IntersectBModel(BLVFace *pFace, unsigned int ModelID, __int16 *displaced_face_intersect_plane_coords_a, __int16 *displaced_face_intersect_plane_coords_b, Vec3_short_ *a5, BLVFace *face, unsigned int uModelID) |
863 { | 817 { |