Mercurial > mm7
comparison mm7_3.cpp @ 1643:7182930263b3
fixpoint functions renaming
author | zipi |
---|---|
date | Tue, 17 Sep 2013 19:24:23 +0100 |
parents | 8971dc85b8fb |
children | bac69d9157b6 |
comparison
equal
deleted
inserted
replaced
1642:8971dc85b8fb | 1643:7182930263b3 |
---|---|
792 if (dt) | 792 if (dt) |
793 v7 = dt; | 793 v7 = dt; |
794 else | 794 else |
795 v7 = pEventTimer->dt_in_some_format; | 795 v7 = pEventTimer->dt_in_some_format; |
796 | 796 |
797 v8 = fixpoint_sub0(v7, speed) - v2->field_70; // speed * dt - something | 797 v8 = fixpoint_mul(v7, speed) - v2->field_70; // speed * dt - something |
798 v2->field_6C = v8; | 798 v2->field_6C = v8; |
799 if ( v8 > 0 ) | 799 if ( v8 > 0 ) |
800 { | 800 { |
801 v10 = fixpoint_sub0(v8, v2->direction.x) + v2->normal.x; | 801 v10 = fixpoint_mul(v8, v2->direction.x) + v2->normal.x; |
802 v2->field_4C = v10; | 802 v2->field_4C = v10; |
803 v2->normal2.x = v10; | 803 v2->normal2.x = v10; |
804 v11 = fixpoint_sub0(v2->field_6C, v2->direction.y) + v2->normal.y; | 804 v11 = fixpoint_mul(v2->field_6C, v2->direction.y) + v2->normal.y; |
805 v2->field_50 = v11; | 805 v2->field_50 = v11; |
806 v2->normal2.y = v11; | 806 v2->normal2.y = v11; |
807 v2->normal2.z = fixpoint_sub0(v2->field_6C, v2->direction.z) + v2->normal.z; | 807 v2->normal2.z = fixpoint_mul(v2->field_6C, v2->direction.z) + v2->normal.z; |
808 v12 = v2->position.z; | 808 v12 = v2->position.z; |
809 v13 = v2->normal.x; | 809 v13 = v2->normal.x; |
810 v14 = v2->normal2.x; | 810 v14 = v2->normal2.x; |
811 v15 = v2->prolly_normal_d; | 811 v15 = v2->prolly_normal_d; |
812 v16 = v12 + fixpoint_sub0(v2->field_6C, v2->direction.z); | 812 v16 = v12 + fixpoint_mul(v2->field_6C, v2->direction.z); |
813 v28 = v16; | 813 v28 = v16; |
814 v2->field_54 = v16; | 814 v2->field_54 = v16; |
815 v17 = v13; | 815 v17 = v13; |
816 if ( v13 >= v14 ) | 816 if ( v13 >= v14 ) |
817 v17 = v14; | 817 v17 = v14; |
989 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 1 ) | 989 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 1 ) |
990 v8 *= flt_6BE3AC_debug_recmod1_x_1_6; | 990 v8 *= flt_6BE3AC_debug_recmod1_x_1_6; |
991 if ( v8 > 1000 ) | 991 if ( v8 > 1000 ) |
992 v8 = 1000; | 992 v8 = 1000; |
993 | 993 |
994 v0->vVelocity.x = fixpoint_sub0(stru_5C6E00->Cos(v0->uYawAngle), v8); | 994 v0->vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v0->uYawAngle), v8); |
995 v0->vVelocity.y = fixpoint_sub0(stru_5C6E00->Sin(v0->uYawAngle), v8); | 995 v0->vVelocity.y = fixpoint_mul(stru_5C6E00->Sin(v0->uYawAngle), v8); |
996 if ( uIsFlying ) | 996 if ( uIsFlying ) |
997 { | 997 { |
998 v0->vVelocity.z = fixpoint_sub0(stru_5C6E00->Sin(v0->uPitchAngle), v8); | 998 v0->vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(v0->uPitchAngle), v8); |
999 } | 999 } |
1000 //v7 = v68; | 1000 //v7 = v68; |
1001 } | 1001 } |
1002 else | 1002 else |
1003 { | 1003 { |
1004 v0->vVelocity.x = fixpoint_sub0(55000, v0->vVelocity.x); | 1004 v0->vVelocity.x = fixpoint_mul(55000, v0->vVelocity.x); |
1005 v0->vVelocity.y = fixpoint_sub0(55000, v0->vVelocity.y); | 1005 v0->vVelocity.y = fixpoint_mul(55000, v0->vVelocity.y); |
1006 if ( uIsFlying ) | 1006 if ( uIsFlying ) |
1007 { | 1007 { |
1008 v0->vVelocity.z = fixpoint_sub0(55000, v0->vVelocity.z); | 1008 v0->vVelocity.z = fixpoint_mul(55000, v0->vVelocity.z); |
1009 } | 1009 } |
1010 } | 1010 } |
1011 if ( v0->vPosition.z < v5 ) | 1011 if ( v0->vPosition.z < v5 ) |
1012 { | 1012 { |
1013 v16 = uIsFlying; | 1013 v16 = uIsFlying; |
1026 //v22 = v62.z; | 1026 //v22 = v62.z; |
1027 //v23 = v62.y * v0->vVelocity.y; | 1027 //v23 = v62.y * v0->vVelocity.y; |
1028 v0->vVelocity.z += -8 * LOWORD(pEventTimer->uTimeElapsed) * v20; | 1028 v0->vVelocity.z += -8 * LOWORD(pEventTimer->uTimeElapsed) * v20; |
1029 int v73 = abs(v62.x * v0->vVelocity.x + v62.z * v0->vVelocity.z + v62.y * v0->vVelocity.y) >> 16; | 1029 int v73 = abs(v62.x * v0->vVelocity.x + v62.z * v0->vVelocity.z + v62.y * v0->vVelocity.y) >> 16; |
1030 //v72b = v21; | 1030 //v72b = v21; |
1031 v0->vVelocity.x += fixpoint_sub0(v73, v62.x); | 1031 v0->vVelocity.x += fixpoint_mul(v73, v62.x); |
1032 v0->vVelocity.y += fixpoint_sub0(v73, v62.y); | 1032 v0->vVelocity.y += fixpoint_mul(v73, v62.y); |
1033 v0->vVelocity.z += fixpoint_sub0(v73, v62.z); | 1033 v0->vVelocity.z += fixpoint_mul(v73, v62.z); |
1034 //v17 = 0; | 1034 //v17 = 0; |
1035 } | 1035 } |
1036 } | 1036 } |
1037 else | 1037 else |
1038 { | 1038 { |
1095 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) ) | 1095 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) ) |
1096 ++i; | 1096 ++i; |
1097 } | 1097 } |
1098 v71 = i > 1; | 1098 v71 = i > 1; |
1099 if ( stru_721530.field_7C < stru_721530.field_6C ) | 1099 if ( stru_721530.field_7C < stru_721530.field_6C ) |
1100 v70 = fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); | 1100 v70 = fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
1101 //v34 = 0; | 1101 //v34 = 0; |
1102 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 1102 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
1103 v36 = ODM_GetFloorLevel(stru_721530.normal2.x, | 1103 v36 = ODM_GetFloorLevel(stru_721530.normal2.x, |
1104 stru_721530.normal2.y, | 1104 stru_721530.normal2.y, |
1105 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, | 1105 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, |
1128 v0->vPosition.x = LOWORD(stru_721530.normal2.x); | 1128 v0->vPosition.x = LOWORD(stru_721530.normal2.x); |
1129 v0->vPosition.y = LOWORD(stru_721530.normal2.y); | 1129 v0->vPosition.y = LOWORD(stru_721530.normal2.y); |
1130 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; | 1130 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1; |
1131 break; | 1131 break; |
1132 } | 1132 } |
1133 //v72b = fixpoint_sub0(stru_721530.field_7C, stru_721530.field_58.x); | 1133 //v72b = fixpoint_mul(stru_721530.field_7C, stru_721530.field_58.x); |
1134 v0->vPosition.x += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); | 1134 v0->vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
1135 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; | 1135 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
1136 v0->vPosition.y += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); | 1136 v0->vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
1137 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; | 1137 //v72b = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
1138 v0->vPosition.z += fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); | 1138 v0->vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
1139 v38 = stru_721530.uFaceID; | 1139 v38 = stru_721530.uFaceID; |
1140 stru_721530.field_70 += stru_721530.field_7C; | 1140 stru_721530.field_70 += stru_721530.field_7C; |
1141 v39 = PID_ID(v38); | 1141 v39 = PID_ID(v38); |
1142 switch ( PID_TYPE(v38) ) | 1142 switch ( PID_TYPE(v38) ) |
1143 { | 1143 { |
1191 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); | 1191 v47 = integer_sqrt(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y); |
1192 v48 = stru_5C6E00->Atan2( | 1192 v48 = stru_5C6E00->Atan2( |
1193 v0->vPosition.x - pLevelDecorations[v39].vPosition.x, | 1193 v0->vPosition.x - pLevelDecorations[v39].vPosition.x, |
1194 v0->vPosition.y - pLevelDecorations[v39].vPosition.y); | 1194 v0->vPosition.y - pLevelDecorations[v39].vPosition.y); |
1195 v49 = v48; | 1195 v49 = v48; |
1196 v0->vVelocity.x = fixpoint_sub0(stru_5C6E00->Cos(v48), v47); | 1196 v0->vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v48), v47); |
1197 v0->vVelocity.y = fixpoint_sub0(stru_5C6E00->Sin(v48), v47); | 1197 v0->vVelocity.y = fixpoint_mul(stru_5C6E00->Sin(v48), v47); |
1198 break; | 1198 break; |
1199 case OBJECT_BModel: | 1199 case OBJECT_BModel: |
1200 v40 = &pOutdoor->pBModels[v38 >> 9]; | 1200 v40 = &pOutdoor->pBModels[v38 >> 9]; |
1201 v41 = &v40->pFaces[v39 & 0x3F]; | 1201 v41 = &v40->pFaces[v39 & 0x3F]; |
1202 if ( !(v41->uAttributes & 0x20000000) ) | 1202 if ( !(v41->uAttributes & 0x20000000) ) |
1219 v72b = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z | 1219 v72b = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z |
1220 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16; | 1220 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16; |
1221 if ( (stru_721530.speed >> 3) > v72b ) | 1221 if ( (stru_721530.speed >> 3) > v72b ) |
1222 v72b = stru_721530.speed >> 3; | 1222 v72b = stru_721530.speed >> 3; |
1223 | 1223 |
1224 v0->vVelocity.x += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.x); | 1224 v0->vVelocity.x += fixpoint_mul(v72b, v41->pFacePlane.vNormal.x); |
1225 v0->vVelocity.y += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.y); | 1225 v0->vVelocity.y += fixpoint_mul(v72b, v41->pFacePlane.vNormal.y); |
1226 v0->vVelocity.z += fixpoint_sub0(v72b, v41->pFacePlane.vNormal.z); | 1226 v0->vVelocity.z += fixpoint_mul(v72b, v41->pFacePlane.vNormal.z); |
1227 if ( v42 != 4 ) | 1227 if ( v42 != 4 ) |
1228 { | 1228 { |
1229 v45 = v0->vPosition.z; | 1229 v45 = v0->vPosition.z; |
1230 v46 = stru_721530.prolly_normal_d | 1230 v46 = stru_721530.prolly_normal_d |
1231 - ((v41->pFacePlane.dist | 1231 - ((v41->pFacePlane.dist |
1243 } | 1243 } |
1244 } | 1244 } |
1245 break; | 1245 break; |
1246 } | 1246 } |
1247 | 1247 |
1248 v0->vVelocity.x = fixpoint_sub0(58500, v0->vVelocity.x); | 1248 v0->vVelocity.x = fixpoint_mul(58500, v0->vVelocity.x); |
1249 v0->vVelocity.y = fixpoint_sub0(58500, v0->vVelocity.y); | 1249 v0->vVelocity.y = fixpoint_mul(58500, v0->vVelocity.y); |
1250 v0->vVelocity.z = fixpoint_sub0(58500, v0->vVelocity.z); | 1250 v0->vVelocity.z = fixpoint_mul(58500, v0->vVelocity.z); |
1251 | 1251 |
1252 ++v69; | 1252 ++v69; |
1253 if ( v69 >= 100 ) | 1253 if ( v69 >= 100 ) |
1254 break; | 1254 break; |
1255 v26 = stru_721530.prolly_normal_d; | 1255 v26 = stru_721530.prolly_normal_d; |
1694 else | 1694 else |
1695 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); | 1695 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82)); |
1696 break; | 1696 break; |
1697 | 1697 |
1698 case PARTY_StrafeLeft: | 1698 case PARTY_StrafeLeft: |
1699 v2 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); | 1699 v2 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); |
1700 v1 += fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); | 1700 v1 += fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); |
1701 v78 = 1; | 1701 v78 = 1; |
1702 break; | 1702 break; |
1703 case PARTY_StrafeRight: | 1703 case PARTY_StrafeRight: |
1704 v2 += fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); | 1704 v2 += fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fWalkSpeedMultiplier / 2); |
1705 v1 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); | 1705 v1 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fWalkSpeedMultiplier / 2); |
1706 v78 = 1; | 1706 v78 = 1; |
1707 break; | 1707 break; |
1708 case PARTY_WalkForward: | 1708 case PARTY_WalkForward: |
1709 v2 += fixpoint_sub0(stru_5C6E00->Cos(angle), 5 * v81 * fWalkSpeedMultiplier); | 1709 v2 += fixpoint_mul(stru_5C6E00->Cos(angle), 5 * v81 * fWalkSpeedMultiplier); |
1710 v1 += fixpoint_sub0(stru_5C6E00->Sin(angle), 5 * v81 * fWalkSpeedMultiplier); | 1710 v1 += fixpoint_mul(stru_5C6E00->Sin(angle), 5 * v81 * fWalkSpeedMultiplier); |
1711 v78 = 1; | 1711 v78 = 1; |
1712 break; | 1712 break; |
1713 case PARTY_WalkBackward: | 1713 case PARTY_WalkBackward: |
1714 v2 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); | 1714 v2 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); |
1715 v1 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); | 1715 v1 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); |
1716 v78 = 1; | 1716 v78 = 1; |
1717 break; | 1717 break; |
1718 case PARTY_RunForward: | 1718 case PARTY_RunForward: |
1719 v2 += fixpoint_sub0(stru_5C6E00->Cos(angle), 2 * v81 * fWalkSpeedMultiplier); | 1719 v2 += fixpoint_mul(stru_5C6E00->Cos(angle), 2 * v81 * fWalkSpeedMultiplier); |
1720 v1 += fixpoint_sub0(stru_5C6E00->Sin(angle), 2 * v81 * fWalkSpeedMultiplier); | 1720 v1 += fixpoint_mul(stru_5C6E00->Sin(angle), 2 * v81 * fWalkSpeedMultiplier); |
1721 v72 = 1; | 1721 v72 = 1; |
1722 break; | 1722 break; |
1723 case PARTY_RunBackward: | 1723 case PARTY_RunBackward: |
1724 //v32 = stru_5C6E00->SinCos(angle); | 1724 //v32 = stru_5C6E00->SinCos(angle); |
1725 //v33 = (double)v81; | 1725 //v33 = (double)v81; |
1726 //v88 = (double)v81; | 1726 //v88 = (double)v81; |
1727 v2 -= fixpoint_sub0(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); | 1727 v2 -= fixpoint_mul(stru_5C6E00->Cos(angle), v81 * fBackwardWalkSpeedMultiplier); |
1728 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); | 1728 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi); |
1729 v1 -= fixpoint_sub0(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); | 1729 v1 -= fixpoint_mul(stru_5C6E00->Sin(angle), v81 * fBackwardWalkSpeedMultiplier); |
1730 v72 = 1; | 1730 v72 = 1; |
1731 break; | 1731 break; |
1732 case PARTY_LookUp: | 1732 case PARTY_LookUp: |
1733 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); | 1733 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0); |
1734 if ( _view_angle > 128 ) | 1734 if ( _view_angle > 128 ) |
2691 _angle_y = stru_721530.normal2.y; | 2691 _angle_y = stru_721530.normal2.y; |
2692 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | 2692 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2693 } | 2693 } |
2694 else | 2694 else |
2695 { | 2695 { |
2696 _angle_x = pX + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.x); | 2696 _angle_x = pX + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
2697 _angle_y = pY + fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.y); | 2697 _angle_y = pY + fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
2698 pModel = (BSPModel *)fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z); | 2698 pModel = (BSPModel *)fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
2699 v40 = fixpoint_sub0(stru_721530.field_7C, stru_721530.direction.z) + pZ; | 2699 v40 = fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z) + pZ; |
2700 } | 2700 } |
2701 v122 = v40; | 2701 v122 = v40; |
2702 ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); | 2702 ODM_GetFloorLevel(_angle_x, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &bmodel_standing_on_pid, 0); |
2703 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); | 2703 v129 = ODM_GetFloorLevel(_angle_x, pY, v40, pParty->uPartyHeight, &is_on_water, &v97, 0); |
2704 auto v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); | 2704 auto v119 = ODM_GetFloorLevel(pX, _angle_y, v40, pParty->uPartyHeight, &is_on_water, &v110, 0); |
5446 if ( pShading < 0 ) | 5446 if ( pShading < 0 ) |
5447 pShading = pODMRenderParams->shading_dist_mist; | 5447 pShading = pODMRenderParams->shading_dist_mist; |
5448 | 5448 |
5449 v37 += ((unsigned __int64)(pSkyPolygon.ptr_38->field_10 * v13) >> 16); | 5449 v37 += ((unsigned __int64)(pSkyPolygon.ptr_38->field_10 * v13) >> 16); |
5450 screen_center_x += ((unsigned __int64)(pSkyPolygon.ptr_38->field_1C * v13) >> 16); | 5450 screen_center_x += ((unsigned __int64)(pSkyPolygon.ptr_38->field_1C * v13) >> 16); |
5451 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(v37, pShading) / 8; | 5451 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_mul(v37, pShading) / 8; |
5452 screen_center_x = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_sub0(screen_center_x, pShading) / 8; | 5452 screen_center_x = 224 * pMiscTimer->uTotalGameTimeElapsed + fixpoint_mul(screen_center_x, pShading) / 8; |
5453 | 5453 |
5454 //array_50AC10[i].vWorldViewPosition.x = pODMRenderParams->shading_dist_mist; | 5454 //array_50AC10[i].vWorldViewPosition.x = pODMRenderParams->shading_dist_mist; |
5455 //array_50AC10[i].vWorldPosition.x = v36 / (pSky.pTexture->uTextureHeight * 65536.0); | 5455 //array_50AC10[i].vWorldPosition.x = v36 / (pSky.pTexture->uTextureHeight * 65536.0); |
5456 //array_50AC10[i].vWorldPosition.y = 1.0 / (pODMRenderParams->shading_dist_mist >> 16); | 5456 //array_50AC10[i].vWorldPosition.y = 1.0 / (pODMRenderParams->shading_dist_mist >> 16); |
5457 //array_50AC10[i].vWorldPosition.z = v35 / (pSky.pTexture->uTextureWidth * 65536.0); | 5457 //array_50AC10[i].vWorldPosition.z = v35 / (pSky.pTexture->uTextureWidth * 65536.0); |
6065 v9 = y_x1z1; | 6065 v9 = y_x1z1; |
6066 v10 = y_x2z2; | 6066 v10 = y_x2z2; |
6067 v15 = grid_x2 - a1; | 6067 v15 = grid_x2 - a1; |
6068 v13 = grid_z1 - a2; | 6068 v13 = grid_z1 - a2; |
6069 } | 6069 } |
6070 return v14 + v8 + fixpoint_sub0(v13, (v10 - v8) * 128) + fixpoint_sub0(v15, (v9 - v8) * 128); | 6070 return v14 + v8 + fixpoint_mul(v13, (v10 - v8) * 128) + fixpoint_mul(v15, (v9 - v8) * 128); |
6071 } | 6071 } |
6072 else | 6072 else |
6073 return y_x1z1; | 6073 return y_x1z1; |
6074 } | 6074 } |
6075 | 6075 |
6153 //v26 = -pIndoorCamera->pos.z; | 6153 //v26 = -pIndoorCamera->pos.z; |
6154 v11 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.x + pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.y; | 6154 v11 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.x + pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.y; |
6155 v24 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.y - pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.x; | 6155 v24 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.y - pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.x; |
6156 if (pGame->pIndoorCameraD3D->sRotationX) | 6156 if (pGame->pIndoorCameraD3D->sRotationX) |
6157 { | 6157 { |
6158 this->field_0_party_dir_x = fixpoint_sub0(v11, pGame->pIndoorCameraD3D->int_cosine_x) + | 6158 this->field_0_party_dir_x = fixpoint_mul(v11, pGame->pIndoorCameraD3D->int_cosine_x) + |
6159 fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, pGame->pIndoorCameraD3D->int_sine_x); | 6159 fixpoint_mul((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, pGame->pIndoorCameraD3D->int_sine_x); |
6160 this->field_4_party_dir_y = v24; | 6160 this->field_4_party_dir_y = v24; |
6161 this->field_8_party_dir_z = fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, v25) - fixpoint_sub0(v11, v27); | 6161 this->field_8_party_dir_z = fixpoint_mul((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, v25) - fixpoint_mul(v11, v27); |
6162 } | 6162 } |
6163 else | 6163 else |
6164 { | 6164 { |
6165 this->field_0_party_dir_x = v11; | 6165 this->field_0_party_dir_x = v11; |
6166 this->field_4_party_dir_y = v24; | 6166 this->field_4_party_dir_y = v24; |
6167 this->field_8_party_dir_z = (-pGame->pIndoorCameraD3D->vPartyPos.z) << 16; | 6167 this->field_8_party_dir_z = (-pGame->pIndoorCameraD3D->vPartyPos.z) << 16; |
6168 } | 6168 } |
6169 | 6169 |
6170 if (pGame->pIndoorCameraD3D->sRotationX) | 6170 if (pGame->pIndoorCameraD3D->sRotationX) |
6171 { | 6171 { |
6172 v17 = fixpoint_sub0(a2, v9) + fixpoint_sub0(a3, v7); | 6172 v17 = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); |
6173 | 6173 |
6174 this->field_C = fixpoint_sub0(v17, v25) + fixpoint_sub0(a4, v27); | 6174 this->field_C = fixpoint_mul(v17, v25) + fixpoint_mul(a4, v27); |
6175 this->field_10 = fixpoint_sub0(a3, v9) - fixpoint_sub0(a2, v7); | 6175 this->field_10 = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); |
6176 this->field_14 = fixpoint_sub0(a4, v25) - fixpoint_sub0(v17, v27); | 6176 this->field_14 = fixpoint_mul(a4, v25) - fixpoint_mul(v17, v27); |
6177 } | 6177 } |
6178 else | 6178 else |
6179 { | 6179 { |
6180 this->field_C = fixpoint_sub0(a2, v9) + fixpoint_sub0(a3, v7); | 6180 this->field_C = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); |
6181 this->field_10 = fixpoint_sub0(a3, v9) - fixpoint_sub0(a2, v7); | 6181 this->field_10 = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); |
6182 this->field_14 = a4; | 6182 this->field_14 = a4; |
6183 } | 6183 } |
6184 | 6184 |
6185 if (pGame->pIndoorCameraD3D->sRotationX) | 6185 if (pGame->pIndoorCameraD3D->sRotationX) |
6186 { | 6186 { |
6187 v19 = fixpoint_sub0(a5, v9) + fixpoint_sub0(a6, v7); | 6187 v19 = fixpoint_mul(a5, v9) + fixpoint_mul(a6, v7); |
6188 | 6188 |
6189 this->field_18 = fixpoint_sub0(v19, v25) + fixpoint_sub0(a7, v27); | 6189 this->field_18 = fixpoint_mul(v19, v25) + fixpoint_mul(a7, v27); |
6190 this->field_1C = fixpoint_sub0(a6, v9) - fixpoint_sub0(a5, v7); | 6190 this->field_1C = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7); |
6191 this->field_20 = fixpoint_sub0(a7, v25) - fixpoint_sub0(v19, v27); | 6191 this->field_20 = fixpoint_mul(a7, v25) - fixpoint_mul(v19, v27); |
6192 } | 6192 } |
6193 else | 6193 else |
6194 { | 6194 { |
6195 this->field_18 = fixpoint_sub0(a5, v9) + fixpoint_sub0(a6, v7); | 6195 this->field_18 = fixpoint_mul(a5, v9) + fixpoint_mul(a6, v7); |
6196 this->field_1C = fixpoint_sub0(a6, v9) - fixpoint_sub0(a5, v7); | 6196 this->field_1C = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7); |
6197 this->field_20 = a7; | 6197 this->field_20 = a7; |
6198 } | 6198 } |
6199 | 6199 |
6200 this->field_18 = -this->field_18; | 6200 this->field_18 = -this->field_18; |
6201 this->field_1C = -this->field_1C; | 6201 this->field_1C = -this->field_1C; |