comparison mm7_4.cpp @ 725:7037f22cd716

little continue
author Ritor1
date Fri, 22 Mar 2013 01:29:25 +0600
parents 256211e8243a
children 9d13d2ec35a6
comparison
equal deleted inserted replaced
724:737d7fec67f0 725:7037f22cd716
328 { 328 {
329 if ( v55 >= 50 ) 329 if ( v55 >= 50 )
330 break; 330 break;
331 if ( pFloor->uPolygonType == POLYGON_Floor || pFloor->uPolygonType == POLYGON_Ceiling ) 331 if ( pFloor->uPolygonType == POLYGON_Floor || pFloor->uPolygonType == POLYGON_Ceiling )
332 { 332 {
333 v21 = pIndoor->pVertices[*pFloor->pVertexIDs].z; 333 v21 = pIndoor->pVertices[pFloor->pVertexIDs[0]].z;
334 } 334 }
335 else 335 else
336 { 336 {
337 v21 = ((pFloor->zCalc1 * x) >> 16) + ((pFloor->zCalc2 * y) >> 16) + pFloor->zCalc3; 337 v21 = ((unsigned __int64)(pFloor->zCalc1 * (signed __int64)x) >> 16) + ((unsigned __int64)(pFloor->zCalc2 * (signed __int64)y) >> 16)
338 + HIWORD(pFloor->zCalc3);
338 } 339 }
339 v22 = v55++; 340 v22 = v55++;
340 dword_7212C8[v22] = v21; 341 blv_floor_level[v22] = v21;
341 dword_721200[v22] = pSector->pFloors[i]; 342 dword_721200[v22] = pSector->pFloors[i];
342 } 343 }
343 } 344 }
344 } 345 }
345 } 346 }
392 if ( v54 == 1 ) 393 if ( v54 == 1 )
393 { 394 {
394 if ( v55 >= 50 ) 395 if ( v55 >= 50 )
395 break; 396 break;
396 v34 = v55++; 397 v34 = v55++;
397 dword_7212C8[v34] = -29000; 398 blv_floor_level[v34] = -29000;
398 dword_721200[v34] = pSector->pPortals[i]; 399 dword_721200[v34] = pSector->pPortals[i];
399 } 400 }
400 } 401 }
401 } 402 }
402 } 403 }
403 } 404 }
404 if ( v55 == 1 ) 405 if ( v55 == 1 )
405 { 406 {
406 *pFaceID = dword_721200[0]; 407 *pFaceID = dword_721200[0];
407 return dword_7212C8[0]; 408 return blv_floor_level[0];
408 } 409 }
409 if ( !v55 ) 410 if ( !v55 )
410 return -30000; 411 return -30000;
411 *pFaceID = dword_721200[0]; 412 *pFaceID = dword_721200[0];
412 result = dword_7212C8[0]; 413 //result = blv_floor_level[0];
413 if ( v55 > 1 ) 414 if ( v55 > 1 )
414 { 415 {
415 for ( v35 = 1; v35 < v55; ++v35 ) 416 for ( v35 = 1; v35 < v55; ++v35 )
416 { 417 {
417 if ( result <= z + 5 ) 418 if ( blv_floor_level[0] <= z + 5 )
418 { 419 {
419 if ( dword_7212C8[v35] >= result || dword_7212C8[v35] > z + 5 ) 420 if ( blv_floor_level[v35] >= blv_floor_level[0] || blv_floor_level[v35] > z + 5 )
420 continue; 421 continue;
421 result = dword_7212C8[v35]; 422 blv_floor_level[0] = blv_floor_level[v35];
422 *pFaceID = dword_721200[v35]; 423 *pFaceID = dword_721200[v35];
423 continue; 424 continue;
424 } 425 }
425 if ( dword_7212C8[v35] < result ) 426 if ( blv_floor_level[v35] < blv_floor_level[0] )
426 { 427 {
427 result = dword_7212C8[v35]; 428 blv_floor_level[0] = blv_floor_level[v35];
428 *pFaceID = dword_721200[v35]; 429 *pFaceID = dword_721200[v35];
429 } 430 }
430 } 431 }
431 } 432 }
432 return result; 433 return blv_floor_level[0];
433 } 434 }
434 435
435 //----- (0046D49E) -------------------------------------------------------- 436 //----- (0046D49E) --------------------------------------------------------
436 int __fastcall ODM_GetFloorLevel(int X, signed int Y, int Z, int a4, int *a5, int *a6, int a7) 437 int __fastcall ODM_GetFloorLevel(int X, signed int Y, int Z, int a4, int *a5, int *a6, int a7)
437 { 438 {
466 signed int v49; // [sp+58h] [bp+18h]@43 467 signed int v49; // [sp+58h] [bp+18h]@43
467 468
468 v46 = 1; 469 v46 = 1;
469 dword_721160[0] = -1; 470 dword_721160[0] = -1;
470 dword_721110[0] = -1; 471 dword_721110[0] = -1;
471 floor_level[0] = GetTerrainHeightsAroundParty2(X, Y, a5, a7); 472 odm_floor_level[0] = GetTerrainHeightsAroundParty2(X, Y, a5, a7);
472 if ( (signed int)pOutdoor->uNumBModels <= 0 ) 473 if ( (signed int)pOutdoor->uNumBModels <= 0 )
473 { 474 {
474 *a6 = 0; 475 *a6 = 0;
475 return floor_level[0]; 476 return odm_floor_level[0];
476 } 477 }
477 v38 = 0; 478 v38 = 0;
478 for ( pBModelNum = 0; pBModelNum < (signed int)pOutdoor->uNumBModels; ++pBModelNum ) 479 for ( pBModelNum = 0; pBModelNum < (signed int)pOutdoor->uNumBModels; ++pBModelNum )
479 { 480 {
480 pBModel = &pOutdoor->pBModels[v38]; 481 pBModel = &pOutdoor->pBModels[v38];
536 if ( v46 >= 20 ) 537 if ( v46 >= 20 )
537 break; 538 break;
538 if ( pFace->uPolygonType == POLYGON_Floor ) 539 if ( pFace->uPolygonType == POLYGON_Floor )
539 v24 = pBModel->pVertices.pVertices[pFace->pVertexIDs[0]].z; 540 v24 = pBModel->pVertices.pVertices[pFace->pVertexIDs[0]].z;
540 else 541 else
541 v24 = ((pFace->zCalc1 * X) >> 16) + ((pFace->zCalc2 * Y) >> 16) + pFace->zCalc3; 542 v24 = ((unsigned __int64)(pFace->zCalc1 * (signed __int64)X) >> 16) + ((unsigned __int64)(pFace->zCalc2 * (signed __int64)Y) >> 16)
543 + HIWORD(pFace->zCalc3);
542 v25 = v46++; 544 v25 = v46++;
543 floor_level[v25] = v24; 545 odm_floor_level[v25] = v24;
544 dword_721160[v25] = pBModelNum; 546 dword_721160[v25] = pBModelNum;
545 dword_721110[v25] = pFaceNum; 547 dword_721110[v25] = pFaceNum;
546 } 548 }
547 } 549 }
548 } 550 }
553 ++v38; 555 ++v38;
554 } 556 }
555 if ( v46 == 1 ) 557 if ( v46 == 1 )
556 { 558 {
557 *a6 = 0; 559 *a6 = 0;
558 return floor_level[0]; 560 return odm_floor_level[0];
559 } 561 }
560 v27 = 0; 562 v27 = 0;
561 if ( v46 <= 1 ) 563 if ( v46 <= 1 )
562 *a6 = 0; 564 *a6 = 0;
563 else 565 else
564 { 566 {
565 v28 = 0; 567 //v29 = 1;
566 v29 = 1;
567 for ( v49 = 1; v49 < v46; ++v49 ) 568 for ( v49 = 1; v49 < v46; ++v49 )
568 { 569 {
569 if ( floor_level[v29] == floor_level[v28] ) 570 if ( odm_floor_level[v49] == odm_floor_level[0] )
570 { 571 {
571 v27 = v49; 572 v27 = v49;
572 v28 = v29 * 4; 573 //++v29;
573 ++v29;
574 break; 574 break;
575 } 575 }
576 if ( floor_level[v28] > Z + 5 ) 576 if ( odm_floor_level[0] > Z + 5 )
577 { 577 {
578 if ( floor_level[v29] >= floor_level[v28] ) 578 if ( odm_floor_level[v49] >= odm_floor_level[0] )
579 { 579 {
580 ++v29; 580 //++v29;
581 break; 581 break;
582 } 582 }
583 v27 = v49; 583 v27 = v49;
584 v28 = v29 * 4; 584 //++v29;
585 ++v29;
586 break; 585 break;
587 } 586 }
588 if ( floor_level[v29] > floor_level[v28] && floor_level[v29] <= Z + 5 ) 587 if ( odm_floor_level[v49] > odm_floor_level[0] && odm_floor_level[v49] <= Z + 5 )
589 { 588 {
590 v27 = v49; 589 v27 = v49;
591 v28 = v29 * 4; 590 //++v29;
592 ++v29;
593 } 591 }
594 } 592 }
595 if ( !v27 ) 593 if ( !v27 )
596 *a6 = 0; 594 *a6 = 0;
597 else 595 else
602 v32 = &pOutdoor->pBModels[dword_721160[v27]].pFaces[dword_721110[v27]]; 600 v32 = &pOutdoor->pBModels[dword_721160[v27]].pFaces[dword_721110[v27]];
603 *a5 = 0; 601 *a5 = 0;
604 if ( v32->uAttributes & 0x10 ) 602 if ( v32->uAttributes & 0x10 )
605 *a5 = 1; 603 *a5 = 1;
606 } 604 }
607 v33 = floor_level[v27]; 605 if ( odm_floor_level[v27] >= odm_floor_level[0] )
608 result = floor_level[0]; 606 odm_floor_level[0] = odm_floor_level[v27];
609 if ( v33 >= floor_level[0] ) 607 return odm_floor_level[0];
610 result = v33;
611 return result;
612 } 608 }
613 609
614 //----- (0046D8E3) -------------------------------------------------------- 610 //----- (0046D8E3) --------------------------------------------------------
615 int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4) 611 int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4)
616 { 612 {