Mercurial > mm7
comparison mm7_1.cpp @ 1187:02e2a5c1ebc0
BspRernderer refactoring continued
author | Ritor1 |
---|---|
date | Fri, 07 Jun 2013 11:30:29 +0600 |
parents | 883eaee77094 |
children | 1f92c110a4f2 312e895a6439 |
comparison
equal
deleted
inserted
replaced
1180:b542660e7302 | 1187:02e2a5c1ebc0 |
---|---|
2304 //int a3a; // [sp+48h] [bp+8h]@76 | 2304 //int a3a; // [sp+48h] [bp+8h]@76 |
2305 //int a3b; // [sp+48h] [bp+8h]@87 | 2305 //int a3b; // [sp+48h] [bp+8h]@87 |
2306 | 2306 |
2307 //try graphic engine with function returning 1 always, and without | 2307 //try graphic engine with function returning 1 always, and without |
2308 //return true; | 2308 //return true; |
2309 if ( !pNumVertices ) | 2309 if ( pNumVertices <= 1 ) |
2310 return false; | 2310 return false; |
2311 v7 = stru_50B700._screen_space_y[0]; | 2311 v7 = stru_50B700._screen_space_y[0]; |
2312 v65 = 0; | 2312 v65 = 0; |
2313 v8 = stru_50B700._screen_space_y[0]; | 2313 v8 = stru_50B700._screen_space_y[0]; |
2314 if ( !stru_50B700.field_0 ) | 2314 if ( !stru_50B700.field_0 ) |
2319 else | 2319 else |
2320 { | 2320 { |
2321 v63 = -1; | 2321 v63 = -1; |
2322 v64 = 1; | 2322 v64 = 1; |
2323 } | 2323 } |
2324 if ( pNumVertices <= 1 ) | 2324 |
2325 return false; | |
2326 for ( v6 = 1; v6 < pNumVertices; ++v6 ) | 2325 for ( v6 = 1; v6 < pNumVertices; ++v6 ) |
2327 { | 2326 { |
2328 if ( stru_50B700._screen_space_y[v6] >= v7 ) | 2327 if ( stru_50B700._screen_space_y[v6] >= v7 ) |
2329 { | 2328 { |
2330 if ( stru_50B700._screen_space_y[v6] > v8 ) | 2329 if ( stru_50B700._screen_space_y[v6] > v8 ) |
2336 v7 = stru_50B700._screen_space_y[v6]; | 2335 v7 = stru_50B700._screen_space_y[v6]; |
2337 } | 2336 } |
2338 } | 2337 } |
2339 if ( v8 == v7 ) | 2338 if ( v8 == v7 ) |
2340 return false; | 2339 return false; |
2340 | |
2341 v10 = v65; | 2341 v10 = v65; |
2342 a2->_viewport_space_y = v7; | 2342 a2->_viewport_space_y = v7; |
2343 a2->_viewport_space_w = v8; | 2343 a2->_viewport_space_w = v8; |
2344 v55 = v65; | 2344 v55 = v65; |
2345 if ( pNumVertices > 0 ) | 2345 |
2346 { | 2346 for ( v68 = 0; v68 < pNumVertices; ++v68 ) |
2347 //v11 = v65; | 2347 { |
2348 for ( v68 = 0; v68 < pNumVertices; ++v68 ) | 2348 v10 += v64; |
2349 { | 2349 if ( v10 < pNumVertices ) |
2350 v10 += v64; | 2350 { |
2351 if ( v10 < pNumVertices ) | 2351 if ( v10 < 0 ) |
2352 { | 2352 v10 += pNumVertices; |
2353 if ( v10 < 0 ) | 2353 } |
2354 v10 += pNumVertices; | 2354 else |
2355 } | 2355 v10 -= pNumVertices; |
2356 else | 2356 if ( stru_50B700._screen_space_y[v10] <= stru_50B700._screen_space_y[v65] ) |
2357 { | 2357 { |
2358 v10 -= pNumVertices; | 2358 v55 = v10; |
2359 } | 2359 v65 = v10; |
2360 if ( stru_50B700._screen_space_y[v10] <= stru_50B700._screen_space_y[v65] ) | 2360 } |
2361 { | 2361 if ( stru_50B700._screen_space_y[v10] == v8 ) |
2362 v55 = v10; | 2362 break; |
2363 v65 = v10; | |
2364 } | |
2365 if ( stru_50B700._screen_space_y[v10] == v8 ) | |
2366 break; | |
2367 } | |
2368 } | 2363 } |
2369 v13 = v55 + v64; | 2364 v13 = v55 + v64; |
2370 if ( v13 < pNumVertices ) | 2365 if ( v13 < pNumVertices ) |
2371 { | 2366 { |
2372 if ( v13 < 0 ) | 2367 if ( v13 < 0 ) |
2373 v13 += pNumVertices; | 2368 v13 += pNumVertices; |
2374 } | 2369 } |
2375 else | 2370 else |
2376 { | |
2377 v13 -= pNumVertices; | 2371 v13 -= pNumVertices; |
2378 } | |
2379 if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] ) | 2372 if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] ) |
2380 { | 2373 { |
2381 v62 = stru_50B700._screen_space_x[v55] << 16; | 2374 v62 = stru_50B700._screen_space_x[v55] << 16; |
2382 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]); | 2375 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]); |
2383 a2->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]); | 2376 a2->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]); |
2384 } | 2377 } |
2385 v15 = v65; | 2378 v15 = v65; |
2386 v61 = v65; | 2379 v61 = v65; |
2387 if ( pNumVertices > 0 ) | 2380 |
2388 { | 2381 for ( v69 = 0; v69 < pNumVertices; ++v69 ) |
2389 //v16 = v65; | 2382 { |
2390 for ( v69 = 0; v69 < pNumVertices; ++v69 ) | 2383 v15 += v63; |
2391 { | 2384 if ( v15 < pNumVertices ) |
2392 v15 += v63; | 2385 { |
2393 if ( v15 < pNumVertices ) | 2386 if ( v15 < 0 ) |
2394 { | 2387 v15 += pNumVertices; |
2395 if ( v15 < 0 ) | 2388 } |
2396 v15 += pNumVertices; | 2389 else |
2397 } | 2390 v15 -= pNumVertices; |
2398 else | 2391 if ( stru_50B700._screen_space_y[v15] <= stru_50B700._screen_space_y[v65] ) |
2399 { | 2392 { |
2400 v15 -= pNumVertices; | 2393 v61 = v15; |
2401 } | 2394 v65 = v15; |
2402 if ( stru_50B700._screen_space_y[v15] <= stru_50B700._screen_space_y[v65] ) | 2395 } |
2403 { | 2396 if ( stru_50B700._screen_space_y[v15] == v8 ) |
2404 v61 = v15; | 2397 break; |
2405 v65 = v15; | |
2406 } | |
2407 if ( stru_50B700._screen_space_y[v15] == v8 ) | |
2408 break; | |
2409 } | |
2410 } | 2398 } |
2411 v18 = v63 + v61; | 2399 v18 = v63 + v61; |
2412 if ( v18 < pNumVertices ) | 2400 if ( v18 < pNumVertices ) |
2413 { | 2401 { |
2414 if ( v18 < 0 ) | 2402 if ( v18 < 0 ) |
2415 v18 += pNumVertices; | 2403 v18 += pNumVertices; |
2416 } | 2404 } |
2417 else | 2405 else |
2418 { | |
2419 v18 -= pNumVertices; | 2406 v18 -= pNumVertices; |
2420 } | |
2421 v19 = v18; | 2407 v19 = v18; |
2422 v20 = v61; | 2408 v20 = v61; |
2423 if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] ) | 2409 if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] ) |
2424 { | 2410 { |
2425 v61 = stru_50B700._screen_space_x[v20] << 16; | 2411 v61 = stru_50B700._screen_space_x[v20] << 16; |
2441 { | 2427 { |
2442 if ( v13 < 0 ) | 2428 if ( v13 < 0 ) |
2443 v13 += pNumVertices; | 2429 v13 += pNumVertices; |
2444 } | 2430 } |
2445 else | 2431 else |
2446 { | |
2447 v13 -= pNumVertices; | 2432 v13 -= pNumVertices; |
2448 } | |
2449 v26 = v13; | 2433 v26 = v13; |
2450 //v27 = stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24]; | 2434 //v27 = stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24]; |
2451 if ( stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24] > 0 ) | 2435 if ( stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24] > 0 ) |
2452 { | 2436 { |
2453 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]; | 2437 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]; |
2462 { | 2446 { |
2463 if ( v18 < 0 ) | 2447 if ( v18 < 0 ) |
2464 v18 += pNumVertices; | 2448 v18 += pNumVertices; |
2465 } | 2449 } |
2466 else | 2450 else |
2467 { | |
2468 v18 -= pNumVertices; | 2451 v18 -= pNumVertices; |
2469 } | |
2470 v31 = v18; | 2452 v31 = v18; |
2471 //v32 = stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29]; | 2453 //v32 = stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29]; |
2472 if ( stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29] > 0 ) | 2454 if ( stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29] > 0 ) |
2473 { | 2455 { |
2474 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]; | 2456 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]; |