Mercurial > mm7
comparison Indoor.cpp @ 1643:7182930263b3
fixpoint functions renaming
author | zipi |
---|---|
date | Tue, 17 Sep 2013 19:24:23 +0100 |
parents | 8971dc85b8fb |
children | a395359afc8f |
comparison
equal
deleted
inserted
replaced
1642:8971dc85b8fb | 1643:7182930263b3 |
---|---|
395 _this.uFlags |= BLV_RENDER_DRAW_SW_OUTLINES; | 395 _this.uFlags |= BLV_RENDER_DRAW_SW_OUTLINES; |
396 _this.uFlags |= BLV_RENDER_DRAW_D3D_OUTLINES; | 396 _this.uFlags |= BLV_RENDER_DRAW_D3D_OUTLINES; |
397 | 397 |
398 _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed; | 398 _this.field_0_timer = pEventTimer->uTotalGameTimeElapsed; |
399 //_this.fov_deg = 65; | 399 //_this.fov_deg = 65; |
400 //_this.vPosition.x = pParty->vPosition.x - fixpoint_sub0(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); | 400 //_this.vPosition.x = pParty->vPosition.x - fixpoint_mul(stru_5C6E00->Cos(pParty->sRotationY), pParty->y_rotation_granularity); |
401 //_this.vPosition.y = pParty->vPosition.y - fixpoint_sub0(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); | 401 //_this.vPosition.y = pParty->vPosition.y - fixpoint_mul(stru_5C6E00->Sin(pParty->sRotationY), pParty->y_rotation_granularity); |
402 //_this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel; | 402 //_this.vPosition.z = pParty->vPosition.z + pParty->sEyelevel; |
403 //_this.sRotationX = pParty->sRotationX; | 403 //_this.sRotationX = pParty->sRotationX; |
404 //_this.sRotationY = pParty->sRotationY; | 404 //_this.sRotationY = pParty->sRotationY; |
405 _this.pRenderTarget = pRenderer->pTargetSurface; | 405 _this.pRenderTarget = pRenderer->pTargetSurface; |
406 _this.uViewportX = pViewport->uScreen_TL_X; | 406 _this.uViewportX = pViewport->uScreen_TL_X; |
2571 v32 = v1->x - v2->x; | 2571 v32 = v1->x - v2->x; |
2572 LODWORD(v33) = v32 << 16; | 2572 LODWORD(v33) = v32 << 16; |
2573 HIDWORD(v33) = v32 >> 16;*/ | 2573 HIDWORD(v33) = v32 >> 16;*/ |
2574 //fixpoint_div(v1->x - v2->x, v1->y - v2->y); | 2574 //fixpoint_div(v1->x - v2->x, v1->y - v2->y); |
2575 //_a58 = v33 / (v1->y - v2->y); | 2575 //_a58 = v33 / (v1->y - v2->y); |
2576 //_a59 = fixpoint_sub0(_a58, sY - v2->y); | 2576 //_a59 = fixpoint_mul(_a58, sY - v2->y); |
2577 auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); | 2577 auto x_div_y = fixpoint_div(v1->x - v2->x, v1->y - v2->y); |
2578 auto res = fixpoint_sub0(x_div_y, sY - v2->y); // a / b * c - looks like projection | 2578 auto res = fixpoint_mul(x_div_y, sY - v2->y); // a / b * c - looks like projection |
2579 if (res + v2->x > sX) | 2579 if (res + v2->x > sX) |
2580 ++v54; | 2580 ++v54; |
2581 } | 2581 } |
2582 else | 2582 else |
2583 { | 2583 { |
2584 auto x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y); | 2584 auto x_div_y = fixpoint_div(v2->x - v1->x, v2->y - v1->y); |
2585 auto res = fixpoint_sub0(x_div_y, sY - v1->y); | 2585 auto res = fixpoint_mul(x_div_y, sY - v1->y); |
2586 | 2586 |
2587 if (res + v1->x > sX) | 2587 if (res + v1->x > sX) |
2588 ++v54; | 2588 ++v54; |
2589 | 2589 |
2590 /*int _a58; | 2590 /*int _a58; |
2591 int _a59; | 2591 int _a59; |
2592 auto v32 = v2->x - v1->x; | 2592 auto v32 = v2->x - v1->x; |
2593 LODWORD(v33) = v32 << 16; | 2593 LODWORD(v33) = v32 << 16; |
2594 HIDWORD(v33) = v32 >> 16; | 2594 HIDWORD(v33) = v32 >> 16; |
2595 _a58 = v33 / (v2->y - v1->y); | 2595 _a58 = v33 / (v2->y - v1->y); |
2596 _a59 = fixpoint_sub0(_a58, sY - v1->y); | 2596 _a59 = fixpoint_mul(_a58, sY - v1->y); |
2597 | 2597 |
2598 if (_a59 + pVertices[k].x > sX) | 2598 if (_a59 + pVertices[k].x > sX) |
2599 ++v54;*/ | 2599 ++v54;*/ |
2600 } | 2600 } |
2601 } | 2601 } |
3443 v31 = stru_721530.normal2.y; | 3443 v31 = stru_721530.normal2.y; |
3444 v32 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 3444 v32 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
3445 } | 3445 } |
3446 else | 3446 else |
3447 { | 3447 { |
3448 v30 = v0->vPosition.x + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); | 3448 v30 = v0->vPosition.x + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
3449 v31 = v0->vPosition.y + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); | 3449 v31 = v0->vPosition.y + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
3450 v32 = v0->vPosition.z + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); | 3450 v32 = v0->vPosition.z + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
3451 } | 3451 } |
3452 v33 = collide_against_floor(v30, v31, v32, &stru_721530.uSectorID, &uFaceID); | 3452 v33 = collide_against_floor(v30, v31, v32, &stru_721530.uSectorID, &uFaceID); |
3453 v34 = pIndoor->pFaces[uFaceID].uAttributes; | 3453 v34 = pIndoor->pFaces[uFaceID].uAttributes; |
3454 v35 = v34 & 0x400000; | 3454 v35 = v34 & 0x400000; |
3455 if (v35 && v0->uAIState == Dead) | 3455 if (v35 && v0->uAIState == Dead) |
3470 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; | 3470 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; |
3471 v0->uSectorID = LOWORD(stru_721530.uSectorID); | 3471 v0->uSectorID = LOWORD(stru_721530.uSectorID); |
3472 goto LABEL_123; | 3472 goto LABEL_123; |
3473 } | 3473 } |
3474 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; | 3474 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; |
3475 v0->vPosition.x += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); | 3475 v0->vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
3476 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; | 3476 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; |
3477 v0->vPosition.y += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); | 3477 v0->vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
3478 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16; | 3478 //v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16; |
3479 v36 = stru_721530.uFaceID; | 3479 v36 = stru_721530.uFaceID; |
3480 v0->vPosition.z += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); | 3480 v0->vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
3481 v0->uSectorID = LOWORD(stru_721530.uSectorID); | 3481 v0->uSectorID = LOWORD(stru_721530.uSectorID); |
3482 stru_721530.field_70 += stru_721530.field_7C; | 3482 stru_721530.field_70 += stru_721530.field_7C; |
3483 v37 = PID_ID(v36); | 3483 v37 = PID_ID(v36); |
3484 if ( PID_TYPE(v36) != OBJECT_Actor) | 3484 if ( PID_TYPE(v36) != OBJECT_Actor) |
3485 { | 3485 { |
3489 { | 3489 { |
3490 _this = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); | 3490 _this = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); |
3491 v45 = stru_5C6E00->Atan2( | 3491 v45 = stru_5C6E00->Atan2( |
3492 v0->vPosition.x - pLevelDecorations[v37].vPosition.x, | 3492 v0->vPosition.x - pLevelDecorations[v37].vPosition.x, |
3493 v0->vPosition.y - pLevelDecorations[v37].vPosition.y); | 3493 v0->vPosition.y - pLevelDecorations[v37].vPosition.y); |
3494 v0->vVelocity.x = fixpoint_sub0(stru_5C6E00->Cos(v45), _this); | 3494 v0->vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v45), _this); |
3495 v0->vVelocity.y = fixpoint_sub0(stru_5C6E00->Sin(v45), _this); | 3495 v0->vVelocity.y = fixpoint_mul(stru_5C6E00->Sin(v45), _this); |
3496 goto LABEL_119; | 3496 goto LABEL_119; |
3497 } | 3497 } |
3498 if ( PID_TYPE(v36) == OBJECT_BModel) | 3498 if ( PID_TYPE(v36) == OBJECT_BModel) |
3499 { | 3499 { |
3500 stru_721530.field_84 = v36 >> 3; | 3500 stru_721530.field_84 = v36 >> 3; |
3519 + v38->pFacePlane_old.vNormal.z | 3519 + v38->pFacePlane_old.vNormal.z |
3520 * v0->vVelocity.z) >> 16; | 3520 * v0->vVelocity.z) >> 16; |
3521 if ( (stru_721530.speed >> 3) > v61 ) | 3521 if ( (stru_721530.speed >> 3) > v61 ) |
3522 v61 = stru_721530.speed >> 3; | 3522 v61 = stru_721530.speed >> 3; |
3523 | 3523 |
3524 v0->vVelocity.x += fixpoint_sub0(v61, v38->pFacePlane_old.vNormal.x); | 3524 v0->vVelocity.x += fixpoint_mul(v61, v38->pFacePlane_old.vNormal.x); |
3525 v0->vVelocity.y += fixpoint_sub0(v61, v38->pFacePlane_old.vNormal.y); | 3525 v0->vVelocity.y += fixpoint_mul(v61, v38->pFacePlane_old.vNormal.y); |
3526 v0->vVelocity.z += fixpoint_sub0(v61, v38->pFacePlane_old.vNormal.z); | 3526 v0->vVelocity.z += fixpoint_mul(v61, v38->pFacePlane_old.vNormal.z); |
3527 v41 = v38->uPolygonType; | 3527 v41 = v38->uPolygonType; |
3528 if ( v41 != 4 && v41 != 3 ) | 3528 if ( v41 != 4 && v41 != 3 ) |
3529 { | 3529 { |
3530 v42 = v38->pFacePlane_old.vNormal.x; | 3530 v42 = v38->pFacePlane_old.vNormal.x; |
3531 v43 = v0->vPosition.z; | 3531 v43 = v0->vPosition.z; |
3545 } | 3545 } |
3546 if ( BYTE3(v38->uAttributes) & 8 ) | 3546 if ( BYTE3(v38->uAttributes) & 8 ) |
3547 EventProcessor(pIndoor->pFaceExtras[v38->uFaceExtraID].uEventID, 0, 1); | 3547 EventProcessor(pIndoor->pFaceExtras[v38->uFaceExtraID].uEventID, 0, 1); |
3548 } | 3548 } |
3549 LABEL_119: | 3549 LABEL_119: |
3550 v0->vVelocity.x = fixpoint_sub0(58500, v0->vVelocity.x); | 3550 v0->vVelocity.x = fixpoint_mul(58500, v0->vVelocity.x); |
3551 v0->vVelocity.y = fixpoint_sub0(58500, v0->vVelocity.y); | 3551 v0->vVelocity.y = fixpoint_mul(58500, v0->vVelocity.y); |
3552 v0->vVelocity.z = fixpoint_sub0(58500, v0->vVelocity.z); | 3552 v0->vVelocity.z = fixpoint_mul(58500, v0->vVelocity.z); |
3553 v22 = 0; | 3553 v22 = 0; |
3554 goto LABEL_120; | 3554 goto LABEL_120; |
3555 } | 3555 } |
3556 if ( v0->GetActorsRelation(0) ) | 3556 if ( v0->GetActorsRelation(0) ) |
3557 { | 3557 { |
4068 else if (!v15) | 4068 else if (!v15) |
4069 ++v53; | 4069 ++v53; |
4070 else | 4070 else |
4071 { | 4071 { |
4072 auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]); | 4072 auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]); |
4073 auto res = fixpoint_sub0((signed int)word_721460_xs[j + 1] - (signed int)word_721460_xs[j], a_div_b); | 4073 auto res = fixpoint_mul((signed int)word_721460_xs[j + 1] - (signed int)word_721460_xs[j], a_div_b); |
4074 | 4074 |
4075 if (res + word_721460_xs[j] >= x) | 4075 if (res + word_721460_xs[j] >= x) |
4076 ++v53; | 4076 ++v53; |
4077 } | 4077 } |
4078 } | 4078 } |
4086 { | 4086 { |
4087 v21 = pIndoor->pVertices[pFloor->pVertexIDs[0]].z; | 4087 v21 = pIndoor->pVertices[pFloor->pVertexIDs[0]].z; |
4088 } | 4088 } |
4089 else | 4089 else |
4090 { | 4090 { |
4091 v21 = fixpoint_sub0(pFloor->zCalc1, x) + fixpoint_sub0(pFloor->zCalc2, y) + (short)(pFloor->zCalc3 >> 16); | 4091 v21 = fixpoint_mul(pFloor->zCalc1, x) + fixpoint_mul(pFloor->zCalc2, y) + (short)(pFloor->zCalc3 >> 16); |
4092 } | 4092 } |
4093 blv_floor_level[v55] = v21; | 4093 blv_floor_level[v55] = v21; |
4094 blv_floor_id[v55] = pSector->pFloors[i]; | 4094 blv_floor_id[v55] = pSector->pFloors[i]; |
4095 v55++; | 4095 v55++; |
4096 } | 4096 } |
4139 if ( !v29 ) | 4139 if ( !v29 ) |
4140 ++v54; | 4140 ++v54; |
4141 else | 4141 else |
4142 { | 4142 { |
4143 auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]); | 4143 auto a_div_b = fixpoint_div(y - word_721390_ys[j], word_721390_ys[j + 1] - word_721390_ys[j]); |
4144 auto res = fixpoint_sub0(word_721460_xs[j + 1] - word_721460_xs[j], a_div_b); | 4144 auto res = fixpoint_mul(word_721460_xs[j + 1] - word_721460_xs[j], a_div_b); |
4145 if (res + word_721460_xs[j] >= x) | 4145 if (res + word_721460_xs[j] >= x) |
4146 ++v54; | 4146 ++v54; |
4147 } | 4147 } |
4148 } | 4148 } |
4149 } | 4149 } |
5162 //v12 = -pBLVRenderParams->vPartyPos.z; | 5162 //v12 = -pBLVRenderParams->vPartyPos.z; |
5163 if (pGame->pIndoorCameraD3D->sRotationX) | 5163 if (pGame->pIndoorCameraD3D->sRotationX) |
5164 { | 5164 { |
5165 v16 = v8 * -pGame->pIndoorCameraD3D->vPartyPos.x + v29 * -pGame->pIndoorCameraD3D->vPartyPos.y; | 5165 v16 = v8 * -pGame->pIndoorCameraD3D->vPartyPos.x + v29 * -pGame->pIndoorCameraD3D->vPartyPos.y; |
5166 v17 = -65536 * pGame->pIndoorCameraD3D->vPartyPos.z; | 5166 v17 = -65536 * pGame->pIndoorCameraD3D->vPartyPos.z; |
5167 this->field_0_party_dir_x = fixpoint_sub0(v16, v28) + fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, v9); | 5167 this->field_0_party_dir_x = fixpoint_mul(v16, v28) + fixpoint_mul((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, v9); |
5168 this->field_4_party_dir_y = v8 * -pGame->pIndoorCameraD3D->vPartyPos.y - v29 * -pGame->pIndoorCameraD3D->vPartyPos.x; | 5168 this->field_4_party_dir_y = v8 * -pGame->pIndoorCameraD3D->vPartyPos.y - v29 * -pGame->pIndoorCameraD3D->vPartyPos.x; |
5169 this->field_8_party_dir_z = fixpoint_sub0(v17, v28) - fixpoint_sub0(v16, v9); | 5169 this->field_8_party_dir_z = fixpoint_mul(v17, v28) - fixpoint_mul(v16, v9); |
5170 } | 5170 } |
5171 else | 5171 else |
5172 { | 5172 { |
5173 this->field_0_party_dir_x = v8 * -pGame->pIndoorCameraD3D->vPartyPos.x + v29 * -pGame->pIndoorCameraD3D->vPartyPos.y; | 5173 this->field_0_party_dir_x = v8 * -pGame->pIndoorCameraD3D->vPartyPos.x + v29 * -pGame->pIndoorCameraD3D->vPartyPos.y; |
5174 this->field_4_party_dir_y = v8 * -pGame->pIndoorCameraD3D->vPartyPos.y - v29 * -pGame->pIndoorCameraD3D->vPartyPos.x; | 5174 this->field_4_party_dir_y = v8 * -pGame->pIndoorCameraD3D->vPartyPos.y - v29 * -pGame->pIndoorCameraD3D->vPartyPos.x; |
5175 this->field_8_party_dir_z = (-pGame->pIndoorCameraD3D->vPartyPos.z) << 16; | 5175 this->field_8_party_dir_z = (-pGame->pIndoorCameraD3D->vPartyPos.z) << 16; |
5176 } | 5176 } |
5177 | 5177 |
5178 if (pGame->pIndoorCameraD3D->sRotationX) | 5178 if (pGame->pIndoorCameraD3D->sRotationX) |
5179 { | 5179 { |
5180 v19 = fixpoint_sub0(a2, v8) + fixpoint_sub0(a3, v29); | 5180 v19 = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); |
5181 | 5181 |
5182 this->field_C = fixpoint_sub0(v19, v28) + fixpoint_sub0(a4, v9); | 5182 this->field_C = fixpoint_mul(v19, v28) + fixpoint_mul(a4, v9); |
5183 this->field_10 = fixpoint_sub0(a3, v8) - fixpoint_sub0(a2, v29); | 5183 this->field_10 = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); |
5184 this->field_14 = fixpoint_sub0(a4, v28) - fixpoint_sub0(v19, v9); | 5184 this->field_14 = fixpoint_mul(a4, v28) - fixpoint_mul(v19, v9); |
5185 } | 5185 } |
5186 else | 5186 else |
5187 { | 5187 { |
5188 this->field_C = fixpoint_sub0(a2, v8) + fixpoint_sub0(a3, v29); | 5188 this->field_C = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); |
5189 this->field_10 = fixpoint_sub0(a3, v8) - fixpoint_sub0(a2, v29); | 5189 this->field_10 = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); |
5190 this->field_14 = a4; | 5190 this->field_14 = a4; |
5191 } | 5191 } |
5192 | 5192 |
5193 if (pGame->pIndoorCameraD3D->sRotationX) | 5193 if (pGame->pIndoorCameraD3D->sRotationX) |
5194 { | 5194 { |
5195 v21 = fixpoint_sub0(a5, v8) + fixpoint_sub0(a6, v29); | 5195 v21 = fixpoint_mul(a5, v8) + fixpoint_mul(a6, v29); |
5196 | 5196 |
5197 this->field_18 = fixpoint_sub0(v21, v28) + fixpoint_sub0(a7, v9); | 5197 this->field_18 = fixpoint_mul(v21, v28) + fixpoint_mul(a7, v9); |
5198 this->field_1C = fixpoint_sub0(a6, v8) - fixpoint_sub0(a5, v29); | 5198 this->field_1C = fixpoint_mul(a6, v8) - fixpoint_mul(a5, v29); |
5199 this->field_20 = fixpoint_sub0(a7, v28) - fixpoint_sub0(v21, v9); | 5199 this->field_20 = fixpoint_mul(a7, v28) - fixpoint_mul(v21, v9); |
5200 } | 5200 } |
5201 else | 5201 else |
5202 { | 5202 { |
5203 this->field_18 = fixpoint_sub0(a5, v8) + fixpoint_sub0(a6, v29); | 5203 this->field_18 = fixpoint_mul(a5, v8) + fixpoint_mul(a6, v29); |
5204 this->field_1C = fixpoint_sub0(a6, v8) - fixpoint_sub0(a5, v29); | 5204 this->field_1C = fixpoint_mul(a6, v8) - fixpoint_mul(a5, v29); |
5205 this->field_20 = a7; | 5205 this->field_20 = a7; |
5206 } | 5206 } |
5207 | 5207 |
5208 this->field_18 = -this->field_18; | 5208 this->field_18 = -this->field_18; |
5209 this->field_1C = -this->field_1C; | 5209 this->field_1C = -this->field_1C; |
5533 //v108 = v70 / v107; | 5533 //v108 = v70 / v107; |
5534 v108 = fixpoint_div(v68, v107); | 5534 v108 = fixpoint_div(v68, v107); |
5535 if ( v108 >= 0 ) | 5535 if ( v108 >= 0 ) |
5536 { | 5536 { |
5537 if ( sub_4075DB( | 5537 if ( sub_4075DB( |
5538 pOut.x + ((signed int)(fixpoint_sub0(v108, v143) + 32768) >> 16), | 5538 pOut.x + ((signed int)(fixpoint_mul(v108, v143) + 32768) >> 16), |
5539 pOut.y + ((signed int)(fixpoint_sub0(v108, v147) + 32768) >> 16), | 5539 pOut.y + ((signed int)(fixpoint_mul(v108, v147) + 32768) >> 16), |
5540 outz + ((signed int)(fixpoint_sub0(v108, v151) + 32768) >> 16), | 5540 outz + ((signed int)(fixpoint_mul(v108, v151) + 32768) >> 16), |
5541 v62) ) | 5541 v62) ) |
5542 { | 5542 { |
5543 v114 = 1; | 5543 v114 = 1; |
5544 break; | 5544 break; |
5545 } | 5545 } |
5659 || v124 < v90->pBounding.x1 | 5659 || v124 < v90->pBounding.x1 |
5660 || v128 > v90->pBounding.y2 | 5660 || v128 > v90->pBounding.y2 |
5661 || v132 < v90->pBounding.y1 | 5661 || v132 < v90->pBounding.y1 |
5662 || v136 > v90->pBounding.z2 | 5662 || v136 > v90->pBounding.z2 |
5663 || v140 < v90->pBounding.z1 | 5663 || v140 < v90->pBounding.z1 |
5664 || (yb = fixpoint_sub0(v144, v90->pFacePlane_old.vNormal.x), | 5664 || (yb = fixpoint_mul(v144, v90->pFacePlane_old.vNormal.x), |
5665 v_4b = fixpoint_sub0(v148, v90->pFacePlane_old.vNormal.y), | 5665 v_4b = fixpoint_mul(v148, v90->pFacePlane_old.vNormal.y), |
5666 vf = fixpoint_sub0(v152, v90->pFacePlane_old.vNormal.z), | 5666 vf = fixpoint_mul(v152, v90->pFacePlane_old.vNormal.z), |
5667 v20 = yb + vf + v_4b == 0, | 5667 v20 = yb + vf + v_4b == 0, |
5668 v91 = yb + vf + v_4b, | 5668 v91 = yb + vf + v_4b, |
5669 vc = yb + vf + v_4b, | 5669 vc = yb + vf + v_4b, |
5670 v20) ) | 5670 v20) ) |
5671 goto LABEL_145; | 5671 goto LABEL_145; |
5702 //vd = v94 / vc; | 5702 //vd = v94 / vc; |
5703 vd = fixpoint_div(v93, vc); | 5703 vd = fixpoint_div(v93, vc); |
5704 if ( vd >= 0 ) | 5704 if ( vd >= 0 ) |
5705 { | 5705 { |
5706 if ( sub_4075DB( | 5706 if ( sub_4075DB( |
5707 pOut.x + ((signed int)(fixpoint_sub0(vd, v144) + 32768) >> 16), | 5707 pOut.x + ((signed int)(fixpoint_mul(vd, v144) + 32768) >> 16), |
5708 pOut.y + ((signed int)(fixpoint_sub0(vd, v148) + 32768) >> 16), | 5708 pOut.y + ((signed int)(fixpoint_mul(vd, v148) + 32768) >> 16), |
5709 outz + ((signed int)(fixpoint_sub0(vd, v152) + 32768) >> 16), | 5709 outz + ((signed int)(fixpoint_mul(vd, v152) + 32768) >> 16), |
5710 v90) ) | 5710 v90) ) |
5711 { | 5711 { |
5712 v113 = 1; | 5712 v113 = 1; |
5713 goto LABEL_148; | 5713 goto LABEL_148; |
5714 } | 5714 } |
5802 || v145 < v16->pBoundingBox.x1 | 5802 || v145 < v16->pBoundingBox.x1 |
5803 || v141 > v16->pBoundingBox.y2 | 5803 || v141 > v16->pBoundingBox.y2 |
5804 || v137 < v16->pBoundingBox.y1 | 5804 || v137 < v16->pBoundingBox.y1 |
5805 || v133 > v16->pBoundingBox.z2 | 5805 || v133 > v16->pBoundingBox.z2 |
5806 || v129 < v16->pBoundingBox.z1 | 5806 || v129 < v16->pBoundingBox.z1 |
5807 || (v17 = fixpoint_sub0(v125, v16->pFacePlane.vNormal.x), | 5807 || (v17 = fixpoint_mul(v125, v16->pFacePlane.vNormal.x), |
5808 v18 = fixpoint_sub0(v121, v16->pFacePlane.vNormal.y), | 5808 v18 = fixpoint_mul(v121, v16->pFacePlane.vNormal.y), |
5809 v19 = fixpoint_sub0(v117, v16->pFacePlane.vNormal.z), | 5809 v19 = fixpoint_mul(v117, v16->pFacePlane.vNormal.z), |
5810 v20 = v17 + v18 + v19 == 0, | 5810 v20 = v17 + v18 + v19 == 0, |
5811 v21 = v17 + v18 + v19, | 5811 v21 = v17 + v18 + v19, |
5812 v109 = v17 + v18 + v19, | 5812 v109 = v17 + v18 + v19, |
5813 v20) ) | 5813 v20) ) |
5814 goto LABEL_33; | 5814 goto LABEL_33; |
5833 //v110 = v25 / v109; | 5833 //v110 = v25 / v109; |
5834 v110 = fixpoint_div(v23, v109); | 5834 v110 = fixpoint_div(v23, v109); |
5835 if ( v110 >= 0 ) | 5835 if ( v110 >= 0 ) |
5836 { | 5836 { |
5837 if ( sub_4077F1( | 5837 if ( sub_4077F1( |
5838 pOut.x + ((signed int)(fixpoint_sub0(v110, v125) + 32768) >> 16), | 5838 pOut.x + ((signed int)(fixpoint_mul(v110, v125) + 32768) >> 16), |
5839 pOut.y + ((signed int)(fixpoint_sub0(v110, v121) + 32768) >> 16), | 5839 pOut.y + ((signed int)(fixpoint_mul(v110, v121) + 32768) >> 16), |
5840 outz + ((signed int)(fixpoint_sub0(v110, v117) + 32768) >> 16), | 5840 outz + ((signed int)(fixpoint_mul(v110, v117) + 32768) >> 16), |
5841 v16, | 5841 v16, |
5842 (BSPVertexBuffer *)a5) ) | 5842 (BSPVertexBuffer *)a5) ) |
5843 { | 5843 { |
5844 v114 = 1; | 5844 v114 = 1; |
5845 goto LABEL_36; | 5845 goto LABEL_36; |
5936 || v146 < v39->pBoundingBox.x1 | 5936 || v146 < v39->pBoundingBox.x1 |
5937 || v142 > v39->pBoundingBox.y2 | 5937 || v142 > v39->pBoundingBox.y2 |
5938 || v138 < v39->pBoundingBox.y1 | 5938 || v138 < v39->pBoundingBox.y1 |
5939 || v134 > v39->pBoundingBox.z2 | 5939 || v134 > v39->pBoundingBox.z2 |
5940 || v130 < v39->pBoundingBox.z1 | 5940 || v130 < v39->pBoundingBox.z1 |
5941 || (ya = fixpoint_sub0(v126, v39->pFacePlane.vNormal.x), | 5941 || (ya = fixpoint_mul(v126, v39->pFacePlane.vNormal.x), |
5942 ve = fixpoint_sub0(v122, v39->pFacePlane.vNormal.y), | 5942 ve = fixpoint_mul(v122, v39->pFacePlane.vNormal.y), |
5943 v_4 = fixpoint_sub0(v118, v39->pFacePlane.vNormal.z), | 5943 v_4 = fixpoint_mul(v118, v39->pFacePlane.vNormal.z), |
5944 v20 = ya + ve + v_4 == 0, | 5944 v20 = ya + ve + v_4 == 0, |
5945 v40 = ya + ve + v_4, | 5945 v40 = ya + ve + v_4, |
5946 va = ya + ve + v_4, | 5946 va = ya + ve + v_4, |
5947 v20) ) | 5947 v20) ) |
5948 goto LABEL_68; | 5948 goto LABEL_68; |
5966 //vb = v43 / va; | 5966 //vb = v43 / va; |
5967 vb = fixpoint_div(v42, va); | 5967 vb = fixpoint_div(v42, va); |
5968 if ( vb >= 0 ) | 5968 if ( vb >= 0 ) |
5969 { | 5969 { |
5970 if ( sub_4077F1( | 5970 if ( sub_4077F1( |
5971 pOut.x + ((signed int)(fixpoint_sub0(vb, v126) + 32768) >> 16), | 5971 pOut.x + ((signed int)(fixpoint_mul(vb, v126) + 32768) >> 16), |
5972 pOut.y + ((signed int)(fixpoint_sub0(vb, v122) + 32768) >> 16), | 5972 pOut.y + ((signed int)(fixpoint_mul(vb, v122) + 32768) >> 16), |
5973 outz + ((signed int)(fixpoint_sub0(vb, v118) + 32768) >> 16), | 5973 outz + ((signed int)(fixpoint_mul(vb, v118) + 32768) >> 16), |
5974 v39, | 5974 v39, |
5975 (BSPVertexBuffer *)a5a) ) | 5975 (BSPVertexBuffer *)a5a) ) |
5976 { | 5976 { |
5977 v113 = 1; | 5977 v113 = 1; |
5978 goto LABEL_71; | 5978 goto LABEL_71; |