Mercurial > mm7
comparison Indoor.cpp @ 1380:635500df9320
Слияние
author | Ritor1 |
---|---|
date | Tue, 16 Jul 2013 14:11:43 +0600 |
parents | db3769ae574c 1fb9f4b9b6a7 |
children | 729635c2bb40 |
comparison
equal
deleted
inserted
replaced
1379:db3769ae574c | 1380:635500df9320 |
---|---|
6829 UpdateActors_BLV(); | 6829 UpdateActors_BLV(); |
6830 BLV_UpdateDoors(); | 6830 BLV_UpdateDoors(); |
6831 check_event_triggers(); | 6831 check_event_triggers(); |
6832 } | 6832 } |
6833 //----- (00424829) -------------------------------------------------------- | 6833 //----- (00424829) -------------------------------------------------------- |
6834 // Finds out if current portal can be seen through the previous portal | |
6834 bool PortalFrustrum(int pNumVertices, BspRenderer_PortalViewportData *far_portal, BspRenderer_PortalViewportData *near_portal, int uFaceID) | 6835 bool PortalFrustrum(int pNumVertices, BspRenderer_PortalViewportData *far_portal, BspRenderer_PortalViewportData *near_portal, int uFaceID) |
6835 { | 6836 { |
6836 int min_y; // esi@5 | 6837 int min_y; // esi@5 |
6837 int max_y; // edx@5 | 6838 int max_y; // edx@5 |
6838 int current_ID; // eax@12 | 6839 int current_ID; // eax@12 |
6885 } | 6886 } |
6886 | 6887 |
6887 //get min and max y for portal( y ) | 6888 //get min and max y for portal( y ) |
6888 for ( uint i = 1; i < pNumVertices; ++i ) | 6889 for ( uint i = 1; i < pNumVertices; ++i ) |
6889 { | 6890 { |
6890 if ( PortalFace._screen_space_y[i] >= min_y ) | 6891 if (PortalFace._screen_space_y[i] < min_y) |
6891 { | |
6892 if ( PortalFace._screen_space_y[i] > max_y ) | |
6893 max_y = PortalFace._screen_space_y[i]; | |
6894 } | |
6895 else | |
6896 { | 6892 { |
6897 min_y_ID = i; | 6893 min_y_ID = i; |
6898 min_y = PortalFace._screen_space_y[i]; | 6894 min_y = PortalFace._screen_space_y[i]; |
6895 } | |
6896 else if (PortalFace._screen_space_y[i] > max_y) | |
6897 { | |
6898 max_y = PortalFace._screen_space_y[i]; | |
6899 } | 6899 } |
6900 } | 6900 } |
6901 if ( max_y == min_y ) | 6901 if ( max_y == min_y ) |
6902 return false; | 6902 return false; |
6903 | 6903 |
6935 else | 6935 else |
6936 v13 -= pNumVertices; | 6936 v13 -= pNumVertices; |
6937 if ( PortalFace._screen_space_y[v13] != PortalFace._screen_space_y[min_y_ID2] ) | 6937 if ( PortalFace._screen_space_y[v13] != PortalFace._screen_space_y[min_y_ID2] ) |
6938 { | 6938 { |
6939 v62 = PortalFace._screen_space_x[min_y_ID2] << 16; | 6939 v62 = PortalFace._screen_space_x[min_y_ID2] << 16; |
6940 v54 = ((PortalFace._screen_space_x[v13] - PortalFace._screen_space_x[min_y_ID2]) << 16) / (PortalFace._screen_space_y[v13] - PortalFace._screen_space_y[min_y_ID2]); | 6940 v54 = ((PortalFace._screen_space_x[v13] - PortalFace._screen_space_x[min_y_ID2]) << 16) / |
6941 far_portal->viewport_left_side[min_y] = PortalFace._screen_space_x[min_y_ID2]; | 6941 (PortalFace._screen_space_y[v13] - PortalFace._screen_space_y[min_y_ID2]); |
6942 far_portal->viewport_left_side[min_y] = (short)PortalFace._screen_space_x[min_y_ID2]; | |
6942 } | 6943 } |
6943 //**************************************************************************************************************************************** | 6944 //**************************************************************************************************************************************** |
6944 // | 6945 // |
6945 v15 = min_y_ID; | 6946 v15 = min_y_ID; |
6946 v61 = min_y_ID; | 6947 v61 = min_y_ID; |
6973 v19 = v18; | 6974 v19 = v18; |
6974 v20 = v61; | 6975 v20 = v61; |
6975 if ( PortalFace._screen_space_y[v19] != PortalFace._screen_space_y[v61] ) | 6976 if ( PortalFace._screen_space_y[v19] != PortalFace._screen_space_y[v61] ) |
6976 { | 6977 { |
6977 v61 = PortalFace._screen_space_x[v20] << 16; | 6978 v61 = PortalFace._screen_space_x[v20] << 16; |
6978 v53 = ((PortalFace._screen_space_x[v19] - PortalFace._screen_space_x[v20]) << 16) / PortalFace._screen_space_y[v19] - PortalFace._screen_space_y[v20]; | 6979 v53 = ((PortalFace._screen_space_x[v19] - PortalFace._screen_space_x[v20]) << 16) / |
6979 far_portal->viewport_right_side[max_y] = PortalFace._screen_space_x[v20]; | 6980 (PortalFace._screen_space_y[v19] - PortalFace._screen_space_y[v20]); |
6981 far_portal->viewport_right_side[max_y] = (short)PortalFace._screen_space_x[v20]; | |
6980 } | 6982 } |
6981 //**************************************************************************************************************************************** | 6983 //**************************************************************************************************************************************** |
6982 v22 = min_y; | 6984 v22 = min_y; |
6983 if ( min_y <= max_y ) | 6985 if ( min_y <= max_y ) |
6984 { | 6986 { |
6996 else | 6998 else |
6997 v13 -= pNumVertices; | 6999 v13 -= pNumVertices; |
6998 v26 = v13; | 7000 v26 = v13; |
6999 if ( PortalFace._screen_space_y[v26] - PortalFace._screen_space_y[v24] > 0 ) | 7001 if ( PortalFace._screen_space_y[v26] - PortalFace._screen_space_y[v24] > 0 ) |
7000 { | 7002 { |
7001 v54 = ((PortalFace._screen_space_x[v26] - PortalFace._screen_space_x[v24]) << 16) / PortalFace._screen_space_y[v26] - PortalFace._screen_space_y[v24]; | 7003 v54 = ((PortalFace._screen_space_x[v26] - PortalFace._screen_space_x[v24]) << 16) / (PortalFace._screen_space_y[v26] - PortalFace._screen_space_y[v24]); |
7002 v62 = PortalFace._screen_space_x[v24] << 16; | 7004 v62 = PortalFace._screen_space_x[v24] << 16; |
7003 } | 7005 } |
7004 } | 7006 } |
7005 v29 = v18; | 7007 v29 = v18; |
7006 if ( v70 >= PortalFace._screen_space_y[v18] && v70 != max_y ) | 7008 if ( v70 >= PortalFace._screen_space_y[v18] && v70 != max_y ) |
7014 else | 7016 else |
7015 v18 -= pNumVertices; | 7017 v18 -= pNumVertices; |
7016 v31 = v18; | 7018 v31 = v18; |
7017 if ( PortalFace._screen_space_y[v31] - PortalFace._screen_space_y[v29] > 0 ) | 7019 if ( PortalFace._screen_space_y[v31] - PortalFace._screen_space_y[v29] > 0 ) |
7018 { | 7020 { |
7019 v53 = ((PortalFace._screen_space_x[v31] - PortalFace._screen_space_x[v29]) << 16) / PortalFace._screen_space_y[v31] - PortalFace._screen_space_y[v29]; | 7021 v53 = ((PortalFace._screen_space_x[v31] - PortalFace._screen_space_x[v29]) << 16) / (PortalFace._screen_space_y[v31] - PortalFace._screen_space_y[v29]); |
7020 v61 = PortalFace._screen_space_x[v29] << 16; | 7022 v61 = PortalFace._screen_space_x[v29] << 16; |
7021 } | 7023 } |
7022 } | 7024 } |
7023 far_portal->viewport_left_side[v70] = HIWORD(v62); | 7025 far_portal->viewport_left_side[v70] = HIWORD(v62); |
7024 far_portal->viewport_right_side[v70] = HIWORD(v61); | 7026 far_portal->viewport_right_side[v70] = HIWORD(v61); |