comparison Indoor.cpp @ 68:fdacbc653945

BLV render: first image
author Nomad
date Sat, 27 Oct 2012 19:23:06 +0200
parents 5159d2e6f559
children 8453114181af
comparison
equal deleted inserted replaced
63:427b6c3b4e0f 68:fdacbc653945
449 int v17; // ebx@25 449 int v17; // ebx@25
450 //double v18; // st7@27 450 //double v18; // st7@27
451 //double v19; // st6@27 451 //double v19; // st6@27
452 //double v20; // st5@27 452 //double v20; // st5@27
453 //char v21; // dl@27 453 //char v21; // dl@27
454 unsigned int v22; // eax@44 454 //unsigned int v22; // eax@44
455 unsigned int v23; // eax@35 455 unsigned int v23; // eax@35
456 DWORD v24; // eax@37 456 DWORD v24; // eax@37
457 int v25; // eax@38 457 int v25; // eax@38
458 char *v26; // edi@38 458 //char *v26; // edi@38
459 IDirect3DTexture2 *v27; // eax@42 459 IDirect3DTexture2 *v27; // eax@42
460 Texture *v28; // [sp+Ch] [bp-1Ch]@15 460 Texture *v28; // [sp+Ch] [bp-1Ch]@15
461 int i; // [sp+10h] [bp-18h]@38 461 //int i; // [sp+10h] [bp-18h]@38
462 //LightmapBuilder *pStru4; // [sp+14h] [bp-14h]@16 462 //LightmapBuilder *pStru4; // [sp+14h] [bp-14h]@16
463 //IndoorCameraD3D *v31; // [sp+18h] [bp-10h]@16 463 //IndoorCameraD3D *v31; // [sp+18h] [bp-10h]@16
464 //IndoorCameraD3D_Vec4 *a7; // [sp+1Ch] [bp-Ch]@1 464 //IndoorCameraD3D_Vec4 *a7; // [sp+1Ch] [bp-Ch]@1
465 //unsigned int uFaceID_; // [sp+20h] [bp-8h]@1 465 //unsigned int uFaceID_; // [sp+20h] [bp-8h]@1
466 unsigned int uNumVerticesa; // [sp+24h] [bp-4h]@17 466 unsigned int uNumVerticesa; // [sp+24h] [bp-4h]@17
467 int a4a; // [sp+34h] [bp+Ch]@25 467 int a4a; // [sp+34h] [bp+Ch]@25
468 unsigned int a4b; // [sp+34h] [bp+Ch]@38 468 //unsigned int a4b; // [sp+34h] [bp+Ch]@38
469 469
470 //v4 = uFaceID; 470 //v4 = uFaceID;
471 //a7 = pVertices; 471 //a7 = pVertices;
472 //uFaceID_ = uFaceID; 472 //uFaceID_ = uFaceID;
473 if (uFaceID >= pIndoor->uNumFaces) 473 if (uFaceID >= pIndoor->uNumFaces)
503 static_vertices_F7C228[i].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[i]].y; 503 static_vertices_F7C228[i].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[i]].y;
504 static_vertices_F7C228[i].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[i]].z; 504 static_vertices_F7C228[i].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[i]].z;
505 static_vertices_F7C228[i].u = (signed)pFace->pVertexUIDs[i]; 505 static_vertices_F7C228[i].u = (signed)pFace->pVertexUIDs[i];
506 static_vertices_F7C228[i].v = (signed)pFace->pVertexUIDs[i]; 506 static_vertices_F7C228[i].v = (signed)pFace->pVertexUIDs[i];
507 } 507 }
508 if ( !pVertices 508
509 || (pGame->pStru9Instance->_498377(a4, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) ) 509 if (!pVertices ||
510 { 510 (pGame->pStru9Instance->_498377(a4, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
511 if ( pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum( 511 {
512 if (pGame->pIndoorCameraD3D->_437285_prolly_colide_vertices_against_frustrum(
512 static_vertices_F7C228, 513 static_vertices_F7C228,
513 &uNumVerticesa, 514 &uNumVerticesa,
514 static_vertices_F7B628, 515 static_vertices_F7B628,
515 pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 516 pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum,
516 4, 517 4,
517 false, 518 false,
518 0) != 1 519 0) != 1
519 || uNumVerticesa ) 520 || uNumVerticesa )
520 { 521 {
521 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel); 522 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel);
522 v17 = (248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | (((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | ((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) << 8)) << 8); 523 v17 = (248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | (((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) | ((248 - 8 * SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel)) << 8)) << 8);
523 sub_4B0E07(uFaceID); 524 sub_4B0E07(uFaceID);
524 pGame->pLightmapBuilder->ApplyLights_IndoorFace(uFaceID); 525 pGame->pLightmapBuilder->ApplyLights_IndoorFace(uFaceID);
525 pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID); 526 pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID);
526 pGame->pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28); 527 pGame->pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28);
527 pGame->pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0); 528 pGame->pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0);
528 pGame->pLightmapBuilder->std__vector_000004_size = 0; 529 pGame->pLightmapBuilder->std__vector_000004_size = 0;
529 if (stru_F8AD28.uNumLightsApplied > 0 || 530 if (stru_F8AD28.uNumLightsApplied > 0 ||
530 pDecalBuilder->uNumDecals > 0) 531 pDecalBuilder->uNumDecals > 0)
531 { 532 {
532 stru_F7B60C.face_plane.vNormal.x = pFace->pFacePlane.vNormal.x; 533 stru_F7B60C.face_plane.vNormal.x = pFace->pFacePlane.vNormal.x;
533 stru_F7B60C.polygonType = pFace->uPolygonType; 534 stru_F7B60C.polygonType = pFace->uPolygonType;
534 stru_F7B60C.face_plane.vNormal.y = pFace->pFacePlane.vNormal.y; 535 stru_F7B60C.face_plane.vNormal.y = pFace->pFacePlane.vNormal.y;
535 stru_F7B60C.face_plane.vNormal.z = pFace->pFacePlane.vNormal.z; 536 stru_F7B60C.face_plane.vNormal.z = pFace->pFacePlane.vNormal.z;
536 stru_F7B60C.face_plane.dist = pFace->pFacePlane.dist; 537 stru_F7B60C.face_plane.dist = pFace->pFacePlane.dist;
537 } 538 }
538 if (stru_F8AD28.uNumLightsApplied > 0 && 539
539 !(pFace->uAttributes & 0x400000)) 540 if (stru_F8AD28.uNumLightsApplied > 0 &&
540 pGame->pLightmapBuilder->ApplyLights( 541 !(pFace->uAttributes & 0x400000))
542 pGame->pLightmapBuilder->ApplyLights(
541 &stru_F8AD28, 543 &stru_F8AD28,
542 &stru_F7B60C, 544 &stru_F7B60C,
543 uNumVerticesa, 545 uNumVerticesa,
544 array_507D30, 546 array_507D30,
545 pVertices, 547 pVertices,
546 0); 548 0);
547 549
548 if (pDecalBuilder->uNumDecals > 0) 550 if (pDecalBuilder->uNumDecals > 0)
549 pDecalBuilder->ApplyDecals( 551 pDecalBuilder->ApplyDecals(
550 a4a, 552 a4a,
551 1, 553 1,
552 &stru_F7B60C, 554 &stru_F7B60C,
553 uNumVerticesa, 555 uNumVerticesa,
554 array_507D30, 556 array_507D30,
555 pVertices, 557 pVertices,
556 0, 558 0,
557 pFace->uSectorID); 559 pFace->uSectorID);
558 if (pFace->uAttributes & 0x10 && 560
559 pFace->uBitmapID == pRenderer->field_1036AC_bitmapid ) 561 if (pFace->Animated() &&
560 { 562 pFace->uBitmapID == pRenderer->field_1036AC_bitmapid )
561 v23 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]; 563 {
562 goto LABEL_42; 564 __debugbreak();
563 } 565 v23 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
564 if ( pFace->uAttributes & 0x10 ) 566 goto LABEL_42;
565 { 567 }
566 v24 = GetTickCount() >> 2; 568
567 if ( (signed int)uNumVerticesa > 0 ) 569 if (pFace->Animated())
568 { 570 {
569 v25 = v24 - stru_5C6E00->uIntegerHalfPi; 571 v24 = GetTickCount() / 4;
570 v26 = (char *)&array_507D30[0].v; 572 v25 = v24 - stru_5C6E00->uIntegerHalfPi;
571 a4b = uNumVerticesa; 573
572 for ( i = v25; ; v25 = i ) 574 for (uint i = 0; i < uNumVerticesa; ++i)
573 { 575 array_507D30[i].v += (double)(pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8));
574 *(float *)v26 = (double)(pBitmaps_LOD->pTextures[pFace->uBitmapID].uHeightMinus1 & (unsigned int)(stru_5C6E00->SinCos(v25) >> 8)) 576
575 + *(float *)v26; 577 v23 = pFace->uBitmapID;
576 v26 += 48; 578 goto LABEL_42;
577 --a4b; 579 }
578 if ( !a4b ) 580 else
579 break; 581 {
580 } 582 if (pFace->uAttributes & 0x4000)
581 } 583 {
582 } 584 v23 = pTextureFrameTable->GetFrameTexture(
583 else
584 {
585 v22 = pFace->uAttributes;
586 if ( BYTE1(v22) & 0x40 )
587 {
588 v23 = pTextureFrameTable->GetFrameTexture(
589 pFace->uBitmapID, 585 pFace->uBitmapID,
590 pBLVRenderParams->field_0_timer_); 586 pBLVRenderParams->field_0_timer_);
591 LABEL_42: 587 LABEL_42:
592 v27 = pBitmaps_LOD->pHardwareTextures[v23]; 588 v27 = pBitmaps_LOD->pHardwareTextures[v23];
593 if ( BYTE2(pFace->uAttributes) & 0x40 ) 589 if (pFace->uAttributes & 0x400000)
594 sub_479A53(uNumVerticesa, uFaceID); 590 _479A53_draw_some_blv_poly(uNumVerticesa, uFaceID);
595 else 591 else
596 pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | 6, v17, 0); 592 pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, 8 * uFaceID | 6, v17, 0);
597 return; 593 return;
598 } 594 }
599 } 595 }
600 v23 = pFace->uBitmapID; 596 }
601 goto LABEL_42; 597 }
602 }
603 }
604 } 598 }
605 } 599 }
606 600
607 //----- (004AFF79) -------------------------------------------------------- 601 //----- (004AFF79) --------------------------------------------------------
608 void IndoorLocation::ExecDraw_sw(unsigned int uFaceID) 602 void IndoorLocation::ExecDraw_sw(unsigned int uFaceID)