Mercurial > mm7
comparison mm7_1.cpp @ 1143:ed6a9efc6c90
sub_424829 little clean
author | Ritor1 |
---|---|
date | Sun, 02 Jun 2013 00:43:36 +0600 |
parents | e7871ca07661 |
children | 29a8defbad9e 908c00615587 |
comparison
equal
deleted
inserted
replaced
1142:1b570a110e6c | 1143:ed6a9efc6c90 |
---|---|
2223 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | 2223 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); |
2224 return result;*/ | 2224 return result;*/ |
2225 } | 2225 } |
2226 | 2226 |
2227 //----- (00424829) -------------------------------------------------------- | 2227 //----- (00424829) -------------------------------------------------------- |
2228 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | 2228 bool sub_424829(int pNumVertices, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int uFaceID) |
2229 { | 2229 { |
2230 int v4; // edi@1 | 2230 //int v4; // edi@1 |
2231 BspRenderer_stru2 *v5; // ebx@1 | 2231 //BspRenderer_stru2 *v5; // ebx@1 |
2232 int v6; // eax@3 | 2232 int v6; // eax@3 |
2233 int v7; // esi@5 | 2233 int v7; // esi@5 |
2234 int v8; // edx@5 | 2234 int v8; // edx@5 |
2235 int v9; // ecx@6 | 2235 //int v9; // ecx@6 |
2236 int v10; // eax@12 | 2236 int v10; // eax@12 |
2237 int v11; // edi@13 | 2237 int v11; // edi@13 |
2238 int v12; // edx@18 | 2238 //int v12; // edx@18 |
2239 int v13; // eax@22 | 2239 int v13; // eax@22 |
2240 int v14; // edi@28 | 2240 //int v14; // edi@28 |
2241 int v15; // ecx@29 | 2241 int v15; // ecx@29 |
2242 int v16; // edi@30 | 2242 int v16; // edi@30 |
2243 int v17; // edx@35 | 2243 //int v17; // edx@35 |
2244 int v18; // eax@39 | 2244 int v18; // eax@39 |
2245 int v19; // eax@44 | 2245 int v19; // eax@44 |
2246 int v20; // ecx@44 | 2246 int v20; // ecx@44 |
2247 int v21; // edi@45 | 2247 //int v21; // edi@45 |
2248 int v22; // edi@46 | 2248 int v22; // edi@46 |
2249 __int16 *v23; // ecx@47 | 2249 __int16 *v23; // ecx@47 |
2250 int v24; // edx@48 | 2250 int v24; // edx@48 |
2251 int v25; // eax@50 | 2251 int v25; // eax@50 |
2252 int v26; // eax@55 | 2252 int v26; // eax@55 |
2253 signed int v27; // edi@55 | 2253 signed int v27; // edi@55 |
2254 int v28; // edx@56 | 2254 //int v28; // edx@56 |
2255 int v29; // edx@57 | 2255 int v29; // edx@57 |
2256 int v30; // eax@59 | 2256 int v30; // eax@59 |
2257 int v31; // eax@64 | 2257 int v31; // eax@64 |
2258 signed int v32; // edi@64 | 2258 signed int v32; // edi@64 |
2259 int v33; // edx@65 | 2259 //int v33; // edx@65 |
2260 __int16 *v34; // eax@66 | 2260 __int16 *v34; // eax@66 |
2261 __int16 v35; // dx@66 | 2261 __int16 v35; // dx@66 |
2262 __int16 v36; // dx@67 | 2262 __int16 v36; // dx@67 |
2263 __int16 v37; // di@67 | 2263 __int16 v37; // di@67 |
2264 __int16 v38; // dx@67 | 2264 __int16 v38; // dx@67 |
2265 BspRenderer_stru2 *v39; // ecx@69 | 2265 //BspRenderer_stru2 *v39; // ecx@69 |
2266 int v40; // edx@69 | 2266 int v40; // edx@69 |
2267 int v41; // edi@70 | 2267 int v41; // edi@70 |
2268 __int16 *v42; // eax@76 | 2268 __int16 *v42; // eax@76 |
2269 __int16 *v43; // eax@81 | 2269 __int16 *v43; // eax@81 |
2270 __int16 *v45; // eax@87 | 2270 __int16 *v45; // eax@87 |
2272 __int16 v47; // cx@88 | 2272 __int16 v47; // cx@88 |
2273 int v48; // eax@93 | 2273 int v48; // eax@93 |
2274 int v49; // esi@93 | 2274 int v49; // esi@93 |
2275 __int16 *v50; // ecx@94 | 2275 __int16 *v50; // ecx@94 |
2276 int v51; // eax@95 | 2276 int v51; // eax@95 |
2277 int v52; // eax@97 | 2277 //int v52; // eax@97 |
2278 int v53; // [sp+Ch] [bp-34h]@44 | 2278 int v53; // [sp+Ch] [bp-34h]@44 |
2279 int v54; // [sp+10h] [bp-30h]@0 | 2279 int v54; // [sp+10h] [bp-30h]@0 |
2280 int v55; // [sp+14h] [bp-2Ch]@12 | 2280 int v55; // [sp+14h] [bp-2Ch]@12 |
2281 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | 2281 __int16 *v56; // [sp+14h] [bp-2Ch]@47 |
2282 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | 2282 __int16 *v57; // [sp+14h] [bp-2Ch]@76 |
2283 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | 2283 __int16 *v58; // [sp+14h] [bp-2Ch]@81 |
2284 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | 2284 __int16 *v59; // [sp+14h] [bp-2Ch]@87 |
2285 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | 2285 //BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 |
2286 int v61; // [sp+1Ch] [bp-24h]@29 | 2286 int v61; // [sp+1Ch] [bp-24h]@29 |
2287 int v62; // [sp+20h] [bp-20h]@0 | 2287 int v62; // [sp+20h] [bp-20h]@0 |
2288 signed int v63; // [sp+24h] [bp-1Ch]@3 | 2288 signed int v63; // [sp+24h] [bp-1Ch]@3 |
2289 signed int v64; // [sp+28h] [bp-18h]@3 | 2289 signed int v64; // [sp+28h] [bp-18h]@3 |
2290 int v65; // [sp+2Ch] [bp-14h]@5 | 2290 int v65; // [sp+2Ch] [bp-14h]@5 |
2294 int v69; // [sp+34h] [bp-Ch]@29 | 2294 int v69; // [sp+34h] [bp-Ch]@29 |
2295 int v70; // [sp+34h] [bp-Ch]@46 | 2295 int v70; // [sp+34h] [bp-Ch]@46 |
2296 int v71; // [sp+34h] [bp-Ch]@75 | 2296 int v71; // [sp+34h] [bp-Ch]@75 |
2297 int v72; // [sp+34h] [bp-Ch]@80 | 2297 int v72; // [sp+34h] [bp-Ch]@80 |
2298 int v73; // [sp+38h] [bp-8h]@11 | 2298 int v73; // [sp+38h] [bp-8h]@11 |
2299 int v74; // [sp+3Ch] [bp-4h]@1 | 2299 //int v74; // [sp+3Ch] [bp-4h]@1 |
2300 int a3a; // [sp+48h] [bp+8h]@76 | 2300 int a3a; // [sp+48h] [bp+8h]@76 |
2301 int a3b; // [sp+48h] [bp+8h]@87 | 2301 int a3b; // [sp+48h] [bp+8h]@87 |
2302 | 2302 |
2303 //try graphic engine with function returning 1 always, and without | 2303 //try graphic engine with function returning 1 always, and without |
2304 return 1; | 2304 //return true; |
2305 v4 = a1; | 2305 if ( !pNumVertices ) |
2306 v5 = a2; | 2306 return false; |
2307 v74 = a1; | 2307 v7 = stru_50B700._screen_space_y[0]; |
2308 v60 = a2; | 2308 v65 = 0; |
2309 if ( !a1 | 2309 v8 = stru_50B700._screen_space_y[0]; |
2310 || (!stru_50B700.field_0 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | 2310 if ( !stru_50B700.field_0 ) |
2311 v7 = stru_50B700._screen_space_y[0], | 2311 { |
2312 v65 = 0, | 2312 v63 = 1; |
2313 v8 = stru_50B700._screen_space_y[0], | 2313 v64 = -1; |
2314 a1 <= v6) ) | 2314 } |
2315 return 0; | 2315 else |
2316 do | 2316 { |
2317 { | 2317 v63 = -1; |
2318 v9 = stru_50B700._screen_space_y[v6]; | 2318 v64 = 1; |
2319 if ( v9 >= v7 ) | 2319 } |
2320 { | 2320 if ( pNumVertices <= 1 ) |
2321 if ( v9 > v8 ) | 2321 return false; |
2322 for ( v6 = 1; v6 < pNumVertices; ++v6 ) | |
2323 { | |
2324 if ( stru_50B700._screen_space_y[v6] >= v7 ) | |
2325 { | |
2326 if ( stru_50B700._screen_space_y[v6] > v8 ) | |
2322 v8 = stru_50B700._screen_space_y[v6]; | 2327 v8 = stru_50B700._screen_space_y[v6]; |
2323 } | 2328 } |
2324 else | 2329 else |
2325 { | 2330 { |
2326 v65 = v6; | 2331 v65 = v6; |
2327 v7 = stru_50B700._screen_space_y[v6]; | 2332 v7 = stru_50B700._screen_space_y[v6]; |
2328 } | 2333 } |
2329 ++v6; | 2334 } |
2330 } | |
2331 while ( v6 < v4 ); | |
2332 v73 = v8; | 2335 v73 = v8; |
2333 if ( v8 == v7 ) | 2336 if ( v8 == v7 ) |
2334 return 0; | 2337 return false; |
2335 v10 = v65; | 2338 v10 = v65; |
2336 v68 = 0; | 2339 a2->_viewport_space_y = v7; |
2337 v5->_viewport_space_y = v7; | 2340 a2->_viewport_space_w = v8; |
2338 v5->_viewport_space_w = v8; | |
2339 v55 = v65; | 2341 v55 = v65; |
2340 if ( v4 > 0 ) | 2342 if ( pNumVertices > 0 ) |
2341 { | 2343 { |
2342 v11 = v65; | 2344 v11 = v65; |
2343 do | 2345 for ( v68 = 0; v68 < pNumVertices; ++v68 ) |
2344 { | 2346 { |
2345 v10 += v64; | 2347 v10 += v64; |
2346 if ( v10 < v74 ) | 2348 if ( v10 < pNumVertices ) |
2347 { | 2349 { |
2348 if ( v10 < 0 ) | 2350 if ( v10 < 0 ) |
2349 v10 += v74; | 2351 v10 += pNumVertices; |
2350 } | 2352 } |
2351 else | 2353 else |
2352 { | 2354 { |
2353 v10 -= v74; | 2355 v10 -= pNumVertices; |
2354 } | 2356 } |
2355 v12 = stru_50B700._screen_space_y[v10]; | 2357 if ( stru_50B700._screen_space_y[v10] <= stru_50B700._screen_space_y[v11] ) |
2356 if ( v12 <= stru_50B700._screen_space_y[v11] ) | |
2357 { | 2358 { |
2358 v55 = v10; | 2359 v55 = v10; |
2359 v11 = v10; | 2360 v11 = v10; |
2360 } | 2361 } |
2361 if ( v12 == v73 ) | 2362 if ( stru_50B700._screen_space_y[v10] == v73 ) |
2362 break; | 2363 break; |
2363 ++v68; | 2364 } |
2364 } | |
2365 while ( v68 < v74 ); | |
2366 } | 2365 } |
2367 v13 = v55 + v64; | 2366 v13 = v55 + v64; |
2368 v67 = v55 + v64; | 2367 v67 = v55 + v64; |
2369 if ( v55 + v64 < v74 ) | 2368 if ( v55 + v64 < pNumVertices ) |
2370 { | 2369 { |
2371 if ( v13 >= 0 ) | 2370 if ( v13 >= 0 ) |
2372 goto LABEL_27; | 2371 goto LABEL_27; |
2373 v13 += v74; | 2372 v13 += pNumVertices; |
2374 } | 2373 } |
2375 else | 2374 else |
2376 { | 2375 { |
2377 v13 -= v74; | 2376 v13 -= pNumVertices; |
2378 } | 2377 } |
2379 v67 = v13; | 2378 v67 = v13; |
2380 LABEL_27: | 2379 LABEL_27: |
2381 if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] ) | 2380 if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] ) |
2382 { | 2381 { |
2383 v14 = stru_50B700._screen_space_x[v55]; | 2382 v62 = stru_50B700._screen_space_x[v55] << 16; |
2384 v62 = v14 << 16; | 2383 v54 = ((stru_50B700._screen_space_x[v13] - stru_50B700._screen_space_x[v55]) << 16) / (stru_50B700._screen_space_y[v13] - stru_50B700._screen_space_y[v55]); |
2385 v54 = ((stru_50B700._screen_space_x[v13] - v14) << 16) / (stru_50B700._screen_space_y[v13] - stru_50B700._screen_space_y[v55]); | 2384 a2->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]); |
2386 v5->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]); | |
2387 } | 2385 } |
2388 v15 = v65; | 2386 v15 = v65; |
2389 v69 = 0; | |
2390 v61 = v65; | 2387 v61 = v65; |
2391 if ( v74 > 0 ) | 2388 if ( pNumVertices > 0 ) |
2392 { | 2389 { |
2393 v16 = v65; | 2390 v16 = v65; |
2394 do | 2391 for ( v69 = 0; v69 < pNumVertices; ++v69 ) |
2395 { | 2392 { |
2396 v15 += v63; | 2393 v15 += v63; |
2397 if ( v15 < v74 ) | 2394 if ( v15 < pNumVertices ) |
2398 { | 2395 { |
2399 if ( v15 < 0 ) | 2396 if ( v15 < 0 ) |
2400 v15 += v74; | 2397 v15 += pNumVertices; |
2401 } | 2398 } |
2402 else | 2399 else |
2403 { | 2400 { |
2404 v15 -= v74; | 2401 v15 -= pNumVertices; |
2405 } | 2402 } |
2406 v17 = stru_50B700._screen_space_y[v15]; | 2403 if ( stru_50B700._screen_space_y[v15] <= stru_50B700._screen_space_y[v16] ) |
2407 if ( v17 <= stru_50B700._screen_space_y[v16] ) | |
2408 { | 2404 { |
2409 v61 = v15; | 2405 v61 = v15; |
2410 v16 = v15; | 2406 v16 = v15; |
2411 } | 2407 } |
2412 if ( v17 == v73 ) | 2408 if ( stru_50B700._screen_space_y[v15] == v73 ) |
2413 break; | 2409 break; |
2414 ++v69; | 2410 } |
2415 } | |
2416 while ( v69 < v74 ); | |
2417 } | 2411 } |
2418 v18 = v63 + v61; | 2412 v18 = v63 + v61; |
2419 v66 = v63 + v61; | 2413 v66 = v63 + v61; |
2420 if ( v63 + v61 < v74 ) | 2414 if ( v63 + v61 < pNumVertices ) |
2421 { | 2415 { |
2422 if ( v18 >= 0 ) | 2416 if ( v18 >= 0 ) |
2423 goto LABEL_44; | 2417 goto LABEL_44; |
2424 v18 += v74; | 2418 v18 += pNumVertices; |
2425 } | 2419 } |
2426 else | 2420 else |
2427 { | 2421 { |
2428 v18 -= v74; | 2422 v18 -= pNumVertices; |
2429 } | 2423 } |
2430 v66 = v18; | 2424 v66 = v18; |
2431 LABEL_44: | 2425 LABEL_44: |
2432 v19 = v18; | 2426 v19 = v18; |
2433 v20 = v61; | 2427 v20 = v61; |
2434 v53 = stru_50B700._screen_space_y[v19] - stru_50B700._screen_space_y[v61]; | |
2435 if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] ) | 2428 if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] ) |
2436 { | 2429 { |
2437 v21 = stru_50B700._screen_space_x[v20]; | 2430 v61 = stru_50B700._screen_space_x[v20] << 16; |
2438 v5 = v60; | 2431 v53 = ((stru_50B700._screen_space_x[v19] - stru_50B700._screen_space_x[v20]) << 16) / stru_50B700._screen_space_y[v19] - stru_50B700._screen_space_y[v20]; |
2439 v61 = v21 << 16; | 2432 a2->array_3D8[v73] = LOWORD(stru_50B700._screen_space_x[v20]); |
2440 v53 = ((stru_50B700._screen_space_x[v19] - v21) << 16) / v53; | |
2441 v60->array_3D8[v73] = LOWORD(stru_50B700._screen_space_x[v20]); | |
2442 } | 2433 } |
2443 v22 = v7; | 2434 v22 = v7; |
2444 v70 = v7; | |
2445 if ( v7 <= v73 ) | 2435 if ( v7 <= v73 ) |
2446 { | 2436 { |
2447 v56 = &v5->array_3D8[v7]; | 2437 v56 = &a2->array_3D8[v7]; |
2448 v23 = &v5->array_18[v7]; | 2438 v23 = &a2->array_18[v7]; |
2449 do | 2439 for ( v70 = v7; v70 <= v73; ++v70 ) |
2450 { | 2440 { |
2451 v24 = v67; | 2441 v24 = v67; |
2452 if ( v22 < stru_50B700._screen_space_y[v67] || v22 == v73 ) | 2442 if ( v22 < stru_50B700._screen_space_y[v67] || v22 == v73 ) |
2453 goto LABEL_57; | 2443 goto LABEL_57; |
2454 v25 = v64 + v67; | 2444 v25 = v64 + v67; |
2455 v67 = v25; | 2445 v67 = v25; |
2456 if ( v25 < v74 ) | 2446 if ( v25 < pNumVertices ) |
2457 { | 2447 { |
2458 if ( v25 >= 0 ) | 2448 if ( v25 >= 0 ) |
2459 goto LABEL_55; | 2449 goto LABEL_55; |
2460 v25 += v74; | 2450 v25 += pNumVertices; |
2461 } | 2451 } |
2462 else | 2452 else |
2463 { | 2453 { |
2464 v25 -= v74; | 2454 v25 -= pNumVertices; |
2465 } | 2455 } |
2466 v67 = v25; | 2456 v67 = v25; |
2467 LABEL_55: | 2457 LABEL_55: |
2468 v26 = v25; | 2458 v26 = v25; |
2469 v27 = stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24]; | 2459 //v27 = stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24]; |
2470 if ( stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24] > 0 ) | 2460 if ( stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24] > 0 ) |
2471 { | 2461 { |
2472 v28 = stru_50B700._screen_space_x[v24]; | 2462 v54 = ((stru_50B700._screen_space_x[v26] - stru_50B700._screen_space_x[v24]) << 16) / stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24]; |
2473 v54 = ((stru_50B700._screen_space_x[v26] - v28) << 16) / v27; | 2463 v62 = stru_50B700._screen_space_x[v24] << 16; |
2474 v62 = v28 << 16; | |
2475 } | 2464 } |
2476 LABEL_57: | 2465 LABEL_57: |
2477 v29 = v66; | 2466 v29 = v66; |
2478 if ( v70 >= stru_50B700._screen_space_y[v66] && v70 != v73 ) | 2467 if ( v70 >= stru_50B700._screen_space_y[v66] && v70 != v73 ) |
2479 { | 2468 { |
2480 v30 = v63 + v66; | 2469 v30 = v63 + v66; |
2481 v66 += v63; | 2470 v66 += v63; |
2482 if ( v66 >= v74 ) | 2471 if ( v66 >= pNumVertices ) |
2483 { | 2472 { |
2484 v30 -= v74; | 2473 v30 -= pNumVertices; |
2485 goto LABEL_63; | 2474 goto LABEL_63; |
2486 } | 2475 } |
2487 if ( v30 < 0 ) | 2476 if ( v30 < 0 ) |
2488 { | 2477 { |
2489 v30 += v74; | 2478 v30 += pNumVertices; |
2490 LABEL_63: | 2479 LABEL_63: |
2491 v66 = v30; | 2480 v66 = v30; |
2492 } | 2481 } |
2493 v31 = v30; | 2482 v31 = v30; |
2494 v32 = stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29]; | 2483 //v32 = stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29]; |
2495 if ( stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29] > 0 ) | 2484 if ( stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29] > 0 ) |
2496 { | 2485 { |
2497 v33 = stru_50B700._screen_space_x[v29]; | 2486 v53 = ((stru_50B700._screen_space_x[v31] - stru_50B700._screen_space_x[v29]) << 16) / stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29]; |
2498 v53 = ((stru_50B700._screen_space_x[v31] - v33) << 16) / v32; | 2487 v61 = stru_50B700._screen_space_x[v29] << 16; |
2499 v61 = v33 << 16; | 2488 } |
2500 } | 2489 } |
2501 } | 2490 *(__int16 *)((char *)v56 + (int)(char *)a2->array_18 - (char *)a2->array_3D8) = HIWORD(v62); |
2502 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
2503 *v56 = HIWORD(v61); | 2491 *v56 = HIWORD(v61); |
2504 v34 = v23 + 480; | 2492 v34 = v23 + 480; |
2505 v35 = v23[480]; | 2493 v35 = v23[480]; |
2506 if ( *v23 > v35 ) | 2494 if ( *v23 > v35 ) |
2507 { | 2495 { |
2515 ++v56; | 2503 ++v56; |
2516 v62 += v54; | 2504 v62 += v54; |
2517 v22 = v70 + 1; | 2505 v22 = v70 + 1; |
2518 v61 += v53; | 2506 v61 += v53; |
2519 ++v23; | 2507 ++v23; |
2520 ++v70; | 2508 } |
2521 } | 2509 } |
2522 while ( v70 <= v73 ); | |
2523 } | |
2524 v39 = a3; | |
2525 v40 = v73; | 2510 v40 = v73; |
2526 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | 2511 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) |
2527 return 0; | 2512 return false; |
2528 if ( v7 < a3->_viewport_space_y ) | 2513 if ( v7 < a3->_viewport_space_y ) |
2529 v7 = a3->_viewport_space_y; | 2514 v7 = a3->_viewport_space_y; |
2530 if ( v73 > v41 ) | 2515 if ( v73 > v41 ) |
2531 { | 2516 { |
2532 v40 = a3->_viewport_space_w; | 2517 v40 = a3->_viewport_space_w; |
2533 v73 = a3->_viewport_space_w; | 2518 v73 = a3->_viewport_space_w; |
2534 } | 2519 } |
2535 v71 = v7; | |
2536 if ( v7 <= v40 ) | 2520 if ( v7 <= v40 ) |
2537 { | 2521 { |
2538 a3a = (char *)v5 - (char *)a3; | 2522 a3a = (char *)a2 - (char *)a3; |
2539 v57 = &v5->array_18[v7]; | 2523 v57 = &a2->array_18[v7]; |
2540 v42 = &v39->array_3D8[v7]; | 2524 v42 = &a3->array_3D8[v7]; |
2541 do | 2525 for ( v71 = v7; v71 <= v40; ++v71 ) |
2542 { | 2526 { |
2543 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | 2527 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && a2->array_18[v71] <= a3->array_3D8[v71] ) |
2544 break; | 2528 break; |
2545 ++v57; | 2529 ++v57; |
2546 ++v7; | 2530 ++v7; |
2547 ++v71; | |
2548 ++v42; | 2531 ++v42; |
2549 } | 2532 } |
2550 while ( v71 <= v40 ); | 2533 } |
2551 } | |
2552 v72 = v40; | |
2553 if ( v40 < v7 ) | 2534 if ( v40 < v7 ) |
2554 return 0; | 2535 return false; |
2555 v58 = &v5->array_18[v40]; | 2536 v58 = &a2->array_18[v40]; |
2556 v43 = &v39->array_3D8[v40]; | 2537 v43 = &a3->array_3D8[v40]; |
2557 do | 2538 for ( v72 = v40; v72 >= v7; --v72 ) |
2558 { | 2539 { |
2559 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | 2540 if ( *(__int16 *)((char *)v43 + (int)(char *)a2 - (char *)a3) >= *(v43 - 480) && *v58 <= a3->array_3D8[v72] ) |
2560 break; | 2541 break; |
2561 --v58; | 2542 --v58; |
2562 --v40; | 2543 --v40; |
2563 --v72; | |
2564 --v43; | 2544 --v43; |
2565 v73 = v40; | 2545 v73 = v40; |
2566 } | 2546 } |
2567 while ( v72 >= v7 ); | |
2568 if ( v7 >= v40 ) | 2547 if ( v7 >= v40 ) |
2569 return 0; | 2548 return false; |
2570 a3b = (char *)v39 - (char *)v5; | 2549 a3b = (char *)a3 - (char *)a2; |
2571 v59 = &v39->array_3D8[v7]; | 2550 v59 = &a3->array_3D8[v7]; |
2572 v45 = &v5->array_18[v7]; | 2551 v45 = &a2->array_18[v7]; |
2573 v46 = v73 - v7 + 1; | 2552 |
2574 do | 2553 for ( v46 = v73 - v7 + 1; v46; --v46 ) |
2575 { | 2554 { |
2576 v47 = *(__int16 *)((char *)v45 + a3b); | 2555 v47 = *(__int16 *)((char *)v45 + a3b); |
2577 if ( *v45 < v47 ) | 2556 if ( *v45 < v47 ) |
2578 *v45 = v47; | 2557 *v45 = v47; |
2579 if ( v45[480] > *v59 ) | 2558 if ( v45[480] > *v59 ) |
2580 v45[480] = *v59; | 2559 v45[480] = *v59; |
2581 ++v59; | 2560 ++v59; |
2582 ++v45; | 2561 ++v45; |
2583 --v46; | 2562 } |
2584 } | 2563 a2->_viewport_space_y = v7; |
2585 while ( v46 ); | 2564 a2->_viewport_space_w = v73; |
2586 v5->_viewport_space_y = v7; | 2565 a2->field_8 = a2->array_18[v7]; |
2587 v5->_viewport_space_w = v73; | 2566 v48 = a2->array_3D8[v7]; |
2588 v5->field_8 = v5->array_18[v7]; | 2567 a2->field_10 = v7; |
2589 v48 = v5->array_3D8[v7]; | 2568 a2->field_14 = v7; |
2590 v5->field_10 = v7; | 2569 a2->field_C = v48; |
2591 v5->field_14 = v7; | |
2592 v49 = v7 + 1; | 2570 v49 = v7 + 1; |
2593 v5->field_C = v48; | |
2594 if ( v49 <= v73 ) | 2571 if ( v49 <= v73 ) |
2595 { | 2572 { |
2596 v50 = &v5->array_3D8[v49]; | 2573 v50 = &a2->array_3D8[v49]; |
2597 do | 2574 for ( v49; v49 <= v73; ++v49 ) |
2598 { | 2575 { |
2599 v51 = *(v50 - 480); | 2576 v51 = *(v50 - 480); |
2600 if ( v51 < v5->field_8 ) | 2577 if ( v51 < a2->field_8 ) |
2601 { | 2578 { |
2602 v5->field_8 = v51; | 2579 a2->field_8 = v51; |
2603 v5->field_10 = v49; | 2580 a2->field_10 = v49; |
2604 } | 2581 } |
2605 v52 = *v50; | 2582 if ( a2->array_3D8[v49] > a2->field_C ) |
2606 if ( v52 > v5->field_C ) | 2583 { |
2607 { | 2584 a2->field_C = a2->array_3D8[v49]; |
2608 v5->field_C = v52; | 2585 a2->field_14 = v49; |
2609 v5->field_14 = v49; | 2586 } |
2610 } | |
2611 ++v49; | |
2612 ++v50; | 2587 ++v50; |
2613 } | 2588 } |
2614 while ( v49 <= v73 ); | 2589 } |
2615 } | 2590 return true; |
2616 return 1; | |
2617 } | 2591 } |
2618 // 50B700: using guessed type int stru_50B700.field_0; | 2592 // 50B700: using guessed type int stru_50B700.field_0; |
2619 | 2593 |
2620 //----- (00424CD7) -------------------------------------------------------- | 2594 //----- (00424CD7) -------------------------------------------------------- |
2621 signed int __fastcall sr_424CD7(unsigned int uVertexID) | 2595 signed int __fastcall sr_424CD7(unsigned int uVertexID) |